1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2707],{32707:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var r,i=n(37876),l=n(14232),o=n(37626),a=n(36139),s=n(62426),d=n.n(s),c=n(59506),u=n(95855);let p="#264a6c",x=[null!=(r=null===d()||void 0===d()?void 0:d().default)?r:d()],f={components:{table:e=>(0,i.jsx)("table",{style:{borderCollapse:"collapse",width:"100%",fontSize:"12px",marginTop:"4px"},...e}),th:e=>(0,i.jsx)("th",{style:{border:"1px solid #cbd5e1",padding:"4px 8px",background:"#e2e8f0",textAlign:"left"},...e}),td:e=>(0,i.jsx)("td",{style:{border:"1px solid #cbd5e1",padding:"4px 8px"},...e}),ul:e=>(0,i.jsx)("ul",{style:{listStyleType:"disc",paddingLeft:"20px",margin:"4px 0"},...e}),ol:e=>(0,i.jsx)("ol",{style:{listStyleType:"decimal",paddingLeft:"20px",margin:"4px 0"},...e}),li:e=>(0,i.jsx)("li",{style:{marginBottom:"2px"},...e})}};function g(e){let{text:t}=e,[n,r]=(0,a.qy)({remarkPlugins:x,rehypeReactOptions:f});return(0,l.useEffect)(()=>{r(t||"")},[t,r]),n}let b=e=>{let{userId:t,autoOpenJobId:n,autoOpenKey:r}=e,{i18n:a}=(0,o.B)(),[s,d]=(0,l.useState)(!1),[x,f]=(0,l.useState)([]),[b,h]=(0,l.useState)(!1),[m,y]=(0,l.useState)(null),[S,v]=(0,l.useState)([]),[j,k]=(0,l.useState)(""),[_,w]=(0,l.useState)(!1),[I,T]=(0,l.useState)({}),[z,C]=(0,l.useState)(!1),[R,E]=(0,l.useState)([]),O=(0,l.useRef)(null),B=(0,l.useRef)(!1),N=(0,l.useRef)(null),W=(0,l.useRef)(!1),A=(0,l.useRef)(!1),H=(0,l.useRef)(0),F=(0,l.useRef)(null);(0,l.useEffect)(()=>{s&&!B.current&&(B.current=!0,h(!0),(0,u.FH)("v2/job/?filter=myVacancies&page=1&limit=100",null,"get",!0).then(e=>f(((null==e?void 0:e.data)||[]).filter(e=>e.isPublished))).catch(()=>{}).finally(()=>h(!1)))},[s]),(0,l.useEffect)(()=>{var e;null==(e=O.current)||e.scrollIntoView({behavior:"smooth"})},[S]);let L=(0,l.useCallback)(e=>{let n;if(!t)return null;let r="matchbot_session_".concat(t,"_").concat(e);try{n=localStorage.getItem(r)}catch(e){}if(!n){n="mb-".concat(e,"-").concat(t,"-").concat(Date.now());try{localStorage.setItem(r,n)}catch(e){}}return n},[t]);(0,l.useEffect)(()=>{if(r){try{if(sessionStorage.getItem("matchbot_user_closed")===String(r))return;sessionStorage.removeItem("matchbot_user_closed")}catch(e){}d(!0),y(null),B.current=!0,h(!0),(0,u.FH)("v2/job/?filter=myVacancies&page=1&limit=100",null,"get",!0).then(e=>f(((null==e?void 0:e.data)||[]).filter(e=>e.isPublished))).catch(()=>{}).finally(()=>h(!1))}},[r]),(0,l.useEffect)(()=>{if(!n||!s||!x.length||m)return;let e=x.find(e=>String(e.id)===String(n));if(!e)return;let t=L(String(e.id));N.current=t,y(e),E([]);try{let e=localStorage.getItem("matchbot_msgs_".concat(t)),n=e?JSON.parse(e):[],r=Array.isArray(n)?n:[];v(r),0===r.length&&(A.current=!0)}catch(e){v([]),A.current=!0}try{let e=sessionStorage.getItem("matchbot_labels_".concat(t));e&&T(JSON.parse(e))}catch(e){}},[n,s,x,m,L]),(0,l.useEffect)(()=>{let e=N.current;if(e&&0!==Object.keys(I).length)try{sessionStorage.setItem("matchbot_labels_".concat(e),JSON.stringify(I))}catch(e){}},[I]),(0,l.useEffect)(()=>{m&&A.current&&(A.current=!1,P("__start__",{silent:!0}))},[m]),(0,l.useEffect)(()=>{if(m){let e=N.current;if(e)try{localStorage.setItem("matchbot_msgs_".concat(e),JSON.stringify(S.filter(e=>!e.isError)))}catch(e){}}},[S,m]);let P=async function(e){let{silent:t=!1,isRetry:n=!1,isPoll:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null!=e?e:j.trim();if(!m||!i||W.current&&!n&&!r)return;t||(clearTimeout(F.current),F.current=null);let l=N.current;if(!l)return;e||k(""),E([]),t||v(e=>[...e,{role:"user",text:i}]),W.current=!0,w(!0);let o=!1;try{var s,d,c,p,x,f,g,b,h,y;let e=await (0,u.FH)("v2/matchbot/session",{session_id:l,job_id:m.id,message:i,ui_language:a.language||"nl",...m.matchbotConfigId?{config_id:String(m.matchbotConfigId)}:{}},"post",!0);if((null==e||null==(s=e.data)?void 0:s.polling)&&(null==e||null==(d=e.data)?void 0:d.needs_continue)){o=!0,clearTimeout(F.current),F.current=setTimeout(()=>P("ok",{silent:!0,isPoll:!0}),15e3);return}H.current=0;let t=(null==e||null==(c=e.data)?void 0:c.reply)||"No response received.",n=(null==e||null==(p=e.data)?void 0:p.cards)||null;if(v(e=>[...e,{role:"assistant",text:t,cards:n}]),E((null==e||null==(x=e.data)?void 0:x.quick_replies)||[]),n&&(T({}),C(!1)),(null==e||null==(f=e.data)?void 0:f.intake_config)&&(null==m?void 0:m.matchbotConfigId))try{await (0,u.FH)("v2/matchbot/config/".concat(m.matchbotConfigId,"/versions"),{matchConfig:e.data.intake_config},"post",!0)}catch(e){}if((null==e||null==(g=e.data)?void 0:g.calibration_config)&&(null==m?void 0:m.matchbotConfigId))try{let{match_config:t,notes:n}=e.data.calibration_config;await (0,u.FH)("v2/matchbot/config/".concat(m.matchbotConfigId,"/versions"),{matchConfig:t,notes:n},"post",!0)}catch(e){}!n&&!(null==e||null==(b=e.data)?void 0:b.intake_config)&&!(null==e||null==(h=e.data)?void 0:h.calibration_config)&&((null==e||null==(y=e.data)?void 0:y.needs_continue)||/ronde\s+\d+\s+van\s+\d+/i.test(t))&&(clearTimeout(F.current),F.current=setTimeout(()=>P("ok",{silent:!0}),9e4))}catch(e){r?(H.current+=1,H.current>=6?(H.current=0,v(e=>[...e,{role:"assistant",text:"en"===a.language?"Something went wrong. Please try again.":"Er ging iets mis. Probeer het opnieuw.",isError:!0}])):(o=!0,clearTimeout(F.current),F.current=setTimeout(()=>P("ok",{silent:!0,isPoll:!0}),2e4))):n?(H.current+=1,H.current>=6?(H.current=0,v(e=>[...e,{role:"assistant",text:"en"===a.language?"Something went wrong. Please try again.":"Er ging iets mis. Probeer het opnieuw.",isError:!0}])):(o=!0,clearTimeout(F.current),F.current=setTimeout(()=>P("ok",{silent:!0,isPoll:!0}),2e4))):(o=!0,clearTimeout(F.current),F.current=setTimeout(()=>P(i,{silent:!0,isRetry:!0}),15e3))}finally{o||(W.current=!1,w(!1))}},M=async()=>
1{if(0===Object.keys(I).length||z)return;C(!0);let e={...I};v(t=>{let n=t.map(e=>!!e.cards).lastIndexOf(!0);return -1===n?t:t.map((t,r)=>r===n?{...t,labelsSubmitted:!0,submittedLabels:e}:t)});let t="[LABELS] ".concat(JSON.stringify(I));T({});try{sessionStorage.removeItem("matchbot_labels_".concat(N.current))}catch(e){}await P(t)},D=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),P())};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{onClick:()=>{try{sessionStorage.removeItem("matchbot_user_closed")}catch(e){}d(e=>!e)},title:"Open Matchbot",style:{position:"fixed",bottom:"24px",right:"24px",width:"52px",height:"52px",borderRadius:"50%",background:p,color:"#fff",border:"none",fontSize:"12px",fontWeight:700,cursor:"pointer",boxShadow:"0 4px 16px rgba(0,0,0,0.25)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",letterSpacing:"0.5px"},children:"MB"}),s&&(0,i.jsxs)("div",{style:{position:"fixed",bottom:"84px",right:"24px",width:"520px",maxHeight:"600px",display:"flex",flexDirection:"column",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"12px",boxShadow:"0 12px 40px rgba(0,0,0,0.18)",zIndex:10001,overflow:"hidden"},children:[(0,i.jsxs)("div",{style:{background:p,color:"#fff",padding:"14px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{fontWeight:700,fontSize:"14px"},children:"Matchbot"}),(0,i.jsx)("div",{style:{fontSize:"11px",opacity:.8,marginTop:"1px"},children:"AI-powered candidate matching"})]}),(0,i.jsx)("button",{onClick:()=>{try{sessionStorage.setItem("matchbot_user_closed",String(r||"1"))}catch(e){}d(!1)},style:{background:"none",border:"none",color:"#fff",cursor:"pointer",fontSize:"20px",lineHeight:1,padding:"0 2px",opacity:.8},children:"\xd7"})]}),(0,i.jsx)("div",{style:{padding:"10px 12px",borderBottom:"1px solid #f1f5f9",flexShrink:0},children:b?(0,i.jsx)("div",{style:{textAlign:"center",padding:"6px"},children:(0,i.jsx)(c.A,{size:"sm",color:"primary"})}):(0,i.jsxs)("select",{style:{width:"100%",padding:"7px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"13px",outline:"none",background:"#fff",color:"#334155"},value:(null==m?void 0:m.id)||"",onChange:e=>{clearTimeout(F.current),F.current=null;let t=e.target.value,n=x.find(e=>String(e.id)===t)||null;if(y(n),k(""),E([]),n){let e=L(String(n.id));N.current=e;try{let t=localStorage.getItem("matchbot_msgs_".concat(e)),n=t?JSON.parse(t):[],r=Array.isArray(n)?n:[];v(r),A.current=0===r.length}catch(e){v([]),A.current=!0}}else N.current=null,v([]),A.current=!1},disabled:_,children:[(0,i.jsx)("option",{value:"",children:"Select a vacancy..."}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.title},e.id))]})}),(0,i.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px",minHeight:"200px",maxHeight:"400px"},children:[0===S.length&&(0,i.jsx)("p",{style:{color:"#94a3b8",fontSize:"13px",textAlign:"center",marginTop:"30px"},children:m?"Ask Matchbot about candidates for this vacancy.":"Select a vacancy to start."}),S.map((e,t)=>{let n=e.cards&&t===S.map(e=>!!e.cards).lastIndexOf(!0);return(0,i.jsxs)("div",{style:"user"===e.role?{alignSelf:"flex-end",background:p,color:"#fff",padding:"8px 12px",borderRadius:"12px 12px 0 12px",fontSize:"13px",maxWidth:"80%",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.5}:{alignSelf:"flex-start",background:"#f1f5f9",color:"#1e293b",padding:"8px 12px",borderRadius:"12px 12px 12px 0",fontSize:"13px",maxWidth:"92%",wordBreak:"break-word",lineHeight:1.5},children:["assistant"===e.role?(0,i.jsx)(g,{text:e.text}):e.text,e.cards&&(0,i.jsxs)("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"6px"},children:[(()=>{let t=["top","middle","bottom"],r={top:(a.language,"\uD83C\uDFC6 Top 3 matches"),middle:"en"===a.language?"âï¸ Middle range":"âï¸ Middenmoot",bottom:"en"===a.language?"\uD83D\uDCCA Lower matches":"\uD83D\uDCCA Lager scorend"},l=[...e.cards].sort((e,n)=>t.indexOf(e.tier||"top")-t.indexOf(n.tier||"top")),o=[],s=null;return l.forEach((t,l)=>{var d;t.tier&&t.tier!==s&&(s=t.tier,o.push((0,i.jsx)("div",{style:{fontSize:"10px",fontWeight:700,color:"#64748b",marginTop:0===l?"2px":"6px",marginBottom:"2px",textTransform:"uppercase",letterSpacing:"0.06em"},children:r[t.tier]||t.tier},"tier-".concat(t.tier)))),o.push((0,i.jsxs)("div",{style:{background:"#fff",border:"1px solid #e2e8f0",borderRadius:"8px",padding:"8px",fontSize:"12px"},children:[(0,i.jsx)("div",{style:{fontSize:"10px",color:"#94a3b8",marginBottom:"1px"},children:"en"===a.language?"Most recent role":"Meest recente functie"}),(0,i.jsx)("div",{style:{fontWeight:600,color:"#1e293b",marginBottom:"2px"},children:t.name}),(null==(d=t.snippets)?void 0:d.length)>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{style:{fontSize:"10px",color:"#94a3b8",marginTop:"4px",marginBottom:"1px"},children:"en"===a.language?"Key skills":"Topvaardigheden"}),(0,i.jsx)("div",{style:{color:"#64748b",marginBottom:"6px"},children:t.snippets.join(" \xb7 ")})]}),(0,i.jsx)("div",{style:{display:"flex",gap:"4px"},children:("en"===a.language?[["Good","Goed"],["Maybe","Twijfel"],["No","Nee"]]:[["Goed","Goed"],["Twijfel","Twijfel"],["Nee","Nee"]]).map(r=>{let[l,o]=r,a=e.labelsSubmitted?(e.submittedLabels||{})[t.candidateId]:I[t.candidateId];return(0,i.jsx)("button",{disabled:e.labelsSubmitted||!n||z,onClick:()=>{var e;return e=t.candidateId,void T(t=>({...t,[e]:o}))},style:{flex:1,padding:"4px 0",borderRadius:"6px",border:a===o?"2px solid ".concat(p):"1px solid #cbd5e1",background:a===o?p:"#f8fafc",color:a===o?"#fff":"#475569",fontSize:"11px",fontWeight:600,cursor:e.labelsSubmitted||!n||z?"default":"pointer"},children:l},o)})})]},t.candidateId))}),o})(),n&&!z&&!e.labelsSubmitted&&(0,i.jsx)("button",{onClick:M,disabled:0===Object.keys(I).length,style:{background:Object.keys(I).length>0?p:"#94a3b8",color:"#fff",border:"none",borderRadius:"8px",padding:"8px",fontSize:"13px",fontWeight:600,cursor:Object.keys(I).length>0?"pointer":"not-allowed"},children:"en"===a.language?"Confirm labels":"Bevestig labels"})]})]},t)}),_&&(0,i.jsx)("div",{style:{alignSelf:"flex-start",background:"#f1f5f9",color:"#64748b",padding:"8px 12px",borderRadius:"12px 12px 12px 0",fontSize:"13px"},children:(0,i.jsx)("em",{children:"Thinkingâ¦"})}),(0,i.jsx)("div",{ref:O})]}),(0,i.jsx)("div",{style:{borderTop:"1px solid #f1f5f9",flexShrink:0,display:"flex",flexDirection:"column"},children:(()=>{let e=S.map(e=>!!e.cards).lastIndexOf(!0),t=e>=0?S[e]:null,n=e>=0&&S.slice(e+1).some(e=>"assistant"===e.role),r=e>=0&&!z&&!n&&!(null==t?void 0:t.labelsSubmitted);return(0,i.jsxs)(i.Fragment,{children:[R.length>0&&!r&&(0,i.jsxs)("div",{style:{display:"flex",gap:"6px",padding:"8px 12px 0",flexWrap:"wrap"},children:[R.map((e,t)=>(0,i.jsx)("button",{disabled:_,onClick:()=>{E([]),P(e)},style:{background:"#e8f0fe",color:p,border:"1px solid ".concat(p),borderRadius:"16px",padding:"5px 14px",fontSize:"13px",fontWeight:600,cursor:_?"not-allowed":"pointer",opacity:_?.6:1},children:e},t)),(0,i.jsx)("button",{disabled:_,onClick:()=>E([]),style:{background:"transparent",color:"#94a3b8",border:"1px dashed #cbd5e1",borderRadius:"16px",padding:"5px 14px",fontSize:"13px",fontWeight:500,cursor:_?"not-allowed":"pointer",opacity:_?.6:1},children:"en"===a.language?"Type yourself...":"Typ zelf..."})]}),(0,i.jsx)("div",{style:{display:"flex",gap:"8px",padding:"10px 12px",alignItems:"flex-end"},children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("textarea",{style:{flex:1,resize:"none",borderRadius:"8px",border:"1px solid #cbd5e1",padding:"8px",fontSize:"13px",outline:"none",fontFamily:"inherit",color:"#334155"},value:j,onChange:e=>k(e.target.value),onKeyDown:D,placeholder:r?"en"===a.language?"Label all candidates and click Confirm":"Label alle kandidaten en klik Bevestig":"Type a messageâ¦",rows:2,disabled:!m||_||r}),(0,i.jsx)("button",{style:{background:!m||!j.trim()||_||r?"#94a3b8":p,color:"#fff",border:"none",borderRadius:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:600,height:"36px",flexShrink:0,cursor:!m||!j.trim()||_||r?"not-allowed":"pointer",transition:"background 0.15s"},onClick:()=>P(),disabled:!m||!j.trim()||_||r,children:"Send"})]})})]})})()})]})]})}}}]);
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.