From 9d2e14b72a462e5096d104e0e32d3d02c41ac60d Mon Sep 17 00:00:00 2001 From: root Date: Sat, 17 Oct 2026 12:48:13 +0800 Subject: [PATCH] fix(resume): remove shadowing local ResumeSectionCfg (use types.ts with edu kind) --- app/server/db.mjs | 2 + app/src/lib/resume.ts | 48 +++++++++++-------- app/src/lib/types.ts | 4 +- app/src/pages/profile/ProfilePage.tsx | 9 +++- sync-server/schema.sql | 15 ++++++ ...Page-EK2Zo7TL.js => AdminPage-CU2b53Nb.js} | 6 +-- ...-CPUiI0iy.js => DashboardPage-DNoywp7V.js} | 2 +- ...age-Ij8UzdbZ.js => GradesPage-DDtpIPC0.js} | 2 +- .../www/assets/ProfilePage-Bc_DPBs5.js | 6 +++ .../www/assets/ProfilePage-CL6-SO69.js | 6 --- ...ge-COdEkyD5.js => RecordsPage-BGd2ZncK.js} | 2 +- sync-server/www/assets/ResumePage-BHj_NUxM.js | 36 -------------- sync-server/www/assets/ResumePage-Cej-3M7z.js | 39 +++++++++++++++ ...e-IQFdyHqI.js => TaxonomyPage-c8tjIm6X.js} | 2 +- ...Page-B7GapiTk.js => TypesPage-DbjmBLAq.js} | 2 +- .../{card-BcMbz03g.js => card-BkBMnQAf.js} | 2 +- .../{index-CSVqyJB0.js => index-DWQlGpif.js} | 4 +- ...RYI4-uz.js => mammoth.browser-MQmSAuUh.js} | 2 +- ...Chart-CUy-j464.js => useChart-q1r1yv4-.js} | 2 +- sync-server/www/index.html | 2 +- 20 files changed, 113 insertions(+), 80 deletions(-) rename sync-server/www/assets/{AdminPage-EK2Zo7TL.js => AdminPage-CU2b53Nb.js} (97%) rename sync-server/www/assets/{DashboardPage-CPUiI0iy.js => DashboardPage-DNoywp7V.js} (94%) rename sync-server/www/assets/{GradesPage-Ij8UzdbZ.js => GradesPage-DDtpIPC0.js} (99%) create mode 100644 sync-server/www/assets/ProfilePage-Bc_DPBs5.js delete mode 100644 sync-server/www/assets/ProfilePage-CL6-SO69.js rename sync-server/www/assets/{RecordsPage-COdEkyD5.js => RecordsPage-BGd2ZncK.js} (99%) delete mode 100644 sync-server/www/assets/ResumePage-BHj_NUxM.js create mode 100644 sync-server/www/assets/ResumePage-Cej-3M7z.js rename sync-server/www/assets/{TaxonomyPage-IQFdyHqI.js => TaxonomyPage-c8tjIm6X.js} (97%) rename sync-server/www/assets/{TypesPage-B7GapiTk.js => TypesPage-DbjmBLAq.js} (98%) rename sync-server/www/assets/{card-BcMbz03g.js => card-BkBMnQAf.js} (89%) rename sync-server/www/assets/{index-CSVqyJB0.js => index-DWQlGpif.js} (99%) rename sync-server/www/assets/{mammoth.browser-DRYI4-uz.js => mammoth.browser-MQmSAuUh.js} (99%) rename sync-server/www/assets/{useChart-CUy-j464.js => useChart-q1r1yv4-.js} (92%) diff --git a/app/server/db.mjs b/app/server/db.mjs index c059dfb..55ed233 100644 --- a/app/server/db.mjs +++ b/app/server/db.mjs @@ -336,6 +336,8 @@ function openDb(dbPath) { d.exec('PRAGMA foreign_keys = ON;'); preMigrateColumns(d); d.exec(fs.readFileSync(path.join(__dirname, '..', 'schema.sql'), 'utf8')); + // 个人信息表兜底(确保任何挂载形态下都存在) + d.exec("CREATE TABLE IF NOT EXISTS profile (id INTEGER PRIMARY KEY AUTOINCREMENT, uuid TEXT, content TEXT NOT NULL DEFAULT '{}', deleted_at TEXT, origin TEXT, hlc TEXT)"); migrateSync(d); ensureBuiltin(d); alignBuiltinUuids(d); diff --git a/app/src/lib/resume.ts b/app/src/lib/resume.ts index 5bee697..77f18d6 100644 --- a/app/src/lib/resume.ts +++ b/app/src/lib/resume.ts @@ -1,4 +1,4 @@ -import type { FootprintRow, ProfileInfo, ResumeConfig } from './types'; +import type { FootprintRow, ProfileInfo, ResumeConfig, ResumeSectionCfg } from './types'; // ---------- 简历数据模型 v2 ---------- @@ -6,34 +6,33 @@ export interface ResumeItemCfg { title: string; subtitle?: string; date?: string export interface ResumeSectionDef { key: string; defaultTitle: string; - kind: 'info' | 'list' | 'text'; + kind: 'info' | 'edu' | 'list' | 'text'; types?: string[]; // list 类:从哪些记录类型装配 - fixed?: boolean; // 不可删除/停用(基本信息、自我评价) + fixed?: boolean; // 不可删除/停用 } export const RESUME_SECTION_DEFS: ResumeSectionDef[] = [ { key: 'info', defaultTitle: '基本信息', kind: 'info', fixed: true }, - { key: 'education', defaultTitle: '教育背景', kind: 'list', types: ['学业'] }, - { key: 'skills', defaultTitle: '技能证书', kind: 'list', types: ['证书技能'] }, - { key: 'awards', defaultTitle: '荣誉奖项', kind: 'list', types: ['荣誉惩处'] }, - { key: 'competition', defaultTitle: '竞赛经历', kind: 'list', types: ['竞赛'] }, - { key: 'research', defaultTitle: '科研经历', kind: 'list', types: ['科研'] }, - { key: 'practice', defaultTitle: '实践经历', kind: 'list', types: ['志愿公益', '实习实践', '学生工作'] }, + { key: 'education', defaultTitle: '教育经历', kind: 'edu', fixed: true }, + { 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: 'other', defaultTitle: '其他经历', kind: 'list' }, { key: 'self', defaultTitle: '自我评价', kind: 'text', fixed: true }, ]; -export interface ResumeSectionCfg { - key: string; - title: string; - enabled: boolean; - kind?: 'info' | 'list' | 'text'; - types?: string[]; - excluded?: number[]; // 隐藏的记录 id - items?: ResumeItemCfg[]; // 自定义条目 - text?: string; // text 板块内容 -} +// 首次使用种子内容(IT/网安方向示例,可自由修改) +const SEED: Record = { + skills: { text: '路由交换:熟悉TCP/IP协议栈与基础路由交换,掌握VLAN、链路聚合、MSTP、VRRP/VRRP6等园区网冗余技术,熟悉OSPF、RIP、BGP等动态路由协议,具备IPv4/IPv6双栈网络的规划与部署能力。\n网络安全:熟悉防火墙安全区域、ACL访问控制与安全策略配置,掌握NAPT、NAT Server、NAT64地址转换,了解GRE over IPsec隧道与防火墙双机热备。\n网络设备:熟悉华为交换机、路由器、防火墙CLI操作与配置,掌握GVRP、MSTP、VRRP、链路聚合及BFD联动快速收敛,熟悉Wireshark抓包分析。\n运维基础:熟悉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: '心态沉稳、抗压能力较好,遇到突发状况能冷静应对、稳住局面。做事有计划性,习惯提前预判风险并做好预案,追求稳妥与确定性,执行质量有保障,能在压力下保持稳定输出。责任心强,凡事有始有终,注重细节与条理,能在复杂环境中稳步推进工作,是一名可靠、值得信赖的执行者。' }, +}; + export type ResumeTemplate = 'classic' | 'tech' | 'minimal'; @@ -44,6 +43,9 @@ export function defaultResumeConfig(): ResumeConfig { fontScale: 1, density: 'normal', onePage: false, sections: RESUME_SECTION_DEFS.map(d => ({ key: d.key, title: d.defaultTitle, enabled: true, kind: d.kind, types: d.types, + ...(d.key === 'skills' ? { text: SEED.skills.text } : {}), + ...(d.key === 'campus' ? { items: SEED.campus.items } : {}), + ...(d.key === 'self' ? { text: SEED.self.text } : {}), })), }; } @@ -57,7 +59,11 @@ export function migrateResumeConfig(raw: unknown): ResumeConfig { const sections = def.sections.map(d => { const old = oldSections.find(o => o.key === d.key); const dd = RESUME_SECTION_DEFS.find(x => x.key === d.key); - return { ...d, enabled: old?.enabled ?? true, title: old?.title ?? dd?.defaultTitle ?? d.title }; + const base: ResumeSectionCfg = { ...d, enabled: old?.enabled ?? true, title: old?.title ?? dd?.defaultTitle ?? d.title }; + if (d.key === 'skills' && !base.text) base.text = SEED.skills.text; + if (d.key === 'campus' && !(base.items?.length)) base.items = SEED.campus.items; + if (d.key === 'self' && !base.text) base.text = SEED.self.text; + return base; }); // v1 里用户新增的板块(不在默认定义中)→ 追加为自定义文本板块 for (const o of oldSections) { diff --git a/app/src/lib/types.ts b/app/src/lib/types.ts index ed5e537..3fa8952 100644 --- a/app/src/lib/types.ts +++ b/app/src/lib/types.ts @@ -235,7 +235,7 @@ export interface GradesOverview { export interface ProfileInfo { name: string; gender: string; birth: string; nation: string; native: string; political: string; school: string; college: string; major: string; - className: string; studentId: string; degree: string; + className: string; studentId: string; degree: string; eduLength: string; eduStart: string; eduEnd: string; majorCourses: string; phone: string; email: string; homepage: string; photoUrl: string; selfIntro: string; } @@ -243,7 +243,7 @@ export interface ResumeItemCfg { title: string; subtitle?: string; date?: string export interface ResumeSectionCfg { key: string; title: string; enabled: boolean; - kind?: 'info' | 'list' | 'text'; + kind?: 'info' | 'edu' | 'list' | 'text'; types?: string[]; excluded?: number[]; items?: ResumeItemCfg[]; diff --git a/app/src/pages/profile/ProfilePage.tsx b/app/src/pages/profile/ProfilePage.tsx index 6166acf..ba0e2c8 100644 --- a/app/src/pages/profile/ProfilePage.tsx +++ b/app/src/pages/profile/ProfilePage.tsx @@ -8,7 +8,8 @@ import { Button, Dialog, Field, Input, Select, Textarea, useToast } from '@/comp const EMPTY: ProfileInfo = { name: '', gender: '', birth: '', nation: '', native: '', political: '', school: '', college: '', major: '', className: '', studentId: '', degree: '', - phone: '', email: '', homepage: '', photoUrl: '', selfIntro: '' + phone: '', email: '', homepage: '', photoUrl: '', selfIntro: '', + eduLength: '', eduStart: '', eduEnd: '', majorCourses: '' }; const FIELD_GROUPS: { title: string; fields: { key: keyof ProfileInfo; label: string; type?: string; options?: string[] }[] }[] = [ @@ -27,6 +28,12 @@ const FIELD_GROUPS: { title: string; fields: { key: keyof ProfileInfo; label: st { key: 'className', label: '班级' }, { key: 'studentId', label: '学号' }, { key: 'degree', label: '学历层次', options: ['', '专科', '本科', '硕士研究生', '博士研究生'] }, + { key: 'eduLength', label: '学制', options: ['', '两年', '三年', '四年', '五年'] }, + { key: 'eduStart', label: '入学时间', type: 'month' }, + { key: 'eduEnd', label: '毕业时间', type: 'month' }, + ]}, + { title: '主修课程', fields: [ + { key: 'majorCourses', label: '主修课程' }, ]}, { title: '联系方式', fields: [ { key: 'phone', label: '手机' }, diff --git a/sync-server/schema.sql b/sync-server/schema.sql index 0e22119..b41ef94 100644 --- a/sync-server/schema.sql +++ b/sync-server/schema.sql @@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS footprint_type ( color TEXT NOT NULL DEFAULT '#64748b', sort INTEGER NOT NULL DEFAULT 100, form_template TEXT NOT NULL DEFAULT '[]', + profile TEXT, is_builtin INTEGER NOT NULL DEFAULT 0, closed INTEGER NOT NULL DEFAULT 0, deleted_at TEXT, @@ -89,6 +90,11 @@ CREATE TABLE IF NOT EXISTS attachment ( size INTEGER NOT NULL DEFAULT 0, rel_path TEXT NOT NULL, sha256 TEXT, + thumb_rel_path TEXT, + remote_url TEXT, + remote_thumb TEXT, + remote_key TEXT, + remote_thumb_key TEXT, taken_at TEXT, deleted_at TEXT, origin TEXT, @@ -197,6 +203,15 @@ CREATE TRIGGER IF NOT EXISTS footprint_au AFTER UPDATE OF search_text ON footpri END; CREATE INDEX IF NOT EXISTS idx_footprint_start ON footprint(start_date); +CREATE TABLE IF NOT EXISTS profile ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + uuid TEXT, + content TEXT NOT NULL DEFAULT '{}', + deleted_at TEXT, + origin TEXT, + hlc TEXT +); + CREATE INDEX IF NOT EXISTS idx_footprint_type ON footprint(type_id); CREATE INDEX IF NOT EXISTS idx_footprint_group ON footprint(group_id); CREATE INDEX IF NOT EXISTS idx_footprint_hlc ON footprint(hlc); diff --git a/sync-server/www/assets/AdminPage-EK2Zo7TL.js b/sync-server/www/assets/AdminPage-CU2b53Nb.js similarity index 97% rename from sync-server/www/assets/AdminPage-EK2Zo7TL.js rename to sync-server/www/assets/AdminPage-CU2b53Nb.js index 63b617b..98bcf4f 100644 --- a/sync-server/www/assets/AdminPage-EK2Zo7TL.js +++ b/sync-server/www/assets/AdminPage-CU2b53Nb.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CSVqyJB0.js","assets/index-CIs6Yi-t.css"])))=>i.map(i=>d[i]); -import{c as o,u as Z,_ as J,f as _,$ as C,r as n,g as h,j as s,E as w,B as t,a0 as U,P as Y,I as z,k as ee,l as se,T as ae,m as p,a1 as te,a2 as ne,a3 as ie,a4 as re,a5 as ce,a6 as de,a7 as le,a8 as oe}from"./index-CSVqyJB0.js";import{C as $,a as B,b as O}from"./card-BcMbz03g.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DWQlGpif.js","assets/index-CIs6Yi-t.css"])))=>i.map(i=>d[i]); +import{c as o,u as Z,_ as J,f as _,$ as C,r as n,g as h,j as s,E as w,B as t,a0 as U,P as Y,I as z,k as ee,l as se,T as ae,m as p,a1 as te,a2 as ne,a3 as ie,a4 as re,a5 as ce,a6 as de,a7 as le,a8 as oe}from"./index-DWQlGpif.js";import{C as $,a as B,b as O}from"./card-BkBMnQAf.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. @@ -24,5 +24,5 @@ import{c as o,u as Z,_ as J,f as _,$ as C,r as n,g as h,j as s,E as w,B as t,a0 * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ye=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],fe=o("UsersRound",ye);function ke({i:c}){return c.used_by?s.jsx(p,{color:"var(--text-3)",children:"已使用"}):c.valid?s.jsx(p,{color:"var(--success)",children:"可用"}):s.jsx(p,{color:"var(--warning)",children:"已停用"})}function Ne(){var Q,K,L;const c=Z(),i=J(),E=_({queryKey:["me-admin"],queryFn:async()=>(await de(()=>import("./index-CSVqyJB0.js").then(a=>a.ah),__vite__mapDeps([0,1]))).serverMe(i),enabled:!!C()}),M=_({queryKey:["admin-users"],queryFn:()=>le(i),enabled:!!C()}),v=_({queryKey:["admin-invites"],queryFn:()=>oe(i),enabled:!!C()}),[I,r]=n.useState(""),[H,S]=n.useState(null),[V,j]=n.useState(!1),[x,y]=n.useState(""),[q,f]=n.useState(""),[G,d]=n.useState(null),[k,b]=n.useState(""),[l,W]=n.useState("all"),m=()=>{c.invalidateQueries({queryKey:["admin-invites"]})},u=e=>r(e.message||"操作失败"),F=h({mutationFn:()=>ne(5,i),onSuccess:e=>{m(),r(""),navigator.clipboard.writeText(e.codes.join(` + */const ye=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],fe=o("UsersRound",ye);function ke({i:c}){return c.used_by?s.jsx(p,{color:"var(--text-3)",children:"已使用"}):c.valid?s.jsx(p,{color:"var(--success)",children:"可用"}):s.jsx(p,{color:"var(--warning)",children:"已停用"})}function Ne(){var Q,K,L;const c=Z(),i=J(),E=_({queryKey:["me-admin"],queryFn:async()=>(await de(()=>import("./index-DWQlGpif.js").then(a=>a.ah),__vite__mapDeps([0,1]))).serverMe(i),enabled:!!C()}),M=_({queryKey:["admin-users"],queryFn:()=>le(i),enabled:!!C()}),v=_({queryKey:["admin-invites"],queryFn:()=>oe(i),enabled:!!C()}),[I,r]=n.useState(""),[H,S]=n.useState(null),[V,j]=n.useState(!1),[x,y]=n.useState(""),[q,f]=n.useState(""),[G,d]=n.useState(null),[k,b]=n.useState(""),[l,W]=n.useState("all"),m=()=>{c.invalidateQueries({queryKey:["admin-invites"]})},u=e=>r(e.message||"操作失败"),F=h({mutationFn:()=>ne(5,i),onSuccess:e=>{m(),r(""),navigator.clipboard.writeText(e.codes.join(` `)).catch(()=>{})},onError:u}),g=h({mutationFn:()=>ie(x.trim(),q.trim(),i),onSuccess:()=>{m(),j(!1),y(""),f(""),r("")},onError:u}),N=h({mutationFn:e=>re(e.id,e.patch,i),onSuccess:()=>{m(),d(null),r("")},onError:u}),X=h({mutationFn:e=>ce(e,i),onSuccess:()=>{m(),r("")},onError:u}),T=n.useMemo(()=>{var e;return((e=v.data)==null?void 0:e.invites)??[]},[v.data]),P=((Q=M.data)==null?void 0:Q.users)??[],R=n.useMemo(()=>T.filter(e=>l==="valid"?e.valid&&!e.used_by:l==="used"?!!e.used_by:l==="disabled"?!e.valid&&!e.used_by:!0),[T,l]);if(E.data&&!E.data.is_admin)return s.jsx(w,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const D=e=>{navigator.clipboard.writeText(e.code),S(e.id),setTimeout(()=>S(a=>a===e.id?null:a),1500)};return s.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"管理"}),s.jsxs(t,{variant:"secondary",onClick:()=>{c.invalidateQueries()},children:[s.jsx(pe,{size:13})," 刷新"]})]}),I&&s.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-md border border-danger/30 bg-danger-subtle px-3 py-2 text-[12px] text-danger",children:[s.jsx("span",{children:I}),s.jsx("button",{className:"rounded p-0.5 hover:bg-surface-3",onClick:()=>r(""),"aria-label":"关闭",children:s.jsx(U,{size:13})})]}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsxs($,{children:[s.jsx(B,{title:"邀请码("+(((K=v.data)==null?void 0:K.total)??0)+")",extra:s.jsxs("div",{className:"flex gap-1.5",children:[s.jsxs(t,{size:"sm",variant:"secondary",onClick:()=>{j(e=>!e),r("")},children:[s.jsx(Y,{size:13})," 新建"]}),s.jsx(t,{size:"sm",variant:"primary",disabled:F.isPending,onClick:()=>F.mutate(),children:"批量生成 5 个"})]})}),s.jsxs(O,{className:"p-0",children:[V&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b border-line bg-surface-2 px-4 py-3",children:[s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"邀请码(4-32 位字母数字-_)"}),s.jsx(z,{className:"w-[210px]",value:x,placeholder:"如 XIONG-2025",onChange:e=>y(e.target.value)})]}),s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"备注(可选)"}),s.jsx(z,{className:"w-[180px]",value:q,placeholder:"发给谁 / 用途",onChange:e=>f(e.target.value),onKeyDown:e=>{e.key==="Enter"&&x.trim()&&g.mutate()}})]}),s.jsxs("div",{className:"flex gap-1.5 pb-0.5",children:[s.jsx(t,{size:"sm",variant:"primary",disabled:!x.trim()||g.isPending,onClick:()=>g.mutate(),children:"创建"}),s.jsx(t,{size:"sm",variant:"ghost",onClick:()=>{j(!1),y(""),f("")},children:"取消"})]})]}),s.jsx("div",{className:"flex gap-1 border-b border-line px-4 py-2 text-[12px]",children:[["all","全部"],["valid","可用"],["used","已使用"],["disabled","已停用"]].map(([e,a])=>s.jsx("button",{className:"rounded-md px-2.5 py-1 transition-colors "+(l===e?"bg-brand-subtle font-medium text-brand-text":"text-ink-3 hover:bg-surface-3"),onClick:()=>W(e),children:a},e))}),R.length?s.jsx("div",{className:"divide-y divide-line max-h-[430px] overflow-y-auto",children:R.map(e=>s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[s.jsx("button",{className:"num shrink-0 cursor-pointer rounded-sm bg-surface-3 px-1.5 py-0.5 font-mono text-[12px] text-ink-1 transition-colors hover:bg-brand-subtle hover:text-brand-text",title:"点击复制",onClick:()=>D(e),children:H===e.id?s.jsxs("span",{className:"inline-flex items-center gap-1 text-success",children:[s.jsx(A,{size:11}),"已复制"]}):e.code}),s.jsx(ke,{i:e}),G===e.id?s.jsxs("span",{className:"ml-1 flex min-w-0 flex-1 items-center gap-1",children:[s.jsx(z,{className:"h-7 flex-1 text-[12px]",value:k,autoFocus:!0,placeholder:"备注(64 字以内)",onChange:a=>b(a.target.value),onKeyDown:a=>{a.key==="Enter"&&N.mutate({id:e.id,patch:{remark:k}}),a.key==="Escape"&&d(null)}}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"保存备注",className:"text-success",onClick:()=>N.mutate({id:e.id,patch:{remark:k}}),children:s.jsx(A,{size:13})}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"取消",className:"text-ink-3",onClick:()=>d(null),children:s.jsx(U,{size:13})})]}):s.jsx("button",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-ink-3 hover:text-ink-2",title:e.remark?"点击编辑备注":e.created_by_name?"由 "+e.created_by_name+" 创建 · 点击添加备注":"点击添加备注",onClick:()=>{d(e.id),b(e.remark??"")},children:e.remark||(e.created_by_name?"由 "+e.created_by_name+" 创建":s.jsx("span",{className:"opacity-60",children:"添加备注…"}))}),e.used_by_name&&s.jsxs("span",{className:"shrink-0 text-ink-3",children:["被 ",e.used_by_name," 使用于 ",ee(e.used_at)]}),s.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"复制",className:"text-ink-3",onClick:()=>D(e),children:s.jsx(ue,{size:13})}),!e.used_by&&s.jsxs(s.Fragment,{children:[s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"编辑备注",className:"text-ink-3",onClick:()=>{d(e.id),b(e.remark??"")},children:s.jsx(se,{size:13})}),s.jsx(t,{size:"sm",variant:"ghost",className:e.valid?"text-ink-3 hover:text-warning":"text-ink-3 hover:text-success",onClick:()=>N.mutate({id:e.id,patch:{valid:!e.valid}}),children:e.valid?"停用":"启用"})]}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"删除",className:"text-ink-3 hover:text-danger",onClick:()=>{window.confirm("删除邀请码 "+e.code+"?此操作不可恢复。")&&X.mutate(e.id)},children:s.jsx(ae,{size:13})})]})]},e.id))}):s.jsx(w,{icon:s.jsx(je,{size:32,strokeWidth:1.5}),title:"暂无符合条件的邀请码",description:"新建自定义邀请码,或批量生成后发给需要注册的用户。"})]})]}),s.jsxs($,{children:[s.jsx(B,{title:"用户("+(((L=M.data)==null?void 0:L.total)??0)+")"}),s.jsx(O,{className:"p-0",children:P.length?s.jsx("div",{className:"divide-y divide-line max-h-[520px] overflow-y-auto",children:P.map(e=>s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[s.jsx("span",{className:"font-medium text-ink-1",children:e.username}),e.is_admin&&s.jsx(p,{color:"var(--brand-text)",children:"管理员"}),s.jsxs("span",{className:"num ml-auto text-ink-3",children:[e.devices," 设备 · ",e.records," 记录 · ",te(e.attachment_bytes)]})]},e.id))}):s.jsx(w,{icon:s.jsx(fe,{size:32,strokeWidth:1.5}),title:"暂无用户"})})]})]})]})}export{Ne as AdminPage}; diff --git a/sync-server/www/assets/DashboardPage-CPUiI0iy.js b/sync-server/www/assets/DashboardPage-DNoywp7V.js similarity index 94% rename from sync-server/www/assets/DashboardPage-CPUiI0iy.js rename to sync-server/www/assets/DashboardPage-DNoywp7V.js index c91be60..80e411b 100644 --- a/sync-server/www/assets/DashboardPage-CPUiI0iy.js +++ b/sync-server/www/assets/DashboardPage-DNoywp7V.js @@ -1 +1 @@ -import{r as g,f as v,j as t,S as j,t as S}from"./index-CSVqyJB0.js";import{C as c,a as d,b as x}from"./card-BcMbz03g.js";import{u as N,i as u,a as m}from"./useChart-CUy-j464.js";import{u as k,i as w,a as C,b as L,c as R,d as $,e as z,f as T}from"./echarts-BIWefrIc.js";k([w,C,L,R,$,z,T]);function q(){const[l,n]=g.useState(""),i=N(),e=v({queryKey:["stats",l||void 0],queryFn:()=>S(l?Number(l):void 0)}).data,p=u("2"),r=u("3"),h=m(()=>({grid:{left:34,right:12,top:14,bottom:24},tooltip:{trigger:"axis"},xAxis:{type:"category",data:(e==null?void 0:e.monthly.map(a=>a.ym.slice(2)))??[],axisLine:{lineStyle:{color:r}},axisTick:{show:!1},axisLabel:{color:r,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},series:[{type:"bar",data:(e==null?void 0:e.monthly.map(a=>a.count))??[],barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]}}]}),[e,i]),b=m(()=>{const a=((e==null?void 0:e.by_type)??[]).filter(s=>s.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:4,top:"middle",textStyle:{color:p,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:a.map(s=>({name:s.label,value:s.count,itemStyle:{color:s.color||"#64748b"}}))}]}},[e,i]),y=m(()=>{const a=((e==null?void 0:e.by_level)??[]).filter(s=>s.count>0).slice().reverse();return{grid:{left:64,right:24,top:8,bottom:22},tooltip:{trigger:"axis"},xAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},yAxis:{type:"category",data:a.map(s=>s.label),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:p,fontSize:11}},series:[{type:"bar",data:a.map(s=>({value:s.count,itemStyle:{color:s.color||"#3056d3",borderRadius:[0,3,3,0]}})),barMaxWidth:14}]}},[e,i]),f=((e==null?void 0:e.metrics)??[]).slice(0,3);return t.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(o,{label:"总记录",value:(e==null?void 0:e.total)??0}),t.jsx(o,{label:l?l+" 年新增":"本年新增",value:(e==null?void 0:e.total_this_year)??0}),t.jsx(o,{label:"附件总数",value:(e==null?void 0:e.attachment_total)??0}),f.map(a=>t.jsx(o,{label:a.label,value:a.value,unit:a.unit??""},a.key))]}),t.jsx(j,{className:"w-[120px]",value:l,onChange:a=>n(a.target.value),options:[{value:"",label:"全部年份"},...((e==null?void 0:e.years)??[]).map(a=>({value:String(a),label:a+" 年"}))]})]}),!(e!=null&&e.metrics.length)&&t.jsx("div",{className:"mb-4 rounded-md border border-dashed border-line px-4 py-2 text-[12px] text-ink-3",children:"提示:在「统计」配置中注册指标(如志愿时长、读书本数),带单位的数值字段即可在此量化展示。"}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs(c,{children:[t.jsx(d,{title:"近 12 个月活跃度"}),t.jsx(x,{children:t.jsx("div",{ref:h,className:"h-[220px]"})})]}),t.jsxs(c,{children:[t.jsx(d,{title:"类型分布"}),t.jsx(x,{children:t.jsx("div",{ref:b,className:"h-[220px]"})})]}),t.jsxs(c,{className:"lg:col-span-2",children:[t.jsx(d,{title:"级别分布"}),t.jsx(x,{children:t.jsx("div",{ref:y,className:"h-[200px]"})})]})]})]})}function o({label:l,value:n,unit:i}){return t.jsxs("div",{className:"min-w-[120px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[t.jsx("div",{className:"text-[12px] text-ink-3",children:l}),t.jsxs("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:[n,i&&t.jsx("span",{className:"ml-1 text-[12px] font-normal text-ink-3",children:i})]})]})}export{q as DashboardPage}; +import{r as g,f as v,j as t,S as j,t as S}from"./index-DWQlGpif.js";import{C as c,a as d,b as x}from"./card-BkBMnQAf.js";import{u as N,i as u,a as m}from"./useChart-q1r1yv4-.js";import{u as k,i as w,a as C,b as L,c as R,d as $,e as z,f as T}from"./echarts-BIWefrIc.js";k([w,C,L,R,$,z,T]);function q(){const[l,n]=g.useState(""),i=N(),e=v({queryKey:["stats",l||void 0],queryFn:()=>S(l?Number(l):void 0)}).data,p=u("2"),r=u("3"),h=m(()=>({grid:{left:34,right:12,top:14,bottom:24},tooltip:{trigger:"axis"},xAxis:{type:"category",data:(e==null?void 0:e.monthly.map(a=>a.ym.slice(2)))??[],axisLine:{lineStyle:{color:r}},axisTick:{show:!1},axisLabel:{color:r,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},series:[{type:"bar",data:(e==null?void 0:e.monthly.map(a=>a.count))??[],barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]}}]}),[e,i]),b=m(()=>{const a=((e==null?void 0:e.by_type)??[]).filter(s=>s.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:4,top:"middle",textStyle:{color:p,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:a.map(s=>({name:s.label,value:s.count,itemStyle:{color:s.color||"#64748b"}}))}]}},[e,i]),y=m(()=>{const a=((e==null?void 0:e.by_level)??[]).filter(s=>s.count>0).slice().reverse();return{grid:{left:64,right:24,top:8,bottom:22},tooltip:{trigger:"axis"},xAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},yAxis:{type:"category",data:a.map(s=>s.label),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:p,fontSize:11}},series:[{type:"bar",data:a.map(s=>({value:s.count,itemStyle:{color:s.color||"#3056d3",borderRadius:[0,3,3,0]}})),barMaxWidth:14}]}},[e,i]),f=((e==null?void 0:e.metrics)??[]).slice(0,3);return t.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(o,{label:"总记录",value:(e==null?void 0:e.total)??0}),t.jsx(o,{label:l?l+" 年新增":"本年新增",value:(e==null?void 0:e.total_this_year)??0}),t.jsx(o,{label:"附件总数",value:(e==null?void 0:e.attachment_total)??0}),f.map(a=>t.jsx(o,{label:a.label,value:a.value,unit:a.unit??""},a.key))]}),t.jsx(j,{className:"w-[120px]",value:l,onChange:a=>n(a.target.value),options:[{value:"",label:"全部年份"},...((e==null?void 0:e.years)??[]).map(a=>({value:String(a),label:a+" 年"}))]})]}),!(e!=null&&e.metrics.length)&&t.jsx("div",{className:"mb-4 rounded-md border border-dashed border-line px-4 py-2 text-[12px] text-ink-3",children:"提示:在「统计」配置中注册指标(如志愿时长、读书本数),带单位的数值字段即可在此量化展示。"}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs(c,{children:[t.jsx(d,{title:"近 12 个月活跃度"}),t.jsx(x,{children:t.jsx("div",{ref:h,className:"h-[220px]"})})]}),t.jsxs(c,{children:[t.jsx(d,{title:"类型分布"}),t.jsx(x,{children:t.jsx("div",{ref:b,className:"h-[220px]"})})]}),t.jsxs(c,{className:"lg:col-span-2",children:[t.jsx(d,{title:"级别分布"}),t.jsx(x,{children:t.jsx("div",{ref:y,className:"h-[200px]"})})]})]})]})}function o({label:l,value:n,unit:i}){return t.jsxs("div",{className:"min-w-[120px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[t.jsx("div",{className:"text-[12px] text-ink-3",children:l}),t.jsxs("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:[n,i&&t.jsx("span",{className:"ml-1 text-[12px] font-normal text-ink-3",children:i})]})]})}export{q as DashboardPage}; diff --git a/sync-server/www/assets/GradesPage-Ij8UzdbZ.js b/sync-server/www/assets/GradesPage-DDtpIPC0.js similarity index 99% rename from sync-server/www/assets/GradesPage-Ij8UzdbZ.js rename to sync-server/www/assets/GradesPage-DDtpIPC0.js index 890cf54..43f4045 100644 --- a/sync-server/www/assets/GradesPage-Ij8UzdbZ.js +++ b/sync-server/www/assets/GradesPage-DDtpIPC0.js @@ -1,4 +1,4 @@ -import{c as R,f as I,j as e,E as O,w as $,u as N,d as f,r as u,g as v,x as H,y as W,B as b,P as q,C as L,z as J,A as T,D as U,m as k,l as F,T as z,I as g,F as Y,H as S,J as E,K as V}from"./index-CSVqyJB0.js";import{C,a as M,b as _}from"./card-BcMbz03g.js";import{u as X,i as Q,a as K}from"./useChart-CUy-j464.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}from"./echarts-BIWefrIc.js";/** +import{c as R,f as I,j as e,E as O,w as $,u as N,d as f,r as u,g as v,x as H,y as W,B as b,P as q,C as L,z as J,A as T,D as U,m as k,l as F,T as z,I as g,F as Y,H as S,J as E,K as V}from"./index-DWQlGpif.js";import{C,a as M,b as _}from"./card-BkBMnQAf.js";import{u as X,i as Q,a as K}from"./useChart-q1r1yv4-.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}from"./echarts-BIWefrIc.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/ProfilePage-Bc_DPBs5.js b/sync-server/www/assets/ProfilePage-Bc_DPBs5.js new file mode 100644 index 0000000..87368bc --- /dev/null +++ b/sync-server/www/assets/ProfilePage-Bc_DPBs5.js @@ -0,0 +1,6 @@ +import{c as E,u as P,d as S,r as p,f as U,g as F,j as e,B as f,l as q,a9 as B,F as L,H as k,S as z,I as M,aa as Q,ab as _,ac as v,ad as K}from"./index-DWQlGpif.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 T=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],D=E("Upload",T),n={name:"",gender:"",birth:"",nation:"",native:"",political:"",school:"",college:"",major:"",className:"",studentId:"",degree:"",phone:"",email:"",homepage:"",photoUrl:"",selfIntro:"",eduLength:"",eduStart:"",eduEnd:"",majorCourses:""},N=[{title:"基本信息",fields:[{key:"name",label:"姓名"},{key:"gender",label:"性别",options:["","男","女"]},{key:"birth",label:"出生日期",type:"date"},{key:"nation",label:"民族"},{key:"native",label:"籍贯"},{key:"political",label:"政治面貌"}]},{title:"学校信息",fields:[{key:"school",label:"学校"},{key:"college",label:"学院"},{key:"major",label:"专业"},{key:"className",label:"班级"},{key:"studentId",label:"学号"},{key:"degree",label:"学历层次",options:["","专科","本科","硕士研究生","博士研究生"]},{key:"eduLength",label:"学制",options:["","两年","三年","四年","五年"]},{key:"eduStart",label:"入学时间",type:"month"},{key:"eduEnd",label:"毕业时间",type:"month"}]},{title:"主修课程",fields:[{key:"majorCourses",label:"主修课程"}]},{title:"联系方式",fields:[{key:"phone",label:"手机"},{key:"email",label:"邮箱"},{key:"homepage",label:"个人主页 / 博客"}]}];function H(){var g,j;const m=P(),o=S(),[w,r]=p.useState(!1),[i,d]=p.useState(n),[h,u]=p.useState(!1),y=U({queryKey:["profile"],queryFn:K}),a=((j=(g=y.data)==null?void 0:g.content)==null?void 0:j.info)??{},c=t=>d(s=>({...n,...s,...t})),C=()=>{d({...n,...a}),r(!0)},b=F({mutationFn:()=>v({info:i}),onSuccess:()=>{o("success","个人信息已保存"),r(!1),m.invalidateQueries({queryKey:["profile"]})},onError:t=>o("error",t.message)}),I=async t=>{if(t){u(!0);try{const s=await _(t),l={...n,...i,photoUrl:s};d(l),await v({info:l}),m.invalidateQueries({queryKey:["profile"]}),o("success","证件照已上传")}catch(s){o("error",s.message)}u(!1)}},x=a.photoUrl;return e.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"个人信息"}),e.jsxs(f,{variant:"primary",onClick:C,children:[e.jsx(q,{size:13})," 编辑"]})]}),y.isLoading?e.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):e.jsxs("div",{className:"rounded-lg border border-line bg-surface shadow-card",children:[e.jsxs("div",{className:"flex flex-col gap-4 border-b border-line p-4 sm:flex-row sm:items-center",children:[e.jsx("div",{className:"flex size-20 shrink-0 items-center justify-center overflow-hidden rounded-full border border-line bg-surface-2",children:x?e.jsx("img",{src:x,alt:"证件照",className:"h-full w-full object-cover"}):e.jsx(B,{size:32,className:"text-ink-3"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[17px] font-semibold text-ink-1",children:a.name||"未填写姓名"}),e.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:[a.school,a.college,a.major].filter(Boolean).join(" · ")||"完善学校信息后,简历将自动填充"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-[12px] text-ink-2 transition-colors hover:border-line-strong",children:[e.jsx(D,{size:13}),h?"上传中…":x?"更换证件照":"上传证件照",e.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:h,onChange:t=>{var s;I((s=t.target.files)==null?void 0:s[0]),t.target.value=""}})]})]}),N.map(t=>e.jsxs("div",{className:"border-b border-line px-4 py-3 last:border-b-0",children:[e.jsx("div",{className:"mb-2 text-[12px] font-semibold text-ink-2",children:t.title}),e.jsx("dl",{className:"grid grid-cols-1 gap-x-6 gap-y-1.5 sm:grid-cols-2",children:t.fields.map(s=>{const l=a[s.key]||"";return e.jsxs("div",{className:"grid min-w-0 grid-cols-[84px_1fr] gap-x-2.5 py-0.5",children:[e.jsx("dt",{className:"shrink-0 text-right text-[12px] text-ink-3",children:s.label}),e.jsx("dd",{className:"min-w-0 truncate text-[12.5px] "+(l?"text-ink-1":"text-ink-3/60"),title:l,children:l||"未填写"})]},s.key)})})]},t.title))]}),!a.selfIntro&&e.jsx("div",{className:"mt-3 rounded-md border border-dashed border-line px-4 py-2.5 text-[12px] text-ink-3",children:"提示:编辑里填写「自我评价」后,可一键用于简历生成。"}),e.jsx(L,{open:w,onClose:()=>r(!1),width:720,title:"编辑个人信息",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mr-auto text-[12px] text-ink-3",children:"填写一次,填表与简历自动复用"}),e.jsx(f,{variant:"primary",onClick:()=>b.mutate(),disabled:b.isPending,children:"保存"})]}),children:e.jsxs("div",{className:"flex flex-col gap-4",children:[N.map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-semibold text-ink-2",children:t.title}),e.jsx("div",{className:"grid grid-cols-1 gap-x-3 gap-y-3 sm:grid-cols-2",children:t.fields.map(s=>e.jsx(k,{label:s.label,children:s.options?e.jsx(z,{value:i[s.key]||"",onChange:l=>c({[s.key]:l.target.value}),options:s.options.map(l=>({value:l,label:l||"未选择"}))}):e.jsx(M,{type:s.type||"text",value:i[s.key]||"",onChange:l=>c({[s.key]:l.target.value})})},s.key))})]},t.title)),e.jsx("div",{className:"border-t border-line pt-3",children:e.jsx(k,{label:"自我评价",hint:"简历「自我评价」板块使用",children:e.jsx(Q,{rows:4,value:i.selfIntro,onChange:t=>c({selfIntro:t.target.value}),placeholder:"简述性格、能力、方向…"})})})]})})]})}export{H as ProfilePage}; diff --git a/sync-server/www/assets/ProfilePage-CL6-SO69.js b/sync-server/www/assets/ProfilePage-CL6-SO69.js deleted file mode 100644 index 0aa47d1..0000000 --- a/sync-server/www/assets/ProfilePage-CL6-SO69.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as U,u as C,d as E,r as p,f as F,g as S,j as e,B as f,l as q,a9 as B,F as z,H as k,S as M,I as Q,aa as _,ab as K,ac as v,ad as L}from"./index-CSVqyJB0.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 T=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],D=U("Upload",T),r={name:"",gender:"",birth:"",nation:"",native:"",political:"",school:"",college:"",major:"",className:"",studentId:"",degree:"",phone:"",email:"",homepage:"",photoUrl:"",selfIntro:""},N=[{title:"基本信息",fields:[{key:"name",label:"姓名"},{key:"gender",label:"性别",options:["","男","女"]},{key:"birth",label:"出生日期",type:"date"},{key:"nation",label:"民族"},{key:"native",label:"籍贯"},{key:"political",label:"政治面貌"}]},{title:"学校信息",fields:[{key:"school",label:"学校"},{key:"college",label:"学院"},{key:"major",label:"专业"},{key:"className",label:"班级"},{key:"studentId",label:"学号"},{key:"degree",label:"学历层次",options:["","专科","本科","硕士研究生","博士研究生"]}]},{title:"联系方式",fields:[{key:"phone",label:"手机"},{key:"email",label:"邮箱"},{key:"homepage",label:"个人主页 / 博客"}]}];function H(){var g,j;const m=C(),o=E(),[w,n]=p.useState(!1),[i,d]=p.useState(r),[h,u]=p.useState(!1),b=F({queryKey:["profile"],queryFn:L}),a=((j=(g=b.data)==null?void 0:g.content)==null?void 0:j.info)??{},c=t=>d(s=>({...r,...s,...t})),I=()=>{d({...r,...a}),n(!0)},y=S({mutationFn:()=>v({info:i}),onSuccess:()=>{o("success","个人信息已保存"),n(!1),m.invalidateQueries({queryKey:["profile"]})},onError:t=>o("error",t.message)}),P=async t=>{if(t){u(!0);try{const s=await K(t),l={...r,...i,photoUrl:s};d(l),await v({info:l}),m.invalidateQueries({queryKey:["profile"]}),o("success","证件照已上传")}catch(s){o("error",s.message)}u(!1)}},x=a.photoUrl;return e.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"个人信息"}),e.jsxs(f,{variant:"primary",onClick:I,children:[e.jsx(q,{size:13})," 编辑"]})]}),b.isLoading?e.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):e.jsxs("div",{className:"rounded-lg border border-line bg-surface shadow-card",children:[e.jsxs("div",{className:"flex flex-col gap-4 border-b border-line p-4 sm:flex-row sm:items-center",children:[e.jsx("div",{className:"flex size-20 shrink-0 items-center justify-center overflow-hidden rounded-full border border-line bg-surface-2",children:x?e.jsx("img",{src:x,alt:"证件照",className:"h-full w-full object-cover"}):e.jsx(B,{size:32,className:"text-ink-3"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[17px] font-semibold text-ink-1",children:a.name||"未填写姓名"}),e.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:[a.school,a.college,a.major].filter(Boolean).join(" · ")||"完善学校信息后,简历将自动填充"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-[12px] text-ink-2 transition-colors hover:border-line-strong",children:[e.jsx(D,{size:13}),h?"上传中…":x?"更换证件照":"上传证件照",e.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:h,onChange:t=>{var s;P((s=t.target.files)==null?void 0:s[0]),t.target.value=""}})]})]}),N.map(t=>e.jsxs("div",{className:"border-b border-line px-4 py-3 last:border-b-0",children:[e.jsx("div",{className:"mb-2 text-[12px] font-semibold text-ink-2",children:t.title}),e.jsx("dl",{className:"grid grid-cols-1 gap-x-6 gap-y-1.5 sm:grid-cols-2",children:t.fields.map(s=>{const l=a[s.key]||"";return e.jsxs("div",{className:"grid min-w-0 grid-cols-[84px_1fr] gap-x-2.5 py-0.5",children:[e.jsx("dt",{className:"shrink-0 text-right text-[12px] text-ink-3",children:s.label}),e.jsx("dd",{className:"min-w-0 truncate text-[12.5px] "+(l?"text-ink-1":"text-ink-3/60"),title:l,children:l||"未填写"})]},s.key)})})]},t.title))]}),!a.selfIntro&&e.jsx("div",{className:"mt-3 rounded-md border border-dashed border-line px-4 py-2.5 text-[12px] text-ink-3",children:"提示:编辑里填写「自我评价」后,可一键用于简历生成。"}),e.jsx(z,{open:w,onClose:()=>n(!1),width:720,title:"编辑个人信息",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mr-auto text-[12px] text-ink-3",children:"填写一次,填表与简历自动复用"}),e.jsx(f,{variant:"primary",onClick:()=>y.mutate(),disabled:y.isPending,children:"保存"})]}),children:e.jsxs("div",{className:"flex flex-col gap-4",children:[N.map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-semibold text-ink-2",children:t.title}),e.jsx("div",{className:"grid grid-cols-1 gap-x-3 gap-y-3 sm:grid-cols-2",children:t.fields.map(s=>e.jsx(k,{label:s.label,children:s.options?e.jsx(M,{value:i[s.key]||"",onChange:l=>c({[s.key]:l.target.value}),options:s.options.map(l=>({value:l,label:l||"未选择"}))}):e.jsx(Q,{type:s.type||"text",value:i[s.key]||"",onChange:l=>c({[s.key]:l.target.value})})},s.key))})]},t.title)),e.jsx("div",{className:"border-t border-line pt-3",children:e.jsx(k,{label:"自我评价",hint:"简历「自我评价」板块使用",children:e.jsx(_,{rows:4,value:i.selfIntro,onChange:t=>c({selfIntro:t.target.value}),placeholder:"简述性格、能力、方向…"})})})]})})]})}export{H as ProfilePage}; diff --git a/sync-server/www/assets/RecordsPage-COdEkyD5.js b/sync-server/www/assets/RecordsPage-BGd2ZncK.js similarity index 99% rename from sync-server/www/assets/RecordsPage-COdEkyD5.js rename to sync-server/www/assets/RecordsPage-BGd2ZncK.js index 9156021..49cd18f 100644 --- a/sync-server/www/assets/RecordsPage-COdEkyD5.js +++ b/sync-server/www/assets/RecordsPage-BGd2ZncK.js @@ -1,4 +1,4 @@ -import{c as fe,j as e,a as N,r as s,b as he,u as ve,d as ge,e as je,f as L,g as ye,I as be,S as k,B as w,P as Q,h as te,L as se,G as ae,R as Ne,i as ne,k as ke,l as we,T as Ce,E as le,m as Ee,n as Se,o as _e,C as ze,p as qe,q as Le,s as Re,t as De,v as Ie}from"./index-CSVqyJB0.js";/** +import{c as fe,j as e,a as N,r as s,b as he,u as ve,d as ge,e as je,f as L,g as ye,I as be,S as k,B as w,P as Q,h as te,L as se,G as ae,R as Ne,i as ne,k as ke,l as we,T as Ce,E as le,m as Ee,n as Se,o as _e,C as ze,p as qe,q as Le,s as Re,t as De,v as Ie}from"./index-DWQlGpif.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/ResumePage-BHj_NUxM.js b/sync-server/www/assets/ResumePage-BHj_NUxM.js deleted file mode 100644 index efe0889..0000000 --- a/sync-server/www/assets/ResumePage-BHj_NUxM.js +++ /dev/null @@ -1,36 +0,0 @@ -import{c as P,d as se,f as q,r as _,j as e,B as T,ae as ne,H as M,S as B,aa as G,P as K,a6 as ae,ac as ie,I as O,T as le,ad as re,v as oe}from"./index-CSVqyJB0.js";import{C as $,a as V,b as W}from"./card-BcMbz03g.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 ce=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],de=P("ArrowDown",ce);/** - * @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 xe=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],me=P("ArrowUp",xe);/** - * @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 pe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ue=P("ChevronRight",pe);/** - * @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 he=[["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"}]],fe=P("GripVertical",he);/** - * @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 ye=[["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"}]],ge=P("PanelRightClose",ye);/** - * @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"}]],ke=P("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 je=[["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"}]],ve=P("Printer",je),E=[{key:"info",defaultTitle:"基本信息",kind:"info",fixed:!0},{key:"education",defaultTitle:"教育背景",kind:"list",types:["学业"]},{key:"skills",defaultTitle:"技能证书",kind:"list",types:["证书技能"]},{key:"awards",defaultTitle:"荣誉奖项",kind:"list",types:["荣誉惩处"]},{key:"competition",defaultTitle:"竞赛经历",kind:"list",types:["竞赛"]},{key:"research",defaultTitle:"科研经历",kind:"list",types:["科研"]},{key:"practice",defaultTitle:"实践经历",kind:"list",types:["志愿公益","实习实践","学生工作"]},{key:"activity",defaultTitle:"文体活动",kind:"list",types:["文体活动"]},{key:"other",defaultTitle:"其他经历",kind:"list"},{key:"self",defaultTitle:"自我评价",kind:"text",fixed:!0}];function U(){return{version:2,template:"tech",accent:"#3056d3",fontScale:1,density:"normal",onePage:!1,sections:E.map(i=>({key:i.key,title:i.defaultTitle,enabled:!0,kind:i.kind,types:i.types}))}}function Q(i){const a=U();if(!i||typeof i!="object")return a;const u=i,b=Array.isArray(u.sections)?u.sections:[],c=a.sections.map(s=>{const d=b.find(N=>N.key===s.key),k=E.find(N=>N.key===s.key);return{...s,enabled:(d==null?void 0:d.enabled)??!0,title:(d==null?void 0:d.title)??(k==null?void 0:k.defaultTitle)??s.title}});for(const s of b)c.some(d=>d.key===s.key)||c.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:c}}function Ne(){return E.filter(i=>i.types).flatMap(i=>i.types)}function we(i){const a=[i.organizer,i.level,i.award_grade].filter(b=>b!=null&&b!=="").map(String).join(" · "),u=[i.result,i.description].filter(b=>b!=null&&b!=="").map(String).join(" — ");return{title:i.title,subtitle:a||void 0,date:i.start_date??i.created_at.slice(0,10),desc:u||void 0,fromRecord:i.id}}function Z(i,a){const u=[],b=Ne();for(const c of a.sections){if(!c.enabled)continue;const s=E.find(x=>x.key===c.key);if(c.key==="info"){u.push({key:c.key,title:c.title,kind:"info"});continue}if(c.key==="self"||c.kind==="text"){u.push({key:c.key,title:c.title,kind:"text",text:c.text??""});continue}const d=new Set(c.excluded??[]);let k=[];const N=s==null?void 0:s.types;N?k=i.filter(x=>N.includes(x.type_name)&&x.status!=="draft"&&!d.has(x.id)):k=i.filter(x=>x.status!=="draft"&&!d.has(x.id)&&!b.includes(x.type_name));const j=k.map(we).filter(x=>!x.fromRecord||!d.has(x.fromRecord));for(const x of c.items??[])j.push({...x});j.sort((x,g)=>(g.date??"").localeCompare(x.date??"")),j.length&&u.push({key:c.key,title:c.title,kind:"list",items:j})}return u}const J=[{key:"tech",name:"互联网技术风",desc:"品牌色标题 + 左侧色条,紧凑现代"},{key:"minimal",name:"极简风",desc:"灰色大写字距标题,大量留白"},{key:"classic",name:"经典风",desc:"黑色衬线标题 + 通栏分隔线,正式通用"}],X=["#3056d3","#0f766e","#7c3aed","#c2410c","#0e7490","#1f2937"],w=i=>String(i??"").replace(/&/g,"&").replace(//g,">");function Ce(i,a,u,b){const c=u.fontScale,s=g=>(g*c).toFixed(1)+"pt",d=u.accent,k={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:"+d+";border-left:3pt solid "+d+";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"},N=i.map(g=>{let l="";if(g.kind==="info"){const m=[["姓名",f(a).name],["性别",f(a).gender],["出生年月",f(a).birth],["民族",f(a).nation],["籍贯",f(a).native],["政治面貌",f(a).political],["学校",f(a).school],["学院",f(a).college],["专业",f(a).major],["班级",f(a).className],["学号",f(a).studentId],["学历",f(a).degree],["手机",f(a).phone],["邮箱",f(a).email]].filter(C=>C[1]!=="");l=''+m.map(([C,r],R)=>(R%2===0?"":"")+'"+(R%2===1?"":"")).join("")+"
'+w(C)+''+w(r)+"
"}else g.kind==="list"?l='
'+(g.items??[]).map(m=>{const C=m.subtitle?'
'+w(m.subtitle)+"
":"",r=m.desc?'
'+w(m.desc)+"
":"";return'
'+w(m.title)+''+w(m.date??"")+"
"+C+r+"
"}).join("")+"
":l='

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

";return'

'+w(g.title)+"

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

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

"+j+"
"+(x?'
'+x+"
":"")+N+""}function f(i){return i??{}}const Se=Object.freeze(Object.defineProperty({__proto__:null,ACCENT_CHOICES:X,RESUME_SECTION_DEFS:E,TEMPLATES:J,assembleSections:Z,defaultResumeConfig:U,migrateResumeConfig:Q,resumeToWordHtml:Ce},Symbol.toStringTag,{value:"Module"}));function Pe(){var D,L,H;const i=se(),a=q({queryKey:["profile"],queryFn:re}),u=q({queryKey:["resume-records"],queryFn:()=>oe({page:1,page_size:500})}),[b,c]=_.useState(null),[s,d]=_.useState(""),[k,N]=_.useState(!0),[j,x]=_.useState(new Set),[g,l]=_.useState(1),m=_.useRef(null),C=_.useRef(null);_.useEffect(()=>{var p,o;const t=(p=a.data)==null?void 0:p.content;t&&(c(Q(t.resume)),d(((o=t.info)==null?void 0:o.selfIntro)??""))},[a.data]);const r={...((L=(D=a.data)==null?void 0:D.content)==null?void 0:L.info)??{}},R=((H=u.data)==null?void 0:H.items)??[],n=b??U(),I=_.useMemo(()=>Z(R,n),[R,r,s,n]),F=(t,p)=>c(o=>{if(!o)return o;const z=o,v=[...z.sections],h=t+p;return h<0||h>=v.length?z:([v[t],v[h]]=[v[h],v[t]],{...z,sections:v})}),S=t=>{c(t),ie({info:{...r,selfIntro:s},resume:t}).catch(p=>i("error",p.message))};_.useEffect(()=>{if(!n.onePage){l(1);return}const t=m.current;if(!t)return;const p=1043,o=t.scrollHeight;l(o>p?Math.max(.7,p/o):1)},[n.onePage,n.fontScale,n.density,I]);const A=n.fontScale*(n.onePage?g:1),Y=()=>{ae(async()=>{const{resumeToWordHtml:t}=await Promise.resolve().then(()=>Se);return{resumeToWordHtml:t}},void 0).then(({resumeToWordHtml:t})=>{const p=t(I,{...r,selfIntro:s},n,r.photoUrl),o=new Blob(["\uFEFF"+p],{type:"application/msword"}),z=URL.createObjectURL(o),v=document.createElement("a");v.href=z,v.download=(r.name||"个人简历")+".doc",v.click(),setTimeout(()=>URL.revokeObjectURL(z),6e4),i("success","Word 文档已导出(按当前模板与字号)")})},ee=t=>{var p;return((p=E.find(o=>o.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:()=>N(t=>!t),children:[k?e.jsx(ge,{size:13}):e.jsx(ke,{size:13}),k?"收起设置":"展开设置"]}),e.jsxs(T,{variant:"secondary",onClick:Y,children:[e.jsx(ne,{size:13})," 导出 Word"]}),e.jsxs(T,{variant:"primary",onClick:()=>window.print(),children:[e.jsx(ve,{size:13})," 打印 / PDF"]})]})]}),e.jsxs("div",{className:"grid gap-4 "+(k?"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:A,"--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"})]}),I.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(o=>o[1]).map(([o,z])=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"w-16 shrink-0 text-neutral-500",children:o}),e.jsx("span",{children:z})]},o))}):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(o=>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:o.title}),e.jsx("span",{className:"num shrink-0 text-[11.5px] text-neutral-500",children:o.date??""})]}),o.subtitle&&e.jsx("div",{className:"text-[12px] text-neutral-600",children:o.subtitle}),o.desc&&e.jsx("p",{className:"text-[12px] text-neutral-500 "+(n.density==="compact"?"":"mt-0.5"),children:o.desc})]},o.title+o.date))})]},t.key)})]})}),n.onePage&&e.jsxs("div",{className:"no-print mt-2 text-center text-[11.5px] text-ink-3",children:["一页限定已启用:内容自动缩放 ",Math.round(A*100),"% 以适配单页 A4"]})]}),k&&e.jsxs("div",{className:"no-print flex flex-col gap-4 lg:sticky lg:top-4 lg:self-start",children:[e.jsxs($,{children:[e.jsx(V,{title:"模板与风格"}),e.jsxs(W,{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"grid grid-cols-1 gap-2",children:J.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:()=>S({...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:X.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:()=>S({...n,accent:t})},t))})}),e.jsx(M,{label:"字号",children:e.jsx(B,{value:String(n.fontScale),onChange:t=>S({...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(B,{value:n.density,onChange:t=>S({...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:()=>S({...n,onePage:!n.onePage}),children:n.onePage?"已开启":"已关闭"})})]})]})]}),e.jsxs($,{children:[e.jsx(V,{title:"板块布局",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"拖动排序 · 内容可编辑"})}),e.jsx(W,{className:"p-0",children:e.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[n.sections.map((t,p)=>{var v;const o=j.has(t.key),z=t.kind==="info"?"固定":t.kind==="text"?"文本":"记录";return e.jsxs("div",{draggable:!0,onDragStart:()=>{C.current=t.key},onDragOver:h=>h.preventDefault(),onDrop:()=>{const h=n.sections.findIndex(y=>y.key===C.current);if(h>=0&&h!==p){const y=[...n.sections],[te]=y.splice(h,1);y.splice(p,0,te),S({...n,sections:y})}C.current=null},className:"bg-surface "+(C.current===t.key?"opacity-40":""),children:[e.jsxs("div",{className:"flex items-center gap-1 px-3 py-2",children:[e.jsx(fe,{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=>S({...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:()=>F(p,-1),children:e.jsx(me,{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:()=>F(p,1),children:e.jsx(de,{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:()=>S({...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:()=>x(h=>{const y=new Set(h);return y.has(t.key)?y.delete(t.key):y.add(t.key),y}),children:e.jsx(ue,{size:13,className:"transition-transform "+(o?"rotate-90":"")})})]}),o&&e.jsx("div",{className:"border-t border-line bg-surface-2 px-3 py-2.5",children:t.kind==="text"?e.jsx(G,{rows:4,value:t.text??"",placeholder:"输入该板块内容…",onChange:h=>S({...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:S,sectionTitle:ee(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:[z,(v=t.types)!=null&&v.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();S({...n,sections:[...n.sections,{key:t,title:"自定义板块",enabled:!0,kind:"text",text:""}]}),x(p=>new Set(p).add(t))},children:[e.jsx(K,{size:13})," 新增文本板块"]})})]})})]})]})]})]})}function _e({cfg:i,section:a,records:u,persist:b,sectionTitle:c}){const[s,d]=_.useState(null),k=new Set(a.excluded??[]),N=u.filter(l=>(a.types??[]).includes(l.type_name)&&l.status!=="draft").sort((l,m)=>(m.start_date??m.created_at).localeCompare(l.start_date??l.created_at)),j=a.items??[],x=l=>b({...i,sections:i.sections.map(m=>m.key===a.key?{...m,...l}:m)}),g=l=>{const m=new Set(a.excluded??[]);m.has(l)?m.delete(l):m.add(l),x({excluded:[...m]})};return e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"text-[11px] text-ink-3",children:"来自记录的条目(勾选 = 显示)· 另可添加自定义条目"}),N.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:!k.has(l.id),onChange:()=>g(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:["自定义条目(",j.length,")"]}),e.jsxs(T,{size:"sm",variant:"ghost",onClick:()=>d({title:""}),children:[e.jsx(K,{size:12})," 添加"]})]}),s&&e.jsxs("div",{className:"mb-2 rounded-md border border-line bg-surface p-2",children:[e.jsx(O,{className:"mb-1.5",placeholder:"标题",value:s.title,onChange:l=>d({...s,title:l.target.value})}),e.jsxs("div",{className:"mb-1.5 grid grid-cols-2 gap-1.5",children:[e.jsx(O,{placeholder:"副标题(单位/角色)",value:s.subtitle??"",onChange:l=>d({...s,subtitle:l.target.value})}),e.jsx(O,{placeholder:"日期(2025-06)",value:s.date??"",onChange:l=>d({...s,date:l.target.value})})]}),e.jsx(G,{rows:2,placeholder:"描述",value:s.desc??"",onChange:l=>d({...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()&&(x({items:[...j,s]}),d(null))},children:"添加"}),e.jsx(T,{size:"sm",variant:"ghost",onClick:()=>d(null),children:"取消"})]})]}),j.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:()=>x({items:j.filter((C,r)=>r!==m)}),children:e.jsx(le,{size:12})})]},m)),!j.length&&!s&&e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"暂无自定义条目"})]}),e.jsxs("p",{className:"text-[11px] text-ink-3",children:["「",c,"」板块的记录条目来自你的记录数据,此处可隐藏不需要展示的条目。"]})]})}export{Pe as ResumePage}; diff --git a/sync-server/www/assets/ResumePage-Cej-3M7z.js b/sync-server/www/assets/ResumePage-Cej-3M7z.js new file mode 100644 index 0000000..e9174c5 --- /dev/null +++ b/sync-server/www/assets/ResumePage-Cej-3M7z.js @@ -0,0 +1,39 @@ +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}; diff --git a/sync-server/www/assets/TaxonomyPage-IQFdyHqI.js b/sync-server/www/assets/TaxonomyPage-c8tjIm6X.js similarity index 97% rename from sync-server/www/assets/TaxonomyPage-IQFdyHqI.js rename to sync-server/www/assets/TaxonomyPage-c8tjIm6X.js index d8392c3..5a2fba2 100644 --- a/sync-server/www/assets/TaxonomyPage-IQFdyHqI.js +++ b/sync-server/www/assets/TaxonomyPage-c8tjIm6X.js @@ -1 +1 @@ -import{j as e,u as k,d as q,f as z,r as g,g as h,V as F,W as w,B as j,T as D,I as Q,P as T,C as E,X as M,Y as B,s as P,Z as V}from"./index-CSVqyJB0.js";import{C as K,a as S}from"./card-BcMbz03g.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(I,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function I(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:V}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{H as TaxonomyPage}; +import{j as e,u as k,d as q,f as z,r as g,g as h,V as F,W as w,B as j,T as D,I as Q,P as T,C as E,X as M,Y as B,s as P,Z as V}from"./index-DWQlGpif.js";import{C as K,a as S}from"./card-BkBMnQAf.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(I,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function I(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:V}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{H as TaxonomyPage}; diff --git a/sync-server/www/assets/TypesPage-B7GapiTk.js b/sync-server/www/assets/TypesPage-DbjmBLAq.js similarity index 98% rename from sync-server/www/assets/TypesPage-B7GapiTk.js rename to sync-server/www/assets/TypesPage-DbjmBLAq.js index 86b0d27..b7b8ab3 100644 --- a/sync-server/www/assets/TypesPage-B7GapiTk.js +++ b/sync-server/www/assets/TypesPage-DbjmBLAq.js @@ -1,4 +1,4 @@ -import{c as D,u as K,d as F,f as L,r,g as I,j as e,B as p,P as q,M as O,m as _,l as H,T as P,C as R,N as G,F as U,H as i,I as j,O as W,S as z,Q as J,U as V,q as X}from"./index-CSVqyJB0.js";import{C as Y}from"./card-BcMbz03g.js";/** +import{c as D,u as K,d as F,f as L,r,g as I,j as e,B as p,P as q,M as O,m as _,l as H,T as P,C as R,N as G,F as U,H as i,I as j,O as W,S as z,Q as J,U as V,q as X}from"./index-DWQlGpif.js";import{C as Y}from"./card-BkBMnQAf.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/card-BcMbz03g.js b/sync-server/www/assets/card-BkBMnQAf.js similarity index 89% rename from sync-server/www/assets/card-BcMbz03g.js rename to sync-server/www/assets/card-BkBMnQAf.js index 314cf9c..28bf543 100644 --- a/sync-server/www/assets/card-BcMbz03g.js +++ b/sync-server/www/assets/card-BkBMnQAf.js @@ -1 +1 @@ -import{j as s,a}from"./index-CSVqyJB0.js";function i({className:r,...e}){return s.jsx("div",{className:a("rounded-lg border border-line bg-surface shadow-card",r),...e})}function t({title:r,extra:e,className:n}){return s.jsxs("div",{className:a("flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-1.5",n),children:[s.jsx("h3",{className:"text-[13px] font-semibold text-ink-1",children:r}),e&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e})]})}function c({className:r,...e}){return s.jsx("div",{className:a("p-4",r),...e})}export{i as C,t as a,c as b}; +import{j as s,a}from"./index-DWQlGpif.js";function i({className:r,...e}){return s.jsx("div",{className:a("rounded-lg border border-line bg-surface shadow-card",r),...e})}function t({title:r,extra:e,className:n}){return s.jsxs("div",{className:a("flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-1.5",n),children:[s.jsx("h3",{className:"text-[13px] font-semibold text-ink-1",children:r}),e&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e})]})}function c({className:r,...e}){return s.jsx("div",{className:a("p-4",r),...e})}export{i as C,t as a,c as b}; diff --git a/sync-server/www/assets/index-CSVqyJB0.js b/sync-server/www/assets/index-DWQlGpif.js similarity index 99% rename from sync-server/www/assets/index-CSVqyJB0.js rename to sync-server/www/assets/index-DWQlGpif.js index e1cf111..e23e6b1 100644 --- a/sync-server/www/assets/index-CSVqyJB0.js +++ b/sync-server/www/assets/index-DWQlGpif.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-CPUiI0iy.js","assets/card-BcMbz03g.js","assets/useChart-CUy-j464.js","assets/echarts-BIWefrIc.js","assets/GradesPage-Ij8UzdbZ.js","assets/TypesPage-B7GapiTk.js","assets/TaxonomyPage-IQFdyHqI.js","assets/AdminPage-EK2Zo7TL.js","assets/ResumePage-BHj_NUxM.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DNoywp7V.js","assets/card-BkBMnQAf.js","assets/useChart-q1r1yv4-.js","assets/echarts-BIWefrIc.js","assets/GradesPage-DDtpIPC0.js","assets/TypesPage-DbjmBLAq.js","assets/TaxonomyPage-c8tjIm6X.js","assets/AdminPage-CU2b53Nb.js","assets/ResumePage-Cej-3M7z.js"])))=>i.map(i=>d[i]); var wp=n=>{throw TypeError(n)};var Kf=(n,r,s)=>r.has(n)||wp("Cannot "+s);var T=(n,r,s)=>(Kf(n,r,"read from private field"),s?s.call(n):r.get(n)),he=(n,r,s)=>r.has(n)?wp("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),P=(n,r,s,o)=>(Kf(n,r,"write to private field"),o?o.call(n,s):r.set(n,s),s),Se=(n,r,s)=>(Kf(n,r,"access private method"),s);var Gs=(n,r,s,o)=>({set _(f){P(n,r,f,s)},get _(){return T(n,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const d of m.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=s(f);fetch(f.href,m)}})();var H5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ag(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zf={exports:{}},Wu={};/** * @license React * react-jsx-runtime.production.js @@ -329,4 +329,4 @@ Please change the parent to Ce("app_info"),E4=()=>Ce("sync_status"),uo=()=>Ce("type_list"),_4=n=>Ce("type_upsert",n),T4=n=>Ce("type_delete",{id:n}),E0=n=>Ce("taxonomy_list",{kind:n}),N4=n=>Ce("taxonomy_upsert",n),w4=n=>Ce("taxonomy_delete",{id:n}),Wd=()=>Ce("dimension_list"),C4=n=>Ce("dimension_upsert",n),j4=n=>Ce("dimension_delete",{id:n}),_0=(n={})=>Ce("footprint_list",{query:n}),Id=n=>Ce("footprint_get",{id:n}),T0=n=>Ce("footprint_upsert",{item:n}),z4=n=>Ce("footprint_delete",{id:n}),N0=(n={})=>Ce("timeline",{query:n}),O4=n=>Ce("stats_overview",{year:n}),R4=()=>Ce("metric_list"),A4=n=>Ce("metric_upsert",n),M4=n=>Ce("metric_delete",{key:n}),D4=()=>Ce("grades_overview"),U4=n=>Ce("semester_upsert",n),k4=n=>Ce("semester_delete",{id:n}),H4=n=>Ce("course_upsert",n),q4=n=>Ce("course_delete",{id:n}),L4=n=>Ce("band_upsert",n),B4=n=>Ce("band_delete",{id:n}),w0=n=>Ce("attachment_list",{owner_id:n}),C0=n=>Ce("attachment_delete",{id:n}),Is=n=>Ce("attachment_read",{id:n});async function Td(n,r,s){const o=new URLSearchParams({owner:String(n),name:r.name,mime:r.type||"application/octet-stream"}),f=await fetch(Ol()+"/sync/attachment/raw?"+o,{method:"PUT",headers:{authorization:"Bearer "+vl(),"content-type":r.type||"application/octet-stream"},body:r}),m=await f.json().catch(()=>({ok:!1,error:"HTTP "+f.status}));if(!m.ok)throw new Error(m.error||"上传失败");const d=m.data.item;if(s)try{await Ce("attachment_set_thumb",{id:d.id,thumb_b64:s})}catch{}return d}async function j0(n){var f;const r=await fetch(Ol()+"/api/attachment_download",{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+vl()},body:JSON.stringify({id:n})});if(!r.ok){const m=await r.json().catch(()=>null);throw new Error((m==null?void 0:m.error)||"下载失败")}const s=decodeURIComponent(r.headers.get("x-file-name")||((f=(r.headers.get("content-disposition")||"").match(/UTF-8''([^;]+)/))==null?void 0:f[1])||"file"),o=r.headers.get("content-type")||void 0;return{blob:await r.blob(),file_name:s,mime:o}}const z0=n=>Ce("attachment_thumb",{id:n}),Q4=()=>Ce("view_list"),G4=n=>Ce("view_upsert",n),Y4=n=>Ce("view_delete",{id:n});async function ro(n,r,s){const o=await fetch((s||Ol())+n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+vl()},body:JSON.stringify(r??{})}),f=await o.json().catch(()=>({ok:!1,error:"HTTP "+o.status}));if(!f.ok)throw new Error(f.error||"请求失败");return f.data}async function O0(n,r){const s=await fetch((r||Ol())+n,{headers:{Authorization:"Bearer "+vl()}}),o=await s.json().catch(()=>({ok:!1,error:"HTTP "+s.status}));if(!o.ok)throw new Error(o.error||"请求失败");return o.data}const V4=n=>O0("/admin/invites",n),X4=n=>O0("/admin/users",n),K4=(n,r)=>ro("/admin/invites/generate",{count:n},r),Z4=(n,r,s)=>ro("/admin/invites/create",{code:n,remark:r},s),J4=(n,r,s)=>ro("/admin/invites/update",{id:n,...r},s),F4=(n,r)=>ro("/admin/invites/delete",{id:n},r),$4=()=>Ce("profile_get",{}),P4=n=>Ce("profile_upsert",{content:n});async function W4(n){const r=await new Promise((f,m)=>{const d=new FileReader;d.onload=()=>f(String(d.result||"").split(",")[1]||""),d.onerror=()=>m(new Error("读取文件失败")),d.readAsDataURL(n)}),o=await(await fetch(Ol()+"/api/profile_photo",{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+vl()},body:JSON.stringify({data_b64:r,file_name:n.name,mime:n.type||"image/png"})})).json().catch(()=>null);if(!(o!=null&&o.ok))throw new Error((o==null?void 0:o.error)||"证件照上传失败");return o.data.url}const I4=Object.freeze(Object.defineProperty({__proto__:null,AuthError:_d,adminCreateInvite:Z4,adminDeleteInvite:F4,adminGenerateInvites:K4,adminListInvites:V4,adminListUsers:X4,adminUpdateInvite:J4,appInfo:S4,attachmentDelete:C0,attachmentDownload:j0,attachmentList:w0,attachmentRead:Is,attachmentThumb:z0,attachmentUploadRaw:Td,bandDelete:B4,bandUpsert:L4,clearToken:Fd,courseDelete:q4,courseUpsert:H4,deleteDimension:j4,deleteTaxonomy:w4,deleteType:T4,footprintDelete:z4,footprintGet:Id,footprintList:_0,footprintUpsert:T0,getServerUrl:Ol,getToken:vl,gradesOverview:D4,listDimensions:Wd,listTaxonomy:E0,listTypes:uo,metricDelete:M4,metricList:R4,metricUpsert:A4,profileGet:$4,profilePhotoUpload:W4,profileUpsert:P4,semesterDelete:k4,semesterUpsert:U4,serverLogin:$d,serverMe:b0,serverRegister:Pd,setServerUrl:S0,setToken:Jd,statsOverview:O4,syncStatus:E4,timeline:N0,upsertDimension:C4,upsertTaxonomy:N4,upsertType:_4,viewDelete:Y4,viewList:Q4,viewUpsert:G4},Symbol.toStringTag,{value:"Module"}));function R0(n){var r,s,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var f=n.length;for(r=0;rtypeof n=="boolean"?`${n}`:n===0?"0":n,ag=A0,e_=(n,r)=>s=>{var o;if((r==null?void 0:r.variants)==null)return ag(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:f,defaultVariants:m}=r,d=Object.keys(f).map(p=>{const x=s==null?void 0:s[p],g=m==null?void 0:m[p];if(x===null)return null;const _=lg(x)||lg(g);return f[p][_]}),v=s&&Object.entries(s).reduce((p,x)=>{let[g,_]=x;return _===void 0||(p[g]=_),p},{}),b=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((p,x)=>{let{class:g,className:_,...k}=x;return Object.entries(k).every(K=>{let[q,D]=K;return Array.isArray(D)?D.includes({...m,...v}[q]):{...m,...v}[q]===D})?[...p,g,_]:p},[]);return ag(n,d,b,s==null?void 0:s.class,s==null?void 0:s.className)},t_=(n,r)=>{const s=new Array(n.length+r.length);for(let o=0;o({classGroupId:n,validator:r}),M0=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),eo="-",ng=[],a_="arbitrary..",n_=n=>{const r=u_(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return i_(d);const v=d.split(eo),b=v[0]===""&&v.length>1?1:0;return D0(v,b,r)},getConflictingClassGroupIds:(d,v)=>{if(v){const b=o[d],p=s[d];return b?p?t_(p,b):b:p||ng}return s[d]||ng}}},D0=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const f=n[r],m=s.nextPart.get(f);if(m){const p=D0(n,r+1,m);if(p)return p}const d=s.validators;if(d===null)return;const v=r===0?n.join(eo):n.slice(r).join(eo),b=d.length;for(let p=0;pn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?a_+o:void 0})(),u_=n=>{const{theme:r,classGroups:s}=n;return r_(s,r)},r_=(n,r)=>{const s=M0();for(const o in n){const f=n[o];eh(f,s,o,r)}return s},eh=(n,r,s,o)=>{const f=n.length;for(let m=0;m{if(typeof n=="string"){o_(n,r,s);return}if(typeof n=="function"){c_(n,r,s,o);return}f_(n,r,s,o)},o_=(n,r,s)=>{const o=n===""?r:U0(r,n);o.classGroupId=s},c_=(n,r,s,o)=>{if(d_(n)){eh(n(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(l_(s,n))},f_=(n,r,s,o)=>{const f=Object.entries(n),m=f.length;for(let d=0;d{let s=n;const o=r.split(eo),f=o.length;for(let m=0;m"isThemeGetter"in n&&n.isThemeGetter===!0,h_=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const f=(m,d)=>{s[m]=d,r++,r>n&&(r=0,o=s,s=Object.create(null))};return{get(m){let d=s[m];if(d!==void 0)return d;if((d=o[m])!==void 0)return f(m,d),d},set(m,d){m in s?s[m]=d:f(m,d)}}},Nd="!",ig=":",m_=[],ug=(n,r,s,o,f)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:f}),y_=n=>{const{prefix:r,experimentalParseClassName:s}=n;let o=f=>{const m=[];let d=0,v=0,b=0,p;const x=f.length;for(let q=0;qb?p-b:void 0;return ug(m,k,_,K)};if(r){const f=r+ig,m=o;o=d=>d.startsWith(f)?m(d.slice(f.length)):ug(m_,!1,d,void 0,!0)}if(s){const f=o;o=m=>s({className:m,parseClassName:f})}return o},v_=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let f=[];for(let m=0;m0&&(f.sort(),o.push(...f),f=[]),o.push(d)):f.push(d)}return f.length>0&&(f.sort(),o.push(...f)),o}},p_=n=>({cache:h_(n.cacheSize),parseClassName:y_(n),sortModifiers:v_(n),postfixLookupClassGroupIds:g_(n),...n_(n)}),g_=n=>{const r=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let o=0;o{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:f,sortModifiers:m,postfixLookupClassGroupIds:d}=r,v=[],b=n.trim().split(b_);let p="";for(let x=b.length-1;x>=0;x-=1){const g=b[x],{isExternal:_,modifiers:k,hasImportantModifier:K,baseClassName:q,maybePostfixModifierPosition:D}=s(g);if(_){p=g+(p.length>0?" "+p:p);continue}let H=!!D,Q;if(H){const F=q.substring(0,D);Q=o(F);const U=Q&&d[Q]?o(q):void 0;U&&U!==Q&&(Q=U,H=!1)}else Q=o(q);if(!Q){if(!H){p=g+(p.length>0?" "+p:p);continue}if(Q=o(q),!Q){p=g+(p.length>0?" "+p:p);continue}H=!1}const Z=k.length===0?"":k.length===1?k[0]:m(k).join(":"),J=K?Z+Nd:Z,Y=J+Q;if(v.indexOf(Y)>-1)continue;v.push(Y);const de=f(Q,H);for(let F=0;F0?" "+p:p)}return p},S_=(...n)=>{let r=0,s,o,f="";for(;r{if(typeof n=="string")return n;let r,s="";for(let o=0;o{let s,o,f,m;const d=b=>{const p=r.reduce((x,g)=>g(x),n());return s=p_(p),o=s.cache.get,f=s.cache.set,m=v,v(b)},v=b=>{const p=o(b);if(p)return p;const x=x_(b,s);return f(b,x),x};return m=d,(...b)=>m(S_(...b))},__=[],ct=n=>{const r=s=>s[n]||__;return r.isThemeGetter=!0,r.themeKey=n,r},H0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,N_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,w_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,C_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,j_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Za=n=>T_.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),Xl=n=>!!n&&Number.isInteger(Number(n)),ad=n=>n.endsWith("%")&&_e(n.slice(0,-1)),fa=n=>N_.test(n),L0=()=>!0,O_=n=>w_.test(n)&&!C_.test(n),th=()=>!1,R_=n=>j_.test(n),A_=n=>z_.test(n),M_=n=>!ne(n)&&!ue(n),D_=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),U_=n=>nn(n,G0,th),ne=n=>H0.test(n),zn=n=>nn(n,Y0,O_),rg=n=>nn(n,Y_,_e),k_=n=>nn(n,X0,L0),H_=n=>nn(n,V0,th),sg=n=>nn(n,B0,th),q_=n=>nn(n,Q0,A_),Xs=n=>nn(n,K0,R_),ue=n=>q0.test(n),tr=n=>Vn(n,Y0),L_=n=>Vn(n,V0),og=n=>Vn(n,B0),B_=n=>Vn(n,G0),Q_=n=>Vn(n,Q0),Ks=n=>Vn(n,K0,!0),G_=n=>Vn(n,X0,!0),nn=(n,r,s)=>{const o=H0.exec(n);return o?o[1]?r(o[1]):s(o[2]):!1},Vn=(n,r,s=!1)=>{const o=q0.exec(n);return o?o[1]?r(o[1]):s:!1},B0=n=>n==="position"||n==="percentage",Q0=n=>n==="image"||n==="url",G0=n=>n==="length"||n==="size"||n==="bg-size",Y0=n=>n==="length",Y_=n=>n==="number",V0=n=>n==="family-name",X0=n=>n==="number"||n==="weight",K0=n=>n==="shadow",V_=()=>{const n=ct("color"),r=ct("font"),s=ct("text"),o=ct("font-weight"),f=ct("tracking"),m=ct("leading"),d=ct("breakpoint"),v=ct("container"),b=ct("spacing"),p=ct("radius"),x=ct("shadow"),g=ct("inset-shadow"),_=ct("text-shadow"),k=ct("drop-shadow"),K=ct("blur"),q=ct("perspective"),D=ct("aspect"),H=ct("ease"),Q=ct("animate"),Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...J(),ue,ne],de=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],U=()=>[ue,ne,b],I=()=>[Za,"full","auto",...U()],le=()=>[Xl,"none","subgrid",ue,ne],Ve=()=>["auto",{span:["full",Xl,ue,ne]},Xl,ue,ne],Fe=()=>[Xl,"auto",ue,ne],ie=()=>["auto","min","max","fr",ue,ne],Te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...U()],ee=()=>[Za,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],R=()=>[v,Za,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ae=()=>[Za,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],X=()=>[n,ue,ne],ke=()=>[...J(),og,sg,{position:[ue,ne]}],Nt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Rl=()=>["auto","cover","contain",B_,U_,{size:[ue,ne]}],w=()=>[ad,tr,zn],G=()=>["","none","full",p,ue,ne],W=()=>["",_e,tr,zn],ce=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[_e,ad,og,sg],Ae=()=>["","none",K,ue,ne],se=()=>["none",_e,ue,ne],ye=()=>["none",_e,ue,ne],Yt=()=>[_e,ue,ne],pa=()=>[Za,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[L0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[M_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fa],shadow:[fa],spacing:["px",_e],text:[fa],"text-shadow":[fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Za,ne,ue,D]}],container:["container"],"container-type":[{"@container":["","normal","size",ue,ne]}],"container-named":[D_],columns:[{columns:[_e,"auto",ne,ue,v]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:de()}],"overflow-x":[{"overflow-x":de()}],"overflow-y":[{"overflow-y":de()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Xl,"auto",ue,ne]}],basis:[{basis:[Za,"full","auto",v,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Za,"auto","initial","none",ne]}],grow:[{grow:["",_e,ue,ne]}],shrink:[{shrink:["",_e,ue,ne]}],order:[{order:[Xl,"first","last","none",ue,ne]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":Fe()}],"col-end":[{"col-end":Fe()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":Fe()}],"row-end":[{"row-end":Fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Te(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...Te()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":Te()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[v,"screen",...ee()]}],"min-w":[{"min-w":[v,"screen","none",...ee()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[d]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh","none",...ee()]}],"font-size":[{text:["base",s,tr,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,G_,k_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ad,ne]}],"font-family":[{font:[L_,H_,r]}],"font-features":[{"font-features":[ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[f,ue,ne]}],"line-clamp":[{"line-clamp":[_e,"none",ue,rg]}],leading:[{leading:["none",m,...U()]}],"list-image":[{"list-image":["none",ue,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ue,zn]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[_e,"auto",ue,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Xl,ue,ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue,ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ke()}],"bg-repeat":[{bg:Nt()}],"bg-size":[{bg:Rl()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,ue,ne],radial:["",ue,ne],conic:["",Xl,ue,ne]},Q_,q_]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:w()}],"gradient-via-pos":[{via:w()}],"gradient-to-pos":[{to:w()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ue,ne]}],"outline-w":[{outline:["",_e,tr,zn]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","inner","none",x,Ks,Xs]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",g,Ks,Xs]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[_e,zn]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",_,Ks,Xs]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[_e,ue,ne]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[ue,ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":J()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ke()}],"mask-repeat":[{mask:Nt()}],"mask-size":[{mask:Rl()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,ne]}],filter:[{filter:["","none",ue,ne]}],blur:[{blur:Ae()}],brightness:[{brightness:[_e,ue,ne]}],contrast:[{contrast:[_e,ue,ne]}],"drop-shadow":[{"drop-shadow":["","none",k,Ks,Xs]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",_e,ue,ne]}],"hue-rotate":[{"hue-rotate":[_e,ue,ne]}],invert:[{invert:["",_e,ue,ne]}],saturate:[{saturate:[_e,ue,ne]}],sepia:[{sepia:["",_e,ue,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,ne]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ue,ne]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ue,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ue,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ue,ne]}],"backdrop-invert":[{"backdrop-invert":["",_e,ue,ne]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ue,ne]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ue,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ue,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ue,ne]}],ease:[{ease:["linear","initial",H,ue,ne]}],delay:[{delay:[_e,ue,ne]}],animate:[{animate:["none",Q,ue,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[q,ue,ne]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Yt()}],"skew-x":[{"skew-x":Yt()}],"skew-y":[{"skew-y":Yt()}],transform:[{transform:[ue,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pa()}],"translate-x":[{"translate-x":pa()}],"translate-y":[{"translate-y":pa()}],"translate-z":[{"translate-z":pa()}],"translate-none":["translate-none"],zoom:[{zoom:[Xl,ue,ne]}],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue,ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":X()}],"scrollbar-track-color":[{"scrollbar-track":X()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue,ne]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[_e,tr,zn,rg]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},X_=E_(V_);function pl(...n){return X_(A0(n))}const K_=e_("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors select-none disabled:pointer-events-none disabled:opacity-45",{variants:{variant:{primary:"bg-brand text-white hover:bg-brand-hover shadow-card",secondary:"bg-surface text-ink-1 border border-line hover:bg-surface-3 hover:border-line-strong",ghost:"text-ink-2 hover:bg-surface-3 hover:text-ink-1",subtle:"bg-brand-subtle text-brand-text hover:brightness-[0.97]",danger:"bg-danger text-white hover:brightness-110","danger-ghost":"text-danger hover:bg-danger-subtle"},size:{sm:"h-7 px-2.5 text-[12px]",md:"h-8 px-3 text-[13px]",lg:"h-9 px-4 text-sm",icon:"h-8 w-8 p-0","icon-sm":"h-7 w-7 p-0"}},defaultVariants:{variant:"secondary",size:"md"}}),zt=E.forwardRef(function({className:r,variant:s,size:o,...f},m){return h.jsx("button",{ref:m,className:pl(K_({variant:s,size:o}),r),...f})}),Z0="w-full rounded-md border border-line bg-surface px-2.5 text-[13px] text-ink-1 placeholder:text-ink-3 transition-colors hover:border-line-strong focus:border-brand focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",nt=E.forwardRef(function({className:r,...s},o){return h.jsx("input",{ref:o,className:pl(Z0,"h-8",r),...s})}),wd=E.forwardRef(function({className:r,...s},o){return h.jsx("textarea",{ref:o,className:pl(Z0,"py-2 min-h-[72px] resize-y leading-relaxed",r),...s})});function De({label:n,required:r,hint:s,className:o,children:f}){return h.jsxs("div",{className:pl("flex flex-col gap-1.5",o),children:[h.jsxs("label",{className:"text-[12px] font-medium text-ink-2",children:[n,r&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"}),s&&h.jsx("span",{className:"text-ink-3 font-normal ml-2",children:s})]}),f]})}const ml=E.forwardRef(function({className:r,options:s,children:o,...f},m){return h.jsxs("div",{className:pl("relative",r?r.split(" ").filter(d=>/^w-|^min-w|^flex-/.test(d)).join(" "):""),children:[h.jsx("select",{ref:m,className:pl("w-full h-8 appearance-none rounded-md border border-line bg-surface pl-2.5 pr-7 text-[13px] text-ink-1","transition-colors hover:border-line-strong focus:border-brand focus:outline-none disabled:opacity-50",r),...f,children:s?s.map(d=>h.jsx("option",{value:d.value,children:d.label},d.value)):o}),h.jsx(J3,{size:14,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-ink-3"})]})});function Ii({className:n,color:r,...s}){return h.jsx("span",{className:pl("inline-flex items-center gap-1 rounded-sm border px-1.5 py-px text-[11px] leading-[18px] font-medium whitespace-nowrap",n),style:r?{color:r,borderColor:r+"44",backgroundColor:r+"14"}:void 0,...s})}function Z_({className:n,...r}){return h.jsx("span",{className:pl("inline-flex items-center gap-1 rounded-sm border border-line bg-surface-2 px-1.5 py-px text-[11px] leading-[18px] font-medium text-ink-2 whitespace-nowrap",n),...r})}function so({open:n,onClose:r,title:s,width:o=560,children:f,footer:m}){return E.useEffect(()=>{if(!n)return;const d=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[n,r]),n?KS.createPortal(h.jsxs("div",{className:"fixed inset-0 z-50 flex justify-center overflow-y-auto p-3 sm:p-6",children:[h.jsx("div",{className:"fixed inset-0 bg-black/45",onClick:r}),h.jsxs("div",{className:"animate-in relative my-auto w-full rounded-lg border border-line bg-surface shadow-pop",style:{maxWidth:o},role:"dialog",children:[h.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-line px-4",children:[h.jsx("div",{className:"text-sm font-semibold text-ink-1",children:s}),h.jsx(zt,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":"关闭",children:h.jsx(g0,{size:15})})]}),h.jsx("div",{className:"max-h-[70vh] overflow-y-auto px-3 py-3 sm:px-4 sm:py-4",children:f}),m&&h.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-3 py-2.5 sm:h-14 sm:flex-nowrap sm:px-4 sm:py-0",children:m})]})]}),document.body):null}function J_({icon:n,title:r,description:s,action:o}){return h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[h.jsx("div",{className:"text-ink-3",children:n??h.jsx(gE,{size:36,strokeWidth:1.5})}),h.jsx("div",{className:"text-[13px] font-medium text-ink-2",children:r}),s&&h.jsx("div",{className:"max-w-[360px] text-[12px] text-ink-3",children:s}),o&&h.jsx("div",{className:"mt-2",children:o})]})}const J0=E.createContext(()=>{});function oo(){return E.useContext(J0)}const F_={success:h.jsx(W3,{size:15,className:"text-success"}),error:h.jsx($3,{size:15,className:"text-danger"}),info:h.jsx(xE,{size:15,className:"text-brand"})};function $_({children:n}){const[r,s]=E.useState([]),o=E.useRef(0),f=E.useCallback((m,d)=>{const v=++o.current;s(b=>[...b,{id:v,kind:m,text:d}]),setTimeout(()=>s(b=>b.filter(p=>p.id!==v)),3200)},[]);return h.jsxs(J0.Provider,{value:f,children:[n,h.jsx("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex flex-col gap-2",children:r.map(m=>h.jsxs("div",{className:pl("pointer-events-auto flex items-center gap-2 rounded-md border border-line bg-surface px-3 py-2 text-[13px] text-ink-1 shadow-pop","animate-in"),children:[F_[m.kind],m.text]},m.id))})]})}function P_({open:n,title:r,content:s,onCancel:o,onOk:f,loading:m}){return h.jsx(so,{open:n,onClose:o,title:r,width:420,footer:h.jsxs(h.Fragment,{children:[h.jsx(zt,{variant:"secondary",onClick:o,children:"取消"}),h.jsx(zt,{variant:"danger",onClick:f,disabled:m,children:"确认"})]}),children:h.jsx("p",{className:"text-[13px] text-ink-2",children:s??"该操作不可撤销,请确认。"})})}function W_({size:n=44}){return h.jsxs("svg",{width:n,height:n,viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function I_({open:n,onClose:r,defaultUrl:s}){const o=lu(),f=oo(),[m,d]=E.useState("login"),[v,b]=E.useState(s||"https://footpr.linyux.cn"),[p,x]=E.useState(""),[g,_]=E.useState(""),[k,K]=E.useState(""),[q,D]=E.useState(""),[H,Q]=E.useState(!1),Z=async()=>{if(!p.trim()||!g){D("请填写账号与密码");return}let J=v.trim();J&&!J.startsWith("http")&&(J="https://"+J),Q(!0),D("");try{if(m==="login")await $d(p.trim(),g,J);else{if(!k.trim())throw new Error("请填写邀请码");await Pd(p.trim(),g,k.trim(),J)}o.invalidateQueries(),f("success",m==="login"?"已登录 · 同步已开启":"已注册登录 · 同步已开启"),r(),setTimeout(()=>window.location.reload(),300)}catch(Y){D(Y.message)}finally{Q(!1)}};return n?h.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-bg/95",children:h.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[h.jsx(W_,{}),h.jsx("div",{className:"text-[17px] font-semibold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[10px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),h.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(m==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("login"),D("")},children:"登录"}),h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(m==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("register"),D("")},children:"注册"})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(De,{label:"服务器地址",hint:"与网页版同一账号体系",children:h.jsx(nt,{value:v,onChange:J=>b(J.target.value),placeholder:"https://footpr.linyux.cn"})}),h.jsx(De,{label:"用户名",required:!0,children:h.jsx(nt,{value:p,onChange:J=>x(J.target.value),placeholder:"3-32 位字母数字-_"})}),h.jsx(De,{label:"密码",required:!0,children:h.jsx(nt,{type:"password",value:g,onChange:J=>_(J.target.value),placeholder:"至少 8 位"})}),m==="register"&&h.jsx(De,{label:"邀请码",required:!0,hint:"向管理员索取",children:h.jsx(nt,{value:k,onChange:J=>K(J.target.value),placeholder:"邀请码"})}),q&&h.jsx("div",{className:"text-[12px] text-danger",children:q}),h.jsx(zt,{variant:"primary",size:"lg",onClick:()=>void Z(),disabled:H,children:H?"请稍候…":m==="login"?"登录并同步":"注册并同步"}),h.jsx("p",{className:"text-center text-[11px] text-ink-3",children:"登录后本机数据将多端同步"})]})]})}):null}const e5=[{section:"工作区",items:[{to:"/timeline",label:"时间线",icon:m0},{to:"/records",label:"记录",icon:FE},{to:"/grades",label:"成绩",icon:v0},{to:"/dashboard",label:"统计",icon:K3}]},{section:"个人",items:[{to:"/profile",label:"个人信息",icon:p4},{to:"/resume",label:"我的简历",icon:PE}]},{section:"配置",items:[{to:"/admin",label:"管理",icon:i4},{to:"/types",label:"记录类型",icon:t4},{to:"/taxonomy",label:"字典与维度",icon:r4}]}];function t5(){return h.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"lg",x1:"0",y1:"0",x2:"0",y2:"26",children:[h.jsx("stop",{stopColor:"#4359e8"}),h.jsx("stop",{offset:"1",stopColor:"#2a3ab8"})]})}),h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"7",fill:"url(#lg)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:".95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:".7"})]})}function l5({open:n,onClose:r}){const s=lu(),f=yl({queryKey:["me",vl()??""],refetchOnMount:"always",queryFn:()=>b0(),enabled:!!vl(),retry:0}).data??null,[m,d]=E.useState(!1);return h.jsxs("aside",{className:pl("no-print","flex w-[236px] shrink-0 flex-col border-r border-line bg-surface","max-lg:fixed max-lg:inset-y-0 max-lg:left-0 max-lg:z-40 max-lg:transition-transform",n?"max-lg:translate-x-0":"max-lg:-translate-x-full"),children:[h.jsx(I_,{open:m,onClose:()=>d(!1),defaultUrl:"https://footpr.linyux.cn"}),h.jsxs("div",{className:"flex h-[60px] items-center gap-3 border-b border-line px-5",children:[h.jsx(t5,{}),h.jsxs("div",{className:"leading-tight",children:[h.jsx("div",{className:"text-[15px] font-bold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[9px] font-medium tracking-[0.24em] text-ink-3",children:"FOOTPRINTS"})]})]}),h.jsx("nav",{className:"flex-1 overflow-y-auto px-2.5 py-4",children:e5.map(v=>h.jsxs("div",{className:"mb-5",children:[h.jsx("div",{className:"px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-ink-3",children:v.section}),h.jsx("div",{className:"flex flex-col gap-0.5",children:v.items.map(b=>h.jsxs(e0,{to:b.to,onClick:r,className:({isActive:p})=>pl("relative flex h-[34px] items-center gap-3 rounded-lg px-3 text-[13px] font-medium transition-all duration-150",p?"bg-brand-subtle text-brand-text nav-active":"text-ink-2 hover:bg-surface-3 hover:text-ink-1"),children:[h.jsx(b.icon,{size:16,strokeWidth:1.8}),b.label]},b.to))})]},v.section))}),h.jsx("div",{className:"border-t border-line px-3 py-3",children:vl()&&f?h.jsxs("div",{className:"rounded-lg bg-surface-2 px-3 py-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-brand text-[10px] font-bold text-white",children:f.username.charAt(0).toUpperCase()}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"truncate text-[12px] font-semibold text-ink-1",title:f.username,children:f.username}),f.is_admin&&h.jsx("div",{className:"text-[10px] text-brand-text",children:"管理员"})]})]}),h.jsx("button",{className:"shrink-0 rounded p-1 text-ink-3 transition-colors hover:bg-surface-3 hover:text-danger",title:"退出登录",onClick:()=>{Fd(),s.clear(),window.location.reload()},children:h.jsx(jE,{size:13})})]}),h.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[10px] text-success",children:[h.jsx(eE,{size:10}),"云端同步已开启"]})]}):h.jsxs("button",{className:"flex w-full items-center justify-center gap-2 rounded-lg border border-brand/30 bg-brand-subtle px-3 py-2 text-[13px] font-medium text-brand-text transition-all hover:shadow-brand",onClick:()=>d(!0),children:[h.jsx(wE,{size:14}),"登录我的档案"]})})]})}const a5={"/timeline":{title:"时间线",sub:"按学年与月份回顾全部足迹"},"/records":{title:"记录",sub:"全部足迹的检索与管理"},"/grades":{title:"成绩",sub:"学年学科成绩 · 梯度与总览"},"/dashboard":{title:"统计",sub:"量化个人成长收获"},"/types":{title:"记录类型",sub:"类型与字段模板管理"},"/taxonomy":{title:"字典与维度",sub:"级别、角色与成长维度"}};function n5({onMenu:n}){const{pathname:r}=gl(),s=ao(),[o,f]=E.useState(""),[m,d]=E.useState(document.documentElement.classList.contains("dark")),v=a5[r]??{title:""},b=()=>{const p=!m;d(p),document.documentElement.classList.toggle("dark",p),localStorage.setItem("fp-theme",p?"dark":"light"),window.dispatchEvent(new CustomEvent("fp-theme-change"))};return h.jsxs("header",{className:"no-print flex h-14 shrink-0 items-center gap-2 border-b border-line bg-surface px-3 sm:gap-4 sm:px-5",children:[h.jsx(zt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:n,"aria-label":"打开导航",children:h.jsx(OE,{size:17})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h1",{className:"truncate text-[15px] font-semibold leading-tight text-ink-1",children:v.title}),v.sub&&h.jsx("p",{className:"truncate text-[11px] leading-tight text-ink-3",children:v.sub})]}),h.jsxs("div",{className:"relative ml-auto hidden w-[240px] md:block lg:w-[280px]",children:[h.jsx(IE,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-3"}),h.jsx(nt,{className:"pl-8",placeholder:"搜索标题、内容、结果、标签",value:o,onChange:p=>f(p.target.value),onKeyDown:p=>{p.key==="Enter"&&o.trim()&&s("/records?q="+encodeURIComponent(o.trim()))}})]}),h.jsx(zt,{variant:"ghost",size:"icon",onClick:b,"aria-label":"切换主题",children:m?h.jsx(f4,{size:15}):h.jsx(DE,{size:15})}),h.jsxs(zt,{variant:"primary",onClick:()=>s("/records?new=1"),"aria-label":"新建记录",children:[h.jsx(XE,{size:14}),h.jsx("span",{className:"hidden sm:inline",children:"新建记录"})]})]})}function i5(){return h.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function u5(){const[n,r]=E.useState("login"),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(""),[x,g]=E.useState(!1),_="__TAURI_INTERNALS__"in window,[k,K]=E.useState(Ol()),q=H=>{K(H),S0(H)},D=async()=>{if(!s.trim()||!f){p("请填写账号与密码");return}g(!0),p("");try{if(n==="login")await $d(s.trim(),f,k);else{if(!d.trim())throw new Error("请填写邀请码");await Pd(s.trim(),f,d.trim(),k)}setTimeout(()=>window.location.reload(),200)}catch(H){p(H.message)}finally{g(!1)}};return h.jsx("div",{className:"flex h-full items-center justify-center bg-bg px-4",children:h.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[h.jsx(i5,{}),h.jsx("div",{className:"text-[18px] font-semibold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[11px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),h.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(n==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{r("login"),p("")},children:"登录"}),h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(n==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{r("register"),p("")},children:"注册"})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[_&&h.jsx(De,{label:"服务器地址",hint:"默认即可",children:h.jsx(nt,{value:k,onChange:H=>q(H.target.value),placeholder:"https://footpr.linyux.cn"})}),h.jsx(De,{label:"用户名",required:!0,children:h.jsx(nt,{value:s,onChange:H=>o(H.target.value),placeholder:"3-32 位字母数字-_",onKeyDown:H=>{H.key==="Enter"&&D()}})}),h.jsx(De,{label:"密码",required:!0,children:h.jsx(nt,{type:"password",value:f,onChange:H=>m(H.target.value),placeholder:"至少 8 位",onKeyDown:H=>{H.key==="Enter"&&D()}})}),n==="register"&&h.jsx(De,{label:"邀请码",required:!0,hint:"向管理员索取",children:h.jsx(nt,{value:d,onChange:H=>v(H.target.value),placeholder:"邀请码",onKeyDown:H=>{H.key==="Enter"&&D()}})}),b&&h.jsx("div",{className:"text-[12px] text-danger",children:b}),h.jsx(zt,{variant:"primary",size:"lg",onClick:()=>void D(),disabled:x,children:x?"请稍候…":n==="login"?"进入我的档案":"创建我的档案"}),h.jsx("button",{type:"button",className:"mt-1 flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line px-3 py-2 text-[11.5px] text-ink-3 transition-colors hover:border-brand/40 hover:text-brand-text",onClick:()=>{o("demo"),m("demo1234")},children:"演示账号:demo / demo1234(点击填充)"})]})]})})}function r5(){const[n,r]=E.useState(()=>!!vl()),[s,o]=E.useState(!1);return E.useEffect(()=>{const f=()=>r(!1);return window.addEventListener("fp-auth-required",f),()=>window.removeEventListener("fp-auth-required",f)},[]),n?h.jsx($_,{children:h.jsxs("div",{className:"flex h-full",children:[s&&h.jsx("div",{className:"fixed inset-0 z-30 bg-black/45 lg:hidden",onClick:()=>o(!1),"aria-hidden":!0}),h.jsx(l5,{open:s,onClose:()=>o(!1)}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[h.jsx(n5,{onMenu:()=>o(!0)}),h.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:h.jsx(cS,{})})]})]})}):h.jsx(u5,{})}const Gn="inline-flex h-[22px] min-w-[52px] items-center justify-center gap-1 rounded-sm border px-2 text-[11.5px] font-medium whitespace-nowrap",cg={draft:{label:"草稿",color:"var(--text-3)",bg:"var(--surface-3)"},ongoing:{label:"进行中",color:"var(--brand-text)",bg:"var(--brand-subtle)"},submitted:{label:"已提交待果",color:"var(--warning)",bg:"var(--warning-subtle)"},finished:{label:"已完结",color:"var(--success)",bg:"var(--success-subtle)"}};function F0({status:n}){const r=cg[n]??cg.draft;return h.jsx("span",{className:Gn+" border-transparent",style:{color:r.color,backgroundColor:r.bg},children:r.label})}const s5={国际级:"#7c3aed",国家级:"#dc2626",省市级:"#ea580c",区县级:"#2563eb",校级:"#16a34a",院级:"#0891b2"};function $0({level:n}){return n?h.jsx(Ii,{color:s5[n]??"var(--text-3)",className:Gn,children:n}):null}const o5={特等奖:"#b45309",一等奖:"#b45309",二等奖:"#ea580c",三等奖:"#2563eb",优秀奖:"#64748b"};function P0({grade:n}){return n?h.jsx(Ii,{color:o5[n]??"var(--text-3)",className:Gn,children:n}):null}function W0({role:n}){return n?h.jsx(Z_,{className:Gn,children:n}):null}function I0(){return h.jsx(Ii,{color:"var(--danger)",className:Gn,children:"负面"})}const B5=[{name:"tag",label:"通用"},{name:"graduation-cap",label:"学业"},{name:"trophy",label:"竞赛"},{name:"flask-conical",label:"科研"},{name:"briefcase",label:"实习"},{name:"network",label:"学生工作"},{name:"heart-handshake",label:"志愿"},{name:"palette",label:"文体"},{name:"award",label:"荣誉"},{name:"file-badge",label:"证书"},{name:"star",label:"收藏"},{name:"shield-alert",label:"惩处"},{name:"book-open",label:"阅读"},{name:"code-2",label:"技术"},{name:"languages",label:"语言"},{name:"mic-2",label:"文艺"},{name:"pen-line",label:"发表"},{name:"rocket",label:"项目"},{name:"users",label:"团队"},{name:"building-2",label:"组织"},{name:"dumbbell",label:"体育"}],c5={tag:p0,"graduation-cap":v0,trophy:y4,"flask-conical":fE,briefcase:Q3,network:kE,"heart-handshake":mE,palette:qE,award:H3,"file-badge":sE,star:o4,"shield-alert":a4,"book-open":L3,"code-2":lE,languages:EE,"mic-2":AE,"pen-line":QE,rocket:ZE,users:b4,"building-2":Y3,dumbbell:uE};function f5({name:n,color:r,size:s=14,className:o}){const f=c5[n]??p0;return h.jsx(f,{size:s,color:r,className:o,strokeWidth:2})}const fg=new Map,d5=25*1024*1024;async function h5(n){const r=fg.get(n.id);if(r)return r;const s=await Is(n.id);return(n.size??0)<=d5&&fg.set(n.id,s),s}function dg(n){const r=(n.mime||"").toLowerCase(),s=(n.file_name.split(".").pop()||"").toLowerCase();return r.startsWith("image/")||["png","jpg","jpeg","gif","webp","bmp","svg"].includes(s)?"image":r==="application/pdf"||s==="pdf"?"pdf":s==="docx"||r.includes("wordprocessingml")?"docx":s==="xlsx"||s==="xls"||r.includes("spreadsheetml")||r==="application/vnd.ms-excel"?"xlsx":r.startsWith("audio/")||["mp3","wav","m4a","flac","ogg"].includes(s)?"audio":r.startsWith("video/")||["mp4","mov","webm","mkv"].includes(s)?"video":r.startsWith("text/")||["txt","md","csv","json","log","srt"].includes(s)?"text":"other"}function m5(n){return Uint8Array.from(atob(n),r=>r.charCodeAt(0))}const y5={image:"图片",pdf:"PDF 文档",text:"文本文件",audio:"音频",video:"视频",docx:"Word 文档(.docx)",xlsx:"Excel 表格(.xlsx)",other:"该类型暂不支持在线预览"};function e1({att:n,onClose:r}){const s=oo(),[o,f]=E.useState(!1),[m,d]=E.useState(""),[v,b]=E.useState(null);E.useEffect(()=>{if(!n){b(null),d("");return}let x=!1;const g=[];return f(!0),d(""),b(null),(async()=>{try{const _=dg(n),k=n.remote_url||null;if(k&&(_==="image"||_==="pdf"||_==="audio"||_==="video")){b({kind:_,objectUrl:k}),f(!1);return}let K=n.mime??void 0,q;if(k)q=new Uint8Array(await(await fetch(k)).arrayBuffer());else{const D=await h5(n);K=D.mime,q=m5(D.data_b64)}if(x)return;if(_==="text"){const D=new TextDecoder().decode(q);b({kind:_,text:D.length>4e5?D.slice(0,4e5)+` -…(已截断)`:D})}else if(_==="docx"){const H=(await(await jl(()=>import("./mammoth.browser-DRYI4-uz.js").then(Q=>Q.m),[])).convertToHtml({arrayBuffer:q.buffer})).value;if(x)return;b({kind:_,html:H})}else if(_==="xlsx"){const D=await jl(()=>import("./xlsx-CbTSpprj.js"),[]),H=D.read(q,{type:"array"}),Q=D.utils.sheet_to_html(H.Sheets[H.SheetNames[0]]);if(x)return;b({kind:_,html:Q})}else{const D=URL.createObjectURL(new Blob([q],{type:K||"application/octet-stream"}));if(x){URL.revokeObjectURL(D);return}g.push(D),b({kind:_,objectUrl:D})}}catch(_){x||d(_.message||"预览加载失败")}finally{x||f(!1)}})(),()=>{x=!0,g.forEach(_=>URL.revokeObjectURL(_))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const p=n?dg(n):"other";return h.jsxs(so,{open:!!n,onClose:r,width:p==="image"||p==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+y5[p]+")":""),footer:n?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"secondary",className:"mr-auto",onClick:()=>{(async()=>{try{const{blob:x,file_name:g}=await j0(n.id),_=URL.createObjectURL(x),k=document.createElement("a");k.href=_,k.download=g,k.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),s("success","已下载:"+g)}catch(x){s("error","下载失败:"+x.message)}})()},children:[h.jsx(nE,{size:13})," 下载"]}),h.jsx(zt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[h.jsx(TE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!o&&!!m&&h.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:m}),!o&&!m&&v&&h.jsxs(h.Fragment,{children:[v.kind==="image"&&h.jsx("img",{src:v.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),v.kind==="pdf"&&h.jsx("iframe",{src:v.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),v.kind==="audio"&&h.jsx("audio",{controls:!0,src:v.objectUrl,className:"w-full"}),v.kind==="video"&&h.jsx("video",{controls:!0,src:v.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),v.kind==="text"&&h.jsx("pre",{className:"max-h-[68vh] overflow-auto whitespace-pre-wrap rounded-md bg-surface-2 p-3 text-[12.5px] leading-relaxed text-ink-1",children:v.text}),(v.kind==="docx"||v.kind==="xlsx")&&h.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-md border border-line bg-white p-4 text-[13px] leading-relaxed [&_img]:max-w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1",dangerouslySetInnerHTML:{__html:v.html||""}}),v.kind==="other"&&h.jsxs("div",{className:"py-10 text-center",children:[h.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),h.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function v5({value:n,onChange:r,placeholder:s}){const[o,f]=E.useState(""),m=()=>{const v=o.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m()):v.key==="Backspace"&&!o&&n.length&&r(n.slice(0,-1))};return h.jsxs("div",{className:pl("flex min-h-8 w-full flex-wrap items-center gap-1 rounded-md border border-line bg-surface px-1.5 py-1","transition-colors hover:border-line-strong focus-within:border-brand"),children:[n.map(v=>h.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[v,h.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:h.jsx(g0,{size:11})})]},v)),h.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:o,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:m})]})}function hg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function p5({fields:n,value:r,onChange:s,taxonomies:o}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),m=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",p=x=>d.unit?h.jsxs("div",{className:"flex items-center gap-2",children:[x,h.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(wd,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:p(h.jsx(nt,{type:"number",step:"any",className:"num",value:v==null?"":String(v),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(ml,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...hg(d,o)]})},d.key);case"multiselect":{const x=hg(d,o),g=Array.isArray(v)?v:[];return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(_=>{const k=g.includes(_.value);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(k?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,k?g.filter(K=>K!==_.value):[...g,_.value]),children:_.label},_.value)}),!x.length&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return h.jsx(De,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>h.jsx("div",{className:d.widget==="textarea"?"sm:col-span-2":"",children:m(d)},d.key))})}function mg(n){return n?n.slice(0,16).replace("T"," "):""}function g5(n,r){const s=n?n.slice(0,10):"",o=r?r.slice(0,10):"";return s&&o?s+" ~ "+o:s?s+(r===""?"":" 起"):o?"至 "+o:""}function Cd(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function t1(n,r,s=480,o=.82){return new Promise((f,m)=>{const d=new Image;d.onload=()=>{try{const v=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*v)),p=Math.max(1,Math.round(d.naturalHeight*v)),x=document.createElement("canvas");x.width=b,x.height=p;const g=x.getContext("2d");if(!g)return m(new Error("canvas 不可用"));g.drawImage(d,0,0,b,p),f(x.toDataURL("image/webp",o))}catch(v){m(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>m(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function yg({items:n,pending:r,onPick:s,onDeleteSaved:o,onDeletePending:f,onOpenSaved:m,uploading:d}){const v=E.useRef(null),b=n.length+r.length;return h.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[h.jsx(Kd,{size:13}),"附件(",b,")"]}),h.jsx(zt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var p;return(p=v.current)==null?void 0:p.click()},children:d?"上传中…":"添加文件"}),h.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:p=>{var x;(x=p.target.files)!=null&&x.length&&s(p.target.files),p.target.value=""}})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(p=>h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[h.jsx(y0,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate "+(m?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>m==null?void 0:m(p),title:p.file_name,children:p.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>o(p.id),"aria-label":"删除附件",children:h.jsx(Ed,{size:13})})]},"s"+p.id)),r.map((p,x)=>{var g;return h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(g=p.mime)!=null&&g.startsWith("image/")&&p.preview?h.jsx("img",{src:p.preview,alt:p.file_name,className:"size-7 shrink-0 rounded object-cover"}):h.jsx(vE,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate text-ink-1",children:p.file_name}),h.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:h.jsx(Ed,{size:13})})]},"p"+x)}),!b&&h.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function vg(n){var d,v,b,p;let r=n;if(n.type==="image/jpeg"&&n.size>3*1024*1024)try{const x=await createImageBitmap(n),g=Math.min(1,2560/Math.max(x.width,x.height)),_=document.createElement("canvas");_.width=Math.round(x.width*g),_.height=Math.round(x.height*g),(d=_.getContext("2d"))==null||d.drawImage(x,0,0,_.width,_.height);const k=await new Promise(K=>_.toBlob(K,"image/jpeg",.85));k&&k.size{const _=new FileReader;_.onload=()=>x(String(_.result||"")),_.onerror=()=>g(new Error("读取文件失败")),_.readAsDataURL(r)}),o=s.indexOf(","),f=o>=0?s.slice(o+1):s;let m;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{m=(await t1(f,n.type)).split(",")[1]||void 0}catch{m=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:m,preview:(p=n.type)!=null&&p.startsWith("image/")?URL.createObjectURL(n):void 0}}const $s={竞赛:{core:["level","award_grade","role","organizer"]},科研:{core:["level","role","organizer"]},实习实践:{core:["organizer"]},学生工作:{core:["role","organizer"]},志愿公益:{core:["organizer"]},文体活动:{core:["level","organizer"]},证书技能:{core:["level","organizer"]},荣誉惩处:{core:["award_grade","level","organizer"]},学业:{core:["rank"]}},pg={core:["level","role","award_grade","organizer"]},Q5=[{value:"",label:"通用布局(级别/角色/奖等/组织方)"},...Object.keys($s).map(n=>({value:n,label:n+"式布局"}))];function b5(n,r){return r&&$s[r]?$s[r]:n?$s[n]??pg:pg}const gg={type_id:null,title:"",organizer:"",start_date:"",end_date:"",status:"draft",role:"",level:"",award_grade:"",rank:"",polarity:"positive",weight:"3",description:"",result:"",tags:[],dimension_ids:[],group_id:"",parent_id:"",extras:{}},x5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],bg=80*1024*1024,S5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function E5({open:n,onClose:r,footprintId:s,onSaved:o}){var ie,Te,re,V,ee;const f=lu(),m=oo(),[d,v]=E.useState(gg),[b,p]=E.useState([]),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(""),D=yl({queryKey:["types"],queryFn:uo,enabled:n}),H=yl({queryKey:["taxonomy-all"],queryFn:()=>E0(),enabled:n}),Q=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),Z=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),J=yl({queryKey:["attachments",s],queryFn:()=>w0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var R;return(R=D.data)==null?void 0:R.items.find(ae=>ae.id===d.type_id)},[D.data,d.type_id]),de=b5(Y==null?void 0:Y.name,Y==null?void 0:Y.profile),F=yl({queryKey:["parent-candidates",d.type_id],queryFn:()=>_0({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});E.useEffect(()=>{if(n)if(q(""),p([]),s&&Z.data){const R=Z.data.item;v({type_id:R.type_id,title:R.title,organizer:R.organizer??"",start_date:(R.start_date??"").slice(0,10),end_date:(R.end_date??"").slice(0,10),status:R.status,role:R.role??"",level:R.level??"",award_grade:R.award_grade??"",rank:R.rank!=null?String(R.rank):"",polarity:R.polarity,weight:String(R.weight??3),description:R.description??"",result:R.result??"",tags:R.tags??[],dimension_ids:R.dimensions??[],group_id:R.group_id??"",parent_id:R.parent_id!=null?String(R.parent_id):"",extras:R.extras??{}})}else v(gg)},[n,s,Z.data]);const U=E.useMemo(()=>{var ae,X;const R={};for(const ke of((ae=H.data)==null?void 0:ae.items)??[])(R[X=ke.kind]??(R[X]=[])).push({value:ke.value,label:ke.value});return R},[H.data]),I=Sd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const R={};for(const ke of(Y==null?void 0:Y.form_template)??[])if(ke.metric&&ke.widget==="number"){const Nt=d.extras[ke.key];typeof Nt=="number"&&!Number.isNaN(Nt)&&(R[ke.metric]=Nt)}const ae={id:s??void 0,type_id:d.type_id,title:d.title.trim(),organizer:d.organizer||null,start_date:d.start_date||null,end_date:d.end_date||null,status:d.status,role:d.role||null,level:d.level||null,award_grade:d.award_grade&&d.award_grade!=="无"?d.award_grade:null,rank:d.rank?Number(d.rank):null,polarity:d.polarity,description:d.description,result:d.result,tags:d.tags,dimension_ids:d.dimension_ids,group_id:d.group_id||null,parent_id:d.parent_id?Number(d.parent_id):null,weight:Number(d.weight)||3,extras:d.extras,metrics:R},X=await T0(ae);for(const ke of b)await Td(X.id,ke.file,ke.thumb_b64);return X.id},onSuccess:R=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",R]}),f.invalidateQueries({queryKey:["types"]}),m("success",s?"记录已更新":"记录已创建"),o==null||o(R),r()},onError:R=>q(R.message)}),le=(R,ae)=>v(X=>({...X,[R]:ae})),Ve=Sd({mutationFn:R=>C0(R),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})}),Fe=R=>R==="organizer"?h.jsx(De,{label:"组织方 / 所在组织",children:h.jsx(nt,{value:d.organizer,onChange:ae=>le("organizer",ae.target.value),placeholder:"如:中国工业与应用数学学会"})},"organizer"):R==="role"?h.jsx(De,{label:"角色",children:h.jsx(ml,{value:d.role,onChange:ae=>le("role",ae.target.value),options:[{value:"",label:"未设置"},...U.role??[]]})},"role"):R==="level"?h.jsx(De,{label:"级别",children:h.jsx(ml,{value:d.level,onChange:ae=>le("level",ae.target.value),options:[{value:"",label:"未设置"},...U.level??[]]})},"level"):R==="award_grade"?h.jsx(De,{label:"奖等",children:h.jsx(ml,{value:d.award_grade,onChange:ae=>le("award_grade",ae.target.value),options:[{value:"",label:"未设置"},...x5.map(ae=>({value:ae,label:ae}))]})},"award_grade"):R==="rank"?h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:ae=>le("rank",ae.target.value),placeholder:"如 2"})},"rank"):null;return h.jsxs(so,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:h.jsxs(h.Fragment,{children:[K&&h.jsx("span",{className:"mr-auto text-[12px] text-danger",children:K}),h.jsx(zt,{variant:"secondary",onClick:r,children:"取消"}),h.jsx(zt,{variant:"primary",onClick:()=>I.mutate(),disabled:I.isPending,children:I.isPending?"保存中…":"保存"})]}),children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"类型",required:!0,children:h.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:R=>le("type_id",R.target.value?Number(R.target.value):null),options:[{value:"",label:"请选择"},...(((ie=D.data)==null?void 0:ie.items)??[]).map(R=>({value:String(R.id),label:R.name}))]})}),h.jsx(De,{label:"标题",required:!0,children:h.jsx(nt,{value:d.title,onChange:R=>le("title",R.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"开始日期",children:h.jsx(nt,{type:"date",value:d.start_date,onChange:R=>le("start_date",R.target.value)})}),h.jsx(De,{label:"结束日期",children:h.jsx(nt,{type:"date",value:d.end_date,onChange:R=>le("end_date",R.target.value)})}),h.jsx(De,{label:"状态",children:h.jsx(ml,{value:d.status,onChange:R=>le("status",R.target.value),options:S5})})]}),h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12px] font-semibold text-ink-2",children:["类型要素",Y?" · "+Y.name:""]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:de.core.map(R=>Fe(R))}),Y&&Y.form_template.length>0&&h.jsxs("div",{className:"mt-3.5",children:[h.jsx("div",{className:"mb-2 text-[11.5px] text-ink-3",children:"专项信息"}),h.jsx(p5,{fields:Y.form_template,value:d.extras,onChange:R=>le("extras",R),taxonomies:U})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"工作内容 / 描述",children:h.jsx(wd,{value:d.description,onChange:R=>le("description",R.target.value),placeholder:"具体做了什么、承担什么分工"})}),h.jsx(De,{label:"结果 / 产出",children:h.jsx(wd,{value:d.result,onChange:R=>le("result",R.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"标签",children:h.jsx(v5,{value:d.tags,onChange:R=>le("tags",R)})}),h.jsx(De,{label:"成长维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Te=Q.data)==null?void 0:Te.items)??[]).map(R=>{const ae=d.dimension_ids.includes(R.id);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ae?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>le("dimension_ids",ae?d.dimension_ids.filter(X=>X!==R.id):[...d.dimension_ids,R.id]),children:R.name},R.id)}),!((re=Q.data)!=null&&re.items.length)&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),h.jsxs("details",{className:"border-t border-line pt-4",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-ink-3 transition-colors hover:text-ink-2",children:"高级选项(重要度 · 名次 · 性质 · 关联)"}),h.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"重要度",children:h.jsx(ml,{value:d.weight,onChange:R=>le("weight",R.target.value),options:[1,2,3,4,5].map(R=>({value:String(R),label:String(R)}))})}),!de.core.includes("rank")&&h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:R=>le("rank",R.target.value),placeholder:"如 2"})}),h.jsx(De,{label:"性质",children:h.jsx(ml,{value:d.polarity,onChange:R=>le("polarity",R.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),h.jsx(De,{label:"上级记录",hint:"晋升链",children:h.jsx(ml,{value:d.parent_id,onChange:R=>le("parent_id",R.target.value),options:[{value:"",label:"无"},...(((V=F.data)==null?void 0:V.items)??[]).filter(R=>R.id!==s).map(R=>({value:String(R.id),label:R.title.slice(0,24)}))]})})]}),h.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:h.jsx(De,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:h.jsx(nt,{value:d.group_id,onChange:R=>le("group_id",R.target.value),placeholder:"如 g2025001(可选)"})})})]}),s?h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:((ee=J.data)==null?void 0:ee.items)??[],pending:b,uploading:x,onPick:async R=>{if(s){g(!0);try{let ae=0;for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}const ke=await vg(X);await Td(s,ke.file,ke.thumb_b64),ae++}ae>0&&(f.invalidateQueries({queryKey:["attachments",s]}),m("success","已上传 "+ae+" 个附件"))}catch(ae){m("error",ae.message)}finally{g(!1)}}},onDeleteSaved:R=>Ve.mutate(R),onDeletePending:()=>{},onOpenSaved:R=>k(R)}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:[],pending:b,onPick:async R=>{const ae=[];for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}ae.push(await vg(X))}p(X=>[...X,...ae])},onDeleteSaved:()=>{},onDeletePending:R=>p(ae=>ae.filter((X,ke)=>ke!==R))}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),h.jsx(e1,{att:_,onClose:()=>k(null)})]})}const ki=new Map;function _5({open:n,onClose:r,footprintId:s,onEdit:o}){var U,I,le,Ve,Fe;const f=lu(),m=oo(),d=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),v=yl({queryKey:["types"],queryFn:uo,enabled:n}),b=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),p=(U=d.data)==null?void 0:U.item,x=(I=v.data)==null?void 0:I.items.find(ie=>ie.id===(p==null?void 0:p.type_id)),g=((p==null?void 0:p.dimensions)??[]).map(ie=>{var Te,re;return(re=(Te=b.data)==null?void 0:Te.items.find(V=>V.id===ie))==null?void 0:re.name}).filter(Boolean),[_,k]=E.useState(!1),[K,q]=E.useState(null),D=Sd({mutationFn:()=>jl(()=>Promise.resolve().then(()=>I4),void 0).then(ie=>ie.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),m("success","记录已删除"),k(!1),r()}}),[H,Q]=E.useState({}),Z=(p==null?void 0:p.attachments)??[],J=Z.filter(ie=>{var Te;return(Te=ie.mime)==null?void 0:Te.startsWith("image/")}),Y=Z.filter(ie=>{var Te;return!((Te=ie.mime)!=null&&Te.startsWith("image/"))}),de=Z.map(ie=>ie.id).join(",");E.useEffect(()=>{if(!n||!de)return;let ie=!1;const Te=Z.filter(re=>{var V;return(V=re.mime)==null?void 0:V.startsWith("image/")});return(async()=>{for(const re of Te){if(ie)return;if(ki.has(re.id)){Q(V=>({...V,[re.id]:ki.get(re.id)}));continue}if(re.remote_thumb){ki.set(re.id,re.remote_thumb),Q(V=>({...V,[re.id]:re.remote_thumb}));continue}try{if(re.thumb_rel_path){const V=await z0(re.id);if(ie)return;const ee="data:"+(V.mime||"image/webp")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}else{const V=await Is(re.id);if(ie)return;const ee=await t1(V.data_b64,V.mime||"image/png");ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}}catch{try{const V=await Is(re.id);if(ie)return;const ee="data:"+(V.mime||"image/png")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}catch{}}}})(),()=>{ie=!0}},[n,s,de]);const F=[];if(p&&x)for(const ie of x.form_template??[]){const Te=(p.extras??{})[ie.key];if(Te==null||Te==="")continue;const re=Array.isArray(Te)?Te.join("、"):String(Te);F.push({label:ie.label,value:ie.unit?re+" "+ie.unit:re})}return h.jsxs(so,{open:n,onClose:r,width:680,title:"记录详情",footer:p?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>k(!0),disabled:D.isPending,children:[h.jsx(Ed,{size:13})," 删除"]}),h.jsx(zt,{variant:"secondary",onClick:r,children:"关闭"}),h.jsxs(zt,{variant:"primary",onClick:()=>s&&(o==null?void 0:o(s)),children:[h.jsx(YE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!p?h.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[20px] font-bold leading-tight tracking-tight text-ink-1",style:{textWrap:"balance"},children:p.title}),h.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[h.jsx(Ii,{color:p.type_color,className:Gn,children:p.type_name}),h.jsx($0,{level:p.level}),h.jsx(P0,{grade:p.award_grade}),h.jsx(W0,{role:p.role}),h.jsx(F0,{status:p.status}),p.polarity==="negative"&&h.jsx(I0,{}),p.rank!=null&&h.jsxs(Ii,{color:"var(--text-3)",className:Gn,children:["第 ",p.rank," 名"]})]})]}),h.jsx(Hi,{title:"事项要素",children:h.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px] sm:grid-cols-2",children:[h.jsx(nd,{label:"时间",value:g5(p.start_date,p.end_date)||"—"}),h.jsx(nd,{label:"组织方",value:p.organizer||"—"}),F.map(ie=>h.jsx(nd,{label:ie.label,value:ie.value},ie.label))]})}),(((le=p.attachments)==null?void 0:le.length)??0)>0&&h.jsx(Hi,{title:"附件("+(((Ve=p.attachments)==null?void 0:Ve.length)??0)+")",children:Z.length?h.jsxs("div",{className:"flex flex-col gap-2.5",children:[J.length>0&&h.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:J.map(ie=>h.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(ie),title:"点击预览:"+ie.file_name,children:[H[ie.id]?h.jsx("img",{src:H[ie.id],alt:ie.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):h.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),h.jsx("span",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-1.5 pb-1 pt-3 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100",children:ie.file_name})]},ie.id))}),Y.length>0&&h.jsx("div",{className:"flex flex-col gap-1",children:Y.map(ie=>h.jsxs("button",{className:"flex items-center gap-2 rounded-md border border-line bg-surface px-2.5 py-2 text-left text-[12.5px] transition-colors hover:border-line-strong",onClick:()=>q(ie),children:[h.jsx(y0,{size:14,className:"shrink-0 text-ink-3"}),h.jsx("span",{className:"truncate text-ink-1",children:ie.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(ie.size)}),h.jsx(Kd,{size:12,className:"shrink-0 text-ink-3"})]},ie.id))}),h.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):h.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})}),p.description&&h.jsx(Hi,{title:"工作内容 / 描述",children:h.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:p.description})}),p.result&&h.jsx(Hi,{title:"结果 / 产出",children:h.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:p.result})}),p.metrics&&Object.keys(p.metrics).length>0&&h.jsx(Hi,{title:"量化指标",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(p.metrics).map(([ie,Te])=>h.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[ie,": ",h.jsx("span",{className:"font-medium text-ink-1",children:Te})]},ie))})}),((((Fe=p.tags)==null?void 0:Fe.length)??0)>0||g.length>0)&&h.jsx(Hi,{title:"标签与维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[p.tags.map(ie=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:ie},ie)),g.map(ie=>h.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:ie},ie))]})}),h.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-t border-line pt-3 text-[11.5px] text-ink-3",children:[h.jsxs("span",{children:["创建于 ",mg(p.created_at)]}),h.jsxs("span",{children:["更新于 ",mg(p.updated_at)]}),p.group_id&&h.jsxs("span",{children:["事件组 ",p.group_id]}),p.parent_id!=null&&h.jsxs("span",{children:["上级 #",p.parent_id]})]})]}),h.jsx(e1,{att:K,onClose:()=>q(null)}),h.jsx(P_,{open:_,title:"删除记录",content:p?"确定删除「"+p.title+"」吗?该操作不可撤销。":"",onCancel:()=>k(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function nd({label:n,value:r}){return h.jsxs("div",{className:"grid min-w-0 grid-cols-[76px_1fr] gap-x-2.5",children:[h.jsx("span",{className:"shrink-0 text-right text-ink-3",children:n}),h.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Hi({title:n,children:r}){return h.jsxs("div",{children:[h.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function T5(){var Y,de,F;const[n,r]=E.useState(""),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(null),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(!1),D=yl({queryKey:["types"],queryFn:uo}),H=E.useMemo(()=>({q:n||void 0,types:s?[Number(s)]:void 0,year:f?Number(f):void 0,polarity:d||void 0,sort:"date_desc",page_size:2e3}),[n,s,f,d]),Q=yl({queryKey:["timeline",H],queryFn:()=>N0(H)}),Z=E.useMemo(()=>{var I;const U=new Set;for(const le of((I=Q.data)==null?void 0:I.groups)??[])U.add(le.year);return Array.from(U).sort((le,Ve)=>Ve-le)},[Q.data]),J=U=>{k(U),q(!0)};return h.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[h.jsx(nt,{className:"w-full sm:w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),h.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[h.jsx(ml,{className:"w-full sm:w-[130px]",value:s,onChange:U=>o(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),h.jsx(ml,{className:"w-full sm:w-[120px]",value:f,onChange:U=>m(U.target.value),options:[{value:"",label:"全部年份"},...Z.map(U=>({value:String(U),label:U+" 年"}))]}),h.jsx(ml,{className:"w-full sm:w-[110px]",value:d,onChange:U=>v(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})]}),h.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((de=Q.data)==null?void 0:de.total)??0," 条"]})]}),Q.isLoading?h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(F=Q.data)!=null&&F.groups.length?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Q.data.groups.map(U=>h.jsxs("section",{className:"mb-2",children:[h.jsxs("div",{className:"sticky top-0 z-10 -mx-3 flex items-center gap-2 bg-bg/90 px-3 py-2 backdrop-blur sm:-mx-6 sm:px-6",children:[h.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),h.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map(I=>h.jsxs("div",{className:"mb-3",children:[h.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[I.month," 月"]}),h.jsx("div",{className:"flex flex-col gap-2",children:I.items.map(le=>h.jsx(N5,{row:le,onClick:()=>J(le.id)},le.id))})]},I.month))]},U.year))]}):h.jsx(J_,{icon:h.jsx(m0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),h.jsx(_5,{open:K,onClose:()=>q(!1),footprintId:_,onEdit:U=>{q(!1),p(U),g(!0)}}),h.jsx(E5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function N5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return h.jsxs("button",{onClick:r,className:"group relative w-full rounded-lg border border-line bg-surface px-4 py-3 text-left shadow-card transition-all hover:border-line-strong hover:shadow-pop",children:[h.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"num w-[52px] shrink-0 pt-0.5 text-[12px] leading-relaxed text-ink-3",children:[s.slice(5,7),"-",s.slice(8,10)]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),h.jsx(Ii,{color:n.type_color,children:n.type_name}),h.jsx($0,{level:n.level}),h.jsx(P0,{grade:n.award_grade}),h.jsx(W0,{role:n.role}),h.jsx(F0,{status:n.status}),n.polarity==="negative"&&h.jsx(I0,{})]}),n.organizer&&h.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&h.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-relaxed text-ink-2",children:n.description}),(n.result||n.tags.length>0||n.attachment_count>0)&&h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-ink-3",children:[n.result&&h.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(o=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:o},o)),n.attachment_count>0&&h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Kd,{size:11}),n.attachment_count]})]})]}),h.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:h.jsx(f5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const w5=E.lazy(()=>jl(()=>import("./RecordsPage-COdEkyD5.js"),[]).then(n=>({default:n.RecordsPage}))),C5=E.lazy(()=>jl(()=>import("./DashboardPage-CPUiI0iy.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),j5=E.lazy(()=>jl(()=>import("./GradesPage-Ij8UzdbZ.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),z5=E.lazy(()=>jl(()=>import("./TypesPage-B7GapiTk.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),O5=E.lazy(()=>jl(()=>import("./TaxonomyPage-IQFdyHqI.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),R5=E.lazy(()=>jl(()=>import("./AdminPage-EK2Zo7TL.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage}))),A5=E.lazy(()=>jl(()=>import("./ProfilePage-CL6-SO69.js"),[]).then(n=>({default:n.ProfilePage}))),M5=E.lazy(()=>jl(()=>import("./ResumePage-BHj_NUxM.js"),__vite__mapDeps([8,1])).then(n=>({default:n.ResumePage})));function Ja(){return h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function D5(){return h.jsx(dS,{children:h.jsxs(tl,{element:h.jsx(r5,{}),children:[h.jsx(tl,{path:"/",element:h.jsx(Vp,{to:"/timeline",replace:!0})}),h.jsx(tl,{path:"/timeline",element:h.jsx(T5,{})}),h.jsx(tl,{path:"/records",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(w5,{})})}),h.jsx(tl,{path:"/grades",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(j5,{})})}),h.jsx(tl,{path:"/dashboard",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(C5,{})})}),h.jsx(tl,{path:"/types",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(z5,{})})}),h.jsx(tl,{path:"/taxonomy",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(O5,{})})}),h.jsx(tl,{path:"/admin",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(R5,{})})}),h.jsx(tl,{path:"/profile",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(A5,{})})}),h.jsx(tl,{path:"/resume",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(M5,{})})}),h.jsx(tl,{path:"*",element:h.jsx(Vp,{to:"/timeline",replace:!0})})]})})}const U5=new b3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),xg=localStorage.getItem("fp-theme");(xg==="dark"||!xg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function l1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}l1();window.addEventListener("fp-theme-change",l1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});o2.createRoot(document.getElementById("root")).render(h.jsx(l2.StrictMode,{children:h.jsx(ZS,{client:U5,children:h.jsx(HS,{children:h.jsx(D5,{})})})}));export{vl as $,U4 as A,zt as B,P_ as C,k4 as D,J_ as E,so as F,P0 as G,De as H,nt as I,H4 as J,D4 as K,$0 as L,f5 as M,_4 as N,B5 as O,XE as P,Q5 as Q,W0 as R,ml as S,Ed as T,T4 as U,N4 as V,w4 as W,C4 as X,j4 as Y,Wd as Z,Ol as _,pl as a,g0 as a0,Cd as a1,K4 as a2,Z4 as a3,J4 as a4,F4 as a5,jl as a6,X4 as a7,V4 as a8,p4 as a9,wd as aa,W4 as ab,P4 as ac,$4 as ad,nE as ae,H5 as af,Ag as ag,I4 as ah,KS as b,pe as c,oo as d,q5 as e,yl as f,Sd as g,g5 as h,F0 as i,h as j,mg as k,YE as l,Ii as m,_5 as n,E5 as o,z4 as p,uo as q,E as r,E0 as s,O4 as t,lu as u,_0 as v,v0 as w,L4 as x,B4 as y,q4 as z}; +…(已截断)`:D})}else if(_==="docx"){const H=(await(await jl(()=>import("./mammoth.browser-MQmSAuUh.js").then(Q=>Q.m),[])).convertToHtml({arrayBuffer:q.buffer})).value;if(x)return;b({kind:_,html:H})}else if(_==="xlsx"){const D=await jl(()=>import("./xlsx-CbTSpprj.js"),[]),H=D.read(q,{type:"array"}),Q=D.utils.sheet_to_html(H.Sheets[H.SheetNames[0]]);if(x)return;b({kind:_,html:Q})}else{const D=URL.createObjectURL(new Blob([q],{type:K||"application/octet-stream"}));if(x){URL.revokeObjectURL(D);return}g.push(D),b({kind:_,objectUrl:D})}}catch(_){x||d(_.message||"预览加载失败")}finally{x||f(!1)}})(),()=>{x=!0,g.forEach(_=>URL.revokeObjectURL(_))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const p=n?dg(n):"other";return h.jsxs(so,{open:!!n,onClose:r,width:p==="image"||p==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+y5[p]+")":""),footer:n?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"secondary",className:"mr-auto",onClick:()=>{(async()=>{try{const{blob:x,file_name:g}=await j0(n.id),_=URL.createObjectURL(x),k=document.createElement("a");k.href=_,k.download=g,k.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),s("success","已下载:"+g)}catch(x){s("error","下载失败:"+x.message)}})()},children:[h.jsx(nE,{size:13})," 下载"]}),h.jsx(zt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[h.jsx(TE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!o&&!!m&&h.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:m}),!o&&!m&&v&&h.jsxs(h.Fragment,{children:[v.kind==="image"&&h.jsx("img",{src:v.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),v.kind==="pdf"&&h.jsx("iframe",{src:v.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),v.kind==="audio"&&h.jsx("audio",{controls:!0,src:v.objectUrl,className:"w-full"}),v.kind==="video"&&h.jsx("video",{controls:!0,src:v.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),v.kind==="text"&&h.jsx("pre",{className:"max-h-[68vh] overflow-auto whitespace-pre-wrap rounded-md bg-surface-2 p-3 text-[12.5px] leading-relaxed text-ink-1",children:v.text}),(v.kind==="docx"||v.kind==="xlsx")&&h.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-md border border-line bg-white p-4 text-[13px] leading-relaxed [&_img]:max-w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1",dangerouslySetInnerHTML:{__html:v.html||""}}),v.kind==="other"&&h.jsxs("div",{className:"py-10 text-center",children:[h.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),h.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function v5({value:n,onChange:r,placeholder:s}){const[o,f]=E.useState(""),m=()=>{const v=o.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m()):v.key==="Backspace"&&!o&&n.length&&r(n.slice(0,-1))};return h.jsxs("div",{className:pl("flex min-h-8 w-full flex-wrap items-center gap-1 rounded-md border border-line bg-surface px-1.5 py-1","transition-colors hover:border-line-strong focus-within:border-brand"),children:[n.map(v=>h.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[v,h.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:h.jsx(g0,{size:11})})]},v)),h.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:o,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:m})]})}function hg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function p5({fields:n,value:r,onChange:s,taxonomies:o}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),m=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",p=x=>d.unit?h.jsxs("div",{className:"flex items-center gap-2",children:[x,h.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(wd,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:p(h.jsx(nt,{type:"number",step:"any",className:"num",value:v==null?"":String(v),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(ml,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...hg(d,o)]})},d.key);case"multiselect":{const x=hg(d,o),g=Array.isArray(v)?v:[];return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(_=>{const k=g.includes(_.value);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(k?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,k?g.filter(K=>K!==_.value):[...g,_.value]),children:_.label},_.value)}),!x.length&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return h.jsx(De,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>h.jsx("div",{className:d.widget==="textarea"?"sm:col-span-2":"",children:m(d)},d.key))})}function mg(n){return n?n.slice(0,16).replace("T"," "):""}function g5(n,r){const s=n?n.slice(0,10):"",o=r?r.slice(0,10):"";return s&&o?s+" ~ "+o:s?s+(r===""?"":" 起"):o?"至 "+o:""}function Cd(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function t1(n,r,s=480,o=.82){return new Promise((f,m)=>{const d=new Image;d.onload=()=>{try{const v=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*v)),p=Math.max(1,Math.round(d.naturalHeight*v)),x=document.createElement("canvas");x.width=b,x.height=p;const g=x.getContext("2d");if(!g)return m(new Error("canvas 不可用"));g.drawImage(d,0,0,b,p),f(x.toDataURL("image/webp",o))}catch(v){m(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>m(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function yg({items:n,pending:r,onPick:s,onDeleteSaved:o,onDeletePending:f,onOpenSaved:m,uploading:d}){const v=E.useRef(null),b=n.length+r.length;return h.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[h.jsx(Kd,{size:13}),"附件(",b,")"]}),h.jsx(zt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var p;return(p=v.current)==null?void 0:p.click()},children:d?"上传中…":"添加文件"}),h.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:p=>{var x;(x=p.target.files)!=null&&x.length&&s(p.target.files),p.target.value=""}})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(p=>h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[h.jsx(y0,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate "+(m?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>m==null?void 0:m(p),title:p.file_name,children:p.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>o(p.id),"aria-label":"删除附件",children:h.jsx(Ed,{size:13})})]},"s"+p.id)),r.map((p,x)=>{var g;return h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(g=p.mime)!=null&&g.startsWith("image/")&&p.preview?h.jsx("img",{src:p.preview,alt:p.file_name,className:"size-7 shrink-0 rounded object-cover"}):h.jsx(vE,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate text-ink-1",children:p.file_name}),h.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:h.jsx(Ed,{size:13})})]},"p"+x)}),!b&&h.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function vg(n){var d,v,b,p;let r=n;if(n.type==="image/jpeg"&&n.size>3*1024*1024)try{const x=await createImageBitmap(n),g=Math.min(1,2560/Math.max(x.width,x.height)),_=document.createElement("canvas");_.width=Math.round(x.width*g),_.height=Math.round(x.height*g),(d=_.getContext("2d"))==null||d.drawImage(x,0,0,_.width,_.height);const k=await new Promise(K=>_.toBlob(K,"image/jpeg",.85));k&&k.size{const _=new FileReader;_.onload=()=>x(String(_.result||"")),_.onerror=()=>g(new Error("读取文件失败")),_.readAsDataURL(r)}),o=s.indexOf(","),f=o>=0?s.slice(o+1):s;let m;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{m=(await t1(f,n.type)).split(",")[1]||void 0}catch{m=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:m,preview:(p=n.type)!=null&&p.startsWith("image/")?URL.createObjectURL(n):void 0}}const $s={竞赛:{core:["level","award_grade","role","organizer"]},科研:{core:["level","role","organizer"]},实习实践:{core:["organizer"]},学生工作:{core:["role","organizer"]},志愿公益:{core:["organizer"]},文体活动:{core:["level","organizer"]},证书技能:{core:["level","organizer"]},荣誉惩处:{core:["award_grade","level","organizer"]},学业:{core:["rank"]}},pg={core:["level","role","award_grade","organizer"]},Q5=[{value:"",label:"通用布局(级别/角色/奖等/组织方)"},...Object.keys($s).map(n=>({value:n,label:n+"式布局"}))];function b5(n,r){return r&&$s[r]?$s[r]:n?$s[n]??pg:pg}const gg={type_id:null,title:"",organizer:"",start_date:"",end_date:"",status:"draft",role:"",level:"",award_grade:"",rank:"",polarity:"positive",weight:"3",description:"",result:"",tags:[],dimension_ids:[],group_id:"",parent_id:"",extras:{}},x5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],bg=80*1024*1024,S5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function E5({open:n,onClose:r,footprintId:s,onSaved:o}){var ie,Te,re,V,ee;const f=lu(),m=oo(),[d,v]=E.useState(gg),[b,p]=E.useState([]),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(""),D=yl({queryKey:["types"],queryFn:uo,enabled:n}),H=yl({queryKey:["taxonomy-all"],queryFn:()=>E0(),enabled:n}),Q=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),Z=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),J=yl({queryKey:["attachments",s],queryFn:()=>w0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var R;return(R=D.data)==null?void 0:R.items.find(ae=>ae.id===d.type_id)},[D.data,d.type_id]),de=b5(Y==null?void 0:Y.name,Y==null?void 0:Y.profile),F=yl({queryKey:["parent-candidates",d.type_id],queryFn:()=>_0({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});E.useEffect(()=>{if(n)if(q(""),p([]),s&&Z.data){const R=Z.data.item;v({type_id:R.type_id,title:R.title,organizer:R.organizer??"",start_date:(R.start_date??"").slice(0,10),end_date:(R.end_date??"").slice(0,10),status:R.status,role:R.role??"",level:R.level??"",award_grade:R.award_grade??"",rank:R.rank!=null?String(R.rank):"",polarity:R.polarity,weight:String(R.weight??3),description:R.description??"",result:R.result??"",tags:R.tags??[],dimension_ids:R.dimensions??[],group_id:R.group_id??"",parent_id:R.parent_id!=null?String(R.parent_id):"",extras:R.extras??{}})}else v(gg)},[n,s,Z.data]);const U=E.useMemo(()=>{var ae,X;const R={};for(const ke of((ae=H.data)==null?void 0:ae.items)??[])(R[X=ke.kind]??(R[X]=[])).push({value:ke.value,label:ke.value});return R},[H.data]),I=Sd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const R={};for(const ke of(Y==null?void 0:Y.form_template)??[])if(ke.metric&&ke.widget==="number"){const Nt=d.extras[ke.key];typeof Nt=="number"&&!Number.isNaN(Nt)&&(R[ke.metric]=Nt)}const ae={id:s??void 0,type_id:d.type_id,title:d.title.trim(),organizer:d.organizer||null,start_date:d.start_date||null,end_date:d.end_date||null,status:d.status,role:d.role||null,level:d.level||null,award_grade:d.award_grade&&d.award_grade!=="无"?d.award_grade:null,rank:d.rank?Number(d.rank):null,polarity:d.polarity,description:d.description,result:d.result,tags:d.tags,dimension_ids:d.dimension_ids,group_id:d.group_id||null,parent_id:d.parent_id?Number(d.parent_id):null,weight:Number(d.weight)||3,extras:d.extras,metrics:R},X=await T0(ae);for(const ke of b)await Td(X.id,ke.file,ke.thumb_b64);return X.id},onSuccess:R=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",R]}),f.invalidateQueries({queryKey:["types"]}),m("success",s?"记录已更新":"记录已创建"),o==null||o(R),r()},onError:R=>q(R.message)}),le=(R,ae)=>v(X=>({...X,[R]:ae})),Ve=Sd({mutationFn:R=>C0(R),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})}),Fe=R=>R==="organizer"?h.jsx(De,{label:"组织方 / 所在组织",children:h.jsx(nt,{value:d.organizer,onChange:ae=>le("organizer",ae.target.value),placeholder:"如:中国工业与应用数学学会"})},"organizer"):R==="role"?h.jsx(De,{label:"角色",children:h.jsx(ml,{value:d.role,onChange:ae=>le("role",ae.target.value),options:[{value:"",label:"未设置"},...U.role??[]]})},"role"):R==="level"?h.jsx(De,{label:"级别",children:h.jsx(ml,{value:d.level,onChange:ae=>le("level",ae.target.value),options:[{value:"",label:"未设置"},...U.level??[]]})},"level"):R==="award_grade"?h.jsx(De,{label:"奖等",children:h.jsx(ml,{value:d.award_grade,onChange:ae=>le("award_grade",ae.target.value),options:[{value:"",label:"未设置"},...x5.map(ae=>({value:ae,label:ae}))]})},"award_grade"):R==="rank"?h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:ae=>le("rank",ae.target.value),placeholder:"如 2"})},"rank"):null;return h.jsxs(so,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:h.jsxs(h.Fragment,{children:[K&&h.jsx("span",{className:"mr-auto text-[12px] text-danger",children:K}),h.jsx(zt,{variant:"secondary",onClick:r,children:"取消"}),h.jsx(zt,{variant:"primary",onClick:()=>I.mutate(),disabled:I.isPending,children:I.isPending?"保存中…":"保存"})]}),children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"类型",required:!0,children:h.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:R=>le("type_id",R.target.value?Number(R.target.value):null),options:[{value:"",label:"请选择"},...(((ie=D.data)==null?void 0:ie.items)??[]).map(R=>({value:String(R.id),label:R.name}))]})}),h.jsx(De,{label:"标题",required:!0,children:h.jsx(nt,{value:d.title,onChange:R=>le("title",R.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"开始日期",children:h.jsx(nt,{type:"date",value:d.start_date,onChange:R=>le("start_date",R.target.value)})}),h.jsx(De,{label:"结束日期",children:h.jsx(nt,{type:"date",value:d.end_date,onChange:R=>le("end_date",R.target.value)})}),h.jsx(De,{label:"状态",children:h.jsx(ml,{value:d.status,onChange:R=>le("status",R.target.value),options:S5})})]}),h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12px] font-semibold text-ink-2",children:["类型要素",Y?" · "+Y.name:""]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:de.core.map(R=>Fe(R))}),Y&&Y.form_template.length>0&&h.jsxs("div",{className:"mt-3.5",children:[h.jsx("div",{className:"mb-2 text-[11.5px] text-ink-3",children:"专项信息"}),h.jsx(p5,{fields:Y.form_template,value:d.extras,onChange:R=>le("extras",R),taxonomies:U})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"工作内容 / 描述",children:h.jsx(wd,{value:d.description,onChange:R=>le("description",R.target.value),placeholder:"具体做了什么、承担什么分工"})}),h.jsx(De,{label:"结果 / 产出",children:h.jsx(wd,{value:d.result,onChange:R=>le("result",R.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"标签",children:h.jsx(v5,{value:d.tags,onChange:R=>le("tags",R)})}),h.jsx(De,{label:"成长维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Te=Q.data)==null?void 0:Te.items)??[]).map(R=>{const ae=d.dimension_ids.includes(R.id);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ae?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>le("dimension_ids",ae?d.dimension_ids.filter(X=>X!==R.id):[...d.dimension_ids,R.id]),children:R.name},R.id)}),!((re=Q.data)!=null&&re.items.length)&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),h.jsxs("details",{className:"border-t border-line pt-4",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-ink-3 transition-colors hover:text-ink-2",children:"高级选项(重要度 · 名次 · 性质 · 关联)"}),h.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"重要度",children:h.jsx(ml,{value:d.weight,onChange:R=>le("weight",R.target.value),options:[1,2,3,4,5].map(R=>({value:String(R),label:String(R)}))})}),!de.core.includes("rank")&&h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:R=>le("rank",R.target.value),placeholder:"如 2"})}),h.jsx(De,{label:"性质",children:h.jsx(ml,{value:d.polarity,onChange:R=>le("polarity",R.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),h.jsx(De,{label:"上级记录",hint:"晋升链",children:h.jsx(ml,{value:d.parent_id,onChange:R=>le("parent_id",R.target.value),options:[{value:"",label:"无"},...(((V=F.data)==null?void 0:V.items)??[]).filter(R=>R.id!==s).map(R=>({value:String(R.id),label:R.title.slice(0,24)}))]})})]}),h.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:h.jsx(De,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:h.jsx(nt,{value:d.group_id,onChange:R=>le("group_id",R.target.value),placeholder:"如 g2025001(可选)"})})})]}),s?h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:((ee=J.data)==null?void 0:ee.items)??[],pending:b,uploading:x,onPick:async R=>{if(s){g(!0);try{let ae=0;for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}const ke=await vg(X);await Td(s,ke.file,ke.thumb_b64),ae++}ae>0&&(f.invalidateQueries({queryKey:["attachments",s]}),m("success","已上传 "+ae+" 个附件"))}catch(ae){m("error",ae.message)}finally{g(!1)}}},onDeleteSaved:R=>Ve.mutate(R),onDeletePending:()=>{},onOpenSaved:R=>k(R)}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:[],pending:b,onPick:async R=>{const ae=[];for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}ae.push(await vg(X))}p(X=>[...X,...ae])},onDeleteSaved:()=>{},onDeletePending:R=>p(ae=>ae.filter((X,ke)=>ke!==R))}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),h.jsx(e1,{att:_,onClose:()=>k(null)})]})}const ki=new Map;function _5({open:n,onClose:r,footprintId:s,onEdit:o}){var U,I,le,Ve,Fe;const f=lu(),m=oo(),d=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),v=yl({queryKey:["types"],queryFn:uo,enabled:n}),b=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),p=(U=d.data)==null?void 0:U.item,x=(I=v.data)==null?void 0:I.items.find(ie=>ie.id===(p==null?void 0:p.type_id)),g=((p==null?void 0:p.dimensions)??[]).map(ie=>{var Te,re;return(re=(Te=b.data)==null?void 0:Te.items.find(V=>V.id===ie))==null?void 0:re.name}).filter(Boolean),[_,k]=E.useState(!1),[K,q]=E.useState(null),D=Sd({mutationFn:()=>jl(()=>Promise.resolve().then(()=>I4),void 0).then(ie=>ie.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),m("success","记录已删除"),k(!1),r()}}),[H,Q]=E.useState({}),Z=(p==null?void 0:p.attachments)??[],J=Z.filter(ie=>{var Te;return(Te=ie.mime)==null?void 0:Te.startsWith("image/")}),Y=Z.filter(ie=>{var Te;return!((Te=ie.mime)!=null&&Te.startsWith("image/"))}),de=Z.map(ie=>ie.id).join(",");E.useEffect(()=>{if(!n||!de)return;let ie=!1;const Te=Z.filter(re=>{var V;return(V=re.mime)==null?void 0:V.startsWith("image/")});return(async()=>{for(const re of Te){if(ie)return;if(ki.has(re.id)){Q(V=>({...V,[re.id]:ki.get(re.id)}));continue}if(re.remote_thumb){ki.set(re.id,re.remote_thumb),Q(V=>({...V,[re.id]:re.remote_thumb}));continue}try{if(re.thumb_rel_path){const V=await z0(re.id);if(ie)return;const ee="data:"+(V.mime||"image/webp")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}else{const V=await Is(re.id);if(ie)return;const ee=await t1(V.data_b64,V.mime||"image/png");ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}}catch{try{const V=await Is(re.id);if(ie)return;const ee="data:"+(V.mime||"image/png")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}catch{}}}})(),()=>{ie=!0}},[n,s,de]);const F=[];if(p&&x)for(const ie of x.form_template??[]){const Te=(p.extras??{})[ie.key];if(Te==null||Te==="")continue;const re=Array.isArray(Te)?Te.join("、"):String(Te);F.push({label:ie.label,value:ie.unit?re+" "+ie.unit:re})}return h.jsxs(so,{open:n,onClose:r,width:680,title:"记录详情",footer:p?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>k(!0),disabled:D.isPending,children:[h.jsx(Ed,{size:13})," 删除"]}),h.jsx(zt,{variant:"secondary",onClick:r,children:"关闭"}),h.jsxs(zt,{variant:"primary",onClick:()=>s&&(o==null?void 0:o(s)),children:[h.jsx(YE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!p?h.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[20px] font-bold leading-tight tracking-tight text-ink-1",style:{textWrap:"balance"},children:p.title}),h.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[h.jsx(Ii,{color:p.type_color,className:Gn,children:p.type_name}),h.jsx($0,{level:p.level}),h.jsx(P0,{grade:p.award_grade}),h.jsx(W0,{role:p.role}),h.jsx(F0,{status:p.status}),p.polarity==="negative"&&h.jsx(I0,{}),p.rank!=null&&h.jsxs(Ii,{color:"var(--text-3)",className:Gn,children:["第 ",p.rank," 名"]})]})]}),h.jsx(Hi,{title:"事项要素",children:h.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px] sm:grid-cols-2",children:[h.jsx(nd,{label:"时间",value:g5(p.start_date,p.end_date)||"—"}),h.jsx(nd,{label:"组织方",value:p.organizer||"—"}),F.map(ie=>h.jsx(nd,{label:ie.label,value:ie.value},ie.label))]})}),(((le=p.attachments)==null?void 0:le.length)??0)>0&&h.jsx(Hi,{title:"附件("+(((Ve=p.attachments)==null?void 0:Ve.length)??0)+")",children:Z.length?h.jsxs("div",{className:"flex flex-col gap-2.5",children:[J.length>0&&h.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:J.map(ie=>h.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(ie),title:"点击预览:"+ie.file_name,children:[H[ie.id]?h.jsx("img",{src:H[ie.id],alt:ie.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):h.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),h.jsx("span",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-1.5 pb-1 pt-3 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100",children:ie.file_name})]},ie.id))}),Y.length>0&&h.jsx("div",{className:"flex flex-col gap-1",children:Y.map(ie=>h.jsxs("button",{className:"flex items-center gap-2 rounded-md border border-line bg-surface px-2.5 py-2 text-left text-[12.5px] transition-colors hover:border-line-strong",onClick:()=>q(ie),children:[h.jsx(y0,{size:14,className:"shrink-0 text-ink-3"}),h.jsx("span",{className:"truncate text-ink-1",children:ie.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(ie.size)}),h.jsx(Kd,{size:12,className:"shrink-0 text-ink-3"})]},ie.id))}),h.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):h.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})}),p.description&&h.jsx(Hi,{title:"工作内容 / 描述",children:h.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:p.description})}),p.result&&h.jsx(Hi,{title:"结果 / 产出",children:h.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:p.result})}),p.metrics&&Object.keys(p.metrics).length>0&&h.jsx(Hi,{title:"量化指标",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(p.metrics).map(([ie,Te])=>h.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[ie,": ",h.jsx("span",{className:"font-medium text-ink-1",children:Te})]},ie))})}),((((Fe=p.tags)==null?void 0:Fe.length)??0)>0||g.length>0)&&h.jsx(Hi,{title:"标签与维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[p.tags.map(ie=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:ie},ie)),g.map(ie=>h.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:ie},ie))]})}),h.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-t border-line pt-3 text-[11.5px] text-ink-3",children:[h.jsxs("span",{children:["创建于 ",mg(p.created_at)]}),h.jsxs("span",{children:["更新于 ",mg(p.updated_at)]}),p.group_id&&h.jsxs("span",{children:["事件组 ",p.group_id]}),p.parent_id!=null&&h.jsxs("span",{children:["上级 #",p.parent_id]})]})]}),h.jsx(e1,{att:K,onClose:()=>q(null)}),h.jsx(P_,{open:_,title:"删除记录",content:p?"确定删除「"+p.title+"」吗?该操作不可撤销。":"",onCancel:()=>k(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function nd({label:n,value:r}){return h.jsxs("div",{className:"grid min-w-0 grid-cols-[76px_1fr] gap-x-2.5",children:[h.jsx("span",{className:"shrink-0 text-right text-ink-3",children:n}),h.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Hi({title:n,children:r}){return h.jsxs("div",{children:[h.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function T5(){var Y,de,F;const[n,r]=E.useState(""),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(null),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(!1),D=yl({queryKey:["types"],queryFn:uo}),H=E.useMemo(()=>({q:n||void 0,types:s?[Number(s)]:void 0,year:f?Number(f):void 0,polarity:d||void 0,sort:"date_desc",page_size:2e3}),[n,s,f,d]),Q=yl({queryKey:["timeline",H],queryFn:()=>N0(H)}),Z=E.useMemo(()=>{var I;const U=new Set;for(const le of((I=Q.data)==null?void 0:I.groups)??[])U.add(le.year);return Array.from(U).sort((le,Ve)=>Ve-le)},[Q.data]),J=U=>{k(U),q(!0)};return h.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[h.jsx(nt,{className:"w-full sm:w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),h.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[h.jsx(ml,{className:"w-full sm:w-[130px]",value:s,onChange:U=>o(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),h.jsx(ml,{className:"w-full sm:w-[120px]",value:f,onChange:U=>m(U.target.value),options:[{value:"",label:"全部年份"},...Z.map(U=>({value:String(U),label:U+" 年"}))]}),h.jsx(ml,{className:"w-full sm:w-[110px]",value:d,onChange:U=>v(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})]}),h.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((de=Q.data)==null?void 0:de.total)??0," 条"]})]}),Q.isLoading?h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(F=Q.data)!=null&&F.groups.length?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Q.data.groups.map(U=>h.jsxs("section",{className:"mb-2",children:[h.jsxs("div",{className:"sticky top-0 z-10 -mx-3 flex items-center gap-2 bg-bg/90 px-3 py-2 backdrop-blur sm:-mx-6 sm:px-6",children:[h.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),h.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map(I=>h.jsxs("div",{className:"mb-3",children:[h.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[I.month," 月"]}),h.jsx("div",{className:"flex flex-col gap-2",children:I.items.map(le=>h.jsx(N5,{row:le,onClick:()=>J(le.id)},le.id))})]},I.month))]},U.year))]}):h.jsx(J_,{icon:h.jsx(m0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),h.jsx(_5,{open:K,onClose:()=>q(!1),footprintId:_,onEdit:U=>{q(!1),p(U),g(!0)}}),h.jsx(E5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function N5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return h.jsxs("button",{onClick:r,className:"group relative w-full rounded-lg border border-line bg-surface px-4 py-3 text-left shadow-card transition-all hover:border-line-strong hover:shadow-pop",children:[h.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"num w-[52px] shrink-0 pt-0.5 text-[12px] leading-relaxed text-ink-3",children:[s.slice(5,7),"-",s.slice(8,10)]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),h.jsx(Ii,{color:n.type_color,children:n.type_name}),h.jsx($0,{level:n.level}),h.jsx(P0,{grade:n.award_grade}),h.jsx(W0,{role:n.role}),h.jsx(F0,{status:n.status}),n.polarity==="negative"&&h.jsx(I0,{})]}),n.organizer&&h.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&h.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-relaxed text-ink-2",children:n.description}),(n.result||n.tags.length>0||n.attachment_count>0)&&h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-ink-3",children:[n.result&&h.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(o=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:o},o)),n.attachment_count>0&&h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Kd,{size:11}),n.attachment_count]})]})]}),h.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:h.jsx(f5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const w5=E.lazy(()=>jl(()=>import("./RecordsPage-BGd2ZncK.js"),[]).then(n=>({default:n.RecordsPage}))),C5=E.lazy(()=>jl(()=>import("./DashboardPage-DNoywp7V.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),j5=E.lazy(()=>jl(()=>import("./GradesPage-DDtpIPC0.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),z5=E.lazy(()=>jl(()=>import("./TypesPage-DbjmBLAq.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),O5=E.lazy(()=>jl(()=>import("./TaxonomyPage-c8tjIm6X.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),R5=E.lazy(()=>jl(()=>import("./AdminPage-CU2b53Nb.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage}))),A5=E.lazy(()=>jl(()=>import("./ProfilePage-Bc_DPBs5.js"),[]).then(n=>({default:n.ProfilePage}))),M5=E.lazy(()=>jl(()=>import("./ResumePage-Cej-3M7z.js"),__vite__mapDeps([8,1])).then(n=>({default:n.ResumePage})));function Ja(){return h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function D5(){return h.jsx(dS,{children:h.jsxs(tl,{element:h.jsx(r5,{}),children:[h.jsx(tl,{path:"/",element:h.jsx(Vp,{to:"/timeline",replace:!0})}),h.jsx(tl,{path:"/timeline",element:h.jsx(T5,{})}),h.jsx(tl,{path:"/records",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(w5,{})})}),h.jsx(tl,{path:"/grades",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(j5,{})})}),h.jsx(tl,{path:"/dashboard",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(C5,{})})}),h.jsx(tl,{path:"/types",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(z5,{})})}),h.jsx(tl,{path:"/taxonomy",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(O5,{})})}),h.jsx(tl,{path:"/admin",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(R5,{})})}),h.jsx(tl,{path:"/profile",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(A5,{})})}),h.jsx(tl,{path:"/resume",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(M5,{})})}),h.jsx(tl,{path:"*",element:h.jsx(Vp,{to:"/timeline",replace:!0})})]})})}const U5=new b3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),xg=localStorage.getItem("fp-theme");(xg==="dark"||!xg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function l1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}l1();window.addEventListener("fp-theme-change",l1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});o2.createRoot(document.getElementById("root")).render(h.jsx(l2.StrictMode,{children:h.jsx(ZS,{client:U5,children:h.jsx(HS,{children:h.jsx(D5,{})})})}));export{vl as $,U4 as A,zt as B,P_ as C,k4 as D,J_ as E,so as F,P0 as G,De as H,nt as I,H4 as J,D4 as K,$0 as L,f5 as M,_4 as N,B5 as O,XE as P,Q5 as Q,W0 as R,ml as S,Ed as T,T4 as U,N4 as V,w4 as W,C4 as X,j4 as Y,Wd as Z,Ol as _,pl as a,g0 as a0,Cd as a1,K4 as a2,Z4 as a3,J4 as a4,F4 as a5,jl as a6,X4 as a7,V4 as a8,p4 as a9,wd as aa,W4 as ab,P4 as ac,$4 as ad,nE as ae,H5 as af,Ag as ag,I4 as ah,KS as b,pe as c,oo as d,q5 as e,yl as f,Sd as g,g5 as h,F0 as i,h as j,mg as k,YE as l,Ii as m,_5 as n,E5 as o,z4 as p,uo as q,E as r,E0 as s,O4 as t,lu as u,_0 as v,v0 as w,L4 as x,B4 as y,q4 as z}; diff --git a/sync-server/www/assets/mammoth.browser-DRYI4-uz.js b/sync-server/www/assets/mammoth.browser-MQmSAuUh.js similarity index 99% rename from sync-server/www/assets/mammoth.browser-DRYI4-uz.js rename to sync-server/www/assets/mammoth.browser-MQmSAuUh.js index c26957e..463d774 100644 --- a/sync-server/www/assets/mammoth.browser-DRYI4-uz.js +++ b/sync-server/www/assets/mammoth.browser-MQmSAuUh.js @@ -1,4 +1,4 @@ -import{af as dt,ag as mn}from"./index-CSVqyJB0.js";function vn(ut,Et){for(var P=0;Poe[R]})}}}return Object.freeze(Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"}))}function bt(ut){throw new Error('Could not dynamically require "'+ut+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xt={exports:{}},hr;function yn(){return hr||(hr=1,(function(ut,Et){(function(P){ut.exports=P()})(function(){return(function P(oe,R,M){function E(p,u){if(!R[p]){if(!oe[p]){var i=typeof bt=="function"&&bt;if(!u&&i)return i(p,!0);if(a)return a(p,!0);var e=new Error("Cannot find module '"+p+"'");throw e.code="MODULE_NOT_FOUND",e}var s=R[p]={exports:{}};oe[p][0].call(s.exports,function(d){var y=oe[p][1][d];return E(y||d)},s,s.exports,P,oe,R,M)}return R[p].exports}for(var a=typeof bt=="function"&&bt,g=0;goe[R]})}}}return Object.freeze(Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"}))}function bt(ut){throw new Error('Could not dynamically require "'+ut+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xt={exports:{}},hr;function yn(){return hr||(hr=1,(function(ut,Et){(function(P){ut.exports=P()})(function(){return(function P(oe,R,M){function E(p,u){if(!R[p]){if(!oe[p]){var i=typeof bt=="function"&&bt;if(!u&&i)return i(p,!0);if(a)return a(p,!0);var e=new Error("Cannot find module '"+p+"'");throw e.code="MODULE_NOT_FOUND",e}var s=R[p]={exports:{}};oe[p][0].call(s.exports,function(d){var y=oe[p][1][d];return E(y||d)},s,s.exports,P,oe,R,M)}return R[p].exports}for(var a=typeof bt=="function"&&bt,g=0;g0&&(Ee=X.concat(Ee),X=[]),r.map(ne(fe),K(Ee),function(Se,Me){return new a.Paragraph(Me,Se)}).insertExtra()},"w:r":function(re){return r.map(ie(re.firstOrEmpty("w:rPr")),K(re.children),function(fe,_e){var Ee=Ie();return Ee!==null&&(_e=[new a.Hyperlink(_e,Ee)]),new a.Run(_e,fe)})},"w:fldChar":be,"w:instrText":Le,"w:t":function(re){return c(new a.Text(re.text()))},"w:tab":function(re){return c(new a.Tab)},"w:noBreakHyphen":function(){return c(new a.Text("‑"))},"w:softHyphen":function(re){return c(new a.Text("­"))},"w:sym":Be,"w:hyperlink":function(re){var fe=re.attributes["r:id"],_e=re.attributes["w:anchor"];return K(re.children).map(function(Ee){function Se(Pe){var Fe=re.attributes["w:tgtFrame"]||null;return new a.Hyperlink(Ee,E.extend({targetFrame:Fe},Pe))}if(fe){var Me=x.findTargetByRelationshipId(fe);return _e&&(Me=e.replaceFragment(Me,_e)),Se({href:Me})}else return _e?Se({anchor:_e}):Ee})},"w:tbl":l,"w:tr":o,"w:tc":D,"w:footnoteReference":f("footnote"),"w:endnoteReference":f("endnote"),"w:commentReference":$,"w:br":function(re){var fe=re.attributes["w:type"];return fe==null||fe==="textWrapping"?c(a.lineBreak):fe==="page"?c(a.pageBreak):fe==="column"?c(a.columnBreak):h([p("Unsupported break type: "+fe)])},"w:bookmarkStart":function(re){var fe=re.attributes["w:name"];return fe==="_GoBack"?_():c(new a.BookmarkStart({name:fe}))},"mc:AlternateContent":function(re){return V(re.firstOrEmpty("mc:Fallback"))},"w:sdt":function(re){var fe=K(re.firstOrEmpty("w:sdtContent").children);return fe.map(function(_e){var Ee=re.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(Ee){var Se=Ee.first("wordml:checked"),Me=!!Se&&Q(Se.attributes["wordml:val"]),Pe=a.checkbox({checked:Me}),Fe=!1,Ze=_e.map(i._elementsOfType(a.types.text,function(N){return N.value.length>0&&!Fe?(Fe=!0,Pe):N}));return Fe?Ze:Pe}else return _e})},"w:customXml":V,"w:ins":V,"w:moveFromRangeEnd":V,"w:moveFromRangeStart":V,"w:moveTo":V,"w:moveToRangeEnd":V,"w:moveToRangeStart":V,"w:object":V,"w:smartTag":V,"w:drawing":V,"w:pict":function(re){return V(re).toExtra()},"v:roundrect":V,"v:shape":V,"v:textbox":V,"w:txbxContent":V,"wp:inline":ae,"wp:anchor":ae,"v:imagedata":Ae,"v:group":V,"v:rect":V};return{readXmlElement:pe,readXmlElements:K};function l(re){var fe=t(re.firstOrEmpty("w:tblPr"));return K(re.children).flatMap(G).flatMap(function(_e){return fe.map(function(Ee){return a.Table(_e,Ee)})})}function t(re){return Re(re).map(function(fe){return{styleId:fe.styleId,styleName:fe.name}})}function o(re){var fe=re.firstOrEmpty("w:trPr"),_e=!!fe.first("w:del");if(_e)return _();var Ee=!!fe.first("w:tblHeader");return K(re.children).map(function(Se){return a.TableRow(Se,{isHeader:Ee})})}function D(re){return K(re.children).map(function(fe){var _e=re.firstOrEmpty("w:tcPr"),Ee=_e.firstOrEmpty("w:gridSpan").attributes["w:val"],Se=Ee?parseInt(Ee,10):1,Me=a.TableCell(fe,{colSpan:Se});return Me._vMerge=C(_e),Me})}function C(re){var fe=re.first("w:vMerge");if(fe){var _e=fe.attributes["w:val"];return _e==="continue"||!_e}else return null}function G(re){var fe=E.any(re,function(Se){return Se.type!==a.types.tableRow});if(fe)return te(re),n(re,[p("unexpected non-row element in table, cell merging may be incorrect")]);var _e=E.any(re,function(Se){return E.any(Se.children,function(Me){return Me.type!==a.types.tableCell})});if(_e)return te(re),n(re,[p("unexpected non-cell element in table row, cell merging may be incorrect")]);var Ee={};return re.forEach(function(Se){var Me=0;Se.children.forEach(function(Pe){Pe._vMerge&&Ee[Me]?Ee[Me].rowSpan++:(Ee[Me]=Pe,Pe._vMerge=!1),Me+=Pe.colSpan})}),re.forEach(function(Se){Se.children=Se.children.filter(function(Me){return!Me._vMerge}),Se.children.forEach(function(Me){delete Me._vMerge})}),c(re)}function te(re){re.forEach(function(fe){var _e=i.getDescendantsOfType(fe,a.types.tableCell);_e.forEach(function(Ee){delete Ee._vMerge})})}function ae(re){var fe=re.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip");return m(fe.map(de.bind(null,re)))}function de(re,fe){var _e=re.firstOrEmpty("wp:docPr"),Ee=_e.attributes,Se=Te(Ee.descr)?Ee.title:Ee.descr,Me=me(fe);return Me===null?h([p("Could not find image file for a:blip element")]):ze(Me,Se).map(function(Pe){var Fe=_e.firstOrEmpty("a:hlinkClick"),Ze=Fe.attributes["r:id"];if(Ze){var N=x.findTargetByRelationshipId(Ze);return new a.Hyperlink([Pe],{href:N})}else return Pe})}function Te(re){return re==null||/^\s*$/.test(re)}function me(re){var fe=re.attributes["r:embed"],_e=re.attributes["r:link"];if(fe)return Ue(fe);if(_e){var Ee=x.findTargetByRelationshipId(_e);return{path:Ee,read:B.read.bind(B,Ee)}}else return null}function Ae(re){var fe=re.attributes["r:id"];return fe?ze(Ue(fe),re.attributes["o:title"]):h([p("A v:imagedata element without a relationship ID was ignored")])}function Ue(re){var fe=e.uriToZipEntryName("word",x.findTargetByRelationshipId(re));return{path:fe,read:ee.read.bind(ee,fe)}}function ze(re,fe){var _e=W.findContentType(re.path),Ee=a.Image({readImage:re.read,altText:fe,contentType:_e}),Se=w[_e]?[]:p("Image of type "+_e+" is unlikely to display in web browsers");return n(Ee,Se)}function He(re,fe){return p(re+" style with ID "+fe+" was referenced but not defined in the document")}}function y(k,A,O){var X=A.firstOrEmpty("w:ilvl").attributes["w:val"],x=A.firstOrEmpty("w:numId").attributes["w:val"];if(X!==void 0&&x!==void 0)return O.findLevel(x,X);if(k!=null){var W=O.findLevelByParagraphStyleId(k);if(W!=null)return W}return x!==void 0?O.findLevel(x,"0"):null}var w={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},v={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:moveFrom":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function h(k){return new r(null,null,k)}function _(){return new r(null)}function c(k){return new r(k)}function n(k,A){return new r(k,null,A)}function r(k,A,O){this.value=k||[],this.extra=A||[],this._result=new g({element:this.value,extra:A},O),this.messages=this._result.messages}r.prototype.toExtra=function(){return new r(null,I(this.extra,this.value),this.messages)},r.prototype.insertExtra=function(){var k=this.extra;return k&&k.length?new r(I(this.value,k),null,this.messages):this},r.prototype.map=function(k){var A=this._result.map(function(O){return k(O.element)});return new r(A.value,this.extra,A.messages)},r.prototype.flatMap=function(k){var A=this._result.flatMap(function(O){return k(O.element)._result});return new r(A.value.element,I(this.extra,A.value.extra),A.messages)},r.map=function(k,A,O){return new r(O(k.value,A.value),I(k.extra,A.extra),k.messages.concat(A.messages))};function m(k){var A=g.combine(E.pluck(k,"_result"));return new r(E.flatten(E.pluck(A.value,"element")),E.filter(E.flatten(E.pluck(A.value,"extra")),U),A.messages)}function I(k,A){return E.flatten([k,A])}function U(k){return k}},{"../documents":4,"../results":25,"../transforms":30,"../xml":35,"./uris":16,"dingbat-to-unicode":50,underscore:67}],6:[function(P,oe,R){var M=P("../documents"),E=P("../results").Result;function a(g){function p(i){return E.combine(i.getElementsByTagName("w:comment").map(u))}function u(i){var e=i.attributes["w:id"];function s(d){return(i.attributes[d]||"").trim()||null}return g.readXmlElements(i.children).map(function(d){return M.comment({commentId:e,body:d,authorName:s("w:author"),authorInitials:s("w:initials")})})}return p}R.createCommentsReader=a},{"../documents":4,"../results":25}],7:[function(P,oe,R){R.readContentTypesFromXml=E;var M={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};R.defaultContentTypes=a({},{});function E(g){var p=Object.create(null),u=Object.create(null);return g.children.forEach(function(i){if(i.name==="content-types:Default"&&(p[i.attributes.Extension]=i.attributes.ContentType),i.name==="content-types:Override"){var e=i.attributes.PartName;e.charAt(0)==="/"&&(e=e.substring(1)),u[e]=i.attributes.ContentType}}),a(u,p)}function a(g,p){return{findContentType:function(u){var i=g[u];if(i)return i;var e=u.split("."),s=e[e.length-1];if(Object.prototype.hasOwnProperty.call(p,s))return p[s];var d=M[s.toLowerCase()];return d?"image/"+d:null}}}},{}],8:[function(P,oe,R){R.DocumentXmlReader=a;var M=P("../documents"),E=P("../results").Result;function a(g){var p=g.bodyReader;function u(i){var e=i.first("w:body");if(e==null)throw new Error("Could not find the body element: are you sure this is a docx file?");var s=p.readXmlElements(e.children).map(function(d){return new M.Document(d,{notes:g.notes,comments:g.comments})});return new E(s.value,s.messages)}return{convertXmlToDocument:u}}},{"../documents":4,"../results":25}],9:[function(P,oe,R){R.read=_,R._findPartPaths=c;var M=P("../promises"),E=P("../documents"),a=P("../results").Result,g=P("../zipfile"),p=P("./office-xml-reader").readXmlFromZipFile,u=P("./body-reader").createBodyReader,i=P("./document-xml-reader").DocumentXmlReader,e=P("./relationships-reader"),s=P("./content-types-reader"),d=P("./numbering-xml"),y=P("./styles-reader"),w=P("./notes-reader"),v=P("./comments-reader"),h=P("./files").Files;function _(x,W,ee){W=W||{},ee=ee||{};var B=new h({externalFileAccess:ee.externalFileAccess,relativeToFile:W.path});return M.props({contentTypes:k(x),partPaths:c(x),docxFile:x,files:B}).also(function(Y){return{styles:O(x,Y.partPaths.styles)}}).also(function(Y){return{numbering:A(x,Y.partPaths.numbering,Y.styles)}}).also(function(Y){return{footnotes:I(Y.partPaths.footnotes,Y,function(T,K){return K?w.createFootnotesReader(T)(K):new a([])}),endnotes:I(Y.partPaths.endnotes,Y,function(T,K){return K?w.createEndnotesReader(T)(K):new a([])}),comments:I(Y.partPaths.comments,Y,function(T,K){return K?v.createCommentsReader(T)(K):new a([])})}}).also(function(Y){return{notes:Y.footnotes.flatMap(function(T){return Y.endnotes.map(function(K){return new E.Notes(T.concat(K))})})}}).then(function(Y){return I(Y.partPaths.mainDocument,Y,function(T,K){return Y.notes.flatMap(function(pe){return Y.comments.flatMap(function(ne){var ce=new i({bodyReader:T,notes:pe,comments:ne});return ce.convertXmlToDocument(K)})})})})}function c(x){return X(x).then(function(W){var ee=n({docxFile:x,relationships:W,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!x.exists(ee))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return m({filename:U(ee),readElement:e.readRelationships,defaultValue:e.defaultValue})(x).then(function(B){function Y(T){return n({docxFile:x,relationships:B,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+T,basePath:g.splitPath(ee).dirname,fallbackPath:"word/"+T+".xml"})}return{mainDocument:ee,comments:Y("comments"),endnotes:Y("endnotes"),footnotes:Y("footnotes"),numbering:Y("numbering"),styles:Y("styles")}})})}function n(x){var W=x.docxFile,ee=x.relationships,B=x.relationshipType,Y=x.basePath,T=x.fallbackPath,K=ee.findTargetsByType(B),pe=K.map(function(ce){return r(g.joinPath(Y,ce),"/")}),ne=pe.filter(function(ce){return W.exists(ce)});return ne.length===0?T:ne[0]}function r(x,W){return x.substring(0,W.length)===W?x.substring(W.length):x}function m(x){return function(W){return p(W,x.filename).then(function(ee){return ee?x.readElement(ee):x.defaultValue})}}function I(x,W,ee){var B=m({filename:U(x),readElement:e.readRelationships,defaultValue:e.defaultValue});return B(W.docxFile).then(function(Y){var T=new u({relationships:Y,contentTypes:W.contentTypes,docxFile:W.docxFile,numbering:W.numbering,styles:W.styles,files:W.files});return p(W.docxFile,x).then(function(K){return ee(T,K)})})}function U(x){var W=g.splitPath(x);return g.joinPath(W.dirname,"_rels",W.basename+".rels")}var k=m({filename:"[Content_Types].xml",readElement:s.readContentTypesFromXml,defaultValue:s.defaultContentTypes});function A(x,W,ee){return m({filename:W,readElement:function(B){return d.readNumberingXml(B,{styles:ee})},defaultValue:d.defaultNumbering})(x)}function O(x,W){return m({filename:W,readElement:y.readStylesXml,defaultValue:y.defaultStyles})(x)}var X=m({filename:"_rels/.rels",readElement:e.readRelationships,defaultValue:e.defaultValue})},{"../documents":4,"../promises":23,"../results":25,"../zipfile":40,"./body-reader":5,"./comments-reader":6,"./content-types-reader":7,"./document-xml-reader":8,"./files":1,"./notes-reader":10,"./numbering-xml":11,"./office-xml-reader":12,"./relationships-reader":13,"./styles-reader":15}],10:[function(P,oe,R){var M=P("../documents"),E=P("../results").Result;R.createFootnotesReader=a.bind(this,"footnote"),R.createEndnotesReader=a.bind(this,"endnote");function a(g,p){function u(s){return E.combine(s.getElementsByTagName("w:"+g).filter(i).map(e))}function i(s){var d=s.attributes["w:type"];return d!=="continuationSeparator"&&d!=="separator"}function e(s){var d=s.attributes["w:id"];return p.readXmlElements(s.children).map(function(y){return M.Note({noteType:g,noteId:d,body:y})})}return u}},{"../documents":4,"../results":25}],11:[function(P,oe,R){var M=P("underscore");R.readNumberingXml=a,R.Numbering=E,R.defaultNumbering=new E({},{});function E(i,e,s){var d=M.flatten(M.values(e).map(function(_){return M.values(_.levels)})),y=M.indexBy(d.filter(function(_){return _.paragraphStyleId!=null}),"paragraphStyleId");function w(_,c){return v(_,c,Object.create(null))}function v(_,c,n){if(n[_])return null;n[_]=!0;var r=i[_];if(!r)return null;var m=e[r.abstractNumId];if(m){if(m.numStyleLink==null)return e[r.abstractNumId].levels[c];var I=s.findNumberingStyleById(m.numStyleLink);return v(I.numId,c,n)}else return null}function h(_){return y[_]||null}return{findLevel:w,findLevelByParagraphStyleId:h}}function a(i,e){if(!e||!e.styles)throw new Error("styles is missing");var s=g(i),d=u(i);return new E(d,s,e.styles)}function g(i){var e=Object.create(null);return i.getElementsByTagName("w:abstractNum").forEach(function(s){var d=s.attributes["w:abstractNumId"];e[d]=p(s)}),e}function p(i){var e=Object.create(null),s=null;i.getElementsByTagName("w:lvl").forEach(function(y){var w=y.attributes["w:ilvl"],v=y.firstOrEmpty("w:numFmt").attributes["w:val"],h=v!=="bullet",_=y.firstOrEmpty("w:pStyle").attributes["w:val"];w===void 0?s={isOrdered:h,level:"0",paragraphStyleId:_}:e[w]={isOrdered:h,level:w,paragraphStyleId:_}}),s!==null&&e[s.level]===void 0&&(e[s.level]=s);var d=i.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:e,numStyleLink:d}}function u(i){var e=Object.create(null);return i.getElementsByTagName("w:num").forEach(function(s){var d=s.attributes["w:numId"],y=s.first("w:abstractNumId").attributes["w:val"];e[d]={abstractNumId:y}}),e}},{underscore:67}],12:[function(P,oe,R){var M=P("underscore"),E=P("../promises"),a=P("../xml");R.read=p,R.readXmlFromZipFile=u;var g={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function p(s){return a.readString(s,g).then(function(d){return e(d)[0]})}function u(s,d){return s.exists(d)?s.read(d,"utf-8").then(i).then(p):E.resolve(null)}function i(s){return s.replace(/^\uFEFF/g,"")}function e(s){return s.type==="element"?s.name==="mc:AlternateContent"?s.firstOrEmpty("mc:Fallback").children:(s.children=M.flatten(s.children.map(e,!0)),[s]):[s]}},{"../promises":23,"../xml":35,underscore:67}],13:[function(P,oe,R){R.readRelationships=M,R.defaultValue=new E([]),R.Relationships=E;function M(a){var g=[];return a.children.forEach(function(p){if(p.name==="relationships:Relationship"){var u={relationshipId:p.attributes.Id,target:p.attributes.Target,type:p.attributes.Type};g.push(u)}}),new E(g)}function E(a){var g=Object.create(null);a.forEach(function(u){g[u.relationshipId]=u.target});var p=Object.create(null);return a.forEach(function(u){p[u.type]||(p[u.type]=[]),p[u.type].push(u.target)}),{findTargetByRelationshipId:function(u){return g[u]},findTargetsByType:function(u){return p[u]||[]}}}},{}],14:[function(P,oe,R){var M=P("underscore"),E=P("../promises"),a=P("../xml");R.writeStyleMap=i,R.readStyleMap=y;var g="http://schemas.zwobble.org/mammoth/style-map",p="mammoth/style-map",u="/"+p;function i(w,v){return w.write(p,v),e(w).then(function(){return s(w)})}function e(w){var v="word/_rels/document.xml.rels",h="http://schemas.openxmlformats.org/package/2006/relationships",_="{"+h+"}Relationship";return w.read(v,"utf8").then(a.readString).then(function(c){var n=c.children;d(n,_,"Id",{Id:"rMammothStyleMap",Type:g,Target:u});var r={"":h};return w.write(v,a.writeString(c,r))})}function s(w){var v="[Content_Types].xml",h="http://schemas.openxmlformats.org/package/2006/content-types",_="{"+h+"}Override";return w.read(v,"utf8").then(a.readString).then(function(c){var n=c.children;d(n,_,"PartName",{PartName:u,ContentType:"text/prs.mammoth.style-map"});var r={"":h};return w.write(v,a.writeString(c,r))})}function d(w,v,h,_){var c=M.find(w,function(n){return n.name===v&&n.attributes[h]===_[h]});c?c.attributes=_:w.push(a.element(v,_))}function y(w){return w.exists(p)?w.read(p,"utf8"):E.resolve(null)}},{"../promises":23,"../xml":35,underscore:67}],15:[function(P,oe,R){R.readStylesXml=E,R.Styles=M,R.defaultStyles=new M({},{});function M(i,e,s,d){return{findParagraphStyleById:function(y){return i[y]},findCharacterStyleById:function(y){return e[y]},findTableStyleById:function(y){return s[y]},findNumberingStyleById:function(y){return d[y]}}}M.EMPTY=new M({},{},{},{});function E(i){var e=Object.create(null),s=Object.create(null),d=Object.create(null),y=Object.create(null);return i.getElementsByTagName("w:style").forEach(function(w){var v=a(w),h;switch(v.type){case"paragraph":h=e;break;case"character":h=s;break;case"table":h=d;break;case"numbering":h=y;break}h&&h[v.styleId]===void 0&&(h[v.styleId]=v)}),new M(e,s,d,y)}function a(i){var e=i.attributes["w:type"];if(e==="numbering")return p(e,i);var s=u(i),d=g(i);return{type:e,styleId:s,name:d}}function g(i){var e=i.first("w:name");return e?e.attributes["w:val"]:null}function p(i,e){var s=u(e),d=e.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:i,numId:d,styleId:s}}function u(i){return i.attributes["w:styleId"]}},{}],16:[function(P,oe,R){R.uriToZipEntryName=M,R.replaceFragment=E;function M(a,g){return g.charAt(0)==="/"?g.substr(1):a+"/"+g}function E(a,g){var p=a.indexOf("#");return p!==-1&&(a=a.substring(0,p)),a+"#"+g}},{}],17:[function(P,oe,R){var M=P("../styles/html-paths");function E(s,d,y){return g(M.element(s,d,{fresh:!1}),y)}function a(s,d,y){var w=M.element(s,d,{fresh:!0});return g(w,y)}function g(s,d){return{type:"element",tag:s,children:d||[]}}function p(s){return{type:"text",value:s}}var u={type:"forceWrite"};R.freshElement=a,R.nonFreshElement=E,R.elementWithTag=g,R.text=p,R.forceWrite=u;var i={br:!0,hr:!0,img:!0,input:!0};function e(s){return s.children.length===0&&i[s.tag.tagName]}R.isVoidElement=e},{"../styles/html-paths":28}],18:[function(P,oe,R){var M=P("./ast");R.freshElement=M.freshElement,R.nonFreshElement=M.nonFreshElement,R.elementWithTag=M.elementWithTag,R.text=M.text,R.forceWrite=M.forceWrite,R.simplify=P("./simplify");function E(i,e){e.forEach(function(s){a(i,s)})}function a(i,e){g[e.type](i,e)}var g={element:p,text:u,forceWrite:function(){}};function p(i,e){M.isVoidElement(e)?i.selfClosing(e.tag.tagName,e.tag.attributes):(i.open(e.tag.tagName,e.tag.attributes),E(i,e.children),i.close(e.tag.tagName))}function u(i,e){i.text(e.value)}R.write=E},{"./ast":17,"./simplify":19}],19:[function(P,oe,R){var M=P("underscore"),E=P("./ast");function a(c){return g(d(c))}function g(c){var n=[];return c.map(p).forEach(function(r){s(n,r)}),n}function p(c){return u[c.type](c)}var u={element:i,text:e,forceWrite:e};function i(c){return E.elementWithTag(c.tag,g(c.children))}function e(c){return c}function s(c,n){var r=c[c.length-1];n.type==="element"&&!n.tag.fresh&&r&&r.type==="element"&&n.tag.matchesElement(r.tag)?(n.tag.separator&&s(r.children,E.text(n.tag.separator)),n.children.forEach(function(m){s(r.children,m)})):c.push(n)}function d(c){return y(c,function(n){return w[n.type](n)})}function y(c,n){return M.flatten(M.map(c,n),!0)}var w={element:h,text:_,forceWrite:v};function v(c){return[c]}function h(c){var n=d(c.children);return n.length===0&&!E.isVoidElement(c)?[]:[E.elementWithTag(c.tag,n)]}function _(c){return c.value.length===0?[]:[c]}oe.exports=a},{"./ast":17,underscore:67}],20:[function(P,oe,R){var M=P("underscore"),E=P("./promises"),a=P("./html");R.imgElement=g;function g(u){return function(i,e){return E.resolve(u(i)).then(function(s){var d={};return i.altText&&(d.alt=i.altText),M.extend(d,s),[a.freshElement("img",d)]})}}R.inline=R.imgElement,R.dataUri=g(function(u){return u.readAsBase64String().then(function(i){return{src:"data:"+u.contentType+";base64,"+i}})});function p(u){return u.contentType.split(/\/|\\/)[1]}R.imageFilenameExtension=p},{"./html":18,"./promises":23,underscore:67}],21:[function(P,oe,R){(function(M){var E=P("underscore"),a=P("./docx/docx-reader"),g=P("./docx/style-map"),p=P("./document-to-html").DocumentConverter,u=P("./raw-text").convertElementToRawText,i=P("./style-reader").readStyle,e=P("./options-reader").readOptions,s=P("./promises"),d=P("./unzip"),y=P("./results").Result;R.convertToHtml=w,R.convertToMarkdown=v,R.convert=h,R.extractRawText=r,R.images=P("./images"),R.transforms=P("./transforms"),R.underline=P("./underline"),R.embedStyleMap=m,R.readEmbeddedStyleMap=_;function w(I,U){return h(I,U)}function v(I,U){var k=Object.create(U||{});return k.outputFormat="markdown",h(I,k)}function h(I,U){U=e(U);var k=d.openZip(I).then(function(A){return g.readStyleMap(A).then(function(O){return U.embeddedStyleMap=O,A})}).then(function(A){return a.read(A,I,U).then(function(O){return O.map(U.transformDocument)}).then(function(O){return c(O,U)})});return s.toExternalPromise(k)}function _(I){var U=d.openZip(I).then(g.readStyleMap);return s.toExternalPromise(U)}function c(I,U){var k=n(U.readStyleMap()),A=E.extend({},U,{styleMap:k.value}),O=new p(A);return I.flatMapThen(function(X){return k.flatMapThen(function(x){return O.convertToHtml(X)})})}function n(I){return y.combine((I||[]).map(i)).map(function(U){return U.filter(function(k){return!!k})})}function r(I){var U=d.openZip(I).then(a.read).then(function(k){return k.map(u)});return s.toExternalPromise(U)}function m(I,U){var k=d.openZip(I).then(function(A){return g.writeStyleMap(A,U).then(function(){return A})}).then(function(A){return A.toArrayBuffer()}).then(function(A){return{toArrayBuffer:function(){return A},toBuffer:function(){return M.from(A)}}});return s.toExternalPromise(k)}R.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)}}).call(this,P("buffer").Buffer)},{"./document-to-html":3,"./docx/docx-reader":9,"./docx/style-map":14,"./images":20,"./options-reader":22,"./promises":23,"./raw-text":24,"./results":25,"./style-reader":26,"./transforms":30,"./underline":31,"./unzip":2,buffer:48,underscore:67}],22:[function(P,oe,R){R.readOptions=g;var M=P("underscore"),E=R._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],a=R._standardOptions={externalFileAccess:!1,transformDocument:u,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function g(i){return i=i||{},M.extend({},a,i,{customStyleMap:p(i.styleMap),readStyleMap:function(){var e=this.customStyleMap;return this.includeEmbeddedStyleMap&&(e=e.concat(p(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(e=e.concat(E)),e}})}function p(i){return i?M.isString(i)?i.split(` `).map(function(e){return e.trim()}).filter(function(e){return e!==""&&e.charAt(0)!=="#"}):i:[]}function u(i){return i}},{underscore:67}],23:[function(P,oe,R){(function(M){var E=P("underscore");R.defer=u,R.Promise=Promise,R.resolve=Promise.resolve.bind(Promise),R.reject=Promise.reject.bind(Promise),R.forEachSeries=function(d,y){var w=0,v=u(),h=function(){if(w"u"?!1:{}.toString.call(M).toLowerCase()==="[object process]"}}).call(this,P("_process"))},{_process:66,underscore:67}],24:[function(P,oe,R){var M=P("./documents");function E(a){if(a.type==="text")return a.value;if(a.type===M.types.tab)return" ";var g=a.type==="paragraph"?` diff --git a/sync-server/www/assets/useChart-CUy-j464.js b/sync-server/www/assets/useChart-q1r1yv4-.js similarity index 92% rename from sync-server/www/assets/useChart-CUy-j464.js rename to sync-server/www/assets/useChart-q1r1yv4-.js index 5f93330..a457888 100644 --- a/sync-server/www/assets/useChart-CUy-j464.js +++ b/sync-server/www/assets/useChart-q1r1yv4-.js @@ -1 +1 @@ -import{r}from"./index-CSVqyJB0.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u}; +import{r}from"./index-DWQlGpif.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u}; diff --git a/sync-server/www/index.html b/sync-server/www/index.html index 263fda4..c1a9bd6 100644 --- a/sync-server/www/index.html +++ b/sync-server/www/index.html @@ -9,7 +9,7 @@ 足迹 Footprints - +