PageSourceSearch

https://kultura-analitiki.ru/_next/static/chunks/app/(auth)/accoun…/page-ff5bfe5d2cf29271.js

js kultura-analitiki.ru collected 2026-10-07 18:16:20 UTC 13,365 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[780],{1326:(e,s,a)=>{"use strict";a.d(s,{default:()=>p});var t=a(5155),i=a(2115),r=a(5176);function n(e,s={}){return(0,r.SS)(e,s,void 0,(e,s)=>401===e.status&&!!s.data?.flows)}var l=a(7765);function c({title:e,children:s,media:a}){let i=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"eyebrow text-kan",children:"Культура Аналитики"}),(0,t.jsx)("h1",{className:"h2 mb-4",children:e}),s]});return a?(0,t.jsxs)("div",{className:"row g-4 align-items-stretch",children:[(0,t.jsx)("section",{className:"col-12 col-lg-6",children:(0,t.jsx)("div",{className:"auth-card h-100",children:i})}),(0,t.jsx)("div",{className:"col-12 col-lg-6",children:a})]}):(0,t.jsx)("section",{className:"auth-message-card",children:i})}let o={login:"Вход",register:"Регистрация",reset:"Восстановление пароля","reset-sent":"Проверьте почту","reset-complete":"Пароль изменён","reset-confirm":"Новый пароль","social-signup":"Завершение регистрации","social-cancelled":"Вход отменён","social-error":"Не удалось войти","email-sent":"Подтвердите email","email-confirm":"Подтверждение email",inactive:"Аккаунт отключён"},d={login:{endpoint:"/api/ui/session/login/",submitLabel:"Войти"},register:{endpoint:"/api/ui/auth/register/",submitLabel:"Зарегистрироваться"},reset:{endpoint:"/api/ui/auth/password-reset/",submitLabel:"Отправить инструкции"},"reset-confirm":{endpoint:e=>`/api/ui/auth/password-reset/${encodeURIComponent(e)}/`,submitLabel:"Сохранить пароль",loadDetails:!0},"social-signup":{endpoint:"/api/ui/auth/provider/signup/",submitLabel:"Завершить регистрацию",loadDetails:!0},"email-confirm":{endpoint:"/api/ui/auth/email/verify/",submitLabel:"Подтвердить email",loadDetails:!0}};async function u(e){return window.grecaptcha||await new Promise((s,a)=>{let t=document.createElement("script");t.src=`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e.public_key)}`,t.async=!0;let i=window.setTimeout(()=>{t.remove(),a(Error("CAPTCHA"))},12e3);t.onload=()=>{clearTimeout(i),s()},t.onerror=()=>{clearTimeout(i),t.remove(),a(Error("CAPTCHA"))},document.head.appendChild(t)}),new Promise((s,a)=>{let t=window.setTimeout(()=>a(Error("CAPTCHA")),12e3);window.grecaptcha?.ready(()=>{window.grecaptcha.execute(e.public_key,e.action?{action:e.action}:{}).then(s,a).finally(()=>clearTimeout(t))})})}function m(){let[e,s]=(0,i.useState)(!1);return(0,t.jsxs)("aside",{className:"auth-media-card h-100",children:[(0,t.jsx)("p",{className:"eyebrow",children:"Культура Аналитики"}),(0,t.jsx)("h2",{className:"h3 mb-3",children:"Экономим время, а не обещаем чудеса"}),(0,t.jsx)("p",{children:"Ваши решения — ваша сила. Наша задача — дать вам понятные данные и удобные инструменты."}),(0,t.jsx)("div",{className:"ratio ratio-16x9 video-poster my-4",children:e?(0,t.jsx)("iframe",{src:"https://kinescope.io/embed/doo4CBdZT8iqBhBz6ZMHnM",title:"Знакомство с Культурой Аналитики",allow:"autoplay; fullscreen; picture-in-picture; encrypted-media",allowFullScreen:!0}):(0,t.jsx)("button",{type:"button","aria-label":"Смотреть видео о сервисе",onClick:()=>s(!0),children:(0,t.jsx)("span",{className:"display-4 text-white","aria-hidden":"true",children:"▶"})})}),(0,t.jsxs)("div",{className:"d-flex flex-wrap gap-2",children:[(0,t.jsx)("a",{className:"btn btn-outline-light rounded-pill",href:"https://t.me/OchenKulturniyBot",target:"_blank",rel:"noreferrer",children:"Telegram"}),(0,t.jsx)("a",{className:"btn btn-outline-light rounded-pill",href:"https://max.ru/id781130293840_bot",target:"_blank",rel:"noreferrer",children:"MAX"})]})]})}function p({mode:e,uid:s,validPath:a}){let h,[w,f]=(0,i.useState)(null),[b,x]=(0,i.useState)(!1),[j,_]=(0,i.useState)(0),[g,y]=(0,i.useState)(!1),[N,v]=(0,i.useState)({}),[k,C]=(0,i.useState)(null),[S,T]=(0,i.useState)(!1),$="login"===e||"register"===e,E=$||"reset"===e||"reset-confirm"===e,F=d[e],A="function"==typeof(h=d[e].endpoint)?h(s):h;(0,i.useEffect)(()=>{let s=new AbortController;return(async function(){let t=await n(`/api/ui/auth/${window.location.search}`,{signal:s.signal});if(!s.signal.aborted){if(t.authenticated&&("login"===e||"register"===e))return void window.location.replace(t.redirect_url);if(f(t),F.loadDetails&&("reset-confirm"!==e||a)){let e=await n(A,{signal:s.signal});if(s.signal.aborted)return;C(e)}v({}),x(!1)}})().catch(()=>{s.signal.aborted||x(!0)}),()=>s.abort()},[j,e,a,A,F.loadDetails]);let D=e=>`${e}${w?`?next=${encodeURIComponent(w.redirect_url)}`:""}`;async function L(e){if(e.preventDefault(),g||!w)return;let s=e.currentTarget;y(!0),v({});try{s.elements.namedItem("csrfmiddlewaretoken").value=await (0,r.SN)(),HTMLFormElement.prototype.submit.call(s)}catch(e){v(e instanceof r.j$?e.fields:{__all__:["Не удалось начать вход. Повторите попытку."]}),y(!1)}}async function H(s){if(s.preventDefault(),g||!w)return;let a=Object.fromEntries(new FormData(s.currentTarget));y(!0),v({});try{let s=await (0,r.SN)(),t={...a,next:w.redirect_url};if("register"===e){let e;try{e=await u(w.captcha)}catch{throw new r.j$({captcha:["Не удалось загрузить CAPTCHA. Проверьте соединение и повторите попытку."]})}t={...t,captcha:e,is_politics_info_subscribed:"on"===a.is_politics_info_subscribed,is_newsletter_subscribed:"on"===a.is_newsletter_subscribed}}"email-confirm"===e&&(t={});let i=await n(A,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":s},body:JSON.stringify(t)});if(i.confirmed)i.authenticated?window.location.assign(w.redirect_url):T(!0);else if(i.redirect_url)window.location.assign(i.redirect_url);else if(i.meta?.is_authenticated)window.location.assign(w.redirect_url);else if(i.data?.flows?.some(e=>"verify_email"===e.id&&e.is_pending))window.location.assign("/accounts/confirm-email/");else throw new r.j$({__all__:["Вход не завершён. Вернитесь на страницу входа и повторите попытку."]})}catch(e){v(e instanceof r.j$?e.fields:{__all__:["Не удалось связаться с сервером. Повторите попытку."]})}finally{y(!1)}}function O(e,s,a,i,r){return(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("label",{className:"form-label",htmlFor:e,children:s}),(0,t.jsx)("input",{className:`form-control${N[e]?" is-invalid":""}`,id:e,name:e,type:a,autoComplete:i,defaultValue:r,required:!0,"aria-invalid":!!N[e],"aria-describedby":N[e]?`${e}-errors`:void 0}
1),N[e]&&(0,t.jsx)("div",{className:"invalid-feedback",id:`${e}-errors`,children:N[e].join(" ")})]},e)}let P="reset-confirm"===e&&(!a||k?.validlink===!1),R=w&&!g&&!b&&(!F.loadDetails||k),I="login"===e||"register"===e||"reset"===e||"reset-confirm"===e&&!P||"social-signup"===e&&k?.data||"email-confirm"===e&&k?.data&&!S;return(0,t.jsxs)(c,{title:o[e],media:E?(0,t.jsx)(m,{}):void 0,children:[b?(0,t.jsx)(l.G,{message:"Не удалось загрузить данные.",onRetry:()=>_(e=>e+1),buttonClassName:"btn btn-link p-0"}):!w&&(0,t.jsx)("p",{role:"status",children:"Загрузка…"}),Object.entries(N).filter(([e])=>!["username","email","phone","password","password1","password2","new_password1","new_password2"].includes(e)).map(([e,s])=>(0,t.jsx)("div",{className:"alert alert-danger",role:"alert",children:s.join(" ")},e)),P&&(0,t.jsxs)("p",{role:"alert",children:["Ссылка недействительна или уже использована. ",(0,t.jsx)("a",{href:"/accounts/password_reset/",children:"Запросите новую ссылку"}),"."]}),S&&(0,t.jsx)("p",{role:"status",children:"Email подтверждён. Теперь можно войти в аккаунт."}),I&&(0,t.jsx)("form",{onSubmit:H,"aria-busy":g,children:(0,t.jsxs)("fieldset",{disabled:!R,children:["login"===e&&(0,t.jsxs)(t.Fragment,{children:[O("username","Email","email","username"),O("password","Пароль","password","current-password"),(0,t.jsx)("p",{children:(0,t.jsx)("a",{href:D("/accounts/password_reset/"),children:"Забыли пароль?"})})]}),"register"===e&&(0,t.jsxs)(t.Fragment,{children:[O("email","Email","email","email"),O("phone","Номер телефона","tel","tel"),O("password1","Пароль","password","new-password"),O("password2","Подтверждение пароля","password","new-password"),(0,t.jsx)("ul",{className:"small text-secondary ps-3",children:w?.password_help.map(e=>(0,t.jsx)("li",{children:e},e))}),(0,t.jsxs)("div",{className:"form-check mb-3",children:[(0,t.jsx)("input",{className:"form-check-input",type:"checkbox",id:"consent",name:"is_politics_info_subscribed",required:!0}),(0,t.jsx)("label",{className:"form-check-label",htmlFor:"consent",dangerouslySetInnerHTML:{__html:w?.consent_label??""}})]}),(0,t.jsxs)("div",{className:"form-check mb-4",children:[(0,t.jsx)("input",{className:"form-check-input",type:"checkbox",id:"newsletter",name:"is_newsletter_subscribed"}),(0,t.jsx)("label",{className:"form-check-label",htmlFor:"newsletter",children:w?.newsletter_label})]})]}),("reset"===e||"social-signup"===e)&&O("email","Email","email","email",k?.data?.user?.email),"social-signup"===e&&(0,t.jsx)("p",{className:"small text-secondary",children:"Провайдер не передал email. Укажите адрес для завершения регистрации."}),"reset-confirm"===e&&(0,t.jsxs)(t.Fragment,{children:[O("new_password1","Новый пароль","password","new-password"),O("new_password2","Подтверждение пароля","password","new-password")]}),"email-confirm"===e&&(0,t.jsxs)("p",{children:["Подтвердить адрес ",k?.data?.email,"?"]}),(0,t.jsx)("button",{className:"btn btn-kan btn-lg w-100 rounded-pill",type:"submit",disabled:!R,children:g?"Отправка…":F.submitLabel})]})}),$&&(0,t.jsxs)(t.Fragment,{children:[w&&w.providers.length>0&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("p",{className:"small text-secondary mb-2",children:"Или войдите через"}),(0,t.jsx)("div",{className:"d-flex gap-3",children:w.providers.map(e=>(0,t.jsxs)("form",{action:"/api/ui/auth/provider/",method:"post",onSubmit:L,children:[(0,t.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:w.csrfToken}),(0,t.jsx)("input",{type:"hidden",name:"provider",value:e.id}),(0,t.jsx)("input",{type:"hidden",name:"process",value:"login"}),(0,t.jsx)("input",{type:"hidden",name:"callback_url",value:w.social_callback_url}),(0,t.jsx)("button",{className:`social-auth-button social-auth-button-${e.id} border-0`,type:"submit","aria-label":`Войти через ${e.name}`,disabled:g})]},e.id))})]}),(0,t.jsx)("p",{className:"mt-4 mb-0",children:"login"===e?(0,t.jsxs)(t.Fragment,{children:["Нет аккаунта? ",(0,t.jsx)("a",{href:D("/accounts/register/"),children:"Зарегистрироваться"})]}):(0,t.jsxs)(t.Fragment,{children:["Уже есть аккаунт? ",(0,t.jsx)("a",{href:D("/accounts/login/"),children:"Войти"})]})})]}),!$&&(0,t.jsx)("p",{className:"mt-4 mb-0",children:(0,t.jsx)("a",{href:D("/accounts/login/"),children:"Вернуться ко входу"})})]})}},5176:(e,s,a)=>{"use strict";a.d(s,{SN:()=>l,SS:()=>n,j$:()=>t,x6:()=>r});
1class t extends Error{constructor(e,s){super(Object.values(e).flat()[0]),this.fields=e,this.status=s}}let i="Не удалось связаться с сервером. Повторите попытку.";async function r(e,s={},a=i){let n=new Headers(s.headers);n.set("Accept","application/json");let l=await fetch(e,{credentials:"same-origin",cache:"no-store",...s,headers:n});if(!l.headers.get("Content-Type")?.includes("application/json"))throw new t({__all__:[a]},l.status);let c=await l.json().catch(()=>{throw new t({__all__:[a]},l.status)});return{response:l,data:c}}async function n(e,s={},a=i,l){let{response:c,data:o}=await r(e,s,a);if(!c.ok&&!l?.(c,o)){let e=o.errors;throw new t((Array.isArray(e)?e.reduce((e,s)=>((e[s.param??"__all__"]??=[]).push(s.message),e),{}):e)??{__all__:[a]},c.status)}return o}async function l(){let e="Не удалось подготовить защищённую отправку формы. Обновите страницу.",s=await n("/landing/csrf/",{},e);if(!s.csrfToken)throw new t({__all__:[e]});return s.csrfToken}},7765:(e,s,a)=>{"use strict";a.d(s,{A:()=>r,G:()=>i});var t=a(5155);function i({message:e,onRetry:s,retryLabel:a="Повторить",buttonClassName:r="btn btn-sm btn-outline-danger"}){return(0,t.jsxs)("div",{className:"alert alert-danger",role:"alert",children:[e,s&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("button",{type:"button",className:r,onClick:s,children:a})]})]})}function r({error:e="",loadingText:s="Загрузка…"}){return e?(0,t.jsx)(i,{message:e,onRetry:()=>window.location.reload()}):(0,t.jsx)("p",{role:"status",children:s})}},7853:(e,s,a)=>{Promise.resolve().then(a.bind(a,1326))}},e=>{e.O(0,[441,794,358],()=>e(e.s=7853)),_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.