1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="07e63a90-d907-4c3f-86a5-f298e6a219d9",e._sentryDebugIdIdentifier="sentry-dbid-07e63a90-d907-4c3f-86a5-f298e6a219d9")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1798],{1364:e=>{e.exports={"gilroy-text":"datepicker_gilroy-text__l9E75",scope:"datepicker_scope__7AKdO"}},3811:(e,s,a)=>{"use strict";a.d(s,{A:()=>c});var l=a(37876),t=a(14232),n=a(48230),i=a.n(n),r=a(58587),d=a.n(r);let c=e=>{let{textData:s,blockingInfo:a,handleBlocking:n=null,isOpen:r=!1,pageType:c=null}=e,[o,_]=(0,t.useState)(!1),u=()=>{_(!1),n()};(0,t.useEffect)(()=>{_(r)},[r]);let m=(0,l.jsxs)("div",{className:"".concat(d().window," ").concat(d().debt),children:[(0,l.jsx)("p",{className:d().title,children:null==s?void 0:s.modal_title}),(0,l.jsx)("p",{className:d().text,dangerouslySetInnerHTML:{__html:null==s?void 0:s.modal_message_debt}}),(0,l.jsx)("div",{className:d().buttonsWrapper,children:(0,l.jsx)(i(),{legacyBehavior:!0,href:"/mz#overdue_orders",children:(0,l.jsx)("a",{className:d().button,onClick:u,type:"button",children:(null==s?void 0:s.modal_button_debt)||"OK"})})})]}),p=(0,l.jsxs)("div",{className:"".concat(d().window," ").concat(d().permanent),children:[(0,l.jsx)("a",{onClick:u,className:d().close}),(0,l.jsx)("p",{className:d().title,children:null==s?void 0:s.modal_title}),(0,l.jsx)("p",{className:d().text,dangerouslySetInnerHTML:{__html:null==s?void 0:s.modal_message_permanent}})]}),x=(0,l.jsxs)("div",{className:"".concat(d().window," ").concat(d().toManyOrders),children:[(0,l.jsx)("a",{onClick:u,className:d().close}),(0,l.jsx)("p",{className:d().title,children:null==s?void 0:s.modal_title}),(0,l.jsxs)("p",{className:d().text,children:[null==s?void 0:s.modal_text_1,(0,l.jsx)("strong",{children:" ".concat(a.count_orders_active," ").concat(null==s?void 0:s.modal_count_active_orders)})]}),(0,l.jsx)("p",{className:d().text,dangerouslySetInnerHTML:{__html:null==s?void 0:s.modal_text_2}})]});return(0,l.jsxs)("div",{style:o?{display:"block"}:{display:"none"},className:d().main,children:[a.blocking_data.blocked_by_debt&&m,a.blocking_data.blocked_by_auto&&!a.blocking_data.blocked_by_debt&&p,a.blocking_data.blocked_by_auto_permanent&&!a.blocking_data.blocked_by_debt&&p,a.blocking_data.blocked_by_admin&&!a.blocking_data.blocked_by_debt&&p,"order"===c&&a.has_too_many_active_orders&&!a.blocking_data.blocked_by_debt&&x,(0,l.jsx)("div",{className:d().backDrop})]})}},4609:(e,s,a)=>{"use strict";a.d(s,{L:()=>d});var l=a(27799),t=a(66421),n=a(65613),i=a(57829),r=a(43024);let d=e=>{switch(e){case"ua":return l.uk;case"ru":return t.ru;case"es":return n.es;case"pl":return i.pl;default:return r.c}}},7484:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>A});var l=a(37876),t=a(85310),n=a(75596),i=a(14232),r=a(75862),d=a(50223),c=a(89099),o=a(56856),_=a(34906),u=a.n(_),m=a(91695),p=a(89e3),x=a(12124),h=a(3811),j=a(639),b=a(67394),f=a(61389);class y{async getBillingData(e){let s={withCredentials:!0};(null==e?void 0:e.cookie)&&(s.headers=e);try{return(await b.SP.get(this.paths.getBillingData,s)).data}catch(e){return(0,f.r)(e)}}async saveBillingData(e,s,a){let l=new FormData;s.forEach(e=>{l.append("new_billing_documents[]",e)}),a.forEach(e=>{l.append("new_address_documents[]",e)}),l.append("billing_data",JSON.stringify(e));try{return(await b.SP.post(this.paths.saveBillingData,l,{headers:{"Content-Type":"multipart/form-data"},withCredentials:!0})).data}catch(e){return(0,f.r)(e)}}async getInvoice(e){try{return(await b.SP.get("".concat(this.paths.getInvoice,"?payment_id=").concat(e),{headers:{"Content-Type":"application/pdf"},withCredentials:!0})).data}catch(e){return(0,f.r)(e)}}constructor(e){this.api=e,this.paths={getBillingData:"".concat(this.api,"/billing_data/get"),saveBillingData:"".concat(this.api,"/billing_data/save"),getInvoice:"".concat(this.api,"/billing_data/get_invoice_file")}}}let v=new y("".concat(b.Vd,"/tutor"));var g=a(75597),N=a(4609),w=a(39091),k=a(83751),D=a(49420),E=a(1364),W=a.n(E),C=a(88389),q=a.n(C);let T=u().bind(q()),O=e=>{var s,a,t,n,c,_;let{errors:u,values:p,setFieldValue:x,setFieldError:h,isSubmitting:b,isValidating:f,textData:y,countries:v,legalStatuses:w,billingFiles:E,addressFiles:C,router:O,noNIP:S,setNoNIP:I,setIdentityFiles:K,setLocalityFiles:Y,taxNumberError:B,rules:F}=e,M=(0,D.D)().country,P=k.W[M].siteName,{full_name:L,legal_status:z,tax_number:A,address_1:R,adress_title:V,iso_country_code:U,iso_country_code_of_issue:H,region:Q,city:G,street:X,house:J,apt:Z,zip_code:$,date_of_birth:ee,nip:es,birth_place:ea,new_billing_documents:el,save_button:et,documents:en,pesel:ei,first_name:er,last_name:ed,legal_person_title:ec,legal_person_name:eo,legal_person_address:e_,vat_already_used_error:eu,tax_comment:em,add_document:ep}=y;(0,i.useEffect)(()=>{h("tax_number",A[B])},[B]),(0,o.E)("current",(0,N.L)(O.locale));let[ex,eh]=(0,i.useState)(!1),[ej,eb]=(0,i.useState)(!1);(0,i.useEffect)(()=>
1{if(b&&!f){let e=Object.keys(u);e.length>0&&window.scrollTo(0,(0,g.kt)(e[0]))}},[u,b,f]),(0,i.useEffect)(()=>{p.iso_country_code===M||p.tax_number||E.length||p.new_billing_documents.length?eh(!1):eh(!0)},[p,E,C]),(0,i.useEffect)(()=>{p.iso_country_code===M||p.tax_number||(null==C?void 0:C.length)||p.new_address_documents.length?eb(!1):eb(!0)},[p,E,C]);let ef=async e=>{x("new_billing_documents",[...p.new_billing_documents,...e.currentTarget.files])},ey=async e=>{x("new_address_documents",[...p.new_address_documents,...e.currentTarget.files])},ev=(e,s)=>{x(s,p[s].filter(s=>{let{name:a}=s;return a!==e.name}))};return(0,l.jsxs)(d.lV,{className:q().formBody,children:[(0,l.jsxs)("div",{className:q().formWrapper,children:[(0,l.jsxs)("div",{className:q().row,children:["pl"===M&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[er.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"first_name",placeholder:er.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"first_name",children:(0,l.jsx)(d.Kw,{component:"p",name:"first_name"})})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[ed.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"last_name",placeholder:ed.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"last_name",children:(0,l.jsx)(d.Kw,{component:"p",name:"last_name"})})]})]}),"es"===M&&(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[L.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"full_name",placeholder:L.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"full_name",children:(0,l.jsx)(d.Kw,{component:"p",name:"full_name"})})]})]}),(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:"".concat(T({fieldWrapper:!0,datePicker:!0})," ").concat(W().scope),children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[ee.header,":"]}),(0,l.jsx)(o.Ay,{selected:p.date_of_birth?new Date(p.date_of_birth):"",placeholderText:ee.placeholder,onChange:e=>{e?x("date_of_birth",(0,m.GP)(new Date(e),"yyyy-MM-dd")):x("date_of_birth","")},maxDate:new Date,dateFormat:"dd/MM/yyyy",locale:"current"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"date_of_birth",children:(0,l.jsx)(d.Kw,{component:"p",name:"date_of_birth"})})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[z.placeholder,":"]}),(0,l.jsx)(r.Ay,{value:p.legal_status?{value:p.legal_status,label:z[p.legal_status]}:null,className:"select",classNamePrefix:"customSelect",placeholder:z.placeholder,options:Object.keys(w).map(e=>({value:e,label:z[e]})),instanceId:"legal_status",onChange:e=>{let{value:s}=e;return x("legal_status",Number(s))}}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"legal_status",children:(0,l.jsx)(d.Kw,{component:"p",name:"legal_status"})})]})]}),(0,l.jsxs)("div",{className:q().row,children:["pl"===M?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[ei.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"pesel",placeholder:ei.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"pesel",children:(0,l.jsx)(d.Kw,{component:"p",name:"pesel"})})]}),(0,l.jsx)("div",{className:T(q().fieldWrapper,q().checkboxWrapper),children:(0,l.jsxs)("label",{children:[(0,l.jsx)(d.D0,{type:"checkbox",name:"no_pesel",checked:!!p.no_pesel,onChange:()=>x("no_pesel",!p.no_pesel)}),(0,l.jsx)("span",{children:ei.no_pesel})]})}),!!p.no_pesel&&(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsx)(d.D0,{name:"birth_place",placeholder:ea.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"birth_place",children:(0,l.jsx)(d.Kw,{component:"p",name:"birth_place"})})]})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[es.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"nip",placeholder:es.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"nip",children:(0,l.jsx)(d.Kw,{component:"p",name:"nip"})})]})]}):null,"es"===M?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[es.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"nip",placeholder:es.placeholder,type:"text",disabled:S}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"nip",children:(0,l.jsx)(d.Kw,{component:"p",name:"nip"})})]}),(0,l.jsx)("div",{className:T(q().fieldWrapper,q().checkboxWrapper),children:(0,l.jsxs)("label",{children:[(0,l.jsx)(d.D0,{type:"checkbox",value:S,checked:S,onChange:()=>I(!S)}),(0,l.jsx)("span",{children:es.no_nip})]})}),S&&(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsx)(d.D0,{name:"birth_place",placeholder:ea.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"birth_place",children:(0,l.jsx)(d.Kw,{component:"p",name:"birth_place"})})]})]}),(0,l.jsx)("div",{className:q().fieldWrapper})]}):null]}),(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:T({fieldWrapper:!0,halfWidth:2===p.legal_status}),children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[H.placeholder,":"]}),(0,l.jsx)(r.Ay,{defaultValue:p.iso_country_code_of_issue&&{value:p.iso_country_code_of_issue,label:null==(s=v.find(e=>{let{alpha:s}=e;return s===p.iso_country_code_of_issue}))?void 0:s.name},value:p.iso_country_code_of_issue&&{value:p.iso_country_code_of_issue,label:null==(a=v.find(e=>{let{alpha:s}=e;return s===p.iso_country_code_of_issue}))?void 0:a.name},className:"select",classNamePrefix:"customSelect",options:v.map(e=>{let{name:s,alpha:a}=e;return{value:a,label:s}}),placeholder:H.placeholder,instanceId:"iso_country_code_of_issue",onChange:e=>{let{value:s}=e;return x("iso_country_code_of_issue",s)}}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"iso_country_code_of_issue",children:(0,l.jsx)(d.Kw,{component:"p",name:"iso_country_code_of_issue"})})]}),2!==p.legal_status&&(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[A.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"tax_number",placeholder:A.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"tax_number",children:(0,l.jsx)(d.Kw,{component:"p",name:"tax_number"})})]})]}),2===p.legal_status&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:T({text:!0,header:!0,bold:!0}),children:ec}),(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsx)("p",{className:T({text:!0,header:!0}),children:eo}),(0,l.jsx)(d.D0,{name:"full_name",placeholder:e_,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"full_name",children:(0,l.jsx)(d.Kw,{component:"p",name:"full_name"})})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsx)("p",{className:T({text:!0,header:!0}),children:e_}),(0,l.jsx)(d.D0,{name:"billing_address_registration",placeholder:e_,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"billing_address_registration",children:(0,l.jsx)(d.Kw,{component:"p",name:"billing_address_registration"})})]})]}),(0,l.jsx)("div",{className:q().row,children:(0,l.jsxs)("div",{className:T({fieldWrapper:!0,halfWidth:!0}),children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[A.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"tax_number",placeholder:A.placeholder,type:"text"}),"tax_number_already_exist"!==B&&(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"tax_number",children:(0,l.jsx)(d.Kw,{component:"p",name:"tax_number"})})]})}),B&&2===p.legal_status&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:q().vatError,children:[(0,l.jsx)("img",{src:"/img/svg/warning_icon.svg",alt:"icon"}),(0,l.jsx)("p",{children:eu})]}),(0,l.jsxs)("div",{className:q().textareaWrapper,children:[(0,l.jsx)(j.Ww,{name:"tax_number_exist_comment",textData:em,errors:u,rules:F.tax_number_exist_comment,setFieldValue:x}),(0,l.jsx)("div",{className:q().fieldError,children:(0,l.jsx)("p",{children:u.tax_number_exist_comment&&em.length})})]}),(0,l.jsx)("div",{className:q().addContainer,children:(0,l.jsxs)("label",{className:q().upload,children:[(0,l.jsx)("input",{type:"file",onChange:ef,id:"new_billing_documents",name:"new_billing_documents"}),ep]})}),!!(null==p?void 0:p.new_billing_documents)&&p.new_billing_documents.map((e,s)=>(0,l.jsxs)("div",{className:q().fileLink,children:[(0,l.jsx)("span",{className:q().icon}),(0,l.jsx)("span",{children:null==e?void 0:e.name}),(0,l.jsx)("span",{className:q().file,onClick:()=>ev(e,"new_billing_documents")}),e.size>1e7&&u.new_billing_documents&&(0,l.jsx)("span",{className:q().fieldError,children:u.new_billing_documents})]},"file-".concat(s)))]})]}),(0,l.jsx)("p",{className:T({text:!0,header:!0,bold:!0}),children:V}),(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[U.placeholder,":"]}),(0,l.jsx)(r.Ay,{defaultValue:p.iso_country_code&&{value:p.iso_country_code_temp||p.iso_country_code,label:null==(t=v.find(e=>{let{alpha:s}=e;return s===p.iso_country_code_temp||s===p.iso_country_code}))?void 0:t.name},value:p.iso_country_code&&{value:p.iso_country_code,label:null==(n=v.find(e=>{let{alpha:s}=e;return s===p.iso_country_code}))?void 0:n.name},className:"select",classNamePrefix:"customSelect",options:v.map(e=>{let{name:s,alpha:a}=e;return{value:a,label:s}}),placeholder:U.placeholder,instanceId:"iso_country_code",onChange:e=>{let{value:s}=e;x("iso_country_code",s),x("new_address_documents",[]),x("new_billing_documents",[]),x("billing_proof_type",""),x("address_proof_type",""),x("date_document_issued",""),K([]),Y([])}}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"iso_country_code",children:(0,l.jsx)(d.Kw,{component:"p",name:"iso_country_code"})})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[$.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"zip_code",placeholder:$.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"zip_code",children:(0,l.jsx)(d.Kw,{component:"p",name:"zip_code"})})]})]}),(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[Q.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"region",placeholder:Q.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"region",children:(0,l.jsx)(d.Kw,{component:"p",name:"region"})})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[G.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"city",placeholder:G.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"city",children:(0,l.jsx)(d.Kw,{component:"p",name:"city"})})]})]}),"pl"===M?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[X.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"street",placeholder:X.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"street",children:(0,l.jsx)(d.Kw,{component:"p",name:"street"})})]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[J.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"house",placeholder:J.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"house",children:(0,l.jsx)(d.Kw,{component:"p",name:"house"})})]})]}),(0,l.jsxs)("div",{className:q().row,children:[(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[Z.placeholder,":"]}),(0,l.jsx)(d.D0,{name:"apt",placeholder:Z.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"apt",children:(0,l.jsx)(d.Kw,{component:"p",name:"apt"})})]}),(0,l.jsx)("div",{className:q().fieldWrapper})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{className:T({text:!0,header:!0}),children:[R.placeholder,":"]}),(0,l.jsxs)("div",{className:q().fieldWrapper,children:[(0,l.jsx)(d.D0,{name:"address_1",placeholder:R.placeholder,type:"text"}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"address_1",children:(0,l.jsx)(d.Kw,{component:"p",name:"address_1"})})]})]}),p.iso_country_code!==M&&""!==p.iso_country_code&&!p.tax_number&&(0,l.jsxs)("div",{className:q().documents,children:[(0,l.jsx)("p",{className:T({text:!0,header:!0,bold:!0}),children:en.identity_title}),en.identity_info.map((e,s)=>(0,l.jsx)("p",{className:T({text:!0}),children:e},s)),(0,l.jsx)("p",{className:T({text:!0,header:!0,bold:!0}),children:en.upload_title}),(0,l.jsx)("p",{className:T({text:!0,bold:!0}),children:en.identity_proof}),(0,l.jsx)("p",{className:T({text:!0}),children:en.identity_proof_hint}),Object.entries(en.billing_proof_type).map(e=>{let[s,a]=e;return(0,l.jsx)("div",{className:T(q().fieldWrapper,q().checkboxWrapper),children:(0,l.jsxs)("label",{children:[(0,l.jsx)(d.D0,{type:"radio",value:s,name:"billing_proof_type",checked:p.billing_proof_type==s}),(0,l.jsx)("span",{children:a})]})},s)}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"billing_proof_type",children:(0,l.jsx)(d.Kw,{component:"p",name:"billing_proof_type"})}),(null==p||null==(c=p.new_billing_documents)?void 0:c.length)<1&&!E.length&&(0,l.jsxs)("label",{className:q().upload,children:[en.identity_upload_btn,(0,l.jsx)("input",{id:"new_billing_documents",name:"new_billing_documents",type:"file",onChange:ef})]}),!!(null==p?void 0:p.new_billing_documents)&&p.new_billing_documents.map((e,s)=>(0,l.jsxs)("div",{className:q().fileLink,children:[(0,l.jsx)("span",{className:q().icon}),(0,l.jsx)("span",{children:null==e?void 0:e.name}),(0,l.jsx)("span",{className:q().file,onClick:()=>ev(e,"new_billing_documents")}),e.size>1e7&&u.new_billing_documents&&(0,l.jsx)("span",{className:q().fieldError,children:u.new_billing_documents})]},"file-".concat(s))),!!E.length&&(0,l.jsx)("div",{className:T({fieldWrapper:!0}),children:E.map(e=>{let{id:s,original_name:a,url:t}=e;return(0,l.jsxs)("div",{className:q().fileLink,children:[(0,l.jsx)("img",{src:t,alt:a}),(0,l.jsx)("a",{target:"_blank",href:t,rel:"noreferrer",children:a}),(0,l.jsx)("span",{className:q().file,onClick:()=>{K([]),x("billing_proof_type","")}})]},s)})}),(0,l.jsxs)("div",{className:q().fieldError,children:[(0,l.jsx)("p",{children:u.new_billing_documents}),ex&&(0,l.jsx)("p",{children:el.min})]}),(0,l.jsx)("p",{className:T({text:!0,bold:!0}),children:en.address_proof}),(0,l.jsx)("p",{className:T({text:!0}),children:en.address_proof_hint}),Object.entries(en.address_proof_type).map(e=>{let[s,a]=e;return(0,l.jsx)("div",{className:T(q().fieldWrapper,q().checkboxWrapper),children:(0,l.jsxs)("label",{children:[(0,l.jsx)(d.D0,{type:"radio",value:s,name:"address_proof_type",checked:p.address_proof_type==s}),(0,l.jsx)("span",{children:a})]})},s)}),(0,l.jsx)("div",{className:q().fieldError,"data-invalid":"address_proof_type",children:(0,l.jsx)(d.Kw,{component:"p",name:"address_proof_type"})}),(null==p||null==(_=p.new_address_documents)?void 0:_.length)<1&&!C.length&&(0,l.jsxs)("label",{className:q().upload,children:[en.identity_upload_btn,(0,l.jsx)("input",{id:"new_address_documents",name:"new_address_documents",type:"file",onChange:e
1y})]}),!!(null==p?void 0:p.new_address_documents)&&p.new_address_documents.map((e,s)=>(0,l.jsxs)("div",{className:q().fileLink,children:[(0,l.jsx)("span",{className:q().icon}),(0,l.jsx)("span",{children:null==e?void 0:e.name}),(0,l.jsx)("span",{className:q().file,onClick:()=>ev(e,"new_address_documents")}),e.size>1e7&&u.new_address_documents&&(0,l.jsx)("span",{className:q().fieldError,children:u.new_address_documents})]},"file-".concat(s))),!!C.length&&(0,l.jsx)("div",{className:T({fieldWrapper:!0}),children:C.map(e=>{let{id:s,original_name:a,url:t}=e;return(0,l.jsxs)("div",{className:q().fileLink,children:[(0,l.jsx)("img",{src:t,alt:a}),(0,l.jsx)("a",{target:"_blank",href:t,rel:"noreferrer",children:a}),(0,l.jsx)("span",{className:q().file,onClick:()=>{Y([]),x("address_proof_type","")}})]},s)})}),(0,l.jsxs)("div",{className:q().fieldError,children:[(0,l.jsx)("p",{children:u.new_billing_documents}),ej&&(0,l.jsx)("p",{children:el.min})]}),(0,l.jsx)("p",{className:T({text:!0}),children:en.make_sure}),["11","12","13","15"].includes(p.address_proof_type.toString())&&(0,l.jsx)("div",{className:T(q().fieldWrapper,q().checkboxWrapper),children:(0,l.jsxs)("label",{children:[(0,l.jsx)(d.D0,{type:"checkbox",name:"document_issued_success",checked:p.document_issued_success,onChange:()=>{x("address_date_document_issued",p.address_date_document_issued?0:Date.now()+7776e6),x("document_issued_success",!p.document_issued_success)}}),(0,l.jsx)("span",{children:en.date_issued.replace("[:date]",(0,m.GP)(p.date_document_issued?p.address_date_document_issued:Date.now()+7776e6,"dd-MM-yyyy"))})]})}),(0,l.jsxs)("div",{className:q().docRequirements,children:[(0,l.jsx)("p",{className:q().title,children:en.docs_requirements}),(0,l.jsx)("p",{children:en.docs_info.replace(/\[:SITE]/g,P)})]})]})]}),(0,l.jsx)("div",{className:q().buttonWrapper,children:(0,l.jsx)("button",{disabled:ej||ex||b,className:q().button,type:"submit",children:et})})]})},S=e=>{var s;let{billingData:a,billingFiles:t,addressFiles:n,tutor:r,rules:o,countries:_,textData:u,legalStatuses:m,auth:j}=e,b=(0,D.D)().country,f=((e,s,a)=>{let{full_name:l,first_name:t,last_name:n,tax_number:i,address_1:r,address_2:d,iso_country_code:c,iso_country_code_of_issue:o,region:_,city:u,zip_code:m,date_of_birth:p,nip:x,birth_place:h,pesel:j,legal_status:b,new_billing_documents:f,tax_comment:y}=e;return w.Ik().shape({full_name:w.Yj().when([],{is:()=>"es"===a,then:w.Yj().min(s.full_name.min,l.min).max(s.full_name.max,l.max).required(l.required)}),first_name:w.Yj().when([],{is:()=>"pl"===a,then:w.Yj().min(s.full_name.min,t.min).max(s.full_name.max,t.max).required(t.required)}),last_name:w.Yj().when([],{is:()=>"pl"===a,then:w.Yj().min(s.full_name.min,n.min).max(s.full_name.max,n.max).required(n.required)}),legal_status:w.ai().oneOf([1,2,3],b.required).required(b.required),tax_number:w.Yj().when("new_billing_documents",{is:1,then:w.Yj().min(s.tax_number.min,i.min).max(s.tax_number.max,i.max).required(i.required)}),address_1:w.Yj().when([],{is:()=>"es"===a,then:w.Yj().min(s.address_1.min,r.min).max(s.address_1.max,r.max).required(r.required)}),iso_country_code:w.Yj().max(5,c.max).required(c.required),iso_country_code_of_issue:w.Yj().max(5,o.max).required(o.required),region:w.Yj().min(s.region.min,_.min).max(s.region.max,_.max).required(_.required),city:w.Yj().min(s.city.min,u.min).max(s.city.max,u.max).required(u.required),street:w.Yj().when([],{is:()=>"pl"===a,then:w.Yj().min(s.city.min,u.min).max(s.city.max,u.max).required(u.required)}),house:w.Yj().when([],{is:()=>"pl"===a,then:w.Yj().min(1,u.min).max(s.city.max,u.max).required(u.required)}),apt:w.Yj(),zip_code:w.Yj().min(s.zip_code.min,m.min).max(s.zip_code.max,m.max).required(m.required),date_of_birth:w.Yj().min(1,p.required).required(p.required),nip:w.Yj().min(s.nip.min,x.min).max(s.nip.max,x.max).when(["birth_place"],{is:e=>!e&&"es"===a,then:w.Yj().min(s.nip.min,x.min).max(s.nip.max,x.max).required(x.required)}),birth_place:w.Yj().min(s.birth_place.min,h.min).max(s.birth_place.max,h.max).when(["nip","no_pesel"],{is:(e,s)=>!e&&"es"===a||"pl"===a&&!!s,then:w.Yj().min(s.birth_place.min,h.min).max(s.birth_place.max,h.max).required(h.required)}),pesel:w.Yj().min(11,j.min).max(11,j.max).when(["no_pesel"],{is:e=>"pl"===a&&!e,then:w.Yj().min(11,j.min).max(11,j.max).required(h.required)}),new_billing_documents:w.YO().max(1,f.max).of(w.gl().test("size",f.warning,e=>e.size<=1e7)),billing_proof_type:w.gl().when(["iso_country_code","tax_number"],(e,s,l)=>s||e===a||""===e?l.nullable():l.required("Please select a valid option").oneOf([1,2,3,4,5,"1","2","3","4","5"],"Please select a valid option")),new_address_documents:w.YO().max(1,f.max).of(w.gl().test("size",f.warning,e=>e.size<=1e7)),address_proof_type:w.gl().when(["iso_country_code","tax_number"],(e,s,l)=>s||e===a||""===e?l.nullable():l.required("Please select a valid option").oneOf([10,11,12,13,14,15,16,"10","11","12","13","14","15","16"],"Please select a valid option")),tax_number_exist_comment:w.Yj().min(s.tax_number_exist_comment.min,y.length).max(s.tax_number_exist_comment.max,y.length)},[["nip","birth_place"]])})(u,o,b),y=(0,c.useRouter)(),[g,N]=(0,i.useState)(t),[k,E]=(0,i.useState)(n),[W,C]=(0,i.useState)(a.status),[T,S]=(0,i.useState)({...a,new_billing_documents:[],new_address_documents:[],document_issued_success:!!(null==k||null==(s=k[0])?void 0:s.date_document_issued),address_date_document_issued:0}),[I,K]=(0,i.useState)(!1),[Y,B]=(0,i.useState)(!1),[F,M]=(0,i.useState)(null),[P,L]=(0,i.useState)(!1),[z,A]=(0,i.useState)(!!T.birth_place);(0,i.useEffect)(()=>{var e;S({...a,new_billing_documents:[],new_address_documents:[],document_issued_success:!!(null==k||null==(e=k[0])?void 0:e.date_document_issued)}),C(a.status)},[y.locale]);let[R,V]=(0,i.useState)(null),U=async e=>{if(K(!0),j.tutor_info.blocking_data.blocked_by_debt||j.tutor_info.blocking_data.blocked_by_auto||j.tutor_info.blocking_data.blocked_by_auto_permanent||j.tutor_info.blocking_data.blocked_by_admin){L(!0),K(!1);return}"es"===b&&(z?e.nip="":e.birth_place="");let s=await v.saveBillingData(e,e.new_billing_documents,e.new_address_documents);if("success"===s.status)S({...s.data.billing_data,new_billing_documents:[],new_address_documents:[]}),C(s.data.billing_data.status),N(s.data.billing_files),E(s.data.address_files),B(!0),1===s.data.billing_data.status?M({status:"success",textTitle:u.modal.success_title,textBody:u.modal.moderation_text}):2===s.data.billing_data.status?M({status:"success",textTitle:u.modal.success_title,textBody:u.modal.success_text}):3===s.data.billing_data.status?M({status:"cancel",textTitle:u.modal.fail_title,textBody:u.modal.incorrect_tax_number}):M({status:"success",textTitle:u.modal.success_title,textBody:u.modal.success_text});else{var a,l,t,n,i,r,d;(null==s?void 0:s.error)&&(null==s||null==(a=s.error)?void 0:a.tax_number)?(null==s||null==(l=s.error)?void 0:l.tax_number)==="tax_number_already_exist"?V(null==s||null==(t=s.error)?void 0:t.tax_number):(V(null),B(!0),M({status:"cancel",textTitle:u.modal.fail_title,textBody:(null==(r=u.modal)||null==(i=r.tax_number)?void 0:i[null==(n=s.error)?void 0:n.tax_number])||u.modal.other_errors})):(B(!0),M({status:"cancel",textTitle:u.modal.fail_title,textBody:(null==(d=u.modal)?void 0:d[s.error])||u.modal.other_errors}))}K(!1)};return(0,l.jsxs)("div",{className:q().form,children:[3===T.status&&T.iso_country_code!==b&&(0,l.jsxs)("div",{className:q().rejectReason,children:[(0,l.jsx)("p",{className:q().reject,children:e.textData.reject_text}),(0,l.jsx)("p",{children:e.textData.update_docs}),(0,l.jsx)("p",{children:"".concat(e.textData.reject_reason).concat(T.reject_comment)})]}),(0,l.jsxs)("p",{className:q().status,children:[(0,l.jsx)("span",{children:u.billing_data_statuses.header}),(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:"".concat(u.billing_data_statuses.statuses[W||0].replace("[:vat_rate]",r.vat_rate))}})]}),(0,l.jsx)(d.l1,{initialValues:T,validationSchema:f,onSubmit:U,enableReinitialize:!0,component:s=>(0,l.jsx)(O,{...e,...s,schema:f,billingData:a,status:W,countries:_,legalStatuses:m,billingFiles:g,addressFiles:k,router:y,noNIP:z,setNoNIP:A,setIdentityFiles:N,setLocalityFiles:E,taxNumberError:R,rules:o})}),I&&(0,l.jsx)(p.A,{}),(0,l.jsx)(x.A,{...F,handleCloseModal:()=>B(!1),isOpen:Y}),P&&(0,l.jsx)(h.A,{textData:u.modal_bloking,blockingInfo:j.tutor_info,handleBlocking:()=>{L(!1)},isOpen:P})]})};var I=a(58077),K=a(25377),Y=a(51714),B=a(46294),F=a(57051),M=a(12352),P=a(43042),L=a.n(P);let z=e=>e.authError?(0,l.jsx)(n.A,{textData:e.loginData}):(0,l.jsx)(t.A,{auth:e.auth,dataBanners:e.dataBanners,textData:e.dataHeader,tutor:e.auth.tutor_info,title:e.textData.page_title,children:(0,l.jsx)("div",{className:L().profileWrapper,children:(0,l.jsx)(S,{...e})})});z.getInitialProps=async e=>{var s,l,t,n,i,r,d,c;let{ctx:o}=e,_=(await (0,F.z)(o)).country,u=(0,Y.O)(o),m=(0,B.U)(o.locale,_),p=await a(73742)("./".concat(m,"TutorBillingText.json")),x=await a(13123)("./".concat(m,"Header.json")),h=await a(37053)("./".concat(m,"Footer.json")),j=await a(11869)("./".concat(m,"TutorBanners.json")),b=await a(54261)("./".concat(m,"ClientLoginText.json")),[f,y,g]=await Promise.all([v.getBillingData(u),I.I.getFooter(m),K._.getNotifications(u)]),{hasErrors:N,statusCode:w}
1=(0,M.W)({billingData:f});return N?(o.res&&(o.res.statusCode=w),{statusCode:w,textData:p,dataHeader:x,dataFooter:h}):((null===k.W||void 0===k.W?void 0:k.W[_].billing_data)||(o.res.writeHead(301,{Location:"/404"}),o.res.end()),f.error&&"unauthorized tutor"===f.error)?{authError:!0,footer:(null==y?void 0:y.data)||{},loginData:b,dataHeader:x,dataFooter:h,pageType:"tutor_cabinet"}:{billingData:(null==f||null==(s=f.data)?void 0:s.billing_data)||{},billingFiles:(null==f||null==(l=f.data)?void 0:l.billing_files)||[],addressFiles:(null==f||null==(t=f.data)?void 0:t.address_files)||[],tutor:(null==f||null==(n=f.data)?void 0:n.tutor)||{},rules:(null==f||null==(i=f.data)?void 0:i.rules)||{},countries:(null==f||null==(r=f.data)?void 0:r.iso_country_codes)||[],footer:(null==y?void 0:y.data)||{},notifications:(null==g||null==(d=g.data)?void 0:d.notifications)||{},auth:null==g?void 0:g.auth,legalStatuses:(null==f||null==(c=f.data)?void 0:c.legal_statuses)||{},textData:p,dataHeader:x,dataFooter:h,dataBanners:j,pageType:"tutor_cabinet"}};let A=z},8106:(e,s,a)=>{"use strict";a.d(s,{v:()=>i});var l=a(14232);let t=e=>{let s,a=new Set,l=(e,l)=>{let t="function"==typeof e?e(s):e;if(!Object.is(t,s)){let e=s;s=(null!=l?l:"object"!=typeof t||null===t)?t:Object.assign({},s,t),a.forEach(a=>a(s,e))}},t=()=>s,n={setState:l,getState:t,getInitialState:()=>i,subscribe:e=>(a.add(e),()=>a.delete(e))},i=s=e(l,t,n);return n},n=e=>{let s=(e=>e?t(e):t)(e),a=e=>(function(e,s=e=>e){let a=l.useSyncExternalStore(e.subscribe,l.useCallback(()=>s(e.getState()),[e,s]),l.useCallback(()=>s(e.getInitialState()),[e,s]));return l.useDebugValue(a),a})(s,e);return Object.assign(a,s),a},i=e=>e?n(e):n},12124:(e,s,a)=>{"use strict";a.d(s,{A:()=>_});var l=a(37876),t=a(89099),n=a(34906),i=a.n(n),r=a(49420),d=a(21152),c=a.n(d);let o=i().bind(c()),_=e=>{let{isOpen:s=!0,isNotification:a=!0,setNotification:n=null,handleCloseModal:i,status:d="success",handleConfirmationModal:_=null,redirectLink:u=null,textTitle:m=null,textBody:p=null,successButton:x,cancelButton:h}=e,j=(0,r.D)().siteEmail,b=(0,t.useRouter)(),f=()=>{i(),n&&n(!1),u&&b.push(u)},y='<a href="mailto:'.concat(j,'">').concat(j,"</a>");return s&&(0,l.jsxs)("div",{className:c().main,children:[(0,l.jsxs)("div",{className:c().window,children:[(0,l.jsx)("span",{onClick:f,className:c().close}),a?(0,l.jsxs)(l.Fragment,{children:[m&&(0,l.jsx)("p",{className:c().title,children:m}),(0,l.jsx)("p",{className:o({text:!0,[d]:!0}),dangerouslySetInnerHTML:{__html:p.replace("[:EMAIL]",y)}}),(0,l.jsx)("button",{onClick:f,type:"button",children:x||"OK"})]}):(0,l.jsxs)(l.Fragment,{children:[m&&(0,l.jsx)("p",{className:c().title,children:m}),(0,l.jsx)("div",{className:o({text:!0,[d]:!0}),dangerouslySetInnerHTML:{__html:p}}),(0,l.jsxs)("div",{className:c().buttonsWrapper,children:[(0,l.jsx)("button",{className:c().success,onClick:_,type:"button",children:x||"OK"}),(0,l.jsx)("button",{className:c().cancel,onClick:f,type:"button",children:h||"Cancel"})]})]})]}),(0,l.jsx)("div",{onClick:f,className:c().backDrop})]})}},12352:(e,s,a)=>{"use strict";a.d(s,{W:()=>t});let l=e=>!!e&&"object"==typeof e&&(null==e?void 0:e.status)==="fail"&&"statusCode"in e,t=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};arguments.length>2&&arguments[2];let a=s.defaults||{},t={},n={};for(let[s,i]of Object.entries(e))l(i)?(t[s]=i,n[s]=Object.prototype.hasOwnProperty.call(a,s)?a[s]:{}):n[s]=null!=i?i:Object.prototype.hasOwnProperty.call(a,s)?a[s]:i;return Object.keys(t).length>0?{...(e=>{let s=Object.values(e).map(e=>{if(e&&e.statusCode)return e.statusCode});if(s.includes(404))return{statusCode:404,notFound:!0};if(s.includes(429))return{statusCode:429};if(s.includes(403))return{statusCode:403};if(s.includes(410))return{statusCode:410};if(s.includes(0))return{statusCode:0};else return{statusCode:500}})(t),hasErrors:!0}:{data:n,hasErrors:!1,statusCode:200}}},21152:e=>{e.exports={"gilroy-text":"styles_gilroy-text__92K2v",main:"styles_main__3UGDK",backDrop:"styles_backDrop__MyJ8a",window:"styles_window__XfZnu",title:"styles_title__oeOVI",text:"styles_text__QliG9",success:"styles_success__Cf705",fail:"styles_fail__koDlK",buttonsWrapper:"styles_buttonsWrapper__ziQiQ",cancel:"styles_cancel__hVLrs",icon:"styles_icon__lb8U4",close:"styles_close__v25qH"}},40323:e=>{function s(e){var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}s.keys=()=>[],s.resolve=s,s.id=40323,e.exports=s},57051:(e,s,a)=>{"use strict";a.d(s,{z:()=>t});var l=a(68173);let t=async e=>e.req?(0,l.RW)():await (0,l.$U)()},58587:e=>{e.exports={"gilroy-text":"styles_gilroy-text__RlIpR",main:"styles_main__I24Je",backDrop:"styles_backDrop__hqOr_",window:"styles_window__i8298",debt:"styles_debt___kiQp",title:"styles_title__eD2uA",text:"styles_text__p4T5Y",permanent:"styles_permanent__0gsy_",toManyOrders:"styles_toManyOrders__xa3k0",close:"styles_close__D2QBU",success:"styles_success__I9A8C",fail:"styles_fail__RvsOv",button:"styles_button__0g9Mo",buttonsWrapper:"styles_buttonsWrapper__H0_eF",cancel:"styles_cancel__mXwf1",icon:"styles_icon__dK_2T"}},64512:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/billing_information",function(){return a(7484)}])},73742:(e,s,a)=>{var l={"./enTutorBillingText.json":[7079,7079],"./esTutorBillingText.json":[74008,4008],"./plTutorBillingText.json":[96360,6360],"./ruTutorBillingText.json":[88497,8497],"./uaTutorBillingText.json":[10094,94]};function t(e){if(!a.o(l,e))return Promise.resolve().then(()=>{var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s});var s=l[e],t=s[0];return a.e(s[1]).then(()=>a.t(t,19))}t.keys=()=>Object.keys(l),t.id=73742,e.exports=t},88389:e=>{e.exports={"gilroy-text":"styles_gilroy-text__AA81t",form:"styles_form__O515S",status:"styles_status__Q4lWE",row:"styles_row__6seX8",fieldWrapper:"styles_fieldWrapper__LvGor",halfWidth:"styles_halfWidth__zUr3l",datePicker:"styles_datePicker__lJEEN",checkboxWrapper:"styles_checkboxWrapper__rMMwA",text:"styles_text__VGLT2",header:"styles_header__3C9Id",green:"styles_green__kyPIV",bold:"styles_bold__O6sFQ",option:"styles_option__EXY_0",file:"styles_file__CI05T",upload:"styles_upload__rxutN",buttonWrapper:"styles_buttonWrapper__7iVyN",button:"styles_button__eGUb3",fieldError:"styles_fieldError__kuSfT",rejectReason:"styles_rejectReason__Yvvt_",reject:"styles_reject__qqkKC",documents:"styles_documents__d60xD",fileLink:"styles_fileLink__TKMMh",icon:"styles_icon__pVin3",docRequirements:"styles_docRequirements__jASkX",title:"styles_title__2FhUI",vatError:"styles_vatError__i_qQ3",addContainer:"styles_addContainer__qoeFE",addBtn:"styles_addBtn__1vICw",textareaWrapper:"styles_textareaWrapper__7m4Wj"}}},e=>{e.O(0,[1121,6701,223,9091,8072,5862,351,1315,9558,639,4294,7032,3985,1054,636,6593,8792],()=>e(e.s=64512)),_N_E=e.O()}]);
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.