const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cloudWorkspaceReports-DVFEojKb.js","assets/norm-CeclA1Tu.js","assets/appConfig-CuVl6yRs.js","assets/chunk-B3pr0VN8.js","assets/cloudWorkspaceClient-CMlIQBWi.js","assets/preload-helper-Dd-HcVz_.js","assets/authSession-CrP9lMPq.js"])))=>i.map(i=>d[i]);
import{i as e}from"./chunk-B3pr0VN8.js";import{n as t,t as n}from"./jsx-runtime-wTfS3W87.js";import{t as r}from"./preload-helper-Dd-HcVz_.js";import{m as i}from"./chunk-6CSD65Y2-Dj7xjS5D.js";import{a,i as o,s}from"./runtimeTheme-D84RXo8q.js";import{r as c}from"./authSession-CrP9lMPq.js";import{r as l}from"./norm-CeclA1Tu.js";import{f as u,g as d}from"./cloudModel-CGo_el7I.js";import{n as f}from"./llmSettings-A1Pww_S_.js";import{t as p}from"./resumeAiConsent-Cb5Qq4UE.js";import{t as m}from"./exportDomPng-BDWMk3SC.js";import{l as h,t as g}from"./LightweightCharts-CtdVXWCM.js";import{t as _}from"./PlatformTokenUsage-DOyFOKQg.js";import{n as v,r as y,t as b}from"./FallbackNoticeCard-B3WK5QL2.js";import{a as x,c as S,i as C,l as ee,n as w,s as te,t as ne,u as T}from"./toolRuntime-wpPmOqkC.js";import{i as re}from"./llm-BJZzBJtf.js";import{t as E}from"./resumePdfPipeline-Ch0NR2zW.js";import{n as D,r as ie,t as ae}from"./ToolSidebarNav-ydI_X_Ab.js";import{i as oe,r as se}from"./ToolConversationBilling-tfxRkJpq.js";import{n as ce}from"./aiResumeMatch-CPT2N070.js";import{n as le}from"./taskPointGuard-Cj3sjKf6.js";import{n as ue,t as de}from"./toolSkillSummary-B3044xDN.js";import{t as fe}from"./resumeMatchCloudSummary-R7sGXkmL.js";import{a as pe,i as me,n as he,r as ge,t as _e}from"./ResumeMatchInsightsPanel-D8phW5S3.js";import{n as ve,r as O}from"./ToolConversationPersistence-DHdCZcA8.js";import{t as ye}from"./ToolConversationExecution-Dzjh1RyP.js";import{n as be,t as xe}from"./useToolRunState-lqkZz3ea.js";import{t as Se}from"./JdBuzzwordDetector-BRBwbLvV.js";import{t as Ce}from"./ToolRunStatus-sSVJghbX.js";import{n as we,t as Te}from"./useRestoredFieldsHighlight-C1fpbsAB.js";import{t as k}from"./AgentTaskPanel-DuwCymmK.js";import{t as Ee}from"./FilePicker-BfdbCP5q.js";var A=e(t(),1),De=`deepseek`,Oe=`deepseek`,ke=`deepseek-v4-flash`,Ae=e=>{let t=String(e||``).replace(/\r\n/g,`
`).trim();if(!t||/该步骤未返回可用结构化结果|系统将继续基于其他已完成信息完成总结/i.test(t))return``;let n=l(t.match(/^【([^】]+)】/)?.[1]||``),r=Array.from(t.matchAll(/<think>([\s\S]*?)<\/think>/gi)).map(e=>l(e?.[1]||``)).filter(Boolean);return r.length?[n?`【${n}】`:``,r.join(`

`)].filter(Boolean).join(`
`):``},j=e=>{let t=String(e||``).replace(/\r\n/g,`
`).trim();if(!t)return``;let n=t.split(`
`),r=0;for(;r<n.length;){let e=String(n[r]||``).trim();if(!e){r+=1;continue}if(!/工具调用|技术问题|技术性错误|波动|异常|请放心查阅|感谢你的耐心等待|综合分析报告|最终综合报告|深度匹配分析报告/i.test(e))break;r+=1}return n.slice(r).join(`
`).trim()},je=(e,t)=>{let n=l(e),r=l(t);return!n&&!r?``:`${n}::${r}`},Me=()=>{try{let e=new Uint8Array(12);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}catch{return`${Math.random().toString(16).slice(2)}${Date.now().toString(16)}`.slice(0,24)}},M=e=>{let t={title:``,summary:``,fit:``,scoreText:``,overallScoreText:``,objectiveScoreText:``,subjectiveScoreText:``,strengths:[],gaps:[],actions:[],highlights:[],gapsSummary:[],keywords:[],radarLabels:[],radarValues:[]},n=(e,t)=>{let n=String(t||``).trim();n&&(e.includes(n)||e.push(n))},r=String(e||``).replace(/\r\n/g,`
`).split(`
`),i=``,a=(e,n)=>{let r=String(n||``).trim();r&&(t[e]=r)},o=e=>{let t=String(e||``);if(!t)return``;try{return JSON.parse(`"${t.replace(/"/g,`\\"`)}"`)}catch{}return t.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).replace(/\\n/g,`
`).replace(/\\t/g,`	`)},s=(e,t)=>{let n=RegExp(`"${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}"\\s*:`,`i`).exec(e);return n?n.index+n[0].length:-1},c=(e,t)=>{let n=t;for(;n<e.length&&/\s/.test(e[n]);)n+=1;return n},l=(e,t,n=!1)=>{let r=c(e,s(e,t));if(r<0||e[r]!==`"`)return``;r+=1;let i=!1,a=``;for(;r<e.length;r+=1){let t=e[r];if(i){a+=`\\${t}`,i=!1;continue}if(t===`\\`){i=!0;continue}if(t===`"`)return o(a);a+=t}return n?o(a):``},u=(e,t)=>{let n=s(e,t);if(n<0)return``;let r=e.slice(n).match(/^\s*(-?\d+(?:\.\d+)?)/);return r?String(r[1]||``).trim():``},d=(e,t,r=12)=>{let i=c(e,s(e,t)),a=[];if(i<0||e[i]!==`[`)return a;for(i+=1;i<e.length&&a.length<r&&(i=c(e,i),e[i]!==`]`);){if(e[i]!==`"`){i+=1;continue}i+=1;let t=!1,r=``,s=!1;for(;i<e.length;i+=1){let n=e[i];if(t){r+=`\\${n}`,t=!1;continue}if(n===`\\`){t=!0;continue}if(n===`"`){s=!0,i+=1;break}r+=n}let c=o(r).trim();if(c&&(s||c.length>=4)&&n(a,c),!s)break}return a},f=(e,t,r=12)=>{let i=[],a=RegExp(`"${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}"\\s*:\\s*"`,`gi`),s;for(;(s=a.exec(e))&&i.length<r;){let t=!1,r=``,c=s.index+s[0].length;for(;c<e.length;c+=1){let n=e[c];if(t){r+=`\\${n}`,t=!1;continue}if(n===`\\`){t=!0;continue}if(n===`"`)break;r+=n}r&&n(i,o(r)),a.lastIndex=Math.max(a.lastIndex+1,c+1)}return i},p=(e,t,n=12)=>{let r=c(e,s(e,t));if(r<0||e[r]!==`[`)return[];let i=e.indexOf(`]`,r);return(e.slice(r+1,i>=0?i:e.length).match(/-?\d+(?:\.\d+)?/g)||[]).slice(0,n).map(e=>String(e||``).trim()).filter(Boolean)};for(let e of r){let r=String(e||``).trim();if(!r||/^[\s,]*[{\[\]}][\s,]*$/.test(r))continue;let o=r.match(/^\s*["']?([A-Za-z_][\w-]*)["']?\s*:\s*(.*)$/);if(o){let e=String(o[1]||``).trim(),r=String(o[2]||``).trim(),s=e.toLowerCase();if(s===`summary`){i=`summary`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&a(`summary`,e[1])}else if(s===`fit`){i=`fit`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&a(`fit`,e[1])}else if(s===`title`){i=`title`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&a(`title`,e[1])}else if(s===`score`||s===`overallscore`||s===`objectivescore`||s===`subjectivescore`){let e=r.match(/^([0-9]+(?:\.[0-9]+)?)\s*,?\s*$/);if(e){let t=String(e[1]||``).trim();a(s===`score`?`scoreText`:s===`overallscore`?`overallScoreText`:s===`objectivescore`?`objectiveScoreText`:`subjectiveScoreText`,t)}i=``}else if(s===`strengths`)i=`strengths`;else if(s===`gaps`)i=`gaps`;else if(s===`actions`)i=`actions`;else if(s===`highlights`)i=`highlights`;else if(s===`gapssummary`)i=`gapsSummary`;else if(s===`keywords`)i=`keywords`;else if(s===`keyword`){i=`keywords`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&n(t.keywords,e[1])}else i=s===`labels`?`radarLabels`:s===`values`?`radarValues`:``;continue}let s=r.match(/^\s*["']([\s\S]*?)["']\s*,?\s*$/);if(s){let e=String(s[1]||``).trim();if(!e)continue;i===`strengths`?n(t.strengths,e):i===`gaps`?n(t.gaps,e):i===`actions`?n(t.actions,e):i===`highlights`?n(t.highlights,e):i===`gapsSummary`?n(t.gapsSummary,e):i===`keywords`?n(t.keywords,e):i===`radarLabels`&&n(t.radarLabels,e);continue}let c=r.match(/^\s*([0-9]+(?:\.[0-9]+)?)\s*,?\s*$/);if(c&&i===`radarValues`){n(t.radarValues,String(c[1]||``).trim());continue}r.includes(`:`)||/["{}\[\]]/.test(r)&&(r.match(/[A-Za-z\u4e00-\u9fa5]/g)||[]).length}let m=String(e||``);a(`title`,t.title||l(m,`title`,!0)),a(`summary`,t.summary||l(m,`summary`,!0)),a(`fit`,t.fit||l(m,`fit`,!0)),a(`scoreText`,t.scoreText||u(m,`score`)),a(`overallScoreText`,t.overallScoreText||u(m,`overall`)),a(`objectiveScoreText`,t.objectiveScoreText||u(m,`objective`)),a(`subjectiveScoreText`,t.subjectiveScoreText||u(m,`subjective`));for(let e of d(m,`strengths`))n(t.strengths,e);for(let e of d(m,`gaps`))n(t.gaps,e);for(let e of d(m,`actions`))n(t.actions,e);for(let e of d(m,`highlights`))n(t.highlights,e);for(let e of d(m,`gapsSummary`))n(t.gapsSummary,e);for(let e of f(m,`keyword`))n(t.keywords,e);for(let e of d(m,`labels`,8))n(t.radarLabels,e);for(let e of p(m,`values`,8))n(t.radarValues,e);return t},Ne=e=>{let t=String(e||``).replace(/\r\n/g,`
`);if(!t.trim())return``;let n=t.split(`
`),r=[];for(let e of n){let t=String(e||``).trimEnd(),n=t.replace(/\s+/g,``);if(!n){r.length&&r[r.length-1]!==``&&r.push(``);continue}/^`{3,}/.test(n)||/(^|[^a-z])\{.*"lang"\s*:\s*"zh-CN"/i.test(t)||/output_schema|response_format|compact_json|max_tokens|prompt_tokens/i.test(t)||r.push(t)}let i=r.join(`
`).replace(/\n{3,}/g,`

`).trim();return/^[\d\s.,;:，。；：-]+$/.test(i)?``:i.length<t.length*.15?t:i},Pe=(e,t)=>{let n=String(e||``),r=String(t||``);if(!r)return n;if(!n)return r;if(r===n)return n;if(r.startsWith(n))return r;if(n.startsWith(r))return n;let i=Math.min(n.length,r.length);for(let e=i;e>=1;e--)if(n.slice(-e)===r.slice(0,e))return n+r.slice(e);return`${n}${r}`},Fe=e=>{let t=Number(e||0);if(!Number.isFinite(t)||t<=0)return``;let n=Math.max(1,Math.round(t/1e3));if(n<60)return`${n} 秒`;let r=Math.floor(n/60),i=n%60;return i?`${r} 分 ${i} 秒`:`${r} 分`},Ie=e=>{let t=l(e).toLowerCase();return t===`resume_match`?`匹配分析`:t===`jd_analysis`?`岗位解析`:t===`resume_optimize`?`改写建议`:t===`interview_coach`?`题目生成`:l(e)||`处理中`},Le=e=>j(e)||String(e||``).replace(/\r\n/g,`
`).trim(),Re=(e,t)=>{let n=Le(e);if(!n)return null;let r=M(n),i=n.split(/\r?\n/).map(e=>l(e).replace(/^#{1,6}\s*/,``).replace(/^\*\*(.+)\*\*$/,`$1`)).filter(Boolean),a=i.filter(e=>/^(\d+[\.\)]|[-•])\s*/.test(e)).map(e=>e.replace(/^(\d+[\.\)]|[-•])\s*/,``)).filter(Boolean),o=i.filter(e=>!/^(\d+[\.\)]|[-•])\s*/.test(e)),s=e=>{let t=String(e||``).trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?Math.max(0,Math.min(100,Math.round(n))):void 0},c=s(r.overallScoreText||r.scoreText),u=s(r.objectiveScoreText),d=s(r.subjectiveScoreText),f=r.summary||o.slice(0,3).join(`
`),p=r.fit||o[0]||(n.length>20?`已生成匹配分析`:`未返回有效结果`),m=r.radarLabels.slice(0,8),h=r.radarValues.slice(0,m.length).map(e=>Number(e)).filter(e=>Number.isFinite(e)).map(e=>Math.max(0,Math.min(10,e)));return/异常|错误|失败|无法连接|限制|波动/i.test(n),{lang:`zh-CN`,title:r.title||`简历匹配`,summary:f||p,overallScore:c,objectiveScore:u,subjectiveScore:d,radar:m.length&&h.length?{labels:m,values:h}:void 0,keywords:r.keywords.length?r.keywords.map(e=>({keyword:e,jd:0,resume:0,match:`partial`,note:``})):[],highlights:r.highlights.length?r.highlights:o.slice(0,6),gapsSummary:r.gapsSummary,items:[{jobId:`agent_fallback`,jobTitle:l(t.jobTitle)||`目标岗位`,company:l(t.company)||`当前岗位`,score:c??0,fit:p,strengths:r.strengths,gaps:r.gaps,actions:r.actions.length?r.actions:a.slice(0,6)}],caveats:[]}},ze=(e,t)=>{let n=e&&typeof e==`object`?e:null,r=e=>{let t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.min(100,Math.round(t)))},i=(e,t=12)=>Array.isArray(e)?e.map(e=>l(e)).filter(Boolean).slice(0,t):[],a=(Array.isArray(n?.items)?n.items:[]).map(e=>({jobId:l(e?.jobId),jobTitle:l(e?.jobTitle)||l(t.jobTitle)||`目标岗位`,company:l(e?.company)||l(t.company)||`当前岗位`,score:r(e?.score)??0,fit:l(e?.fit),strengths:i(e?.strengths),gaps:i(e?.gaps),actions:i(e?.actions)})).filter(e=>e.jobId||e.jobTitle||e.company||e.fit||e.strengths.length||e.gaps.length||e.actions.length);if(!a.length)return null;let o=a.reduce((e,t)=>Number(t.score||0)>Number(e?.score||-1)?t:e,a[0]),s=r(n?.overallScore)??r(o?.score),c=r(n?.objectiveScore)??s,u=r(n?.subjectiveScore)??s,d=l(n?.summary)||l(o?.fit)||`已基于当前返回内容生成匹配结论。`,f=l(n?.title)||`简历匹配`,p=i(n?.radar?.labels,8),m=Array.isArray(n?.radar?.values)?n.radar.values.map(e=>Number(e)).filter(e=>Number.isFinite(e)).slice(0,p.length).map(e=>Math.max(0,Math.min(10,e))):[],h=Array.isArray(n?.keywords)?n.keywords.map(e=>{let t=l(e?.keyword);return t?{keyword:t,jd:Math.max(0,Math.min(10,Number(e?.jd||0)||0)),resume:Math.max(0,Math.min(10,Number(e?.resume||0)||0)),match:l(e?.match)||`partial`,note:l(e?.note)}:null}).filter(Boolean).slice(0,12):[];return{lang:`zh-CN`,title:f,summary:d,overallScore:s,objectiveScore:c,subjectiveScore:u,focus:o?{jobId:l(o.jobId),jobTitle:l(o.jobTitle),company:l(o.company)}:void 0,radar:p.length&&m.length?{labels:p,values:m}:void 0,keywords:h,highlights:i(n?.highlights,6).length?i(n?.highlights,6):o?.strengths.slice(0,6),gapsSummary:i(n?.gapsSummary,6).length?i(n?.gapsSummary,6):o?.gaps.slice(0,6),riskSignals:i(n?.riskSignals,6),interviewQuestions:i(n?.interviewQuestions,8),items:a,caveats:i(n?.caveats,10)}},Be=e=>{let t=`web_${Math.random().toString(16).slice(2)}`,n=l(e.title)||`（未命名岗位）`,r=l(e.company)||`（未填写公司）`,i=l(e.url)||`https://bysjob.com`,a=l(e.jd),o=l(e.requirements);return{id:t,pool:`jobseeker`,title:n,company:r,salary:{min:0,max:0,currency:`CNY`,text:``},description:o&&!a.includes(o)?`${a}\n\n岗位要求：\n${o}`:a,url:i,platform:`import`,tags:[],created_at:Date.now(),updated_at:Date.now()}},N=n();function Ve(){let[e,t]=(0,A.useState)(null),[n,a]=(0,A.useState)(``),[o]=i();(0,A.useEffect)(()=>{if(o.get(`cc_ref`)!==`career_coach`)return;let e=o.get(`cc_resume`)||``;e&&a(t=>t||e)},[]);let[s,m]=(0,A.useState)(``),[h,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(``),[y,b]=(0,A.useState)(``),[D,ie]=(0,A.useState)(``),[ae,pe]=(0,A.useState)(!1),[me,he]=(0,A.useState)([]),ge=(0,A.useRef)(!1),_e=(0,A.useRef)(!1),ye=(0,A.useRef)(!1),Se=(0,A.useRef)(!1),Ce=(0,A.useRef)(!1),[we,k]=(0,A.useState)(!1),[Ee,j]=(0,A.useState)(``),[Ve,He]=(0,A.useState)([]),{runState:P,progress:Ue,setProgress:We,setRunState:Ge,start:Ke,partial:qe,done:Je,failByMessage:Ye}=be(),[F,I]=(0,A.useState)(null),[Xe,L]=(0,A.useState)(null),[R,z]=(0,A.useState)(``),[Ze,Qe]=(0,A.useState)(``),{restoredFields:B,setRestoredFields:$e,isRestored:et,hasRestored:tt}=Te(),nt=(0,A.useRef)(null),rt=(0,A.useRef)(null),it=(0,A.useRef)(null),at=(0,A.useRef)(null),ot=(0,A.useRef)(null),V=(0,A.useRef)(0),H=(0,A.useRef)(0),U=(0,A.useRef)(0),W=(0,A.useRef)(4),G=(0,A.useRef)(null),st=(0,A.useRef)(null),ct=(0,A.useRef)(!1),lt=(0,A.useRef)(null),ut=(0,A.useRef)(``);ve({tool:`resume_match`,onRestore:e=>{l(e.resumeText)&&a(l(e.resumeText)),l(e.jd)&&m(l(e.jd)),l(e.jobTitle)&&g(l(e.jobTitle)),l(e.company)&&v(l(e.company)),l(e.jobUrl)&&b(l(e.jobUrl)),l(e.requirements)&&ie(l(e.requirements)),typeof e.jdCollapsed==`boolean`&&pe(!!e.jdCollapsed),Array.isArray(e.jdDrafts)&&he(e.jdDrafts.slice(0,8)),e.out&&I(e.out),Array.isArray(e.chatTurns)&&He(e.chatTurns.slice(-80));let t=e.billing||(Array.isArray(e.chatTurns)?[...e.chatTurns].reverse().find(e=>e?.role===`assistant`&&e?.billing)?.billing:null);t&&L(t),l(e.streamText)&&(K(l(e.streamText)),Yt(l(e.streamText))),l(e.streamText)&&(_t.current=l(e.streamText)),l(e.streamThinking)&&J(l(e.streamThinking)),l(e.streamStage)&&pt(l(e.streamStage)),l(e.streamActor)&&X(l(e.streamActor)),Number.isFinite(Number(e.progress))&&We(Number(e.progress)),l(e.latestResultId)&&z(l(e.latestResultId));let n=String(e.streamMode||``).trim()===`agent`?`agent`:`direct`;Gt(n===`agent`);let r=l(e.streamRequestId),i=Math.max(0,Number(e.streamLastEventId||0)),o=l(e.streamModelKey);(e.runState===`running`||e.runState===`partial`)&&n===`agent`&&r&&(lt.current={requestId:r,lastEventId:i,mode:n,modelKey:o}),e.timing&&typeof e.timing==`object`&&(gt.current=e.timing,ht(e.timing))},syncEntries:[{key:`out`,signature:e=>e.out&&typeof e.out==`object`?JSON.stringify(e.out):``,apply:e=>I(e.out??null)},{key:`streamText`,signature:e=>l(e.streamText),apply:e=>{let t=l(e.streamText);K(t),Yt(t),t&&(_t.current=t)}},{key:`streamThinking`,signature:e=>l(e.streamThinking),apply:e=>J(l(e.streamThinking))},{key:`streamStage`,signature:e=>l(e.streamStage),apply:e=>pt(l(e.streamStage))},{key:`streamActor`,signature:e=>l(e.streamActor),apply:e=>X(l(e.streamActor))},{key:`progress`,signature:e=>Number.isFinite(Number(e.progress))?String(Number(e.progress)):``,apply:e=>{Number.isFinite(Number(e.progress))&&We(Number(e.progress))}},{key:`jdDrafts`,signature:e=>Array.isArray(e.jdDrafts)?JSON.stringify(e.jdDrafts):``,apply:e=>{Array.isArray(e.jdDrafts)&&he(e.jdDrafts.slice(0,8))}},{key:`timing`,signature:e=>e.timing&&typeof e.timing==`object`?JSON.stringify(e.timing):``,apply:e=>{e.timing&&typeof e.timing==`object`&&(gt.current=e.timing,ht(e.timing))}},{key:`billing`,signature:e=>e.billing&&typeof e.billing==`object`?JSON.stringify(e.billing):``,apply:e=>L(e.billing||null)}],onRunState:(e,t)=>{Gt((String(t.streamMode||``).trim()===`agent`?`agent`:`direct`)==`agent`),e===`running`?(Ge(`running`),k(!0)):e===`partial`?(qe(),k(!0),j(``)):e===`done`?(Je(),k(!1),j(``)):e===`failed`?(Ye(String(t.err||`生成失败`),j),k(!1)):e===`cancelled`&&(Ye(`已取消`,j),k(!1))},shouldStop:e=>e!==`running`&&e!==`partial`}),(0,A.useEffect)(()=>{if(!ct.current){ct.current=!0;return}try{st.current&&window.clearTimeout(st.current)}catch{}return st.current=window.setTimeout(()=>{O(`resume_match`,{resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D),jdCollapsed:ae,jdDrafts:me.slice(0,8),latestResultId:l(R)})},300),()=>{try{st.current&&window.clearTimeout(st.current)}catch{}st.current=null}},[_,s,ae,me,h,y,R,D,n]);let[dt,K]=(0,A.useState)(``),[q,J]=(0,A.useState)(``),[ft,pt]=(0,A.useState)(``),[Y,X]=(0,A.useState)(``),[mt,ht]=(0,A.useState)({steps:[]}),gt=(0,A.useRef)({steps:[]}),_t=(0,A.useRef)(``),vt=(0,A.useMemo)(()=>Ne(q),[q]),Z=(0,A.useMemo)(()=>M(dt),[dt]),yt=e=>{let t=e(gt.current?.steps?gt.current:{steps:[]});return gt.current=t,ht(t),t};(0,A.useEffect)(()=>{let e=e=>{if(!e||typeof e!=`object`)return;let t=l(e.resumeText),n=l(e.jdText),r=l(e.targetRole),i=l(e.targetIndustry),o=l(e.summary);t&&a(e=>e||t),n&&m(e=>e||n),r&&!ge.current&&g(e=>e||r),i&&!_e.current&&v(e=>e||i),o&&!Se.current&&ie(e=>e||o),Ce.current||pe(!1)},t=new URLSearchParams(window.location.search),n=l(t.get(`source`));if(n!==`career_coach`&&n!==`extension`&&n!==`public_jobs`)return;let r=l(t.get(`sid`));if(!r)return;let i=()=>{let t=C(r);t&&e(t)};i();let o=e=>{e.key&&e.key!==`offer_lens_tool_handoff_v1`||i()},s=()=>{i()},c=()=>{i()},u=0,d=window.setInterval(()=>{u+=1,i(),u>=12&&window.clearInterval(d)},350);return window.addEventListener(`storage`,o),window.addEventListener(`TOOL_HANDOFF_UPDATED_WEB`,s),window.addEventListener(`focus`,c),()=>{window.clearInterval(d),window.removeEventListener(`storage`,o),window.removeEventListener(`TOOL_HANDOFF_UPDATED_WEB`,s),window.removeEventListener(`focus`,c)}},[]),(0,A.useEffect)(()=>{let e=Xt.current;if(e)try{e.scrollTop=e.scrollHeight}catch{}},[Ve.length,q,dt,we]);let Q=(0,A.useMemo)(()=>{let e={title:``,summary:``,fit:``,scoreText:``,overallScoreText:``,objectiveScoreText:``,subjectiveScoreText:``,strengths:[],gaps:[],actions:[],highlights:[],gapsSummary:[],keywords:[],radarLabels:[],radarValues:[]};if(!F)return e;let t=(()=>{let e=Array.isArray(F?.items)?F.items:[],t=e[0]||null,n=-1;for(let r of e){let e=Number(r?.score??-1);Number.isFinite(e)&&e>n&&(n=e,t=r)}return t})();return e.title=l(F?.title),e.summary=l(F?.summary),e.fit=l(t?.fit),e.scoreText=Number.isFinite(Number(t?.score))?String(Math.round(Number(t?.score))):``,e.overallScoreText=Number.isFinite(Number(F?.overallScore))?String(Math.round(Number(F?.overallScore))):``,e.objectiveScoreText=Number.isFinite(Number(F?.objectiveScore))?String(Math.round(Number(F?.objectiveScore))):``,e.subjectiveScoreText=Number.isFinite(Number(F?.subjectiveScore))?String(Math.round(Number(F?.subjectiveScore))):``,e.strengths=Array.isArray(t?.strengths)?t.strengths.map(l).filter(Boolean):[],e.gaps=Array.isArray(t?.gaps)?t.gaps.map(l).filter(Boolean):[],e.actions=Array.isArray(t?.actions)?t.actions.map(l).filter(Boolean):[],e.highlights=Array.isArray(F?.highlights)?F.highlights.map(l).filter(Boolean):[],e.gapsSummary=Array.isArray(F?.gapsSummary)?F.gapsSummary.map(l).filter(Boolean):[],e.keywords=Array.isArray(F?.keywords)?F.keywords.map(e=>l(e?.keyword)).filter(Boolean):[],e.radarLabels=Array.isArray(F?.radar?.labels)?F.radar.labels.map(l).filter(Boolean):[],e.radarValues=Array.isArray(F?.radar?.values)?F.radar.values.map(e=>String(e??``).trim()).filter(Boolean):[],e},[F]),$=(0,A.useMemo)(()=>P===`running`||P===`partial`?{...Q,...Z,strengths:Z.strengths.length?Z.strengths:Q.strengths,gaps:Z.gaps.length?Z.gaps:Q.gaps,actions:Z.actions.length?Z.actions:Q.actions,highlights:Z.highlights.length?Z.highlights:Q.highlights,gapsSummary:Z.gapsSummary.length?Z.gapsSummary:Q.gapsSummary,keywords:Z.keywords.length?Z.keywords:Q.keywords}:Q,[Q,P,Z]),bt=(0,A.useMemo)(()=>l([...Ve].reverse().find(e=>e.role===`assistant`)?.id),[Ve]),xt=(0,A.useMemo)(()=>{let e=Number($.overallScoreText||$.scoreText),t=Number.isFinite(e)?Math.max(0,Math.min(100,Math.round(e))):void 0;return{score:t,summary:l($.summary),fit:l($.fit),headline:t==null?``:t>=80?`这份简历可以直接进入投递决策。`:t>=60?`建议先做一轮针对性改写，再决定是否投递。`:`建议先补关键信息和项目证据，再进入投递。`,primaryAction:`去简历优化`}},[$]),St=(0,A.useMemo)(()=>{let e=Array.isArray(mt.steps)?mt.steps.map(e=>({...e,durationText:Fe(e.durationMs),startElapsedText:Fe(e.startElapsedMs),completedElapsedText:Fe(e.completedElapsedMs)})):[];return{firstReadableText:Fe(mt.firstReadableMs),completedText:Fe(mt.completedMs),steps:e,hasAny:!!mt.startedAt}},[mt]),Ct=(0,A.useMemo)(()=>w(`/tools/resume-optimize`,`tool`,{source:`resume_match`,jt:l(h),cp:l(_),matchRid:l(R)}),[_,h,R]);(0,A.useEffect)(()=>{let e=l(R);e&&S({sid:e,source:`resume_match`,tool:`resume_optimize`,createdAt:Date.now(),resumeText:l(n),jdText:l(s),currentRole:l(_),targetRole:l(h),summary:l($.summary)||l(xt.summary),primaryAction:`去简历优化`,prefillHint:[l(h)?`目标岗位：${l(h)}`:``,l(_)?`公司：${l(_)}`:``].filter(Boolean).join(`
`)})},[_,s,h,R,xt.summary,n,$.summary]);let wt=(0,A.useMemo)(()=>$.strengths.slice(0,3),[$]),Tt=(0,A.useMemo)(()=>($.gapsSummary.length?$.gapsSummary:$.gaps).slice(0,3),[$]),Et=(0,A.useMemo)(()=>$.actions.slice(0,3),[$]),Dt=(0,A.useMemo)(()=>Array.isArray(F?.riskSignals)?F.riskSignals.slice(0,6).map(e=>l(e)).filter(Boolean):[],[F]),Ot=(0,A.useMemo)(()=>F?ue(`resume_match`,F):null,[F]),kt=()=>{let t=[];return l(h)&&t.push(`目标岗位：${l(h)}`),l(_)&&t.push(`公司：${l(_)}`),l(s)&&t.push(`JD 已提供（${l(s).length} 字）`),l(n)&&t.push(`简历已提供（${l(n).length} 字）`),e&&t.push(`附件：${l(e.name)}`),t.join(`
`)},At=e=>{let t=Array.isArray(e?.items)?e.items[0]:null,n=[];return Number.isFinite(Number(e?.overallScore))&&n.push(`我先给你一个整体判断：这份简历和岗位的综合匹配度大约是 ${Math.round(Number(e.overallScore||0))}%。`),l(t?.fit)&&n.push(`从匹配角度看：${l(t?.fit)}`),Array.isArray(t?.strengths)&&t.strengths.length&&n.push(`最有优势的点：\n${t.strengths.slice(0,4).map(e=>`- ${l(e)}`).join(`
`)}`),Array.isArray(t?.gaps)&&t.gaps.length&&n.push(`最需要补的点：\n${t.gaps.slice(0,4).map(e=>`- ${l(e)}`).join(`
`)}`),Array.isArray(t?.actions)&&t.actions.length&&n.push(`如果你要继续改简历或准备投递，我建议先做这几步：\n${t.actions.slice(0,4).map(e=>`- ${l(e)}`).join(`
`)}`),n.join(`

`)||`已生成简历匹配建议。`},jt=(0,A.useMemo)(()=>l(s).length>20&&(l(n).length>30||!!e),[s,n,e]),Mt=()=>{let e=l(s);if(!e)return;let t={id:`jd_${Date.now()}_${Math.random().toString(16).slice(2,6)}`,title:l(h)||`未命名岗位`,company:l(_),jd:e,url:l(y),requirements:l(D),updatedAt:Date.now()};he(e=>[t,...e.filter(e=>!(l(e.jd)===t.jd&&l(e.title)===t.title&&l(e.company)===t.company))].slice(0,8))},Nt=e=>{let t=me.find(t=>t.id===e);t&&(g(l(t.title)),v(l(t.company)),b(l(t.url)),ie(l(t.requirements)),m(l(t.jd)),pe(!1))},Pt=e=>{he(t=>t.filter(t=>t.id!==e))},Ft=()=>{l(s)&&Mt(),g(``),v(``),b(``),ie(``),m(``),pe(!1)},[It,Lt]=(0,A.useState)(!1),[Rt,zt]=(0,A.useState)(``),[Bt,Vt]=(0,A.useState)(``),[Ht,Ut]=(0,A.useState)(!0),[Wt,Gt]=(0,A.useState)(!0),[Kt,qt]=(0,A.useState)([]),[Jt,Yt]=(0,A.useState)(``),Xt=(0,A.useRef)(null),Zt=e=>{He(t=>[...t,e].slice(-80))};(0,A.useEffect)(()=>{if(!we||Wt)return;let e=window.setInterval(()=>{let e=Number(U.current||0);if(!e)return;let t=String(P||``).trim();if(t!==`running`&&t!==`partial`||Date.now()-e<12e4)return;H.current+=1,U.current=0;try{it.current?.abort()}catch{}it.current=null;let i=ze(F,{jobTitle:h,company:_});if(!i){k(!1),Ye(`生成停滞：请点击重新生成或切换模型后重试`,j),O(`resume_match`,{runState:`failed`,err:`stalled`,progress:Number(Ue||0),streamMode:`direct`});return}let a=l(R)||`resume_match_${Date.now()}_${Math.random().toString(16).slice(2,8)}`;I(i),j(``),z(a),pt(`分析完成`),k(!1),Ut(!0),Je(),Zt({id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:At(i),createdAt:Date.now()}),O(`resume_match`,{runState:`done`,progress:100,out:i,requirements:l(D),jdCollapsed:ae,chatTurns:[...Ve].slice(-80),latestResultId:a,resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),streamThinking:l(q),streamText:l(dt),streamStage:`分析完成`,streamRequestId:``,streamMode:`direct`}),queueMicrotask(()=>{ee(de({id:a,toolLabel:`简历匹配`,toolType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,score:Number.isFinite(Number(i?.overallScore))?`匹配度 ${Math.round(Number(i?.overallScore||0))}%`:``,deepLink:w(`/tools/resume-match`,`result`,{rid:a,jt:l(h),cp:l(_)}),result:i}),{resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D),result:i}).catch(()=>{}),(async()=>{let{cloudWorkspaceUpsertReport:e}=await r(async()=>{let{cloudWorkspaceUpsertReport:e}=await import(`./cloudWorkspaceReports-DVFEojKb.js`);return{cloudWorkspaceUpsertReport:e}},__vite__mapDeps([0,1,2,3,4,5,6]));await e({id:a,reportType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,jobIds:[],status:`done`,progress:100,summary:fe({result:i,resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D)})}).catch(()=>{})})()})},1e3);return()=>{try{window.clearInterval(e)}catch{}}},[Wt,At,we,Ve,_,Je,Ye,s,ae,h,y,R,F,Ue,D,n,P,dt,q]),(0,A.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=String(e.get(`focus`)||``).trim(),r=String(e.get(`jt`)||``).trim(),i=String(e.get(`cp`)||``).trim(),o=String(e.get(`rid`)||``).trim();if(r&&!l(h)&&g(r),i&&!l(_)&&v(i),o&&z(o),o&&!tt){let e=x(o,`简历匹配`);if(e&&typeof e==`object`){let t=[];Qe(`已恢复历史记录 ${o.slice(-6)}`),l(e?.resumeText)&&!l(n)&&(a(l(e.resumeText)),t.push(`简历文本`)),l(e?.jd)&&!l(s)&&(m(l(e.jd)),t.push(`JD`)),l(e?.jobTitle)&&!l(h)&&g(l(e.jobTitle)),l(e?.company)&&!l(_)&&v(l(e.company)),l(e?.jobUrl)&&!l(y)&&(b(l(e.jobUrl)),t.push(`链接`)),l(e?.requirements)&&!l(D)&&ie(l(e.requirements)),typeof e?.jdCollapsed==`boolean`&&pe(!!e.jdCollapsed),e?.result&&!F&&(I(e.result),t.push(`结果`)),$e(t)}}t===`result`&&window.setTimeout(()=>{try{rt.current?.scrollIntoView({behavior:`smooth`,block:`start`})}catch{}},80)},[_,tt,s,h,y,F,D,n]);let Qt=e=>{if(at.current?.abort(),ot.current=null,V.current+=1,t(e),Vt(``),!e){Lt(!1),zt(``);return}a(``),I(null),z(``),K(``),J(``),pt(``),qt([]),Yt(``),j(``),Lt(!0),zt(`准备解析新简历…`)},$t=async t=>{if(ot.current)return await ot.current;if(!e)throw Error(`请上传 PDF 简历或粘贴简历文本`);let n=e;if(String(n.type||``).toLowerCase()!==`application/pdf`&&!/\.pdf$/i.test(n.name||``))throw Error(`仅支持 PDF 格式`);if(n.size>1e7)throw Error(`PDF 文件过大（限制 10MB）`);at.current?.abort();let r=new AbortController;at.current=r;let i=++V.current;Vt(``),Lt(!0),zt(t===`auto`?`自动解析中…`:`解析中…`);let o=(async()=>{let e=l((await E({file:n,minLength:800,signal:r.signal,onStage:zt}))?.finalText);if(!e)throw Error(`解析结果为空`);return a(e),zt(`解析完成`),Zt({id:`turn_s_parse_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`system`,content:`已解析简历附件《${l(n.name)||`PDF 简历`}》，后续匹配会自动结合这份简历内容。`,createdAt:Date.now(),attachments:[{name:l(n.name)||`PDF 简历`,preview:`${e.slice(0,90)}${e.length>90?`…`:``}`}]}),e})();ot.current=o;try{return await o}finally{if(V.current===i){ot.current=null,Lt(!1);try{at.current=null}catch{}zt(``)}}},en=async()=>l(n)||await $t(`run`),tn=async e=>{let t=await c();if(!t?.token)return j((0,N.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[`请先`,(0,N.jsx)(`a`,{href:ne(),children:`登录`}),`并确认积分余额后继续使用简历匹配。`]})),null;if(!e?.skipQuote)try{let e=await le({tool:`resume_match`,modelChoice:De,resumeChars:l(n).length,jdChars:l(s).length});if(!e.ok)return j((0,N.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[e.message,` `,(0,N.jsx)(`a`,{href:e.rechargeHref,children:`充值`})]})),null}catch(e){return j((0,N.jsx)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:String(e?.message||`暂时无法校验积分余额，请稍后重试。`)})),null}return t};(0,A.useEffect)(()=>{if(!e){Lt(!1),zt(``),Vt(``),at.current?.abort(),ot.current=null,V.current+=1;return}(async()=>{if(!await p()){Lt(!1),zt(``),Vt(`未同意隐私条款，已取消解析`);return}try{await $t(`auto`)}catch(e){Vt(l(e?.message||`解析失败`))}})()},[e]);let nn=async e=>{let t=!!e?.requestId;if(we&&!t||!await tn({skipQuote:t}))return;let n=++H.current;G.current&&=(clearInterval(G.current),null);let r={startedAt:Date.now(),steps:[]};gt.current=r,ht(r),j(``),t||(I(null),L(null),z(``),qt([]),Yt(``),_t.current=``,K(``),J(``),pt(`准备开始`),X(``)),W.current=4,Ke(),k(!0),it.current=new AbortController;let i=!1,a=``;try{let o=await oe({rangeDays:1,pageSize:100}),c=await en(),p=await f();if(!p.enabled||!p.proxyUrl)throw Error(`AI 服务未启用，请在设置中开启 AI 代理`);let m=u(De);a=je(m?.provider,m?.model);let g=d(De),v=e?.requestId||Me();O(`resume_match`,{runState:`running`,...t?{}:{progress:0,err:``,out:null,billing:null,timing:r,streamText:``,streamThinking:``,streamStage:`准备开始`,streamActor:`agent`},streamRequestId:v,streamLastEventId:Math.max(0,Number(e?.lastEventId||0)),streamMode:`agent`,streamModelKey:a});let b=await re({op:`resume_match_agent`,proxyUrl:p.proxyUrl,gatewayApiKey:p.gatewayApiKey,thinking:g,subProvider:m?.provider,subModel:m?.model,data:{resume:c,jd:l(s),jobTitle:l(h)},signal:it.current.signal,requestId:v,resumeFromSeq:Math.max(0,Number(e?.lastEventId||0)),onToolStart:(e,t,r)=>{if(i||n!==H.current)return;G.current&&=(clearInterval(G.current),null),W.current=Math.max(1,Number(r||0)||1),qt(t=>[...t,{tool:e,status:`running`}]),pt(`步骤 ${t}/${r}`);let a=xe(t,r,`start`);We(a);let o=Date.now(),s=yt(n=>{let r=`${e}:${t}`,i=(n.steps||[]).filter(e=>e.key!==r);return i.push({key:r,tool:e,label:Ie(e),startedAt:o,startElapsedMs:Math.max(0,o-Number(n.startedAt||o))}),{...n,steps:i}});O(`resume_match`,{runState:`running`,progress:a,streamStage:`步骤 ${t}/${r}`,streamActor:e,timing:s});let c=xe(t,r,`done`)-1;G.current=window.setInterval(()=>{We(e=>e>=c?(clearInterval(G.current),G.current=null,e):e+.4)},1e3)},onToolDone:(e,t)=>{if(i||n!==H.current)return;G.current&&=(clearInterval(G.current),null),qt(t=>t.map(t=>t.tool===e&&t.status===`running`?{...t,status:`done`}:t));let r=xe(t,W.current,`done`);We(r);let a=Date.now(),o=yt(n=>({...n,steps:(n.steps||[]).map(r=>r.key===`${e}:${t}`?{...r,completedAt:a,completedElapsedMs:Math.max(0,a-Number(n.startedAt||a)),durationMs:r.startedAt?Math.max(0,a-r.startedAt):void 0}:r)}));O(`resume_match`,{runState:`partial`,progress:r,streamStage:`已完成 ${t}/${W.current}`,streamActor:e,timing:o});let s=Math.min(r+8,90);G.current=window.setInterval(()=>{We(e=>e>=s?(clearInterval(G.current),G.current=null,e):e+.3)},1200)},onProcess:e=>{if(i||n!==H.current)return;let t=Ae(e);t&&J(e=>{if(String(e||``).includes(t))return e;let n=[e,t].filter(Boolean).join(`

`);return O(`resume_match`,{runState:`partial`,streamThinking:n}),n})},onThinking:e=>{if(i||n!==H.current)return;let t=String(e||``).trim();t&&(J(t),O(`resume_match`,{runState:`partial`,streamThinking:t}))},onText:e=>{if(i||n!==H.current)return;let t=Le(e);t&&(_t.current=t);let r=yt(e=>{if(e.firstReadableAt||String(t||``).replace(/\s+/g,``).length<24)return e;let n=Date.now();return{...e,firstReadableAt:n,firstReadableMs:Math.max(0,n-Number(e.startedAt||n))}});Yt(t),K(t),O(`resume_match`,{runState:`partial`,streamText:t,timing:r})},onMeta:e=>{e.type===`start`&&O(`resume_match`,{streamRequestId:String(e.requestId||v),streamMode:`agent`,streamModelKey:a})},onEventId:e=>{O(`resume_match`,{streamRequestId:v,streamLastEventId:Math.max(0,Number(e||0)),streamMode:`agent`,streamModelKey:a})}});if(n!==H.current)return;i=!0,G.current&&=(clearInterval(G.current),null);let x=Le(b)||l(_t.current),S=`resume_match_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,C=Re(x,{jobTitle:h,company:_}),ee=yt(e=>{let t=Date.now();return{...e,firstReadableAt:e.firstReadableAt||(x?t:e.firstReadableAt),firstReadableMs:e.firstReadableMs||(x?Math.max(0,t-Number(e.startedAt||t)):e.firstReadableMs),completedAt:t,completedMs:Math.max(0,t-Number(e.startedAt||t))}});z(S),C&&I(C),Yt(x),K(x);let w=await se({beforeIds:o,aggregateAllNew:!0,pageSize:100,rangeDays:1});L(w);let te={id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:At(C||b),createdAt:Date.now(),billing:w},ne=[...Ve,te].slice(-80);He(ne),O(`resume_match`,{runState:`done`,progress:100,out:C,timing:ee,streamText:x,streamThinking:q||vt,streamStage:`分析完成`,streamActor:`agent`,latestResultId:S,resumeText:c,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D),streamRequestId:v,streamMode:`agent`,streamModelKey:a,billing:w,chatTurns:ne}),Je(),k(!1)}catch(e){if(n!==H.current)return;i=!0;let t=te(e,`生成失败`);O(`resume_match`,{runState:`failed`,err:t,streamMode:`agent`,streamModelKey:a}),Ye(t,j)}finally{i=!0,k(!1)}},rn=async t=>{let i=!!t?.requestId;if(we&&!i||!await tn({skipQuote:i}))return;let a=++H.current,o=u(De),c=d(De),f=je(o?.provider,o?.model);if(j(``),!await p())return;i||(I(null),L(null),z(``),Yt(``),qt([]),K(``),J(``),pt(``),X(``)),Ke(),it.current=new AbortController,k(!0);let m=await oe({rangeDays:1,pageSize:100}),g=null;i||(g={id:`turn_u_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`user`,content:kt(),createdAt:Date.now(),attachments:e?[{name:l(e.name)||`PDF 简历`,preview:`将结合当前简历与 JD 做匹配分析`}]:void 0},Zt(g)),O(`resume_match`,{runState:`running`,...i?{}:{progress:0,err:``,billing:null},resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D),jdCollapsed:ae,chatTurns:[...Ve,...g?[g]:[]].slice(-80),streamMode:`direct`,streamModelKey:f});let v=!1,b=0;U.current=Date.now();let x=null;try{let e=await en(),n=Be({title:h,company:_,jd:s,requirements:D,url:y}),o=i&&F&&typeof F==`object`?{...F}:{},u=t?.requestId||Me(),d={},p=i?l(q):``,S=i?l(dt):``,C=``,te=``,ne=()=>{if(x!=null&&(window.clearTimeout(x),x=null),v||a!==H.current)return;let e=String(o?._streamStage||``).trim(),t=String(o?._streamActor||``).trim(),n=C,r=te;C=``,te=``,qe(),j(``),e&&pt(e),t&&X(t),n&&(S=n,K(n)),r&&(p=r,J(r)),I({...o}),O(`resume_match`,{runState:`partial`,progress:b,err:``,out:{...o},requirements:l(D),jdCollapsed:ae,streamText:n||S||String(o?._streamText||``),streamThinking:r||p,streamStage:e,streamActor:t})},re=()=>{x??=window.setTimeout(()=>{x=null,ne()},60)};O(`resume_match`,{runState:`running`,streamRequestId:u,streamLastEventId:Math.max(0,Number(t?.lastEventId||0)),streamMode:`direct`,streamModelKey:f});let E=await T(ce([n],e,{signal:it.current.signal,provider:Oe,model:ke,thinking:c,requestId:u,resumeFromSeq:Math.max(0,Number(t?.lastEventId||0)),onEventId:e=>{O(`resume_match`,{streamRequestId:u,streamLastEventId:Math.max(0,Number(e||0)),streamMode:`direct`,streamModelKey:f})},onProgress:e=>{v||a!==H.current||(U.current=Date.now(),b=Math.max(0,Number(e||0)),We(b),O(`resume_match`,{runState:`running`,progress:b,err:``,requirements:l(D),jdCollapsed:ae}))},onPartial:e=>{if(!(v||a!==H.current)){U.current=Date.now();try{let t=String(e?._streamStage||``).trim(),n=String(e?._streamActor||``).trim(),r=String(e?._streamText||``).trim(),i=String(e?._streamThinking||``).trim();if(r&&(C=r),t||i){let n=String(e?._streamSegment||t||`analysis`).trim()||`analysis`,r=d[n]||{label:``,content:``};d[n]={label:t||r.label||`分析中`,content:i?Pe(r.content,i):r.content},te=Object.values(d).filter(e=>String(e.content||``).trim()).map(e=>`[${e.label}]\n${e.content}`).join(`

`)}t&&(e._streamStage=t),n&&(e._streamActor=n)}catch{}Object.assign(o,e||{}),re()}}}),6e5,`简历匹配生成`);if(a!==H.current)return;(x!=null||C||te)&&ne(),v=!0,U.current=0,I(E),j(``);let ie=S||String(E?._streamText||``),oe=p||l(E?._streamThinking);ie&&K(ie),oe&&J(oe);let le=await se({beforeIds:m,aggregateAllNew:!0,pageSize:100,rangeDays:1});L(le);let ue={id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:At(E),createdAt:Date.now(),billing:le},pe=[...Ve,...g?[g]:[],ue].slice(-80);He(pe);let me=`resume_match_${Date.now()}_${Math.random().toString(16).slice(2,8)}`;Je(),k(!1),Ut(!0),O(`resume_match`,{runState:`done`,progress:100,out:E,requirements:l(D),jdCollapsed:ae,chatTurns:pe,billing:le,latestResultId:me,resumeText:e,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),streamThinking:oe,streamText:ie,streamStage:`分析完成`,streamRequestId:u,streamMode:`direct`,streamModelKey:f}),z(me),queueMicrotask(()=>{ee(de({id:me,toolLabel:`简历匹配`,toolType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,score:Number.isFinite(Number(E?.overallScore))?`匹配度 ${Math.round(Number(E?.overallScore||0))}%`:``,deepLink:w(`/tools/resume-match`,`result`,{rid:me,jt:l(h),cp:l(_)}),result:E}),{resumeText:e,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D),result:E}).catch(()=>{}),(async()=>{let{cloudWorkspaceUpsertReport:t}=await r(async()=>{let{cloudWorkspaceUpsertReport:e}=await import(`./cloudWorkspaceReports-DVFEojKb.js`);return{cloudWorkspaceUpsertReport:e}},__vite__mapDeps([0,1,2,3,4,5,6]));await t({id:me,reportType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,jobIds:[n.id],status:`done`,progress:100,summary:fe({result:E,resumeText:e,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(D)})}).catch(()=>{})})()})}catch(e){if(a!==H.current)return;v=!0,U.current=0,x!=null&&(window.clearTimeout(x),x=null);let t=te(e,`生成失败`);Ye(t,j),O(`resume_match`,{runState:String(t||``).includes(`取消`)?`cancelled`:`failed`,err:String(t||``),progress:b,streamMode:`direct`,streamModelKey:f})}finally{x!=null&&(window.clearTimeout(x),x=null),v=!0,U.current=0,k(!1)}};return(0,A.useEffect)(()=>{let e=lt.current;if(!e)return;let t=`${e.mode}:${e.requestId}:${e.lastEventId}:${l(e.modelKey)}`;ut.current!==t&&(ut.current=t,lt.current=null,(async()=>{if(e.mode===`direct`){k(!1);return}let t=!0;try{let n=u(De),r=je(n?.provider,n?.model),i=l(e.modelKey);i&&r&&i!==r&&(t=!1)}catch{}if(!t){Qe(`检测到模型已切换：当前进行中的流式结果已失效，请重新点击“开始匹配分析”。`);return}await(e.mode===`agent`?nn(e):rn(e))})())},[_,s,h,D,n]),{resumeFile:e,setResumeFile:Qt,resumeText:n,setResumeText:a,jd:s,setJd:m,jobTitle:h,setJobTitle:e=>{ge.current=!0,g(e)},company:_,setCompany:e=>{_e.current=!0,v(e)},jobUrl:y,setJobUrl:e=>{ye.current=!0,b(e)},requirements:D,setRequirements:e=>{Se.current=!0,ie(e)},jdCollapsed:ae,setJdCollapsed:e=>{Ce.current=!0,pe(e)},busy:we,setBusy:k,runState:P,progress:Ue,failByMessage:Ye,err:Ee,setErr:j,chatTurns:Ve,setChatTurns:He,platformBilling:Xe,out:F,setOut:I,latestResultId:R,setLatestResultId:z,restoredHint:Ze,setRestoredHint:Qe,restoredFields:B,isRestored:et,exportRef:nt,resultCardRef:rt,abortRef:it,parseAbortRef:at,parsePromiseRef:ot,runSeqRef:H,draftTimerRef:st,streamText:dt,setStreamText:K,streamThinking:q,setStreamThinking:J,streamStage:ft,setStreamStage:pt,streamActor:Y,setStreamActor:X,cleanedThinking:vt,timing:mt,timingSummary:St,streamSections:Z,finalSections:Q,shownSections:$,latestAssistantTurnId:bt,matchOverview:xt,resumeOptimizeHref:Ct,jdDrafts:me,saveCurrentJdDraft:Mt,loadJdDraft:Nt,removeJdDraft:Pt,startNextJd:Ft,matchTopStrengths:wt,matchTopGaps:Tt,matchTopActions:Et,matchRiskSignals:Dt,unifiedSummary:Ot,buildUserRunSummary:kt,buildAssistantSummary:At,canRun:jt,parseBusy:It,setParseBusy:Lt,parseStage:Rt,setParseStage:zt,parseErrText:Bt,setParseErrText:Vt,detailExpanded:Ht,setDetailExpanded:Ut,chatScrollRef:Xt,appendTurn:Zt,runParseResume:$t,parseResumeIfNeeded:en,run:rn,runAgent:nn,agentMode:Wt,setAgentMode:Gt,agentSteps:Kt,agentText:Jt}}var He=e=>/云端大模型生成.*输出可能不准确/.test(l(e)),P=`var(--he-font-sans)`,Ue=e=>{let t=l(e);return t?/(博士|phd|doctor)/i.test(t)?`博士`:/(硕士|master|mba)/i.test(t)?`硕士`:/(本科|学士|bachelor)/i.test(t)?`本科`:/(大专|专科|college diploma)/i.test(t)?`大专`:/(高中|中专)/i.test(t)?`高中/中专`:/(大学|学院|学校)/.test(t)?`已提及院校背景`:``:``},We=e=>{let t=l(e);if(!t)return``;let n=[...t.matchAll(/(\d{1,2})(?:\s*[-~至到]\s*(\d{1,2}))?\s*年(?:以上|及以上|相关|工作)?经验/g)];if(!n.length)return``;let r=n.reduce((e,t)=>{let n=Math.max(Number(t[1]||0),Number(t[2]||0));return n>e?n:e},0);return r>0?`${r} 年+`:``},Ge=e=>{let t=l(e);if(!t)return``;let n=new Date,r=n.getFullYear(),i=n.getMonth()+1,a=(e,t)=>e*12+(t-1),o=(e,t,n)=>{let a=String(e||``).trim().toLowerCase();if(!a)return null;if(/^(至今|现在|目前|present|current)$/i.test(a))return{year:r,month:i};let o=Number((a.match(/(19\d{2}|20\d{2})/)||[])[1]||0);if(!o)return null;let s=Number(String(t||``).trim()||0);return{year:o,month:s>=1&&s<=12?s:n?12:1}},s=[];for(let e of t.matchAll(/(19\d{2}|20\d{2})(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?\s*(?:至|到|[-~—–])\s*(19\d{2}|20\d{2}|至今|现在|目前|present|current)(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?/gi)){let t=o(String(e[1]||``),String(e[2]||``),!1),n=o(String(e[3]||``),String(e[4]||``),!0);if(!t||!n)continue;let r=a(t.year,t.month),i=a(n.year,n.month);r>i||s.push({start:r,end:i,startLabel:`${t.year}.${String(t.month).padStart(2,`0`)}`,endLabel:`${n.year}.${String(n.month).padStart(2,`0`)}`})}if(!s.length)return``;s.sort((e,t)=>e.start-t.start);let c=[];for(let e of s){let t=c[c.length-1];if(!t||e.start>t.end+1){c.push({...e});continue}t.end=Math.max(t.end,e.end)}let u=c.reduce((e,t)=>e+(t.end-t.start+1),0);if(u<=0)return``;let d=Math.floor(u/12),f=u%12;return`${d>0?`${d}年`:``}${f>0?`${f}个月`:d>0?``:`不足1个月`}（${s.length}段）`},Ke=e=>{let t=l(e);if(!t)return[];let n=new Date,r=n.getFullYear(),i=n.getMonth()+1,a=(e,t)=>e*12+(t-1),o=(e,t,n)=>{let a=String(e||``).trim().toLowerCase();if(!a)return null;if(/^(至今|现在|目前|present|current)$/i.test(a))return{year:r,month:i};let o=Number((a.match(/(19\d{2}|20\d{2})/)||[])[1]||0);if(!o)return null;let s=Number(String(t||``).trim()||0);return{year:o,month:s>=1&&s<=12?s:n?12:1}},s=[];for(let e of t.matchAll(/(19\d{2}|20\d{2})(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?\s*(?:至|到|[-~—–])\s*(19\d{2}|20\d{2}|至今|现在|目前|present|current)(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?/gi)){let t=o(String(e[1]||``),String(e[2]||``),!1),n=o(String(e[3]||``),String(e[4]||``),!0);if(!t||!n)continue;let r=a(t.year,t.month),i=a(n.year,n.month);if(r>i)continue;let c=i-r+1;s.push({start:r,end:i,text:`${t.year}.${String(t.month).padStart(2,`0`)} - ${n.year}.${String(n.month).padStart(2,`0`)}（${c}个月）`})}return s.sort((e,t)=>e.start-t.start),s.map(e=>e.text).slice(0,12)};function qe(){let{resumeFile:e,setResumeFile:t,resumeText:n,setResumeText:r,jd:i,setJd:c,jobUrl:u,setJobUrl:d,busy:f,setBusy:x,runState:S,progress:C,failByMessage:ee,err:w,setErr:te,platformBilling:ne,out:T,setOut:re,latestResultId:E,setLatestResultId:oe,restoredHint:se,restoredFields:ce,isRestored:le,exportRef:ue,resultCardRef:de,abortRef:fe,parseAbortRef:ve,runSeqRef:O,streamStage:be,setStreamStage:xe,streamActor:Te,setStreamActor:De,streamText:Oe,setStreamText:ke,streamThinking:Ae,setStreamThinking:j,cleanedThinking:je,timingSummary:Me,shownSections:M,matchOverview:Ne,resumeOptimizeHref:Pe,matchTopGaps:Fe,matchTopActions:Ie,matchRiskSignals:Le,unifiedSummary:Re,canRun:ze,parseBusy:Be,parseStage:qe,parseErrText:Je,setParseErrText:Ye,runParseResume:F,run:I,runAgent:Xe,agentMode:L,agentSteps:R,agentText:z}=Ve(),[Ze,Qe]=(0,A.useState)(()=>o(a()));(0,A.useEffect)(()=>s(({theme:e})=>{Qe(e)}),[]);let B=(0,A.useMemo)(()=>(Array.isArray(T?.keywords)?T.keywords:[]).slice(0,12).map(e=>{let t=l(e?.keyword),n=Number(e?.jd||0),r=Number(e?.resume||0),i=l(e?.match).toLowerCase(),a=i===`match`||r>=n?`match`:i===`miss`||r<=0?`miss`:`partial`;return{keyword:t,jd:n,resume:r,note:l(e?.note),status:a}}).filter(e=>e.keyword),[T]),$e=(0,A.useMemo)(()=>(Array.isArray(T?.caveats)?T.caveats:[]).map(e=>l(e)).filter(e=>e&&!He(e)).slice(0,6),[T]),et=(0,A.useMemo)(()=>{let e=[...Ie,...Array.isArray(Re?.risks)?Re.risks:[],...Fe,l(Re?.primaryAction)];return Array.from(new Set(e.map(e=>l(e)).filter(Boolean))).slice(0,5)},[Ie,Fe,Re]),tt=(0,A.useMemo)(()=>[...B].sort((e,t)=>Number(t.jd||0)-Number(e.jd||0)).map(e=>e.keyword).filter(Boolean).slice(0,10),[B]),nt=(0,A.useMemo)(()=>[...B].filter(e=>Number(e.resume||0)>0).sort((e,t)=>Number(t.resume||0)-Number(e.resume||0)).map(e=>e.keyword).filter(Boolean).slice(0,10),[B]),rt=(0,A.useMemo)(()=>v(T?._fallback),[T]),it=(0,A.useMemo)(()=>y(T?._fallback),[T]),at=e=>{let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,Math.round(t))):void 0},ot=(0,A.useMemo)(()=>at(M.overallScoreText),[M.overallScoreText]),V=(0,A.useMemo)(()=>at(M.objectiveScoreText),[M.objectiveScoreText]),H=(0,A.useMemo)(()=>at(M.subjectiveScoreText),[M.subjectiveScoreText]),U=(0,A.useMemo)(()=>at(M.scoreText),[M.scoreText]),W=(0,A.useMemo)(()=>{if(ot!=null)return ot;if(V!=null)return V;if(H!=null)return H;if(U!=null)return U},[U,V,ot,H]),G=(0,A.useMemo)(()=>W==null?null:2*Math.PI*28*(W>0?Math.max(W,4):2)/100,[W]),st=(0,A.useMemo)(()=>{let e=W;return e==null?{label:`待结构化评分`,tone:`#666666`,bg:`rgba(102,102,102,0.08)`,border:`rgba(102,102,102,0.20)`}:e>=75?{label:`建议优先投递`,tone:`#FF6600`,bg:`rgba(255,102,0,0.10)`,border:`rgba(255,102,0,0.28)`}:e>=55?{label:`建议优化后投递`,tone:`#FF6600`,bg:`rgba(255,102,0,0.08)`,border:`rgba(255,102,0,0.22)`}:{label:`建议补强后再投递`,tone:`#111111`,bg:`rgba(17,17,17,0.04)`,border:`rgba(17,17,17,0.16)`}},[W]),ct=(0,A.useMemo)(()=>pe(T),[T]),lt=(0,A.useMemo)(()=>`注：默认展示 6 个一级维度；数值为 0-10 原始证据分，接口缺失项按证据不足处理。`,[]),ut=(0,A.useMemo)(()=>Ue(i),[i]),dt=(0,A.useMemo)(()=>Ue(n),[n]),K=(0,A.useMemo)(()=>We(i),[i]),q=(0,A.useMemo)(()=>Ge(n),[n]),J=(0,A.useMemo)(()=>Ke(n),[n]),ft=(0,A.useMemo)(()=>B.filter(e=>e.status===`match`).length,[B]),pt=(0,A.useMemo)(()=>[{label:`技能匹配`,jdExpected:B.length?`目标覆盖 ${B.length} 项关键词`:`等待 JD 结构化`,resumeEvidence:B.length?`已覆盖 ${ft}/${B.length}${V==null?``:`（硬性条件 ${V}）`}`:V==null?`等待结构化结果`:`硬性条件 ${V}`,contrast:V==null?`待计算`:V>=80?`基本匹配`:V>=60?`差距 ${100-V}`:`差距显著 ${100-V}`,contrastTone:V==null?`neutral`:V>=80?`ok`:V>=60?`warn`:`risk`},{label:`经验年限`,jdExpected:K||`JD 未明确`,resumeEvidence:q?(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{children:q}),J.length?(0,N.jsxs)(`details`,{style:{marginTop:6},children:[(0,N.jsx)(`summary`,{style:{cursor:`pointer`,fontSize:12,fontWeight:700},children:`展开查看时间段明细`}),(0,N.jsx)(`div`,{style:{marginTop:6,display:`grid`,gap:4,fontSize:12,lineHeight:1.55},children:J.map(e=>(0,N.jsx)(`div`,{children:e},e))})]}):null]}):`简历未识别出明确跨度`,contrast:K?q?`需人工核验`:`证据缺失`:`JD 未明确`,contrastTone:K?q?`warn`:`risk`:`neutral`},{label:`教育背景`,jdExpected:ut||`JD 未明确`,resumeEvidence:dt||`简历未识别`,contrast:ut?dt?`需人工核验`:`证据缺失`:`JD 未明确`,contrastTone:ut?dt?`warn`:`risk`:`neutral`},{label:`胜任力判断`,jdExpected:`岗位场景胜任要求`,resumeEvidence:H==null?M.fit||`等待结果`:`${H} · ${M.fit||`待判断`}`,contrast:H==null?`待计算`:H>=80?`基本匹配`:H>=60?`差距 ${100-H}`:`差距显著 ${100-H}`,contrastTone:H==null?`neutral`:H>=80?`ok`:H>=60?`warn`:`risk`}],[V,B.length,ft,K,q,J,ut,dt,H,M.fit]),Y=Ze===`dark`,X=(0,A.useMemo)(()=>Y?{cardBg:`var(--resume-card-bg-alt)`,cardBgSolid:`var(--resume-card-bg-solid)`,cardBgAlt:`var(--resume-card-bg-alt)`,cardInnerBg:`var(--resume-card-inner-bg)`,border:`var(--resume-card-border)`,borderSoft:`var(--resume-card-border-soft)`,textStrong:`var(--resume-card-text-strong)`,textBody:`var(--resume-card-text-body)`,textMuted:`var(--resume-card-text-muted)`,textSoft:`var(--resume-card-text-soft)`,accent:`var(--resume-card-accent)`,accentSoft:`var(--resume-card-accent-soft)`,accentBorder:`var(--resume-card-accent-border)`,inverseBg:`var(--resume-card-accent)`,inverseText:`#141717`,neutralPillBg:`var(--resume-pill-bg)`,neutralPillText:`var(--resume-pill-text)`,neutralPillBorder:`var(--resume-pill-border)`,track:`rgba(255,255,255,0.10)`,ringTrack:`rgba(255,255,255,0.10)`,tableBg:`var(--resume-card-inner-bg)`,rowBg:`rgba(255,255,255,0.02)`,rowBgMuted:`rgba(255,255,255,0.035)`,badgeDarkBg:`var(--resume-pill-bg)`,badgeDarkText:`var(--resume-pill-text)`,badgeDarkBorder:`var(--resume-pill-border)`,keywordOk:`#F3F2EF`}:{cardBg:`var(--resume-card-bg-solid)`,cardBgSolid:`var(--resume-card-bg-solid)`,cardBgAlt:`var(--resume-card-bg-alt)`,cardInnerBg:`var(--resume-card-inner-bg)`,border:`var(--resume-card-border)`,borderSoft:`var(--resume-card-border-soft)`,textStrong:`var(--resume-card-text-strong)`,textBody:`var(--resume-card-text-body)`,textMuted:`var(--resume-card-text-muted)`,textSoft:`var(--resume-card-text-soft)`,accent:`var(--resume-card-accent)`,accentSoft:`var(--resume-card-accent-soft)`,accentBorder:`var(--resume-card-accent-border)`,inverseBg:`#111111`,inverseText:`#FFFFFF`,neutralPillBg:`var(--resume-pill-bg)`,neutralPillText:`var(--resume-pill-text)`,neutralPillBorder:`var(--resume-pill-border)`,track:`rgba(17,17,17,0.08)`,ringTrack:`rgba(17,17,17,0.08)`,tableBg:`var(--resume-card-inner-bg)`,rowBg:`rgba(17,17,17,0.03)`,rowBgMuted:`rgba(17,17,17,0.05)`,badgeDarkBg:`#111111`,badgeDarkText:`#FFFFFF`,badgeDarkBorder:`rgba(17,17,17,0.12)`,keywordOk:`#111111`},[Y]),mt=(0,A.useMemo)(()=>Y?{...g,paper:`#151919`,backdrop:`rgba(255,255,255,0.03)`,ringFillOdd:`rgba(255,255,255,0.026)`,ringFillEven:`rgba(255,255,255,0.008)`,ringStroke:`rgba(255,255,255,0.065)`,axisStroke:`rgba(255,255,255,0.06)`,tickText:`rgba(243,242,239,0.52)`,labelText:`#F3F2EF`,legendBg:`rgba(255,255,255,0.04)`,legendBorder:`rgba(255,255,255,0.10)`,legendText:`#F3F2EF`,centerDot:`#E8895C`,pointCoreFill:`#141717`}:{...g,paper:_e.paper,ringFillOdd:`rgba(17,17,17,0.018)`,ringFillEven:`rgba(17,17,17,0.006)`,ringStroke:`rgba(17,17,17,0.10)`,axisStroke:`rgba(17,17,17,0.09)`,legendBg:_e.legendBg,legendText:_e.ink,centerDot:_e.ink},[Y]),ht={fontSize:19,fontWeight:800,color:`var(--text-1)`,letterSpacing:`0.01em`},gt={display:`inline-flex`,alignItems:`center`,padding:`6px 12px`,borderRadius:999,background:X.neutralPillBg,border:`1px solid ${X.neutralPillBorder}`,color:X.neutralPillText,fontSize:13,fontWeight:700,lineHeight:1.2},_t={border:`1px solid ${X.border}`,borderRadius:18,background:X.cardBgSolid,padding:`18px 18px`,boxShadow:`var(--resume-card-shadow)`,transition:`background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease`},vt=(0,A.useMemo)(()=>{let e=l(z).split(/\r?\n/).map(e=>l(e).replace(/^#{1,6}\s*/,``).replace(/^\*\*(.+)\*\*$/,`$1`)).filter(Boolean);if(!e.length)return null;let t=e[0],n=e.filter((e,t)=>t>0&&/^(\d+[\.\)]|[-•])\s*/.test(e)).map(e=>e.replace(/^(\d+[\.\)]|[-•])\s*/,``)),r=e.filter((e,t)=>t>0&&!/^(\d+[\.\)]|[-•])\s*/.test(e));return{headline:t,summary:r[0]||``,bullets:n.slice(0,5),paragraphs:r.slice(1,4)}},[z]),Z=S===`running`||S===`partial`;(0,A.useEffect)(()=>{let e=Z?S:S||`idle`;try{window.dispatchEvent(new CustomEvent(ie,{detail:{tool:`resume_match`,snapshot:{runState:e}}}))}catch{}},[Z,S]);let yt=!!(l(je)||l(Ae)||l(T?._streamThinking)),Q=(0,A.useMemo)(()=>{let e=l(je)||l(Ae)||l(T?._streamThinking);if(!e)return[];let t=Array.from(e.matchAll(/\[([^\]\n]{1,80})\]\n([\s\S]*?)(?=(?:\n\[[^\]\n]{1,80}\]\n)|$)/g)).map(e=>({label:String(e[1]||`分析中`).trim(),content:String(e[2]||``).trim()})).filter(e=>e.content);return t.length?t:[{label:`分析中`,content:e}]},[je,Ae,T]),$=(0,A.useMemo)(()=>{let e=l(Ne.summary);if(e.length>=80)return e;let t=l(M.fit),n=M.highlights.slice(0,4),r=(M.gapsSummary.length?M.gapsSummary:M.gaps).slice(0,4),i=M.actions.slice(0,4),a=Le.slice(0,3);return[t?`综合诊断：${t}。`:``,n.length?`当前最有说服力的匹配证据包括：${n.join(`；`)}。`:``,r.length?`关键短板主要集中在：${r.join(`；`)}。`:``,a.length?`影响投递判断的风险信号有：${a.join(`；`)}。`:``,i.length?`建议下一步优先完成：${i.join(`；`)}。`:``].filter(Boolean).join(`

`)},[Ne.summary,M.fit,M.highlights,M.gapsSummary,M.gaps,M.actions,Le]),bt=(0,A.useMemo)(()=>me(T,$),[T,$]),xt=(0,A.useMemo)(()=>E?`/report/resume-match?sid=${encodeURIComponent(E)}`:``,[E]),St=(0,A.useMemo)(()=>!!(W!=null||l(Ne.summary)||l(M.fit)||M.highlights.length||M.gapsSummary.length||M.gaps.length||M.actions.length||M.keywords.length||M.radarLabels.length||B.length||bt.length),[W,B.length,Ne.summary,bt.length,M.actions.length,M.fit,M.gaps.length,M.gapsSummary.length,M.highlights.length,M.keywords.length,M.radarLabels.length]),Ct=!!T&&(S===`done`||St),wt=(0,A.useMemo)(()=>!!(St||l(Oe).length>=20||Fe.length||et.length),[St,Fe.length,et.length,Oe]),Tt=(0,A.useMemo)(()=>wt?[{id:`headline`,title:`综合结论`,content:Ne.headline||M.fit||`正在生成结论...`},...et.slice(0,2).map((e,t)=>({id:`action_${t}`,title:`建议 ${t+1}`,content:e})),...Fe.slice(0,2).map((e,t)=>({id:`gap_${t}`,title:`风险 ${t+1}`,content:e}))].filter(e=>l(e.content)):[],[wt,Ne.headline,Fe,et,M.fit]),[Et,Dt]=(0,A.useState)(1);(0,A.useEffect)(()=>{if(!Tt.length){Dt(0);return}Dt(e=>Math.min(Math.max(e,1),Tt.length))},[Tt.length]),(0,A.useEffect)(()=>{if(Et>=Tt.length)return;let e=window.setTimeout(()=>{Dt(e=>Math.min(Tt.length,e+1))},200);return()=>window.clearTimeout(e)},[Tt.length,Et]);let Ot=(0,A.useMemo)(()=>!f&&!!w&&(bt.length>0||B.length>0),[f,w,B.length,bt.length]),[kt,At]=(0,A.useState)(!0);(0,A.useEffect)(()=>{if(Z&&!St){At(!0);return}(St||S===`done`||S===`failed`)&&At(!1)},[St,Z,S]);let jt=Z||Q.length>0,Mt=()=>{L?Xe():I()};return(0,N.jsx)(D,{title:`简历匹配`,subTitle:`上传 PDF 简历（或粘贴简历文本）+ 粘贴 JD，生成匹配度、优势、缺口与行动建议。`,forceThinkingEnabled:!0,hideThinkingToggle:!0,hideModelSelector:!0,defaultModelChoice:`deepseek`,sidebar:(0,N.jsx)(ae,{current:`/tools/resume-match`}),children:(0,N.jsxs)(`div`,{className:`he-tools-main`,children:[(0,N.jsxs)(`div`,{className:`he-form-grid`,children:[(0,N.jsxs)(`div`,{className:`he-form-block he-accent-blue`,children:[(0,N.jsxs)(`div`,{className:`he-pill`,children:[(0,N.jsx)(`span`,{className:`he-pill-dot`}),`Resume`]}),(0,N.jsxs)(`div`,{style:{marginTop:12},children:[(0,N.jsx)(Ee,{label:`PDF 简历（可选）`,accept:`application/pdf,.pdf`,file:e,onPick:t,hint:`上传后会自动解析；也可直接粘贴简历文本。解析按页计费（会消耗积分），生成结果另按 token 计费。`}),e&&!l(n)?(0,N.jsxs)(`div`,{className:`he-muted he-parse-status`,children:[(0,N.jsx)(`div`,{className:`he-parse-status-text`,children:Be?`解析中… ${qe||``}`:Je?`解析失败：${Je}`:`等待解析…`}),(0,N.jsx)(`div`,{className:`he-inline-actions`,children:Be?(0,N.jsx)(`button`,{type:`button`,className:`he-compact-action he-compact-action--secondary`,onClick:()=>{try{ve.current?.abort()}catch{}},children:`取消解析`}):(0,N.jsx)(`button`,{type:`button`,className:`he-compact-action he-compact-action--secondary`,onClick:async()=>{if(await p())try{await F(`run`)}catch(e){Ye(l(e?.message||`解析失败`))}},children:`重新解析`})})]}):null]}),(0,N.jsx)(`div`,{className:`he-sep`}),(0,N.jsx)(`div`,{className:`he-label`,children:`简历文本（可直接粘贴，优先使用）`}),(0,N.jsx)(`textarea`,{className:[`he-textarea`,le(`简历文本`)?`he-restored-field`:``].join(` `),value:n,onChange:e=>r(e.target.value),placeholder:`粘贴简历文本…`})]}),(0,N.jsxs)(`div`,{className:`he-form-block he-accent-orange`,children:[(0,N.jsxs)(`div`,{className:`he-pill`,children:[(0,N.jsx)(`span`,{className:`he-pill-dot`}),`Job`]}),(0,N.jsx)(`div`,{className:`he-label`,style:{marginTop:10},children:`职位描述 JD（必填）`}),(0,N.jsx)(`textarea`,{className:[`he-textarea`,le(`JD`)?`he-restored-field`:``].join(` `),value:i,onChange:e=>c(e.target.value),placeholder:`粘贴职位描述 / 任职要求…`}),(0,N.jsx)(Se,{jd:i,sourceTool:`resume_match`}),(0,N.jsxs)(`div`,{style:{marginTop:12},children:[(0,N.jsx)(`div`,{className:`he-label`,children:`岗位链接（仅记录，可选）`}),(0,N.jsx)(`input`,{className:[`he-input`,le(`链接`)?`he-restored-field`:``].join(` `),value:u,onChange:e=>d(e.target.value),placeholder:`https://...`}),(0,N.jsx)(`div`,{className:`he-muted`,style:{marginTop:6,fontSize:12,lineHeight:1.7},children:`当前仅用于记录岗位来源与后续跳转，还不会自动抓取 JD 内容；请继续手动粘贴完整 JD。`})]}),(0,N.jsx)(`div`,{style:{marginTop:14,display:`flex`,justifyContent:`flex-end`},children:(0,N.jsxs)(`div`,{className:`he-action-pill-group`,children:[(0,N.jsx)(`button`,{type:`button`,className:`he-action-pill`,onClick:()=>{Mt()},disabled:!ze||Z,children:Z?`匹配分析中…`:`匹配分析`}),(0,N.jsx)(`button`,{type:`button`,className:`he-action-pill he-action-pill--ghost`,onClick:()=>ye({tool:`resume_match`,runSeqRef:O,abortRef:fe,setBusy:x,snapshotPatch:{out:null,progress:0,latestResultId:``,streamText:``,streamThinking:``,streamStage:``,streamActor:``,streamRequestId:``,streamLastEventId:0},onCancelled:()=>{re(null),oe(``),ke(``),j(``),xe(``),De(``),ee(`已取消`,te)}}),disabled:!Z,children:`取消`})]})})]})]}),Z&&L&&R.length>0?(0,N.jsx)(k,{title:`Agent 执行清单`,stage:[l(be),l(Te)].filter(Boolean).join(` · `),progress:C,steps:R,labels:{resume_match:`匹配分析`,jd_analysis:`岗位解析`,resume_optimize:`改写建议`,interview_coach:`题目生成`}}):null,!L||!z&&!Oe?null:(0,N.jsxs)(`div`,{style:{marginTop:14,padding:`18px 20px`,borderRadius:18,background:`linear-gradient(180deg, rgba(244,136,53,0.08), rgba(244,136,53,0.03))`,border:`1px solid rgba(244,136,53,0.14)`},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`he-label`,children:`Agent 综合结论`}),(0,N.jsx)(`div`,{className:`he-muted`,style:{marginTop:4,fontSize:12},children:`把最终判断和建议收敛成更容易扫读的结论卡。`})]}),S===`done`?(0,N.jsx)(`span`,{className:`he-chip`,children:st.label}):Z&&Oe?(0,N.jsx)(`span`,{className:`he-chip`,children:`实时生成中`}):null]}),vt&&!Z?(0,N.jsxs)(`div`,{style:{marginTop:12,display:`grid`,gap:12},children:[(0,N.jsx)(`div`,{style:{fontSize:20,fontWeight:800,color:`var(--text-1)`,lineHeight:1.6},children:vt.headline}),vt.summary?(0,N.jsx)(`div`,{style:{padding:`12px 14px`,borderRadius:14,background:`var(--surface)`,border:`1px solid var(--border-soft)`,color:`var(--text-2)`,lineHeight:1.8},children:vt.summary}):null,vt.bullets.length?(0,N.jsxs)(`div`,{style:{..._t,padding:`14px 16px`},children:[(0,N.jsx)(`div`,{className:`he-label`,style:{fontSize:14,fontWeight:800,color:`var(--text-1)`},children:`关键建议`}),(0,N.jsx)(`div`,{style:{marginTop:10,display:`grid`,gap:8},children:vt.bullets.map((e,t)=>(0,N.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`flex-start`,lineHeight:1.75,color:`var(--text-1)`},children:[(0,N.jsxs)(`span`,{style:{color:`var(--accent)`,fontWeight:800},children:[t+1,`.`]}),(0,N.jsx)(`span`,{children:e})]},`agent_b_${t}`))})]}):null,vt.paragraphs.length?(0,N.jsx)(`div`,{style:{display:`grid`,gap:8},children:vt.paragraphs.map((e,t)=>(0,N.jsx)(`div`,{style:{color:`var(--text-2)`,lineHeight:1.8},children:e},`agent_p_${t}`))}):null,(0,N.jsxs)(`details`,{style:{marginTop:2},children:[(0,N.jsx)(`summary`,{style:{cursor:`pointer`,color:`var(--text-2)`,fontSize:12},children:`查看原始完整结论`}),(0,N.jsx)(`div`,{style:{marginTop:10,padding:`12px 14px`,borderRadius:12,background:`var(--surface)`,border:`1px solid var(--border-soft)`,whiteSpace:`pre-wrap`,lineHeight:1.8,fontSize:14,color:`var(--text-1)`},children:z})]})]}):(0,N.jsx)(`div`,{style:{marginTop:12,whiteSpace:`pre-wrap`,lineHeight:1.8,fontSize:14,color:`var(--text-1)`},children:z||Oe})]}),L&&z&&S===`done`?(0,N.jsxs)(`div`,{style:{marginTop:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,N.jsx)(`a`,{href:Pe,className:`btn-primary`,style:{minHeight:34,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,gap:6,fontSize:13},children:`继续下一步：去简历优化`}),(0,N.jsx)(`span`,{className:`he-muted`,style:{fontSize:12},children:`会自动带上当前简历、JD 和匹配建议`})]}):null,(0,N.jsx)(Ce,{state:S,progress:C}),Me.hasAny?(0,N.jsxs)(`div`,{className:`he-muted`,style:{marginTop:8,fontSize:12,lineHeight:1.8},children:[Me.firstReadableText?(0,N.jsx)(`div`,{children:`首条可读结果：${Me.firstReadableText}`}):null,Me.completedText?(0,N.jsx)(`div`,{children:`完整完成：${Me.completedText}`}):null,Me.steps.length?(0,N.jsx)(`div`,{children:`阶段耗时：${Me.steps.map(e=>`${e.label}${e.durationText?` ${e.durationText}`:``}`).join(` / `)}`}):null]}):null,Tt.length?(0,N.jsxs)(`section`,{style:{marginTop:14,padding:20,borderRadius:18,background:`var(--surface)`,border:`1px solid var(--border)`,boxShadow:`0 14px 40px rgba(15,23,42,0.05)`,fontFamily:P},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:`var(--text-3)`,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Streaming Conclusions`}),(0,N.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,color:`var(--text-1)`},children:`实时结论`})]}),(0,N.jsx)(`span`,{className:`he-chip`,children:`${Math.min(Et,Tt.length)}/${Tt.length} 已显示`})]}),Ot?(0,N.jsx)(`div`,{style:{marginTop:12,padding:`10px 12px`,borderRadius:12,background:`color-mix(in srgb, var(--accent) 8%, transparent)`,border:`1px solid var(--accent-border-soft)`,fontSize:13,lineHeight:1.7,color:`var(--text-1)`},children:`网络中断后已保留当前已渲染内容。可点击“开始匹配分析”重新开始生成，页面不会清空已看到的结论。`}):null,(0,N.jsx)(`div`,{style:{marginTop:16,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:12},children:Tt.slice(0,Et).map((e,t)=>(0,N.jsxs)(`article`,{style:{borderRadius:14,border:`1px solid var(--border)`,background:`transparent`,padding:16,display:`grid`,gap:8},children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:`var(--accent)`,letterSpacing:`0.08em`,textTransform:`uppercase`},children:`Card ${t+1}`}),(0,N.jsx)(`div`,{style:{fontSize:16,fontWeight:800,color:`var(--text-1)`},children:e.title}),(0,N.jsx)(`div`,{style:{fontSize:14,lineHeight:1.65,color:`var(--text-2)`},children:e.content})]},e.id))})]}):null,jt?(0,N.jsxs)(`div`,{style:{marginTop:12,padding:`16px 18px`,borderRadius:16,background:`linear-gradient(135deg, color-mix(in srgb, var(--surface) 98%, rgba(200,90,34,0.06)), color-mix(in srgb, var(--surface) 98%, rgba(200,90,34,0.02)))`,border:`1px solid rgba(200,90,34,0.15)`,display:`flex`,flexDirection:`column`,gap:10,position:`relative`,overflow:`hidden`},children:[(0,N.jsx)(`style`,{children:`
                @keyframes thinking-pulse {
                  0%, 100% { opacity: 0.3; transform: scale(0.8); }
                  50% { opacity: 1; transform: scale(1); }
                }
                @keyframes thinking-wave {
                  0% { transform: translateX(-100%); }
                  100% { transform: translateX(100%); }
                }
              `}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,N.jsx)(`div`,{style:{display:`flex`,gap:4,alignItems:`center`},children:[0,1,2].map(e=>(0,N.jsx)(`span`,{style:{width:6,height:6,borderRadius:999,background:`var(--accent)`,animation:Z?`thinking-pulse 1.2s ease-in-out ${e*.15}s infinite`:`none`}},e))}),(0,N.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`var(--text-1)`,letterSpacing:`0.02em`},children:yt?`模型思考过程`:`分析过程`}),Z?(0,N.jsx)(`span`,{style:{fontSize:11,padding:`2px 8px`,borderRadius:999,background:`rgba(200,90,34,0.12)`,color:`var(--accent)`,fontWeight:600,marginLeft:`auto`},children:`实时更新中`}):null,Q.length?(0,N.jsx)(`button`,{type:`button`,className:`btn-secondary`,style:{minHeight:28,padding:`0 10px`,fontSize:12,marginLeft:Z?0:`auto`},onClick:()=>At(e=>!e),children:kt?`收起`:`展开`}):null]}),kt?(0,N.jsxs)(`div`,{style:{fontSize:13,color:`var(--text-2)`,lineHeight:1.7,whiteSpace:`pre-wrap`,maxHeight:240,overflowY:`auto`,padding:`12px`,borderRadius:10,background:`var(--surface)`,border:`1px solid var(--border-soft)`,position:`relative`},children:[(0,N.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,height:32,background:`linear-gradient(to bottom, var(--surface), transparent)`,pointerEvents:`none`,zIndex:1}}),(0,N.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,height:32,background:`linear-gradient(to top, var(--surface), transparent)`,pointerEvents:`none`,zIndex:1}}),(0,N.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`},children:Q.length?Q.map((e,t)=>(0,N.jsxs)(`details`,{open:t===Q.length-1,style:{borderBottom:t<Q.length-1?`1px solid var(--border-soft)`:`none`,paddingBottom:t<Q.length-1?8:0},children:[(0,N.jsx)(`summary`,{style:{cursor:`pointer`,fontWeight:600,color:`var(--text-1)`,marginBottom:4},children:e.label}),(0,N.jsx)(`div`,{style:{paddingLeft:14,borderLeft:`2px solid rgba(200,90,34,0.3)`,marginTop:4},children:e.content})]},t)):(0,N.jsx)(`div`,{style:{color:`var(--text-2)`},children:`正在梳理 JD 要求与简历证据…`})})]}):(0,N.jsx)(`div`,{style:{fontSize:13,color:`var(--text-2)`,lineHeight:1.7,padding:`10px 12px`,borderRadius:10,background:`var(--surface)`,border:`1px solid var(--border-soft)`},children:`思考过程已收起，匹配结论会在下方继续实时刷新。`})]}):null,w?(0,N.jsx)(`div`,{className:`he-err`,children:w}):null,(0,N.jsx)(_,{billing:ne,label:`本次生成`,showRequests:!0,style:{marginTop:w?10:0}}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginTop:10},children:[l(i)?(0,N.jsxs)(`span`,{className:`he-chip`,style:{fontSize:11},children:[`JD `,l(i).length,` 字`]}):null,l(n)?(0,N.jsxs)(`span`,{className:`he-chip`,style:{fontSize:11},children:[`简历 `,l(n).length,` 字`]}):null]}),(0,N.jsx)(`div`,{id:`resume-match-detail-view`,style:{marginTop:14,width:`100%`},children:Ct||se||T&&Z?(0,N.jsxs)(`div`,{className:[`he-split-card`,se?`he-restored-focus`:``].join(` `),ref:de,style:{width:`100%`},children:[(0,N.jsx)(`div`,{className:`he-split-head`,children:(0,N.jsx)(`div`,{children:(0,N.jsx)(we,{restoredHint:se,restoredFields:ce,runState:S})})}),(0,N.jsx)(`div`,{className:`he-split-body`,children:Ct?(0,N.jsxs)(`div`,{children:[rt?(0,N.jsx)(b,{raw:T?._fallback,variant:`notice`,style:{marginBottom:12,padding:`10px 14px`,borderRadius:14,background:`rgba(244, 136, 53, 0.08)`,border:`1px solid rgba(244, 136, 53, 0.18)`},textStyle:{color:`var(--text-1)`,fontSize:13,fontWeight:600}}):null,(0,N.jsxs)(`div`,{ref:ue,style:{padding:`20px 24px 24px`,borderRadius:20,background:`var(--surface)`,boxShadow:`inset 0 0 0 1px var(--border-soft)`,fontFamily:P},children:[(0,N.jsx)(`div`,{className:`he-muted`,children:typeof T._progress==`number`?`进度：${Math.round(Number(T._progress||0))}%`:``}),(0,N.jsxs)(`div`,{style:{marginTop:12,display:`grid`,gap:18},children:[(0,N.jsxs)(`section`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`space-between`,gap:12,paddingBottom:8,borderBottom:`1px solid var(--border-soft)`},children:[(0,N.jsx)(`div`,{children:(0,N.jsx)(`div`,{style:{fontSize:22,fontWeight:800,color:`var(--text-1)`,letterSpacing:`-0.02em`},children:`简历匹配结果`})}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:[W==null?null:(0,N.jsxs)(`span`,{className:`he-chip`,children:[`综合 `,W]}),M.fit?(0,N.jsx)(`span`,{className:`he-chip`,children:M.fit}):null]})]}),it?(0,N.jsx)(`section`,{style:{paddingBottom:18,borderBottom:`1px solid var(--border-soft)`},children:(0,N.jsx)(b,{raw:T?._fallback,variant:`hint`,style:{padding:`10px 14px`,borderRadius:14,background:`rgba(244, 136, 53, 0.07)`,border:`1px solid rgba(244, 136, 53, 0.16)`},textStyle:{color:`var(--text-2)`,fontSize:13,lineHeight:1.65}})}):null,(0,N.jsxs)(`section`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,N.jsx)(`style`,{children:`
                          @keyframes score-sweep {
                            0% { stroke-dashoffset: 226; opacity: 0.35; }
                            100% { stroke-dashoffset: 0; opacity: 1; }
                          }
                          .score-card-hover:hover {
                            transform: translateY(-2px);
                            box-shadow: 0 6px 20px rgba(0,0,0,0.06);
                            transition: all 0.2s ease;
                          }
                        `}),(0,N.jsxs)(`article`,{className:`resume-theme-card-alt`,style:{borderRadius:8,padding:24,fontFamily:P,transition:`background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease`},children:[(0,N.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:16,flexWrap:`wrap`},children:(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Resume Match Report`}),(0,N.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,N.jsx)(`div`,{style:{fontSize:30,fontWeight:800,lineHeight:1.15,letterSpacing:`-0.03em`,color:X.textStrong},children:Ne.headline||`简历匹配结果`}),(0,N.jsxs)(`div`,{style:{position:`relative`,width:56,height:56,flexShrink:0},children:[(0,N.jsxs)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 80 80`,style:{transform:`rotate(-90deg)`},children:[(0,N.jsx)(`circle`,{cx:`40`,cy:`40`,r:`28`,fill:`none`,stroke:X.ringTrack,strokeWidth:`8`}),W==null?null:(0,N.jsx)(`circle`,{cx:`40`,cy:`40`,r:`28`,fill:`none`,stroke:X.accent,strokeWidth:`8`,strokeLinecap:`round`,strokeDasharray:`${G||0} ${2*Math.PI*28}`,style:{animation:`score-sweep 900ms ease-out both`}})]}),(0,N.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:21,fontWeight:800,color:X.textStrong,letterSpacing:`-0.03em`},children:W==null?`--`:`${W}`})]})]})]})}),(0,N.jsxs)(`div`,{style:{display:`grid`,gap:16},children:[(0,N.jsxs)(`div`,{style:{border:`1px solid ${X.borderSoft}`,borderRadius:8,overflow:`hidden`,background:X.tableBg},children:[(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(96px, 120px) minmax(0, 1fr) minmax(0, 1.1fr) 132px`,padding:`12px 14px`,borderBottom:`1px solid ${X.borderSoft}`,fontSize:11,fontWeight:800,color:X.textMuted,letterSpacing:`0.10em`,textTransform:`uppercase`},children:[(0,N.jsx)(`div`,{children:`维度`}),(0,N.jsx)(`div`,{children:`JD 期望（必须达到）`}),(0,N.jsx)(`div`,{children:`简历证据（当前达到）`}),(0,N.jsx)(`div`,{children:`差距结论`})]}),pt.map((e,t)=>(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(96px, 120px) minmax(0, 1fr) minmax(0, 1.1fr) 132px`,gap:12,padding:`14px 14px`,borderBottom:t<pt.length-1?`1px solid ${X.borderSoft}`:`none`,background:e.contrastTone===`risk`?X.accentSoft:`transparent`,alignItems:`start`},children:[(0,N.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:X.textStrong,lineHeight:1.45},children:e.label}),(0,N.jsx)(`div`,{style:{fontSize:14,color:e.label===`技能匹配`||e.label===`胜任力判断`?X.accent:X.textStrong,fontWeight:e.label===`技能匹配`||e.label===`胜任力判断`?800:600,lineHeight:1.5},children:e.jdExpected}),(0,N.jsx)(`div`,{style:{fontSize:14,color:X.textBody,lineHeight:1.5},children:e.resumeEvidence}),(0,N.jsx)(`div`,{children:(0,N.jsx)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,border:`1px solid ${e.contrastTone===`risk`?X.accent:X.neutralPillBorder}`,background:e.contrastTone===`ok`?X.rowBg:e.contrastTone===`risk`?X.accentSoft:X.neutralPillBg,color:e.contrastTone===`ok`?X.textStrong:e.contrastTone===`risk`?X.accent:X.neutralPillText,fontSize:12,fontWeight:800},children:e.contrast})})]},e.label))]}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,N.jsx)(`a`,{href:Pe,className:`btn-primary`,style:{minHeight:44,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,fontFamily:P},children:`去简历优化`}),xt?(0,N.jsx)(`a`,{href:xt,className:`btn-secondary`,style:{minHeight:44,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,fontFamily:P},children:`查看评估报告`}):null,(0,N.jsx)(`button`,{type:`button`,className:`btn-secondary`,style:{minHeight:44,padding:`0 16px`,fontFamily:P},disabled:!T,onClick:async()=>{te(``);try{let e=ue.current;if(!e)throw Error(`导出区域不存在`);await m({element:e,fileName:`简历匹配结果.png`,backgroundColor:document.documentElement.dataset.theme===`dark`?`#0f1111`:`#ffffff`,pixelRatio:2})}catch(e){te(String(e?.message||`导出失败`))}},children:`导出 PNG`})]})]})]}),ct.labels.length?(0,N.jsxs)(`section`,{className:`resume-theme-card-alt`,style:{borderRadius:8,padding:`16px 16px 14px`,fontFamily:P,boxShadow:`var(--resume-card-shadow)`,transition:`background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease`},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Resume Match Radar`}),(0,N.jsx)(`div`,{style:{...ht,marginTop:6,color:X.textStrong},children:`岗位要求 vs 简历证据`}),(0,N.jsx)(`div`,{style:{marginTop:6,fontSize:12,color:X.textBody,lineHeight:1.7},children:`橙色阴影 = JD 目标；蓝色阴影 = 简历证据。两者重叠越多，表示越接近岗位要求。`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,N.jsx)(`span`,{className:`he-chip`,style:{padding:`5px 10px`,borderRadius:6,background:X.accentSoft,color:X.accent,border:`1px solid ${X.accentBorder}`,fontWeight:800},children:`JD 期望（目标）`}),(0,N.jsx)(`span`,{className:`he-chip`,style:{padding:`5px 10px`,borderRadius:6,background:Y?`rgba(96,165,250,0.18)`:`rgba(37,99,235,0.10)`,color:Y?`#BFDBFE`:`#1D4ED8`,border:`1px solid ${Y?`rgba(96,165,250,0.36)`:`rgba(37,99,235,0.22)`}`,fontWeight:800},children:`简历证据（当前）`}),(0,N.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:X.textMuted,letterSpacing:`0.04em`},children:`DYNAMIC DIMENSIONS`})]})]}),(0,N.jsx)(`div`,{style:{marginTop:14,paddingTop:12,borderTop:`1px solid ${X.borderSoft}`},children:(0,N.jsx)(`div`,{style:{minHeight:270,position:`relative`},children:(0,N.jsx)(h,{labels:ct.labels,datasets:[{label:`JD期望（目标）`,values:ct.jdValues,stroke:Y?`#F59E42`:X.accent,fill:Y?`rgba(245,158,66,0.30)`:`rgba(255,106,0,0.24)`,missingMask:ct.missingMask},{label:`简历证据（当前）`,values:ct.resumeValues,stroke:Y?`#60A5FA`:`#2563EB`,fill:Y?`rgba(96,165,250,0.24)`:`rgba(37,99,235,0.20)`,missingMask:ct.missingMask}],maxValue:10,size:260,theme:mt,footerNote:lt,showScaleLabels:!1,showPointMarkers:!1,showValueLabels:!1,ringCount:2,interactiveTooltip:!1},ct.labels.join(`,`)+`_`+T?._ts)})})]}):null,bt.length?(0,N.jsx)(ge,{summaryText:$,sections:bt}):null,(0,N.jsx)(he,{insights:T,onRetry:()=>{Z||(L?Xe():I())}})]}),M.highlights.length||Le.length?(0,N.jsxs)(`section`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(280px, 1fr))`,gap:16},children:[M.highlights.length?(0,N.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:P},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,justifyContent:`space-between`,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Highlight Evidence`}),(0,N.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:X.textStrong},children:`亮点证据`})]}),(0,N.jsxs)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,background:X.accentSoft,border:`1px solid ${X.accentBorder}`,color:X.accent,fontSize:11,fontWeight:800},children:[M.highlights.length,` 条重点`]})]}),(0,N.jsx)(`div`,{style:{marginTop:14,borderTop:`1px solid ${X.borderSoft}`},children:M.highlights.slice(0,8).map((e,t)=>(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`28px minmax(0, 1fr)`,gap:10,padding:`12px 0`,borderBottom:t<Math.min(M.highlights.length,8)-1?`1px solid ${X.borderSoft}`:`none`},children:[(0,N.jsx)(`div`,{style:{width:24,height:24,borderRadius:999,background:X.accentSoft,color:X.accent,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:11,fontWeight:800},children:t+1}),(0,N.jsx)(`div`,{style:{fontSize:14,lineHeight:1.6,color:X.textStrong},children:e})]},t))})]}):null,Le.length?(0,N.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:P},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,justifyContent:`space-between`,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Risk Signals`}),(0,N.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:X.textStrong},children:`风险信号`})]}),(0,N.jsx)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,background:X.badgeDarkBg,color:X.badgeDarkText,border:`1px solid ${X.badgeDarkBorder}`,fontSize:11,fontWeight:800},children:`需重点核查`})]}),(0,N.jsx)(`div`,{style:{marginTop:14,borderTop:`1px solid ${X.borderSoft}`},children:Le.map((e,t)=>(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`28px minmax(0, 1fr)`,gap:10,padding:`12px 0`,borderBottom:t<Le.length-1?`1px solid ${X.borderSoft}`:`none`},children:[(0,N.jsx)(`div`,{style:{width:24,height:24,borderRadius:999,border:`1px solid ${X.accentBorder}`,color:X.accent,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:11,fontWeight:800},children:`!`}),(0,N.jsx)(`div`,{style:{fontSize:14,lineHeight:1.6,color:X.textStrong},children:e})]},t))})]}):null]}):null,B.length?(0,N.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:P},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-end`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Keyword Coverage`}),(0,N.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:X.textStrong},children:`ATS / JD 关键词对比`}),(0,N.jsx)(`div`,{style:{marginTop:8,fontSize:14,color:X.textBody,lineHeight:1.6},children:`用对齐表格直接看 JD 要求、简历覆盖程度与优先补强项。`})]}),(0,N.jsxs)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,border:`1px solid ${X.neutralPillBorder}`,background:X.neutralPillBg,color:X.neutralPillText,fontSize:11,fontWeight:800},children:[B.length,` 项对比`]})]}),(0,N.jsxs)(`div`,{style:{marginTop:16,border:`1px solid ${X.borderSoft}`,borderRadius:8,overflow:`hidden`,background:X.tableBg},children:[(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(140px, 1.2fr) 92px 92px 92px 88px`,gap:12,padding:`12px 14px`,borderBottom:`1px solid ${X.borderSoft}`,fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.10em`},children:[(0,N.jsx)(`div`,{children:`关键词`}),(0,N.jsx)(`div`,{children:`JD`}),(0,N.jsx)(`div`,{children:`简历`}),(0,N.jsx)(`div`,{children:`状态`}),(0,N.jsx)(`div`,{children:`动作`})]}),(0,N.jsx)(`div`,{style:{display:`grid`,gap:0},children:B.map((e,t)=>{let n=e.status===`match`?{color:X.keywordOk,bg:X.rowBg,bar:X.keywordOk,label:`覆盖`}:e.status===`miss`?{color:X.accent,bg:X.accentSoft,bar:X.accent,label:`缺口`}:{color:X.accent,bg:Y?`rgba(232,137,92,0.10)`:`rgba(255,102,0,0.06)`,bar:X.accent,label:`部分`},r=Math.min(10,Math.max(0,Math.round(e.resume||0))),i=Math.min(10,Math.max(0,Math.round(e.jd||0)));return(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(140px, 1.2fr) 92px 92px 92px 88px`,gap:12,padding:`14px 14px`,borderBottom:t<B.length-1?`1px solid ${X.borderSoft}`:`none`,background:n.bg,alignItems:`center`},children:[(0,N.jsxs)(`div`,{style:{minWidth:0},children:[(0,N.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:(0,N.jsx)(`span`,{style:{fontWeight:700,fontSize:13,color:X.textStrong,textDecoration:e.status===`miss`?`line-through`:`none`,textDecorationColor:X.accent,textDecorationThickness:`1.5px`},children:e.keyword})}),e.note?(0,N.jsx)(`div`,{style:{marginTop:5,fontSize:12,lineHeight:1.5,color:X.textMuted},children:e.note}):null]}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{style:{fontSize:12,fontWeight:800,color:X.textStrong},children:[i,`/10`]}),(0,N.jsx)(`div`,{style:{marginTop:6,height:4,borderRadius:2,background:X.track,overflow:`hidden`},children:(0,N.jsx)(`div`,{style:{width:`${i*10}%`,height:`100%`,background:X.keywordOk,borderRadius:2}})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{style:{fontSize:12,fontWeight:800,color:e.status===`match`?X.textStrong:X.accent},children:[r,`/10`]}),(0,N.jsx)(`div`,{style:{marginTop:6,height:4,borderRadius:2,background:X.track,overflow:`hidden`},children:(0,N.jsx)(`div`,{style:{width:`${r*10}%`,height:`100%`,background:n.bar,borderRadius:2}})})]}),(0,N.jsx)(`div`,{children:(0,N.jsx)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,border:`1px solid ${n.color}33`,color:n.color,fontSize:11,fontWeight:800,background:X.neutralPillBg},children:n.label})}),(0,N.jsx)(`div`,{children:e.status===`match`?(0,N.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:X.textSoft},children:`已满足`}):(0,N.jsx)(`a`,{href:Pe,style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,background:X.accent,color:X.inverseText,fontSize:11,fontWeight:800,textDecoration:`none`},children:`去补齐`})})]},`${e.keyword}_${t}`)})})]})]}):null,tt.length||nt.length?(0,N.jsxs)(`section`,{style:{..._t,paddingBottom:18},children:[(0,N.jsx)(`div`,{className:`he-label`,style:ht,children:`岗位与简历关键词`}),tt.length?(0,N.jsxs)(`div`,{style:{marginTop:10},children:[(0,N.jsx)(`div`,{className:`he-label`,style:{fontSize:13,fontWeight:700,color:`var(--text-2)`},children:`岗位 / JD 胜任力关键词`}),(0,N.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:8},children:tt.map(e=>(0,N.jsx)(`span`,{style:gt,children:e},`jd_${e}`))})]}):null,nt.length?(0,N.jsxs)(`div`,{style:{marginTop:tt.length?14:10},children:[(0,N.jsx)(`div`,{className:`he-label`,style:{fontSize:13,fontWeight:700,color:`var(--text-2)`},children:`简历已体现关键词`}),(0,N.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:8},children:nt.map(e=>(0,N.jsx)(`span`,{style:gt,children:e},`resume_${e}`))})]}):null]}):null,$e.length||et.length?(0,N.jsxs)(`section`,{style:{display:`flex`,flexDirection:`column`,gap:14},children:[$e.length?(0,N.jsxs)(`div`,{style:{..._t,background:Y?`linear-gradient(180deg, #171b1b 0%, #121515 100%)`:`linear-gradient(180deg, #fffdfb 0%, #faf5ef 100%)`},children:[(0,N.jsx)(`div`,{className:`he-label`,style:ht,children:`注意事项`}),(0,N.jsx)(`div`,{className:`he-pre`,style:{marginTop:10},children:$e.map(e=>`• ${e}`).join(`
`)})]}):null,et.length?(0,N.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:P},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-end`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:X.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Next Actions`}),(0,N.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:X.textStrong},children:`下一步行动建议`}),(0,N.jsx)(`div`,{style:{marginTop:8,fontSize:14,color:X.textBody,lineHeight:1.6},children:`先处理最影响投递判断的事项，再进入改写与补证据动作。`})]}),(0,N.jsx)(`a`,{href:Pe,className:`btn-primary`,style:{minHeight:44,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,fontFamily:P},children:`继续下一步`})]}),(0,N.jsx)(`div`,{style:{marginTop:16,borderTop:`1px solid ${X.borderSoft}`},children:et.map((e,t)=>(0,N.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`30px minmax(0, 1fr)`,gap:10,padding:`12px 0`,borderBottom:t<et.length-1?`1px solid ${X.borderSoft}`:`none`},children:[(0,N.jsx)(`div`,{style:{width:24,height:24,borderRadius:999,background:X.accent,color:X.inverseText,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:11,fontWeight:800},children:t+1}),(0,N.jsx)(`div`,{style:{fontSize:14,lineHeight:1.6,color:X.textStrong},children:e})]},t))})]}):null]}):null]})]})]}):T&&Z?(0,N.jsx)(`div`,{style:{padding:`16px 18px`,borderRadius:14,border:`1px solid var(--border-soft)`,background:`var(--surface)`,color:`var(--text-2)`,lineHeight:1.75},children:`已生成阶段性匹配内容，正在汇总最终结论与报告卡片，请稍候片刻。`}):null})]}):null})]})})}export{qe as default};