PageSourceSearch

https://xn--80aapampemcchfmo7a3c9ehj.xn--p1ai/front/dist/assets/ProfilePageSettings-ad576156.js

js xn--80aapampemcchfmo7a3c9ehj.xn--p1ai collected 2026-10-02 03:24:31 UTC 17,627 bytes, 1 lines download raw bytes

1import{K as ne,L as we,N as le,i as P,r as V,h as se,z as ie,A as re,o,c as l,a as t,u as z,n as R,B as q,I as A,m,p as D,t as ee,F as G,q as J,H as pe,w as F,O as oe,_ as K,T as Se,x as X,k as ae,J as ke,G as ze,E as $e}from"./index-d8daf042.js";import{P as H}from"./consts-88dbdb63.js";import{_ as de}from"./CustomInput-ef6b5579.js";import{_ as Pe}from"./CustomDatepicker-2a3d2d4c.js";import{_ as Te}from"./CustomDropdown-48c9e42d.js";import{_ as _e}from"./SpinnerLoading-fb5f1d55.js";import{_ as xe}from"./CustomCheckbox-4d72d9e5.js";import{r as Ce}from"./formats-ff81e4e8.js";const De={class:"profile-form"},Ee={class:"profile-form__preview"},Ve={class:"profile-form__preview-inner"},Le={class:"profile-form__preview-photo-wrap"},Me=["id"],Oe=["src"],We={for:"photoFile",class:"profile-form__preview-edit","aria-label":"Изменить фото"},Fe=["accept"],Be={class:"profile-form__preview-info"},Ae={class:"profile-form__preview-name text-lg"},He=["id"],Ie=t("div",{class:"profile-form__socials-label text-sm color-neutral-500"}," Социальные сети ",-1),Ue={class:"profile-form__socials-list"},Ne=["aria-label","onClick"],qe=["onClick"],Ge={key:0,class:"profile-form__preview-error text-sm"},Ke={key:0},Ye={key:1},je={class:"profile-form__section"},Re=t("h2",{class:"profile-form__section-title title-md"}," Персональные данные ",-1),Je={class:"profile-form__fields-grid"},Qe=["id"],Xe={class:"profile-form__actions"},Ze={key:"success",class:"profile-form__action-success"},et=t("span",null,"успешно сохранено",-1),tt={key:"default"},st=5e3,te=2,it={__name:"ProfileForm",setup(g){const d=ne(),T=we(),{getProfile:f,authServicesData:c,isLoadingUpdateProfileData:p}=le(d),s=P(()=>f.value||{}),h=V(null),a=V(!1);let b=0;const x=["png","jpg","jpeg"],C=se({size:!1,format:!1}),L=new Date().getFullYear()-120,M=[{id:"",name:"Не выбран"},{id:"M",name:"Мужской"},{id:"F",name:"Женский"}],O={VKontakte:{iconSlug:"socials-vk",title:"ВКонтакте"},Odnoklassniki:{iconSlug:"socials-ok",title:"Одноклассники"}},_=se({name:"",birthDate:"",gender:""}),I=P(()=>(c.value||[]).filter(i=>O[i.id])),y=P(()=>x.map(i=>i.trim().startsWith(".")?i:`.${i}`).join(", ")),W=P({get(){if(!_.birthDate)return null;const[i,u,S]=_.birthDate.split("-").map(Number);return!i||!u||!S?null:new Date(i,u-1,S)},set(i){if(!(i instanceof Date)){_.birthDate="";return}const u=i.getFullYear(),S=String(i.getMonth()+1).padStart(2,"0"),E=String(i.getDate()).padStart(2,"0");_.birthDate=`${u}-${S}-${E}`}}),r=P(()=>{var E,B,N;const i=((E=s.value)==null?void 0:E.name)||"",u=((B=s.value)==null?void 0:B.birthDate)||"",S=((N=s.value)==null?void 0:N.gender)||"";return _.name.trim()!==i.trim()||_.birthDate!==u||(_.gender||"")!==S}),v=P(()=>p.value||a.value||!r.value);function e(){b&&(window.clearTimeout(b),b=0)}function n(){e(),a.value=!1}function w(){e(),a.value=!0,b=window.setTimeout(()=>{a.value=!1,b=0},st)}function U(){var i,u,S;_.name=((i=s.value)==null?void 0:i.name)||"",_.birthDate=((u=s.value)==null?void 0:u.birthDate)||"",_.gender=((S=s.value)==null?void 0:S.gender)||""}ie(s,()=>{U()},{immediate:!0,deep:!0}),ie(r,i=>{i&&a.value&&n()});function Y(i){C[i]=!0}function j(i){C[i]=!1}function $(i){let u=!0;if(te!==1/0&&i.size/1024/1024>te||i.size<=0?(Y("size"),u=!1):j("size"),x.length>=1){const E=i.name.lastIndexOf("."),B=i.name.substring(E+1);x.find(Q=>Q===B)?j("format"):(Y("format"),u=!1)}return u}function Z(){h.value&&(h.value.value=""),d.profileUpdatePhoto()}function fe(i){if(!(i.target instanceof HTMLInputElement))return;const u=i.target.files;if(!u||!u.length)return;const S=u[0];if(!$(S)){Z();return}d.profileUpdatePhoto(S)}function ve(){var i;(i=h.value)==null||i.click()}async function me(i){await X.unlinkSocial(i.deleteUrl),d.getProfileData()}function he(i){i.active||new Function(i.onclick)()}function ge(){T.open("changePassword")}async function be(){if(v.value)return;n(),await d.updateProfileData({name:_.name.trim(),birthDate:_.birthDate,gender:_.gender})&&w()}return re(()=>{e()}),(i,u)=>{var S,E,B,N,Q;return o(),l("div",De,[t("div",Ee,[t("div",Ve,[t("div",Le,[t("button",{id:z(H).profileSettingsPhoto,t
1ype:"button",class:R(["profile-form__preview-photo",{"profile-form__preview-photo--void":!((S=s.value)!=null&&S.photo)}]),"aria-label":"Изменить фото",onClick:ve},[(E=s.value)!=null&&E.photo?(o(),l("img",{key:0,src:s.value.photo,alt:"",class:"profile-form__preview-img"},null,8,Oe)):(o(),q(A,{key:1,src:"user-simple-fill"}))],10,Me),(B=s.value)!=null&&B.photo?(o(),l("button",{key:0,type:"button",class:"profile-form__preview-remove","aria-label":"Удалить фото",onClick:Z},[m(A,{src:"delete"})])):D("",!0),t("label",We,[m(A,{src:"edit"})]),t("input",{id:"photoFile",ref_key:"photoFile",ref:h,class:"profile-form__preview-input",type:"file",hidden:"",accept:y.value,onChange:fe},null,40,Fe)]),t("div",Be,[t("div",Ae,ee((N=s.value)==null?void 0:N.name),1),t("div",{id:z(H).profileSettingsSocial,class:"profile-form__socials"},[Ie,t("div",Ue,[(o(!0),l(G,null,J(I.value,k=>{var ce,ue;return o(),l("button",{key:`profile-form__socials-item-${k.id}`,type:"button",class:"profile-form__socials-item","aria-label":((ce=O[k.id])==null?void 0:ce.title)||k.id,onClick:ye=>he(k)},[m(A,{src:(ue=O[k.id])==null?void 0:ue.iconSlug,class:"profile-form__socials-icon"},null,8,["src"]),k.active&&k.id!=="VKontakte"?(o(),l("span",{key:0,class:"profile-form__socials-unlink","aria-label":"Отвязать",onClick:pe(ye=>me(k),["stop"])},[m(A,{src:"close"})],8,qe)):D("",!0)],8,Ne)}),128))])],8,He)])])]),C.size||C.format?(o(),l("div",Ge,[C.size?(o(),l("div",Ke," Размер файла не больше "+ee(te)+"МБ ")):D("",!0),C.format?(o(),l("div",Ye," Недопустимый формат файла ("+ee(y.value)+") ",1)):D("",!0)])):D("",!0),t("div",je,[Re,t("div",{class:R(["profile-form__fields",{"profile-form__fields--is-loading":z(p)}])},[m(_e,{"into-block":"","is-loading":z(p)},null,8,["is-loading"]),t("div",Je,[m(de,{modelValue:_.name,"onUpdate:modelValue":u[0]||(u[0]=k=>_.name=k),label:"Имя",placeholder:"Введите имя"},null,8,["modelValue"]),m(de,{"model-value":((Q=s.value)==null?void 0:Q.email)||"",label:"E-mail",readonly:""},null,8,["model-value"]),t("div",{id:z(H).profileSettingsBirthday},[m(Pe,{modelValue:W.value,"onUpdate:modelValue":u[1]||(u[1]=k=>W.value=k),mode:"form",label:"Дата рождения",placeholder:"Укажите дату","min-year":L},null,8,["modelValue"])],8,Qe),m(Te,{modelValue:_.gender,"onUpdate:modelValue":u[2]||(u[2]=k=>_.gender=k),mode:"form",label:"Пол",placeholder:"Не выбран",options:M,"can-select-all":!1},null,8,["modelValue"])]),t("div",Xe,[m(K,{theme:"secondary",class:"profile-form__action","is-disabled":z(p),onClick:ge},{default:F(()=>[oe(" Изменить пароль ")]),_:1},8,["is-disabled"]),m(K,{theme:"dark",class:R(["profile-form__action",{"profile-form__action--is-success":a.value}]),"is-disabled":v.value,onClick:be},{default:F(()=>[m(Se,{name:"profile-form-action-fade",mode:"out-in"},{default:F(()=>[a.value?(o(),l("span",Ze,[m(A,{src:"check",class:"profile-form__action-success-icon"}),et])):(o(),l("span",tt," Сохранить изменения "))]),_:1})]),_:1},8,["class","is-disabled"])])],2)])])}}};function ot({targetRef:g,windowRef:d,isVisible:T}){const f=se({left:0,top:0,width:0});let c=null,p=null,s=[],h=[];const a=P(()=>({left:`${f.left}px`,top:`${f.top}px`,width:`${f.width}px`}));function b(){return!!z(T)}function x(r){const v=window.getComputedStyle(r);return v.overflowY==="scroll"||v.overflowY==="auto"||v.overflow==="scroll"||v.overflow==="auto"?r.scrollHeight>r.clientHeight:!1}function C(r){const v=[];let e=r||g.value;if(!e)return v;for(e=e.parentElement;e&&e!==document.body;)x(e)&&v.push(e),e=e.parentElement;return v}function L(){h.forEach(({ancestor:r,handler:v})=>{r.removeEventListener("scroll",v)}),h=[],s=[]}function M(){L();const r=g.value;r&&(s=C(r),s.unshift(window),s.forEach(v=>{v.addEventListener("scroll",y,{passive:!0}),h.push({ancestor:v,handler:y})}))}function O(){!g.value||typeof ResizeObserver>"u"||(p||(p=new ResizeObserver(y)),p.observe(g.value))}function _(){!d.value||typeof ResizeObserver>"u"||(c||(c=new ResizeObserver(y)),c.observe(d.value))}function I(){d.value&&c&&c.unobserve(d.value)}function y(){var e,n,w;if(!b())return;const r=(e=g.value)==null?void 0:e.getBoundingClientRect(),v=(n=d.value)==null?void 0:n.getBoundingClientRect();!r||!v||(f.left=r.left,f.top=Math.round(r.bottom+(((w=window.visualVie
1wport)==null?void 0:w.offsetTop)||0)),f.width=r.width)}async function W(){await ke(),M(),O(),_(),y()}return ie(()=>z(T),async r=>{if(r){await W();return}I()}),ae(()=>{var r;(r=window.visualViewport)==null||r.addEventListener("resize",y),window.addEventListener("update-teleport-window",y),M(),O(),y(),b()&&W()}),re(()=>{var r;L(),(r=window.visualViewport)==null||r.removeEventListener("resize",y),window.removeEventListener("update-teleport-window",y),g.value&&p&&(p.unobserve(g.value),p.disconnect(),p=null),d.value&&c&&(c.unobserve(d.value),c.disconnect(),c=null)}),{teleportWindowStyle:a,updateStylesTeleportWindow:y,syncTeleportWindow:W}}const nt={class:"personalized-subscriptions"},lt={class:"personalized-subscriptions__header-content"},rt={class:"personalized-subscriptions__header-flex"},at=t("h2",{class:"personalized-subscriptions__header-title title-md"}," Подписки ",-1),ct=["id","aria-expanded"],ut=t("div",{class:"personalized-subscriptions__header-caption text-sm color-neutral-500"}," Подпишитесь на важные для вас темы ",-1),dt={class:"personalized-subscriptions__window-body"},pt=t("div",{class:"personalized-subscriptions__window-title text-sm color-neutral-300"}," Настройка подписок ",-1),_t={key:0,class:"personalized-subscriptions__empty personalized-subscriptions__empty--window"},ft={key:1,class:"personalized-subscriptions__list personalized-subscriptions__window-list"},vt=["innerHTML"],mt={class:"personalized-subscriptions__body"},ht={key:0,class:"personalized-subscriptions__list"},gt=["innerHTML"],bt={key:1,class:"personalized-subscriptions__empty"},yt={__name:"PersonalizedSubscriptions",setup(g){const d=ne(),{getProfile:T}=le(d),f=V(!1),c=V({}),p=V({}),s=V(!1),h=V(null),a=V(null),{teleportWindowStyle:b}=ot({targetRef:h,windowRef:a,isVisible:f}),x=P({get(){var e;return!((e=T.value)!=null&&e.isUnsubscribed)},set(e){W({name:"isUnsubscribed",value:!e})}}),C=P(()=>{var e,n;return((n=(e=c.value)==null?void 0:e.tags)==null?void 0:n.map(w=>w.id))||[]}),L=P(()=>{var e,n;return[...((e=p.value)==null?void 0:e.tags)||[],...((n=p.value)==null?void 0:n.availableTags)||[]]});function M(e){f.value=e}function O(){M(!f.value)}function _(e){const n=e.target.closest(".personalized-subscriptions__settings"),w=e.target.closest(".personalized-subscriptions__window");!n&&!w&&M(!1)}function I(e){var n,w;return!!((w=(n=c.value)==null?void 0:n.tags)!=null&&w.find(U=>U.id===e))}async function y(){try{s.value=!0;const e=await X.loadPersonalSubscribe();e!=null&&e.success&&(e!=null&&e.data)&&(c.value=e.data,p.value=e.data)}catch(e){throw new Error("vue:PersonalizedSubscriptions | loadPersonalSubscribe ",e)}finally{s.value=!1}}async function W({name:e,value:n}){await d.updateProfileData({[e]:n},!1)}function r(e){const n=I(e)?C.value.filter(w=>w!==e):[...C.value,e];
1v(n)}async function v(e){try{const n=await X.updateSubscribes(e);n!=null&&n.tags&&(c.value=n)}catch(n){throw new Error("vue:PersonalizedSubscriptions | updateSubscribes ",n)}}return ae(()=>{window.addEventListener("mousedown",_),y()}),re(()=>{window.removeEventListener("mousedown",_)}),(e,n)=>{var w,U,Y,j;return o(),l("div",nt,[t("div",{ref_key:"teleportWindowTarget",ref:h,class:"personalized-subscriptions__header"},[t("div",lt,[t("div",rt,[at,t("button",{id:z(H).profileSettingsSubscriptionsTrigger,type:"button",class:R(["personalized-subscriptions__settings base-btn",{"personalized-subscriptions__settings--is-active":f.value}]),"aria-label":"Настройка подписок","aria-expanded":f.value,onClick:O},[m(A,{src:"settings-2"})],10,ct)]),ut,m(xe,{id:z(H).profileSettingsSubscriptions,modelValue:x.value,"onUpdate:modelValue":n[0]||(n[0]=$=>x.value=$),theme:"dark",class:"personalized-subscriptions__header-checkbox"},{default:F(()=>[oe(" Подписаться на e-mail рассылку ")]),_:1},8,["id","modelValue"])])],512),(o(),q($e,{to:"#vue-teleports"},[f.value?(o(),l("div",{key:0,ref_key:"teleportWindow",ref:a,class:"personalized-subscriptions__window",style:ze(z(b)),onClick:n[1]||(n[1]=pe(()=>{},["stop"]))},[t("div",dt,[s.value?(o(),q(_e,{key:0,"into-block":"","is-loading":s.value},null,8,["is-loading"])):(o(),l(G,{key:1},[pt,!((U=(w=p.value)==null?void 0:w.tags)!=null&&U.length)&&!L.value.length?(o(),l("div",_t," список подписок пуст ")):D("",!0),L.value.length?(o(),l("div",ft,[(o(!0),l(G,null,J(L.value,$=>(o(),q(K,{key:`personalized-subscriptions__item-${$.id}`,theme:I($.id)?"light":"light-2-outline",class:"personalized-subscriptions__item",size:"2md",onClick:Z=>r($.id)},{default:F(()=>[t("span",{class:"text-sm",innerHTML:$.name},null,8,vt)]),_:2},1032,["theme","onClick"]))),128))])):D("",!0)],64))])],4)):D("",!0)])),t("div",mt,[(j=(Y=c.value)==null?void 0:Y.tags)!=null&&j.length&&!s.value?(o(),l("div",ht,[(o(!0),l(G,null,J(c.value.tags,$=>(o(),q(K,{key:`personalized-subscriptions__item-${$.id}`,theme:"secondary","no-clickable":"",class:"personalized-subscriptions__item",size:"2md",ellipsis:""},{default:F(()=>[t("span",{class:"text-sm",innerHTML:$.name},null,8,gt)]),_:2},1024))),128))])):s.value?D("",!0):(o(),l("div",bt,[oe(" У Вас нет активных подписок, но Вы можете выбрать их "),t("button",{type:"button",class:"personalized-subscriptions__empty-trigger",onClick:n[2]||(n[2]=$=>M(!0))}," здесь ")]))])])}}};const wt={class:"profile-opportunity-settings__header"},St=["id"],kt={class:"profile-opportunity-settings__body"},zt={key:0,class:"profile-opportunity-settings__list"},$t=["innerHTML"],Pt={class:"profile-opportunity-settings__item-answer text-lg"},Tt=["innerHTML"],xt={key:1,class:"profile-opportunity-settings__empty text-lg"},Ct={class:"profile-opportunity-settings__actions"},Dt={key:0},Et={key:1},Vt=["innerHTML"],Lt={__name:"ProfileOpportunitySettings",props:{wizard:{type:Array,default:()=>[]},opportunityCount:{type:Number,default:0}},setup(g){const d=g,T=P(()=>{var c;const f=Ce(d.opportunityCount,["%value%&nbsp;возможность","%value%&nbsp;возможности","%value%&nbsp;возможностей"]);return d.opportunityCount&&((c=d.wizard)!=null&&c.length)?`Мы нашли для вас ${f}`:""});return(f,c)=>{var p,s,h;return o(),l("div",{class:R(["profile-opportunity-settings",{"profile-opportunity-settings--empty-wizard":!((p=g.wizard)!=null&&p.length)}])},[t("div",wt,[t("h2",{id:z(H).profileSettingsOpportunity,class:"profile-opportunity-settings__title title-md"}," Дополнительные данные ",8,St)]),t("div",kt,[(s=g.wizard)!=null&&s.length?(o(),l("div",zt,[(o(!0),l(G,null,J(g.wizard,(a,b)=>(o(),l("div",{key:`profile-opportunity-settings__item-${a.question}-${b}`,class:"profile-opportunity-settings__item"},[t("div",{class:"profile-opportunity-settings__item-question text-sm color-neutral-500",innerHTML:a.question},null,8,$t),t("div",Pt,[(o(!0),l(G,null,J(a.answers,x=>(o(),l("div",{key:`${x.id}-${a.question}-${b}`,innerHTML:x.label},null,8,Tt))),128))])]))),128))])):(o(),l("div",xt," Пройдите опрос и получите список возможностей! ")),t("div",Ct,[m(K,{id:z(H).profileSettingsOpportunityWizard,href:"/wizard/",theme:(h=g.wizard)!=null&&h.length?"secondary":"dark",class:"profile-opportunity-settings__action"},{default:F(()=>{var a;return[(a=g.wizard)!=null&&a.length?(o(),l("span",Dt,"Изменить ответы")):(o(),l("span",Et,"Пройти опрос"))]}),_:1},8,["id","theme"]),T.value?(o(),q(K,{key:0,href:"/new-opportunities/?group=personal",theme:"dark",class:"profile-opportunity-settings__action"},{default:F(()=>[t("span",{innerHTML:T.value},null,8,Vt)]),_:1})):D("",!0)])])],2)}}};const Mt={class:"profile-page-settings"},Ot={class:"profile-page-settings__inner"},Wt=t("div",{class:"profile-page-settings__back"},[t("div",{class:"container"},[t("a",{href:"/profile/",class:"profile-page-settings__back-link back-link"}," Назад ")])],-1),Ft={class:"container"},Bt={class:"profile-page-settings__content"},At={class:"profile-page-settings__main"},Ht=t("h1",{class:"profile-page-settings__title title-lg"}," Настройки профиля ",-1),It={class:"profile-page-settings__opportunity"},Ut={class:"profile-page-settings__sidebar"},Qt={__name:"ProfilePageSettings",setup(g){const d=ne(),{getProfile:T}=le(d),f=V([]),c=P(()=>{var s,h;return((h=(s=T.value)==null?void 0:s.ngWizardResult)==null?void 0:h.filter(a=>{var b;return((b=a.answers)==null?void 0:b.length)&&a.question}))||[]});async function p(){try{const s=await X.getPersonalOpportunities();s!=null&&s.success&&(s!=null&&s.data)&&Array.isArray(s.data)&&(f.value=s.data)}catch(s){throw new Error("vue:ProfilePageSettings | loadPersonalOpportunities ",s)}}return ae(()=>{p(),d.getAuthServicesData()}),(s,h)=>{var a;return o(),l("div",Mt,[t("div",Ot,[Wt,t("div",Ft,[t("div",Bt,[t("div",At,[Ht,m(it),t("div",It,[m(Lt,{wizard:c.value,"opportunity-count":((a=f.value)==null?void 0:a.length)||0}
1,null,8,["wizard","opportunity-count"])])]),t("aside",Ut,[m(yt)])])])])])}}};export{Qt 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.