import{c as z,d as ne,f as B,r as P,j as e,B as T,ae,H as M,S as q,aa as K,P as Q,a6 as ie,ac as le,I as D,T as re,ad as oe,v as ce}from"./index-DWQlGpif.js";import{C as G,a as W,b as $}from"./card-BkBMnQAf.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const de=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],xe=z("ArrowDown",de);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const me=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],pe=z("ArrowUp",me);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ue=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],he=z("ChevronRight",ue);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fe=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],ye=z("GripVertical",fe);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ge=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],ke=z("PanelRightClose",ge);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const be=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],je=z("PanelRightOpen",be);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ve=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Ne=z("Printer",ve),I=[{key:"info",defaultTitle:"基本信息",kind:"info",fixed:!0},{key:"education",defaultTitle:"教育经历",kind:"edu",fixed:!0},{key:"skills",defaultTitle:"核心技能",kind:"text"},{key:"projects",defaultTitle:"项目经历",kind:"list",types:["竞赛","科研","实习实践"]},{key:"certs",defaultTitle:"证书与荣誉",kind:"list",types:["荣誉惩处","证书技能"]},{key:"campus",defaultTitle:"在校经历",kind:"list",types:["学生工作","志愿公益"]},{key:"activity",defaultTitle:"文体活动",kind:"list",types:["文体活动"]},{key:"other",defaultTitle:"其他经历",kind:"list"},{key:"self",defaultTitle:"自我评价",kind:"text",fixed:!0}],E={skills:{text:`路由交换:熟悉TCP/IP协议栈与基础路由交换,掌握VLAN、链路聚合、MSTP、VRRP/VRRP6等园区网冗余技术,熟悉OSPF、RIP、BGP等动态路由协议,具备IPv4/IPv6双栈网络的规划与部署能力。 网络安全:熟悉防火墙安全区域、ACL访问控制与安全策略配置,掌握NAPT、NAT Server、NAT64地址转换,了解GRE over IPsec隧道与防火墙双机热备。 网络设备:熟悉华为交换机、路由器、防火墙CLI操作与配置,掌握GVRP、MSTP、VRRP、链路聚合及BFD联动快速收敛,熟悉Wireshark抓包分析。 运维基础:熟悉RedHat、Ubuntu等Linux系统部署与日常维护,了解Docker、K8s、Prometheus等云原生运维工具。`},campus:{items:[{title:"学校图书馆 勤工俭学固定岗",subtitle:"图书管理员",date:"2024.12 - 2026.7",desc:"负责图书上架、整理和维护,定时进行馆内安全巡检,协助读者检索和借阅服务,累计服务读者超2000人次,零服务投诉。这段经历培养了高度的责任意识与服务意识,锻炼了高效执行和多任务时间管理能力。"},{title:"学院团总支学生会宣传部 干事",subtitle:"视觉设计",date:"2023.9 - 2024.9",desc:"独立完成学院活动海报、邀请函、KT板、易拉宝等40余份宣传物料设计,参与换届大会、迎新、毕业季等重大活动视觉设计与宣传品制作。负责报告厅后台多媒体设备控制,保障12场大型活动视觉呈现零失误,锻炼了应急处置能力与谨慎细致的工作态度。"}]},self:{text:"心态沉稳、抗压能力较好,遇到突发状况能冷静应对、稳住局面。做事有计划性,习惯提前预判风险并做好预案,追求稳妥与确定性,执行质量有保障,能在压力下保持稳定输出。责任心强,凡事有始有终,注重细节与条理,能在复杂环境中稳步推进工作,是一名可靠、值得信赖的执行者。"}};function F(){return{version:2,template:"tech",accent:"#3056d3",fontScale:1,density:"normal",onePage:!1,sections:I.map(a=>({key:a.key,title:a.defaultTitle,enabled:!0,kind:a.kind,types:a.types,...a.key==="skills"?{text:E.skills.text}:{},...a.key==="campus"?{items:E.campus.items}:{},...a.key==="self"?{text:E.self.text}:{}}))}}function Z(a){const i=F();if(!a||typeof a!="object")return i;const u=a,b=Array.isArray(u.sections)?u.sections:[],d=i.sections.map(s=>{var g;const x=b.find(o=>o.key===s.key),j=I.find(o=>o.key===s.key),v={...s,enabled:(x==null?void 0:x.enabled)??!0,title:(x==null?void 0:x.title)??(j==null?void 0:j.defaultTitle)??s.title};return s.key==="skills"&&!v.text&&(v.text=E.skills.text),s.key==="campus"&&!((g=v.items)!=null&&g.length)&&(v.items=E.campus.items),s.key==="self"&&!v.text&&(v.text=E.self.text),v});for(const s of b)d.some(x=>x.key===s.key)||d.push({key:s.key,title:s.title||s.key,enabled:s.enabled??!0,kind:"text",text:""});return{version:2,template:u.template??"tech",accent:u.accent??"#3056d3",fontScale:Math.min(1.2,Math.max(.8,u.fontScale??1)),density:u.density??"normal",onePage:u.onePage??!1,sections:d}}function we(){return I.filter(a=>a.types).flatMap(a=>a.types)}function Se(a){const i=[a.organizer,a.level,a.award_grade].filter(b=>b!=null&&b!=="").map(String).join(" · "),u=[a.result,a.description].filter(b=>b!=null&&b!=="").map(String).join(" — ");return{title:a.title,subtitle:i||void 0,date:a.start_date??a.created_at.slice(0,10),desc:u||void 0,fromRecord:a.id}}function J(a,i){const u=[],b=we();for(const d of i.sections){if(!d.enabled)continue;const s=I.find(o=>o.key===d.key);if(d.key==="info"){u.push({key:d.key,title:d.title,kind:"info"});continue}if(d.key==="self"||d.kind==="text"){u.push({key:d.key,title:d.title,kind:"text",text:d.text??""});continue}const x=new Set(d.excluded??[]);let j=[];const v=s==null?void 0:s.types;v?j=a.filter(o=>v.includes(o.type_name)&&o.status!=="draft"&&!x.has(o.id)):j=a.filter(o=>o.status!=="draft"&&!x.has(o.id)&&!b.includes(o.type_name));const g=j.map(Se).filter(o=>!o.fromRecord||!x.has(o.fromRecord));for(const o of d.items??[])g.push({...o});g.sort((o,k)=>(k.date??"").localeCompare(o.date??"")),g.length&&u.push({key:d.key,title:d.title,kind:"list",items:g})}return u}const X=[{key:"tech",name:"互联网技术风",desc:"品牌色标题 + 左侧色条,紧凑现代"},{key:"minimal",name:"极简风",desc:"灰色大写字距标题,大量留白"},{key:"classic",name:"经典风",desc:"黑色衬线标题 + 通栏分隔线,正式通用"}],Y=["#3056d3","#0f766e","#7c3aed","#c2410c","#0e7490","#1f2937"],w=a=>String(a??"").replace(/&/g,"&").replace(//g,">");function Ce(a,i,u,b){const d=u.fontScale,s=k=>(k*d).toFixed(1)+"pt",x=u.accent,j={classic:"font-size:"+s(14)+";border-bottom:1.5pt solid #333;padding-bottom:3pt;margin:12pt 0 6pt;color:#111",tech:"font-size:"+s(14)+";color:"+x+";border-left:3pt solid "+x+";padding-left:6pt;margin:12pt 0 6pt",minimal:"font-size:"+s(11.5)+";color:#555;letter-spacing:1.5pt;text-transform:uppercase;margin:14pt 0 6pt"},v=a.map(k=>{let l="";if(k.kind==="info"){const m=[["姓名",f(i).name],["性别",f(i).gender],["出生年月",f(i).birth],["民族",f(i).nation],["籍贯",f(i).native],["政治面貌",f(i).political],["学校",f(i).school],["学院",f(i).college],["专业",f(i).major],["班级",f(i).className],["学号",f(i).studentId],["学历",f(i).degree],["手机",f(i).phone],["邮箱",f(i).email]].filter(S=>S[1]!=="");l=''+m.map(([S,r],R)=>(R%2===0?"":"")+'"+(R%2===1?"":"")).join("")+"
'+w(S)+''+w(r)+"
"}else k.kind==="list"?l='
'+(k.items??[]).map(m=>{const S=m.subtitle?'
'+w(m.subtitle)+"
":"",r=m.desc?'
'+w(m.desc)+"
":"";return'
'+w(m.title)+''+w(m.date??"")+"
"+S+r+"
"}).join("")+"
":l='

