1import{f as _,j as e}from"./vendor-react-CDd3rhf2.js";import{I as X,F as E,B as N,v,o as z,t as P}from"./index-D61LkJSw.js";import{u as S}from"./useDocumentMeta-CBbuVZFa.js";import{P as I}from"./pages-BzwEEChT.js";import"./vendor-oidc-Ctd-BSkT.js";import"./vendor-query-kvRtge1q.js";import"./vendor-motion-DFyxKclL.js";const y="_wrap_1xbrz_6",k="_inner_1xbrz_29",L="_iconWrap_1xbrz_41",M="_title_1xbrz_59",w="_desc_1xbrz_70",F="_card_1xbrz_79",G="_fieldGroup_1xbrz_89",H="_fieldLabel_1xbrz_93",R="_fieldInput_1xbrz_103",V="_fieldInputError_1xbrz_126",W="_fieldError_1xbrz_130",A="_fieldHint_1xbrz_140",q="_btnPrimary_1xbrz_151",C="_btnSpinner_1xbrz_186",D="_serverError_1xbrz_202",T="_support_1xbrz_216",n={wrap:y,inner:k,iconWrap:L,title:M,desc:w,card:F,fieldGroup:G,fieldLabel:H,fieldInput:R,fieldInputError:V,fieldError:W,fieldHint:A,btnPrimary:q,btnSpinner:C,serverError:D,support:T};function x(t,a=""){const o=t.length<a.length,i=t.replace(/\D/g,"").slice(0,11);if(i.length===0)return o?"":"+7";let r=i;r[0]==="8"&&(r="7"+r.slice(1)),r[0]!=="7"&&(r="7"+r),r=r.slice(0,11);let s="+7";return r.length>1&&(s+=" ("+r.slice(1,4)),r.length>=4&&(s+=")"),r.length>4&&(s+=" "+r.slice(4,7)),r.length>7&&(s+="-"+r.slice(7,9)),r.length>9&&(s+="-"+r.slice(9,11)),s}const $=z({phone:P().regex(/^\+7 \(\d{3}\) \d{3}-\d{2}-\d{2}$/,"ФоÑмаÑ: +7 (XXX) XXX-XX-XX")});function B(){return e.jsx("svg",{width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})})}function re(){var f,m;S(I.phoneRequired);const{data:t}=X(),{mutate:a,isPending:o,error:i}=E(),{register:r,handleSubmit:s,watch:b,setValue:c,formState:{errors:d}}=N({resolver:v($),defaultValues:{phone:""}}),g=b("phone")??"",h=_.useRef(!1);_.useEffect(()=>{!h.current&&(t!=null&&t.phoneNumber)&&(h.current=!0,c("phone",x(t.phoneNumber)))},[t==null?void 0:t.phoneNumber,c]);const u=((m=(f=i==null?void 0:i.response)==null?void 0:f.data)==null?void 0:m.errorMessage)??(i?"Ðе ÑдалоÑÑ Ð²ÑполниÑÑ Ð·Ð°Ð¿ÑоÑ. ÐопÑобÑйÑе еÑÑ Ñаз.":null),j=l=>a(l.phone);return e.jsx("div",{className:n.wrap,children:e.jsxs("div",{className:n.inner,children:[e.jsx("div",{className:n.iconWrap,children:e.jsx(B,{})}),e.jsx("h1",{className:n.title,children:"ÐодÑвеÑдиÑе ÑелеÑон"}),e.jsx("p",{className:n.desc,children:"ÐÐ»Ñ Ð¿ÑÐ¾Ð´Ð¾Ð»Ð¶ÐµÐ½Ð¸Ñ ÑабоÑÑ Ñ ÐаÑк ÐÑеной ÑкажиÑе Ð½Ð¾Ð¼ÐµÑ ÑелеÑона. Ðа ÑледÑÑÑем Ñаге Ð¼Ñ Ð¾ÑпÑавим SMS-код Ð´Ð»Ñ Ð¿Ð¾Ð´ÑвеÑждениÑ."}),e.jsxs("form",{className:n.card,onSubmit:s(j),noValidate:!0,children:[u&&e.jsx("div",{className:n.serverError,role:"alert",children:u}),e.jsxs("div",{className:n.fieldGroup,children:[e.jsx("label",{className:n.fieldLabel,htmlFor:"phone",children:"ÐÐ¾Ð¼ÐµÑ ÑелеÑона"}),e.jsx("input",{id:"phone",type:"tel",inputMode:"tel",autoComplete:"tel",placeholder:"+7 (XXX) XXX-XX-XX",className:`${n.fieldInput} ${d.phone?n.fieldInputError:""}`,...r("phone"),onChange:l=>{const p=x(l.target.value,g);
1c("phone",p,{shouldValidate:!0}),requestAnimationFrame(()=>{l.target.setSelectionRange(p.length,p.length)})}}),d.phone?e.jsx("span",{className:n.fieldError,children:d.phone.message}):e.jsx("span",{className:n.fieldHint,children:"Ðа ÑÑÐ¾Ñ Ð½Ð¾Ð¼ÐµÑ Ð¿ÑидÑÑ SMS Ñ ÐºÐ¾Ð´Ð¾Ð¼ подÑвеÑждениÑ."})]}),e.jsx("button",{type:"submit",className:n.btnPrimary,disabled:o,children:o?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:n.btnSpinner,"aria-hidden":"true"}),"ÐеÑенапÑавлÑем..."]}):"ÐодÑвеÑдиÑÑ ÑелеÑон"})]}),e.jsxs("p",{className:n.support,children:["Ðозникли пÑоблемÑ? ÐозвониÑе в ÐаÑк ÐÑÐµÐ½Ñ â"," ",e.jsx("a",{href:"tel:+73432472363",children:"+7 (343) 247-23-63"})]})]})})}export{re 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.