import{l as Qe,b as se,j as e,B as _e,r as i,C as Xe,L as T,m as ye,n as Ke,a as Q,u as Ze,c as Je,p as es,q as ss,s as ts,e as as,t as ns,v as is,V as X,w as cs,A as ls,T as rs,U as ge,o as os,x as ds,y as ms,z as hs}from"./index-qazYPOM_.js";import{S as us}from"./SearchBar-AirayL2g.js";import{l as ps}from"./heart_icon-CNI-J_gl.js";import{l as fs}from"./heart_icon_active-B9yak902.js";import{S as _s}from"./Suggestion-BzeFLwDg.js";import{V as xe,a as je}from"./vacancy-BAHSta_9.js";import{B as gs}from"./BreadcrumbNav-GYSyRF7g.js";import{E as K}from"./ErrorTooltip-CvjJMd6x.js";import{D as Z,s as xs}from"./sort_icon-BDPuiU1G.js";import{I as J}from"./formatters-Be7tCQYY.js";import{N as js}from"./Notification-DUieYXc4.js";import{S as Ns}from"./SEO-BqYEj9ea.js";import"./Skeleton-iZakU_NP.js";const vs=a=>a?new Date(a).toLocaleDateString("ru-RU",{day:"numeric",month:"long"}):"",Ss=(a,l,m="в‚Ѕ")=>{const p={RUB:"в‚Ѕ"}[m]||m,o=h=>{if(typeof h=="number")return h;if(typeof h=="string"){const g=parseInt(h,10);return isNaN(g)?void 0:g}},f=o(a),_=o(l);if(!f&&!_)return"Р·/Рї РЅРµ указана";const S=h=>h.toLocaleString("ru-RU");return f&&_?`${S(f)} - ${S(_)} ${p}`:f?`РѕС‚ ${S(f)} ${p}`:_?`РґРѕ ${S(_)} ${p}`:"Р·/Рї РЅРµ указана"},Cs=a=>a?{EXPERIENCE_UNSPECIFIED:"Опыт РЅРµ указан",EXPERIENCE_WITHOUT:"Нет опыта",EXPERIENCE_1_TO_3_YEARS:"РћС‚ 1 РґРѕ 3 лет",EXPERIENCE_3_TO_6_YEARS:"РћС‚ 3 РґРѕ 6 лет",EXPERIENCE_6_YEARS:"Более 6 лет"}[a]||a:"Опыт РЅРµ указан",Ne=({vacancy:a,applicantId:l,onApplySuccess:m,onLikeToggle:j})=>{var h;const p=Qe(),o=se(),f=p(g=>{g.stopPropagation(),l&&j(a.id,!!a.isLikedByCurrentUser)}),_=p(g=>{g.stopPropagation(),!(a.hasApplied||!l)&&m(a.id)}),S=g=>{g.stopPropagation(),a.chatId?o(`/chats/${a.chatId}`):o("/chats")};return e.jsxs("li",{className:"vacancy__item",id:`vacancy-item-${a.id}`,children:[e.jsxs("div",{className:"vacancy__item-header",children:[e.jsx("a",{href:`/vacancies/detail/${a.id}`,target:"_blank",rel:"noopener noreferrer",className:"vacancy__header-text-link",children:e.jsxs("div",{className:"vacancy__header-text",children:[e.jsx("h3",{className:"vacancy__title h3",children:a.title}),e.jsx("p",{className:"vacancy__subtitle h2",children:Ss(a.salaryFrom,a.salaryTo,a.salaryCurrency)})]})}),e.jsx("button",{className:"icon__button like__button",onClick:f,children:e.jsx("img",{src:a.isLikedByCurrentUser?fs:ps,alt:"Like"})})]}),e.jsxs("div",{className:"vacancy__info",children:[e.jsx("p",{className:"vacancy__city body-3",children:a.city||"Город РЅРµ указан"}),((h=a.company)==null?void 0:h.companyName)&&e.jsx("p",{className:"vacancy__company body-3",children:a.company.companyName}),e.jsx("p",{className:"vacancy__experience body-3",children:Cs(a.workingExperience)})]}),a.coefficient&&a.coefficient>0&&e.jsx(_s,{type:"classic",text:"Рта вакансия РїРѕРґС…РѕРґРёС‚ вам РЅР°",className:"vacancy__item-suggestion",showPlusSign:!1,number:(a.coefficient*100).toFixed(0)}),a.createdAt&&e.jsxs("span",{className:"vacancy__date body-3",children:["Опубликовано ",vs(a.createdAt)]}),a.hasApplied?e.jsx(_e,{className:"vacancy__button",variant:"outlined",onClick:S,children:"Перейти РІ чат"}):e.jsx(_e,{className:"vacancy__button",onClick:_,children:"Откликнуться"})]})},ys="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8470_4439)'%3e%3cpath%20d='M22.8337%201.16666H6.50033C4.9538%201.16852%203.47114%201.78369%202.37758%202.87725C1.28402%203.97081%200.668845%205.45347%200.666992%207L0.666992%2021C0.668845%2022.5465%201.28402%2024.0292%202.37758%2025.1227C3.47114%2026.2163%204.9538%2026.8315%206.50033%2026.8333H22.8337C24.3802%2026.8315%2025.8628%2026.2163%2026.9564%2025.1227C28.05%2024.0292%2028.6651%2022.5465%2028.667%2021V7C28.6651%205.45347%2028.05%203.97081%2026.9564%202.87725C25.8628%201.78369%2024.3802%201.16852%2022.8337%201.16666ZM6.50033%203.5H22.8337C23.5322%203.50137%2024.2144%203.71176%2024.7924%204.1041C25.3704%204.49644%2025.8178%205.05277%2026.077%205.7015L17.1427%2014.637C16.4852%2015.2919%2015.595%2015.6595%2014.667%2015.6595C13.739%2015.6595%2012.8488%2015.2919%2012.1913%2014.637L3.25699%205.7015C3.51617%205.05277%203.96354%204.49644%204.54155%204.1041C5.11955%203.71176%205.80174%203.50137%206.50033%203.5ZM22.8337%2024.5H6.50033C5.57207%2024.5%204.68183%2024.1312%204.02545%2023.4749C3.36907%2022.8185%203.00033%2021.9283%203.00033%2021V8.75L10.5417%2016.2867C11.6367%2017.379%2013.1203%2017.9924%2014.667%2017.9924C16.2137%2017.9924%2017.6973%2017.379%2018.7923%2016.2867L26.3337%208.75V21C26.3337%2021.9283%2025.9649%2022.8185%2025.3085%2023.4749C24.6522%2024.1312%2023.7619%2024.5%2022.8337%2024.5Z'%20fill='%239A9CB0'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8470_4439'%3e%3crect%20width='28'%20height='28'%20fill='white'%20transform='translate(0.666992)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",bs="_overlay_1e881_1",Es="_container_1e881_13",Is="_header_1e881_27",Ts="_title_1e881_36",Fs="_closeButton_1e881_44",ws="_content_1e881_69",A={overlay:bs,container:Es,header:Is,title:Ts,closeButton:Fs,content:ws},Rs=({title:a,onClose:l,children:m})=>{i.useEffect(()=>{const o=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=o}},[]);const j=o=>{o.target===o.currentTarget&&l()},p=o=>{o.stopPropagation()};return e.jsx("div",{className:A.overlay,onClick:j,children:e.jsxs("div",{className:A.container,onClick:p,children:[e.jsxs("div",{className:A.header,children:[e.jsx("h2",{className:A.title,children:a}),e.jsx("button",{className:A.closeButton,onClick:l,children:e.jsx("img",{src:Xe,alt:"close icon"})})]}),e.jsx("div",{className:A.content,children:m})]})})},As="_container_1v0is_12",Ls="_header_1v0is_38",ks="_title_1v0is_47",Ps="_subtitle_1v0is_53",Os="_step_1v0is_59",Ds="_footer_1v0is_84",Vs="_emoji_1v0is_98",Us="_telegramLink_1v0is_125",Bs="_list_1v0is_131",Ms="_sublist_1v0is_132",Gs="_imageGrid_1v0is_146",$s="_image_1v0is_146",Ys="_imageStep4_1v0is_169",Hs="_note_1v0is_186",qs="_metaInfo_1v0is_195",c={container:As,header:Ls,title:ks,subtitle:Ps,step:Os,footer:Ds,emoji:Vs,telegramLink:Us,list:Bs,sublist:Ms,imageGrid:Gs,image:$s,imageStep4:Ys,note:Hs,metaInfo:qs},zs="/static/profile_1-Cnt72SqN.png",Ws="/static/profile_2-Dv2KIMYy.png",Qs="/static/demo_tests-DEox3hfU.png",ve="/static/landing_page-MmU3PXBz.png",Xs="/static/personal_qualities-Cq9tIghO.png",Ks="/static/profile_summary-o5tJbDoT.png",Zs="/static/skills-DT_i7noL.png",Js=()=>e.jsxs("div",{className:c.container,children:[e.jsxs("header",{className:c.header,children:[e.jsx("h2",{className:c.title,children:"🔥 Рнструкция Рє РєРѕРЅРєСѓСЂСЃСѓ «Карьерный Ркспресс РІ ITВ»"}),e.jsx("p",{className:c.subtitle,children:"Если РІС‹ читаете это — значит, РІС‹ СѓР¶Рµ РІ Личном кабинете. Отличный старт! Дальше — РІСЃС‘ просто 👇"})]}),e.jsxs("section",{className:c.step,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"вњ…"}),"Шаг 1. Ознакомьтесь СЃ Положением Рѕ РєРѕРЅРєСѓСЂСЃРµ"]}),e.jsxs("p",{children:["РћРЅРѕ отвечает РЅР° 95% РІРѕРїСЂРѕСЃРѕРІ. Где, РєРѕРіРґР°, зачем, как побеждать — РІСЃС‘ там. Ссылка документ"," ",e.jsx("a",{href:"https://ht-platform.ru/terms",target:"_blank",rel:"noopener noreferrer",children:"ht-platform.ru/terms"})]})]}),e.jsxs("section",{className:c.step,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"вњЌпёЏ"}),"Шаг 2. Заполните Профиль максимально"]}),e.jsxs("p",{children:["Рто важно: РЅР° РѕСЃРЅРѕРІРµ данных профиля строится РїРѕРґР±РѕСЂ вакансий Рё расчёт баллов. Ссылка РЅР° раздел ",e.jsx(T,{to:"/profile",children:"ht-platform.ru/profile"})]}),e.jsx("p",{children:e.jsx("strong",{children:"Обратите внимание:"})}),e.jsxs("ul",{className:c.list,children:[e.jsxs("li",{children:["Р’ разделе В«",e.jsx("strong",{children:e.jsx(T,{to:"/profile/edit/education",children:"Образование"})}),"В» прикрепите ",e.jsx("strong",{children:"фото документа, подтверждающего"}),", что РІС‹ студент или выпускник (справка, диплом, сертификат, зачётка Рё С‚.Рґ.)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Настоятельно рекомендуем"})," пройти демо-версии тестов:",e.jsxs("ul",{className:c.sublist,children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Рнфопрофиль"})," (раздел В«",e.jsx(T,{to:"/profile/edit/characteristics",children:"Личные качества"}),"В»)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Рнфологика"})," (раздел В«",e.jsx(T,{to:"/profile/edit/skills",children:"Знания Рё навыки"}),"В»)"]})]})]})]}),e.jsxs("div",{className:c.imageGrid,children:[e.jsx("img",{src:zs,alt:"Заполнение РѕСЃРЅРѕРІРЅРѕР№ информации профиля",className:c.image}),e.jsx("img",{src:Ws,alt:"Разделы профиля для заполнения",className:c.image}),e.jsx("img",{src:Qs,alt:"Демо-версии профессиональных тестов",className:c.image})]})]}),e.jsxs("section",{className:c.step,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"рџ§ "}),"Шаг 3. Пройдите тест В«Рнфопрофиль»"]}),e.jsxs("p",{className:c.metaInfo,children:[e.jsxs("span",{children:["рџ—“пёЏ ",e.jsx("strong",{children:"Даты:"})," СЃ 18 РїРѕ 26 октября (включительно)"]}),e.jsxs("span",{children:["рџ“Ѓ ",e.jsx("strong",{children:"Раздел:"})," ",e.jsx(T,{to:"/profile/edit/characteristics",children:"Личные качества"})]})]}),e.jsx("p",{children:"Рто обязательный этап. РћРЅ помогает понять ваши сильные стороны, мотивацию Рё ценности. РџРѕ результатам будет рассчитан процент совпадения СЃ вакансиями."}),e.jsxs("div",{className:c.imageGrid,children:[e.jsx("img",{src:ve,alt:"Главная страница РєРѕРЅРєСѓСЂСЃР°",className:c.image}),e.jsx("img",{src:Xs,alt:"Раздел личные качества",className:c.image})]}),e.jsxs("p",{className:c.note,children:[e.jsx("strong",{children:"Р’РќРРњРђРќРР•:"})," последующие скриншоты Р±СѓРґСѓС‚ детализированы, РєРѕРіРґР° актуальные (зачетные) версии конкурсных тестов появятся РІ вашем Личном кабинете."]})]}),e.jsxs("section",{className:c.step,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"рџ’Ў"}),"Шаг 4. Промежуточный итог"]}),e.jsxs("p",{children:["Р’ течение нескольких дней после прохождения В«Рнфопрофиля» РІС‹ увидите, насколько ваш профиль соответствует каждой РёР· вакансий РІ разделе ",e.jsx(T,{to:"/vacancies",children:"Вакансии"}),"."]}),e.jsxs("p",{children:["рџ’Ў Р’ зачёт идёт ",e.jsx("strong",{children:"наивысший процент совпадения"}),", даже если РІС‹ РЅРµ откликались РЅР° вакансию."]}),e.jsx("div",{className:c.imageGrid,children:e.jsx("img",{src:Ks,alt:"РЎРІРѕРґРєР° РїРѕ заполненности профиля",className:c.imageStep4})})]}),e.jsxs("section",{className:c.step,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"рџ“ќ"}),"Шаг 5. Пройдите квалификационный тест В«Рнфологика»"]}),e.jsxs("p",{className:c.metaInfo,children:[e.jsxs("span",{children:["рџ—“пёЏ ",e.jsx("strong",{children:"Дата:"})," 26 октября СЃ 14:00 РґРѕ 16:00 (РїРѕ РњРЎРљ)"]}),e.jsxs("span",{children:["рџ“Ѓ ",e.jsx("strong",{children:"Раздел:"})," ",e.jsx(T,{to:"/profile/edit/skills",children:"Знания Рё навыки"})]})]}),e.jsx("p",{children:"Рто финальный онлайн-этап. Победители выйдут РІ очный финал РІ РњРѕСЃРєРІРµ."}),e.jsxs("div",{className:c.imageGrid,children:[e.jsx("img",{src:ve,alt:"Главная страница РєРѕРЅРєСѓСЂСЃР°",className:c.image}),e.jsx("img",{src:Zs,alt:"Раздел знания Рё навыки",className:c.image})]})]}),e.jsxs("section",{className:c.step,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"рџ“І"}),"Шаг 6. Следите Р·Р° новостями"]}),e.jsxs("p",{children:["Р’СЃРµ важные обновления — РІ нашем Telegram-чате:",e.jsx("br",{}),e.jsx("a",{href:"https://t.me/ht_platform",target:"_blank",rel:"noopener noreferrer",className:c.telegramLink,children:"👉 https://t.me/ht_platform"})]})]}),e.jsxs("footer",{className:`${c.step} ${c.footer}`,children:[e.jsxs("h3",{children:[e.jsx("span",{className:c.emoji,children:"рџ¤ќ"}),"Поддержка"]}),e.jsxs("p",{children:["Если что-то РЅРµ работает или остались РІРѕРїСЂРѕСЃС‹ — напишите нам РїСЂСЏРјРѕ РІ чат РЅР° сайте или РІ Telegram"," ",e.jsx("a",{href:"https://t.me/alexxkirin",target:"_blank",rel:"noopener noreferrer",children:"@alexxkirin"}),"."]})]})]}),Se=({viewsCount:a=0,appliesCount:l=0})=>{const m=se(),j=ye(),[p,o]=i.useState(!1),f=()=>{const g=new URLSearchParams(j.search);g.delete("tab");const b=g.toString();return b?`?${b}`:""},_=()=>{m(`/vacancies/viewed${f()}`)},S=()=>{m(`/vacancies/applied${f()}`)},h=()=>o(!1);return e.jsxs(e.Fragment,{children:[p&&e.jsx(Rs,{title:"Рнструкция Рє РєРѕРЅРєСѓСЂСЃСѓ «Карьерный Ркспресс РІ ITВ»",onClose:h,children:e.jsx(Js,{})}),e.jsx("div",{className:"vacancy__aside",children:e.jsxs("div",{className:"vacancy__aside-links",children:[e.jsxs("div",{className:"vacancy__aside-container",onClick:_,children:[e.jsxs("div",{className:"vacancy__aside-data",children:[e.jsx("span",{className:"vacancy__count",children:a}),e.jsx("p",{className:"vacancy__category",children:"Просмотры"})]}),e.jsx("img",{className:"vacancy__icon",src:Ke,alt:"Eye Icon"})]}),e.jsxs("div",{className:"vacancy__aside-container",onClick:S,children:[e.jsxs("div",{className:"vacancy__aside-data",children:[e.jsx("span",{className:"vacancy__count",children:l}),e.jsx("p",{className:"vacancy__category",children:"Отклики"})]}),e.jsx("img",{className:"vacancy__icon",src:ys,alt:"Envelope Icon"})]})]})})]})},ee=[{value:"FILTER_SORTING_UNSPECIFIED",label:"РџРѕ соответствию"},{value:"FILTER_SORTING_BY_DATE",label:"РџРѕ дате изменения"},{value:"FILTER_SORTING_BY_SALARY_DESC",label:"РџРѕ убыванию зарплаты"},{value:"FILTER_SORTING_BY_SALARY_ASC",label:"РџРѕ возрастанию зарплаты"}],Ce=[...ee,{value:"COEFFICIENT_DESC",label:"РџРѕ убыванию % совместимости"},{value:"COEFFICIENT_ASC",label:"РџРѕ возрастанию % совместимости"}],et=(a=768)=>{const[l,m]=i.useState(window.innerWidth<a);return i.useEffect(()=>{const j=()=>m(window.innerWidth<a);return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[a]),l};function ft(){const{isAuthenticated:a,userId:l}=Q(s=>s.auth),{vacancies:m,totalCount:j,isLoading:p,isFetchingMore:o,error:f,nextPageToken:_,hasMore:S,compatibleVacancies:h,isLoadingCompatible:g}=Q(s=>s.vacancy),{coefficients:b}=Q(s=>s.user),N=Ze(),{filterType:r}=Je(),F=se(),I=ye(),E=et(),[v,be]=i.useState({}),[L,te]=i.useState(""),[Ee,V]=i.useState([]),[ae,U]=i.useState(0),[ne,P]=i.useState(0),[O,B]=i.useState(!0),[M,ie]=i.useState(!1),[Ie,ce]=i.useState(!1),[G,Te]=i.useState("all"),[$,Fe]=i.useState("all"),[Y,we]=i.useState(!1),D=i.useMemo(()=>new URLSearchParams(I.search),[I.search]),Re=D.get("tab")==="compatible"?"compatible":"all",Ae=D.get("sorting")||"FILTER_SORTING_UNSPECIFIED",[d,le]=i.useState(Re),[C,w]=i.useState(Ae),H=i.useRef(null),re=i.useRef(0);i.useEffect(()=>{window.scrollTo(0,0)},[r]),i.useEffect(()=>{const s=D.get("tab")==="compatible"?"compatible":"all";s!==d&&le(s)},[D,d]),i.useEffect(()=>{if(d==="all"){const s=v.sorting;s&&s!==C?w(s):!s&&C!=="FILTER_SORTING_UNSPECIFIED"&&w("FILTER_SORTING_UNSPECIFIED")}},[v.sorting,d]),i.useEffect(()=>{d==="compatible"&&!C&&w("FILTER_SORTING_UNSPECIFIED")},[d,C]);const R=es(L,500);ss(M),i.useEffect(()=>{const s=new URLSearchParams(I.search),t={},n=["workingExperience","workingSchedule","officeType"],u=new Set;s.forEach((y,W)=>u.add(W)),u.forEach(y=>{y!=="tab"&&(t[y]=n.includes(y)?s.getAll(y):s.get(y))}),be(t),we(!0)},[I.search]),i.useEffect(()=>{te(v.searchField||"")},[v.searchField]),i.useEffect(()=>{l&&(N(ts(l)),N(as(l)))},[l,N]),i.useEffect(()=>{l&&b&&N(ns({applicantId:l,coefficients:b}))},[b,l,N]);const oe=i.useMemo(()=>b?m.map(s=>({...s,coefficient:b[s.id]})):m,[m,b]),de=i.useMemo(()=>{const s=[...h];switch(C){case"COEFFICIENT_DESC":return s.sort((t,n)=>(n.coefficient||0)-(t.coefficient||0));case"COEFFICIENT_ASC":return s.sort((t,n)=>(t.coefficient||0)-(n.coefficient||0));case"FILTER_SORTING_BY_SALARY_DESC":return s.sort((t,n)=>(Number(n.salaryFrom)||0)-(Number(t.salaryFrom)||0));case"FILTER_SORTING_BY_SALARY_ASC":return s.sort((t,n)=>(Number(t.salaryFrom)||0)-(Number(n.salaryFrom)||0));case"FILTER_SORTING_BY_DATE":return s.sort((t,n)=>{const u=new Date(t.updatedAt||t.createdAt||"").getTime();return new Date(n.updatedAt||n.createdAt||"").getTime()-u});case"FILTER_SORTING_UNSPECIFIED":default:return s.sort((t,n)=>(n.coefficient||0)-(t.coefficient||0))}},[h,C]),me=i.useMemo(()=>Object.entries(v).reduce((s,[t,n])=>n==null||n===""?s:t==="sorting"?n!=="FILTER_SORTING_UNSPECIFIED"?s+1:s:Array.isArray(n)?s+n.length:s+1,0),[v]);i.useEffect(()=>{!Y||r==="filter"||N(is({filters:v,applicantId:l,filterType:r,selectedViews:G,selectedResponse:$}))},[N,v,l,r,G,$,Y]),i.useEffect(()=>{var s;!r&&!E&&((s=document.querySelector(".vacancy__search-field input"))==null||s.focus())},[r,E]),i.useEffect(()=>{(async()=>{if(R.trim().length<2){V([]);return}try{const[t,n,u]=await Promise.all([ge.fetchAvailableSkills(R),ge.fetchAvailablePersonalQualities(R),X.fetchVacancies({searchField:R,pageSize:5})]),y=t.slice(0,3).map(x=>({label:x.skillName,value:x.id})),W=n.slice(0,3).map(x=>({label:x.qualityName,value:x.id})),ze=R.toLowerCase(),We=Array.from(new Set((u.vacancies||[]).map(x=>x.title).filter(x=>typeof x=="string"&&x.toLowerCase().includes(ze)))).map(x=>({label:x,value:x}));V([...We,...y,...W])}catch(t){console.error("Error fetching suggestions:",t),V([])}})()},[R]),i.useEffect(()=>{if(!l){U(0),P(0),B(!1);return}B(!0),Promise.all([X.fetchViewedVacancies(l),X.fetchApplicantResponses(l)]).then(([s,t])=>{U(s.length),P(t.length)}).catch(s=>{console.error("Failed to fetch aside counts:",s),U(0),P(0)}).finally(()=>B(!1))},[l]);const q=i.useCallback(()=>{const s=document.documentElement.scrollTop,t=s>re.current;if(re.current=s<=0?0:s,!t||o||!S||!_||r||d!=="all")return;const n=document.documentElement.scrollHeight,u=document.documentElement.clientHeight;s+u>=n-300&&N(cs({filters:v,pageToken:_,applicantId:l}))},[o,_,N,v,l,r,d,S]);i.useEffect(()=>(window.addEventListener("scroll",q),()=>window.removeEventListener("scroll",q)),[q]);const Le=s=>te(s),he=s=>{const t=typeof s=="string"?s:s.label,n=new URLSearchParams(I.search);t?n.set("searchField",t):n.delete("searchField"),F({search:n.toString()})},ke=()=>{const s=new URLSearchParams(I.search);L&&s.set("searchField",L),E?ie(!0):F({pathname:"/vacancies/filter",search:s.toString()})},z=()=>{ce(!0),setTimeout(()=>{ie(!1),ce(!1)},300)},ue=s=>{const t=new URLSearchParams;Object.entries(s).forEach(([n,u])=>{Array.isArray(u)?u.forEach(y=>t.append(n,y)):u&&t.set(n,u)}),E&&z(),F({pathname:"/vacancies",search:t.toString()})},pe=s=>{l&&N(hs({vacancyId:s,applicantId:l})).unwrap().then(()=>P(t=>t+1)).catch(t=>console.error("Failed to apply:",t))},fe=(s,t)=>{l&&N(t?ds({vacancyId:s,applicantId:l}):ms({vacancyId:s,applicantId:l}))},Pe=s=>{r==="filter"&&H.current&&(s.preventDefault(),H.current.applyFilters())},Oe=s=>{if(s==="compatible"&&!a){N(os("auth"));return}le(s);const t=new URLSearchParams(I.search);s==="compatible"?(t.set("tab","compatible"),t.delete("sorting"),C.startsWith("COEFFICIENT")||w("FILTER_SORTING_UNSPECIFIED")):(t.delete("tab"),C.startsWith("COEFFICIENT")&&(t.delete("sorting"),w("FILTER_SORTING_UNSPECIFIED"))),F({search:t.toString()},{replace:!0})},De=s=>{const t=String(s);if(w(t),d==="all"){const n=new URLSearchParams(I.search);t==="FILTER_SORTING_UNSPECIFIED"?n.delete("sorting"):n.set("sorting",t),F({search:n.toString()})}},Ve=i.useMemo(()=>{const t=(d==="compatible"?Ce:ee).find(n=>n.value===C);return t?t.label:"РџРѕ соответствию"},[C,d]),k=r?{viewed:"Просмотры",applied:"Отклики",liked:"Рзбранное",filter:"Фильтры"}[r]:null,Ue=i.useMemo(()=>{let s="Вакансии";return k?s+=` - ${k}`:d==="compatible"&&(s+=" - РџРѕ совместимости"),s},[k,d]),Be=r?[{label:"Вакансии",href:"/vacancies",onClick:Pe},{label:k,isCurrent:!0}]:[],Me=[{value:"all",label:"Р’СЃРµ просмотры"},{value:"today",label:"Сегодня"},{value:"week",label:"Р—Р° неделю"}],Ge=[{value:"all",label:"Р’СЃРµ отклики"},{value:"viewed",label:"Просмотрен"},{value:"not_viewed",label:"РќРµ просмотрен"},{value:"rejected",label:"Отказ"}],$e=()=>{const s={viewed:{title:"Нет просмотренных вакансий",message:"Р’С‹ ещё РЅРµ просматривали РЅРё РѕРґРЅРѕР№ вакансии."},applied:{title:"Нет откликов",message:"Р’С‹ ещё РЅРµ откликались РЅР° вакансии."},liked:{title:"Нет избранных вакансий",message:"Р’С‹ ещё РЅРµ добавляли вакансии РІ избранное."},filtered:{title:"Вакансии РЅРµ найдены",message:"РџРѕ вашему запросу ничего РЅРµ найдено. Попробуйте изменить фильтры."},default:{title:"Вакансии РїРѕРєР° отсутствуют",message:"Вакансии Р±СѓРґСѓС‚ добавлены 18.10.2025, Рё Сѓ вас будет возможность СЃ РЅРёРјРё ознакомиться Рё откликнуться. РџРѕРєР° РІС‹ можете заполнить информацию Рѕ себе РІ разделе Профиль. Там Р¶Рµ РјРѕР¶РЅРѕ ознакомиться СЃ тестами."}};let t="default";r&&s[r]?t=r:!r&&me>0&&(t="filtered");const{title:n,message:u}=s[t];return e.jsx(K,{title:n,message:u})},Ye=!M&&r||r&&!E,He=()=>e.jsx(e.Fragment,{children:oe.length>0?e.jsx("ul",{className:"vacancy__list",children:oe.map(s=>e.jsx(Ne,{vacancy:s,applicantId:l,onApplySuccess:pe,onLikeToggle:fe},s.id))}):e.jsx("div",{className:"vacancy__list",children:$e()})}),qe=()=>e.jsx(e.Fragment,{children:g?e.jsx("ul",{className:"vacancy__list",children:Array.from({length:3}).map((s,t)=>e.jsx(je,{},t))}):de.length>0?e.jsxs(e.Fragment,{children:[e.jsx(js,{type:"accent",className:"compatibility-notification",children:"Вакансии РЅРёР¶Рµ имеют процент совместимости персонально для вас. Чем выше %, тем больше вам РїРѕРґС…РѕРґСЏС‚ эти вакансии согласно вашим личным качествам, мотивационным Рё ценностным ожиданиям РѕС‚ будущей работы."}),e.jsx("ul",{className:"vacancy__list",children:de.map(s=>e.jsx(Ne,{vacancy:s,applicantId:l,onApplySuccess:pe,onLikeToggle:fe},s.id))})]}):e.jsx("div",{className:"vacancy__list",children:e.jsx(K,{title:"Нет подходящих вакансий",message:"РњС‹ РЅРµ смогли найти вакансии, которые соответствуют вашему профилю. Попробуйте пройти тесты или заполнить профиль."})})});return e.jsxs(e.Fragment,{children:[e.jsx(Ns,{title:Ue,description:"Найти работу РІ лучших компаниях без резюме. Сервис подберет вакансии персонально для вас РїРѕ совместимости ценностей Рё ожиданий РѕС‚ будущей работы.",canonicalUrl:"/vacancies",type:"website"}),e.jsxs("div",{className:"vacancy",children:[Ye&&e.jsx(gs,{className:"vacancy__breadcrumbnav",items:Be,mobile:!1}),a&&!r&&e.jsx(Se,{viewsCount:O?0:ae,appliesCount:O?0:ne}),!r&&e.jsx("div",{className:"vacancy__search-field",children:e.jsx(us,{type:"forward",placeholder:"Название, навык или качество",filter:"display",onSearch:()=>he(L),value:L,onInputValueChange:Le,onFilterClick:ke,suggestions:Ee,onSuggestionSelect:he,filterCount:me,allowClear:!0})}),e.jsxs("div",{className:"main",children:[e.jsxs("div",{className:"vacancy__container",children:[(r||!E)&&e.jsx("div",{className:"vacancy__container-header",children:r&&r!=="filter"?e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"/vacancies",className:"vacancy__container-header-icon",onClick:s=>{s.preventDefault(),F("/vacancies")},children:e.jsx("img",{src:ls,alt:"Назад"})}),e.jsx("h1",{className:"vacancy__container-title h1",children:k}),e.jsx("span",{className:"vacancy__count-filter body-3",children:p?0:j}),!E&&r==="viewed"&&e.jsx(Z,{buttonText:"Фильтр",position:"right",className:"vacancy__filter-dropdownbutton",children:e.jsx(J,{name:"views",options:Me,value:G,onChange:s=>Te(String(s))})}),!E&&r==="applied"&&e.jsx(Z,{buttonText:"Фильтр",position:"right",className:"vacancy__filter-dropdownbutton",children:e.jsx(J,{name:"responses",options:Ge,value:$,onChange:s=>Fe(String(s))})})]}):null}),!r&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"vacancy__container-title h1",children:"Вакансии"}),e.jsxs("div",{className:"toggletab__container-vacancy",children:[e.jsx(rs,{items:[{id:"all",label:"Р’СЃРµ",count:j},{id:"compatible",label:"РџРѕ совместимости",count:a?h.length:0}],activeTab:d,onTabChange:Oe}),e.jsx(Z,{buttonText:Ve,position:E?"left":"right",icon:e.jsx("img",{src:xs,alt:"Сортировка"}),children:e.jsx(J,{name:"vacanciesSort",options:d==="compatible"?Ce:ee,value:C,onChange:De})})]})]}),r==="filter"?e.jsx(xe,{ref:H,onApplyFilters:ue,initialFilters:v}):p||!Y?e.jsx("ul",{className:"vacancy__list",children:Array.from({length:5}).map((s,t)=>e.jsx(je,{},t))}):f?e.jsx("ul",{className:"vacancy__list",children:e.jsx(K,{message:f})}):d==="all"?He():qe()]}),a&&!r&&e.jsx(Se,{viewsCount:O?0:ae,appliesCount:O?0:ne})]}),M&&e.jsx("div",{className:"mobile-filter-overlay",onClick:z,children:e.jsx("div",{className:`mobile-filter-sheet ${Ie?"closing":""}`,onClick:s=>s.stopPropagation(),children:e.jsx(xe,{isMobileView:!0,onApplyFilters:ue,onCloseMobileView:z,initialFilters:v})})})]})]})}export{ft as VacancyPage};