PageSourceSearch

https://gnature.ru/_next/static/chunks/2a_7-3ub77zph.js

js gnature.ru collected 2026-10-05 03:42:16 UTC 13,555 bytes, 6 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,895138,e=>{"use strict";var r=e.i(843476),t=e.i(117814);e.s(["AccountShell",0,function({children:e}){return(0,r.jsx)("div",{style:{background:t.C.bg,minHeight:"calc(100vh - 68px)",paddingBlock:"clamp(32px,5vw,64px)",paddingInline:"clamp(16px,4vw,32px)"},children:(0,r.jsx)("div",{style:{maxWidth:1e3,margin:"0 auto"},children:e})})},"Card",0,function({children:e,style:n}){return(0,r.jsx)("div",{style:{background:"#fff",borderRadius:16,border:`1px solid ${t.C.fg07}`,padding:"20px 24px",...n},children:e})},"ErrorBanner",0,function({children:e}){return(0,r.jsx)("div",{role:"alert",style:{padding:"12px 14px",borderRadius:8,background:"#fff5f5",border:"1px solid #feb2b2",font:"400 13px/1.5 Manrope, sans-serif",color:"#c53030",marginBottom:14},children:e})},"Field",0,function({id:e,label:n,type:a="text",value:s,onChange:l,required:i,placeholder:o,autoComplete:d,testId:c}){return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:5},children:[(0,r.jsx)("label",{htmlFor:e,style:{font:"500 12px Manrope, sans-serif",color:t.C.fg55},children:n}),(0,r.jsx)("input",{id:e,type:a,value:s,onChange:e=>l(e.target.value),required:i,placeholder:o,autoComplete:d,"data-testid":c,style:{font:"400 14px Manrope, sans-serif",color:t.C.fg,border:`1px solid ${t.C.fg08}`,borderRadius:10,padding:"12px 14px",outline:"none",background:"#fff",width:"100%",boxSizing:"border-box",transition:"border-color 150ms"},onFocus:e=>{e.target.style.borderColor=t.C.green},onBlur:e=>{e.target.style.borderColor=t.C.fg08}})]})},"PageTitle",0,function({children:e}){return(0,r.jsx)("h1",{style:{font:"700 clamp(26px,4vw,40px)/1.05 Manrope, sans-serif",letterSpacing:"-0.02em",textTransform:"uppercase",color:t.C.fg,margin:"0 0 clamp(20px,3vw,32px)"},children:e})},"PrimaryButton",0,function({children:e,disabled:n,type:a="submit",onClick:s,testId:l}){return(0,r.jsx)("button",{type:a,disabled:n,onClick:s,"data-testid":l,style:{width:"100%",padding:"14px",background:n?t.C.fg30:t.C.green,color:"#fff",border:"none",borderRadius:10,cursor:n?"not-allowed":"pointer",font:"600 15px Manrope, sans-serif",transition:"background 160ms",minHeight:50},children:e})}])},405049,e=>{"use strict";e.i(506046),e.s([])},358594,122474,e=>{"use strict";var r=e.i(843476);e.i(405049);var t=e.i(506046),n=e.i(117814),a=e.i(895138),s=e.i(271645);function l({heading:e}){let{login:i,register:o,registrationMessage:d,clearRegistrationMessage:c}
1=(0,t.useAuth)(),[p,u]=(0,s.useState)("login"),[f,x]=(0,s.useState)(""),[g,m]=(0,s.useState)(""),[h,b]=(0,s.useState)(""),[y,j]=(0,s.useState)(""),[C,v]=(0,s.useState)(""),[w,S]=(0,s.useState)(""),[B,M]=(0,s.useState)(null),[k,A]=(0,s.useState)(!1),T=(0,s.useCallback)(async e=>{e.preventDefault(),M(null),A(!0);let r=await i(f.trim(),g);A(!1),r&&M(r)},[i,f,g]),F=(0,s.useCallback)(async e=>{e.preventDefault(),M(null);let r=C.trim().split(/\s+/),t=r[0]??"",n=r.slice(1).join(" ");if(!t)return void M("Укажите имя");if(y.length<8)return void M("Пароль должен быть не короче 8 символов");A(!0);let a=await o({email:h.trim(),password:y,first_name:t,last_name:n||void 0,phone:w.trim()||void 0});A(!1),a&&M(a)},[o,C,h,y,w]),_=(0,s.useCallback)(e=>{u(e),M(null),c()},[c]);return(0,r.jsx)("div",{style:{maxWidth:440,margin:"0 auto"},children:(0,r.jsxs)(a.Card,{style:{padding:"28px 28px 32px"},children:[(0,r.jsx)("h1",{style:{font:"700 24px/1.1 Manrope, sans-serif",letterSpacing:"-0.01em",color:n.C.fg,margin:"0 0 6px"},children:e??("login"===p?"Вход в кабинет":"Регистрация")}),(0,r.jsx)("p",{style:{font:"400 13px/1.5 Manrope, sans-serif",color:n.C.fg55,margin:"0 0 20px"},children:"login"===p?"Войдите, чтобы видеть заказы и сохранённые адреса.":"Создайте аккаунт, чтобы отслеживать заказы и хранить адреса."}),(0,r.jsx)("div",{style:{display:"flex",gap:0,marginBottom:20,background:n.C.bgSection,borderRadius:10,padding:4},children:["login","register"].map(e=>{let t=p===e;return(0,r.jsx)("button",{type:"button",onClick:()=>_(e),style:{flex:1,padding:"9px 0",border:"none",borderRadius:8,cursor:"pointer",background:t?"#fff":"transparent",color:t?n.C.fg:n.C.fg55,font:`${t?600:500} 13px Manrope, sans-serif`,boxShadow:t?"0 1px 4px rgba(0,0,0,0.06)":"none",transition:"all 150ms"},children:"login"===e?"Вход":"Регистрация"},e)})}),B&&(0,r.jsx)(a.ErrorBanner,{children:B}),d&&(0,r.jsx)("div",{role:"status","data-testid":"registration-verification-notice",style:{marginBottom:16,padding:"12px 14px",borderRadius:10,background:n.C.greenTint12,color:n.C.fg,font:"500 13px/1.5 Manrope, sans-serif"},children:d}),"login"===p?(0,r.jsxs)("form",{onSubmit:T,"data-testid":"login-form",style:{display:"flex",flexDirection:"column",gap:16},noValidate:!0,children:[(0,r.jsx)(a.Field,{id:"login-email",label:"Email",type:"email",value:f,onChange:x,required:!0,placeholder:"[email protected]",autoComplete:"email",testId:"login-email"}),(0,r.jsx)(a.Field,{id:"login-password",label:"Пароль",type:"password",value:g,onChange:m,required:!0,placeholder:"••••••••",autoComplete:"current-password",testId:"login-password"}),(0,r.jsx)(a.PrimaryButton,{disabled:k,testId:"login-submit",children:k?"Входим…":"Войти"}),(0,r.jsx)("a",{href:"/account/reset-password",style:{color:n.C.green,font:"600 13px Manrope, sans-serif"},children:"Забыли пароль?"})]}):(0,r.jsxs)("form",{onSubmit:F,"data-testid":"register-form",style:{display:"flex",flexDirection:"column",gap:16},noValidate:!0,children:[(0,r.jsx)(a.Field,{id:"register-name",label:"Имя и фамилия",value:C,onChange:v,required:!0,placeholder:"Иван Иванов",autoComplete:"name",testId:"register-name"}),(0,r.jsx)(a.Field,{id:"register-email",label:"Email",type:"email",value:h,onChange:b,required:!0,placeholder:"[email protected]",autoComplete:"email",testId:"register-email"}),(0,r.jsx)(a.Field,{id:"register-phone",label:"Телефон (необязательно)",type:"tel",value:w,onChange:S,placeholder:"+7 (900) 000-00-00",autoComplete:"tel"}),(0,r.jsx)(a.Field,{id:"register-password",label:"Пароль (минимум 8 символов)",type:"password",value:y,onChange:j,required:!0,placeholder:"••••••••",autoComplete:"new-password",testId:"register-password"}),(0,r.jsx)(a.PrimaryButton,{disabled:k,testId:"register-submit",children:k?"Регистрируем…":"Зарегистрироваться"})]})]})})}e.s(["AccountGuard",0,function({children:e,authHeading:s}){let{customer:i,loading:o}=(0,t.useAuth)();return o?(0,r.jsx)(a.AccountShell,{children:(0,r.jsx)("div",{style:{font:"400 14px Manrope, sans-serif",color:n.C.fg40,padding:"40px 0",textAlign:"center"},children:"Загрузка…"})}):i?(0,r.jsx)(a.AccountShell,{children:e}):(0,r.jsx)(a.AccountShell,{children:(0,r.jsx)(l,{heading:s})})}],358594);var i=e.i(618566);let o=[{href:"/account",label:"Профиль"}
1,{href:"/account/orders",label:"Заказы"},{href:"/account/addresses",label:"Адреса"}];e.s(["AccountNav",0,function(){let e=(0,i.usePathname)(),a=(0,i.useRouter)(),{logout:l}=(0,t.useAuth)(),[d,c]=(0,s.useState)(null),[p,u]=(0,s.useState)(!1),f=(0,s.useCallback)(async()=>{u(!0),c(null);let e=await l();(u(!1),e)?c(e):(a.replace("/account"),a.refresh())},[l,a]);return(0,r.jsxs)("nav",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8,marginBottom:24},children:[o.map(t=>{let a=e===t.href;return(0,r.jsx)("a",{href:t.href,style:{font:"600 13px Manrope, sans-serif",textDecoration:"none",padding:"9px 16px",borderRadius:9999,background:a?n.C.green:"#fff",color:a?"#fff":n.C.fg,border:`1px solid ${a?n.C.green:n.C.fg08}`,transition:"all 150ms"},children:t.label},t.href)}),(0,r.jsx)("button",{type:"button",onClick:f,"data-testid":"account-logout",disabled:p,style:{marginLeft:"auto",font:"600 13px Manrope, sans-serif",padding:"9px 16px",borderRadius:9999,background:"transparent",color:n.C.fg55,border:`1px solid ${n.C.fg08}`,cursor:"pointer",transition:"all 150ms"},children:p?"Выходим…":"Выйти"}),d&&(0,r.jsx)("div",{role:"alert","data-testid":"logout-error",style:{width:"100%",color:"#c53030",font:"500 12px Manrope, sans-serif"},children:d})]})}],122474)},349862,e=>{"use strict";var r=e.i(843476);e.i(405049);var t=e.i(506046),n=e.i(271645),a=e.i(117814),s=e.i(358594),l=e.i(122474),i=e.i(895138);function o(){let{customer:e,refresh:s,authError:o}=(0,t.useAuth)(),[d,c]=(0,n.useState)({first_name:e?.first_name??"",last_name:e?.last_name??"",phone:e?.phone??""}
1),[p,u]=(0,n.useState)(""),[f,x]=(0,n.useState)(""),[g,m]=(0,n.useState)(null),[h,b]=(0,n.useState)(null),[y,j]=(0,n.useState)(!1);if(!e)return null;let C=[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email;return(0,r.jsxs)("div",{"data-testid":"account-dashboard",children:[(0,r.jsx)(i.PageTitle,{children:"Личный кабинет"}),(0,r.jsx)(l.AccountNav,{}),o&&(0,r.jsx)(i.ErrorBanner,{children:o}),g&&(0,r.jsx)(i.ErrorBanner,{children:g}),h&&(0,r.jsx)("div",{role:"status",style:{color:a.C.green,marginBottom:12},children:h}),(0,r.jsxs)(i.Card,{style:{marginBottom:20},children:[(0,r.jsx)("div",{style:{font:"400 13px Manrope, sans-serif",color:a.C.fg40,marginBottom:4},children:"Здравствуйте,"}),(0,r.jsx)("div",{style:{font:"700 22px Manrope, sans-serif",color:a.C.fg,letterSpacing:"-0.01em"},children:C}),(0,r.jsxs)("div",{style:{font:"400 13px Manrope, sans-serif",color:a.C.fg55,marginTop:8},children:[e.email,e.phone?` \xb7 ${e.phone}`:""]})]}),(0,r.jsxs)("div",{className:"gn-account-forms",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,marginBottom:20},children:[(0,r.jsxs)(i.Card,{children:[(0,r.jsx)("div",{style:{font:"700 16px Manrope, sans-serif",marginBottom:14},children:"Данные профиля"}),(0,r.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),j(!0),m(null),b(null);let r=await fetch("/api/customer/profile",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).catch(()=>null);if(r?.ok)await s(),b("Профиль обновлён");else{let e=await r?.json().catch(()=>({}));m(e?.error||"Не удалось сохранить профиль")}j(!1)},style:{display:"flex",flexDirection:"column",gap:12},children:[(0,r.jsx)(i.Field,{id:"profile-first-name",label:"Имя",value:d.first_name,onChange:e=>c(r=>({...r,first_name:e})),required:!0,testId:"profile-first-name"}),(0,r.jsx)(i.Field,{id:"profile-last-name",label:"Фамилия",value:d.last_name,onChange:e=>c(r=>({...r,last_name:e}))}),(0,r.jsx)(i.Field,{id:"profile-phone",label:"Телефон",type:"tel",value:d.phone,onChange:e=>c(r=>({...r,phone:e}))}),(0,r.jsx)(i.PrimaryButton,{disabled:y,testId:"profile-submit",children:"Сохранить профиль"})]})]}),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)("div",{style:{font:"700 16px Manrope, sans-serif",marginBottom:14},children:"Смена пароля"}),(0,r.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),j(!0),m(null),b(null);let r=await fetch("/api/customer/password",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({current_password:p,new_password:f})}).catch(()=>null),t=await r?.json().catch(()=>({}));r?.ok?(u(""),x(""),b("Пароль изменён")):m(t?.error||"Не удалось изменить пароль"),j(!1)},style:{display:"flex",flexDirection:"column",gap:12},children:[(0,r.jsx)(i.Field,{id:"profile-current-password",label:"Текущий пароль",type:"password",value:p,onChange:u,required:!0,autoComplete:"current-password"}),(0,r.jsx)(i.Field,{id:"profile-new-password",label:"Новый пароль",type:"password",value:f,onChange:x,required:!0,autoComplete:"new-password"}),(0,r.jsx)(i.PrimaryButton,{disabled:y,testId:"password-change-submit",children:"Изменить пароль"})]})]})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},className:"gn-account-tiles",children:[(0,r.jsx)("a",{href:"/account/orders",style:{textDecoration:"none",display:"block"},children:(0,r.jsxs)(i.Card,{children:[(0,r.jsx)("div",{style:{font:"700 16px Manrope, sans-serif",color:a.C.fg,marginBottom:6},children:"Мои заказы"}),(0,r.jsx)("div",{style:{font:"400 13px/1.5 Manrope, sans-serif",color:a.C.fg55},children:"История заказов и их статусы."}),(0,r.jsx)("div",{style:{font:"600 13px Manrope, sans-serif",color:a.C.green,marginTop:10},children:"Открыть →"})]})}),(0,r.jsx)("a",{href:"/account/addresses",style:{textDecoration:"none",display:"block"},children:(0,r.jsxs)(i.Card,{children:[(0,r.jsx)("div",{style:{font:"700 16px Manrope, sans-serif",color:a.C.fg,marginBottom:6},children:"Мои адреса"}),(0,r.jsx)("div",{style:{font:"400 13px/1.5 Manrope, sans-serif",color:a.C.fg55},children:"Сохранённые адреса доставки."}),(0,r.jsx)("div",{style:{font:"600 13px Manrope, sans-serif",color:a.C.green,marginTop:10},children:"Открыть →"})]})})]}),(0,r.jsx)("style",{children:`
2        @media (max-width: 640px) {
3          .gn-account-tiles { grid-template-columns: 1fr !important; }
4          .gn-account-forms { grid-template-columns: 1fr !important; }
5        }
6      `})]})}e.s(["AccountClient",0,function(){return(0,r.jsx)(s.AccountGuard,{authHeading:"Вход в кабинет",children:(0,r.jsx)(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.