import{r,j as e,ax as E,e as I}from"./index-DAC_nvu_.js";const b2=a=>r.createElement("svg",{width:24,height:23,viewBox:"0 0 24 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},r.createElement("path",{d:"M17.5 0.916992C16.3739 0.934507 15.2724 1.24885 14.3067 1.82826C13.341 2.40768 12.5453 3.23166 12 4.21699C11.4546 3.23166 10.6589 2.40768 9.6932 1.82826C8.7275 1.24885 7.62601 0.934507 6.49996 0.916992C4.7049 0.994983 3.01366 1.78025 1.79574 3.10122C0.577818 4.4222 -0.0677922 6.17152 -4.17093e-05 7.96699C-4.17093e-05 12.514 4.78596 17.48 8.79996 20.847C9.69618 21.6001 10.8293 22.013 12 22.013C13.1706 22.013 14.3037 21.6001 15.2 20.847C19.214 17.48 24 12.514 24 7.96699C24.0677 6.17152 23.4221 4.4222 22.2042 3.10122C20.9863 1.78025 19.295 0.994983 17.5 0.916992ZM13.915 19.317C13.3789 19.7684 12.7007 20.0159 12 20.0159C11.2992 20.0159 10.621 19.7684 10.085 19.317C4.94696 15.006 1.99996 10.87 1.99996 7.96699C1.9316 6.70171 2.36632 5.46072 3.20932 4.51469C4.05232 3.56866 5.23519 2.99434 6.49996 2.91699C7.76472 2.99434 8.9476 3.56866 9.7906 4.51469C10.6336 5.46072 11.0683 6.70171 11 7.96699C11 8.23221 11.1053 8.48656 11.2929 8.6741C11.4804 8.86164 11.7347 8.96699 12 8.96699C12.2652 8.96699 12.5195 8.86164 12.7071 8.6741C12.8946 8.48656 13 8.23221 13 7.96699C12.9316 6.70171 13.3663 5.46072 14.2093 4.51469C15.0523 3.56866 16.2352 2.99434 17.5 2.91699C18.7647 2.99434 19.9476 3.56866 20.7906 4.51469C21.6336 5.46072 22.0683 6.70171 22 7.96699C22 10.87 19.053 15.006 13.915 19.313V19.317Z",fill:"#31323A"})),f2="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3070_16244)'%3e%3cpath%20d='M17.5%201.91699C16.3739%201.93451%2015.2724%202.24885%2014.3067%202.82826C13.341%203.40768%2012.5453%204.23166%2012%205.21699C11.4546%204.23166%2010.6589%203.40768%209.6932%202.82826C8.7275%202.24885%207.62601%201.93451%206.49996%201.91699C4.7049%201.99498%203.01366%202.78025%201.79574%204.10122C0.577818%205.4222%20-0.0677922%207.17152%20-4.17093e-05%208.96699C-4.17093e-05%2013.514%204.78596%2018.48%208.79996%2021.847C9.69618%2022.6001%2010.8293%2023.013%2012%2023.013C13.1706%2023.013%2014.3037%2022.6001%2015.2%2021.847C19.214%2018.48%2024%2013.514%2024%208.96699C24.0677%207.17152%2023.4221%205.4222%2022.2042%204.10122C20.9863%202.78025%2019.295%201.99498%2017.5%201.91699ZM13.915%2020.317C13.3789%2020.7684%2012.7007%2021.0159%2012%2021.0159C11.2992%2021.0159%2010.621%2020.7684%2010.085%2020.317C4.94696%2016.006%201.99996%2011.87%201.99996%208.96699C1.9316%207.70171%202.36632%206.46072%203.20932%205.51469C4.05232%204.56866%205.23519%203.99434%206.49996%203.91699C7.76472%203.99434%208.9476%204.56866%209.7906%205.51469C10.6336%206.46072%2011.0683%207.70171%2011%208.96699C11%209.23221%2011.1053%209.48656%2011.2929%209.6741C11.4804%209.86164%2011.7347%209.96699%2012%209.96699C12.2652%209.96699%2012.5195%209.86164%2012.7071%209.6741C12.8946%209.48656%2013%209.23221%2013%208.96699C12.9316%207.70171%2013.3663%206.46072%2014.2093%205.51469C15.0523%204.56866%2016.2352%203.99434%2017.5%203.91699C18.7647%203.99434%2019.9476%204.56866%2020.7906%205.51469C21.6336%206.46072%2022.0683%207.70171%2022%208.96699C22%2011.87%2019.053%2016.006%2013.915%2020.313V20.317Z'%20fill='%23FF4B05'/%3e%3cpath%20d='M13.915%2020.317C13.3789%2020.7684%2012.7007%2021.0159%2012%2021.0159C11.2992%2021.0159%2010.621%2020.7684%2010.085%2020.317C4.94696%2016.006%201.99996%2011.87%201.99996%208.96699C1.9316%207.70171%202.36632%206.46072%203.20932%205.51469C4.05232%204.56866%205.23519%203.99434%206.49996%203.91699C7.76472%203.99434%208.9476%204.56866%209.7906%205.51469C10.6336%206.46072%2011.0683%207.70171%2011%208.96699C11%209.23221%2011.1053%209.48656%2011.2929%209.6741C11.4804%209.86164%2011.7347%209.96699%2012%209.96699C12.2652%209.96699%2012.5195%209.86164%2012.7071%209.6741C12.8946%209.48656%2013%209.23221%2013%208.96699C12.9316%207.70171%2013.3663%206.46072%2014.2093%205.51469C15.0523%204.56866%2016.2352%203.99434%2017.5%203.91699C18.7647%203.99434%2019.9476%204.56866%2020.7906%205.51469C21.6336%206.46072%2022.0683%207.70171%2022%208.96699C22%2011.87%2019.053%2016.006%2013.915%2020.313V20.317Z'%20fill='%23FF4B05'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3070_16244'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",R="_overlay_1tlyo_1",T="_closing_1tlyo_14",A="_modal_1tlyo_19",L="_header_1tlyo_32",H="_title_1tlyo_39",V="_closeButton_1tlyo_46",D="_closeIcon_1tlyo_59",Z="_subtitle_1tlyo_63",q="_chartPanel_1tlyo_68",k="_chartPanelHeader_1tlyo_76",F="_matchBadge_1tlyo_84",G="_matchBadgeIcon_1tlyo_96",U="_chartWrapper_1tlyo_100",W="_legend_1tlyo_111",O="_legendItem_1tlyo_121",X="_legendSwatch_1tlyo_127",z="_legendSwatchCandidate_1tlyo_135",J="_legendSwatchRequired_1tlyo_139",n={overlay:R,closing:T,modal:A,header:L,title:H,closeButton:V,closeIcon:D,subtitle:Z,chartPanel:q,chartPanelHeader:k,matchBadge:F,matchBadgeIcon:G,chartWrapper:U,legend:W,legendItem:O,legendSwatch:X,legendSwatchCandidate:z,legendSwatchRequired:J},B=a=>r.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},r.createElement("g",{clipPath:"url(#clip0_15696_112426)"},r.createElement("path",{d:"M1.4 14H2.8C3.57 14 4.2 13.37 4.2 12.6V11.2C4.2 10.43 3.57 9.8 2.8 9.8H1.4C0.63 9.8 0 10.43 0 11.2L0 12.6C0 13.37 0.63 14 1.4 14Z",fill:"white"}),r.createElement("path",{d:"M6.2999 14H7.6999C8.4699 14 9.0999 13.37 9.0999 12.6V7.7C9.0999 6.93 8.4699 6.3 7.6999 6.3H6.2999C5.5299 6.3 4.8999 6.93 4.8999 7.7V12.6C4.8999 13.37 5.5299 14 6.2999 14Z",fill:"white"}),r.createElement("path",{d:"M11.2 14H12.6C13.37 14 14 13.37 14 12.6V1.4C14 0.63 13.37 0 12.6 0L11.2 0C10.43 0 9.80005 0.63 9.80005 1.4V12.6C9.80005 13.37 10.43 14 11.2 14Z",fill:"white"})),r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_15696_112426"},r.createElement("rect",{width:14,height:14,fill:"white"})))),K="_root_v77fr_1",Q="_gridRing_v77fr_8",Y="_axisLine_v77fr_14",e2="_scaleLabel_v77fr_19",t2="_label_v77fr_29",a2="_areaPrimary_v77fr_35",c2="_areaSecondary_v77fr_41",s2="_badge_v77fr_48",n2="_badgePrimary_v77fr_53",l2="_badgeSecondary_v77fr_57",o2="_badgeText_v77fr_61",r2="_badgeTextPrimary_v77fr_66",d2="_badgeTextSecondary_v77fr_70",d={root:K,gridRing:Q,axisLine:Y,scaleLabel:e2,label:t2,areaPrimary:a2,areaSecondary:c2,badge:s2,badgePrimary:n2,badgeSecondary:l2,badgeText:o2,badgeTextPrimary:r2,badgeTextSecondary:d2},i2=[d.areaPrimary,d.areaSecondary],h2=[d.badgePrimary,d.badgeSecondary],m2=[d.badgeTextPrimary,d.badgeTextSecondary],C=180,_2=196,M=24,P=a=>a*Math.PI/180,f=(a,l)=>{const o=360/l;return-90+o/2+a*o},p=(a,l)=>({x:l*Math.cos(P(a)),y:l*Math.sin(P(a))}),g2=({labels:a,series:l,min:o=0,className:w})=>{const x=Math.max(...l.flatMap(s=>s.values.map(t=>t??o))),_=Math.max(Math.ceil(x),1),S=_-o||1,v=s=>{const t=(s-o)/S;return Math.min(Math.max(t,0),1)*C},y=[];for(let s=1;s<=_;s++)y.push(s);const j=l.map(s=>a.map((t,c)=>p(f(c,a.length),v(s.values[c]??o))));return e.jsxs("svg",{viewBox:"-350 -250 700 500",className:`${d.root} ${w||""}`,role:"img","aria-label":"Диаграмма совместимости",children:[y.map(s=>e.jsx("circle",{className:d.gridRing,cx:0,cy:0,r:C*s/_},`grid-${s}`)),a.map((s,t)=>{const c=p(f(t,a.length),C);return e.jsx("line",{className:d.axisLine,x1:0,y1:0,x2:c.x,y2:c.y},`axis-${t}`)}),y.map(s=>{const t=p(-90,C*s/_);return e.jsx("text",{className:d.scaleLabel,x:0,y:t.y,children:s},`scale-${s}`)}),l.map((s,t)=>e.jsx("polygon",{className:i2[t],points:j[t].map(c=>`${c.x},${c.y}`).join(" ")},`area-${s.key}`)),a.map((s,t)=>{const c=f(t,a.length),i=P(c),h=p(c,_2);let b="middle",g=0,m=0;return Math.cos(i)>.1?(b="start",g=4):Math.cos(i)<-.1&&(b="end",g=-4),Math.sin(i)>.1?m=12:Math.sin(i)<-.1&&(m=-4),e.jsx("text",{x:h.x+g,y:h.y+m,className:`${d.label} body-4`,textAnchor:b,dominantBaseline:"central",children:s},`label-${t}`)}),a.map((s,t)=>{const c=l.map(i=>v(i.values[t]??o));if(c.length===2&&Math.abs(c[0]-c[1])<M){const i=(c[0]+c[1])/2,h=c[0]<=c[1]?-1:1;c[0]=i+h*(M/2),c[1]=i-h*(M/2),c[0]=Math.min(Math.max(c[0],18),C+24),c[1]=Math.min(Math.max(c[1],18),C+24)}return l.map((i,h)=>{const g=(i.values[t]??o).toFixed(1),m=p(f(t,a.length),c[h]),N=Math.max(30,g.length*8+6),$=20;return e.jsxs("g",{children:[e.jsx("rect",{className:`${d.badge} ${h2[h]}`,x:m.x-N/2,y:m.y-$/2,width:N,height:$,rx:4}),e.jsx("text",{className:`${d.badgeText} ${m2[h]} body-4`,x:m.x,y:m.y,children:g})]},`badge-${i.key}-${t}`)})})]})},w2=({competencies:a,onClose:l})=>{const[o,w]=r.useState(!1),x=r.useRef(!1);r.useEffect(()=>{const t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[]);const _=()=>{w(!0),setTimeout(l,300)},S=t=>{t.target===t.currentTarget&&(x.current=!0)},v=t=>{t.target===t.currentTarget&&x.current&&_(),x.current=!1},y=a.competencies.map(t=>t.label),j=a.competencies.map(t=>t.candidateScore),s=a.competencies.map(t=>t.requiredScore);return E.createPortal(e.jsx("div",{className:`${n.overlay} ${o?n.closing:""}`,onMouseDown:S,onMouseUp:v,children:e.jsxs("div",{className:n.modal,children:[e.jsxs("div",{className:n.header,children:[e.jsx("h2",{className:`${n.title} h2`,children:"Диаграмма совместимости"}),e.jsx("button",{className:n.closeButton,onClick:_,children:e.jsx(I,{className:n.closeIcon})})]}),e.jsx("p",{className:`${n.subtitle} body-1`,children:"Сравнение профиля соискателя с требованиями вакансии по выбранным компетенциям"}),e.jsxs("div",{className:n.chartPanel,children:[e.jsxs("div",{className:n.chartPanelHeader,children:[e.jsx("span",{className:"body-3",children:"Совпадение с профилем"}),e.jsxs("span",{className:`h3 ${n.matchBadge}`,children:[e.jsx(B,{className:n.matchBadgeIcon}),Math.round(a.matchPercentage),"%"]})]}),e.jsxs("div",{className:n.chartWrapper,children:[e.jsx(g2,{labels:y,min:a.scale.min,series:[{key:"candidate",values:j},{key:"required",values:s}]}),e.jsxs("div",{className:n.legend,children:[e.jsxs("div",{className:n.legendItem,children:[e.jsx("span",{className:`${n.legendSwatch} ${n.legendSwatchCandidate}`}),e.jsx("span",{className:"body-3",children:"Профиль кандидата"})]}),e.jsxs("div",{className:n.legendItem,children:[e.jsx("span",{className:`${n.legendSwatch} ${n.legendSwatchRequired}`}),e.jsx("span",{className:"body-3",children:"Требования вакансии"})]})]})]})]})]})}),document.body)},C2="_matchBadge_2t4rl_1",x2="_matchText_2t4rl_15",y2="_matchRight_2t4rl_21",p2="_matchPercent_2t4rl_28",u2="_matchPercentIcon_2t4rl_43",u={matchBadge:C2,matchText:x2,matchRight:y2,matchPercent:p2,matchPercentIcon:u2},S2=({percent:a,label:l="Совпадение с профилем",className:o=""})=>e.jsxs("div",{className:`${u.matchBadge} ${o}`,children:[e.jsx("p",{className:`${u.matchText} body-3`,children:l}),e.jsx("div",{className:u.matchRight,children:e.jsxs("span",{className:`${u.matchPercent} h3`,children:[e.jsx(B,{className:u.matchPercentIcon}),a,"%"]})})]});export{w2 as C,S2 as M,b2 as S,f2 as l};