'+w(k.text??"")+"

";return'

'+w(k.title)+"

"+l}).join(""),g=b&&i.photoUrl?'
证件照
':"",o=[f(i).school,f(i).college,f(i).major,f(i).degree].filter(k=>k!=="").map(k=>w(k)).join(" · ");return''+w(f(i).name||"个人简历")+'

'+w(f(i).name||"个人简历")+"

"+g+"
"+(o?'
'+o+"
":"")+v+""}function f(a){return a??{}}const Pe=Object.freeze(Object.defineProperty({__proto__:null,ACCENT_CHOICES:Y,RESUME_SECTION_DEFS:I,TEMPLATES:X,assembleSections:J,defaultResumeConfig:F,migrateResumeConfig:Z,resumeToWordHtml:Ce},Symbol.toStringTag,{value:"Module"}));function Re(){var U,H,V;const a=ne(),i=B({queryKey:["profile"],queryFn:oe}),u=B({queryKey:["resume-records"],queryFn:()=>ce({page:1,page_size:500})}),[b,d]=P.useState(null),[s,x]=P.useState(""),[j,v]=P.useState(!0),[g,o]=P.useState(new Set),[k,l]=P.useState(1),m=P.useRef(null),S=P.useRef(null);P.useEffect(()=>{var p,c;const t=(p=i.data)==null?void 0:p.content;t&&(d(Z(t.resume)),x(((c=t.info)==null?void 0:c.selfIntro)??""))},[i.data]);const r={...((H=(U=i.data)==null?void 0:U.content)==null?void 0:H.info)??{}},R=((V=u.data)==null?void 0:V.items)??[],n=b??F(),A=P.useMemo(()=>J(R,n),[R,r,s,n]),L=(t,p)=>d(c=>{if(!c)return c;const _=c,N=[..._.sections],h=t+p;return h<0||h>=N.length?_:([N[t],N[h]]=[N[h],N[t]],{..._,sections:N})}),C=t=>{d(t),le({info:{...r,selfIntro:s},resume:t}).catch(p=>a("error",p.message))};P.useEffect(()=>{if(!n.onePage){l(1);return}const t=m.current;if(!t)return;const p=1043,c=t.scrollHeight;l(c>p?Math.max(.7,p/c):1)},[n.onePage,n.fontScale,n.density,A]);const O=n.fontScale*(n.onePage?k:1),ee=()=>{ie(async()=>{const{resumeToWordHtml:t}=await Promise.resolve().then(()=>Pe);return{resumeToWordHtml:t}},void 0).then(({resumeToWordHtml:t})=>{const p=t(A,{...r,selfIntro:s},n,r.photoUrl),c=new Blob(["\uFEFF"+p],{type:"application/msword"}),_=URL.createObjectURL(c),N=document.createElement("a");N.href=_,N.download=(r.name||"个人简历")+".doc",N.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),a("success","Word 文档已导出(按当前模板与字号)")})},te=t=>{var p;return((p=I.find(c=>c.key===t))==null?void 0:p.defaultTitle)??t};return e.jsxs("div",{className:"mx-auto max-w-[1280px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"no-print mb-4 flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"我的简历"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(T,{variant:"secondary",onClick:()=>v(t=>!t),children:[j?e.jsx(ke,{size:13}):e.jsx(je,{size:13}),j?"收起设置":"展开设置"]}),e.jsxs(T,{variant:"secondary",onClick:ee,children:[e.jsx(ae,{size:13})," 导出 Word"]}),e.jsxs(T,{variant:"primary",onClick:()=>window.print(),children:[e.jsx(Ne,{size:13})," 打印 / PDF"]})]})]}),e.jsxs("div",{className:"grid gap-4 "+(j?"lg:grid-cols-[1fr_340px]":"grid-cols-1"),children:[e.jsxs("div",{children:[e.jsx("div",{className:"print-sheet mx-auto w-full max-w-[794px] rounded-lg border border-line bg-white shadow-card",style:{minHeight:n.onePage?1123:void 0},children:e.jsxs("div",{ref:m,className:"p-8 sm:p-10 resume-tpl-"+n.template,style:{zoom:O,"--accent":n.accent},children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-[26px] font-bold leading-tight "+(n.template==="tech"?"text-[var(--accent)]":"text-neutral-900"),children:r.name||"姓名"}),e.jsx("div",{className:"mt-1.5 text-[12.5px] text-neutral-500",children:[r.school,r.college,r.major,r.degree].filter(Boolean).join(" · ")||"完善个人信息后自动展示"}),e.jsx("div",{className:"mt-1 text-[12px] text-neutral-500",children:[r.phone,r.email,r.homepage].filter(Boolean).join(" · ")})]}),r.photoUrl&&e.jsx("img",{src:r.photoUrl,alt:"证件照",className:"h-[110px] w-[82px] rounded border border-neutral-200 object-cover"})]}),A.map(t=>{var p;return e.jsxs("div",{className:"mb-5 r-sec",children:[e.jsx("div",{className:"r-sec-title mb-2.5 text-[14px] font-bold text-neutral-900",children:t.title}),t.kind==="info"?e.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-1 text-[12.5px]",children:[["姓名",r.name],["性别",r.gender],["出生年月",r.birth],["民族",r.nation],["籍贯",r.native],["政治面貌",r.political],["班级",r.className],["学号",r.studentId],["手机",r.phone],["邮箱",r.email]].filter(c=>c[1]).map(([c,_])=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"w-16 shrink-0 text-neutral-500",children:c}),e.jsx("span",{children:_})]},c))}):t.kind==="text"?e.jsx("p",{className:"whitespace-pre-wrap text-neutral-700 "+(n.density==="compact"?"":"leading-relaxed"),children:t.text||"(在右侧板块设置中填写内容)"}):e.jsx("div",{className:n.density==="compact"?"flex flex-col gap-1.5":"flex flex-col gap-3",children:(p=t.items)==null?void 0:p.map(c=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-[13px] font-semibold text-neutral-900 r-item-title",children:c.title}),e.jsx("span",{className:"num shrink-0 text-[11.5px] text-neutral-500",children:c.date??""})]}),c.subtitle&&e.jsx("div",{className:"text-[12px] text-neutral-600",children:c.subtitle}),c.desc&&e.jsx("p",{className:"text-[12px] text-neutral-500 "+(n.density==="compact"?"":"mt-0.5"),children:c.desc})]},c.title+c.date))})]},t.key)})]})}),n.onePage&&e.jsxs("div",{className:"no-print mt-2 text-center text-[11.5px] text-ink-3",children:["一页限定已启用:内容自动缩放 ",Math.round(O*100),"% 以适配单页 A4"]})]}),j&&e.jsxs("div",{className:"no-print flex flex-col gap-4 lg:sticky lg:top-4 lg:self-start",children:[e.jsxs(G,{children:[e.jsx(W,{title:"模板与风格"}),e.jsxs($,{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"grid grid-cols-1 gap-2",children:X.map(t=>e.jsxs("button",{className:"rounded-md border px-3 py-2 text-left transition-all "+(n.template===t.key?"border-brand bg-brand-subtle":"border-line bg-surface hover:border-line-strong"),onClick:()=>C({...n,template:t.key}),children:[e.jsx("div",{className:"text-[12.5px] font-semibold "+(n.template===t.key?"text-brand-text":"text-ink-1"),children:t.name}),e.jsx("div",{className:"text-[11px] text-ink-3",children:t.desc})]},t.key))}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(M,{label:"主题色",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:Y.map(t=>e.jsx("button",{"aria-label":"主题色 "+t,className:"size-5 rounded-full border-2 transition-transform "+(n.accent===t?"scale-110 border-ink-1":"border-transparent"),style:{backgroundColor:t},onClick:()=>C({...n,accent:t})},t))})}),e.jsx(M,{label:"字号",children:e.jsx(q,{value:String(n.fontScale),onChange:t=>C({...n,fontScale:Number(t.target.value)}),options:[{value:"0.9",label:"小"},{value:"1",label:"标准"},{value:"1.1",label:"大"}]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(M,{label:"间距",children:e.jsx(q,{value:n.density,onChange:t=>C({...n,density:t.target.value}),options:[{value:"compact",label:"紧凑"},{value:"normal",label:"标准"},{value:"relaxed",label:"宽松"}]})}),e.jsx(M,{label:"单页限定",children:e.jsx("button",{className:"flex h-9 w-full items-center justify-center gap-1.5 rounded-md border text-[12px] transition-colors "+(n.onePage?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2"),onClick:()=>C({...n,onePage:!n.onePage}),children:n.onePage?"已开启":"已关闭"})})]})]})]}),e.jsxs(G,{children:[e.jsx(W,{title:"板块布局",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"拖动排序 · 内容可编辑"})}),e.jsx($,{className:"p-0",children:e.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[n.sections.map((t,p)=>{var N;const c=g.has(t.key),_=t.kind==="info"?"固定":t.kind==="text"?"文本":"记录";return e.jsxs("div",{draggable:!0,onDragStart:()=>{S.current=t.key},onDragOver:h=>h.preventDefault(),onDrop:()=>{const h=n.sections.findIndex(y=>y.key===S.current);if(h>=0&&h!==p){const y=[...n.sections],[se]=y.splice(h,1);y.splice(p,0,se),C({...n,sections:y})}S.current=null},className:"bg-surface "+(S.current===t.key?"opacity-40":""),children:[e.jsxs("div",{className:"flex items-center gap-1 px-3 py-2",children:[e.jsx(ye,{size:13,className:"shrink-0 cursor-grab text-ink-3"}),e.jsx("input",{className:"min-w-0 flex-1 rounded-sm border border-transparent bg-transparent px-1 py-0.5 text-[12.5px] font-medium text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:t.title,onChange:h=>C({...n,sections:n.sections.map(y=>y.key===t.key?{...y,title:h.target.value}:y)})}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1 disabled:opacity-30","aria-label":"上移",disabled:p===0,onClick:()=>L(p,-1),children:e.jsx(pe,{size:12})}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1 disabled:opacity-30","aria-label":"下移",disabled:p===n.sections.length-1,onClick:()=>L(p,1),children:e.jsx(xe,{size:12})}),e.jsx("button",{className:"ml-0.5 rounded-sm border px-1.5 py-0.5 text-[11px] transition-colors "+(t.enabled?"border-brand/40 bg-brand-subtle text-brand-text":"border-line bg-surface-2 text-ink-3"),onClick:()=>C({...n,sections:n.sections.map(h=>h.key===t.key?{...h,enabled:!h.enabled}:h)}),children:t.enabled?"显示":"隐藏"}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1","aria-label":"展开编辑",onClick:()=>o(h=>{const y=new Set(h);return y.has(t.key)?y.delete(t.key):y.add(t.key),y}),children:e.jsx(he,{size:13,className:"transition-transform "+(c?"rotate-90":"")})})]}),c&&e.jsx("div",{className:"border-t border-line bg-surface-2 px-3 py-2.5",children:t.kind==="text"?e.jsx(K,{rows:4,value:t.text??"",placeholder:"输入该板块内容…",onChange:h=>C({...n,sections:n.sections.map(y=>y.key===t.key?{...y,text:h.target.value}:y)})}):t.kind==="list"?e.jsx(_e,{cfg:n,section:t,records:R,persist:C,sectionTitle:te(t.key)}):e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"基本信息板块来自「个人信息」页,无法在此编辑。"})}),e.jsxs("div",{className:"px-3 pb-1.5 text-[10.5px] text-ink-3",children:[_,(N=t.types)!=null&&N.length?" · "+t.types.join("/"):""]})]},t.key)}),e.jsx("div",{className:"p-3",children:e.jsxs(T,{size:"sm",variant:"secondary",className:"w-full",onClick:()=>{const t="custom_"+Date.now();C({...n,sections:[...n.sections,{key:t,title:"自定义板块",enabled:!0,kind:"text",text:""}]}),o(p=>new Set(p).add(t))},children:[e.jsx(Q,{size:13})," 新增文本板块"]})})]})})]})]})]})]})}function _e({cfg:a,section:i,records:u,persist:b,sectionTitle:d}){const[s,x]=P.useState(null),j=new Set(i.excluded??[]),v=u.filter(l=>(i.types??[]).includes(l.type_name)&&l.status!=="draft").sort((l,m)=>(m.start_date??m.created_at).localeCompare(l.start_date??l.created_at)),g=i.items??[],o=l=>b({...a,sections:a.sections.map(m=>m.key===i.key?{...m,...l}:m)}),k=l=>{const m=new Set(i.excluded??[]);m.has(l)?m.delete(l):m.add(l),o({excluded:[...m]})};return e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"text-[11px] text-ink-3",children:"来自记录的条目(勾选 = 显示)· 另可添加自定义条目"}),v.map(l=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"size-3.5",checked:!j.has(l.id),onChange:()=>k(l.id)}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:l.title}),e.jsx("span",{className:"num shrink-0 text-[11px] text-ink-3",children:(l.start_date??"").slice(0,7)})]},l.id)),e.jsxs("div",{className:"mt-1 border-t border-line pt-2",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[11.5px] font-medium text-ink-2",children:["自定义条目(",g.length,")"]}),e.jsxs(T,{size:"sm",variant:"ghost",onClick:()=>x({title:""}),children:[e.jsx(Q,{size:12})," 添加"]})]}),s&&e.jsxs("div",{className:"mb-2 rounded-md border border-line bg-surface p-2",children:[e.jsx(D,{className:"mb-1.5",placeholder:"标题",value:s.title,onChange:l=>x({...s,title:l.target.value})}),e.jsxs("div",{className:"mb-1.5 grid grid-cols-2 gap-1.5",children:[e.jsx(D,{placeholder:"副标题(单位/角色)",value:s.subtitle??"",onChange:l=>x({...s,subtitle:l.target.value})}),e.jsx(D,{placeholder:"日期(2025-06)",value:s.date??"",onChange:l=>x({...s,date:l.target.value})})]}),e.jsx(K,{rows:2,placeholder:"描述",value:s.desc??"",onChange:l=>x({...s,desc:l.target.value})}),e.jsxs("div",{className:"mt-1.5 flex gap-1.5",children:[e.jsx(T,{size:"sm",variant:"primary",disabled:!s.title.trim(),onClick:()=>{s.title.trim()&&(o({items:[...g,s]}),x(null))},children:"添加"}),e.jsx(T,{size:"sm",variant:"ghost",onClick:()=>x(null),children:"取消"})]})]}),g.map((l,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-surface p-1.5 text-[12px]",children:[e.jsxs("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:[l.title,e.jsxs("span",{className:"text-ink-3",children:[" · ",l.date??""]})]}),e.jsx("button",{className:"text-ink-3 hover:text-danger","aria-label":"删除条目",onClick:()=>o({items:g.filter((S,r)=>r!==m)}),children:e.jsx(re,{size:12})})]},m)),!g.length&&!s&&e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"暂无自定义条目"})]}),e.jsxs("p",{className:"text-[11px] text-ink-3",children:["「",d,"」板块的记录条目来自你的记录数据,此处可隐藏不需要展示的条目。"]})]})}export{Re as ResumePage};