import{t as e}from"./jsx-runtime-wTfS3W87.js";import{n as t}from"./proxyOps-D3Awrk7b.js";var n=/[一-龥]{2,20}(?:有限公司|股份有限公司|集团|合伙企业|事务所|个体工商户|分公司|有限责任公司)|[0-9A-Z]{18}/,r=/(这家公司|这个公司|该公司|公司怎么样|公司靠谱|靠谱吗|拿到了.*offer|入职前|尽调|核验|工商|股东|失信|被执行|限消令|经营异常|劳动仲裁|劳动争议|拖欠工资|社保(基数|缴纳|按全额|按最低)|996|加班费|试用期|竞业|劳动监察|用工合规|裁判文书)/,i=/(经营|股东|高管|失信|被执行|限消令|经营异常|主体|工商)/,a=/[一-龥]{2,20}(?:有限公司|股份有限公司|集团|合伙企业|事务所|个体工商户|分公司|有限责任公司)/,o=e=>{let t=String(e||``).match(a);return t?t[0]:null},s=(e,t)=>{let n=[`## 企业核验（${t}）`];if(e.summary&&n.push(`总评：${e.summary}`),e.overallRisk&&n.push(`总体风险：${e.overallRisk}`),e.basicInfo){let t=e.basicInfo,r=[t.legalRepresentative&&`法定代表人 ${t.legalRepresentative}`,t.registeredCapital&&`注册资本 ${t.registeredCapital}`,t.establishedDate&&`成立日期 ${t.establishedDate}`,t.registrationStatus&&`登记状态 ${t.registrationStatus}`].filter(Boolean);r.length&&n.push(`基本信息：${r.join(`；`)}`)}if(Array.isArray(e.riskFindings)&&e.riskFindings.length){n.push(`风险信号：`);for(let t of e.riskFindings.slice(0,5))n.push(`- [${t.level}] ${t.category}: ${t.summary}`)}else n.push(`风险信号：未发现显著负面记录。`);return e.disclaimer&&n.push(`说明：${e.disclaimer}`),n.join(`
`)},c=(e,t)=>{let n=[`## 用工合规扫描（${t}）`];if(e.summary&&n.push(`总评：${e.summary}`),e.overallRisk&&n.push(`总体风险：${e.overallRisk}`),e.complianceGrade&&n.push(`合规等级：${e.complianceGrade}`),e.recruitmentOverview){let t=e.recruitmentOverview,r=[t.totalReported!=null&&`历史招聘总量 ${t.totalReported} 条`,t.batchPeriod&&`发布批次 ${t.batchPeriod}`,t.insuredCount&&`参保 ${t.insuredCount}`,t.channels&&t.channels.length&&`渠道 ${t.channels.join(`/`)}`].filter(Boolean);r.length&&n.push(`招聘规模：${r.join(`；`)}`),t.interpretation&&n.push(`解读：${t.interpretation}`)}if(e.salaryAnalysis){let t=e.salaryAnalysis,r=[t.median&&`中位 ${t.median}`,t.p25&&`P25 ${t.p25}`,t.p75&&`P75 ${t.p75}`].filter(Boolean);if(r.length&&n.push(`薪资分布：${r.join(`；`)}`),Array.isArray(t.buckets)&&t.buckets.length){n.push(`  区间分布：`);for(let e of t.buckets)n.push(`  · ${e.range}: ${e.count} 条 (${e.share})${e.complianceNote?` — ${e.complianceNote}`:``}`)}}if(e.disputeOverview){let t=e.disputeOverview;n.push(`司法争议：文书 ${t.totalDocs??`?`} 条 / 劳动相关 ${t.laborRelatedCount??0} / 被告位 ${t.asDefendant??0}${t.defendantLossRate?` / 推断败诉率 ${t.defendantLossRate}`:``}`)}if(Array.isArray(e.findings)&&e.findings.length){n.push(`风险信号：`);for(let t of e.findings.slice(0,5))n.push(`- [${t.level}] ${t.issueType}: ${t.summary}`)}return Array.isArray(e.candidateChecklist)&&e.candidateChecklist.length&&n.push(`求职者核对清单：${e.candidateChecklist.slice(0,5).join(`；`)}`),e.disclaimer&&n.push(`说明：${e.disclaimer}`),n.join(`
`)},l=async(e,a,l)=>{let u=String(e||``),d=n.test(u),f=r.test(u);if(!d&&!f)return{triggered:!1};let p=o(u);if(!p)return{triggered:!1};let m=i.test(u);l?.(m?`正在查询天眼查公开数据：${p}（工商 + 用工合规）`:`正在查询天眼查公开数据：${p}（用工合规）`);let h=[],g=[],_=null,v=null,y=0,b=e=>{let t=String(e?.label||``).trim();t&&(typeof e.index==`number`&&typeof e.total==`number`&&e.total>0?l?.(`${t}（${e.index+1}/${e.total}）`):l?.(t))};if(m&&g.push(t(`kyb_company_check`,{companyName:p},{signal:a,onStage:b}).then(e=>{e?.ok&&e.report?(_=e.report,y+=Number(e?.usage?.billed_points||0)):e?.errors&&h.push(...e.errors)}).catch(e=>{h.push(`kyb: ${String(e?.message||e).slice(0,120)}`)})),g.push(t(`labor_compliance_check`,{companyName:p},{signal:a,onStage:b}).then(e=>{e?.ok&&e.report?(v=e.report,y+=Number(e?.usage?.billed_points||0)):e?.errors&&h.push(...e.errors)}).catch(e=>{h.push(`labor: ${String(e?.message||e).slice(0,120)}`)})),g.length===0)return{triggered:!1};await Promise.allSettled(g),l?.(`已获取${p}公开数据，正在让 AI 基于真实数据回答…`);let x=[];_&&x.push(s(_,p)),v&&x.push(c(v,p));let S=x.length?[`## 系统已为本轮聊天预取公开数据（请直接采信，不要重新猜测）`,...x,`---`,`请基于以上真实数据回答用户问题；引用数字时直接用上面的具体值，不要再说「建议去天眼查查」之类的话。`].join(`

`):``;return{triggered:!0,companyName:p,kybReport:_,laborReport:v,errors:h.length?h:void 0,contextText:S||void 0,totalBilledPoints:y}},u=e();function d({title:e,description:t}){return(0,u.jsxs)(`section`,{className:`rounded-3xl border px-5 py-6`,style:{borderColor:`var(--border)`,background:`var(--surface)`},children:[(0,u.jsx)(`div`,{className:`text-lg font-semibold`,style:{color:`var(--text-1)`},children:e}),(0,u.jsx)(`div`,{className:`mt-3 text-sm leading-7`,style:{color:`var(--text-2)`},children:t})]})}export{l as n,d as t};