1import{dI as y,ed as o,e3 as V,dB as _,dF as r,eG as n,e7 as h,dy as f,eJ as C,dZ as B,er as c,d6 as U,b0 as E,eH as A,eD as I,dE as v}from"./vendor-DUoYKxKf.js";import{f as S}from"./vue-core-BW8FD41h.js";import{an as k,P as z,a as D,g as M,d as N}from"./index-BcPf-nBI.js";import{I as g}from"./Input-D-72TEB_.js";import{E as O}from"./ErrorMessages-BPdrdwYe.js";import{e as P}from"./apiError-aoDaZr77.js";import{e as F}from"./postAuthNavigate-SvuLfIdW.js";const L={class:"onboarding-backdrop"},q=y({__name:"Onboarding",setup(G){const b=S(),l=k(),t=o(""),u=o("");V(async()=>{l.user||await l.fetchUser({silent:!0});const a=l.user;a&&(t.value=a.username??"",u.value=a.surname??"")});const i=o(!1),s=o([]),m=o(!1),p=()=>{s.value=s.value.filter(e=>!e.toLowerCase().includes("имÑ"));const a=t.value.trim();return a.length<2?(i.value=!0,s.value.push("ÐÐ¼Ñ Ð´Ð¾Ð»Ð¶Ð½Ð¾ бÑÑÑ Ð½Ðµ менее 2 Ñимволов"),!1):a.length>32?(i.value=!0,s.value.push("ÐÐ¼Ñ Ð½Ðµ должно пÑевÑÑаÑÑ 32 Ñимвола"),!1):(i.value=!1,!0)},w=()=>{},x=async()=>{if(s.value=[],!!p()){m.value=!0;try{await M.post("/user/onboarding/complete",{username:t.value.trim(),surname:u.value.trim()||null,marketing_consent:!1}),await l.fetchUser({silent:!0}),await F(b,{name:"profiles"},{replace:!0})}catch(a){s.value.push(P(a,"Ðе ÑдалоÑÑ ÑоÑ
ÑаниÑÑ Ð´Ð°Ð½Ð½Ñе"))}finally{m.value=!1}}};return(a,e)=>(h(),_("div",L,[r(z,{size:"sm",visibleClBtn:!1,onClPopup:w},{title:n(()=>e[2]||(e[2]=[v("РаÑÑкажиÑе о Ñебе")])),default:n(()=>[f("form",{onSubmit:C(x,["prevent"]),class:"onboarding-form"},[e[4]||(e[4]=f("p",{class:"onboarding-hint"}," ÐÑо Ð¿Ð¾Ð¼Ð¾Ð¶ÐµÑ ÐºÐ¾Ð»Ð»ÐµÐ³Ð°Ð¼ ÑзнаÑÑ Ð²Ð°Ñ Ð² обÑем пÑоÑÑÑанÑÑве. ÐÑ Ð²Ñегда ÑможеÑе измениÑÑ Ð´Ð°Ð½Ð½Ñе в пÑоÑиле. ",-1)),r(g,{modelValue:t.value,"onUpdate:modelValue":e[0]||(e[0]=d=>t.value=d),type:"text",placeholder:"ÐмÑ",class:B({error:i.value}),onBlur:p,autocomplete:"given-name",required:""},{icon:n(()=>[r(c(U),{size:16})]),_:1},8,["modelValue","class"]),r(g,{modelValue:u.value,"onUpdate:modelValue":e[1]||(e[1]=d=>u.value=d),type:"text",placeholder:"Ð¤Ð°Ð¼Ð¸Ð»Ð¸Ñ (необÑзаÑелÑно)",autocomplete:"family-name"},{icon:n(()=>[r(c(E),{size:16})]),_:1},8,["modelValue"]),A(r(O,{errors:s.value},null,8,["errors"]),[[I,s.value.length>0]]),r(D,{type:"submit",isActive:m.value},{text:n(()=>e[3]||(e[3]=[v("ÐÑодолжиÑÑ")])),_:1},8,["isActive"])],32)]),_:1})]))}}),Q=N(q,[["__scopeId","data-v-c47be88f"]]);export{Q 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.