book-index-ui 0.62.1 → 0.62.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var xu=Object.create;var Ws=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var ju=Object.getPrototypeOf,vu=Object.prototype.hasOwnProperty;var ku=(e,n,i,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of yu(n))!vu.call(e,s)&&s!==i&&Ws(e,s,{get:()=>n[s],enumerable:!(o=bu(n,s))||o.enumerable});return e};var mi=(e,n,i)=>(i=e!=null?xu(ju(e)):{},ku(n||!e||!e.__esModule?Ws(i,"default",{value:e,enumerable:!0}):i,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("./storage-entry-Cx6j1zcJ.cjs"),t=require("react/jsx-runtime"),g=require("react"),wu=require("opencc-js/t2cn"),Cl=require("./variant-supplement.cjs"),Su=require("react-markdown"),_u=require("remark-gfm"),$u=e=>`/item/${e}`,zl=g.createContext($u);function Cu({buildUrl:e,children:n}){const i=g.useMemo(()=>e,[e]);return t.jsx(zl.Provider,{value:i,children:n})}function at(){return g.useContext(zl)}const Nl="",Tl="";function mo(e){const n=[];let i=!1,o=e;for(;o.length;){const s=i?Tl:Nl,a=o.indexOf(s);if(a===-1){n.push({text:o,marked:i});break}a>0&&n.push({text:o.slice(0,a),marked:i}),o=o.slice(a+1),i=!i}return n}function gt(e,n){return{title:e,tokens:n}}const Fs='"Songti SC", "Songti TC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif',zu=[gt("基础(VS Code 环境下跟随 --vscode-*)",{bg:{value:"#ffffff",vscode:"--vscode-editor-background"},fg:{value:"#333333",vscode:"--vscode-foreground"},"input-bg":{value:"#ffffff",vscode:"--vscode-input-background"},"input-fg":{value:"#333333",vscode:"--vscode-input-foreground"},"input-border":{value:"#cccccc",vscode:"--vscode-input-border"},"widget-border":{value:"#e0e0e0",vscode:"--vscode-widget-border"},"link-fg":{value:"#0066cc",vscode:"--vscode-textLink-foreground"},"desc-fg":{value:"#717171",vscode:"--vscode-descriptionForeground"},primary:{value:"#0078d4",vscode:"--vscode-button-background"},"primary-fg":{value:"#ffffff",vscode:"--vscode-button-foreground"},"primary-soft":{value:"rgba(0, 120, 212, 0.15)",css:"color-mix(in srgb, var(--bim-primary) 15%, transparent)"},danger:{value:"#f44336"},warning:{value:"#ff9800"},success:{value:"#4caf50"},"sidebar-bg":{value:"#f3f3f3",vscode:"--vscode-sideBar-background"},"list-hover-bg":{value:"rgba(0, 0, 0, 0.04)",vscode:"--vscode-list-hoverBackground"},"list-active-bg":{value:"rgba(0, 120, 212, 0.1)",vscode:"--vscode-list-activeSelectionBackground"},"focus-border":{value:"#0078d4",vscode:"--vscode-focusBorder"}}),gt("底色层次 / 文字与描边 / 链接",{"bg-subtle":{value:"#fafafa"},"widget-bg":{value:"#f8f8f8"},muted:{value:"#888888"},border:{value:"#e5e5e5"},"primary-bg":{value:"#fdf4f4"},link:{value:"#1976d2"},"tag-bg":{value:"#f0f0f0"},"accent-bg":{value:"#1976d2"},"on-color-fg":{value:"#ffffff",note:"彩色底(徽章、选中态按钮)上的文字"}}),gt("提示与警告",{"info-fg":{value:"#0c5380"},"info-bg":{value:"#e7f3ff"},"info-border":{value:"#b3dbff"},"warn-fg":{value:"#856404"},"warn-bg":{value:"#fff3cd"},"warn-border":{value:"#ffc107"},"danger-bg":{value:"rgba(244, 67, 54, 0.08)",note:"错误提示条底色"},"danger-soft-bg":{value:"rgba(244, 67, 54, 0.03)",note:"编辑器危险区块"},"danger-soft-border":{value:"rgba(244, 67, 54, 0.13)"}}),gt("遮罩与阴影",{backdrop:{value:"rgba(0, 0, 0, 0.5)",note:"对话框遮罩"},"overlay-bg":{value:"#00000010",note:"轻量遮罩底(图片占位等)"},"shadow-dialog":{value:"0 4px 20px rgba(0, 0, 0, 0.3)"},"shadow-dropdown":{value:"0 4px 12px rgba(0, 0, 0, 0.1)"},"shadow-tooltip":{value:"0 2px 8px rgba(0, 0, 0, 0.08)"},"shadow-fab":{value:"0 2px 8px rgba(0, 0, 0, 0.25)",note:"悬浮按钮(反馈)"},"shadow-card":{value:"0 1px 4px rgba(0, 0, 0, 0.06)",note:"展开的卡片"},"shadow-node":{value:"0 1px 3px rgba(0, 0, 0, 0.1)",note:"谱系图节点"},"shadow-node-selected":{value:"0 0 0 3px rgba(0, 120, 212, 0.2), 0 2px 8px rgba(0, 120, 212, 0.3)"}}),gt("条目类型 / 状态徽章",{"type-book":{value:"#c0392b"},"type-work":{value:"#8e6f3e"},"type-collection":{value:"#2471a3"},"type-entity":{value:"#5b3e8e"},"status-draft":{value:"#e67e22"},"status-official":{value:"#27ae60"}}),gt("资源",{"restype-text":{value:"#2196f3"},"restype-image":{value:"#ff9800"},"restype-text-image":{value:"#9c27b0"},"restype-physical":{value:"#795548"},"missing-fg":{value:"#e67e22",note:"资源缺册提示"},"colormode-bw-bg":{value:"#f5f5f5",note:"影印件色彩模式标记(黑白 / 彩色)"},"colormode-bw-fg":{value:"#757575"},"colormode-color-bg":{value:"#fff8e1"},"colormode-color-fg":{value:"#f57f17"},"progress-active":{value:"#f59e0b",note:"资源导入进度"},"progress-done":{value:"#10b981"},"progress-todo":{value:"#9ca3af"},"check-fine-bg":{value:"#e8f5e9",note:"文字资源校对程度徽章(精校 / 粗校 / AI整理)"},"check-fine-fg":{value:"#2e7d32"},"check-rough-bg":{value:"#fff3e0"},"check-rough-fg":{value:"#e65100"},"check-ai-bg":{value:"#e3f2fd"},"check-ai-fg":{value:"#1565c0"}}),gt("整理本(CollatedEdition)",{"highlight-bg":{value:"#fff59d",note:"搜索命中高亮底"},"highlight-fg":{value:"inherit",root:!1},"section-lei":{value:"#8e6f3e",note:"章节类型标记:类 / 书 / 序 / 结语 / 考证 / 注释"},"section-shu":{value:"#c0392b"},"section-xu":{value:"#1a5276"},"section-jieyu":{value:"#7d6608"},"section-kaozhen":{value:"#5d6d7e"},"section-zhushi":{value:"#6c5b7b"},"section-tag-fg":{value:"#e74c3c",note:"章节标记(△ 等)"},"matchstate-fg":{value:"#b78900",note:"与底本匹配状态提示"},"quality-source":{value:"#1b5e20",note:"文本质量等级(底本 / OCR / 粗校 / 精校 / 暂无正文 / 占位)"},"quality-ocr":{value:"#e65100"},"quality-rough":{value:"#1565c0"},"quality-fine":{value:"#2e7d32"},"quality-none":{value:"#5f6368",note:"中性灰:暂无正文"},"quality-placeholder":{value:"#757575",note:"中性灰:占位"}}),gt("版本传承(VersionLineageGraph / List) / 关系方向(RelationPanel)",{"lost-fg":{value:"#c62828",note:"佚失标记"},"confidence-certain":{value:"#2e7d32",note:"关系置信度"},"confidence-consensus":{value:"#1976d2"},"confidence-probable":{value:"#ed6c02"},"confidence-disputed":{value:"#c62828"},"lineage-edge-consensus":{value:"#555555",note:"⚠️ 同为 consensus,List 徽章用 --bim-confidence-consensus(蓝),Graph 连线用这个(灰)。若要统一,覆盖成 var(--bim-confidence-consensus)"},"relation-up":{value:"#2196f3"},"relation-down":{value:"#4caf50"},"relation-flat":{value:"#ff9800"}}),gt("编辑器视图(主要在 guji-platform 插件中可见)",{"editor-type-work":{value:"#4caf50",note:"⚠️ 与展示视图的 --bim-type-* 是两套配色(历史如此)。若要统一,覆盖成对应的 var(--bim-type-*)"},"editor-type-collection":{value:"#2196f3"},"editor-type-book":{value:"#ff9800"},"editor-type-entity":{value:"#9c27b0"},"source-url":{value:"#2196f3",note:"来源类型(SourceEditor)"},"source-bookid":{value:"#4caf50"},"mode-active-bg":{value:"#2196f3",note:"模式指示器当前态(ModeIndicator)"},"cover-accent":{value:"#8e6f3e",note:'书目卡片「封面」点缀(IndexBrowser resultVariant="card")'}}),gt("详情页(作品 / 版本 / 丛编):宣纸 + 朱砂一套独立暖色,不继承 --bim-primary 等控件色",{"page-bg":{value:"#fbf9f3",note:"纸"},"row-hover-bg":{value:"#f5f1e5"},"selection-bg":{value:"#ecdcbc",note:"选区"},"band-bg":{value:"#f0e4cb",note:"全文入口横幅(暖沙)"},"band-bg-hover":{value:"#e6d5b4"},ink:{value:"#2a231c",note:"文字层次:墨 → 正文 → 提要 → meta → 标签 → 提示"},"body-fg":{value:"#3b3228"},"quiet-fg":{value:"#5b4f40"},"meta-fg":{value:"#7b6a54"},"label-fg":{value:"#6f6457",note:"标签 / 提示:2026-09 N3a 调深,纸底与斑马底上对比度均 ≥4.5(原 #a3937b 2.8、#b3a385 2.3)"},"hint-fg":{value:"#756a5e"},accent:{value:"#9c3a2c",note:"朱"},"accent-deep":{value:"#6f2a20",note:"链接 hover"},"rule-strong":{value:"#2a231c",note:"分隔线:强 → 常规 → 虚线 → 提要左线"},rule:{value:"#e4dbc9"},"rule-dashed":{value:"#d6c9ae"},"rule-accent-soft":{value:"#e0d3b6"},"aux-fg":{value:"#6f6457",note:"辅助字(元数据、注记、「·」分隔的浅色小字)。须在 page-bg / zebra-bg 上对比度 ≥4.5(Q5 巡检)"},"card-bg":{value:"#fffdf9",note:"提要卡:抬起的面"},"zebra-bg":{value:"#f6f2eb",note:"表格斑马纹 / 左栏分组底(不画格线,靠这一阶底色分行)"},"tint-bg":{value:"#f3eee6",note:"检索框、悬停"},"shadow-summary":{value:"0 10px 32px rgba(60, 50, 40, 0.07)",note:"提要卡投影"},"flag-bg":{value:"rgba(158, 42, 43, 0.08)",note:"唯一的状态色块「有影印」"},"theme-dot-zhusha":{value:"#9c3a2c",note:"主题切换控件的色点:朱砂(不随主题变,两套主题下都要认得出)"},"theme-dot-indigo":{value:"#2e5266",note:"主题切换控件的色点:靛青"},"theme-dot-ink":{value:"#3b4a58",note:"主题切换控件的色点:墨"},"sect-jing":{value:"#2e5266",note:"四部分布条:經部(人物页提要卡;无别处使用)"},"sect-shi":{value:"#9a7a3b",note:"四部分布条:史部"},"sect-zi":{value:"#4f7a5c",note:"四部分布条:子部"},"sect-ji":{value:"#9fb3bc",note:"四部分布条:集部"},"table-border":{value:"color-mix(in srgb, currentColor 28%, transparent)",root:!1,note:"古籍表格(跟随当前文字色)"},"table-head-bg":{value:"color-mix(in srgb, currentColor 8%, transparent)",root:!1}}),gt('版式(v4 外观系统,overview#291):疏朗=留白分区(默认,下列值即疏朗);界栏=框线分区(`<html data-layout="boxed">`)',{"fr-bd":{value:"0 solid transparent",note:"区块外框(border 简写)。疏朗无框;界栏 1px 实线"},"fr-bg":{value:"transparent",note:"区块底。界栏=卡面色"},"fr-hd-pad":{value:"14px 18px",note:"区块标题栏内边距。10-01 起疏朗也有淡染底的标题栏(--bim-fr-hd-bg),故疏朗 14px 18px,界栏 12px 18px"},"fr-hd-bd":{value:"0 solid transparent",note:"区块标题栏下沿线(border 简写)"},"fr-bd-pad":{value:"0",note:"区块正文内边距"},"fr-gap":{value:"56px",note:"区块之间的间距。界栏收紧到 24px(框线本身已分隔)"},"fr-side-gap":{value:"34px",note:"侧栏各块之间的间距;界栏 20px"},"fr-shadow":{value:"0 1px 0 var(--bim-rule), 0 12px 32px -18px rgba(40, 36, 31, 0.25)",note:"抬起的面(提要卡)的投影;界栏不用投影,靠框线"},"fr-tab-bd":{value:"transparent",note:"页签行下沿线颜色(疏朗不画,界栏画)"},"fr-hd-size":{value:"24px",note:"分区标题字号。界栏标题在框顶标题栏里,小一档 19px"},"fr-hd-bg":{value:"color-mix(in srgb, var(--bim-accent) 7%, var(--bim-page-bg))",note:"分区标题栏底色(淡染主色)。疏朗混进页面底,界栏 6% 混进卡面底。主色取 accent(primary 是 VS Code 按钮蓝,不随配色)"},"fr-card-bd":{value:"1px solid transparent",note:"卡片边框。疏朗不画(靠卡面底与淡投影);界栏 1px"},"fr-card-bg":{value:"var(--bim-card-bg)",note:"卡片底"},"fr-row-bd":{value:"1px solid transparent",note:"列表行线、块内小分割线。疏朗不画(靠行距);界栏 1px"},"fr-row-pad":{value:"10px 2px",note:"列表行内边距。界栏收紧 7px 2px"},"fr-chrome-bd":{value:"1px solid transparent",note:"顶栏、分区导航(吸顶锚点条)的线"},"fr-tag-bd":{value:"1px solid transparent",note:"标签、版本签、计数签、工具按钮的边框。疏朗浅底无框;界栏透明底加框"},"fr-tag-bg":{value:"var(--bim-tint-bg)",note:"标签底"},"fr-tbl-cell-bd":{value:"0 solid transparent",note:"表格格线。疏朗不画(靠斑马纹);界栏全格线"},"fr-tbl-zebra":{value:"var(--bim-tint-bg)",note:"表格斑马纹(只在疏朗下有)"},"fr-rail-bd":{value:"1px solid transparent",note:"侧栏里的块、提示块的边框"},"fr-rail-bg":{value:"var(--bim-tint-bg)",note:"侧栏块底。疏朗浅底;界栏卡面底"},"fr-spine-bd":{value:"1px solid transparent",note:"题签、书脊(竖排书名)的边框。界栏是强调色浅线"},"fr-spine-bg":{value:"var(--bim-flag-bg)",note:"题签、书脊底。疏朗浅色实底;界栏卡面底(正史原志两种版式都是强调色实底)"},"fr-plank":{value:"0 solid transparent",note:"书架架板(border 简写)。只在界栏下画 3px"},"fr-axis-bd":{value:"0 solid transparent",note:"时间轴轴线。界栏 1px"},"fr-axis-band":{value:"6px",note:"时间轴底带高度。疏朗用 6px 浅色带代替轴线;界栏 0"},"fr-tick":{value:"0",note:"时间轴刻度短线长度。界栏 5px"},"fr-band-gap":{value:"3px",note:"年代带各段之间的空隙。疏朗 3px;界栏紧贴"},"fr-band-bd":{value:"0 solid transparent",note:"年代带外框与段间分隔。界栏 1px"}}),gt("阅读器(整理本 / 全文)",{"reader-top":{value:"0px",note:"宿主吸顶导航的高度:阅读器工具条、目录与书影侧栏在它下面吸顶(如 60px)"},"reader-warm":{value:"#c9a24a",note:"阅读设置侧栏的暖黄:只做底色(8%)与选中态(24%),与朱/靛/墨三套主色都不冲"},"warp-bg":{value:"#faf8f5",note:"古籍矫正底本书影画布底色"},"warp-box-shadow":{value:"0 2px 12px rgba(0, 0, 0, 0.08)",note:"古籍底本书影浮雕阴影"},"warp-sel-bg":{value:"rgba(196, 148, 76, 0.45)",note:"古籍对读字框选中高亮底色"},"warp-sel-stroke":{value:"#a06e1c",note:"古籍对读字框选中描边"},"warp-hover-bg":{value:"rgba(217, 185, 106, 0.25)",note:"古籍对读字框悬停高亮底色"},"warp-hover-stroke":{value:"#c4944c",note:"古籍对读字框悬停描边"},"warp-badge-bg":{value:"rgba(184, 134, 54, 0.12)",note:"图文对读徽章背景"},"warp-badge-fg":{value:"#8c6820",note:"图文对读徽章文字颜色"},"warp-badge-bd":{value:"rgba(184, 134, 54, 0.3)",note:"图文对读徽章边框"},"warp-banxin-border":{value:"#8a8070",note:"版心分界线"},"warp-banxin-fold":{value:"rgba(160, 110, 28, 0.65)",note:"版心中缝对折线"},"warp-banxin-outer":{value:"#c9c3b4",note:"版心外边线"}}),gt("反馈浮钮(2026-09-28 Q5)",{"feedback-fab-z":{value:"40",note:"层级:低于页面抽屉、弹层(本包对话框为 1000)"},"feedback-fab-offset":{value:"0px",root:!1}}),gt("字体(全站无衬线,2026-09-05 定)",{"font-ui":{value:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif'},"font-body":{value:"system-ui, sans-serif",css:"var(--bim-font-ui)"},"font-serif":{value:Fs,note:"著录原文(提要、按语)用宋体"},"font-reading":{value:Fs,css:"var(--bim-font-serif)",note:"阅读器正文(整理本 / 全文);默认接 font-serif,只需覆盖那一个就同时换掉"}})],Nu=Object.assign({},...zu.map(e=>e.tokens)),Il={};for(const[e,n]of Object.entries(Nu))Il[e]=`var(--bim-${e}, ${n.value})`;function r(e){const n=Il[e];if(n===void 0)throw new Error(`book-index-ui: 未定义的设计变量 --bim-${e}`);return n}function Vt(e){return e.types&&e.types.length>0?e.types:[]}function Tu(e,n){return Vt(e).includes(n)}const Iu={source:"底本",ocr:"OCR",rough:"粗校",fine:"精校",none:"暫無正文",placeholder:"占位"};r("quality-source"),r("quality-ocr"),r("quality-rough"),r("quality-fine"),r("quality-none"),r("quality-placeholder");const Ru={"commons.wikimedia.org":"維基共享","zh.wikisource.org":"維基文庫","taiwanebook.ncl.edu.tw":"臺灣華文電子書庫","ctext.org":"中國哲學書電子化計劃","www.shidianguji.com":"識典古籍","shidianguji.com":"識典古籍","archive.org":"Internet Archive","www.shuge.org":"書格","shuge.org":"書格","pan.baidu.com":"百度網盤"};function $n(e){try{return Ru[new URL(e).hostname]}catch{return}}const Hs={text:0,image:1,physical:2};function ho(e){return e.length===0?"physical":[...e].sort((n,i)=>(Hs[n]??99)-(Hs[i]??99)).join("+")}function Eu(e){return e.includes("text")&&e.includes("image")?"text+image":e[0]||"physical"}function go(e){var l;const n=d=>{const c=d.match(/^(.+?)·第(\d+)[冊册]$/);if(c)return[c[1],parseInt(c[2])];const p=d.match(/^(.+?)[·(](\d+)[)]?$/);return p?[p[1],parseInt(p[2])]:null},i=new Map;for(let d=0;d<e.length;d++){const c=e[d];if(c.volumes&&c.volumes.length>0)continue;const p=n(c.name);if(!p)continue;const[h,m]=p,u=`${h}|${ho(Vt(c))}`;i.has(u)||i.set(u,{base:{...c,name:h,url:"",volumes:[]},volumes:[],indices:[]});const f=i.get(u);f.volumes.push({volume:m,url:c.url||void 0,status:"found"}),f.indices.push(d)}const o=[],s=new Set;for(const d of i.values())if(!(d.volumes.length<2)){d.volumes.sort((c,p)=>c.volume-p.volume),d.base.volumes=d.volumes,d.base.expected_volumes=d.volumes.length,d.base.url||(d.base.url=((l=d.volumes.find(c=>c.url))==null?void 0:l.url)??""),o.push(d.base);for(const c of d.indices)s.add(c)}const a=[...o];for(let d=0;d<e.length;d++)s.has(d)||a.push(e[d]);return a}function Rl(e){if(e.url)return e.url;for(const[n,i]of Object.entries(e))if(n.endsWith("_url")&&typeof i=="string")return i}function El(e){return!Array.isArray(e.volumes)||e.volumes.length===0?null:e.volumes.map(n=>({...n,url:n.url||Rl(n)}))}function Ri(e){const n=El(e);if(!n)return null;const i=new Set(n.filter(s=>s.status!=="missing").map(s=>s.volume)).size,o=new Set(n.filter(s=>s.status==="missing").map(s=>s.volume)).size;return{found:i,missing:o,expected:e.expected_volumes??i+o}}function fo(e){if(!e)return;const n=e.file_page_range||e.page_range;if(!n||typeof n!="string")return;const i=n.match(/^(\d+)/);return i?parseInt(i[1],10):void 0}function xo(e,n){try{if(new URL(e).hostname.includes("wikimedia.org")){const o=e.match(/\/wiki\/File:(.+?)(?:#|$)/);if(o)return`https://commons.wikimedia.org/w/index.php?title=File%3A${encodeURIComponent(decodeURIComponent(o[1]))}&page=${n}`;const s=new URL(e);return s.searchParams.set("page",String(n)),s.toString()}return e}catch{return e}}function Cn(e){if(!e.url)return;const n=fo(e.metadata);return n?xo(e.url,n):e.url}const Mt=g.createContext(null),Ll=["曹霑"];function Lu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Au(e,n=Ll){const i=[...new Set(n.filter(Boolean))].sort((a,l)=>l.length-a.length);if(!i.length)return e;const o=new RegExp(`(${i.map(Lu).join("|")})`,"g"),s=new Set(i);return a=>{if(!a)return e(a);const l=a.split(o);return l.length===1?e(a):l.map((d,c)=>c%2===1&&s.has(d)?d:d&&e(d)).join("")}}let Ln=null;function Al(){if(Ln)return Ln;try{const e=wu.Converter({from:"t",to:"cn"});Ln=Au(n=>e(ze.normalizeVariants(n)))}catch{Ln=e=>e}return Ln}const Mu={indexType:{work:"作品",book:"書籍",collection:"叢編",entity:"人物"},resourceType:{text:"文字資源",image:"圖片資源",textImage:"文字+圖片資源",physical:"館藏"},resourceTypeShort:{text:"文字",image:"圖片",textImage:"文字+圖片",physical:"館藏"},rootType:{catalog:"目錄式",search:"搜索式"},status:{draft:"草稿",official:"正式"},checkType:{精校:{label:"精校",bg:r("check-fine-bg"),fg:r("check-fine-fg")},粗校:{label:"粗校",bg:r("check-rough-bg"),fg:r("check-rough-fg")},AI整理:{label:"AI整理",bg:r("check-ai-bg"),fg:r("check-ai-fg")}},action:{save:"保存",delete:"刪除",newEntry:"+ 新建",viewAll:"查看全部 →",visit:"訪問 →",view:"查看 →",viewEntity:"查看",copy:"複製 ID",copied:"已複製",linkExisting:"+ 關聯現有",createAndLink:"+ 創建並關聯",remove:"刪除",clearAll:"清除全部",reselect:"重選",changeType:"更換類型",expand:"展開",collapse:"收起",expandMore:"展開更多",addSubWork:"添加子作品",addVersion:"添加新版本",addBook:"添加書籍",addSubCollection:"添加子叢編",addCollectionImpl:"添加叢編實現",addSource:"添加來源",addResource:"添加資源",addIndexedBy:"+ 添加收錄來源",addEmendatedBy:"+ 添加考證來源",addAdditionalWork:"+ 添加附屬作品",selectBookOrWork:"選擇書籍/作品",clickToSelectBookOrWork:"點擊選擇書籍/作品",unlink:"解除關聯"},label:{id:"ID:",author:"作者 (Author)",dynasty:"朝代/年份 (Dynasty/Year)",edition:"版本",juanCount:"卷數",pageCount:"頁數 (Pages)",volumeCount:"冊數 (Volumes)",holder:"現藏於 (Holder)",firstImage:"首頁圖片 (First Image URL)",year:"年代",currentLocation:"現藏",parentWork:"上級作品",relatedWorks:"相關作品",type:"類型",rootType:"根類型",coverageLevel:"覆蓋層級",coverageRange:"覆蓋範圍",metadata:"元數據",optionalInfo:"可選信息",details:"詳細說明",detailsOptional:"詳細說明 (可選)",positionOptional:"位置/頁碼 (可選)",dataVersionOptional:"數據版本 (可選)",processorVersionOptional:"處理器版本 (可選)",sourceName:"來源名稱",sourceBid:"來源 BID",titleInfo:"題名",authorInfo:"著者",urlAddress:"URL 地址"},section:{basicInfo:"📊 基本信息",description:"📝 介紹 (Description)",additionalWorks:"📑 附屬作品 (Additional Works)",indexedBy:"📖 著錄於",emendatedBy:"📝 考證",resources:"資源",textResources:"📝 文字資源 (Text Resources)",imageResources:"🖼️ 圖片資源 (Image Resources)",sources:"📚 資料來源 (Sources)",provenance:"📜 收藏歷史 (Provenance)",relatedVersions:"相關版本",otherEditions:"📚 其他版本 (Other Editions)",dangerZone:"危險區域 (Danger Zone)",aliases:"別名",attachedTexts:"附載篇目",appendix:"附錄",containedIn:"收入叢編",collectedIn:"收入叢編",belongsToWork:"所屬作品",locationHistory:"流轉歷史",historyOverview:"歷史沿革",containedBooks:"收錄書籍",relations:"關聯關係",summary:"提要",comment:"按語",additionalComment:"附按",indexed:"收錄於",emendated:"考證",relatedWorks:"相關作品",containedWorks:"包含作品",adaptations:"改編作品",derivativeWorks:"續書與評註",studies:"所考典籍"},relation:{belongsToWork:"所屬作品 (Work)",containedInCollection:"收入叢編",siblingVersions:"同作品其他版本",addVersionForWork:"為此作品添加新版本",parentWork:"父作品 (Parent Work)",childWorks:"子作品",collectionImpl:"叢編實現",allVersions:"所有版本",correspondingWork:"對應作品 (Work)",parentCollection:"父叢編 (Parent Collection)",childCollections:"子叢編",containedBooks:"包含書籍",notLinked:"(未關聯)",none:"(暫無)"},search:{placeholder:"搜索作品、書籍、叢編...",searching:"搜索中...",loading:"加載中...",noResults:"無匹配結果",noResultsFor:"未找到與「{query}」相關的結果",tryOther:"試試其他關鍵詞、別名或作者名",recentBrowse:"最近瀏覽",history:"搜索歷史",clearAll:"清除全部",clearRecent:"清除最近瀏覽",itemNotFound:"無法找到,可能已刪除",removeFromRecent:"移除",searchTitle:"搜索古籍索引",allTab:"全部",resultTabs:"結果分類",searchSubtitle:"輸入關鍵詞搜索作品、書籍或叢編",searchBookName:"搜索書名...",alias:"別名"},searchV4:{filterTitle:"篩選",dynasty:"朝代",classification:"部類",resources:"資源",extant:"存佚",clearAllFilters:"清除全部篩選",hasImage:"有影印",hasText:"有文本",hasCollated:"有文本",filterButton:"篩選",filterSelected:"{n} 項已選",expand:"展開",collapse:"收起",filteredCount:"篩出 {n} 條",removeFilter:"取消篩選:{name}",viewLabel:"結果視圖",viewTable:"表格",viewCard:"卡片",colTitle:"題名",colType:"類型",colAuthor:"責任者",colEra:"年代",colClass:"部類",colResource:"資源",tagImage:"影印",tagText:"文本",tagCollated:"文本",tagLost:"佚",pageInfo:"共 {total} 條 · 每頁 {size} 條 · 第 {page} / {pages} 頁",pagerLabel:"翻頁",prevPage:"上一頁",nextPage:"下一頁",emptyFiltered:"沒有找到匹配的條目。試試更短的書名、減少篩選,或切換繁 / 簡。",limitedNote:"各類只列前幾條,點上方分類頁籤看全部。",sortLabel:"排序",sortRelevance:"相關度",sortEra:"年代",sortTitle:"書名",sortEraAsc:"由早到晚",sortEraDesc:"由晚到早",sortTitleAsc:"拼音 A→Z",sortTitleDesc:"拼音 Z→A"},home:{title:"古籍索引",subtitle:"從左側搜索框輸入關鍵詞,查找作品、書籍或叢編",recommendedBrowse:"推薦瀏覽",catalogTab:"目錄",collectionTab:"叢編",siteTab:"在線資源",recommendTab:"推薦",feedbackTab:"反饋",statusInProgress:"進行中",statusDone:"已完成",statusTodo:"未開始",typeCatalog:"目錄",typeCollection:"資源集合",totalPending:"待統計",progressFormat:"{imported} / {total}",siteCoverage:"資源覆蓋"},browser:{title:"古籍資源索引",subtitle:""},detailTab:{basicInfo:"概覽",catalog:"目錄",collectionCatalog:"叢編目錄",collatedEdition:"文本",catalogSuffix:"·目錄",fullText:"文本",lineage:"版本傳承",feedback:"勘誤反饋",dataSource:"數據源",backToIndex:"典籍版本索引",submitVersion:"提交新版本",dataLicense:"數據源與授權"},metadata:{edition:"版本",version:"修訂版本",quality:"資源質量",check_type:"校對",image_source:"影像來源",team:"所屬團隊",publisher:"出版社",year:"出版年份",format:"格式",note:"備註",total_page:"頁數",total_pages:"總頁數",page_range:"頁碼範圍",page_count:"頁數",file_page_range:"文件頁碼",file_page_count:"文件頁數",content_page_range:"影印頁碼",volume:"冊",color_mode:"色彩",paragraph_count:"段落數",has_translation:"翻譯"},editor:{untitled:"未命名",workTitle:"作品名 (Work Title)",collectionTitle:"叢書名 (Collection Title)",bookTitle:"書名 (Book Title)",belongsToWork:"所屬作品 (Work)",authorLabel:"作者 (Author)",publicationYearLabel:"出版年 (Publication year)",containedIn:"收入叢編",holderLabel:"現藏於 (Holder)",pageLabel:"頁數 (Pages)",volumeLabel:"冊數 (Volumes)",firstImageLabel:"首頁圖片 (First Image URL)",descriptionPlaceholder:"簡要介紹...",provenancePlaceholder:"該資源的流轉與收藏記錄...",otherEditionsPlaceholder:"相關版本的 ID...",dangerZoneDesc:"從索引庫中永久刪除該實體的所有元數據文件。",deleteEntity:"刪除該實體 (Delete Entity)",selectToLink:"選擇要關聯的",unnamedSource:"(未命名來源)",selectSourceType:"選擇來源類型",fromExistingBook:"從現有書籍選擇",enterUrl:"輸入網址鏈接",sourceNamePlaceholder:"如: 維基文庫、中國基本古籍庫",deleteThisSource:"刪除此來源",deleteThisResource:"刪除此資源",resourcePlaceholder:"資源",idAutoExtract:"ID (自動從URL提取)",resourceName:"資源名稱",resourceUrl:"資源鏈接 (URL)",structurePlaceholder:"層級結構 (如: 冊、卷)",coverageRangePlaceholder:"如: 2,3,5-8",detailsPlaceholder:"詳細說明",summaryPlaceholder:"提要...",commentPlaceholder:"按語...",additionalCommentPlaceholder:"附按...",imageResourceLink:"圖片資源鏈接",bookNameLabel:"書名",sourcePlaceholder:"來源"},download:{completed:"下載完成",downloading:"下載中",downloadThis:"下載此資源"},mode:{localMode:"本地模式",syncMode:"同步模式:",githubSync:"GitHub 同步",switchToSync:"點擊切換到同步模式",switchToLocal:"點擊切換到本地模式",switchToGithub:"點擊切換到 GitHub 同步模式",switchToDraft:"點擊切換到 draft 倉庫",switchToOfficial:"點擊切換到 official 倉庫",selectFolder:"選擇本地文件夾",configurePath:"配置同步路徑"},catalog:{totalVolumes:"共",processed:"已處理",contains:"收錄",matched:"已匹配",unmatched:"待匹配",source:"來源:",all:"全部",loading:"加載叢編目錄...",notFound:"未找到叢編目錄數據",loadFailed:"加載失敗",noMatch:"無匹配結果",unmatched_label:"未匹配",volume:"第 {n} 冊"},unit:{juan:"卷",volume:"冊",bu:"部",items:"條"},workSubtype:{book:"書",article:"篇",poem:"詩",chapter:"篇章"},colorMode:{bw:"黑白",color:"彩色"},misc:{noResources:"暫無資源信息",hasTranslation:"有",noTranslation:"無",structure:"層級",coverage:"覆蓋",notFoundEntry:"未找到該條目",loadFailed:"加載失敗",textResource:"文字資源",imageResource:"圖片資源"}},Pu={indexType:{work:"作品",book:"书籍",collection:"丛编",entity:"人物"},resourceType:{text:"文字资源",image:"图片资源",textImage:"文字+图片资源",physical:"馆藏"},resourceTypeShort:{text:"文字",image:"图片",textImage:"文字+图片",physical:"馆藏"},rootType:{catalog:"目录式",search:"搜索式"},status:{draft:"草稿",official:"正式"},checkType:{精校:{label:"精校",bg:r("check-fine-bg"),fg:r("check-fine-fg")},粗校:{label:"粗校",bg:r("check-rough-bg"),fg:r("check-rough-fg")},AI整理:{label:"AI整理",bg:r("check-ai-bg"),fg:r("check-ai-fg")}},action:{save:"保存",delete:"删除",newEntry:"+ 新建",viewAll:"查看全部 →",visit:"访问 →",view:"查看 →",viewEntity:"查看",copy:"复制 ID",copied:"已复制",linkExisting:"+ 关联现有",createAndLink:"+ 创建并关联",remove:"删除",clearAll:"清除全部",reselect:"重选",changeType:"更换类型",expand:"展开",collapse:"收起",expandMore:"展开更多",addSubWork:"添加子作品",addVersion:"添加新版本",addBook:"添加书籍",addSubCollection:"添加子丛编",addCollectionImpl:"添加丛编实现",addSource:"添加来源",addResource:"添加资源",addIndexedBy:"+ 添加收录来源",addEmendatedBy:"+ 添加考证来源",addAdditionalWork:"+ 添加附属作品",selectBookOrWork:"选择书籍/作品",clickToSelectBookOrWork:"点击选择书籍/作品",unlink:"解除关联"},label:{id:"ID:",author:"作者 (Author)",dynasty:"朝代/年份 (Dynasty/Year)",edition:"版本",juanCount:"卷数",pageCount:"页数 (Pages)",volumeCount:"册数 (Volumes)",holder:"现藏于 (Holder)",firstImage:"首页图片 (First Image URL)",year:"年代",currentLocation:"现藏",parentWork:"上级作品",relatedWorks:"相关作品",type:"类型",rootType:"根类型",coverageLevel:"覆盖层级",coverageRange:"覆盖范围",metadata:"元数据",optionalInfo:"可选信息",details:"详细说明",detailsOptional:"详细说明 (可选)",positionOptional:"位置/页码 (可选)",dataVersionOptional:"数据版本 (可选)",processorVersionOptional:"处理器版本 (可选)",sourceName:"来源名称",sourceBid:"来源 BID",titleInfo:"题名",authorInfo:"著者",urlAddress:"URL 地址"},section:{basicInfo:"📊 基本信息",description:"📝 介绍 (Description)",additionalWorks:"📑 附属作品 (Additional Works)",indexedBy:"📖 著录于",emendatedBy:"📝 考证",resources:"资源",textResources:"📝 文字资源 (Text Resources)",imageResources:"🖼️ 图片资源 (Image Resources)",sources:"📚 资料来源 (Sources)",provenance:"📜 收藏历史 (Provenance)",relatedVersions:"相关版本",otherEditions:"📚 其他版本 (Other Editions)",dangerZone:"危险区域 (Danger Zone)",aliases:"别名",attachedTexts:"附载篇目",appendix:"附录",containedIn:"收入丛编",collectedIn:"收入丛编",belongsToWork:"所属作品",locationHistory:"流转历史",historyOverview:"历史沿革",containedBooks:"收录书籍",relations:"关联关系",summary:"提要",comment:"按语",additionalComment:"附按",indexed:"收录于",emendated:"考证",relatedWorks:"相关作品",containedWorks:"包含作品",adaptations:"改编作品",derivativeWorks:"续书与评注",studies:"所考典籍"},relation:{belongsToWork:"所属作品 (Work)",containedInCollection:"收入丛编",siblingVersions:"同作品其他版本",addVersionForWork:"为此作品添加新版本",parentWork:"父作品 (Parent Work)",childWorks:"子作品",collectionImpl:"丛编实现",allVersions:"所有版本",correspondingWork:"对应作品 (Work)",parentCollection:"父丛编 (Parent Collection)",childCollections:"子丛编",containedBooks:"包含书籍",notLinked:"(未关联)",none:"(暂无)"},search:{placeholder:"搜索作品、书籍、丛编...",searching:"搜索中...",loading:"加载中...",noResults:"无匹配结果",noResultsFor:"未找到与「{query}」相关的结果",tryOther:"试试其他关键词、别名或作者名",recentBrowse:"最近浏览",history:"搜索历史",clearAll:"清除全部",clearRecent:"清除最近浏览",itemNotFound:"无法找到,可能已删除",removeFromRecent:"移除",searchTitle:"搜索古籍索引",allTab:"全部",resultTabs:"结果分类",searchSubtitle:"输入关键词搜索作品、书籍或丛编",searchBookName:"搜索书名...",alias:"别名"},searchV4:{filterTitle:"筛选",dynasty:"朝代",classification:"部类",resources:"资源",extant:"存佚",clearAllFilters:"清除全部筛选",hasImage:"有影印",hasText:"有文本",hasCollated:"有文本",filterButton:"筛选",filterSelected:"{n} 项已选",expand:"展开",collapse:"收起",filteredCount:"筛出 {n} 条",removeFilter:"取消筛选:{name}",viewLabel:"结果视图",viewTable:"表格",viewCard:"卡片",colTitle:"题名",colType:"类型",colAuthor:"责任者",colEra:"年代",colClass:"部类",colResource:"资源",tagImage:"影印",tagText:"文本",tagCollated:"文本",tagLost:"佚",pageInfo:"共 {total} 条 · 每页 {size} 条 · 第 {page} / {pages} 页",pagerLabel:"翻页",prevPage:"上一页",nextPage:"下一页",emptyFiltered:"没有找到匹配的条目。试试更短的书名、减少筛选,或切换繁 / 简。",limitedNote:"各类只列前几条,点上方分类页签看全部。",sortLabel:"排序",sortRelevance:"相关度",sortEra:"年代",sortTitle:"书名",sortEraAsc:"由早到晚",sortEraDesc:"由晚到早",sortTitleAsc:"拼音 A→Z",sortTitleDesc:"拼音 Z→A"},home:{title:"古籍索引",subtitle:"从左侧搜索框输入关键词,查找作品、书籍或丛编",recommendedBrowse:"推荐浏览",catalogTab:"目录",collectionTab:"丛编",siteTab:"在线资源",recommendTab:"推荐",feedbackTab:"反馈",statusInProgress:"进行中",statusDone:"已完成",statusTodo:"未开始",typeCatalog:"目录",typeCollection:"资源集合",totalPending:"待统计",progressFormat:"{imported} / {total}",siteCoverage:"资源覆盖"},browser:{title:"古籍资源索引",subtitle:""},detailTab:{basicInfo:"概览",catalog:"目录",collectionCatalog:"丛编目录",collatedEdition:"文本",catalogSuffix:"·目录",fullText:"文本",lineage:"版本传承",feedback:"勘误反馈",dataSource:"数据源",backToIndex:"典籍版本索引",submitVersion:"提交新版本",dataLicense:"数据源与授权"},metadata:{edition:"版本",version:"修订版本",quality:"资源质量",check_type:"校对",image_source:"影像来源",team:"所属团队",publisher:"出版社",year:"出版年份",format:"格式",note:"备注",total_page:"页数",total_pages:"总页数",page_range:"页码范围",page_count:"页数",file_page_range:"文件页码",file_page_count:"文件页数",content_page_range:"影印页码",volume:"册",color_mode:"色彩",paragraph_count:"段落数",has_translation:"翻译"},editor:{untitled:"未命名",workTitle:"作品名 (Work Title)",collectionTitle:"丛书名 (Collection Title)",bookTitle:"书名 (Book Title)",belongsToWork:"所属作品 (Work)",authorLabel:"作者 (Author)",publicationYearLabel:"出版年 (Publication year)",containedIn:"收入丛编",holderLabel:"现藏于 (Holder)",pageLabel:"页数 (Pages)",volumeLabel:"册数 (Volumes)",firstImageLabel:"首页图片 (First Image URL)",descriptionPlaceholder:"简要介绍...",provenancePlaceholder:"该资源的流转与收藏记录...",otherEditionsPlaceholder:"相关版本的 ID...",dangerZoneDesc:"从索引库中永久删除该实体的所有元数据文件。",deleteEntity:"删除该实体 (Delete Entity)",selectToLink:"选择要关联的",unnamedSource:"(未命名来源)",selectSourceType:"选择来源类型",fromExistingBook:"从现有书籍选择",enterUrl:"输入网址链接",sourceNamePlaceholder:"如: 维基文库、中国基本古籍库",deleteThisSource:"删除此来源",deleteThisResource:"删除此资源",resourcePlaceholder:"资源",idAutoExtract:"ID (自动从URL提取)",resourceName:"资源名称",resourceUrl:"资源链接 (URL)",structurePlaceholder:"层级结构 (如: 册、卷)",coverageRangePlaceholder:"如: 2,3,5-8",detailsPlaceholder:"详细说明",summaryPlaceholder:"提要...",commentPlaceholder:"按语...",additionalCommentPlaceholder:"附按...",imageResourceLink:"图片资源链接",bookNameLabel:"书名",sourcePlaceholder:"来源"},download:{completed:"下载完成",downloading:"下载中",downloadThis:"下载此资源"},mode:{localMode:"本地模式",syncMode:"同步模式:",githubSync:"GitHub 同步",switchToSync:"点击切换到同步模式",switchToLocal:"点击切换到本地模式",switchToGithub:"点击切换到 GitHub 同步模式",switchToDraft:"点击切换到 draft 仓库",switchToOfficial:"点击切换到 official 仓库",selectFolder:"选择本地文件夹",configurePath:"配置同步路径"},catalog:{totalVolumes:"共",processed:"已处理",contains:"收录",matched:"已匹配",unmatched:"待匹配",source:"来源:",all:"全部",loading:"加载丛编目录...",notFound:"未找到丛编目录数据",loadFailed:"加载失败",noMatch:"无匹配结果",unmatched_label:"未匹配",volume:"第 {n} 册"},unit:{juan:"卷",volume:"册",bu:"部",items:"条"},workSubtype:{book:"书",article:"篇",poem:"诗",chapter:"篇章"},colorMode:{bw:"黑白",color:"彩色"},misc:{noResources:"暂无资源信息",hasTranslation:"有",noTranslation:"无",structure:"层级",coverage:"覆盖",notFoundEntry:"未找到该条目",loadFailed:"加载失败",textResource:"文字资源",imageResource:"图片资源"}};function bt(e,n,i){return{"zh-Hant":e,"zh-Hans":n}}const Bu=bt({toHans:"切换为简体",toHant:"切換為繁體",localeShortHans:"简",localeShortHant:"繁",themeLabel:"主題",theme:{zhusha:"朱砂",indigo:"靛青",ink:"墨"},loading:"加載中",repoSourceLink:"在 GitHub 查看本條目源文件",volumesMissing:"缺{n}",collapseVolumes:"收起分冊",expandVolumes:"展開分冊",collapseArrow:"收起 ▲",expandArrow:"展開 ▼",entitySubtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年號",office:"官職",anonymous:"佚名",collective:"集體"},cbdbTitle:"CBDB 中國歷代人物傳記數據庫",entityPlaceholderNote:"人物信息暫缺。該 Entity 僅作為作者佔位,詳細生平資料尚待補充。",otherVersions:"其他版本",switchToEdit:"切換到編輯模式",switchToView:"切換到查看模式",modeEdit:"✏️ 編輯",modeView:"👁 查看",noData:"無數據"},{toHans:"切换为简体",toHant:"切換為繁體",localeShortHans:"简",localeShortHant:"繁",themeLabel:"主题",theme:{zhusha:"朱砂",indigo:"靛青",ink:"墨"},loading:"加载中",repoSourceLink:"在 GitHub 查看本条目源文件",volumesMissing:"缺{n}",collapseVolumes:"收起分册",expandVolumes:"展开分册",collapseArrow:"收起 ▲",expandArrow:"展开 ▼",entitySubtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年号",office:"官职",anonymous:"佚名",collective:"集体"},cbdbTitle:"CBDB 中国历代人物传记数据库",entityPlaceholderNote:"人物信息暂缺。该 Entity 仅作为作者占位,详细生平资料尚待补充。",otherVersions:"其他版本",switchToEdit:"切换到编辑模式",switchToView:"切换到查看模式",modeEdit:"✏️ 编辑",modeView:"👁 查看",noData:"无数据"}),Ei=bt({relation:{part_of:"所屬",has_part:"包含",contains_text_of:"收錄",collected_in:"叢編",text_carried_by:"載錄",studied_by:"研究",studies:"所考",preceded_by:"前承",followed_by:"後繼",derived_from:"衍生",has_adaptation:"改編",related:"相關"},lossStatus:{extant:"今存",fragment:"殘存",partial:"殘存",lost:"已佚",unknown:"未詳"},resourceKind:{text:"文本",image:"影印",textImage:"圖文",physical:"館藏"},otherImages:"其他影印",fragmentTag:"殘片",collapseVolumes:"收起分冊",expandVolumes:"展開 {n} 冊",mirror:"鏡像",volumeStats:"{found} / {expected} 冊",volumeStatsMissing:"{found} / {expected} 冊 缺 {missing}",pageNav:"本頁導航",thisPage:"本頁",more:"更多",expandRest:"展開其餘 {n} {unit}",read:"閱讀",showMore:"顯示更多({n})",review:{reviewed:"已審核",disputed:"有爭議",unreviewed:"未審核",draft:"草稿"},dataVersion:"數據版本",todoCount:"待核 {n} 項",lacuna:"闕文",lacunaWith:"闕文:{label}",composedChar:"組字:{label}",bce:"前{n}",roleAll:"全部",loading:"加載中…",noLineageGraph:"暫無版本圖數據",notFound:"找不到該條目,可能已被刪除或 ID 不正確",workInfo:"作品信息"},{relation:{part_of:"所属",has_part:"包含",contains_text_of:"收录",collected_in:"丛编",text_carried_by:"载录",studied_by:"研究",studies:"所考",preceded_by:"前承",followed_by:"后继",derived_from:"衍生",has_adaptation:"改编",related:"相关"},lossStatus:{extant:"今存",fragment:"残存",partial:"残存",lost:"已佚",unknown:"未详"},resourceKind:{text:"文本",image:"影印",textImage:"图文",physical:"馆藏"},otherImages:"其他影印",fragmentTag:"残片",collapseVolumes:"收起分册",expandVolumes:"展开 {n} 册",mirror:"镜像",volumeStats:"{found} / {expected} 册",volumeStatsMissing:"{found} / {expected} 册 缺 {missing}",pageNav:"本页导航",thisPage:"本页",more:"更多",expandRest:"展开其余 {n} {unit}",read:"阅读",showMore:"显示更多({n})",review:{reviewed:"已审核",disputed:"有争议",unreviewed:"未审核",draft:"草稿"},dataVersion:"数据版本",todoCount:"待核 {n} 项",lacuna:"阙文",lacunaWith:"阙文:{label}",composedChar:"组字:{label}",bce:"前{n}",roleAll:"全部",loading:"加载中…",noLineageGraph:"暂无版本图数据",notFound:"找不到该条目,可能已被删除或 ID 不正确",workInfo:"作品信息"}),Ou=bt({kind:"版本",fact:{editionType:"版本類型",publication:"刊印",era:"刊寫年代",measure:"卷帙",volumes:"冊次",baseEdition:"底本",holdings:"存藏",callNumber:"索書號",seals:"藏印",leafStyle:"行款",binding:"裝幀",dimensions:"尺寸",condition:"品相",aliases:"又名"},inferredFromEdition:"據版本題名推斷",volumesValue:"第 {range} {unit}({n} {unit})",andMorePlaces:" 等 {n} 處",viewImages:"看原書影印",sec:{fulltext:"文本",images:"影印",physical:"館藏",lineage:"版本源流",empty:"影印與文本"},chapterUnit:"章",chapterCount:"{n} {unit}",sourceBy:"據{src}",readFrom:"從{ch}讀起",firstChapter:"第一章",enterReader:"進入閱讀頁",externalText:"站外文本",groupCount:"{n} 組",placeCount:"{n} 處",lineageMeta:"據版本傳承著錄",lineageView:"源流視圖",viewCards:"卡片",viewGraph:"關係圖",totalOf:"全 {n} {unit}",emptyText:"尚未著錄該版本的影印、文本與收藏信息。",editionCount:"{n} 種版本",siblings:"同作品版本",byEra:"按年代",kindCount:"{n} 種",viewAllInWork:"在作品頁看全部 {n} 種 →",volumeRange:"第 {range} {unit}",volumeCount:"{n} {unit}",confidence:{certain:"確證",consensus:"通說",probable:"可能",disputed:"有爭議"},confidenceNote:"({c})",lineage:{ancestor:"祖本",reconstructed:"擬構祖本",thisEdition:"本版",derivatives:"翻刻 · 衍生",appendix:"附記"}},{kind:"版本",fact:{editionType:"版本类型",publication:"刊印",era:"刊写年代",measure:"卷帙",volumes:"册次",baseEdition:"底本",holdings:"存藏",callNumber:"索书号",seals:"藏印",leafStyle:"行款",binding:"装帧",dimensions:"尺寸",condition:"品相",aliases:"又名"},inferredFromEdition:"据版本题名推断",volumesValue:"第 {range} {unit}({n} {unit})",andMorePlaces:" 等 {n} 处",viewImages:"看原书影印",sec:{fulltext:"文本",images:"影印",physical:"馆藏",lineage:"版本源流",empty:"影印与文本"},chapterUnit:"章",chapterCount:"{n} {unit}",sourceBy:"据{src}",readFrom:"从{ch}读起",firstChapter:"第一章",enterReader:"进入阅读页",externalText:"站外文本",groupCount:"{n} 组",placeCount:"{n} 处",lineageMeta:"据版本传承著录",lineageView:"源流视图",viewCards:"卡片",viewGraph:"关系图",totalOf:"全 {n} {unit}",emptyText:"尚未著录该版本的影印、文本与收藏信息。",editionCount:"{n} 种版本",siblings:"同作品版本",byEra:"按年代",kindCount:"{n} 种",viewAllInWork:"在作品页看全部 {n} 种 →",volumeRange:"第 {range} {unit}",volumeCount:"{n} {unit}",confidence:{certain:"确证",consensus:"通说",probable:"可能",disputed:"有争议"},confidenceNote:"({c})",lineage:{ancestor:"祖本",reconstructed:"拟构祖本",thisEdition:"本版",derivatives:"翻刻 · 衍生",appendix:"附记"}}),Wu=bt({fact:{written:"成書",measure:"卷帙",loss:"存佚",earliest:"最早存世",emendation:"考證",alias:"又名",attached:"附載",appendix:"附錄"},inferredFromEdition:"據版本題名推斷",loading:"載入中",emendationCount:"{n} 條",stat:{editions:"版本",hasImage:"有影印",catalogs:"家著錄"},classifiedBy:"據《{source}》",sec:{versions:"版本",catalogs:"著錄",collected:"收入叢編",related:"相關書目",resources:"在線資源"},versionsTotal:"共 {n} 種",versionsWithImage:"{n} 種有影印",versionsCurrent:"當前 {n} 種",scanOnly:"只看有影印",sortByYear:"按年代排列",sortByCatalog:"按著錄順序",col:{edition:"版本",era:"年代",holder:"館藏",image:"影印"},noVersionsFiltered:"當前篩選下沒有版本",noVersions:"暫無版本著錄",moreUnit:"種版本",sameEditionCopies:"同版另藏 {n} 部:",inferredEraNote:"部分年代據版本題名推斷,非著錄原文",empty:"尚未著錄該作品的版本與書目收錄。",relatedCount:"{n} 部",hasImage:"有影印",catalog:{meta:"歷代書目 {n} 家",tablist:"著錄書目",titleOnly:"僅著錄書名,無提要。",prev:"上一家:{name}",next:"下一家:{name}"}},{fact:{written:"成书",measure:"卷帙",loss:"存佚",earliest:"最早存世",emendation:"考证",alias:"又名",attached:"附载",appendix:"附录"},inferredFromEdition:"据版本题名推断",loading:"载入中",emendationCount:"{n} 条",stat:{editions:"版本",hasImage:"有影印",catalogs:"家著录"},classifiedBy:"据《{source}》",sec:{versions:"版本",catalogs:"著录",collected:"收入丛编",related:"相关书目",resources:"在线资源"},versionsTotal:"共 {n} 种",versionsWithImage:"{n} 种有影印",versionsCurrent:"当前 {n} 种",scanOnly:"只看有影印",sortByYear:"按年代排列",sortByCatalog:"按著录顺序",col:{edition:"版本",era:"年代",holder:"馆藏",image:"影印"},noVersionsFiltered:"当前筛选下没有版本",noVersions:"暂无版本著录",moreUnit:"种版本",sameEditionCopies:"同版另藏 {n} 部:",inferredEraNote:"部分年代据版本题名推断,非著录原文",empty:"尚未著录该作品的版本与书目收录。",relatedCount:"{n} 部",hasImage:"有影印",catalog:{meta:"历代书目 {n} 家",tablist:"著录书目",titleOnly:"仅著录书名,无提要。",prev:"上一家:{name}",next:"下一家:{name}"}}),Fu=bt({kind:"叢編",workCollection:"作品集",stat:{titles:"子目"},fact:{publication:"刊印",expected:"應收",measure:"卷帙"},member:{Book:"所收版本",Work:"所收作品",other:"成員"},memberNote:"子目與其各版本合計",nZhong:"{n} 種",nHan:"{n} 函",dist:{head:"全帙冊次分佈",segTitle:"{section} 第 {from}–{to} 冊",only:"只看{section}",unclassified:"未分類",hint:"點色段篩選部類"},sec:{titles:"子目",resources:"影印與文本"},totalVolumes:"全帙 {n} {unit}",currentN:"當前 {n} {unit}",loadAllTitle:"將載入全部 {n} {unit}",grouping:"正在按部類分組…",groupBySection:"按部類分組",find:"在本叢編中檢索",col:{volumes:"冊次",title:"書名",versions:"版本"},volumeRange:"第 {range} {unit}",resourcesCount:"{n} 處",text:"文本",empty:"尚未著錄該叢編的子目。",parent:"上級叢編"},{kind:"丛编",workCollection:"作品集",stat:{titles:"子目"},fact:{publication:"刊印",expected:"应收",measure:"卷帙"},member:{Book:"所收版本",Work:"所收作品",other:"成员"},memberNote:"子目与其各版本合计",nZhong:"{n} 种",nHan:"{n} 函",dist:{head:"全帙册次分布",segTitle:"{section} 第 {from}–{to} 册",only:"只看{section}",unclassified:"未分类",hint:"点色段筛选部类"},sec:{titles:"子目",resources:"影印与文本"},totalVolumes:"全帙 {n} {unit}",currentN:"当前 {n} {unit}",loadAllTitle:"将载入全部 {n} {unit}",grouping:"正在按部类分组…",groupBySection:"按部类分组",find:"在本丛编中检索",col:{volumes:"册次",title:"书名",versions:"版本"},volumeRange:"第 {range} {unit}",resourcesCount:"{n} 处",text:"文本",empty:"尚未著录该丛编的子目。",parent:"上级丛编"}),Hu=bt({subtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年號",office:"官職",anonymous:"佚名",collective:"群體"},bce:"前{n}",floruit:"活躍於 {from}—{to}",zi:"字{name}",hao:"號{name}",nativePlace:"{place}人",lifeAria:"{birth}—{death},一生 {years} 年",lifeYears:"一生 {years} 年",fact:{works:"著作"},nZhong:"{n} 種",moreNames:"更多別名({n})",dist:"著作分佈",autoMatch:"自動匹配",sec:{featured:"著作舉要",allWorks:"全部著作",works:"著作",external:"站外資料"},featuredSub:"存世版本最多的三部",versionsUnit:"種版本",hasImage:"有影印",empty:"尚未著錄該人物的關聯作品。",total:"共 {n} 種",current:"當前 {n} 種",sortByVersions:"按版本數排列",sortByCatalog:"按著錄順序",col:{work:"作品",section:"部類",role:"職任",versions:"存世版本",image:"影印"},notRecorded:"未著錄",emptyRole:"該職任下的著作尚未著錄。",moreUnit:"種著作",cbdbAuto:"CBDB 為自動匹配,未經人工核對",sealAlt:"{name}印影",imgCredit:"圖像:{credit}",imgLicense:"授權:{license}",imgSource:"來源"},{subtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年号",office:"官职",anonymous:"佚名",collective:"群体"},bce:"前{n}",floruit:"活跃于 {from}—{to}",zi:"字{name}",hao:"号{name}",nativePlace:"{place}人",lifeAria:"{birth}—{death},一生 {years} 年",lifeYears:"一生 {years} 年",fact:{works:"著作"},nZhong:"{n} 种",moreNames:"更多别名({n})",dist:"著作分布",autoMatch:"自动匹配",sec:{featured:"著作举要",allWorks:"全部著作",works:"著作",external:"站外资料"},featuredSub:"存世版本最多的三部",versionsUnit:"种版本",hasImage:"有影印",empty:"尚未著录该人物的关联作品。",total:"共 {n} 种",current:"当前 {n} 种",sortByVersions:"按版本数排列",sortByCatalog:"按著录顺序",col:{work:"作品",section:"部类",role:"职任",versions:"存世版本",image:"影印"},notRecorded:"未著录",emptyRole:"该职任下的著作尚未著录。",moreUnit:"种著作",cbdbAuto:"CBDB 为自动匹配,未经人工核对",sealAlt:"{name}印影",imgCredit:"图像:{credit}",imgLicense:"授权:{license}",imgSource:"来源"}),Du=bt({imagesLoading:"加載書影…",noImages:"暫無書影",noImagesHint:"這一卷還沒有配上影像;接入後在此與正文逐頁對看",imageAlt:"書影 第 {label} 頁",prevImage:"上一頁書影",nextImage:"下一頁書影",back:"閱讀",backAria:"返回{label}首頁",skipToText:"跳到正文",settings:"閱讀設置",settingsShort:"設置",closeSettings:"收起設置",groupText:"文字",groupMark:"標註",groupLayout:"版面",font:"字體",fontSong:"宋體",fontKai:"楷體",fontSystem:"系統默認",script:"繁簡",version:"版本",versionShort:"版本▾",unitJuan:"卷",pagerGroup:"翻{unit}",prevUnit:"上一{unit}",nextUnit:"下一{unit}",prevUnitTitle:"上一{unit}:{label}",nextUnitTitle:"下一{unit}:{label}",firstUnit:"已是第一{unit}",lastUnit:"已是最後一{unit}",toc:"目錄",images:"書影",fontSmaller:"縮小字號",fontLarger:"放大字號",paragraphTitle:"條目分行 ↔ 自然段",paragraph:"自然段",workLinks:"標出作品鏈接",properNameTitle:"書名加波浪線",properName:"專名線",properNameOff:"不顯示",properNameLite:"精簡",properNameFull:"完整",properNameLiteTitle:"只標人名、地名、朝代",showWorks:"標註書名",bookTitleStyle:"書名樣式",bookTitleWavy:"波浪線",bookTitleBracket:"書名號",scriptOrig:"原字",scriptOrigUnavailable:"此文本沒有規範層,無「原字」可選",scriptOrigShort:"原",scriptQuick:"字形",scriptHant:"通行繁體",scriptHans:"簡體",quoteStyle:"引號",quoteModern:"“”‘’",quoteClassic:"「」『』",quoteOriginal:"原樣",pageBreaks:"顯示分葉分割線",pageIndicator:"頁指示頭(上下鍵調整位置)",preserveMargins:"書影保留空白",facsimilePager:"書影翻頁",facsimilePageInput:"書影葉碼(輸入數字後按 Enter 或離開輸入框跳轉)",vertical:"豎排",closeToc:"收起目錄",sourceLabel:"出處",licenseOf:"授權 {license}",revisedAt:"最近校訂 {date}",reportError:"報告錯字",pagerNav:"翻卷",rail:"本卷",bottomBar:"閱讀工具",tocShort:"卷目",fontSize:"字號",close:"關閉",loading:"加載中…",noText:"暫無文本",tocFailed:"無法加載目錄",tocLoading:"加載目錄…",viewEntry:"查看條目",defaultRole:"撰",tocCaption:"目錄 · {n} {unit}",tocExpand:"展開",tocCollapse:"收起",searchChapters:"搜索全部章節",searchChaptersPlaceholder:"搜索全部章節…",searchUnit:"搜索全部{unit}",searchUnitPlaceholder:"搜索全部{unit}…",textSource:"來源",originalSource:"本站獨立整理",charGuess:"殘字(推測)",lacunaGuess:"闕文,推測為「{guess}」",upstream:"上游",chapterFailed:"無法加載章節內容",references:"參考文獻",entityDetail:"查看詳情 →"},{imagesLoading:"加载书影…",noImages:"暂无书影",noImagesHint:"这一卷还没有配上影像;接入后在此与正文逐页对看",imageAlt:"书影 第 {label} 页",prevImage:"上一页书影",nextImage:"下一页书影",back:"阅读",backAria:"返回{label}首页",skipToText:"跳到正文",settings:"阅读设置",settingsShort:"设置",closeSettings:"收起设置",groupText:"文字",groupMark:"标注",groupLayout:"版面",font:"字体",fontSong:"宋体",fontKai:"楷体",fontSystem:"系统默认",script:"繁简",version:"版本",versionShort:"版本▾",unitJuan:"卷",pagerGroup:"翻{unit}",prevUnit:"上一{unit}",nextUnit:"下一{unit}",prevUnitTitle:"上一{unit}:{label}",nextUnitTitle:"下一{unit}:{label}",firstUnit:"已是第一{unit}",lastUnit:"已是最后一{unit}",toc:"目录",images:"书影",fontSmaller:"缩小字号",fontLarger:"放大字号",paragraphTitle:"条目分行 ↔ 自然段",paragraph:"自然段",workLinks:"标出作品链接",properNameTitle:"书名加波浪线",properName:"专名线",properNameOff:"不显示",properNameLite:"精简",properNameFull:"完整",properNameLiteTitle:"只标人名、地名、朝代",showWorks:"标注书名",bookTitleStyle:"书名样式",bookTitleWavy:"波浪线",bookTitleBracket:"书名号",scriptOrig:"原字",scriptOrigUnavailable:"此文本没有规范层,无「原字」可选",scriptOrigShort:"原",scriptQuick:"字形",scriptHant:"通行繁体",scriptHans:"简体",quoteStyle:"引号",quoteModern:"“”‘’",quoteClassic:"「」『』",quoteOriginal:"原样",pageBreaks:"显示分叶分割线",pageIndicator:"页指示头(上下键调整位置)",preserveMargins:"书影保留空白",facsimilePager:"书影翻页",facsimilePageInput:"书影叶码(输入数字后按 Enter 或离开输入框跳转)",vertical:"竖排",closeToc:"收起目录",sourceLabel:"出处",licenseOf:"授权 {license}",revisedAt:"最近校订 {date}",reportError:"报告错字",pagerNav:"翻卷",rail:"本卷",bottomBar:"阅读工具",tocShort:"卷目",fontSize:"字号",close:"关闭",loading:"加载中…",noText:"暂无文本",tocFailed:"无法加载目录",tocLoading:"加载目录…",viewEntry:"查看条目",defaultRole:"撰",tocCaption:"目录 · {n} {unit}",tocExpand:"展开",tocCollapse:"收起",searchChapters:"搜索全部章节",searchChaptersPlaceholder:"搜索全部章节…",searchUnit:"搜索全部{unit}",searchUnitPlaceholder:"搜索全部{unit}…",textSource:"来源",originalSource:"本站独立整理",charGuess:"残字(推测)",lacunaGuess:"阙文,推测为「{guess}」",upstream:"上游",chapterFailed:"无法加载章节内容",references:"参考文献",entityDetail:"查看详情 →"}),Uu=bt({nJuan:"{n}卷",viewWork:"查看作品",viewWorkOf:"查看作品:{title}",workArrow:"作品 →",arrowWork:"→作品",nWorks:"{n}部作品",unlinked:"未關聯",summary:"提要",comment:"按語",additionalComment:"附按",noMatch:"無匹配結果",sectionType:{类:"類",书:"書",序:"序",结语:"結語",注释:"註釋",考证:"考證",诗:"詩",小计:"小計"},countTiao:"{n} 條",countTiaoOf:"{m} / {n} 條",countPoems:"{n} 首",countPoemsOf:"{m} / {n} 首",countBooks:"{n} 部書",countBooksOf:"{m} / {n} 部書",kaozhenTarget:"考證對象 {target}",baseText:"底本 {note}",textQuality:"文本質量",qualityLabel:{source:"底本",ocr:"OCR",rough:"粗校",fine:"精校",none:"暫無正文",placeholder:"占位"},qualityCriteria:{source:"照錄來源原文,本站未另行校對",ocr:"保持大意和結構,錯誤率在百分之十以內",rough:"保證文意基本正確,錯誤率在百分之三以內",fine:"通讀無障礙,錯誤率在百分之一以內",none:"質量未評定",placeholder:"占位條目,正文尚未錄入"},originalSource:"原文來源",viewsGroup:"看法",viewText:"正文",viewEntries:"條目",rowHeadNo:"序",rowHeadTitle:"書名",rowHeadWork:"作品",railCap:"本卷",railUnitPoems:"首",railUnitBooks:"部書",linkedN:"已關聯 {n}",linkedOf:"已關聯 {n} / {total}",railEntriesNav:"本卷條目"},{nJuan:"{n}卷",viewWork:"查看作品",viewWorkOf:"查看作品:{title}",workArrow:"作品 →",arrowWork:"→作品",nWorks:"{n}部作品",unlinked:"未关联",summary:"提要",comment:"按语",additionalComment:"附按",noMatch:"无匹配结果",sectionType:{类:"类",书:"书",序:"序",结语:"结语",注释:"注释",考证:"考证",诗:"诗",小计:"小计"},countTiao:"{n} 条",countTiaoOf:"{m} / {n} 条",countPoems:"{n} 首",countPoemsOf:"{m} / {n} 首",countBooks:"{n} 部书",countBooksOf:"{m} / {n} 部书",kaozhenTarget:"考证对象 {target}",baseText:"底本 {note}",textQuality:"文本质量",qualityLabel:{source:"底本",ocr:"OCR",rough:"粗校",fine:"精校",none:"暂无正文",placeholder:"占位"},qualityCriteria:{source:"照录来源原文,本站未另行校对",ocr:"保持大意和结构,错误率在百分之十以内",rough:"保证文意基本正确,错误率在百分之三以内",fine:"通读无障碍,错误率在百分之一以内",none:"质量未评定",placeholder:"占位条目,正文尚未录入"},originalSource:"原文来源",viewsGroup:"看法",viewText:"正文",viewEntries:"条目",rowHeadNo:"序",rowHeadTitle:"书名",rowHeadWork:"作品",railCap:"本卷",railUnitPoems:"首",railUnitBooks:"部书",linkedN:"已关联 {n}",linkedOf:"已关联 {n} / {total}",railEntriesNav:"本卷条目"}),Vu=bt({typeShort:{work:"作",book:"版",collection:"叢",entity:"人"},typeLabel:{work:"作品",book:"版本",collection:"叢編",entity:"人物"},typeAll:"全部",typeChipsLabel:"按類型檢索",recentTitle:"最近瀏覽",recentClear:"清除",recentItemLabel:"{type} {title}",recentEmpty:"還沒有瀏覽記錄。打開任一條目後會出現在這裏。",status:{done:"已完成",in_progress:"進行中",todo:"計劃中"},siteStatus:{done:"已對接",in_progress:"進行中"},catalogTitle:"書目著錄進度",catalogNote:"每條著錄對到作品條目",colCatalog:"書目",colRecords:"著錄條目",colMatched:"已對上作品",colProgress:"進度",colStatus:"狀態",relatedTitle:"同類書目與考證",relatedNote:"不在書架上的",allNWorks:"全部 {n} 部",nKinds:"{n} 種",allNKinds:"全部 {n} 種",pavilion:"閣",yearBC:"前{n}",missingLife:"生卒年未錄、未上軸:{names}",viewLineage:"看版本譜系 →",plannedSites:"計劃接入:{names}",loss:{extant:"存",partially_extant:"殘",lost:"佚",unknown:"未詳"},lossNote:{extant:"今有傳本",partially_extant:"部分存世",lost:"僅見著錄",unknown:"尚未判定"},lossCount:"{n} 部 · {note}",stat:{works:"作品",books:"版本",collections:"叢編",entities:"人物",has_image:"有影印",has_text:"有文本",article:"單篇文",poem:"單篇詩"},dataScale:"數據規模",byLoss:"按存佚檢索",license:"古籍元數據以 CC0 公有領域發布,可自由複製、改編、再發布。",repo:"數據倉庫:",repoNote:"(GitHub,CC0)",version:"當前數據版本:",download:"引用方式與數據下載 →",navLabel:"元數據首頁分區",nav:{zhi:"歷代史志",sibu:"四部",cong:"叢編",people:"人物",lineage:"版本譜系",sites:"在線資源",data:"數據與授權"},zhiSub:"正史藝文志、經籍志與後人補志,按所志朝代排列;每部志的著錄逐條對到作品",shelfLegendCount:"脊下數字=著錄條目",shelfLegendClick:"點書脊進作品頁",sibuSub:"全部作品按經史子集分類;與「目錄」頁同一棵分類樹",toCatalog:"進入目錄 →",unclassifiedNote:"多為只見於史志著錄、尚未歸類的書",congSub:"大型叢書、影印彙編、出土文獻與館藏,逐種列到版本",allNKindsMore:"全部 {n} 種 →",peopleSub:"歷代目錄學家,按生卒年排在一條時間軸上",allNPeopleMore:"全部 {n} 人 →",lineageSub:"版本多的作品,看各本的源流與異同",sitesSub:"外部數字圖書館與本站條目的對接",dataSub:"規模、存佚、許可與版本"},{typeShort:{work:"作",book:"版",collection:"丛",entity:"人"},typeLabel:{work:"作品",book:"版本",collection:"丛编",entity:"人物"},typeAll:"全部",typeChipsLabel:"按类型检索",recentTitle:"最近浏览",recentClear:"清除",recentItemLabel:"{type} {title}",recentEmpty:"还没有浏览记录。打开任一条目后会出现在这里。",status:{done:"已完成",in_progress:"进行中",todo:"计划中"},siteStatus:{done:"已对接",in_progress:"进行中"},catalogTitle:"书目著录进度",catalogNote:"每条著录对到作品条目",colCatalog:"书目",colRecords:"著录条目",colMatched:"已对上作品",colProgress:"进度",colStatus:"状态",relatedTitle:"同类书目与考证",relatedNote:"不在书架上的",allNWorks:"全部 {n} 部",nKinds:"{n} 种",allNKinds:"全部 {n} 种",pavilion:"阁",yearBC:"前{n}",missingLife:"生卒年未录、未上轴:{names}",viewLineage:"看版本谱系 →",plannedSites:"计划接入:{names}",loss:{extant:"存",partially_extant:"残",lost:"佚",unknown:"未详"},lossNote:{extant:"今有传本",partially_extant:"部分存世",lost:"仅见著录",unknown:"尚未判定"},lossCount:"{n} 部 · {note}",stat:{works:"作品",books:"版本",collections:"丛编",entities:"人物",has_image:"有影印",has_text:"有文本",article:"单篇文",poem:"单篇诗"},dataScale:"数据规模",byLoss:"按存佚检索",license:"古籍元数据以 CC0 公有领域发布,可自由复制、改编、再发布。",repo:"数据仓库:",repoNote:"(GitHub,CC0)",version:"当前数据版本:",download:"引用方式与数据下载 →",navLabel:"元数据首页分区",nav:{zhi:"历代史志",sibu:"四部",cong:"丛编",people:"人物",lineage:"版本谱系",sites:"在线资源",data:"数据与授权"},zhiSub:"正史艺文志、经籍志与后人补志,按所志朝代排列;每部志的著录逐条对到作品",shelfLegendCount:"脊下数字=著录条目",shelfLegendClick:"点书脊进作品页",sibuSub:"全部作品按经史子集分类;与「目录」页同一棵分类树",toCatalog:"进入目录 →",unclassifiedNote:"多为只见于史志著录、尚未归类的书",congSub:"大型丛书、影印汇编、出土文献与馆藏,逐种列到版本",allNKindsMore:"全部 {n} 种 →",peopleSub:"历代目录学家,按生卒年排在一条时间轴上",allNPeopleMore:"全部 {n} 人 →",lineageSub:"版本多的作品,看各本的源流与异同",sitesSub:"外部数字图书馆与本站条目的对接",dataSub:"规模、存佚、许可与版本"}),bo=bt({readable:"部可讀",pieces:"篇單篇詩文",startReading:"開始閱讀 →",nCopies:"{n}本",shelfHint:"按所志朝代排列,一脊一部",shelfLegendCount:"脊下「2本」=站內有幾個本子",shelfOther:"其他",shelfRegion:"{label}書架,可橫向滾動",origZhi:"正史原志",laterZhi:"後人補撰、續補",spineBy:"{name} 撰",spineRecords:"著錄 {n} 條",spineOnSite:"站內 {n}",nWorks:"{n} 部",allNWorks:"全部 {n} 部",nCopiesCard:"{n} 個本子",workPageLink:"作品頁:{title}的源流與全部版本 →",sibuUnclassifiedNote:"書目分類還沒補齊,其中多數是單篇詩文,已單列在下方。",subClasses:"{label}子類",allNClasses:"{label}全部 {n} 類 →",unclassified:"未分類",viewUnclassified:"查看未分類 →",periodItem:"{label},{n} 部",periodUnknown:"另有 {n} 部作者無朝代,在「四部」和搜索裏能找到",hoverHint:"窄段懸停看全名",nPieces:"{n} 篇",authorAll:"{name}全部 {n} 篇 →",period:{xianqin:"先秦",qinhan:"秦漢",weijin:"魏晉南北朝",suitang:"隋唐五代",song:"宋",liaojinyuan:"遼金元",ming:"明",qing:"清",modern:"近現代"},navLabel:"閱讀首頁分區",nav:{picks:"推薦閱讀",topics:"專題",famous:"名著與版本",sibu:"四部",period:"按年代",pieces:"單篇詩文"},picksSub:"編輯挑選,定期輪換",topicsSub:"按作品類型歸組;小說見下方「名著與版本」",famousSub:"一部作品一張卡,卡上列出站內能讀的各個本子",sibuSub:"按古籍總目的分類樹,只計站內可讀的作品",periodSub:"按作者朝代歸段,寬度與部數成比例",piecesSub:"單篇的詩、文、賦、表,按作者歸組",piecesMore:"按作者瀏覽全部 →"},{readable:"部可读",pieces:"篇单篇诗文",startReading:"开始阅读 →",nCopies:"{n}本",shelfHint:"按所志朝代排列,一脊一部",shelfLegendCount:"脊下「2本」=站内有几个本子",shelfOther:"其他",shelfRegion:"{label}书架,可横向滚动",origZhi:"正史原志",laterZhi:"后人补撰、续补",spineBy:"{name} 撰",spineRecords:"著录 {n} 条",spineOnSite:"站内 {n}",nWorks:"{n} 部",allNWorks:"全部 {n} 部",nCopiesCard:"{n} 个本子",workPageLink:"作品页:{title}的源流与全部版本 →",sibuUnclassifiedNote:"书目分类还没补齐,其中多数是单篇诗文,已单列在下方。",subClasses:"{label}子类",allNClasses:"{label}全部 {n} 类 →",unclassified:"未分类",viewUnclassified:"查看未分类 →",periodItem:"{label},{n} 部",periodUnknown:"另有 {n} 部作者无朝代,在「四部」和搜索里能找到",hoverHint:"窄段悬停看全名",nPieces:"{n} 篇",authorAll:"{name}全部 {n} 篇 →",period:{xianqin:"先秦",qinhan:"秦汉",weijin:"魏晋南北朝",suitang:"隋唐五代",song:"宋",liaojinyuan:"辽金元",ming:"明",qing:"清",modern:"近现代"},navLabel:"阅读首页分区",nav:{picks:"推荐阅读",topics:"专题",famous:"名著与版本",sibu:"四部",period:"按年代",pieces:"单篇诗文"},picksSub:"编辑挑选,定期轮换",topicsSub:"按作品类型归组;小说见下方「名著与版本」",famousSub:"一部作品一张卡,卡上列出站内能读的各个本子",sibuSub:"按古籍总目的分类树,只计站内可读的作品",periodSub:"按作者朝代归段,宽度与部数成比例",piecesSub:"单篇的诗、文、赋、表,按作者归组",piecesMore:"按作者浏览全部 →"}),Gu=bt({sideNav:"分類導航",classification:"分類",drawerLabel:"分類:{path}",all:"全部",allTitle:"全部典籍",stat:"共 {total} 種 · 每頁 {size} 條",statPage:" · 第 {page} / {pages} 頁",viewLabel:"呈現方式",viewCard:"卡片",viewList:"列表",juanN:"{n}卷",pagerLabel:"分頁",prevPage:"上一頁",nextPage:"下一頁",pageN:"第 {n} 頁",emptyWorks:"此類暫無作品",zhulu:"著錄",cunmu:"存目",categoriesN:"{n} 類",divisionStat:"{cats} 類 · {books} 部",categoryJuan:"卷{n}",booksN:"{n} 部",expandAllN:"展開全部 {n} 條"},{sideNav:"分类导航",classification:"分类",drawerLabel:"分类:{path}",all:"全部",allTitle:"全部典籍",stat:"共 {total} 种 · 每页 {size} 条",statPage:" · 第 {page} / {pages} 页",viewLabel:"呈现方式",viewCard:"卡片",viewList:"列表",juanN:"{n}卷",pagerLabel:"分页",prevPage:"上一页",nextPage:"下一页",pageN:"第 {n} 页",emptyWorks:"此类暂无作品",zhulu:"著录",cunmu:"存目",categoriesN:"{n} 类",divisionStat:"{cats} 类 · {books} 部",categoryJuan:"卷{n}",booksN:"{n} 部",expandAllN:"展开全部 {n} 条"}),Yu=bt({loss:{all:"全部",extant:"存",partially_extant:"殘",lost:"佚"},unclassified:"未分類",statBook:"書",statComma:",",statBookCopies:"本",statArticle:"文章",statArticleUnit:"篇",statPoem:"詩詞",statPoemUnit:"首",statCollection:"叢編",submit:"搜索"},{loss:{all:"全部",extant:"存",partially_extant:"残",lost:"佚"},unclassified:"未分类",statBook:"书",statComma:",",statBookCopies:"本",statArticle:"文章",statArticleUnit:"篇",statPoem:"诗词",statPoemUnit:"首",statCollection:"丛编",submit:"搜索"}),qu=bt({title:"反饋",close:"關閉",submitType:{bug:"反饋錯誤",resource:"添加資源",suggestion:"功能建議",contact:"想參與"},placeholder:{bug:"請描述您發現的錯誤,包括頁面位置和具體內容",resource:"請提供完整資源鏈接和簡要版本說明",suggestion:"您希望網站增加或改進什麼?",contact:"想參與整理、校對或合作?簡單介紹一下您自己,並留下聯繫方式(此類留言不公開)"},chooseTypeFirst:"請先選擇反饋類型",contactPlaceholder:"郵箱(選填,僅站方可見,方便我們回覆您)",contactLabel:"聯繫方式(選填)",submitFailedRetry:"提交失敗,請稍後重試",submitFailed:"提交失敗",thanks:"感謝您的反饋!",viewList:"查看反饋列表 →",continueSubmit:"繼續提交",submitting:"提交中...",submit:"提交",submitFeedback:"提交反饋",listType:{bug:"錯誤反饋",resource:"資源建議",suggestion:"功能建議",other:"其他"},status:{pending:"待處理",in_progress:"處理中",resolved:"已處理",wontfix:"不採納",duplicate:"重複"},empty:"暫無反饋",reply:"回覆"},{title:"反馈",close:"关闭",submitType:{bug:"反馈错误",resource:"添加资源",suggestion:"功能建议",contact:"想参与"},placeholder:{bug:"请描述您发现的错误,包括页面位置和具体内容",resource:"请提供完整资源链接和简要版本说明",suggestion:"您希望网站增加或改进什么?",contact:"想参与整理、校对或合作?简单介绍一下您自己,并留下联系方式(此类留言不公开)"},chooseTypeFirst:"请先选择反馈类型",contactPlaceholder:"邮箱(选填,仅站方可见,方便我们回复您)",contactLabel:"联系方式(选填)",submitFailedRetry:"提交失败,请稍后重试",submitFailed:"提交失败",thanks:"感谢您的反馈!",viewList:"查看反馈列表 →",continueSubmit:"继续提交",submitting:"提交中...",submit:"提交",submitFeedback:"提交反馈",listType:{bug:"错误反馈",resource:"资源建议",suggestion:"功能建议",other:"其他"},status:{pending:"待处理",in_progress:"处理中",resolved:"已处理",wontfix:"不采纳",duplicate:"重复"},empty:"暂无反馈",reply:"回复"}),Ku=bt({empty:"暫無版本傳承數據",emptyGraph:"暫無版本圖數據",modeList:"列表",modeGraph:"關係圖",collectionLabel:"集合:",collectionAll:"全部",collectionAllDesc:"顯示該作品所有版本(含橋接節點)",graphLoading:"加載圖組件中…",graphMissing:"圖組件未安裝。請安裝 {xyflow} 與 {dagre}。",graphMissingHint:"或使用 {list} 列表視圖。",bridgeTitle:"橋接節點:本身不在核心集,為保持派生鏈完整而顯示",otherGroup:"其他",lost:"已佚",fragment:"殘本",hypothetical:"假想祖本",bridge:"橋接",extant:"現存:{juan}",sources:"來源:",related:"關聯:",confidence:{certain:"確定",consensus:"共識",probable:"推測",disputed:"有爭議"}},{empty:"暂无版本传承数据",emptyGraph:"暂无版本图数据",modeList:"列表",modeGraph:"关系图",collectionLabel:"集合:",collectionAll:"全部",collectionAllDesc:"显示该作品所有版本(含桥接节点)",graphLoading:"加载图组件中…",graphMissing:"图组件未安装。请安装 {xyflow} 与 {dagre}。",graphMissingHint:"或使用 {list} 列表视图。",bridgeTitle:"桥接节点:本身不在核心集,为保持派生链完整而显示",otherGroup:"其他",lost:"已佚",fragment:"残本",hypothetical:"假想祖本",bridge:"桥接",extant:"现存:{juan}",sources:"来源:",related:"关联:",confidence:{certain:"确定",consensus:"共识",probable:"推测",disputed:"有争议"}}),Xu={common:Bu,detail:Ei,bookPage:Ou,workPage:Wu,collectionPage:Fu,entityPage:Hu,reader:Du,collated:Uu,metaHome:Vu,readHome:bo,catalogPage:Gu,searchPage:Yu,feedback:qu,lineage:Ku};function Zu(e){const n={};for(const[i,o]of Object.entries(Xu))n[i]=o[e];return n}function wt(e,n){return e.replace(/\{(\w+)\}/g,(i,o)=>String(n[o]??""))}const Ds=new Map;function zn(e){let n=Ds.get(e);return n||(n={...e==="zh-Hans"?Pu:Mu,...Zu(e)},Ds.set(e,n)),n}function Us(e,n){let i=e;for(const o of n.split(".")){if(i==null||typeof i!="object")return;i=i[o]}return typeof i=="string"?i:void 0}function Ml(e){return(n,i)=>{const o=Us(e,n)??Us(zn("zh-Hant"),n)??n;return i?wt(o,i):o}}const Vs=new Map;function Nn(e){let n=Vs.get(e);return n||(n=Ml(zn(e)),Vs.set(e,n)),n}const Pl="bim-locale";function Ju(){try{const e=localStorage.getItem(Pl);if(e==="zh-Hant"||e==="zh-Hans")return e}catch{}}function Qu(e){try{localStorage.setItem(Pl,e)}catch{}}const em="zh-Hans",tm=({locale:e,onLocaleChange:n,converter:i,children:o})=>{const[s,a]=g.useState(e??em),l=e??s;g.useEffect(()=>{if(e)return;const h=Ju();h&&h!==s&&a(h)},[]);const d=g.useMemo(()=>l==="zh-Hans"?i??Al():null,[l,i]),c=g.useCallback(h=>{a(h),Qu(h),n==null||n(h)},[n]),p=g.useMemo(()=>({locale:l,setLocale:c,messages:zn(l),converter:d}),[l,c,d]);return t.jsx(Mt.Provider,{value:p,children:o})};function Ae(){const e=g.useContext(Mt);return(e==null?void 0:e.messages)??zn("zh-Hant")}const nm=2e3;function Ue(){const e=g.useContext(Mt),n=(e==null?void 0:e.locale)??"zh-Hant",i=(e==null?void 0:e.converter)??null,o=g.useRef(new Map),s=g.useRef(n),a=g.useRef(i);(s.current!==n||a.current!==i)&&(o.current.clear(),s.current=n,a.current=i);const l=g.useCallback(d=>{if(!d)return"";if(!i)return d;const c=o.current.get(d);if(c!==void 0)return c;const p=i(d);if(o.current.size>=nm){const h=o.current.keys().next().value;h!==void 0&&o.current.delete(h)}return o.current.set(d,p),p},[i]);return g.useMemo(()=>({convert:l,locale:n,isSimplified:n==="zh-Hans"}),[l,n])}function re(){const e=g.useContext(Mt),{convert:n,locale:i,isSimplified:o}=Ue(),s=(e==null?void 0:e.messages)??zn("zh-Hant"),a=g.useMemo(()=>e?Ml(s):Nn("zh-Hant"),[e,s]);return g.useMemo(()=>({t:a,convert:n,locale:i,isSimplified:o,messages:s}),[a,n,i,o,s])}const Bl=["錄說語詞議樣書記類傳國經補藝紀編後與間條號為開總種無數據冊頁選時題爲詩萬證學續關東圖資歷來讀館論見鈔別進師輯陳覽寫現應從","點兩華實對員長註結闕殘檢閱當會單換體將裡訂處過區釋術頭錢譯識個電動顯問這認質還幾遺雖須專擇係網運權務變發機請風聲輸軍導產","話們車難報讓業設帶辦紙氣麼際聽親場買賣謝費漢庫遷馬叢孫於張義晉閣維曆欽則夢慶齋録舊內陽樓紅淵歸載稱隱遼計評觀禮龜黃興節併","餘齊韓簡霑並樂諸滸屬組篩紹緒劉蘇誤職夾廣蓋敘斷歐寬駰極參試雜魯沒順線貞該測鮮統戰檔衛辭聯臺贊刪聖貫啟瀏譜薈寶約嘗諜謂舉詳","異賦軾復諒構級審標劃彙吳楊暫轉項寧硯蕭儀禪韻掃閉倉麗禎錯監鞏轍繫説筆竄縣聞諡賈僅擊羅宮訓談誌葉視戶細許祿繪鍵絕欄鑑講誕馮","趙習樹饋確賜裝擬規繼製薦畫鉛獨誠遠龍門覺訣隸軒諭繕塊爭鏡裏豐碼備掛堯錦駕鶴遊傷猶鄒瑩綴揚詔託僞頗竊虛莊歲禍爾辯獲篤窮盡跡","萊終穎訛瑣鐫繡廟幀佈躍雙預連狀態軸複懸遞灣箋頌訪層鏈敗達鈞鳳亂奮豈陰婁騎純優獻靈牆隨摺疊驗徑橫瀾蔣壞鈕盤範圍責減籤適側","榮聶頃縉讎銓廳軌厲鶚駢醫駝黨鐘諫樞滄軻溫贈鐵徵賴蹟潁閒顗歿駁歟勸諷誼湯詐脫羣尋澤擄顏釀謄鴻離騷傑滯憤執廢懼匱歎毀蠶獄寵闇","陸淺貨輕貧俠賤貴煩競樑鳩採綜謬鳴養堅韋顎呂蘭脈峯鵲兒賞籠階緊綱漁荊嬰慍潛營鎔繞陣塚億負卻塵懷閨擋撐縮領滾輪匯撈貼讚創險團","隊準礙強髒藥鮑顧給緯悅帳巖廬貢亞壇惡諱鎮薊驍愛討彌護揮偉輒擾況較響喪鑰藍"].join(""),im=new Set([...Bl,...Object.keys(ze.VARIANT_CHARS),...Object.keys(Cl.VARIANT_SUPPLEMENT)]),Ol=[...Ll,"切換為繁體","漢籍リポジトリ"];function rm(e,n=Ol){let i=e;for(const a of n)a&&(i=i.split(a).join(" "));const o=[],s=Array.from(i);return s.forEach((a,l)=>{im.has(a)&&o.push({char:a,context:s.slice(Math.max(0,l-8),l+9).join("")})}),o}function om(e,n,i){return e?e==="orig"?null:n==="zh-Hans"?i??Al():e==="hant"?ze.normalizeVariants:i:n==="zh-Hans"?i:ze.normalizeVariants}const sm=({mode:e,children:n})=>{const i=g.useContext(Mt),o=g.useMemo(()=>i&&{...i,converter:om(e,i.locale,i.converter)},[i,e]);return t.jsx(Mt.Provider,{value:o,children:n})};function am(e){if(!e)return"";try{const n=new URL(e).hostname,i={"zh.wikisource.org":"wikisource","www.shidianguji.com":"shidianguji","shidianguji.com":"shidianguji","archive.org":"archive","ctext.org":"ctext","read.nlc.cn":"nlc","www.digital.archives.go.jp":"japan_archives"};if(i[n])return i[n];const o=n.split(".");return o.length>=2?o[o.length-2]:n}catch{return""}}function Gs(e){return e==="text+image"?["text","image"]:[e]}function Ys(e){const n=Vt(e);return n.length===0?"text":Eu(n)}function lm(){return{id:"",name:"",url:"",types:["text"],details:""}}const Mr=({items:e,onChange:n,onDownload:i,downloadStatuses:o,filterType:s})=>{const a=Ae(),[l,d]=g.useState(null),c=[{value:"text",label:a.resourceTypeShort.text},{value:"image",label:a.resourceTypeShort.image},{value:"text+image",label:a.resourceTypeShort.textImage},{value:"physical",label:a.resourceTypeShort.physical}],p=[{value:"catalog",label:a.rootType.catalog},{value:"search",label:a.rootType.search}],h=w=>{if(!s)return!0;const v=Vt(w);return s==="text"?v.includes("text"):s==="image"?v.includes("image")||v.includes("physical"):s==="physical"?v.includes("physical"):v.includes(s)},m=e.map((w,v)=>({item:w,originalIndex:v})).filter(({item:w})=>h(w)),u=()=>{const w=lm();s&&(w.types=Gs(s)),n([...e,w]),d(e.length)},f=w=>{n(e.filter((v,k)=>k!==w)),d(null)},x=(w,v,k)=>{const z=[...e];if(z[w]={...z[w],[v]:k},v==="url"&&!z[w].id){const C=am(k);C&&(z[w].id=C)}n(z)},j=(w,v)=>{const k=[...e],{type:z,...C}=k[w];k[w]={...C,types:Gs(v)},n(k)},y=(w,v,k)=>{const C={...e[w].metadata||{}};k?C[v]=k:delete C[v],x(w,"metadata",Object.keys(C).length>0?C:void 0)},S=(w,v)=>{const k=v.trim()?v.split(/[,,、]/).map(z=>z.trim()).filter(Boolean):void 0;x(w,"structure",k)},b=(w,v,k)=>{const C=e[w].coverage||{level:1,ranges:""};v==="level"?C.level=parseInt(k)||1:C.ranges=k,x(w,"coverage",C.ranges?C:void 0)};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[m.map(({item:w,originalIndex:v})=>{var k,z,C;return t.jsxs("div",{style:{border:`1px solid ${r("widget-border")}`,borderRadius:"4px",background:r("input-bg"),overflow:"hidden"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 12px",cursor:"pointer",gap:"8px"},onClick:()=>d(l===v?null:v),children:[t.jsx("span",{style:{opacity:.6,fontSize:"12px"},children:l===v?"▼":"▶"}),t.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:cm(Ys(w)),color:r("on-color-fg")},children:(()=>{var I,T;const _=Vt(w);return _.length===0?"text":_.length===1?((I=c.find(N=>N.value===_[0]))==null?void 0:I.label)??_[0]:_.includes("text")&&_.includes("image")?((T=c.find(N=>N.value==="text+image"))==null?void 0:T.label)??"text+image":_.join("+")})()}),t.jsx("span",{style:{flex:1,fontSize:"13px",fontWeight:500},children:w.name||`${a.editor.resourcePlaceholder} ${v+1}`}),w.id&&t.jsx("span",{style:{fontSize:"11px",opacity:.5},children:w.id}),w.url&&t.jsx("a",{href:w.url,target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),style:{fontSize:"12px",opacity:.7},children:"🔗"}),i&&w.url&&dm(v,o==null?void 0:o[v],i,a),t.jsx("button",{onClick:_=>{_.stopPropagation(),f(v)},style:{background:"transparent",border:"none",color:r("danger"),cursor:"pointer",padding:"2px 6px",fontSize:"14px"},title:a.editor.deleteThisResource,children:"✕"})]}),l===v&&t.jsxs("div",{style:{padding:"12px",borderTop:`1px solid ${r("widget-border")}`},children:[Tu(w,"image")&&w.url&&pm(w,a),t.jsxs("div",{style:{display:"grid",gap:"8px"},children:[t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("label",{style:An,children:[t.jsx("span",{style:Mn,children:a.label.type}),t.jsx("select",{value:Ys(w),onChange:_=>j(v,_.target.value),style:{...Rt,flex:1},children:c.map(_=>t.jsx("option",{value:_.value,children:_.label},_.value))})]}),t.jsxs("label",{style:An,children:[t.jsx("span",{style:Mn,children:a.label.rootType}),t.jsx("select",{value:w.root_type||"catalog",onChange:_=>x(v,"root_type",_.target.value),style:{...Rt,flex:1},children:p.map(_=>t.jsx("option",{value:_.value,children:_.label},_.value))})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsx("input",{type:"text",value:w.id,onChange:_=>x(v,"id",_.target.value),placeholder:a.editor.idAutoExtract,style:{...Rt,width:"140px",flexShrink:0}}),t.jsx("input",{type:"text",value:w.name,onChange:_=>x(v,"name",_.target.value),placeholder:a.editor.resourceName,style:{...Rt,flex:1}})]}),t.jsx("input",{type:"text",value:w.url,onChange:_=>x(v,"url",_.target.value),placeholder:a.editor.resourceUrl,style:Rt}),t.jsx("input",{type:"text",value:((k=w.structure)==null?void 0:k.join("、"))||"",onChange:_=>S(v,_.target.value),placeholder:a.editor.structurePlaceholder,style:Rt}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("label",{style:An,children:[t.jsx("span",{style:Mn,children:a.label.coverageLevel}),t.jsx("input",{type:"number",min:1,value:((z=w.coverage)==null?void 0:z.level)??"",onChange:_=>b(v,"level",_.target.value),placeholder:"1",style:{...Rt,width:"60px"}})]}),t.jsxs("label",{style:{...An,flex:1},children:[t.jsx("span",{style:Mn,children:a.label.coverageRange}),t.jsx("input",{type:"text",value:((C=w.coverage)==null?void 0:C.ranges)||"",onChange:_=>b(v,"ranges",_.target.value),placeholder:a.editor.coverageRangePlaceholder,style:{...Rt,flex:1}})]})]}),t.jsx("textarea",{value:w.details||"",onChange:_=>x(v,"details",_.target.value),placeholder:a.editor.detailsPlaceholder,style:{...Rt,minHeight:"60px",resize:"vertical"}}),t.jsxs("div",{style:{borderTop:`1px solid ${r("widget-border")}`,paddingTop:"8px",marginTop:"4px"},children:[t.jsx("div",{style:{fontSize:"12px",color:r("desc-fg"),marginBottom:"6px"},children:a.label.metadata}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"6px"},children:Object.entries(a.metadata).map(([_,I])=>{var T;return t.jsxs("label",{style:{...An,gap:"4px"},children:[t.jsx("span",{style:{...Mn,minWidth:"56px"},children:I}),t.jsx("input",{type:"text",value:((T=w.metadata)==null?void 0:T[_])||"",onChange:N=>y(v,_,N.target.value),placeholder:I,style:{...Rt,flex:1}})]},_)})})]})]})]})]},v)}),t.jsxs("button",{onClick:u,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"8px 16px",border:`1px dashed ${r("widget-border")}`,borderRadius:"4px",background:"transparent",color:r("fg"),cursor:"pointer",fontSize:"13px",opacity:.8},children:[t.jsx("span",{children:"+"}),t.jsx("span",{children:a.action.addResource})]})]})};function cm(e){switch(e){case"text":return r("restype-text");case"image":return r("restype-image");case"text+image":return r("restype-text-image");case"physical":return r("restype-physical")}}function dm(e,n,i,o){const s=(n==null?void 0:n.status)==="downloading",a=(n==null?void 0:n.status)==="completed";return t.jsx("button",{onClick:l=>{l.stopPropagation(),s||i(e,"")},disabled:s,style:{background:"transparent",border:"none",color:r(a?"success":s?"desc-fg":"link-fg"),cursor:s?"default":"pointer",padding:"2px 6px",fontSize:"12px",opacity:s?.6:.9},title:a?o.download.completed:s?`${o.download.downloading} ${(n==null?void 0:n.progress)||0}%`:o.download.downloadThis,children:a?"✓":s?"⏳":"⬇"})}function pm(e,n){const i=/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(e.url)||e.url.includes("iiif")||e.url.includes("image");return t.jsx("div",{style:{marginBottom:"12px"},children:i?t.jsx("div",{style:{width:"100%",maxHeight:"150px",overflow:"hidden",borderRadius:"4px",background:r("overlay-bg")},children:t.jsx("img",{src:e.url,alt:e.name,style:{width:"100%",height:"150px",objectFit:"contain"},onError:o=>{o.target.style.display="none"}})}):t.jsx("div",{style:{padding:"12px",background:r("overlay-bg"),borderRadius:"4px",fontSize:"12px",color:r("desc-fg")},children:n.editor.imageResourceLink})})}const Rt={width:"100%",padding:"6px 8px",background:r("input-bg"),color:r("input-fg"),border:`1px solid ${r("input-border")}`,borderRadius:"2px",fontSize:"13px",boxSizing:"border-box"},An={display:"flex",alignItems:"center",gap:"6px"},Mn={fontSize:"12px",color:r("desc-fg"),whiteSpace:"nowrap"},qs={text:r("restype-text"),image:r("restype-image"),"text+image":r("restype-text-image"),physical:r("restype-physical")};function um(e){return e.includes("text")&&e.includes("image")?qs["text+image"]:qs[e[0]||"physical"]}const yo=({items:e,groupByType:n=!0,resourceGroups:i,onNavigate:o,renderLink:s})=>{const a=Ae(),{convert:l}=Ue(),d=g.useMemo(()=>go(e||[]),[e]),{mirrorGroups:c,ungroupedItems:p}=g.useMemo(()=>{const y=new Map,S=[];for(const b of d){const w=b.group;w?(y.has(w)||y.set(w,[]),y.get(w).push(b)):S.push(b)}for(const b of y.values())b.sort((w,v)=>{const k=z=>z.group_role==="origin"?0:z.group_role==="mirror"?1:2;return k(w)-k(v)});return{mirrorGroups:y,ungroupedItems:S}},[d]),h={text:a.resourceType.text,image:a.resourceType.image,"text+image":a.resourceType.textImage,physical:a.resourceType.physical},m=y=>h[y]?h[y]:y.split("+").map(S=>h[S]||S).join("+");if(!d||d.length===0)return t.jsx("div",{style:{padding:"16px",color:r("desc-fg"),fontSize:"13px",textAlign:"center"},children:a.misc.noResources});if(!n)return t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:d.map((y,S)=>t.jsx(gr,{item:y},y.id||S))});const u=(y,S)=>{const b=i==null?void 0:i[y],w=(b==null?void 0:b.label)||y,v=b==null?void 0:b.description;return t.jsxs("div",{style:{padding:"10px 12px",border:`1px solid ${r("widget-border")}`,borderRadius:"6px",background:r("input-bg"),display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:r("fg")},children:l(w)}),v&&t.jsx("div",{style:{fontSize:"12px",color:r("desc-fg"),lineHeight:1.5},children:l(v)}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:S.map((k,z)=>t.jsx(gr,{item:k,onNavigate:o,renderLink:s},k.id||z))})]},`group-${y}`)},f=new Map;for(const y of p){const S=ho(Vt(y));f.has(S)||f.set(S,[]),f.get(S).push(y)}const x=["text","image","text+image","physical"],j=[...x.filter(y=>f.has(y)),...[...f.keys()].filter(y=>!x.includes(y)).sort()];return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[[...c.entries()].map(([y,S])=>u(y,S)),j.map(y=>{const S=f.get(y),b=um(y.split("+"));return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",flexWrap:"wrap"},children:[t.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:b,whiteSpace:"nowrap",flexShrink:0},children:m(y)}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:S.map((w,v)=>t.jsx(gr,{item:w,onNavigate:o,renderLink:s},w.id||v))})]},y)})]})},mm={bw:{label:"",bg:r("colormode-bw-bg"),fg:r("colormode-bw-fg")},color:{label:"",bg:r("colormode-color-bg"),fg:r("colormode-color-fg")}},gr=({item:e})=>{const n=Ae(),{convert:i}=Ue(),[o,s]=g.useState(!1),a=g.useMemo(()=>(e.url?$n(e.url):void 0)||i(e.name),[e.url,e.name,i]),l=g.useMemo(()=>!Array.isArray(e.volumes)||e.volumes.length===0?null:e.volumes.map(x=>({...x,url:x.url||Rl(x)})),[e.volumes]),d=l&&l.length>0,c=d?new Set(l.filter(x=>x.status!=="missing").map(x=>x.volume)).size:0,p=d?new Set(l.filter(x=>x.status==="missing").map(x=>x.volume)).size:0,h=e.expected_volumes??(d?c+p:0),m=e.color_mode?{...mm[e.color_mode],label:n.colorMode[e.color_mode]}:null,u=e.details&&!d?i(e.details):null,f={display:"inline-flex",alignItems:"center",gap:"5px",padding:"4px 10px",border:`1px solid ${r("widget-border")}`,borderRadius:"5px",background:r("input-bg"),fontSize:"12px",color:r("fg"),lineHeight:1.4,verticalAlign:"middle"};return t.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"4px"},children:[t.jsxs("div",{style:f,children:[t.jsx("span",{style:{fontWeight:500},children:a}),m&&t.jsx("span",{style:{padding:"0 5px",borderRadius:"3px",fontSize:"10px",fontWeight:500,background:m.bg,color:m.fg},children:m.label}),u&&t.jsx("span",{style:{fontSize:"11px",color:r("desc-fg")},children:u}),d&&t.jsxs("span",{style:{fontSize:"11px",color:r("desc-fg")},children:[c,"/",h,n.unit.volume,p>0&&t.jsx("span",{style:{color:r("missing-fg"),marginLeft:"3px"},children:wt(n.common.volumesMissing,{n:p})})]}),e.url&&t.jsx("a",{href:(()=>{const x=fo(e.metadata);return x?xo(e.url,x):e.url})(),target:"_blank",rel:"noopener noreferrer",style:{fontSize:"11px",color:r("link-fg"),textDecoration:"none",whiteSpace:"nowrap"},children:n.action.visit}),d&&t.jsx("button",{onClick:()=>s(!o),style:{padding:"0 6px",fontSize:"11px",border:"none",background:"transparent",color:r("desc-fg"),cursor:"pointer",lineHeight:1.4},children:o?"▲":"▼"})]}),d&&o&&t.jsx("div",{style:{padding:"6px 10px",border:`1px solid ${r("widget-border")}`,borderRadius:"5px",display:"flex",flexWrap:"wrap",gap:"4px",maxWidth:"360px"},children:l.map(x=>{const j=x.status==="missing";return x.url&&!j?t.jsx("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",padding:"1px 5px",fontSize:"11px",borderRadius:"3px",border:`1px solid ${r("widget-border")}`,color:r("link-fg"),textDecoration:"none"},children:x.volume},x.volume):t.jsx("span",{style:{display:"inline-block",padding:"1px 5px",fontSize:"11px",color:r(j?"missing-fg":"desc-fg"),textDecoration:j?"line-through":"none",opacity:j?.6:1},children:x.volume},x.volume)})})]})},Wl=({indexSource:e,syncConfig:n,variant:i="index-browser",onSwitchMode:o,onToggleDraft:s,onConfigurePath:a,onSelectFolder:l})=>{const d=Ae(),c=e==="local",p=(n==null?void 0:n.isDraft)??!0,h=(n==null?void 0:n.repoPath)||"",m=h?h.split(/[/\\]/).pop()||h:"",u={display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"8px",fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"opacity 0.2s",border:"none",background:r("primary-soft"),color:r("primary")},f={onMouseOver:j=>j.currentTarget.style.opacity="0.8",onMouseOut:j=>j.currentTarget.style.opacity="1"},x=t.jsxs("div",{onClick:s,title:p?d.mode.switchToOfficial:d.mode.switchToDraft,style:{...u,background:r(p?"warning":"success"),color:r("on-color-fg")},...f,children:[t.jsx("span",{children:p?"📝":"📚"}),t.jsx("span",{children:p?"draft":"official"})]});return i==="index-browser"?c?t.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[x,t.jsxs("div",{onClick:o,title:d.mode.switchToSync,style:u,...f,children:[t.jsx("span",{children:"📁"}),t.jsx("span",{children:d.mode.localMode}),t.jsx("span",{style:{opacity:.6,marginLeft:"4px"},children:"⇄"})]}),t.jsxs("div",{onClick:l,title:h||d.mode.selectFolder,style:{...u,paddingLeft:"8px",paddingRight:"8px"},...f,children:[t.jsx("span",{children:"📂"}),m&&t.jsx("span",{style:{fontSize:"11px",opacity:.9},children:m})]})]}):t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x,t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t.jsxs("div",{onClick:o,title:d.mode.switchToLocal,style:u,...f,children:[t.jsx("span",{children:"🌐"}),t.jsx("span",{children:d.mode.syncMode}),t.jsx("span",{style:{opacity:.6,marginLeft:"4px"},children:"⇄"})]}),t.jsx("div",{onClick:a,title:m||d.mode.configurePath,style:{...u,background:"transparent",padding:"6px",fontSize:"12px"},...f,children:t.jsx("span",{children:"⚙️"})})]})]}):t.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[t.jsxs("div",{onClick:o,title:c?d.mode.switchToGithub:d.mode.switchToLocal,style:u,...f,children:[t.jsx("span",{children:c?"📁":"🌐"}),t.jsx("span",{children:c?d.mode.localMode:d.mode.githubSync}),t.jsx("span",{style:{opacity:.6},children:"⇄"})]}),c&&t.jsxs("div",{onClick:l,title:h||d.mode.selectFolder,style:{...u,paddingLeft:"8px",paddingRight:"8px",minWidth:h?"100px":"auto",justifyContent:"space-between"},...f,children:[t.jsx("span",{children:"📂"}),m&&t.jsx("span",{style:{fontSize:"11px",opacity:.9},children:m})]}),!c&&m&&t.jsxs("div",{style:{...u,background:r("mode-active-bg"),color:r("on-color-fg"),cursor:"default"},title:h,children:[t.jsx("span",{children:"📂"}),t.jsx("span",{style:{fontSize:"11px"},children:m})]})]})},Li="bim-search-history",Ks=10,Xs=8;function Dn(){try{const e=localStorage.getItem(Li);return e?JSON.parse(e):[]}catch{return[]}}function Fl(e){try{const n=Dn().filter(i=>i!==e);n.unshift(e),n.length>Ks&&(n.length=Ks),localStorage.setItem(Li,JSON.stringify(n))}catch{}}function hm(e){try{const n=Dn().filter(i=>i!==e);localStorage.setItem(Li,JSON.stringify(n))}catch{}}function gm(){try{localStorage.removeItem(Li)}catch{}}const Hl=({transport:e,value:n,onChange:i,onSearch:o,onEntrySelect:s,placeholder:a})=>{const l=Ae(),d=a??l.search.placeholder,c={work:l.indexType.work,book:l.indexType.book,collection:l.indexType.collection,entity:l.indexType.entity},[p,h]=g.useState(!1),[m,u]=g.useState([]),[f,x]=g.useState(-1),[j,y]=g.useState(Dn),S=g.useRef(null),b=g.useRef(null),w=g.useRef(null),v=g.useRef(!1);g.useEffect(()=>{x(-1);const N=n.trim();if(!N){u(j.map(F=>({type:"history",text:F})));return}if(!e.searchAll){u([]);return}let E=!1;const W=setTimeout(()=>{e.searchAll(N,Xs).then(F=>{if(E)return;const A=[...F.works,...F.books,...F.collections,...F.entities??[]];u(A.slice(0,Xs).map(V=>({type:"entry",text:V.title||V.id,entry:V})))}).catch(()=>{E||u([])})},80);return()=>{E=!0,clearTimeout(W)}},[n,j,e]),g.useEffect(()=>{const N=E=>{w.current&&!w.current.contains(E.target)&&h(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),g.useEffect(()=>{const N=E=>{var W,F;if(E.key==="/"&&document.activeElement!==S.current){const A=(W=document.activeElement)==null?void 0:W.tagName;if(A==="INPUT"||A==="TEXTAREA"||A==="SELECT")return;E.preventDefault(),(F=S.current)==null||F.focus()}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[]);const k=g.useCallback(N=>{N.trim()&&(Fl(N.trim()),y(Dn())),o(N),h(!1)},[o]),z=g.useCallback(N=>{N.type==="history"?(i(N.text),k(N.text)):N.entry&&(s?(s(N.entry),h(!1)):(i(N.text),k(N.text)))},[i,k,s]),C=g.useCallback(N=>{if(!p||m.length===0){N.key==="Enter"&&k(n);return}switch(N.key){case"ArrowDown":N.preventDefault(),x(E=>(E+1)%m.length);break;case"ArrowUp":N.preventDefault(),x(E=>(E-1+m.length)%m.length);break;case"Enter":N.preventDefault(),f>=0&&f<m.length?z(m[f]):k(n);break;case"Escape":N.preventDefault(),h(!1);break}},[p,m,f,n,k,z]),_=g.useCallback((N,E)=>{E.stopPropagation(),hm(N),y(Dn()),u(W=>W.filter(F=>!(F.type==="history"&&F.text===N)))},[]),I=g.useCallback(N=>{N.stopPropagation(),gm(),y([]),u([])},[]);g.useEffect(()=>{if(f>=0&&b.current){const N=b.current.children;N[f]&&N[f].scrollIntoView({block:"nearest"})}},[f]);const T=!n.trim()&&j.length>0;return t.jsxs("div",{ref:w,style:{position:"relative",flex:1},children:[t.jsx("input",{ref:S,type:"text",placeholder:d,value:n,onChange:N=>{i(N.target.value),h(!0)},onCompositionStart:()=>{v.current=!0},onCompositionEnd:()=>{v.current=!1},onFocus:()=>{h(!0)},onKeyDown:C,style:{width:"100%",padding:"8px 12px",border:`1px solid ${r("input-border")}`,borderRadius:"6px",background:r("input-bg"),color:r("input-fg"),fontSize:"14px",boxSizing:"border-box"}}),p&&m.length>0&&t.jsxs("div",{ref:b,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:r("input-bg"),border:`1px solid ${r("widget-border")}`,borderRadius:"6px",boxShadow:r("shadow-dropdown"),zIndex:100,maxHeight:"320px",overflow:"auto"},children:[T&&t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 12px",fontSize:"11px",color:r("desc-fg"),borderBottom:`1px solid ${r("widget-border")}`},children:[t.jsx("span",{children:l.search.history}),t.jsx("button",{onClick:I,style:{border:"none",background:"transparent",color:r("desc-fg"),cursor:"pointer",fontSize:"11px",padding:"0 4px"},children:l.search.clearAll})]}),m.map((N,E)=>t.jsxs("div",{onClick:()=>z(N),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",cursor:"pointer",fontSize:"13px",color:r("fg"),background:E===f?r("list-active-bg"):"transparent"},children:[t.jsx("span",{style:{fontSize:"12px",opacity:.5,width:"16px",textAlign:"center"},children:N.type==="history"?"🕐":"🔍"}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.text}),N.entry&&t.jsxs("span",{style:{fontSize:"11px",color:r("desc-fg"),flexShrink:0},children:[c[N.entry.type],N.entry.edition&&` · ${N.entry.edition}`,N.entry.author&&` · ${N.entry.author}`]}),N.type==="history"&&t.jsx("button",{onClick:W=>_(N.text,W),style:{border:"none",background:"transparent",color:r("desc-fg"),cursor:"pointer",fontSize:"12px",padding:"0 2px",lineHeight:1},title:l.action.remove,children:"×"})]},`${N.type}-${N.text}-${E}`))]})]})},Tn=({type:e,size:n=9})=>t.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:n,height:n,borderRadius:1,flex:"none",background:r(`type-${e}`),verticalAlign:"middle"}}),Dl=["西漢","東漢","三國","西晉","東晉","南北朝","南朝","北朝","隋","唐","五代","北宋","南宋","宋","遼","西夏","金","元","南明","明","清","民國","日本","朝鮮","高麗","越南","琉球","西汉","东汉","西晋","东晋","南北朝","南朝","北朝","辽","民国","朝鲜","高丽"],fm={北宋:"宋",南宋:"宋",西漢:"漢",東漢:"漢",西汉:"漢",东汉:"漢",西晉:"晉",東晉:"晉",西晋:"晉",东晋:"晉",南明:"明",民国:"民國",辽:"遼",朝鲜:"朝鮮",高丽:"高麗",南北朝:"南北朝",南朝:"南北朝",北朝:"南北朝"};function ct(e){return fm[e]??e}const kn=[{pattern:/欽定四庫全書薈要|摛藻堂/,era:"清",reign:"乾隆"},{pattern:/欽定四庫全書|四庫全書|文淵閣|文瀾閣|文溯閣|文津閣|文匯閣|文宗閣|文瀾閣/,era:"清",reign:"乾隆"},{pattern:/钦定四库全书|四库全书|文渊阁|文澜阁|文溯阁|文津阁/,era:"清",reign:"乾隆"},{pattern:/武英殿聚珍|聚珍版/,era:"清",reign:"乾隆"},{pattern:/武英殿/,era:"清"},{pattern:/百衲本|涵芬樓|涵芬楼|商務印書館|商务印书馆|中華書局|中华书局/,era:"民國"},{pattern:/汲古閣|汲古阁/,era:"明",reign:"崇禎"}],wn={熹平:172,建安:196,黃初:220,正始:240,廣政:938,太康:280,永和:345,開皇:581,貞觀:627,開元:713,天寶:742,貞元:785,元和:806,開成:836,會昌:841,咸通:860,建隆:960,太平興國:976,咸平:998,天禧:1017,慶曆:1041,皇祐:1049,嘉祐:1056,治平:1064,熙寧:1068,元豐:1078,元祐:1086,紹聖:1094,崇寧:1102,大觀:1107,政和:1111,宣和:1119,建炎:1127,紹興:1131,隆興:1163,乾道:1165,淳熙:1174,紹熙:1190,慶元:1195,嘉泰:1201,開禧:1205,嘉定:1208,寶慶:1225,紹定:1228,端平:1234,嘉熙:1237,淳祐:1241,寶祐:1253,開慶:1259,景定:1260,咸淳:1265,大定:1161,明昌:1190,至元:1264,大德:1297,皇慶:1312,延祐:1314,泰定:1324,天曆:1328,至順:1330,至正:1341,洪武:1368,永樂:1403,宣德:1426,正統:1436,景泰:1450,天順:1457,成化:1465,弘治:1488,正德:1506,嘉靖:1522,隆慶:1567,萬曆:1573,泰昌:1620,天啟:1621,崇禎:1628,弘光:1645,隆武:1645,紹武:1646,永曆:1647,順治:1644,康熙:1662,雍正:1723,乾隆:1736,嘉慶:1796,道光:1821,咸豐:1851,同治:1862,光緒:1875,宣統:1909,慶長:1596,寬永:1624,正保:1644,慶安:1648,承應:1652,明曆:1655,萬治:1658,寬文:1661,延寶:1673,天和:1681,貞享:1684,元祿:1688,寶永:1704,享保:1716,元文:1736,寬保:1741,延享:1744,寬延:1748,寶曆:1751,明和:1764,安永:1772,天明:1781,寬政:1789,享和:1801,文化:1804,文政:1818,天保:1830,弘化:1844,嘉永:1848,安政:1854,萬延:1860,文久:1861,元治:1864,慶應:1865,明治:1868,大正:1912,昭和:1926,天正:1573,文祿:1592,永祿:1558,天文:1532},Ul={"唐|元和":806,"日本|元和":1615,"明|正德":1506,"日本|正德":1711};function Ai(e){const n=e.match(/^\s*(\d{3,4})(?:\s*[-–—~至]\s*(\d{3,4}))?/);if(!n)return;const i=parseInt(n[1],10);if(i<100||i>2100)return;const o=n[2]?parseInt(n[2],10):void 0;return{from:i,to:o!=null&&o>=i&&o<=2100?o:void 0}}function xm(e){return e>=1950?"":e>=1912?"民國":e>=1645?"清":e>=1368?"明":e>=1279?"元":e>=960?"宋":e>=907?"五代":e>=618?"唐":e>=581?"隋":e>=420?"南北朝":e>=265?"晉":e>=220?"三國":e>=-202?"漢":""}const bm=/末[宋元明清]初|[約约]|推定|推算|前後|前后|左右|[前中後后末]期/,Zs={曹魏:"三國",蜀漢:"三國",東吳:"三國",前蜀:"五代",後蜀:"五代"};function jo(e){const n=e.trim().replace(/[代朝]$/,"");for(const s of Object.keys(Zs))if(n.startsWith(s))return Zs[s];const i=ct(n);if(an[i]!=null)return i;const o=Ut(n);if(o&&n.length<=o.length+1)return ct(o)}function sn(e,n){if(n){const i=Ul[`${n}|${e}`];if(i!=null)return i}return wn[e]}const ym=1911;function jm(e){const n=wn[e];if(n==null)return;const i=At[e];let o;for(const[s,a]of Object.entries(wn))At[s]===i&&a>n&&(o==null||a<o)&&(o=a);return o!=null?o-1:void 0}const vm={零:0,"〇":0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9,十:10,廿:20,卅:30,元:1};function _i(e){if(!e)return;if(/^\d+$/.test(e))return parseInt(e,10);let n=0,i=0,o=!1;for(const a of e){const l=vm[a];if(l===void 0)return;o=!0,a==="十"?i=(i||1)*10:a==="廿"||a==="卅"?(n+=l,i=0):i>=10?(n+=i+l,i=0):i=i*10+l}const s=n+i;return o&&s>0?s:void 0}function Ut(e){for(const n of Dl)if(e.startsWith(n))return n}const At={};{const e=(n,i)=>{for(const o of i)At[o]=n};e("東漢",["熹平","建安"]),e("三國",["黃初","正始"]),e("五代",["廣政"]),e("西晉",["太康"]),e("東晉",["永和"]),e("隋",["開皇"]),e("唐",["貞觀","開元","天寶","貞元","元和","開成","會昌","咸通"]),e("宋",["建隆","太平興國","咸平","天禧","慶曆","皇祐","嘉祐","治平","熙寧","元豐","元祐","紹聖","崇寧","大觀","政和","宣和","建炎","紹興","隆興","乾道","淳熙","紹熙","慶元","嘉泰","開禧","嘉定","寶慶","紹定","端平","嘉熙","淳祐","寶祐","開慶","景定","咸淳"]),e("金",["大定","明昌"]),e("元",["至元","大德","皇慶","延祐","泰定","天曆","至順","至正"]),e("明",["洪武","永樂","宣德","正統","景泰","天順","成化","弘治","正德","嘉靖","隆慶","萬曆","泰昌","天啟","崇禎","弘光","隆武","紹武","永曆"]),e("清",["順治","康熙","雍正","乾隆","嘉慶","道光","咸豐","同治","光緒","宣統"]),e("日本",["慶長","寬永","正保","慶安","承應","明曆","萬治","寬文","延寶","天和","貞享","元祿","寶永","享保","元文","寬保","延享","寬延","寶曆","明和","安永","天明","寬政","享和","文化","文政","天保","弘化","嘉永","安政","萬延","文久","元治","慶應","明治","大正","昭和","天正","文祿","永祿","天文"])}function ln(e,n){const i=n==="北宋"||n==="南宋"?"宋":n;for(const o of Object.keys(wn))if(e.includes(o)&&!(i&&At[o]&&At[o]!==i&&Ul[`${i}|${o}`]==null))return o}function Xn(e){var l,d,c;const n={era:"",reign:"",source:"none"},i=e.dating;if(i!=null&&i.era||i!=null&&i.reign)return{era:i.era??"",reign:i.reign??"",source:i.certainty==="attested"?"catalog":"edition"};const o=(l=e.lineage)==null?void 0:l.year_text;if(o){const p=Ut(o)??"";return{era:ct(p),reign:ln(o,p)??"",source:"lineage"}}const s=(d=e.publication_info)==null?void 0:d.year;if(s){const p=Ai(s);if(p)return{era:xm(p.from),reign:"",source:"publication"};const h=Ut(s)??jo(s)??((c=kn.find(f=>f.pattern.test(s)))==null?void 0:c.era)??"",m=ln(s,h)??"",u=h||(m?At[m]??"":"");if(u||m)return{era:ct(u),reign:m,source:"publication"}}const a=e.edition||e.title||"";if(a){const p=Ut(a);if(p)return{era:ct(p),reign:ln(a,p)??"",source:"edition"};const h=kn.find(m=>m.pattern.test(a));if(h)return{era:ct(h.era),reign:ln(a,h.era)??h.reign??"",source:"edition"}}return n}function Mi(e){var o,s,a,l,d,c,p,h,m;if(((o=e.dating)==null?void 0:o.year)!=null)return e.dating.year;if(typeof((s=e.lineage)==null?void 0:s.year)=="number")return e.lineage.year;const n=(a=e.publication_info)==null?void 0:a.year;if(n){const u=Ai(n);if(u)return u.from}const i=[(l=e.lineage)==null?void 0:l.year_text,(d=e.publication_info)==null?void 0:d.year,e.edition,e.edition?void 0:e.title].filter(Boolean);for(const u of i){const f=((c=e.publication_info)==null?void 0:c.year)||((p=e.lineage)==null?void 0:p.year_text);if(f&&u!==f&&(Ut(f)||jo(f)))break;const x=u.match(/(?:^|[^\d第卷冊册頁页])(\d{3,4})\s*年/)??u.match(/[((](\d{3,4})\s*(?:[-–—~至]\s*\d{3,4})?\s*年?[))]/);if(x){const w=parseInt(x[1],10);if(w>=100&&w<=2100)return w}const j=u.match(/民[國国]\s*([零〇一二三四五六七八九十廿卅百元\d]+)\s*年/);if(j){const w=Ut(u);if(!w||ct(w)==="民國"){const k=_i(j[1]);if(k!=null&&k>=1&&k<=120)return ym+k}}const y=Ut(u)??((h=kn.find(w=>w.pattern.test(u)))==null?void 0:h.era),S=y?ct(y):void 0,b=ln(u,S)??(Ut(u)||(m=kn.find(w=>w.pattern.test(u)))==null?void 0:m.reign);if(b){const w=sn(b,S);if(w==null)continue;const v=u.indexOf(b),k=v>=0?u.slice(v+b.length):"",z=k.match(/^([零〇一二三四五六七八九十廿卅元]+)年/)??k.match(/^[甲乙丙丁戊己庚辛壬癸][子丑寅卯辰巳午未申酉戌亥]\s*[((]\s*([零〇一二三四五六七八九十廿卅元]+)\s*年?\s*[))]/),C=z?_i(z[1]):void 0;return w+(C?C-1:0)}}}function vo(e){var l,d,c,p,h,m;const n=(l=e.dating)==null?void 0:l.year_range;if(n&&n.length===2)return{from:n[0],to:n[1]};const i=(d=e.lineage)==null?void 0:d.year_range;if(i&&i.length===2)return{from:i[0],to:i[1]};const o=(c=e.lineage)==null?void 0:c.year_text;if(o){const u=o.match(/([宋元明清])\s*末\s*([宋元明清])\s*初/);if(u){const f=Pr[ct(u[1])],x=an[ct(u[2])];if(f!=null&&x!=null)return{from:Math.min(f,x)-20,to:Math.max(f,x)+40}}}const s=(p=e.publication_info)==null?void 0:p.year;if(s){const u=Ai(s);if((u==null?void 0:u.to)!=null)return{from:u.from,to:u.to};const f=s.match(/([宋元明清])\s*末\s*([宋元明清])\s*初/);if(f){const x=Pr[ct(f[1])],j=an[ct(f[2])];if(x!=null&&j!=null)return{from:Math.min(x,j)-20,to:Math.max(x,j)+40}}}const a=[(h=e.publication_info)==null?void 0:h.year,e.edition,e.title].filter(Boolean);for(const u of a){if(!/[間间]/.test(u))continue;const f=Ut(u)??jo(u)??((m=kn.find(y=>y.pattern.test(u)))==null?void 0:m.era),x=f?ct(f):void 0,j=[];for(const y of Object.keys(wn))u.includes(y)&&(x&&At[y]&&At[y]!==x||sn(y,x)!=null&&j.push(y));if(j.length===0){const y=u.match(/([一-鿿])([一-鿿])[間间]/);if(y&&x){for(const S of[y[1],y[2]])for(const b of Object.keys(wn))if(At[b]===x&&!(b[0]!==S&&b[b.length-1]!==S)&&sn(b,x)!=null){j.push(b);break}}}if(j.length>0){const y=j.map(v=>sn(v,x)).filter(v=>v!=null),S=Math.min(...y),b=j.reduce((v,k)=>sn(v,x)>=sn(k,x)?v:k),w=jm(b)??fr(x??"")??Math.max(...y);return{from:S,to:w>S?w:fr(x??At[b]??"")??S}}if(x&&an[x]!=null)return{from:an[x],to:fr(x)??an[x]}}}const an={漢:-202,三國:220,晉:265,南北朝:420,隋:581,唐:618,五代:907,宋:960,遼:916,西夏:1038,金:1115,元:1271,明:1368,清:1644,民國:1912,日本:1600,朝鮮:1392,高麗:918,越南:1400,琉球:1400},km=[{re:/影印|景印|影鈔|影钞|景鈔|景钞/,relation:"影印"},{re:/翻刻|覆刻|覆刊|翻雕|重刊|重雕/,relation:"翻刻"},{re:/傳鈔|传钞|傳抄|传抄/,relation:"傳鈔"},{re:/配補|配补|百衲/,relation:"配補"},{re:/據.{0,12}本|据.{0,12}本/,relation:"據刊"}],wm=/修補|修补|遞修|递修|[明清元宋]修本|後代修|后代修/,Js=/約|约|疑|傳為|传为|舊題|旧题|相傳|相传|待考|未詳|未详|\(疑\)|(疑)/;function Qs(e,n){for(const i of Dl){const o=e.indexOf(i);if(o<0)continue;if(i.length===1){const c=e[o+1]??"";if(!/[刻刊寫写鈔钞抄印本間间初末年時时代人臧藏]/.test(c)&&!ln(e.slice(o),ct(i)))continue}const s=ct(i);if(s===n)continue;const a=e.slice(o),l=ln(a,s)??"";let d;if(l){const c=sn(l,s);if(c!=null){const h=a.slice(a.indexOf(l)+l.length).match(/^([零〇一二三四五六七八九十廿卅元]+)年/),m=h?_i(h[1]):void 0;d=c+(m?m-1:0)}}return{era:s,reign:l,year:d}}for(const i of kn)if(i.pattern.test(e))return{era:ct(i.era),reign:i.reign??""}}function Sm(e){var S,b,w,v,k;const n=Xn(e),i=((S=e.publication_info)==null?void 0:S.year)??"",o=i?Ai(i):void 0;if(!n.era&&!n.reign&&!o)return;const s=e.edition||e.title||"",a=/[間间]/.test(s),l=((b=e.lineage)==null?void 0:b.year_text)??"",d=/末[宋元明清]初|[約约]|推定|前後|前后|左右/.test(l),c=n.source==="publication"&&bm.test(i),p=n.source==="publication"&&/[間间]/.test(i),h=l.match(/([宋元明清])[^、,,]*?[((](\d{3,4})[))][^、,,]*?原刻/);let m;a||d||c||p?m=void 0:h?m=parseInt(h[2],10):m=Mi(e);const u=m==null?vo(e):void 0;let f;n.source==="publication"&&(c||Js.test(i))?f="uncertain":n.source==="lineage"||n.source==="publication"?f="attested":Js.test(s)||!n.reign&&m==null?f="uncertain":f="inferred";const x=n.source==="edition"?`題名「${s}」`:n.source==="lineage"?`版本傳承著錄「${((w=e.lineage)==null?void 0:w.year_text)??((v=e.lineage)==null?void 0:v.year)??""}」`:`出版著錄「${((k=e.publication_info)==null?void 0:k.year)??""}」`,j={era:n.era,reign:n.reign,year:m,yearRange:u,certainty:f,source:n.source==="edition"?"edition":"catalog",basis:x};if(h){const z=l.match(/[、,,]\s*([宋元明清])/);z&&z[1]!==j.era&&(j.laterRepair={era:z[1]})}if(!j.laterRepair&&wm.test(s)){const z=s.match(/([宋元明清])\s*(?:初|末)?\s*(?:修補|修补|遞修|递修|修)/);z&&z[1]!==n.era&&(j.laterRepair={era:z[1]})}const y=km.find(z=>z.re.test(s));if(y){const z=s.search(y.re),C=s.slice(z),_=Qs(C,n.era)??Qs(s,n.era);_&&(j.basedOn={era:_.era,reign:_.reign,year:_.year,relation:y.relation})}return j}const Pr={漢:220,三國:280,晉:420,南北朝:589,隋:618,唐:907,五代:960,宋:1279,遼:1125,西夏:1227,金:1234,元:1368,明:1662,清:1911,民國:1975,日本:1912,朝鮮:1897,高麗:1392,越南:1945,琉球:1879};function fr(e){return Pr[e]}function $i(e){const n=Mi(e);if(n!=null)return n;const i=vo(e);if(i)return i.from;const o=Xn(e).era;return o?an[o]:void 0}const ea=["漢","三國","晉","南北朝","隋","唐","五代","宋","遼","西夏","金","元","明","清","民國","日本","朝鮮","高麗","越南","琉球"];function Br(e){const n=ea.indexOf(e);return n===-1?ea.length:n}function _m(e){const n={belongsTo:[],collected:[],contains:[],derivative:[],studies:[],related:[]};for(const s of e){const a=s.relation;a==="part_of"?n.belongsTo.push(s):a==="collected_in"?n.collected.push(s):a==="has_part"||a==="contains_text_of"?n.contains.push(s):a==="text_carried_by"||a==="studied_by"||a==="derived_from"||a==="followed_by"||a==="has_adaptation"?n.derivative.push(s):a==="studies"||a==="preceded_by"?n.studies.push(s):n.related.push(s)}const i=[],o=(s,a)=>{n[s].length&&i.push({key:s,labelKey:a,items:n[s]})};return o("belongsTo","belongsToWork"),o("collected","collectedIn"),o("contains","containedWorks"),o("derivative","derivativeWorks"),o("studies","studies"),o("related","relatedWorks"),i}function ko(e,n){const i=go(e||[]),o=new Map,s=[];for(const p of i)p.group?(o.has(p.group)||o.set(p.group,[]),o.get(p.group).push(p)):s.push(p);for(const p of o.values())p.sort((h,m)=>{const u=f=>f.group_role==="origin"?0:f.group_role==="mirror"?1:2;return u(h)-u(m)});const a={text:[],image:[],textImage:[],physical:[]};for(const p of s){const h=Vt(p),m=h.includes("text"),u=h.includes("image");m&&u?a.textImage.push(p):m?a.text.push(p):u?a.image.push(p):a.physical.push(p)}const d=["text","image","textImage","physical"].filter(p=>a[p].length>0).map(p=>({key:p,items:a[p]})),c=[...o.entries()].map(([p,h])=>{var m,u;return{key:p,label:((m=n==null?void 0:n[p])==null?void 0:m.label)||p,description:(u=n==null?void 0:n[p])==null?void 0:u.description,items:h}});return{buckets:d,mirrors:c,total:i.length}}function Pi(e,n=Nn("zh-Hant")){const i=[],o=e.metadata||{};o.edition&&i.push(String(o.edition)),e.source_label&&i.push(e.source_label),e.details&&i.push(e.details);const s=Ri(e);return s&&s.expected>0&&i.push(s.missing>0?n("detail.volumeStatsMissing",{found:s.found,expected:s.expected,missing:s.missing}):n("detail.volumeStats",{found:s.found,expected:s.expected})),o.version&&i.push(String(o.version)),i.join(" · ")}function Vl(e,n){if(Pi(e)||n.filter(o=>o.name===e.name).length<2)return"";try{const o=new URL(e.url),s=o.searchParams.get("res")||o.searchParams.get("id");if(s)return s;const a=o.pathname.split("/").filter(Boolean).pop();if(a)return decodeURIComponent(a)}catch{}return""}const $m="同版";function Cm(e){const n=e==null?void 0:e.metadata;return((n==null?void 0:n.item_id)||(n==null?void 0:n.call_number)||"").trim()||void 0}function zm(e){var n;for(const i of((n=e.lineage)==null?void 0:n.related_to)??[]){const o=i.ref??i.book_id;if(i.relation===$m&&o&&o!==e.id)return o}}function Nm(e){const n=new Map(e.map(a=>[a.id,a])),i=a=>{const l=n.get(a);return!!l&&!l.copyOf},o=new Map;for(const a of e)if(a.copyOf&&i(a.copyOf)){const l=o.get(a.copyOf)??[];l.push(a),o.set(a.copyOf,l)}if(o.size===0)return e;const s=[];for(const a of e){if(a.copyOf&&i(a.copyOf))continue;const l=o.get(a.id);if(!l){s.push(a);continue}const d=[...l].sort((c,p)=>(c.callNumber??c.id).localeCompare(p.callNumber??p.id));s.push({...a,copies:d,hasImage:a.hasImage||d.some(c=>c.hasImage)})}return s}function Gl(e,n){var a,l;const i=e.resources||[],o=[],s=[];for(const d of i){const c=Vt(d);c.includes("image")&&o.push(d),c.includes("physical")&&s.push(d)}return{id:e.id,name:e.edition||e.title||e.id,era:Xn(e),year:Mi(e),sortYear:$i(e),images:o,holders:s,locationName:(a=e.current_location)==null?void 0:a.name,callNumber:Cm(s[0]),copyOf:zm(e),summary:e.summary,important:Tm(e.id,n),group:(l=n==null?void 0:n.node_groups)==null?void 0:l[e.id],hasImage:o.length>0}}function Tm(e,n){var d,c;if(!n)return!1;const i=n.default_collection;if(!i)return!1;const o=(d=n.collections)==null?void 0:d[i];if(((o==null?void 0:o.book_ids)??(i==="core"?n.core_books??[]:[])).includes(e))return!0;const a=(o==null?void 0:o.groups)??[],l=(c=n.node_groups)==null?void 0:c[e];return!!l&&a.includes(l)}function Yl(e,n,i={}){const o=new Set((n==null?void 0:n.excluded_books)??[]),s=Nm(e.filter(c=>!o.has(c.id)).map(c=>Gl(c,n)));let a=s;i.era&&(a=a.filter(c=>c.era.era===i.era)),i.scanOnly&&(a=a.filter(c=>c.hasImage)),i.sort==="year"?a=a.map((c,p)=>({r:c,i:p})).sort((c,p)=>{const h=c.r.sortYear,m=p.r.sortYear;return h!=null&&m!=null?h-m||c.i-p.i:h!=null?-1:m!=null?1:c.i-p.i}).map(c=>c.r):a=a.map((c,p)=>({r:c,i:p})).sort((c,p)=>{const h=m=>(m.important?0:1)*2+(m.hasImage?0:1);return h(c.r)-h(p.r)||c.i-p.i}).map(c=>c.r);const d=[...new Set(s.map(c=>c.era.era).filter(Boolean))].sort((c,p)=>Br(c)-Br(p));return{rows:a,allRows:s,eras:d,hasInferredEra:s.some(c=>c.era.source==="edition")}}function Im(e,n){var y,S;if(!n||!n.default_collection||!n.node_groups)return{useGrouping:!1,coreIds:e,groupedIds:[]};const i=(y=n.collections)==null?void 0:y[n.default_collection],o=(i==null?void 0:i.groups)??[],s=(i==null?void 0:i.book_ids)??[],a=o.length>0||s.length>0,l=!a&&n.default_collection==="core"&&Array.isArray(n.core_books)?n.core_books:[];if(!a&&l.length===0)return{useGrouping:!1,coreIds:e,groupedIds:[]};const d=new Set(o),c=new Set([...s,...l]),p=b=>{if(c.has(b))return!0;const w=n.node_groups[b];return w!=null&&d.has(w)},h=[],m=new Map,u=[];for(const b of e)if(!((S=n.excluded_books)!=null&&S.includes(b)))if(p(b))h.push(b);else{const w=n.node_groups[b];w?(m.has(w)||m.set(w,[]),m.get(w).push(b)):u.push(b)}if(u.length+[...m.values()].reduce((b,w)=>b+w.length,0)<3)return{useGrouping:!1,coreIds:e,groupedIds:[]};const x=new Map((n.groups??[]).map(b=>[b.id,b])),j=[...m.entries()].map(([b,w])=>{const v=x.get(b);return{id:b,label:(v==null?void 0:v.label)??b,description:v==null?void 0:v.description,ids:w}});return u.length>0&&j.push({id:"__other__",label:"其他版本",description:void 0,ids:u}),{useGrouping:!0,coreIds:h,groupedIds:j}}const ql=["撰","編","注","校","譯","繪","其他"],Rm=[{cls:"譯",re:/譯|译/},{cls:"繪",re:/繪|绘|畫|画|圖|图|篆|摹/},{cls:"校",re:/^(?!.*[編编輯辑纂])(?=.*(校|訂|订|勘|審|审|考異)).*/},{cls:"注",re:/注|註|疏|箋|笺|解|釋|释|音|義疏|章句|評|评|批|論|论|答/},{cls:"編",re:/編|编|輯|辑|纂|集|選|选|錄|录|彙|汇|續|续|補|补|刪|删|修|次|定/},{cls:"撰",re:/撰|譔|作|著|述|製|制|書|书|記|记|傳|传|題|题|序|跋|讚|贊|赞|頌|颂/}];function wo(e){if(!e||!e.trim())return"撰";const n=e.replace(/[\s-]/g,"");if(!n)return"撰";for(const{cls:i,re:o}of Rm)if(o.test(n))return i;return"其他"}function So(e){if(!e)return"";const n=e.trim();return!n||!/[一-鿿]/.test(n)?"":n}function Kl(e,n="全部"){const i=new Map;for(const s of e){const a=wo(s);i.set(a,(i.get(a)??0)+1)}const o=[{cls:"全部",label:n,count:e.length}];for(const s of ql){const a=i.get(s);a&&o.push({cls:s,label:s,count:a})}return o.length>2?o:[]}function _o(e){return(e._books??[]).map(n=>n.id).filter(n=>typeof n=="string")}function $o(e){const n=e._classifications??[],i=n.find(o=>o.scheme==="zongmu")??n[0];if(i)return{l1:i.l1??"",l2:i.l2??"",l3:i.l3??"",l4:i.l4??"",...i.source?{source:i.source}:{}}}function Xl(e){const n=e._members??[],i=typeof e._member_count=="number"?e._member_count:n.length;return{works:n.filter(o=>o.t==="work").map(o=>({id:o.id,title:o.title??"",volumes:Un(o.vol)})),bookIds:n.filter(o=>o.t!=="work").map(o=>o.id).filter(o=>typeof o=="string"),total:i,truncated:i>n.length}}function Em(e){var n;return(e==null?void 0:e._member_count)||((n=e==null?void 0:e._members)==null?void 0:n.length)||0}function Zl(e,n,i){if(n&&n.books&&n.books.length>0){const l=n.books.map(c=>({id:c.work_id||c.book_id||void 0,title:c.title,section:c.section,volumes:c.volumes||[],subItems:c.sub_items,edition:c.edition,found:c.found_volumes,expected:c.expected_volumes})),d=[...new Set(l.map(c=>c.section).filter(Boolean))];return{rows:l,source:"catalog",sections:d,totalVolumes:n.total_volumes}}const{works:o,bookIds:s}=Xl(e);return o.length>0?{rows:o.map(d=>({id:d.id,title:d.title,volumes:d.volumes})),source:"works",sections:[]}:{rows:s.map(l=>{var d,c;return{id:l,title:((d=i==null?void 0:i.get(l))==null?void 0:d.title)||l,edition:(c=i==null?void 0:i.get(l))==null?void 0:c.edition,volumes:[]}}),source:"books",sections:[]}}function Un(e){if(e==null)return[];if(typeof e=="number")return[e];if(Array.isArray(e))return e.filter(n=>typeof n=="number");if(typeof e=="string"){const n=e.match(/^(\d+)\s*[-–~]\s*(\d+)$/);if(n){const[i,o]=[parseInt(n[1]),parseInt(n[2])];return Array.from({length:Math.max(0,o-i+1)},(s,a)=>i+a)}return e.split(/[,、]/).map(i=>parseInt(i.trim())).filter(i=>!isNaN(i))}return[]}function Bi(e,n="冊"){if(e.length===0)return"";if(e.length===1)return`${e[0]}`;const i=[...e].sort((a,l)=>a-l),o=i[0],s=i[i.length-1];return s-o+1===i.length?`${o}–${s}`:i.length<=3?i.join(", "):`${o}–${s} (${i.length}${n})`}const Lm=["〇","一","二","三","四","五","六","七","八","九"],ta=["","十","百","千"];function In(e){if(!Number.isInteger(e)||e<=0)return"";if(e>=1e8)return String(e);if(e<1e4)return xr(e,!0);const n=Math.floor(e/1e4),i=e%1e4;let o=xr(n,!0)+"萬";return i>0&&(o+=(i<1e3?"〇":"")+xr(i,!1)),o}function xr(e,n){const i=String(e),o=i.length;let s="",a=!1;for(let l=0;l<o;l++){const d=parseInt(i[l]),c=o-1-l;d===0?a=!0:(a&&s&&(s+="〇"),a=!1,n&&d===1&&c===1&&l===0?s+=ta[c]:s+=Lm[d]+ta[c])}return s}function Am(e){return e==null?"":typeof e=="string"?e:"name"in e&&e.name?e.name:"title"in e&&e.title||""}function Mm(e){if(e==null||typeof e=="string")return;const n="url"in e&&e.url?e.url:"type"in e&&e.type==="url"?e.details:void 0;return n&&/^https?:\/\//i.test(n)?n:void 0}function Gt(e,n="卷"){var o,s;const i=e;return i.measure_info?i.measure_info:(o=i.juan_count)!=null&&o.number?In(i.juan_count.number)+n:(s=i.juan_count)!=null&&s.description?i.juan_count.description:""}function Jl(e){var o;if(e.edition_type)return e.edition_type;if((o=e.lineage)!=null&&o.category)return e.lineage.category;const n=e.edition||e.title||"",i=[[/活字|聚珍/,"活字本"],[/石印/,"石印本"],[/油印/,"油印本"],[/曬印|晒印/,"曬印本"],[/影印|景印/,"影印本"],[/寫本|写本|繕寫|缮写/,"寫本"],[/鈔本|抄本/,"抄本"],[/拓本/,"拓本"],[/批校|評本|评本|校本/,"校本"],[/刻本|刊本|梓行|開雕/,"刻本"],[/排印|鉛印|铅印/,"排印本"]];for(const[s,a]of i)if(s.test(n))return a;return""}const Oi={dynasty:[],classification:[],hasImage:!1,hasText:!1,hasCollated:!1,loss:"",sort:""},Ql=new Set(["work","book","entity"]);function Pm(e){return nc(e)||!!e.sort}function Bm(e,n){return n.sort&&Ql.has(e)?n.sort:void 0}const Wi=[{key:"漢",values:["漢","西漢","東漢"]},{key:"魏晉南北朝",values:["三國魏","三國蜀","三國吳","三國","晉","西晉","東晉","南朝宋","南朝齊","南朝梁","南朝陳","北魏","東魏","西魏","北齊","北周"]},{key:"唐",values:["隋","唐","五代","前蜀","後蜀","南唐"]},{key:"宋",values:["宋","北宋","南宋","宋末元初","遼","金"]},{key:"元",values:["元","元末明初"]},{key:"明",values:["明","明末清初"]},{key:"清",values:["清"]}],Fi=[{value:"經部",label:"經部"},{value:"史部",label:"史部"},{value:"子部",label:"子部"},{value:"集部",label:"集部"},{value:"",label:"未分類"}],ec=[{value:"",label:"全部"},{value:"extant",label:"存"},{value:"partially_extant",label:"殘"},{value:"lost",label:"佚"}],tc={work:new Set(["dynasty","classification","hasImage","hasText","hasCollated","loss"]),book:new Set(["dynasty","hasImage","hasText"]),collection:new Set,entity:new Set(["dynasty"])};function Hi(e){return e.dynasty.length+e.classification.length+(e.hasImage?1:0)+(e.hasText?1:0)+(e.hasCollated?1:0)+(e.loss?1:0)}function nc(e){return Hi(e)>0}function Om(e){const n=[];return e.dynasty.length&&n.push("dynasty"),e.classification.length&&n.push("classification"),e.hasImage&&n.push("hasImage"),e.hasText&&n.push("hasText"),e.hasCollated&&n.push("hasCollated"),e.loss&&n.push("loss"),n}function ic(e,n){const i=tc[e];return Om(n).every(o=>i.has(o))}const Pn=e=>JSON.stringify(e);function Wm(e,n){if(!ic(n,e))return null;const i=[];if(e.dynasty.length){const o=Array.from(new Set(e.dynasty.flatMap(s=>{var a;return((a=Wi.find(l=>l.key===s))==null?void 0:a.values)??[]})));o.length===1?i.push(`dynasty = ${Pn(o[0])}`):o.length>1&&i.push(`dynasty IN [${o.map(Pn).join(", ")}]`)}return e.classification.length&&i.push(e.classification.length===1?`classification = ${Pn(e.classification[0])}`:`classification IN [${e.classification.map(Pn).join(", ")}]`),e.hasImage&&i.push("has_image = true"),e.hasText&&i.push("has_text = true"),e.hasCollated&&i.push("has_collated = true"),e.loss&&i.push(`loss_status = ${Pn(e.loss)}`),i.join(" AND ")}const ht={dynasty:"dy",classification:"cls",hasImage:"img",hasText:"txt",hasCollated:"col",loss:"loss",sort:"sort"},rc="_";function Ci(e,n=new URLSearchParams){for(const i of Object.values(ht))n.delete(i);return e.dynasty.length&&n.set(ht.dynasty,e.dynasty.join(",")),e.classification.length&&n.set(ht.classification,e.classification.map(i=>i||rc).join(",")),e.hasImage&&n.set(ht.hasImage,"1"),e.hasText&&n.set(ht.hasText,"1"),e.hasCollated&&n.set(ht.hasCollated,"1"),e.loss&&n.set(ht.loss,e.loss),e.sort&&n.set(ht.sort,e.sort),n}function Fm(e){const n=a=>(e.get(a)??"").split(",").map(l=>l.trim()).filter(Boolean),i=new Set(Wi.map(a=>a.key)),o=new Set(Fi.map(a=>a.value)),s=e.get(ht.loss);return{dynasty:Array.from(new Set(n(ht.dynasty).filter(a=>i.has(a)))),classification:Array.from(new Set(n(ht.classification).map(a=>a===rc?"":a).filter(a=>o.has(a)))),hasImage:e.get(ht.hasImage)==="1",hasText:e.get(ht.hasText)==="1"||e.get(ht.hasCollated)==="1",hasCollated:!1,loss:s==="extant"||s==="partially_extant"||s==="lost"?s:"",sort:["era:asc","era:desc","title:asc","title:desc"].find(a=>a===e.get(ht.sort))??""}}function Hm(e,n){return JSON.stringify([e.dynasty.slice().sort(),e.classification.slice().sort(),e.hasImage,e.hasText,e.hasCollated,e.loss,e.sort])===JSON.stringify([n.dynasty.slice().sort(),n.classification.slice().sort(),n.hasImage,n.hasText,n.hasCollated,n.loss,n.sort])}function na(e,n){return e.includes(n)?e.filter(i=>i!==n):[...e,n]}const Dm=({filters:e,onChange:n})=>{const i=Ae(),o=i.searchV4,{convert:s}=Ue(),[a,l]=g.useState(!1),d=g.useId(),c=Hi(e),p=h=>n({...e,...h});return t.jsxs("aside",{className:"bim-sr-aside","aria-label":s(o.filterTitle),children:[t.jsxs("button",{type:"button",className:"bim-sr-fbtn","aria-expanded":a,"aria-controls":d,onClick:()=>l(h=>!h),children:[t.jsxs("span",{children:[s(o.filterButton),c>0&&t.jsx("span",{className:"bim-sr-fn",children:s(wt(o.filterSelected,{n:c}))})]}),t.jsxs("span",{className:"bim-sr-fa","aria-hidden":"true",children:[s(a?o.collapse:o.expand)," ",a?"▴":"▾"]})]}),t.jsxs("div",{className:"bim-sr-filters",id:d,"data-open":a?"true":"false",...a?{}:{"data-collapsed":"true"},children:[t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{children:s(o.dynasty)}),t.jsx("div",{className:"bim-sr-chips",children:Wi.map(h=>t.jsx("button",{type:"button",className:"bim-sr-chip","aria-pressed":e.dynasty.includes(h.key),onClick:()=>p({dynasty:na(e.dynasty,h.key)}),children:s(h.key)},h.key))})]}),t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{children:s(o.classification)}),Fi.map(h=>t.jsxs("label",{className:"bim-sr-opt",children:[t.jsx("input",{type:"checkbox",checked:e.classification.includes(h.value),onChange:()=>p({classification:na(e.classification,h.value)})}),h.value?s(h.label):i.searchPage.unclassified]},h.value||"_"))]}),t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{children:s(o.resources)}),t.jsxs("label",{className:"bim-sr-opt",children:[t.jsx("input",{type:"checkbox",checked:e.hasImage,onChange:h=>p({hasImage:h.target.checked})}),s(o.hasImage)]}),t.jsxs("label",{className:"bim-sr-opt",children:[t.jsx("input",{type:"checkbox",checked:e.hasText,onChange:h=>p({hasText:h.target.checked})}),s(o.hasText)]})]}),t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{id:`${d}-loss`,children:s(o.extant)}),t.jsx("div",{className:"bim-sr-seg",role:"group","aria-labelledby":`${d}-loss`,children:ec.map(h=>t.jsx("button",{type:"button","aria-pressed":e.loss===h.value,onClick:()=>p({loss:h.value}),children:i.searchPage.loss[h.value||"all"]},h.value||"all"))})]}),c>0&&t.jsx("button",{type:"button",className:"bim-sr-clear",onClick:()=>n({...Oi,sort:e.sort}),children:s(o.clearAllFilters)})]})]})};function oc({text:e,query:n}){const i=(n??"").trim();if(!i||!e)return t.jsx(t.Fragment,{children:e});const o=e.toLowerCase(),s=i.toLowerCase(),a=[];let l=0,d=0;for(;l<e.length;){const c=o.indexOf(s,l);if(c<0){a.push(e.slice(l));break}c>l&&a.push(e.slice(l,c)),a.push(t.jsx("mark",{className:"bim-sr-hl",children:e.slice(c,c+s.length)},d++)),l=c+s.length}return t.jsx(t.Fragment,{children:a})}const ia=({entries:e,query:n,onEntryLinkClick:i,typeName:o})=>{const s=Ae(),a=s.searchV4,{convert:l}=Ue(),d=at();return t.jsx("div",{className:"bim-sr-tablewrap",children:t.jsxs("table",{className:"bim-sr-table",children:[t.jsxs("colgroup",{children:[t.jsx("col",{style:{width:"34%"}}),t.jsx("col",{style:{width:"8%"}}),t.jsx("col",{style:{width:"19%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:"12%"}}),t.jsx("col",{style:{width:"14%"}})]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",children:l(a.colTitle)}),t.jsx("th",{scope:"col",children:l(a.colType)}),t.jsx("th",{scope:"col",children:l(a.colAuthor)}),t.jsx("th",{scope:"col",children:l(a.colEra)}),t.jsx("th",{scope:"col",children:l(a.colClass)}),t.jsx("th",{scope:"col",style:{textAlign:"right"},children:l(a.colResource)})]})}),t.jsx("tbody",{children:e.map(c=>{const p=l(c.title||c.primary_name||c.id),h=c.measure_info?l(c.measure_info):c.juan_count?`${c.juan_count}${s.unit.juan}`:"",m=c.type==="entity"?[c.birth_year!=null||c.death_year!=null?`${c.birth_year??"?"}—${c.death_year??"?"}`:""].filter(Boolean).join(""):c.author?`${l(c.author)}${c.role&&c.role!=="author"?` ${l(c.role)}`:""}`:"",u=c.type==="book"?c.era??c.dynasty:c.dynasty,f=u?l(u):"",x=c.classification?l(c.classification):"",j=[];c.has_image&&j.push({label:a.tagImage,cls:"bim-sr-tag--img"}),(c.has_text||c.has_collated)&&j.push({label:a.tagText,cls:""}),c.loss_status==="lost"&&j.push({label:a.tagLost,cls:"bim-sr-tag--lost"});const y=[m,f,x].filter(Boolean).join(" · ");return t.jsxs("tr",{children:[t.jsxs("td",{className:"bim-sr-c-title",children:[t.jsxs("div",{className:"bim-sr-tl",children:[t.jsx("a",{href:d(c.id),onClick:S=>i(c,S),children:t.jsx(oc,{text:p,query:n?l(n):void 0})}),h&&t.jsx("span",{className:"bim-sr-measure",children:h})]}),y&&t.jsx("span",{className:"bim-sr-sub",children:y})]}),t.jsxs("td",{className:"bim-sr-c-type",children:[t.jsx(Tn,{type:c.type,size:6})," ",o(c.type)]}),t.jsx("td",{className:"bim-sr-c-who",children:m||"—"}),t.jsx("td",{className:"bim-sr-c-era",children:f||"—"}),t.jsx("td",{className:"bim-sr-c-cls",children:x||"—"}),t.jsx("td",{className:"bim-sr-c-res",children:j.map(S=>t.jsx("span",{className:`bim-sr-tag ${S.cls}`,children:l(S.label)},S.label))})]},c.id)})})]})})},Um=`
1
+ "use strict";var xu=Object.create;var Ws=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var ju=Object.getPrototypeOf,vu=Object.prototype.hasOwnProperty;var ku=(e,n,i,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of yu(n))!vu.call(e,s)&&s!==i&&Ws(e,s,{get:()=>n[s],enumerable:!(o=bu(n,s))||o.enumerable});return e};var mi=(e,n,i)=>(i=e!=null?xu(ju(e)):{},ku(n||!e||!e.__esModule?Ws(i,"default",{value:e,enumerable:!0}):i,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("./storage-entry-Cx6j1zcJ.cjs"),t=require("react/jsx-runtime"),g=require("react"),wu=require("opencc-js/t2cn"),Cl=require("./variant-supplement.cjs"),Su=require("react-markdown"),_u=require("remark-gfm"),$u=e=>`/item/${e}`,zl=g.createContext($u);function Cu({buildUrl:e,children:n}){const i=g.useMemo(()=>e,[e]);return t.jsx(zl.Provider,{value:i,children:n})}function at(){return g.useContext(zl)}const Nl="",Tl="";function mo(e){const n=[];let i=!1,o=e;for(;o.length;){const s=i?Tl:Nl,a=o.indexOf(s);if(a===-1){n.push({text:o,marked:i});break}a>0&&n.push({text:o.slice(0,a),marked:i}),o=o.slice(a+1),i=!i}return n}function gt(e,n){return{title:e,tokens:n}}const Fs='"Songti SC", "Songti TC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif',zu=[gt("基础(VS Code 环境下跟随 --vscode-*)",{bg:{value:"#ffffff",vscode:"--vscode-editor-background"},fg:{value:"#333333",vscode:"--vscode-foreground"},"input-bg":{value:"#ffffff",vscode:"--vscode-input-background"},"input-fg":{value:"#333333",vscode:"--vscode-input-foreground"},"input-border":{value:"#cccccc",vscode:"--vscode-input-border"},"widget-border":{value:"#e0e0e0",vscode:"--vscode-widget-border"},"link-fg":{value:"#0066cc",vscode:"--vscode-textLink-foreground"},"desc-fg":{value:"#717171",vscode:"--vscode-descriptionForeground"},primary:{value:"#0078d4",vscode:"--vscode-button-background"},"primary-fg":{value:"#ffffff",vscode:"--vscode-button-foreground"},"primary-soft":{value:"rgba(0, 120, 212, 0.15)",css:"color-mix(in srgb, var(--bim-primary) 15%, transparent)"},danger:{value:"#f44336"},warning:{value:"#ff9800"},success:{value:"#4caf50"},"sidebar-bg":{value:"#f3f3f3",vscode:"--vscode-sideBar-background"},"list-hover-bg":{value:"rgba(0, 0, 0, 0.04)",vscode:"--vscode-list-hoverBackground"},"list-active-bg":{value:"rgba(0, 120, 212, 0.1)",vscode:"--vscode-list-activeSelectionBackground"},"focus-border":{value:"#0078d4",vscode:"--vscode-focusBorder"}}),gt("底色层次 / 文字与描边 / 链接",{"bg-subtle":{value:"#fafafa"},"widget-bg":{value:"#f8f8f8"},muted:{value:"#888888"},border:{value:"#e5e5e5"},"primary-bg":{value:"#fdf4f4"},link:{value:"#1976d2"},"tag-bg":{value:"#f0f0f0"},"accent-bg":{value:"#1976d2"},"on-color-fg":{value:"#ffffff",note:"彩色底(徽章、选中态按钮)上的文字"}}),gt("提示与警告",{"info-fg":{value:"#0c5380"},"info-bg":{value:"#e7f3ff"},"info-border":{value:"#b3dbff"},"warn-fg":{value:"#856404"},"warn-bg":{value:"#fff3cd"},"warn-border":{value:"#ffc107"},"danger-bg":{value:"rgba(244, 67, 54, 0.08)",note:"错误提示条底色"},"danger-soft-bg":{value:"rgba(244, 67, 54, 0.03)",note:"编辑器危险区块"},"danger-soft-border":{value:"rgba(244, 67, 54, 0.13)"}}),gt("遮罩与阴影",{backdrop:{value:"rgba(0, 0, 0, 0.5)",note:"对话框遮罩"},"overlay-bg":{value:"#00000010",note:"轻量遮罩底(图片占位等)"},"shadow-dialog":{value:"0 4px 20px rgba(0, 0, 0, 0.3)"},"shadow-dropdown":{value:"0 4px 12px rgba(0, 0, 0, 0.1)"},"shadow-tooltip":{value:"0 2px 8px rgba(0, 0, 0, 0.08)"},"shadow-fab":{value:"0 2px 8px rgba(0, 0, 0, 0.25)",note:"悬浮按钮(反馈)"},"shadow-card":{value:"0 1px 4px rgba(0, 0, 0, 0.06)",note:"展开的卡片"},"shadow-node":{value:"0 1px 3px rgba(0, 0, 0, 0.1)",note:"谱系图节点"},"shadow-node-selected":{value:"0 0 0 3px rgba(0, 120, 212, 0.2), 0 2px 8px rgba(0, 120, 212, 0.3)"}}),gt("条目类型 / 状态徽章",{"type-book":{value:"#c0392b"},"type-work":{value:"#8e6f3e"},"type-collection":{value:"#2471a3"},"type-entity":{value:"#5b3e8e"},"status-draft":{value:"#e67e22"},"status-official":{value:"#27ae60"}}),gt("资源",{"restype-text":{value:"#2196f3"},"restype-image":{value:"#ff9800"},"restype-text-image":{value:"#9c27b0"},"restype-physical":{value:"#795548"},"missing-fg":{value:"#e67e22",note:"资源缺册提示"},"colormode-bw-bg":{value:"#f5f5f5",note:"影印件色彩模式标记(黑白 / 彩色)"},"colormode-bw-fg":{value:"#757575"},"colormode-color-bg":{value:"#fff8e1"},"colormode-color-fg":{value:"#f57f17"},"progress-active":{value:"#f59e0b",note:"资源导入进度"},"progress-done":{value:"#10b981"},"progress-todo":{value:"#9ca3af"},"check-fine-bg":{value:"#e8f5e9",note:"文字资源校对程度徽章(精校 / 粗校 / AI整理)"},"check-fine-fg":{value:"#2e7d32"},"check-rough-bg":{value:"#fff3e0"},"check-rough-fg":{value:"#e65100"},"check-ai-bg":{value:"#e3f2fd"},"check-ai-fg":{value:"#1565c0"}}),gt("整理本(CollatedEdition)",{"highlight-bg":{value:"#fff59d",note:"搜索命中高亮底"},"highlight-fg":{value:"inherit",root:!1},"section-lei":{value:"#8e6f3e",note:"章节类型标记:类 / 书 / 序 / 结语 / 考证 / 注释"},"section-shu":{value:"#c0392b"},"section-xu":{value:"#1a5276"},"section-jieyu":{value:"#7d6608"},"section-kaozhen":{value:"#5d6d7e"},"section-zhushi":{value:"#6c5b7b"},"section-tag-fg":{value:"#e74c3c",note:"章节标记(△ 等)"},"matchstate-fg":{value:"#b78900",note:"与底本匹配状态提示"},"quality-source":{value:"#1b5e20",note:"文本质量等级(底本 / OCR / 粗校 / 精校 / 暂无正文 / 占位)"},"quality-ocr":{value:"#e65100"},"quality-rough":{value:"#1565c0"},"quality-fine":{value:"#2e7d32"},"quality-none":{value:"#5f6368",note:"中性灰:暂无正文"},"quality-placeholder":{value:"#757575",note:"中性灰:占位"}}),gt("版本传承(VersionLineageGraph / List) / 关系方向(RelationPanel)",{"lost-fg":{value:"#c62828",note:"佚失标记"},"confidence-certain":{value:"#2e7d32",note:"关系置信度"},"confidence-consensus":{value:"#1976d2"},"confidence-probable":{value:"#ed6c02"},"confidence-disputed":{value:"#c62828"},"lineage-edge-consensus":{value:"#555555",note:"⚠️ 同为 consensus,List 徽章用 --bim-confidence-consensus(蓝),Graph 连线用这个(灰)。若要统一,覆盖成 var(--bim-confidence-consensus)"},"relation-up":{value:"#2196f3"},"relation-down":{value:"#4caf50"},"relation-flat":{value:"#ff9800"}}),gt("编辑器视图(主要在 guji-platform 插件中可见)",{"editor-type-work":{value:"#4caf50",note:"⚠️ 与展示视图的 --bim-type-* 是两套配色(历史如此)。若要统一,覆盖成对应的 var(--bim-type-*)"},"editor-type-collection":{value:"#2196f3"},"editor-type-book":{value:"#ff9800"},"editor-type-entity":{value:"#9c27b0"},"source-url":{value:"#2196f3",note:"来源类型(SourceEditor)"},"source-bookid":{value:"#4caf50"},"mode-active-bg":{value:"#2196f3",note:"模式指示器当前态(ModeIndicator)"},"cover-accent":{value:"#8e6f3e",note:'书目卡片「封面」点缀(IndexBrowser resultVariant="card")'}}),gt("详情页(作品 / 版本 / 丛编):宣纸 + 朱砂一套独立暖色,不继承 --bim-primary 等控件色",{"page-bg":{value:"#fbf9f3",note:"纸"},"row-hover-bg":{value:"#f5f1e5"},"selection-bg":{value:"#ecdcbc",note:"选区"},"band-bg":{value:"#f0e4cb",note:"全文入口横幅(暖沙)"},"band-bg-hover":{value:"#e6d5b4"},ink:{value:"#2a231c",note:"文字层次:墨 → 正文 → 提要 → meta → 标签 → 提示"},"body-fg":{value:"#3b3228"},"quiet-fg":{value:"#5b4f40"},"meta-fg":{value:"#7b6a54"},"label-fg":{value:"#6f6457",note:"标签 / 提示:2026-09 N3a 调深,纸底与斑马底上对比度均 ≥4.5(原 #a3937b 2.8、#b3a385 2.3)"},"hint-fg":{value:"#756a5e"},accent:{value:"#9c3a2c",note:"朱"},"accent-deep":{value:"#6f2a20",note:"链接 hover"},"rule-strong":{value:"#2a231c",note:"分隔线:强 → 常规 → 虚线 → 提要左线"},rule:{value:"#e4dbc9"},"rule-dashed":{value:"#d6c9ae"},"rule-accent-soft":{value:"#e0d3b6"},"aux-fg":{value:"#6f6457",note:"辅助字(元数据、注记、「·」分隔的浅色小字)。须在 page-bg / zebra-bg 上对比度 ≥4.5(Q5 巡检)"},"card-bg":{value:"#fffdf9",note:"提要卡:抬起的面"},"zebra-bg":{value:"#f6f2eb",note:"表格斑马纹 / 左栏分组底(不画格线,靠这一阶底色分行)"},"tint-bg":{value:"#f3eee6",note:"检索框、悬停"},"shadow-summary":{value:"0 10px 32px rgba(60, 50, 40, 0.07)",note:"提要卡投影"},"flag-bg":{value:"rgba(158, 42, 43, 0.08)",note:"唯一的状态色块「有影印」"},"theme-dot-zhusha":{value:"#9c3a2c",note:"主题切换控件的色点:朱砂(不随主题变,两套主题下都要认得出)"},"theme-dot-indigo":{value:"#2e5266",note:"主题切换控件的色点:靛青"},"theme-dot-ink":{value:"#3b4a58",note:"主题切换控件的色点:墨"},"sect-jing":{value:"#2e5266",note:"四部分布条:經部(人物页提要卡;无别处使用)"},"sect-shi":{value:"#9a7a3b",note:"四部分布条:史部"},"sect-zi":{value:"#4f7a5c",note:"四部分布条:子部"},"sect-ji":{value:"#9fb3bc",note:"四部分布条:集部"},"table-border":{value:"color-mix(in srgb, currentColor 28%, transparent)",root:!1,note:"古籍表格(跟随当前文字色)"},"table-head-bg":{value:"color-mix(in srgb, currentColor 8%, transparent)",root:!1}}),gt('版式(v4 外观系统,overview#291):疏朗=留白分区(默认,下列值即疏朗);界栏=框线分区(`<html data-layout="boxed">`)',{"fr-bd":{value:"0 solid transparent",note:"区块外框(border 简写)。疏朗无框;界栏 1px 实线"},"fr-bg":{value:"transparent",note:"区块底。界栏=卡面色"},"fr-hd-pad":{value:"14px 18px",note:"区块标题栏内边距。10-01 起疏朗也有淡染底的标题栏(--bim-fr-hd-bg),故疏朗 14px 18px,界栏 12px 18px"},"fr-hd-bd":{value:"0 solid transparent",note:"区块标题栏下沿线(border 简写)"},"fr-bd-pad":{value:"0",note:"区块正文内边距"},"fr-gap":{value:"56px",note:"区块之间的间距。界栏收紧到 24px(框线本身已分隔)"},"fr-side-gap":{value:"34px",note:"侧栏各块之间的间距;界栏 20px"},"fr-shadow":{value:"0 1px 0 var(--bim-rule), 0 12px 32px -18px rgba(40, 36, 31, 0.25)",note:"抬起的面(提要卡)的投影;界栏不用投影,靠框线"},"fr-tab-bd":{value:"transparent",note:"页签行下沿线颜色(疏朗不画,界栏画)"},"fr-hd-size":{value:"24px",note:"分区标题字号。界栏标题在框顶标题栏里,小一档 19px"},"fr-hd-bg":{value:"color-mix(in srgb, var(--bim-accent) 7%, var(--bim-page-bg))",note:"分区标题栏底色(淡染主色)。疏朗混进页面底,界栏 6% 混进卡面底。主色取 accent(primary 是 VS Code 按钮蓝,不随配色)"},"fr-card-bd":{value:"1px solid transparent",note:"卡片边框。疏朗不画(靠卡面底与淡投影);界栏 1px"},"fr-card-bg":{value:"var(--bim-card-bg)",note:"卡片底"},"fr-row-bd":{value:"1px solid transparent",note:"列表行线、块内小分割线。疏朗不画(靠行距);界栏 1px"},"fr-row-pad":{value:"10px 2px",note:"列表行内边距。界栏收紧 7px 2px"},"fr-chrome-bd":{value:"1px solid transparent",note:"顶栏、分区导航(吸顶锚点条)的线"},"fr-tag-bd":{value:"1px solid transparent",note:"标签、版本签、计数签、工具按钮的边框。疏朗浅底无框;界栏透明底加框"},"fr-tag-bg":{value:"var(--bim-tint-bg)",note:"标签底"},"fr-tbl-cell-bd":{value:"0 solid transparent",note:"表格格线。疏朗不画(靠斑马纹);界栏全格线"},"fr-tbl-zebra":{value:"var(--bim-tint-bg)",note:"表格斑马纹(只在疏朗下有)"},"fr-rail-bd":{value:"1px solid transparent",note:"侧栏里的块、提示块的边框"},"fr-rail-bg":{value:"var(--bim-tint-bg)",note:"侧栏块底。疏朗浅底;界栏卡面底"},"fr-spine-bd":{value:"1px solid transparent",note:"题签、书脊(竖排书名)的边框。界栏是强调色浅线"},"fr-spine-bg":{value:"var(--bim-flag-bg)",note:"题签、书脊底。疏朗浅色实底;界栏卡面底(正史原志两种版式都是强调色实底)"},"fr-plank":{value:"0 solid transparent",note:"书架架板(border 简写)。只在界栏下画 3px"},"fr-axis-bd":{value:"0 solid transparent",note:"时间轴轴线。界栏 1px"},"fr-axis-band":{value:"6px",note:"时间轴底带高度。疏朗用 6px 浅色带代替轴线;界栏 0"},"fr-tick":{value:"0",note:"时间轴刻度短线长度。界栏 5px"},"fr-band-gap":{value:"3px",note:"年代带各段之间的空隙。疏朗 3px;界栏紧贴"},"fr-band-bd":{value:"0 solid transparent",note:"年代带外框与段间分隔。界栏 1px"}}),gt("阅读器(整理本 / 全文)",{"reader-top":{value:"0px",note:"宿主吸顶导航的高度:阅读器工具条、目录与书影侧栏在它下面吸顶(如 60px)"},"reader-warm":{value:"#c9a24a",note:"阅读设置侧栏的暖黄:只做底色(8%)与选中态(24%),与朱/靛/墨三套主色都不冲"},"warp-bg":{value:"#faf8f5",note:"古籍矫正底本书影画布底色"},"warp-box-shadow":{value:"0 2px 12px rgba(0, 0, 0, 0.08)",note:"古籍底本书影浮雕阴影"},"warp-sel-bg":{value:"rgba(196, 148, 76, 0.45)",note:"古籍对读字框选中高亮底色"},"warp-sel-stroke":{value:"#a06e1c",note:"古籍对读字框选中描边"},"warp-hover-bg":{value:"rgba(217, 185, 106, 0.25)",note:"古籍对读字框悬停高亮底色"},"warp-hover-stroke":{value:"#c4944c",note:"古籍对读字框悬停描边"},"warp-badge-bg":{value:"rgba(184, 134, 54, 0.12)",note:"图文对读徽章背景"},"warp-badge-fg":{value:"#8c6820",note:"图文对读徽章文字颜色"},"warp-badge-bd":{value:"rgba(184, 134, 54, 0.3)",note:"图文对读徽章边框"},"warp-banxin-border":{value:"#8a8070",note:"版心分界线"},"warp-banxin-fold":{value:"rgba(160, 110, 28, 0.65)",note:"版心中缝对折线"},"warp-banxin-outer":{value:"#c9c3b4",note:"版心外边线"}}),gt("反馈浮钮(2026-09-28 Q5)",{"feedback-fab-z":{value:"40",note:"层级:低于页面抽屉、弹层(本包对话框为 1000)"},"feedback-fab-offset":{value:"0px",root:!1}}),gt("字体(全站无衬线,2026-09-05 定)",{"font-ui":{value:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif'},"font-body":{value:"system-ui, sans-serif",css:"var(--bim-font-ui)"},"font-serif":{value:Fs,note:"著录原文(提要、按语)用宋体"},"font-reading":{value:Fs,css:"var(--bim-font-serif)",note:"阅读器正文(整理本 / 全文);默认接 font-serif,只需覆盖那一个就同时换掉"}})],Nu=Object.assign({},...zu.map(e=>e.tokens)),Il={};for(const[e,n]of Object.entries(Nu))Il[e]=`var(--bim-${e}, ${n.value})`;function r(e){const n=Il[e];if(n===void 0)throw new Error(`book-index-ui: 未定义的设计变量 --bim-${e}`);return n}function Vt(e){return e.types&&e.types.length>0?e.types:[]}function Tu(e,n){return Vt(e).includes(n)}const Iu={source:"底本",ocr:"OCR",rough:"粗校",fine:"精校",none:"暫無正文",placeholder:"占位"};r("quality-source"),r("quality-ocr"),r("quality-rough"),r("quality-fine"),r("quality-none"),r("quality-placeholder");const Ru={"commons.wikimedia.org":"維基共享","zh.wikisource.org":"維基文庫","taiwanebook.ncl.edu.tw":"臺灣華文電子書庫","ctext.org":"中國哲學書電子化計劃","www.shidianguji.com":"識典古籍","shidianguji.com":"識典古籍","archive.org":"Internet Archive","www.shuge.org":"書格","shuge.org":"書格","pan.baidu.com":"百度網盤"};function $n(e){try{return Ru[new URL(e).hostname]}catch{return}}const Hs={text:0,image:1,physical:2};function ho(e){return e.length===0?"physical":[...e].sort((n,i)=>(Hs[n]??99)-(Hs[i]??99)).join("+")}function Eu(e){return e.includes("text")&&e.includes("image")?"text+image":e[0]||"physical"}function go(e){var l;const n=d=>{const c=d.match(/^(.+?)·第(\d+)[冊册]$/);if(c)return[c[1],parseInt(c[2])];const p=d.match(/^(.+?)[·(](\d+)[)]?$/);return p?[p[1],parseInt(p[2])]:null},i=new Map;for(let d=0;d<e.length;d++){const c=e[d];if(c.volumes&&c.volumes.length>0)continue;const p=n(c.name);if(!p)continue;const[h,m]=p,u=`${h}|${ho(Vt(c))}`;i.has(u)||i.set(u,{base:{...c,name:h,url:"",volumes:[]},volumes:[],indices:[]});const f=i.get(u);f.volumes.push({volume:m,url:c.url||void 0,status:"found"}),f.indices.push(d)}const o=[],s=new Set;for(const d of i.values())if(!(d.volumes.length<2)){d.volumes.sort((c,p)=>c.volume-p.volume),d.base.volumes=d.volumes,d.base.expected_volumes=d.volumes.length,d.base.url||(d.base.url=((l=d.volumes.find(c=>c.url))==null?void 0:l.url)??""),o.push(d.base);for(const c of d.indices)s.add(c)}const a=[...o];for(let d=0;d<e.length;d++)s.has(d)||a.push(e[d]);return a}function Rl(e){if(e.url)return e.url;for(const[n,i]of Object.entries(e))if(n.endsWith("_url")&&typeof i=="string")return i}function El(e){return!Array.isArray(e.volumes)||e.volumes.length===0?null:e.volumes.map(n=>({...n,url:n.url||Rl(n)}))}function Ri(e){const n=El(e);if(!n)return null;const i=new Set(n.filter(s=>s.status!=="missing").map(s=>s.volume)).size,o=new Set(n.filter(s=>s.status==="missing").map(s=>s.volume)).size;return{found:i,missing:o,expected:e.expected_volumes??i+o}}function fo(e){if(!e)return;const n=e.file_page_range||e.page_range;if(!n||typeof n!="string")return;const i=n.match(/^(\d+)/);return i?parseInt(i[1],10):void 0}function xo(e,n){try{if(new URL(e).hostname.includes("wikimedia.org")){const o=e.match(/\/wiki\/File:(.+?)(?:#|$)/);if(o)return`https://commons.wikimedia.org/w/index.php?title=File%3A${encodeURIComponent(decodeURIComponent(o[1]))}&page=${n}`;const s=new URL(e);return s.searchParams.set("page",String(n)),s.toString()}return e}catch{return e}}function Cn(e){if(!e.url)return;const n=fo(e.metadata);return n?xo(e.url,n):e.url}const Mt=g.createContext(null),Ll=["曹霑"];function Lu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Au(e,n=Ll){const i=[...new Set(n.filter(Boolean))].sort((a,l)=>l.length-a.length);if(!i.length)return e;const o=new RegExp(`(${i.map(Lu).join("|")})`,"g"),s=new Set(i);return a=>{if(!a)return e(a);const l=a.split(o);return l.length===1?e(a):l.map((d,c)=>c%2===1&&s.has(d)?d:d&&e(d)).join("")}}let Ln=null;function Al(){if(Ln)return Ln;try{const e=wu.Converter({from:"t",to:"cn"});Ln=Au(n=>e(ze.normalizeVariants(n)))}catch{Ln=e=>e}return Ln}const Mu={indexType:{work:"作品",book:"書籍",collection:"叢編",entity:"人物"},resourceType:{text:"文字資源",image:"圖片資源",textImage:"文字+圖片資源",physical:"館藏"},resourceTypeShort:{text:"文字",image:"圖片",textImage:"文字+圖片",physical:"館藏"},rootType:{catalog:"目錄式",search:"搜索式"},status:{draft:"草稿",official:"正式"},checkType:{精校:{label:"精校",bg:r("check-fine-bg"),fg:r("check-fine-fg")},粗校:{label:"粗校",bg:r("check-rough-bg"),fg:r("check-rough-fg")},AI整理:{label:"AI整理",bg:r("check-ai-bg"),fg:r("check-ai-fg")}},action:{save:"保存",delete:"刪除",newEntry:"+ 新建",viewAll:"查看全部 →",visit:"訪問 →",view:"查看 →",viewEntity:"查看",copy:"複製 ID",copied:"已複製",linkExisting:"+ 關聯現有",createAndLink:"+ 創建並關聯",remove:"刪除",clearAll:"清除全部",reselect:"重選",changeType:"更換類型",expand:"展開",collapse:"收起",expandMore:"展開更多",addSubWork:"添加子作品",addVersion:"添加新版本",addBook:"添加書籍",addSubCollection:"添加子叢編",addCollectionImpl:"添加叢編實現",addSource:"添加來源",addResource:"添加資源",addIndexedBy:"+ 添加收錄來源",addEmendatedBy:"+ 添加考證來源",addAdditionalWork:"+ 添加附屬作品",selectBookOrWork:"選擇書籍/作品",clickToSelectBookOrWork:"點擊選擇書籍/作品",unlink:"解除關聯"},label:{id:"ID:",author:"作者 (Author)",dynasty:"朝代/年份 (Dynasty/Year)",edition:"版本",juanCount:"卷數",pageCount:"頁數 (Pages)",volumeCount:"冊數 (Volumes)",holder:"現藏於 (Holder)",firstImage:"首頁圖片 (First Image URL)",year:"年代",currentLocation:"現藏",parentWork:"上級作品",relatedWorks:"相關作品",type:"類型",rootType:"根類型",coverageLevel:"覆蓋層級",coverageRange:"覆蓋範圍",metadata:"元數據",optionalInfo:"可選信息",details:"詳細說明",detailsOptional:"詳細說明 (可選)",positionOptional:"位置/頁碼 (可選)",dataVersionOptional:"數據版本 (可選)",processorVersionOptional:"處理器版本 (可選)",sourceName:"來源名稱",sourceBid:"來源 BID",titleInfo:"題名",authorInfo:"著者",urlAddress:"URL 地址"},section:{basicInfo:"📊 基本信息",description:"📝 介紹 (Description)",additionalWorks:"📑 附屬作品 (Additional Works)",indexedBy:"📖 著錄於",emendatedBy:"📝 考證",resources:"資源",textResources:"📝 文字資源 (Text Resources)",imageResources:"🖼️ 圖片資源 (Image Resources)",sources:"📚 資料來源 (Sources)",provenance:"📜 收藏歷史 (Provenance)",relatedVersions:"相關版本",otherEditions:"📚 其他版本 (Other Editions)",dangerZone:"危險區域 (Danger Zone)",aliases:"別名",attachedTexts:"附載篇目",appendix:"附錄",containedIn:"收入叢編",collectedIn:"收入叢編",belongsToWork:"所屬作品",locationHistory:"流轉歷史",historyOverview:"歷史沿革",containedBooks:"收錄書籍",relations:"關聯關係",summary:"提要",comment:"按語",additionalComment:"附按",indexed:"收錄於",emendated:"考證",relatedWorks:"相關作品",containedWorks:"包含作品",adaptations:"改編作品",derivativeWorks:"續書與評註",studies:"所考典籍"},relation:{belongsToWork:"所屬作品 (Work)",containedInCollection:"收入叢編",siblingVersions:"同作品其他版本",addVersionForWork:"為此作品添加新版本",parentWork:"父作品 (Parent Work)",childWorks:"子作品",collectionImpl:"叢編實現",allVersions:"所有版本",correspondingWork:"對應作品 (Work)",parentCollection:"父叢編 (Parent Collection)",childCollections:"子叢編",containedBooks:"包含書籍",notLinked:"(未關聯)",none:"(暫無)"},search:{placeholder:"搜索作品、書籍、叢編...",searching:"搜索中...",loading:"加載中...",noResults:"無匹配結果",noResultsFor:"未找到與「{query}」相關的結果",tryOther:"試試其他關鍵詞、別名或作者名",recentBrowse:"最近瀏覽",history:"搜索歷史",clearAll:"清除全部",clearRecent:"清除最近瀏覽",itemNotFound:"無法找到,可能已刪除",removeFromRecent:"移除",searchTitle:"搜索古籍索引",allTab:"全部",resultTabs:"結果分類",searchSubtitle:"輸入關鍵詞搜索作品、書籍或叢編",searchBookName:"搜索書名...",alias:"別名"},searchV4:{filterTitle:"篩選",dynasty:"朝代",classification:"部類",resources:"資源",extant:"存佚",clearAllFilters:"清除全部篩選",hasImage:"有影印",hasText:"有文本",hasCollated:"有文本",filterButton:"篩選",filterSelected:"{n} 項已選",expand:"展開",collapse:"收起",filteredCount:"篩出 {n} 條",removeFilter:"取消篩選:{name}",viewLabel:"結果視圖",viewTable:"表格",viewCard:"卡片",colTitle:"題名",colType:"類型",colAuthor:"責任者",colEra:"年代",colClass:"部類",colResource:"資源",tagImage:"影印",tagText:"文本",tagCollated:"文本",tagLost:"佚",pageInfo:"共 {total} 條 · 每頁 {size} 條 · 第 {page} / {pages} 頁",pagerLabel:"翻頁",prevPage:"上一頁",nextPage:"下一頁",emptyFiltered:"沒有找到匹配的條目。試試更短的書名、減少篩選,或切換繁 / 簡。",limitedNote:"各類只列前幾條,點上方分類頁籤看全部。",sortLabel:"排序",sortRelevance:"相關度",sortEra:"年代",sortTitle:"書名",sortEraAsc:"由早到晚",sortEraDesc:"由晚到早",sortTitleAsc:"拼音 A→Z",sortTitleDesc:"拼音 Z→A"},home:{title:"古籍索引",subtitle:"從左側搜索框輸入關鍵詞,查找作品、書籍或叢編",recommendedBrowse:"推薦瀏覽",catalogTab:"目錄",collectionTab:"叢編",siteTab:"在線資源",recommendTab:"推薦",feedbackTab:"反饋",statusInProgress:"進行中",statusDone:"已完成",statusTodo:"未開始",typeCatalog:"目錄",typeCollection:"資源集合",totalPending:"待統計",progressFormat:"{imported} / {total}",siteCoverage:"資源覆蓋"},browser:{title:"古籍資源索引",subtitle:""},detailTab:{basicInfo:"概覽",catalog:"目錄",collectionCatalog:"叢編目錄",collatedEdition:"文本",catalogSuffix:"·目錄",fullText:"文本",lineage:"版本傳承",feedback:"勘誤反饋",dataSource:"數據源",backToIndex:"典籍版本索引",submitVersion:"提交新版本",dataLicense:"數據源與授權"},metadata:{edition:"版本",version:"修訂版本",quality:"資源質量",check_type:"校對",image_source:"影像來源",team:"所屬團隊",publisher:"出版社",year:"出版年份",format:"格式",note:"備註",total_page:"頁數",total_pages:"總頁數",page_range:"頁碼範圍",page_count:"頁數",file_page_range:"文件頁碼",file_page_count:"文件頁數",content_page_range:"影印頁碼",volume:"冊",color_mode:"色彩",paragraph_count:"段落數",has_translation:"翻譯"},editor:{untitled:"未命名",workTitle:"作品名 (Work Title)",collectionTitle:"叢書名 (Collection Title)",bookTitle:"書名 (Book Title)",belongsToWork:"所屬作品 (Work)",authorLabel:"作者 (Author)",publicationYearLabel:"出版年 (Publication year)",containedIn:"收入叢編",holderLabel:"現藏於 (Holder)",pageLabel:"頁數 (Pages)",volumeLabel:"冊數 (Volumes)",firstImageLabel:"首頁圖片 (First Image URL)",descriptionPlaceholder:"簡要介紹...",provenancePlaceholder:"該資源的流轉與收藏記錄...",otherEditionsPlaceholder:"相關版本的 ID...",dangerZoneDesc:"從索引庫中永久刪除該實體的所有元數據文件。",deleteEntity:"刪除該實體 (Delete Entity)",selectToLink:"選擇要關聯的",unnamedSource:"(未命名來源)",selectSourceType:"選擇來源類型",fromExistingBook:"從現有書籍選擇",enterUrl:"輸入網址鏈接",sourceNamePlaceholder:"如: 維基文庫、中國基本古籍庫",deleteThisSource:"刪除此來源",deleteThisResource:"刪除此資源",resourcePlaceholder:"資源",idAutoExtract:"ID (自動從URL提取)",resourceName:"資源名稱",resourceUrl:"資源鏈接 (URL)",structurePlaceholder:"層級結構 (如: 冊、卷)",coverageRangePlaceholder:"如: 2,3,5-8",detailsPlaceholder:"詳細說明",summaryPlaceholder:"提要...",commentPlaceholder:"按語...",additionalCommentPlaceholder:"附按...",imageResourceLink:"圖片資源鏈接",bookNameLabel:"書名",sourcePlaceholder:"來源"},download:{completed:"下載完成",downloading:"下載中",downloadThis:"下載此資源"},mode:{localMode:"本地模式",syncMode:"同步模式:",githubSync:"GitHub 同步",switchToSync:"點擊切換到同步模式",switchToLocal:"點擊切換到本地模式",switchToGithub:"點擊切換到 GitHub 同步模式",switchToDraft:"點擊切換到 draft 倉庫",switchToOfficial:"點擊切換到 official 倉庫",selectFolder:"選擇本地文件夾",configurePath:"配置同步路徑"},catalog:{totalVolumes:"共",processed:"已處理",contains:"收錄",matched:"已匹配",unmatched:"待匹配",source:"來源:",all:"全部",loading:"加載叢編目錄...",notFound:"未找到叢編目錄數據",loadFailed:"加載失敗",noMatch:"無匹配結果",unmatched_label:"未匹配",volume:"第 {n} 冊"},unit:{juan:"卷",volume:"冊",bu:"部",items:"條"},workSubtype:{book:"書",article:"篇",poem:"詩",chapter:"篇章"},colorMode:{bw:"黑白",color:"彩色"},misc:{noResources:"暫無資源信息",hasTranslation:"有",noTranslation:"無",structure:"層級",coverage:"覆蓋",notFoundEntry:"未找到該條目",loadFailed:"加載失敗",textResource:"文字資源",imageResource:"圖片資源"}},Pu={indexType:{work:"作品",book:"书籍",collection:"丛编",entity:"人物"},resourceType:{text:"文字资源",image:"图片资源",textImage:"文字+图片资源",physical:"馆藏"},resourceTypeShort:{text:"文字",image:"图片",textImage:"文字+图片",physical:"馆藏"},rootType:{catalog:"目录式",search:"搜索式"},status:{draft:"草稿",official:"正式"},checkType:{精校:{label:"精校",bg:r("check-fine-bg"),fg:r("check-fine-fg")},粗校:{label:"粗校",bg:r("check-rough-bg"),fg:r("check-rough-fg")},AI整理:{label:"AI整理",bg:r("check-ai-bg"),fg:r("check-ai-fg")}},action:{save:"保存",delete:"删除",newEntry:"+ 新建",viewAll:"查看全部 →",visit:"访问 →",view:"查看 →",viewEntity:"查看",copy:"复制 ID",copied:"已复制",linkExisting:"+ 关联现有",createAndLink:"+ 创建并关联",remove:"删除",clearAll:"清除全部",reselect:"重选",changeType:"更换类型",expand:"展开",collapse:"收起",expandMore:"展开更多",addSubWork:"添加子作品",addVersion:"添加新版本",addBook:"添加书籍",addSubCollection:"添加子丛编",addCollectionImpl:"添加丛编实现",addSource:"添加来源",addResource:"添加资源",addIndexedBy:"+ 添加收录来源",addEmendatedBy:"+ 添加考证来源",addAdditionalWork:"+ 添加附属作品",selectBookOrWork:"选择书籍/作品",clickToSelectBookOrWork:"点击选择书籍/作品",unlink:"解除关联"},label:{id:"ID:",author:"作者 (Author)",dynasty:"朝代/年份 (Dynasty/Year)",edition:"版本",juanCount:"卷数",pageCount:"页数 (Pages)",volumeCount:"册数 (Volumes)",holder:"现藏于 (Holder)",firstImage:"首页图片 (First Image URL)",year:"年代",currentLocation:"现藏",parentWork:"上级作品",relatedWorks:"相关作品",type:"类型",rootType:"根类型",coverageLevel:"覆盖层级",coverageRange:"覆盖范围",metadata:"元数据",optionalInfo:"可选信息",details:"详细说明",detailsOptional:"详细说明 (可选)",positionOptional:"位置/页码 (可选)",dataVersionOptional:"数据版本 (可选)",processorVersionOptional:"处理器版本 (可选)",sourceName:"来源名称",sourceBid:"来源 BID",titleInfo:"题名",authorInfo:"著者",urlAddress:"URL 地址"},section:{basicInfo:"📊 基本信息",description:"📝 介绍 (Description)",additionalWorks:"📑 附属作品 (Additional Works)",indexedBy:"📖 著录于",emendatedBy:"📝 考证",resources:"资源",textResources:"📝 文字资源 (Text Resources)",imageResources:"🖼️ 图片资源 (Image Resources)",sources:"📚 资料来源 (Sources)",provenance:"📜 收藏历史 (Provenance)",relatedVersions:"相关版本",otherEditions:"📚 其他版本 (Other Editions)",dangerZone:"危险区域 (Danger Zone)",aliases:"别名",attachedTexts:"附载篇目",appendix:"附录",containedIn:"收入丛编",collectedIn:"收入丛编",belongsToWork:"所属作品",locationHistory:"流转历史",historyOverview:"历史沿革",containedBooks:"收录书籍",relations:"关联关系",summary:"提要",comment:"按语",additionalComment:"附按",indexed:"收录于",emendated:"考证",relatedWorks:"相关作品",containedWorks:"包含作品",adaptations:"改编作品",derivativeWorks:"续书与评注",studies:"所考典籍"},relation:{belongsToWork:"所属作品 (Work)",containedInCollection:"收入丛编",siblingVersions:"同作品其他版本",addVersionForWork:"为此作品添加新版本",parentWork:"父作品 (Parent Work)",childWorks:"子作品",collectionImpl:"丛编实现",allVersions:"所有版本",correspondingWork:"对应作品 (Work)",parentCollection:"父丛编 (Parent Collection)",childCollections:"子丛编",containedBooks:"包含书籍",notLinked:"(未关联)",none:"(暂无)"},search:{placeholder:"搜索作品、书籍、丛编...",searching:"搜索中...",loading:"加载中...",noResults:"无匹配结果",noResultsFor:"未找到与「{query}」相关的结果",tryOther:"试试其他关键词、别名或作者名",recentBrowse:"最近浏览",history:"搜索历史",clearAll:"清除全部",clearRecent:"清除最近浏览",itemNotFound:"无法找到,可能已删除",removeFromRecent:"移除",searchTitle:"搜索古籍索引",allTab:"全部",resultTabs:"结果分类",searchSubtitle:"输入关键词搜索作品、书籍或丛编",searchBookName:"搜索书名...",alias:"别名"},searchV4:{filterTitle:"筛选",dynasty:"朝代",classification:"部类",resources:"资源",extant:"存佚",clearAllFilters:"清除全部筛选",hasImage:"有影印",hasText:"有文本",hasCollated:"有文本",filterButton:"筛选",filterSelected:"{n} 项已选",expand:"展开",collapse:"收起",filteredCount:"筛出 {n} 条",removeFilter:"取消筛选:{name}",viewLabel:"结果视图",viewTable:"表格",viewCard:"卡片",colTitle:"题名",colType:"类型",colAuthor:"责任者",colEra:"年代",colClass:"部类",colResource:"资源",tagImage:"影印",tagText:"文本",tagCollated:"文本",tagLost:"佚",pageInfo:"共 {total} 条 · 每页 {size} 条 · 第 {page} / {pages} 页",pagerLabel:"翻页",prevPage:"上一页",nextPage:"下一页",emptyFiltered:"没有找到匹配的条目。试试更短的书名、减少筛选,或切换繁 / 简。",limitedNote:"各类只列前几条,点上方分类页签看全部。",sortLabel:"排序",sortRelevance:"相关度",sortEra:"年代",sortTitle:"书名",sortEraAsc:"由早到晚",sortEraDesc:"由晚到早",sortTitleAsc:"拼音 A→Z",sortTitleDesc:"拼音 Z→A"},home:{title:"古籍索引",subtitle:"从左侧搜索框输入关键词,查找作品、书籍或丛编",recommendedBrowse:"推荐浏览",catalogTab:"目录",collectionTab:"丛编",siteTab:"在线资源",recommendTab:"推荐",feedbackTab:"反馈",statusInProgress:"进行中",statusDone:"已完成",statusTodo:"未开始",typeCatalog:"目录",typeCollection:"资源集合",totalPending:"待统计",progressFormat:"{imported} / {total}",siteCoverage:"资源覆盖"},browser:{title:"古籍资源索引",subtitle:""},detailTab:{basicInfo:"概览",catalog:"目录",collectionCatalog:"丛编目录",collatedEdition:"文本",catalogSuffix:"·目录",fullText:"文本",lineage:"版本传承",feedback:"勘误反馈",dataSource:"数据源",backToIndex:"典籍版本索引",submitVersion:"提交新版本",dataLicense:"数据源与授权"},metadata:{edition:"版本",version:"修订版本",quality:"资源质量",check_type:"校对",image_source:"影像来源",team:"所属团队",publisher:"出版社",year:"出版年份",format:"格式",note:"备注",total_page:"页数",total_pages:"总页数",page_range:"页码范围",page_count:"页数",file_page_range:"文件页码",file_page_count:"文件页数",content_page_range:"影印页码",volume:"册",color_mode:"色彩",paragraph_count:"段落数",has_translation:"翻译"},editor:{untitled:"未命名",workTitle:"作品名 (Work Title)",collectionTitle:"丛书名 (Collection Title)",bookTitle:"书名 (Book Title)",belongsToWork:"所属作品 (Work)",authorLabel:"作者 (Author)",publicationYearLabel:"出版年 (Publication year)",containedIn:"收入丛编",holderLabel:"现藏于 (Holder)",pageLabel:"页数 (Pages)",volumeLabel:"册数 (Volumes)",firstImageLabel:"首页图片 (First Image URL)",descriptionPlaceholder:"简要介绍...",provenancePlaceholder:"该资源的流转与收藏记录...",otherEditionsPlaceholder:"相关版本的 ID...",dangerZoneDesc:"从索引库中永久删除该实体的所有元数据文件。",deleteEntity:"删除该实体 (Delete Entity)",selectToLink:"选择要关联的",unnamedSource:"(未命名来源)",selectSourceType:"选择来源类型",fromExistingBook:"从现有书籍选择",enterUrl:"输入网址链接",sourceNamePlaceholder:"如: 维基文库、中国基本古籍库",deleteThisSource:"删除此来源",deleteThisResource:"删除此资源",resourcePlaceholder:"资源",idAutoExtract:"ID (自动从URL提取)",resourceName:"资源名称",resourceUrl:"资源链接 (URL)",structurePlaceholder:"层级结构 (如: 册、卷)",coverageRangePlaceholder:"如: 2,3,5-8",detailsPlaceholder:"详细说明",summaryPlaceholder:"提要...",commentPlaceholder:"按语...",additionalCommentPlaceholder:"附按...",imageResourceLink:"图片资源链接",bookNameLabel:"书名",sourcePlaceholder:"来源"},download:{completed:"下载完成",downloading:"下载中",downloadThis:"下载此资源"},mode:{localMode:"本地模式",syncMode:"同步模式:",githubSync:"GitHub 同步",switchToSync:"点击切换到同步模式",switchToLocal:"点击切换到本地模式",switchToGithub:"点击切换到 GitHub 同步模式",switchToDraft:"点击切换到 draft 仓库",switchToOfficial:"点击切换到 official 仓库",selectFolder:"选择本地文件夹",configurePath:"配置同步路径"},catalog:{totalVolumes:"共",processed:"已处理",contains:"收录",matched:"已匹配",unmatched:"待匹配",source:"来源:",all:"全部",loading:"加载丛编目录...",notFound:"未找到丛编目录数据",loadFailed:"加载失败",noMatch:"无匹配结果",unmatched_label:"未匹配",volume:"第 {n} 册"},unit:{juan:"卷",volume:"册",bu:"部",items:"条"},workSubtype:{book:"书",article:"篇",poem:"诗",chapter:"篇章"},colorMode:{bw:"黑白",color:"彩色"},misc:{noResources:"暂无资源信息",hasTranslation:"有",noTranslation:"无",structure:"层级",coverage:"覆盖",notFoundEntry:"未找到该条目",loadFailed:"加载失败",textResource:"文字资源",imageResource:"图片资源"}};function bt(e,n,i){return{"zh-Hant":e,"zh-Hans":n}}const Bu=bt({toHans:"切换为简体",toHant:"切換為繁體",localeShortHans:"简",localeShortHant:"繁",themeLabel:"主題",theme:{zhusha:"朱砂",indigo:"靛青",ink:"墨"},loading:"加載中",repoSourceLink:"在 GitHub 查看本條目源文件",volumesMissing:"缺{n}",collapseVolumes:"收起分冊",expandVolumes:"展開分冊",collapseArrow:"收起 ▲",expandArrow:"展開 ▼",entitySubtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年號",office:"官職",anonymous:"佚名",collective:"集體"},cbdbTitle:"CBDB 中國歷代人物傳記數據庫",entityPlaceholderNote:"人物信息暫缺。該 Entity 僅作為作者佔位,詳細生平資料尚待補充。",otherVersions:"其他版本",switchToEdit:"切換到編輯模式",switchToView:"切換到查看模式",modeEdit:"✏️ 編輯",modeView:"👁 查看",noData:"無數據"},{toHans:"切换为简体",toHant:"切換為繁體",localeShortHans:"简",localeShortHant:"繁",themeLabel:"主题",theme:{zhusha:"朱砂",indigo:"靛青",ink:"墨"},loading:"加载中",repoSourceLink:"在 GitHub 查看本条目源文件",volumesMissing:"缺{n}",collapseVolumes:"收起分册",expandVolumes:"展开分册",collapseArrow:"收起 ▲",expandArrow:"展开 ▼",entitySubtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年号",office:"官职",anonymous:"佚名",collective:"集体"},cbdbTitle:"CBDB 中国历代人物传记数据库",entityPlaceholderNote:"人物信息暂缺。该 Entity 仅作为作者占位,详细生平资料尚待补充。",otherVersions:"其他版本",switchToEdit:"切换到编辑模式",switchToView:"切换到查看模式",modeEdit:"✏️ 编辑",modeView:"👁 查看",noData:"无数据"}),Ei=bt({relation:{part_of:"所屬",has_part:"包含",contains_text_of:"收錄",collected_in:"叢編",text_carried_by:"載錄",studied_by:"研究",studies:"所考",preceded_by:"前承",followed_by:"後繼",derived_from:"衍生",has_adaptation:"改編",related:"相關"},lossStatus:{extant:"今存",fragment:"殘存",partial:"殘存",lost:"已佚",unknown:"未詳"},resourceKind:{text:"文本",image:"影印",textImage:"圖文",physical:"館藏"},otherImages:"其他影印",fragmentTag:"殘片",collapseVolumes:"收起分冊",expandVolumes:"展開 {n} 冊",mirror:"鏡像",volumeStats:"{found} / {expected} 冊",volumeStatsMissing:"{found} / {expected} 冊 缺 {missing}",pageNav:"本頁導航",thisPage:"本頁",more:"更多",expandRest:"展開其餘 {n} {unit}",read:"閱讀",showMore:"顯示更多({n})",review:{reviewed:"已審核",disputed:"有爭議",unreviewed:"未審核",draft:"草稿"},dataVersion:"數據版本",todoCount:"待核 {n} 項",lacuna:"闕文",lacunaWith:"闕文:{label}",composedChar:"組字:{label}",bce:"前{n}",roleAll:"全部",loading:"加載中…",noLineageGraph:"暫無版本圖數據",notFound:"找不到該條目,可能已被刪除或 ID 不正確",workInfo:"作品信息"},{relation:{part_of:"所属",has_part:"包含",contains_text_of:"收录",collected_in:"丛编",text_carried_by:"载录",studied_by:"研究",studies:"所考",preceded_by:"前承",followed_by:"后继",derived_from:"衍生",has_adaptation:"改编",related:"相关"},lossStatus:{extant:"今存",fragment:"残存",partial:"残存",lost:"已佚",unknown:"未详"},resourceKind:{text:"文本",image:"影印",textImage:"图文",physical:"馆藏"},otherImages:"其他影印",fragmentTag:"残片",collapseVolumes:"收起分册",expandVolumes:"展开 {n} 册",mirror:"镜像",volumeStats:"{found} / {expected} 册",volumeStatsMissing:"{found} / {expected} 册 缺 {missing}",pageNav:"本页导航",thisPage:"本页",more:"更多",expandRest:"展开其余 {n} {unit}",read:"阅读",showMore:"显示更多({n})",review:{reviewed:"已审核",disputed:"有争议",unreviewed:"未审核",draft:"草稿"},dataVersion:"数据版本",todoCount:"待核 {n} 项",lacuna:"阙文",lacunaWith:"阙文:{label}",composedChar:"组字:{label}",bce:"前{n}",roleAll:"全部",loading:"加载中…",noLineageGraph:"暂无版本图数据",notFound:"找不到该条目,可能已被删除或 ID 不正确",workInfo:"作品信息"}),Ou=bt({kind:"版本",fact:{editionType:"版本類型",publication:"刊印",era:"刊寫年代",measure:"卷帙",volumes:"冊次",baseEdition:"底本",holdings:"存藏",callNumber:"索書號",seals:"藏印",leafStyle:"行款",binding:"裝幀",dimensions:"尺寸",condition:"品相",aliases:"又名"},inferredFromEdition:"據版本題名推斷",volumesValue:"第 {range} {unit}({n} {unit})",andMorePlaces:" 等 {n} 處",viewImages:"看原書影印",sec:{fulltext:"文本",images:"影印",physical:"館藏",lineage:"版本源流",empty:"影印與文本"},chapterUnit:"章",chapterCount:"{n} {unit}",sourceBy:"據{src}",readFrom:"從{ch}讀起",firstChapter:"第一章",enterReader:"進入閱讀頁",externalText:"站外文本",groupCount:"{n} 組",placeCount:"{n} 處",lineageMeta:"據版本傳承著錄",lineageView:"源流視圖",viewCards:"卡片",viewGraph:"關係圖",totalOf:"全 {n} {unit}",emptyText:"尚未著錄該版本的影印、文本與收藏信息。",editionCount:"{n} 種版本",siblings:"同作品版本",byEra:"按年代",kindCount:"{n} 種",viewAllInWork:"在作品頁看全部 {n} 種 →",volumeRange:"第 {range} {unit}",volumeCount:"{n} {unit}",confidence:{certain:"確證",consensus:"通說",probable:"可能",disputed:"有爭議"},confidenceNote:"({c})",lineage:{ancestor:"祖本",reconstructed:"擬構祖本",thisEdition:"本版",derivatives:"翻刻 · 衍生",appendix:"附記"}},{kind:"版本",fact:{editionType:"版本类型",publication:"刊印",era:"刊写年代",measure:"卷帙",volumes:"册次",baseEdition:"底本",holdings:"存藏",callNumber:"索书号",seals:"藏印",leafStyle:"行款",binding:"装帧",dimensions:"尺寸",condition:"品相",aliases:"又名"},inferredFromEdition:"据版本题名推断",volumesValue:"第 {range} {unit}({n} {unit})",andMorePlaces:" 等 {n} 处",viewImages:"看原书影印",sec:{fulltext:"文本",images:"影印",physical:"馆藏",lineage:"版本源流",empty:"影印与文本"},chapterUnit:"章",chapterCount:"{n} {unit}",sourceBy:"据{src}",readFrom:"从{ch}读起",firstChapter:"第一章",enterReader:"进入阅读页",externalText:"站外文本",groupCount:"{n} 组",placeCount:"{n} 处",lineageMeta:"据版本传承著录",lineageView:"源流视图",viewCards:"卡片",viewGraph:"关系图",totalOf:"全 {n} {unit}",emptyText:"尚未著录该版本的影印、文本与收藏信息。",editionCount:"{n} 种版本",siblings:"同作品版本",byEra:"按年代",kindCount:"{n} 种",viewAllInWork:"在作品页看全部 {n} 种 →",volumeRange:"第 {range} {unit}",volumeCount:"{n} {unit}",confidence:{certain:"确证",consensus:"通说",probable:"可能",disputed:"有争议"},confidenceNote:"({c})",lineage:{ancestor:"祖本",reconstructed:"拟构祖本",thisEdition:"本版",derivatives:"翻刻 · 衍生",appendix:"附记"}}),Wu=bt({fact:{written:"成書",measure:"卷帙",loss:"存佚",earliest:"最早存世",emendation:"考證",alias:"又名",attached:"附載",appendix:"附錄"},inferredFromEdition:"據版本題名推斷",loading:"載入中",emendationCount:"{n} 條",stat:{editions:"版本",hasImage:"有影印",catalogs:"家著錄"},classifiedBy:"據《{source}》",sec:{versions:"版本",catalogs:"著錄",collected:"收入叢編",related:"相關書目",resources:"在線資源"},versionsTotal:"共 {n} 種",versionsWithImage:"{n} 種有影印",versionsCurrent:"當前 {n} 種",scanOnly:"只看有影印",sortByYear:"按年代排列",sortByCatalog:"按著錄順序",col:{edition:"版本",era:"年代",holder:"館藏",image:"影印"},noVersionsFiltered:"當前篩選下沒有版本",noVersions:"暫無版本著錄",moreUnit:"種版本",sameEditionCopies:"同版另藏 {n} 部:",inferredEraNote:"部分年代據版本題名推斷,非著錄原文",empty:"尚未著錄該作品的版本與書目收錄。",relatedCount:"{n} 部",hasImage:"有影印",catalog:{meta:"歷代書目 {n} 家",tablist:"著錄書目",titleOnly:"僅著錄書名,無提要。",prev:"上一家:{name}",next:"下一家:{name}"}},{fact:{written:"成书",measure:"卷帙",loss:"存佚",earliest:"最早存世",emendation:"考证",alias:"又名",attached:"附载",appendix:"附录"},inferredFromEdition:"据版本题名推断",loading:"载入中",emendationCount:"{n} 条",stat:{editions:"版本",hasImage:"有影印",catalogs:"家著录"},classifiedBy:"据《{source}》",sec:{versions:"版本",catalogs:"著录",collected:"收入丛编",related:"相关书目",resources:"在线资源"},versionsTotal:"共 {n} 种",versionsWithImage:"{n} 种有影印",versionsCurrent:"当前 {n} 种",scanOnly:"只看有影印",sortByYear:"按年代排列",sortByCatalog:"按著录顺序",col:{edition:"版本",era:"年代",holder:"馆藏",image:"影印"},noVersionsFiltered:"当前筛选下没有版本",noVersions:"暂无版本著录",moreUnit:"种版本",sameEditionCopies:"同版另藏 {n} 部:",inferredEraNote:"部分年代据版本题名推断,非著录原文",empty:"尚未著录该作品的版本与书目收录。",relatedCount:"{n} 部",hasImage:"有影印",catalog:{meta:"历代书目 {n} 家",tablist:"著录书目",titleOnly:"仅著录书名,无提要。",prev:"上一家:{name}",next:"下一家:{name}"}}),Fu=bt({kind:"叢編",workCollection:"作品集",stat:{titles:"子目"},fact:{publication:"刊印",expected:"應收",measure:"卷帙"},member:{Book:"所收版本",Work:"所收作品",other:"成員"},memberNote:"子目與其各版本合計",nZhong:"{n} 種",nHan:"{n} 函",dist:{head:"全帙冊次分佈",segTitle:"{section} 第 {from}–{to} 冊",only:"只看{section}",unclassified:"未分類",hint:"點色段篩選部類"},sec:{titles:"子目",resources:"影印與文本"},totalVolumes:"全帙 {n} {unit}",currentN:"當前 {n} {unit}",loadAllTitle:"將載入全部 {n} {unit}",grouping:"正在按部類分組…",groupBySection:"按部類分組",find:"在本叢編中檢索",col:{volumes:"冊次",title:"書名",versions:"版本"},volumeRange:"第 {range} {unit}",resourcesCount:"{n} 處",text:"文本",empty:"尚未著錄該叢編的子目。",parent:"上級叢編"},{kind:"丛编",workCollection:"作品集",stat:{titles:"子目"},fact:{publication:"刊印",expected:"应收",measure:"卷帙"},member:{Book:"所收版本",Work:"所收作品",other:"成员"},memberNote:"子目与其各版本合计",nZhong:"{n} 种",nHan:"{n} 函",dist:{head:"全帙册次分布",segTitle:"{section} 第 {from}–{to} 册",only:"只看{section}",unclassified:"未分类",hint:"点色段筛选部类"},sec:{titles:"子目",resources:"影印与文本"},totalVolumes:"全帙 {n} {unit}",currentN:"当前 {n} {unit}",loadAllTitle:"将载入全部 {n} {unit}",grouping:"正在按部类分组…",groupBySection:"按部类分组",find:"在本丛编中检索",col:{volumes:"册次",title:"书名",versions:"版本"},volumeRange:"第 {range} {unit}",resourcesCount:"{n} 处",text:"文本",empty:"尚未著录该丛编的子目。",parent:"上级丛编"}),Hu=bt({subtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年號",office:"官職",anonymous:"佚名",collective:"群體"},bce:"前{n}",floruit:"活躍於 {from}—{to}",zi:"字{name}",hao:"號{name}",nativePlace:"{place}人",lifeAria:"{birth}—{death},一生 {years} 年",lifeYears:"一生 {years} 年",fact:{works:"著作"},nZhong:"{n} 種",moreNames:"更多別名({n})",dist:"著作分佈",autoMatch:"自動匹配",sec:{featured:"著作舉要",allWorks:"全部著作",works:"著作",external:"站外資料"},featuredSub:"存世版本最多的三部",versionsUnit:"種版本",hasImage:"有影印",empty:"尚未著錄該人物的關聯作品。",total:"共 {n} 種",current:"當前 {n} 種",sortByVersions:"按版本數排列",sortByCatalog:"按著錄順序",col:{work:"作品",section:"部類",role:"職任",versions:"存世版本",image:"影印"},notRecorded:"未著錄",emptyRole:"該職任下的著作尚未著錄。",moreUnit:"種著作",cbdbAuto:"CBDB 為自動匹配,未經人工核對",sealAlt:"{name}印影",imgCredit:"圖像:{credit}",imgLicense:"授權:{license}",imgSource:"來源"},{subtype:{people:"人物",place:"地名",dynasty:"朝代",reign:"年号",office:"官职",anonymous:"佚名",collective:"群体"},bce:"前{n}",floruit:"活跃于 {from}—{to}",zi:"字{name}",hao:"号{name}",nativePlace:"{place}人",lifeAria:"{birth}—{death},一生 {years} 年",lifeYears:"一生 {years} 年",fact:{works:"著作"},nZhong:"{n} 种",moreNames:"更多别名({n})",dist:"著作分布",autoMatch:"自动匹配",sec:{featured:"著作举要",allWorks:"全部著作",works:"著作",external:"站外资料"},featuredSub:"存世版本最多的三部",versionsUnit:"种版本",hasImage:"有影印",empty:"尚未著录该人物的关联作品。",total:"共 {n} 种",current:"当前 {n} 种",sortByVersions:"按版本数排列",sortByCatalog:"按著录顺序",col:{work:"作品",section:"部类",role:"职任",versions:"存世版本",image:"影印"},notRecorded:"未著录",emptyRole:"该职任下的著作尚未著录。",moreUnit:"种著作",cbdbAuto:"CBDB 为自动匹配,未经人工核对",sealAlt:"{name}印影",imgCredit:"图像:{credit}",imgLicense:"授权:{license}",imgSource:"来源"}),Du=bt({imagesLoading:"加載書影…",noImages:"暫無書影",noImagesHint:"這一卷還沒有配上影像;接入後在此與正文逐頁對看",imageAlt:"書影 第 {label} 頁",prevImage:"上一頁書影",nextImage:"下一頁書影",back:"閱讀",backAria:"返回{label}首頁",skipToText:"跳到正文",settings:"閱讀設置",settingsShort:"設置",closeSettings:"收起設置",groupText:"文字",groupMark:"標註",groupLayout:"版面",font:"字體",fontSong:"宋體",fontKai:"楷體",fontSystem:"系統默認",script:"繁簡",version:"版本",versionShort:"版本▾",unitJuan:"卷",pagerGroup:"翻{unit}",prevUnit:"上一{unit}",nextUnit:"下一{unit}",prevUnitTitle:"上一{unit}:{label}",nextUnitTitle:"下一{unit}:{label}",firstUnit:"已是第一{unit}",lastUnit:"已是最後一{unit}",toc:"目錄",images:"書影",fontSmaller:"縮小字號",fontLarger:"放大字號",paragraphTitle:"條目分行 ↔ 自然段",paragraph:"自然段",workLinks:"標出作品鏈接",properNameTitle:"書名加波浪線",properName:"專名線",properNameOff:"不顯示",properNameLite:"精簡",properNameFull:"完整",properNameLiteTitle:"只標人名、地名、朝代",showWorks:"標註書名",bookTitleStyle:"書名樣式",bookTitleWavy:"波浪線",bookTitleBracket:"書名號",scriptOrig:"原字",scriptOrigUnavailable:"此文本沒有規範層,無「原字」可選",scriptOrigShort:"原",scriptQuick:"字形",scriptHant:"通行繁體",scriptHans:"簡體",quoteStyle:"引號",quoteModern:"“”‘’",quoteClassic:"「」『』",quoteOriginal:"原樣",pageBreaks:"顯示分葉分割線",pageIndicator:"頁指示頭(上下鍵調整位置)",preserveMargins:"書影保留空白",facsimilePager:"書影翻頁",facsimilePageInput:"書影葉碼(輸入數字後按 Enter 或離開輸入框跳轉)",vertical:"豎排",closeToc:"收起目錄",sourceLabel:"出處",licenseOf:"授權 {license}",revisedAt:"最近校訂 {date}",reportError:"報告錯字",pagerNav:"翻卷",rail:"本卷",bottomBar:"閱讀工具",tocShort:"卷目",fontSize:"字號",close:"關閉",loading:"加載中…",noText:"暫無文本",tocFailed:"無法加載目錄",tocLoading:"加載目錄…",viewEntry:"查看條目",defaultRole:"撰",tocCaption:"目錄 · {n} {unit}",tocExpand:"展開",tocCollapse:"收起",searchChapters:"搜索全部章節",searchChaptersPlaceholder:"搜索全部章節…",searchUnit:"搜索全部{unit}",searchUnitPlaceholder:"搜索全部{unit}…",textSource:"來源",originalSource:"本站獨立整理",charGuess:"殘字(推測)",lacunaGuess:"闕文,推測為「{guess}」",upstream:"上游",chapterFailed:"無法加載章節內容",references:"參考文獻",entityDetail:"查看詳情 →"},{imagesLoading:"加载书影…",noImages:"暂无书影",noImagesHint:"这一卷还没有配上影像;接入后在此与正文逐页对看",imageAlt:"书影 第 {label} 页",prevImage:"上一页书影",nextImage:"下一页书影",back:"阅读",backAria:"返回{label}首页",skipToText:"跳到正文",settings:"阅读设置",settingsShort:"设置",closeSettings:"收起设置",groupText:"文字",groupMark:"标注",groupLayout:"版面",font:"字体",fontSong:"宋体",fontKai:"楷体",fontSystem:"系统默认",script:"繁简",version:"版本",versionShort:"版本▾",unitJuan:"卷",pagerGroup:"翻{unit}",prevUnit:"上一{unit}",nextUnit:"下一{unit}",prevUnitTitle:"上一{unit}:{label}",nextUnitTitle:"下一{unit}:{label}",firstUnit:"已是第一{unit}",lastUnit:"已是最后一{unit}",toc:"目录",images:"书影",fontSmaller:"缩小字号",fontLarger:"放大字号",paragraphTitle:"条目分行 ↔ 自然段",paragraph:"自然段",workLinks:"标出作品链接",properNameTitle:"书名加波浪线",properName:"专名线",properNameOff:"不显示",properNameLite:"精简",properNameFull:"完整",properNameLiteTitle:"只标人名、地名、朝代",showWorks:"标注书名",bookTitleStyle:"书名样式",bookTitleWavy:"波浪线",bookTitleBracket:"书名号",scriptOrig:"原字",scriptOrigUnavailable:"此文本没有规范层,无「原字」可选",scriptOrigShort:"原",scriptQuick:"字形",scriptHant:"通行繁体",scriptHans:"简体",quoteStyle:"引号",quoteModern:"“”‘’",quoteClassic:"「」『』",quoteOriginal:"原样",pageBreaks:"显示分叶分割线",pageIndicator:"页指示头(上下键调整位置)",preserveMargins:"书影保留空白",facsimilePager:"书影翻页",facsimilePageInput:"书影叶码(输入数字后按 Enter 或离开输入框跳转)",vertical:"竖排",closeToc:"收起目录",sourceLabel:"出处",licenseOf:"授权 {license}",revisedAt:"最近校订 {date}",reportError:"报告错字",pagerNav:"翻卷",rail:"本卷",bottomBar:"阅读工具",tocShort:"卷目",fontSize:"字号",close:"关闭",loading:"加载中…",noText:"暂无文本",tocFailed:"无法加载目录",tocLoading:"加载目录…",viewEntry:"查看条目",defaultRole:"撰",tocCaption:"目录 · {n} {unit}",tocExpand:"展开",tocCollapse:"收起",searchChapters:"搜索全部章节",searchChaptersPlaceholder:"搜索全部章节…",searchUnit:"搜索全部{unit}",searchUnitPlaceholder:"搜索全部{unit}…",textSource:"来源",originalSource:"本站独立整理",charGuess:"残字(推测)",lacunaGuess:"阙文,推测为「{guess}」",upstream:"上游",chapterFailed:"无法加载章节内容",references:"参考文献",entityDetail:"查看详情 →"}),Uu=bt({nJuan:"{n}卷",viewWork:"查看作品",viewWorkOf:"查看作品:{title}",workArrow:"作品 →",arrowWork:"→作品",nWorks:"{n}部作品",unlinked:"未關聯",summary:"提要",comment:"按語",additionalComment:"附按",noMatch:"無匹配結果",sectionType:{类:"類",书:"書",序:"序",结语:"結語",注释:"註釋",考证:"考證",诗:"詩",小计:"小計"},countTiao:"{n} 條",countTiaoOf:"{m} / {n} 條",countPoems:"{n} 首",countPoemsOf:"{m} / {n} 首",countBooks:"{n} 部書",countBooksOf:"{m} / {n} 部書",kaozhenTarget:"考證對象 {target}",baseText:"底本 {note}",textQuality:"文本質量",qualityLabel:{source:"底本",ocr:"OCR",rough:"粗校",fine:"精校",none:"暫無正文",placeholder:"占位"},qualityCriteria:{source:"照錄來源原文,本站未另行校對",ocr:"保持大意和結構,錯誤率在百分之十以內",rough:"保證文意基本正確,錯誤率在百分之三以內",fine:"通讀無障礙,錯誤率在百分之一以內",none:"質量未評定",placeholder:"占位條目,正文尚未錄入"},originalSource:"原文來源",viewsGroup:"看法",viewText:"正文",viewEntries:"條目",rowHeadNo:"序",rowHeadTitle:"書名",rowHeadWork:"作品",railCap:"本卷",railUnitPoems:"首",railUnitBooks:"部書",linkedN:"已關聯 {n}",linkedOf:"已關聯 {n} / {total}",railEntriesNav:"本卷條目"},{nJuan:"{n}卷",viewWork:"查看作品",viewWorkOf:"查看作品:{title}",workArrow:"作品 →",arrowWork:"→作品",nWorks:"{n}部作品",unlinked:"未关联",summary:"提要",comment:"按语",additionalComment:"附按",noMatch:"无匹配结果",sectionType:{类:"类",书:"书",序:"序",结语:"结语",注释:"注释",考证:"考证",诗:"诗",小计:"小计"},countTiao:"{n} 条",countTiaoOf:"{m} / {n} 条",countPoems:"{n} 首",countPoemsOf:"{m} / {n} 首",countBooks:"{n} 部书",countBooksOf:"{m} / {n} 部书",kaozhenTarget:"考证对象 {target}",baseText:"底本 {note}",textQuality:"文本质量",qualityLabel:{source:"底本",ocr:"OCR",rough:"粗校",fine:"精校",none:"暂无正文",placeholder:"占位"},qualityCriteria:{source:"照录来源原文,本站未另行校对",ocr:"保持大意和结构,错误率在百分之十以内",rough:"保证文意基本正确,错误率在百分之三以内",fine:"通读无障碍,错误率在百分之一以内",none:"质量未评定",placeholder:"占位条目,正文尚未录入"},originalSource:"原文来源",viewsGroup:"看法",viewText:"正文",viewEntries:"条目",rowHeadNo:"序",rowHeadTitle:"书名",rowHeadWork:"作品",railCap:"本卷",railUnitPoems:"首",railUnitBooks:"部书",linkedN:"已关联 {n}",linkedOf:"已关联 {n} / {total}",railEntriesNav:"本卷条目"}),Vu=bt({typeShort:{work:"作",book:"版",collection:"叢",entity:"人"},typeLabel:{work:"作品",book:"版本",collection:"叢編",entity:"人物"},typeAll:"全部",typeChipsLabel:"按類型檢索",recentTitle:"最近瀏覽",recentClear:"清除",recentItemLabel:"{type} {title}",recentEmpty:"還沒有瀏覽記錄。打開任一條目後會出現在這裏。",status:{done:"已完成",in_progress:"進行中",todo:"計劃中"},siteStatus:{done:"已對接",in_progress:"進行中"},catalogTitle:"書目著錄進度",catalogNote:"每條著錄對到作品條目",colCatalog:"書目",colRecords:"著錄條目",colMatched:"已對上作品",colProgress:"進度",colStatus:"狀態",relatedTitle:"同類書目與考證",relatedNote:"不在書架上的",allNWorks:"全部 {n} 部",nKinds:"{n} 種",allNKinds:"全部 {n} 種",pavilion:"閣",yearBC:"前{n}",missingLife:"生卒年未錄、未上軸:{names}",viewLineage:"看版本譜系 →",plannedSites:"計劃接入:{names}",loss:{extant:"存",partially_extant:"殘",lost:"佚",unknown:"未詳"},lossNote:{extant:"今有傳本",partially_extant:"部分存世",lost:"僅見著錄",unknown:"尚未判定"},lossCount:"{n} 部 · {note}",stat:{works:"作品",books:"版本",collections:"叢編",entities:"人物",has_image:"有影印",has_text:"有文本",article:"單篇文",poem:"單篇詩"},dataScale:"數據規模",byLoss:"按存佚檢索",license:"古籍元數據以 CC BY-SA 4.0 發布,可自由複製、改編、再發布,但須註明出處,並以相同方式共享。",repo:"數據倉庫:",repoNote:"(GitHub,CC BY-SA 4.0)",version:"當前數據版本:",download:"引用方式與數據下載 →",navLabel:"元數據首頁分區",nav:{zhi:"歷代史志",sibu:"四部",cong:"叢編",people:"人物",lineage:"版本譜系",sites:"在線資源",data:"數據與授權"},zhiSub:"正史藝文志、經籍志與後人補志,按所志朝代排列;每部志的著錄逐條對到作品",shelfLegendCount:"脊下數字=著錄條目",shelfLegendClick:"點書脊進作品頁",sibuSub:"全部作品按經史子集分類;與「目錄」頁同一棵分類樹",toCatalog:"進入目錄 →",unclassifiedNote:"多為只見於史志著錄、尚未歸類的書",congSub:"大型叢書、影印彙編、出土文獻與館藏,逐種列到版本",allNKindsMore:"全部 {n} 種 →",peopleSub:"歷代目錄學家,按生卒年排在一條時間軸上",allNPeopleMore:"全部 {n} 人 →",lineageSub:"版本多的作品,看各本的源流與異同",sitesSub:"外部數字圖書館與本站條目的對接",dataSub:"規模、存佚、許可與版本"},{typeShort:{work:"作",book:"版",collection:"丛",entity:"人"},typeLabel:{work:"作品",book:"版本",collection:"丛编",entity:"人物"},typeAll:"全部",typeChipsLabel:"按类型检索",recentTitle:"最近浏览",recentClear:"清除",recentItemLabel:"{type} {title}",recentEmpty:"还没有浏览记录。打开任一条目后会出现在这里。",status:{done:"已完成",in_progress:"进行中",todo:"计划中"},siteStatus:{done:"已对接",in_progress:"进行中"},catalogTitle:"书目著录进度",catalogNote:"每条著录对到作品条目",colCatalog:"书目",colRecords:"著录条目",colMatched:"已对上作品",colProgress:"进度",colStatus:"状态",relatedTitle:"同类书目与考证",relatedNote:"不在书架上的",allNWorks:"全部 {n} 部",nKinds:"{n} 种",allNKinds:"全部 {n} 种",pavilion:"阁",yearBC:"前{n}",missingLife:"生卒年未录、未上轴:{names}",viewLineage:"看版本谱系 →",plannedSites:"计划接入:{names}",loss:{extant:"存",partially_extant:"残",lost:"佚",unknown:"未详"},lossNote:{extant:"今有传本",partially_extant:"部分存世",lost:"仅见著录",unknown:"尚未判定"},lossCount:"{n} 部 · {note}",stat:{works:"作品",books:"版本",collections:"丛编",entities:"人物",has_image:"有影印",has_text:"有文本",article:"单篇文",poem:"单篇诗"},dataScale:"数据规模",byLoss:"按存佚检索",license:"古籍元数据以 CC BY-SA 4.0 发布,可自由复制、改编、再发布,但须注明出处,并以相同方式共享。",repo:"数据仓库:",repoNote:"(GitHub,CC BY-SA 4.0)",version:"当前数据版本:",download:"引用方式与数据下载 →",navLabel:"元数据首页分区",nav:{zhi:"历代史志",sibu:"四部",cong:"丛编",people:"人物",lineage:"版本谱系",sites:"在线资源",data:"数据与授权"},zhiSub:"正史艺文志、经籍志与后人补志,按所志朝代排列;每部志的著录逐条对到作品",shelfLegendCount:"脊下数字=著录条目",shelfLegendClick:"点书脊进作品页",sibuSub:"全部作品按经史子集分类;与「目录」页同一棵分类树",toCatalog:"进入目录 →",unclassifiedNote:"多为只见于史志著录、尚未归类的书",congSub:"大型丛书、影印汇编、出土文献与馆藏,逐种列到版本",allNKindsMore:"全部 {n} 种 →",peopleSub:"历代目录学家,按生卒年排在一条时间轴上",allNPeopleMore:"全部 {n} 人 →",lineageSub:"版本多的作品,看各本的源流与异同",sitesSub:"外部数字图书馆与本站条目的对接",dataSub:"规模、存佚、许可与版本"}),bo=bt({readable:"部可讀",pieces:"篇單篇詩文",startReading:"開始閱讀 →",nCopies:"{n}本",shelfHint:"按所志朝代排列,一脊一部",shelfLegendCount:"脊下「2本」=站內有幾個本子",shelfOther:"其他",shelfRegion:"{label}書架,可橫向滾動",origZhi:"正史原志",laterZhi:"後人補撰、續補",spineBy:"{name} 撰",spineRecords:"著錄 {n} 條",spineOnSite:"站內 {n}",nWorks:"{n} 部",allNWorks:"全部 {n} 部",nCopiesCard:"{n} 個本子",workPageLink:"作品頁:{title}的源流與全部版本 →",sibuUnclassifiedNote:"書目分類還沒補齊,其中多數是單篇詩文,已單列在下方。",subClasses:"{label}子類",allNClasses:"{label}全部 {n} 類 →",unclassified:"未分類",viewUnclassified:"查看未分類 →",periodItem:"{label},{n} 部",periodUnknown:"另有 {n} 部作者無朝代,在「四部」和搜索裏能找到",hoverHint:"窄段懸停看全名",nPieces:"{n} 篇",authorAll:"{name}全部 {n} 篇 →",period:{xianqin:"先秦",qinhan:"秦漢",weijin:"魏晉南北朝",suitang:"隋唐五代",song:"宋",liaojinyuan:"遼金元",ming:"明",qing:"清",modern:"近現代"},navLabel:"閱讀首頁分區",nav:{picks:"推薦閱讀",topics:"專題",famous:"名著與版本",sibu:"四部",period:"按年代",pieces:"單篇詩文"},picksSub:"編輯挑選,定期輪換",topicsSub:"按作品類型歸組;小說見下方「名著與版本」",famousSub:"一部作品一張卡,卡上列出站內能讀的各個本子",sibuSub:"按古籍總目的分類樹,只計站內可讀的作品",periodSub:"按作者朝代歸段,寬度與部數成比例",piecesSub:"單篇的詩、文、賦、表,按作者歸組",piecesMore:"按作者瀏覽全部 →"},{readable:"部可读",pieces:"篇单篇诗文",startReading:"开始阅读 →",nCopies:"{n}本",shelfHint:"按所志朝代排列,一脊一部",shelfLegendCount:"脊下「2本」=站内有几个本子",shelfOther:"其他",shelfRegion:"{label}书架,可横向滚动",origZhi:"正史原志",laterZhi:"后人补撰、续补",spineBy:"{name} 撰",spineRecords:"著录 {n} 条",spineOnSite:"站内 {n}",nWorks:"{n} 部",allNWorks:"全部 {n} 部",nCopiesCard:"{n} 个本子",workPageLink:"作品页:{title}的源流与全部版本 →",sibuUnclassifiedNote:"书目分类还没补齐,其中多数是单篇诗文,已单列在下方。",subClasses:"{label}子类",allNClasses:"{label}全部 {n} 类 →",unclassified:"未分类",viewUnclassified:"查看未分类 →",periodItem:"{label},{n} 部",periodUnknown:"另有 {n} 部作者无朝代,在「四部」和搜索里能找到",hoverHint:"窄段悬停看全名",nPieces:"{n} 篇",authorAll:"{name}全部 {n} 篇 →",period:{xianqin:"先秦",qinhan:"秦汉",weijin:"魏晋南北朝",suitang:"隋唐五代",song:"宋",liaojinyuan:"辽金元",ming:"明",qing:"清",modern:"近现代"},navLabel:"阅读首页分区",nav:{picks:"推荐阅读",topics:"专题",famous:"名著与版本",sibu:"四部",period:"按年代",pieces:"单篇诗文"},picksSub:"编辑挑选,定期轮换",topicsSub:"按作品类型归组;小说见下方「名著与版本」",famousSub:"一部作品一张卡,卡上列出站内能读的各个本子",sibuSub:"按古籍总目的分类树,只计站内可读的作品",periodSub:"按作者朝代归段,宽度与部数成比例",piecesSub:"单篇的诗、文、赋、表,按作者归组",piecesMore:"按作者浏览全部 →"}),Gu=bt({sideNav:"分類導航",classification:"分類",drawerLabel:"分類:{path}",all:"全部",allTitle:"全部典籍",stat:"共 {total} 種 · 每頁 {size} 條",statPage:" · 第 {page} / {pages} 頁",viewLabel:"呈現方式",viewCard:"卡片",viewList:"列表",juanN:"{n}卷",pagerLabel:"分頁",prevPage:"上一頁",nextPage:"下一頁",pageN:"第 {n} 頁",emptyWorks:"此類暫無作品",zhulu:"著錄",cunmu:"存目",categoriesN:"{n} 類",divisionStat:"{cats} 類 · {books} 部",categoryJuan:"卷{n}",booksN:"{n} 部",expandAllN:"展開全部 {n} 條"},{sideNav:"分类导航",classification:"分类",drawerLabel:"分类:{path}",all:"全部",allTitle:"全部典籍",stat:"共 {total} 种 · 每页 {size} 条",statPage:" · 第 {page} / {pages} 页",viewLabel:"呈现方式",viewCard:"卡片",viewList:"列表",juanN:"{n}卷",pagerLabel:"分页",prevPage:"上一页",nextPage:"下一页",pageN:"第 {n} 页",emptyWorks:"此类暂无作品",zhulu:"著录",cunmu:"存目",categoriesN:"{n} 类",divisionStat:"{cats} 类 · {books} 部",categoryJuan:"卷{n}",booksN:"{n} 部",expandAllN:"展开全部 {n} 条"}),Yu=bt({loss:{all:"全部",extant:"存",partially_extant:"殘",lost:"佚"},unclassified:"未分類",statBook:"書",statComma:",",statBookCopies:"本",statArticle:"文章",statArticleUnit:"篇",statPoem:"詩詞",statPoemUnit:"首",statCollection:"叢編",submit:"搜索"},{loss:{all:"全部",extant:"存",partially_extant:"残",lost:"佚"},unclassified:"未分类",statBook:"书",statComma:",",statBookCopies:"本",statArticle:"文章",statArticleUnit:"篇",statPoem:"诗词",statPoemUnit:"首",statCollection:"丛编",submit:"搜索"}),qu=bt({title:"反饋",close:"關閉",submitType:{bug:"反饋錯誤",resource:"添加資源",suggestion:"功能建議",contact:"想參與"},placeholder:{bug:"請描述您發現的錯誤,包括頁面位置和具體內容",resource:"請提供完整資源鏈接和簡要版本說明",suggestion:"您希望網站增加或改進什麼?",contact:"想參與整理、校對或合作?簡單介紹一下您自己,並留下聯繫方式(此類留言不公開)"},chooseTypeFirst:"請先選擇反饋類型",contactPlaceholder:"郵箱(選填,僅站方可見,方便我們回覆您)",contactLabel:"聯繫方式(選填)",submitFailedRetry:"提交失敗,請稍後重試",submitFailed:"提交失敗",thanks:"感謝您的反饋!",viewList:"查看反饋列表 →",continueSubmit:"繼續提交",submitting:"提交中...",submit:"提交",submitFeedback:"提交反饋",listType:{bug:"錯誤反饋",resource:"資源建議",suggestion:"功能建議",other:"其他"},status:{pending:"待處理",in_progress:"處理中",resolved:"已處理",wontfix:"不採納",duplicate:"重複"},empty:"暫無反饋",reply:"回覆"},{title:"反馈",close:"关闭",submitType:{bug:"反馈错误",resource:"添加资源",suggestion:"功能建议",contact:"想参与"},placeholder:{bug:"请描述您发现的错误,包括页面位置和具体内容",resource:"请提供完整资源链接和简要版本说明",suggestion:"您希望网站增加或改进什么?",contact:"想参与整理、校对或合作?简单介绍一下您自己,并留下联系方式(此类留言不公开)"},chooseTypeFirst:"请先选择反馈类型",contactPlaceholder:"邮箱(选填,仅站方可见,方便我们回复您)",contactLabel:"联系方式(选填)",submitFailedRetry:"提交失败,请稍后重试",submitFailed:"提交失败",thanks:"感谢您的反馈!",viewList:"查看反馈列表 →",continueSubmit:"继续提交",submitting:"提交中...",submit:"提交",submitFeedback:"提交反馈",listType:{bug:"错误反馈",resource:"资源建议",suggestion:"功能建议",other:"其他"},status:{pending:"待处理",in_progress:"处理中",resolved:"已处理",wontfix:"不采纳",duplicate:"重复"},empty:"暂无反馈",reply:"回复"}),Ku=bt({empty:"暫無版本傳承數據",emptyGraph:"暫無版本圖數據",modeList:"列表",modeGraph:"關係圖",collectionLabel:"集合:",collectionAll:"全部",collectionAllDesc:"顯示該作品所有版本(含橋接節點)",graphLoading:"加載圖組件中…",graphMissing:"圖組件未安裝。請安裝 {xyflow} 與 {dagre}。",graphMissingHint:"或使用 {list} 列表視圖。",bridgeTitle:"橋接節點:本身不在核心集,為保持派生鏈完整而顯示",otherGroup:"其他",lost:"已佚",fragment:"殘本",hypothetical:"假想祖本",bridge:"橋接",extant:"現存:{juan}",sources:"來源:",related:"關聯:",confidence:{certain:"確定",consensus:"共識",probable:"推測",disputed:"有爭議"}},{empty:"暂无版本传承数据",emptyGraph:"暂无版本图数据",modeList:"列表",modeGraph:"关系图",collectionLabel:"集合:",collectionAll:"全部",collectionAllDesc:"显示该作品所有版本(含桥接节点)",graphLoading:"加载图组件中…",graphMissing:"图组件未安装。请安装 {xyflow} 与 {dagre}。",graphMissingHint:"或使用 {list} 列表视图。",bridgeTitle:"桥接节点:本身不在核心集,为保持派生链完整而显示",otherGroup:"其他",lost:"已佚",fragment:"残本",hypothetical:"假想祖本",bridge:"桥接",extant:"现存:{juan}",sources:"来源:",related:"关联:",confidence:{certain:"确定",consensus:"共识",probable:"推测",disputed:"有争议"}}),Xu={common:Bu,detail:Ei,bookPage:Ou,workPage:Wu,collectionPage:Fu,entityPage:Hu,reader:Du,collated:Uu,metaHome:Vu,readHome:bo,catalogPage:Gu,searchPage:Yu,feedback:qu,lineage:Ku};function Zu(e){const n={};for(const[i,o]of Object.entries(Xu))n[i]=o[e];return n}function wt(e,n){return e.replace(/\{(\w+)\}/g,(i,o)=>String(n[o]??""))}const Ds=new Map;function zn(e){let n=Ds.get(e);return n||(n={...e==="zh-Hans"?Pu:Mu,...Zu(e)},Ds.set(e,n)),n}function Us(e,n){let i=e;for(const o of n.split(".")){if(i==null||typeof i!="object")return;i=i[o]}return typeof i=="string"?i:void 0}function Ml(e){return(n,i)=>{const o=Us(e,n)??Us(zn("zh-Hant"),n)??n;return i?wt(o,i):o}}const Vs=new Map;function Nn(e){let n=Vs.get(e);return n||(n=Ml(zn(e)),Vs.set(e,n)),n}const Pl="bim-locale";function Ju(){try{const e=localStorage.getItem(Pl);if(e==="zh-Hant"||e==="zh-Hans")return e}catch{}}function Qu(e){try{localStorage.setItem(Pl,e)}catch{}}const em="zh-Hans",tm=({locale:e,onLocaleChange:n,converter:i,children:o})=>{const[s,a]=g.useState(e??em),l=e??s;g.useEffect(()=>{if(e)return;const h=Ju();h&&h!==s&&a(h)},[]);const d=g.useMemo(()=>l==="zh-Hans"?i??Al():null,[l,i]),c=g.useCallback(h=>{a(h),Qu(h),n==null||n(h)},[n]),p=g.useMemo(()=>({locale:l,setLocale:c,messages:zn(l),converter:d}),[l,c,d]);return t.jsx(Mt.Provider,{value:p,children:o})};function Ae(){const e=g.useContext(Mt);return(e==null?void 0:e.messages)??zn("zh-Hant")}const nm=2e3;function Ue(){const e=g.useContext(Mt),n=(e==null?void 0:e.locale)??"zh-Hant",i=(e==null?void 0:e.converter)??null,o=g.useRef(new Map),s=g.useRef(n),a=g.useRef(i);(s.current!==n||a.current!==i)&&(o.current.clear(),s.current=n,a.current=i);const l=g.useCallback(d=>{if(!d)return"";if(!i)return d;const c=o.current.get(d);if(c!==void 0)return c;const p=i(d);if(o.current.size>=nm){const h=o.current.keys().next().value;h!==void 0&&o.current.delete(h)}return o.current.set(d,p),p},[i]);return g.useMemo(()=>({convert:l,locale:n,isSimplified:n==="zh-Hans"}),[l,n])}function re(){const e=g.useContext(Mt),{convert:n,locale:i,isSimplified:o}=Ue(),s=(e==null?void 0:e.messages)??zn("zh-Hant"),a=g.useMemo(()=>e?Ml(s):Nn("zh-Hant"),[e,s]);return g.useMemo(()=>({t:a,convert:n,locale:i,isSimplified:o,messages:s}),[a,n,i,o,s])}const Bl=["錄說語詞議樣書記類傳國經補藝紀編後與間條號為開總種無數據冊頁選時題爲詩萬證學續關東圖資歷來讀館論見鈔別進師輯陳覽寫現應從","點兩華實對員長註結闕殘檢閱當會單換體將裡訂處過區釋術頭錢譯識個電動顯問這認質還幾遺雖須專擇係網運權務變發機請風聲輸軍導產","話們車難報讓業設帶辦紙氣麼際聽親場買賣謝費漢庫遷馬叢孫於張義晉閣維曆欽則夢慶齋録舊內陽樓紅淵歸載稱隱遼計評觀禮龜黃興節併","餘齊韓簡霑並樂諸滸屬組篩紹緒劉蘇誤職夾廣蓋敘斷歐寬駰極參試雜魯沒順線貞該測鮮統戰檔衛辭聯臺贊刪聖貫啟瀏譜薈寶約嘗諜謂舉詳","異賦軾復諒構級審標劃彙吳楊暫轉項寧硯蕭儀禪韻掃閉倉麗禎錯監鞏轍繫説筆竄縣聞諡賈僅擊羅宮訓談誌葉視戶細許祿繪鍵絕欄鑑講誕馮","趙習樹饋確賜裝擬規繼製薦畫鉛獨誠遠龍門覺訣隸軒諭繕塊爭鏡裏豐碼備掛堯錦駕鶴遊傷猶鄒瑩綴揚詔託僞頗竊虛莊歲禍爾辯獲篤窮盡跡","萊終穎訛瑣鐫繡廟幀佈躍雙預連狀態軸複懸遞灣箋頌訪層鏈敗達鈞鳳亂奮豈陰婁騎純優獻靈牆隨摺疊驗徑橫瀾蔣壞鈕盤範圍責減籤適側","榮聶頃縉讎銓廳軌厲鶚駢醫駝黨鐘諫樞滄軻溫贈鐵徵賴蹟潁閒顗歿駁歟勸諷誼湯詐脫羣尋澤擄顏釀謄鴻離騷傑滯憤執廢懼匱歎毀蠶獄寵闇","陸淺貨輕貧俠賤貴煩競樑鳩採綜謬鳴養堅韋顎呂蘭脈峯鵲兒賞籠階緊綱漁荊嬰慍潛營鎔繞陣塚億負卻塵懷閨擋撐縮領滾輪匯撈貼讚創險團","隊準礙強髒藥鮑顧給緯悅帳巖廬貢亞壇惡諱鎮薊驍愛討彌護揮偉輒擾況較響喪鑰藍"].join(""),im=new Set([...Bl,...Object.keys(ze.VARIANT_CHARS),...Object.keys(Cl.VARIANT_SUPPLEMENT)]),Ol=[...Ll,"切換為繁體","漢籍リポジトリ"];function rm(e,n=Ol){let i=e;for(const a of n)a&&(i=i.split(a).join(" "));const o=[],s=Array.from(i);return s.forEach((a,l)=>{im.has(a)&&o.push({char:a,context:s.slice(Math.max(0,l-8),l+9).join("")})}),o}function om(e,n,i){return e?e==="orig"?null:n==="zh-Hans"?i??Al():e==="hant"?ze.normalizeVariants:i:n==="zh-Hans"?i:ze.normalizeVariants}const sm=({mode:e,children:n})=>{const i=g.useContext(Mt),o=g.useMemo(()=>i&&{...i,converter:om(e,i.locale,i.converter)},[i,e]);return t.jsx(Mt.Provider,{value:o,children:n})};function am(e){if(!e)return"";try{const n=new URL(e).hostname,i={"zh.wikisource.org":"wikisource","www.shidianguji.com":"shidianguji","shidianguji.com":"shidianguji","archive.org":"archive","ctext.org":"ctext","read.nlc.cn":"nlc","www.digital.archives.go.jp":"japan_archives"};if(i[n])return i[n];const o=n.split(".");return o.length>=2?o[o.length-2]:n}catch{return""}}function Gs(e){return e==="text+image"?["text","image"]:[e]}function Ys(e){const n=Vt(e);return n.length===0?"text":Eu(n)}function lm(){return{id:"",name:"",url:"",types:["text"],details:""}}const Mr=({items:e,onChange:n,onDownload:i,downloadStatuses:o,filterType:s})=>{const a=Ae(),[l,d]=g.useState(null),c=[{value:"text",label:a.resourceTypeShort.text},{value:"image",label:a.resourceTypeShort.image},{value:"text+image",label:a.resourceTypeShort.textImage},{value:"physical",label:a.resourceTypeShort.physical}],p=[{value:"catalog",label:a.rootType.catalog},{value:"search",label:a.rootType.search}],h=w=>{if(!s)return!0;const v=Vt(w);return s==="text"?v.includes("text"):s==="image"?v.includes("image")||v.includes("physical"):s==="physical"?v.includes("physical"):v.includes(s)},m=e.map((w,v)=>({item:w,originalIndex:v})).filter(({item:w})=>h(w)),u=()=>{const w=lm();s&&(w.types=Gs(s)),n([...e,w]),d(e.length)},f=w=>{n(e.filter((v,k)=>k!==w)),d(null)},x=(w,v,k)=>{const z=[...e];if(z[w]={...z[w],[v]:k},v==="url"&&!z[w].id){const C=am(k);C&&(z[w].id=C)}n(z)},j=(w,v)=>{const k=[...e],{type:z,...C}=k[w];k[w]={...C,types:Gs(v)},n(k)},y=(w,v,k)=>{const C={...e[w].metadata||{}};k?C[v]=k:delete C[v],x(w,"metadata",Object.keys(C).length>0?C:void 0)},S=(w,v)=>{const k=v.trim()?v.split(/[,,、]/).map(z=>z.trim()).filter(Boolean):void 0;x(w,"structure",k)},b=(w,v,k)=>{const C=e[w].coverage||{level:1,ranges:""};v==="level"?C.level=parseInt(k)||1:C.ranges=k,x(w,"coverage",C.ranges?C:void 0)};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[m.map(({item:w,originalIndex:v})=>{var k,z,C;return t.jsxs("div",{style:{border:`1px solid ${r("widget-border")}`,borderRadius:"4px",background:r("input-bg"),overflow:"hidden"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"8px 12px",cursor:"pointer",gap:"8px"},onClick:()=>d(l===v?null:v),children:[t.jsx("span",{style:{opacity:.6,fontSize:"12px"},children:l===v?"▼":"▶"}),t.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:cm(Ys(w)),color:r("on-color-fg")},children:(()=>{var I,T;const _=Vt(w);return _.length===0?"text":_.length===1?((I=c.find(N=>N.value===_[0]))==null?void 0:I.label)??_[0]:_.includes("text")&&_.includes("image")?((T=c.find(N=>N.value==="text+image"))==null?void 0:T.label)??"text+image":_.join("+")})()}),t.jsx("span",{style:{flex:1,fontSize:"13px",fontWeight:500},children:w.name||`${a.editor.resourcePlaceholder} ${v+1}`}),w.id&&t.jsx("span",{style:{fontSize:"11px",opacity:.5},children:w.id}),w.url&&t.jsx("a",{href:w.url,target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),style:{fontSize:"12px",opacity:.7},children:"🔗"}),i&&w.url&&dm(v,o==null?void 0:o[v],i,a),t.jsx("button",{onClick:_=>{_.stopPropagation(),f(v)},style:{background:"transparent",border:"none",color:r("danger"),cursor:"pointer",padding:"2px 6px",fontSize:"14px"},title:a.editor.deleteThisResource,children:"✕"})]}),l===v&&t.jsxs("div",{style:{padding:"12px",borderTop:`1px solid ${r("widget-border")}`},children:[Tu(w,"image")&&w.url&&pm(w,a),t.jsxs("div",{style:{display:"grid",gap:"8px"},children:[t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("label",{style:An,children:[t.jsx("span",{style:Mn,children:a.label.type}),t.jsx("select",{value:Ys(w),onChange:_=>j(v,_.target.value),style:{...Rt,flex:1},children:c.map(_=>t.jsx("option",{value:_.value,children:_.label},_.value))})]}),t.jsxs("label",{style:An,children:[t.jsx("span",{style:Mn,children:a.label.rootType}),t.jsx("select",{value:w.root_type||"catalog",onChange:_=>x(v,"root_type",_.target.value),style:{...Rt,flex:1},children:p.map(_=>t.jsx("option",{value:_.value,children:_.label},_.value))})]})]}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsx("input",{type:"text",value:w.id,onChange:_=>x(v,"id",_.target.value),placeholder:a.editor.idAutoExtract,style:{...Rt,width:"140px",flexShrink:0}}),t.jsx("input",{type:"text",value:w.name,onChange:_=>x(v,"name",_.target.value),placeholder:a.editor.resourceName,style:{...Rt,flex:1}})]}),t.jsx("input",{type:"text",value:w.url,onChange:_=>x(v,"url",_.target.value),placeholder:a.editor.resourceUrl,style:Rt}),t.jsx("input",{type:"text",value:((k=w.structure)==null?void 0:k.join("、"))||"",onChange:_=>S(v,_.target.value),placeholder:a.editor.structurePlaceholder,style:Rt}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsxs("label",{style:An,children:[t.jsx("span",{style:Mn,children:a.label.coverageLevel}),t.jsx("input",{type:"number",min:1,value:((z=w.coverage)==null?void 0:z.level)??"",onChange:_=>b(v,"level",_.target.value),placeholder:"1",style:{...Rt,width:"60px"}})]}),t.jsxs("label",{style:{...An,flex:1},children:[t.jsx("span",{style:Mn,children:a.label.coverageRange}),t.jsx("input",{type:"text",value:((C=w.coverage)==null?void 0:C.ranges)||"",onChange:_=>b(v,"ranges",_.target.value),placeholder:a.editor.coverageRangePlaceholder,style:{...Rt,flex:1}})]})]}),t.jsx("textarea",{value:w.details||"",onChange:_=>x(v,"details",_.target.value),placeholder:a.editor.detailsPlaceholder,style:{...Rt,minHeight:"60px",resize:"vertical"}}),t.jsxs("div",{style:{borderTop:`1px solid ${r("widget-border")}`,paddingTop:"8px",marginTop:"4px"},children:[t.jsx("div",{style:{fontSize:"12px",color:r("desc-fg"),marginBottom:"6px"},children:a.label.metadata}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"6px"},children:Object.entries(a.metadata).map(([_,I])=>{var T;return t.jsxs("label",{style:{...An,gap:"4px"},children:[t.jsx("span",{style:{...Mn,minWidth:"56px"},children:I}),t.jsx("input",{type:"text",value:((T=w.metadata)==null?void 0:T[_])||"",onChange:N=>y(v,_,N.target.value),placeholder:I,style:{...Rt,flex:1}})]},_)})})]})]})]})]},v)}),t.jsxs("button",{onClick:u,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"8px 16px",border:`1px dashed ${r("widget-border")}`,borderRadius:"4px",background:"transparent",color:r("fg"),cursor:"pointer",fontSize:"13px",opacity:.8},children:[t.jsx("span",{children:"+"}),t.jsx("span",{children:a.action.addResource})]})]})};function cm(e){switch(e){case"text":return r("restype-text");case"image":return r("restype-image");case"text+image":return r("restype-text-image");case"physical":return r("restype-physical")}}function dm(e,n,i,o){const s=(n==null?void 0:n.status)==="downloading",a=(n==null?void 0:n.status)==="completed";return t.jsx("button",{onClick:l=>{l.stopPropagation(),s||i(e,"")},disabled:s,style:{background:"transparent",border:"none",color:r(a?"success":s?"desc-fg":"link-fg"),cursor:s?"default":"pointer",padding:"2px 6px",fontSize:"12px",opacity:s?.6:.9},title:a?o.download.completed:s?`${o.download.downloading} ${(n==null?void 0:n.progress)||0}%`:o.download.downloadThis,children:a?"✓":s?"⏳":"⬇"})}function pm(e,n){const i=/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(e.url)||e.url.includes("iiif")||e.url.includes("image");return t.jsx("div",{style:{marginBottom:"12px"},children:i?t.jsx("div",{style:{width:"100%",maxHeight:"150px",overflow:"hidden",borderRadius:"4px",background:r("overlay-bg")},children:t.jsx("img",{src:e.url,alt:e.name,style:{width:"100%",height:"150px",objectFit:"contain"},onError:o=>{o.target.style.display="none"}})}):t.jsx("div",{style:{padding:"12px",background:r("overlay-bg"),borderRadius:"4px",fontSize:"12px",color:r("desc-fg")},children:n.editor.imageResourceLink})})}const Rt={width:"100%",padding:"6px 8px",background:r("input-bg"),color:r("input-fg"),border:`1px solid ${r("input-border")}`,borderRadius:"2px",fontSize:"13px",boxSizing:"border-box"},An={display:"flex",alignItems:"center",gap:"6px"},Mn={fontSize:"12px",color:r("desc-fg"),whiteSpace:"nowrap"},qs={text:r("restype-text"),image:r("restype-image"),"text+image":r("restype-text-image"),physical:r("restype-physical")};function um(e){return e.includes("text")&&e.includes("image")?qs["text+image"]:qs[e[0]||"physical"]}const yo=({items:e,groupByType:n=!0,resourceGroups:i,onNavigate:o,renderLink:s})=>{const a=Ae(),{convert:l}=Ue(),d=g.useMemo(()=>go(e||[]),[e]),{mirrorGroups:c,ungroupedItems:p}=g.useMemo(()=>{const y=new Map,S=[];for(const b of d){const w=b.group;w?(y.has(w)||y.set(w,[]),y.get(w).push(b)):S.push(b)}for(const b of y.values())b.sort((w,v)=>{const k=z=>z.group_role==="origin"?0:z.group_role==="mirror"?1:2;return k(w)-k(v)});return{mirrorGroups:y,ungroupedItems:S}},[d]),h={text:a.resourceType.text,image:a.resourceType.image,"text+image":a.resourceType.textImage,physical:a.resourceType.physical},m=y=>h[y]?h[y]:y.split("+").map(S=>h[S]||S).join("+");if(!d||d.length===0)return t.jsx("div",{style:{padding:"16px",color:r("desc-fg"),fontSize:"13px",textAlign:"center"},children:a.misc.noResources});if(!n)return t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:d.map((y,S)=>t.jsx(gr,{item:y},y.id||S))});const u=(y,S)=>{const b=i==null?void 0:i[y],w=(b==null?void 0:b.label)||y,v=b==null?void 0:b.description;return t.jsxs("div",{style:{padding:"10px 12px",border:`1px solid ${r("widget-border")}`,borderRadius:"6px",background:r("input-bg"),display:"flex",flexDirection:"column",gap:"8px"},children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:r("fg")},children:l(w)}),v&&t.jsx("div",{style:{fontSize:"12px",color:r("desc-fg"),lineHeight:1.5},children:l(v)}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:S.map((k,z)=>t.jsx(gr,{item:k,onNavigate:o,renderLink:s},k.id||z))})]},`group-${y}`)},f=new Map;for(const y of p){const S=ho(Vt(y));f.has(S)||f.set(S,[]),f.get(S).push(y)}const x=["text","image","text+image","physical"],j=[...x.filter(y=>f.has(y)),...[...f.keys()].filter(y=>!x.includes(y)).sort()];return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[[...c.entries()].map(([y,S])=>u(y,S)),j.map(y=>{const S=f.get(y),b=um(y.split("+"));return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",flexWrap:"wrap"},children:[t.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:b,whiteSpace:"nowrap",flexShrink:0},children:m(y)}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:S.map((w,v)=>t.jsx(gr,{item:w,onNavigate:o,renderLink:s},w.id||v))})]},y)})]})},mm={bw:{label:"",bg:r("colormode-bw-bg"),fg:r("colormode-bw-fg")},color:{label:"",bg:r("colormode-color-bg"),fg:r("colormode-color-fg")}},gr=({item:e})=>{const n=Ae(),{convert:i}=Ue(),[o,s]=g.useState(!1),a=g.useMemo(()=>(e.url?$n(e.url):void 0)||i(e.name),[e.url,e.name,i]),l=g.useMemo(()=>!Array.isArray(e.volumes)||e.volumes.length===0?null:e.volumes.map(x=>({...x,url:x.url||Rl(x)})),[e.volumes]),d=l&&l.length>0,c=d?new Set(l.filter(x=>x.status!=="missing").map(x=>x.volume)).size:0,p=d?new Set(l.filter(x=>x.status==="missing").map(x=>x.volume)).size:0,h=e.expected_volumes??(d?c+p:0),m=e.color_mode?{...mm[e.color_mode],label:n.colorMode[e.color_mode]}:null,u=e.details&&!d?i(e.details):null,f={display:"inline-flex",alignItems:"center",gap:"5px",padding:"4px 10px",border:`1px solid ${r("widget-border")}`,borderRadius:"5px",background:r("input-bg"),fontSize:"12px",color:r("fg"),lineHeight:1.4,verticalAlign:"middle"};return t.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"4px"},children:[t.jsxs("div",{style:f,children:[t.jsx("span",{style:{fontWeight:500},children:a}),m&&t.jsx("span",{style:{padding:"0 5px",borderRadius:"3px",fontSize:"10px",fontWeight:500,background:m.bg,color:m.fg},children:m.label}),u&&t.jsx("span",{style:{fontSize:"11px",color:r("desc-fg")},children:u}),d&&t.jsxs("span",{style:{fontSize:"11px",color:r("desc-fg")},children:[c,"/",h,n.unit.volume,p>0&&t.jsx("span",{style:{color:r("missing-fg"),marginLeft:"3px"},children:wt(n.common.volumesMissing,{n:p})})]}),e.url&&t.jsx("a",{href:(()=>{const x=fo(e.metadata);return x?xo(e.url,x):e.url})(),target:"_blank",rel:"noopener noreferrer",style:{fontSize:"11px",color:r("link-fg"),textDecoration:"none",whiteSpace:"nowrap"},children:n.action.visit}),d&&t.jsx("button",{onClick:()=>s(!o),style:{padding:"0 6px",fontSize:"11px",border:"none",background:"transparent",color:r("desc-fg"),cursor:"pointer",lineHeight:1.4},children:o?"▲":"▼"})]}),d&&o&&t.jsx("div",{style:{padding:"6px 10px",border:`1px solid ${r("widget-border")}`,borderRadius:"5px",display:"flex",flexWrap:"wrap",gap:"4px",maxWidth:"360px"},children:l.map(x=>{const j=x.status==="missing";return x.url&&!j?t.jsx("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",padding:"1px 5px",fontSize:"11px",borderRadius:"3px",border:`1px solid ${r("widget-border")}`,color:r("link-fg"),textDecoration:"none"},children:x.volume},x.volume):t.jsx("span",{style:{display:"inline-block",padding:"1px 5px",fontSize:"11px",color:r(j?"missing-fg":"desc-fg"),textDecoration:j?"line-through":"none",opacity:j?.6:1},children:x.volume},x.volume)})})]})},Wl=({indexSource:e,syncConfig:n,variant:i="index-browser",onSwitchMode:o,onToggleDraft:s,onConfigurePath:a,onSelectFolder:l})=>{const d=Ae(),c=e==="local",p=(n==null?void 0:n.isDraft)??!0,h=(n==null?void 0:n.repoPath)||"",m=h?h.split(/[/\\]/).pop()||h:"",u={display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"8px",fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"opacity 0.2s",border:"none",background:r("primary-soft"),color:r("primary")},f={onMouseOver:j=>j.currentTarget.style.opacity="0.8",onMouseOut:j=>j.currentTarget.style.opacity="1"},x=t.jsxs("div",{onClick:s,title:p?d.mode.switchToOfficial:d.mode.switchToDraft,style:{...u,background:r(p?"warning":"success"),color:r("on-color-fg")},...f,children:[t.jsx("span",{children:p?"📝":"📚"}),t.jsx("span",{children:p?"draft":"official"})]});return i==="index-browser"?c?t.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[x,t.jsxs("div",{onClick:o,title:d.mode.switchToSync,style:u,...f,children:[t.jsx("span",{children:"📁"}),t.jsx("span",{children:d.mode.localMode}),t.jsx("span",{style:{opacity:.6,marginLeft:"4px"},children:"⇄"})]}),t.jsxs("div",{onClick:l,title:h||d.mode.selectFolder,style:{...u,paddingLeft:"8px",paddingRight:"8px"},...f,children:[t.jsx("span",{children:"📂"}),m&&t.jsx("span",{style:{fontSize:"11px",opacity:.9},children:m})]})]}):t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x,t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t.jsxs("div",{onClick:o,title:d.mode.switchToLocal,style:u,...f,children:[t.jsx("span",{children:"🌐"}),t.jsx("span",{children:d.mode.syncMode}),t.jsx("span",{style:{opacity:.6,marginLeft:"4px"},children:"⇄"})]}),t.jsx("div",{onClick:a,title:m||d.mode.configurePath,style:{...u,background:"transparent",padding:"6px",fontSize:"12px"},...f,children:t.jsx("span",{children:"⚙️"})})]})]}):t.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[t.jsxs("div",{onClick:o,title:c?d.mode.switchToGithub:d.mode.switchToLocal,style:u,...f,children:[t.jsx("span",{children:c?"📁":"🌐"}),t.jsx("span",{children:c?d.mode.localMode:d.mode.githubSync}),t.jsx("span",{style:{opacity:.6},children:"⇄"})]}),c&&t.jsxs("div",{onClick:l,title:h||d.mode.selectFolder,style:{...u,paddingLeft:"8px",paddingRight:"8px",minWidth:h?"100px":"auto",justifyContent:"space-between"},...f,children:[t.jsx("span",{children:"📂"}),m&&t.jsx("span",{style:{fontSize:"11px",opacity:.9},children:m})]}),!c&&m&&t.jsxs("div",{style:{...u,background:r("mode-active-bg"),color:r("on-color-fg"),cursor:"default"},title:h,children:[t.jsx("span",{children:"📂"}),t.jsx("span",{style:{fontSize:"11px"},children:m})]})]})},Li="bim-search-history",Ks=10,Xs=8;function Dn(){try{const e=localStorage.getItem(Li);return e?JSON.parse(e):[]}catch{return[]}}function Fl(e){try{const n=Dn().filter(i=>i!==e);n.unshift(e),n.length>Ks&&(n.length=Ks),localStorage.setItem(Li,JSON.stringify(n))}catch{}}function hm(e){try{const n=Dn().filter(i=>i!==e);localStorage.setItem(Li,JSON.stringify(n))}catch{}}function gm(){try{localStorage.removeItem(Li)}catch{}}const Hl=({transport:e,value:n,onChange:i,onSearch:o,onEntrySelect:s,placeholder:a})=>{const l=Ae(),d=a??l.search.placeholder,c={work:l.indexType.work,book:l.indexType.book,collection:l.indexType.collection,entity:l.indexType.entity},[p,h]=g.useState(!1),[m,u]=g.useState([]),[f,x]=g.useState(-1),[j,y]=g.useState(Dn),S=g.useRef(null),b=g.useRef(null),w=g.useRef(null),v=g.useRef(!1);g.useEffect(()=>{x(-1);const N=n.trim();if(!N){u(j.map(F=>({type:"history",text:F})));return}if(!e.searchAll){u([]);return}let E=!1;const W=setTimeout(()=>{e.searchAll(N,Xs).then(F=>{if(E)return;const A=[...F.works,...F.books,...F.collections,...F.entities??[]];u(A.slice(0,Xs).map(V=>({type:"entry",text:V.title||V.id,entry:V})))}).catch(()=>{E||u([])})},80);return()=>{E=!0,clearTimeout(W)}},[n,j,e]),g.useEffect(()=>{const N=E=>{w.current&&!w.current.contains(E.target)&&h(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),g.useEffect(()=>{const N=E=>{var W,F;if(E.key==="/"&&document.activeElement!==S.current){const A=(W=document.activeElement)==null?void 0:W.tagName;if(A==="INPUT"||A==="TEXTAREA"||A==="SELECT")return;E.preventDefault(),(F=S.current)==null||F.focus()}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[]);const k=g.useCallback(N=>{N.trim()&&(Fl(N.trim()),y(Dn())),o(N),h(!1)},[o]),z=g.useCallback(N=>{N.type==="history"?(i(N.text),k(N.text)):N.entry&&(s?(s(N.entry),h(!1)):(i(N.text),k(N.text)))},[i,k,s]),C=g.useCallback(N=>{if(!p||m.length===0){N.key==="Enter"&&k(n);return}switch(N.key){case"ArrowDown":N.preventDefault(),x(E=>(E+1)%m.length);break;case"ArrowUp":N.preventDefault(),x(E=>(E-1+m.length)%m.length);break;case"Enter":N.preventDefault(),f>=0&&f<m.length?z(m[f]):k(n);break;case"Escape":N.preventDefault(),h(!1);break}},[p,m,f,n,k,z]),_=g.useCallback((N,E)=>{E.stopPropagation(),hm(N),y(Dn()),u(W=>W.filter(F=>!(F.type==="history"&&F.text===N)))},[]),I=g.useCallback(N=>{N.stopPropagation(),gm(),y([]),u([])},[]);g.useEffect(()=>{if(f>=0&&b.current){const N=b.current.children;N[f]&&N[f].scrollIntoView({block:"nearest"})}},[f]);const T=!n.trim()&&j.length>0;return t.jsxs("div",{ref:w,style:{position:"relative",flex:1},children:[t.jsx("input",{ref:S,type:"text",placeholder:d,value:n,onChange:N=>{i(N.target.value),h(!0)},onCompositionStart:()=>{v.current=!0},onCompositionEnd:()=>{v.current=!1},onFocus:()=>{h(!0)},onKeyDown:C,style:{width:"100%",padding:"8px 12px",border:`1px solid ${r("input-border")}`,borderRadius:"6px",background:r("input-bg"),color:r("input-fg"),fontSize:"14px",boxSizing:"border-box"}}),p&&m.length>0&&t.jsxs("div",{ref:b,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:r("input-bg"),border:`1px solid ${r("widget-border")}`,borderRadius:"6px",boxShadow:r("shadow-dropdown"),zIndex:100,maxHeight:"320px",overflow:"auto"},children:[T&&t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 12px",fontSize:"11px",color:r("desc-fg"),borderBottom:`1px solid ${r("widget-border")}`},children:[t.jsx("span",{children:l.search.history}),t.jsx("button",{onClick:I,style:{border:"none",background:"transparent",color:r("desc-fg"),cursor:"pointer",fontSize:"11px",padding:"0 4px"},children:l.search.clearAll})]}),m.map((N,E)=>t.jsxs("div",{onClick:()=>z(N),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",cursor:"pointer",fontSize:"13px",color:r("fg"),background:E===f?r("list-active-bg"):"transparent"},children:[t.jsx("span",{style:{fontSize:"12px",opacity:.5,width:"16px",textAlign:"center"},children:N.type==="history"?"🕐":"🔍"}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.text}),N.entry&&t.jsxs("span",{style:{fontSize:"11px",color:r("desc-fg"),flexShrink:0},children:[c[N.entry.type],N.entry.edition&&` · ${N.entry.edition}`,N.entry.author&&` · ${N.entry.author}`]}),N.type==="history"&&t.jsx("button",{onClick:W=>_(N.text,W),style:{border:"none",background:"transparent",color:r("desc-fg"),cursor:"pointer",fontSize:"12px",padding:"0 2px",lineHeight:1},title:l.action.remove,children:"×"})]},`${N.type}-${N.text}-${E}`))]})]})},Tn=({type:e,size:n=9})=>t.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:n,height:n,borderRadius:1,flex:"none",background:r(`type-${e}`),verticalAlign:"middle"}}),Dl=["西漢","東漢","三國","西晉","東晉","南北朝","南朝","北朝","隋","唐","五代","北宋","南宋","宋","遼","西夏","金","元","南明","明","清","民國","日本","朝鮮","高麗","越南","琉球","西汉","东汉","西晋","东晋","南北朝","南朝","北朝","辽","民国","朝鲜","高丽"],fm={北宋:"宋",南宋:"宋",西漢:"漢",東漢:"漢",西汉:"漢",东汉:"漢",西晉:"晉",東晉:"晉",西晋:"晉",东晋:"晉",南明:"明",民国:"民國",辽:"遼",朝鲜:"朝鮮",高丽:"高麗",南北朝:"南北朝",南朝:"南北朝",北朝:"南北朝"};function ct(e){return fm[e]??e}const kn=[{pattern:/欽定四庫全書薈要|摛藻堂/,era:"清",reign:"乾隆"},{pattern:/欽定四庫全書|四庫全書|文淵閣|文瀾閣|文溯閣|文津閣|文匯閣|文宗閣|文瀾閣/,era:"清",reign:"乾隆"},{pattern:/钦定四库全书|四库全书|文渊阁|文澜阁|文溯阁|文津阁/,era:"清",reign:"乾隆"},{pattern:/武英殿聚珍|聚珍版/,era:"清",reign:"乾隆"},{pattern:/武英殿/,era:"清"},{pattern:/百衲本|涵芬樓|涵芬楼|商務印書館|商务印书馆|中華書局|中华书局/,era:"民國"},{pattern:/汲古閣|汲古阁/,era:"明",reign:"崇禎"}],wn={熹平:172,建安:196,黃初:220,正始:240,廣政:938,太康:280,永和:345,開皇:581,貞觀:627,開元:713,天寶:742,貞元:785,元和:806,開成:836,會昌:841,咸通:860,建隆:960,太平興國:976,咸平:998,天禧:1017,慶曆:1041,皇祐:1049,嘉祐:1056,治平:1064,熙寧:1068,元豐:1078,元祐:1086,紹聖:1094,崇寧:1102,大觀:1107,政和:1111,宣和:1119,建炎:1127,紹興:1131,隆興:1163,乾道:1165,淳熙:1174,紹熙:1190,慶元:1195,嘉泰:1201,開禧:1205,嘉定:1208,寶慶:1225,紹定:1228,端平:1234,嘉熙:1237,淳祐:1241,寶祐:1253,開慶:1259,景定:1260,咸淳:1265,大定:1161,明昌:1190,至元:1264,大德:1297,皇慶:1312,延祐:1314,泰定:1324,天曆:1328,至順:1330,至正:1341,洪武:1368,永樂:1403,宣德:1426,正統:1436,景泰:1450,天順:1457,成化:1465,弘治:1488,正德:1506,嘉靖:1522,隆慶:1567,萬曆:1573,泰昌:1620,天啟:1621,崇禎:1628,弘光:1645,隆武:1645,紹武:1646,永曆:1647,順治:1644,康熙:1662,雍正:1723,乾隆:1736,嘉慶:1796,道光:1821,咸豐:1851,同治:1862,光緒:1875,宣統:1909,慶長:1596,寬永:1624,正保:1644,慶安:1648,承應:1652,明曆:1655,萬治:1658,寬文:1661,延寶:1673,天和:1681,貞享:1684,元祿:1688,寶永:1704,享保:1716,元文:1736,寬保:1741,延享:1744,寬延:1748,寶曆:1751,明和:1764,安永:1772,天明:1781,寬政:1789,享和:1801,文化:1804,文政:1818,天保:1830,弘化:1844,嘉永:1848,安政:1854,萬延:1860,文久:1861,元治:1864,慶應:1865,明治:1868,大正:1912,昭和:1926,天正:1573,文祿:1592,永祿:1558,天文:1532},Ul={"唐|元和":806,"日本|元和":1615,"明|正德":1506,"日本|正德":1711};function Ai(e){const n=e.match(/^\s*(\d{3,4})(?:\s*[-–—~至]\s*(\d{3,4}))?/);if(!n)return;const i=parseInt(n[1],10);if(i<100||i>2100)return;const o=n[2]?parseInt(n[2],10):void 0;return{from:i,to:o!=null&&o>=i&&o<=2100?o:void 0}}function xm(e){return e>=1950?"":e>=1912?"民國":e>=1645?"清":e>=1368?"明":e>=1279?"元":e>=960?"宋":e>=907?"五代":e>=618?"唐":e>=581?"隋":e>=420?"南北朝":e>=265?"晉":e>=220?"三國":e>=-202?"漢":""}const bm=/末[宋元明清]初|[約约]|推定|推算|前後|前后|左右|[前中後后末]期/,Zs={曹魏:"三國",蜀漢:"三國",東吳:"三國",前蜀:"五代",後蜀:"五代"};function jo(e){const n=e.trim().replace(/[代朝]$/,"");for(const s of Object.keys(Zs))if(n.startsWith(s))return Zs[s];const i=ct(n);if(an[i]!=null)return i;const o=Ut(n);if(o&&n.length<=o.length+1)return ct(o)}function sn(e,n){if(n){const i=Ul[`${n}|${e}`];if(i!=null)return i}return wn[e]}const ym=1911;function jm(e){const n=wn[e];if(n==null)return;const i=At[e];let o;for(const[s,a]of Object.entries(wn))At[s]===i&&a>n&&(o==null||a<o)&&(o=a);return o!=null?o-1:void 0}const vm={零:0,"〇":0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9,十:10,廿:20,卅:30,元:1};function _i(e){if(!e)return;if(/^\d+$/.test(e))return parseInt(e,10);let n=0,i=0,o=!1;for(const a of e){const l=vm[a];if(l===void 0)return;o=!0,a==="十"?i=(i||1)*10:a==="廿"||a==="卅"?(n+=l,i=0):i>=10?(n+=i+l,i=0):i=i*10+l}const s=n+i;return o&&s>0?s:void 0}function Ut(e){for(const n of Dl)if(e.startsWith(n))return n}const At={};{const e=(n,i)=>{for(const o of i)At[o]=n};e("東漢",["熹平","建安"]),e("三國",["黃初","正始"]),e("五代",["廣政"]),e("西晉",["太康"]),e("東晉",["永和"]),e("隋",["開皇"]),e("唐",["貞觀","開元","天寶","貞元","元和","開成","會昌","咸通"]),e("宋",["建隆","太平興國","咸平","天禧","慶曆","皇祐","嘉祐","治平","熙寧","元豐","元祐","紹聖","崇寧","大觀","政和","宣和","建炎","紹興","隆興","乾道","淳熙","紹熙","慶元","嘉泰","開禧","嘉定","寶慶","紹定","端平","嘉熙","淳祐","寶祐","開慶","景定","咸淳"]),e("金",["大定","明昌"]),e("元",["至元","大德","皇慶","延祐","泰定","天曆","至順","至正"]),e("明",["洪武","永樂","宣德","正統","景泰","天順","成化","弘治","正德","嘉靖","隆慶","萬曆","泰昌","天啟","崇禎","弘光","隆武","紹武","永曆"]),e("清",["順治","康熙","雍正","乾隆","嘉慶","道光","咸豐","同治","光緒","宣統"]),e("日本",["慶長","寬永","正保","慶安","承應","明曆","萬治","寬文","延寶","天和","貞享","元祿","寶永","享保","元文","寬保","延享","寬延","寶曆","明和","安永","天明","寬政","享和","文化","文政","天保","弘化","嘉永","安政","萬延","文久","元治","慶應","明治","大正","昭和","天正","文祿","永祿","天文"])}function ln(e,n){const i=n==="北宋"||n==="南宋"?"宋":n;for(const o of Object.keys(wn))if(e.includes(o)&&!(i&&At[o]&&At[o]!==i&&Ul[`${i}|${o}`]==null))return o}function Xn(e){var l,d,c;const n={era:"",reign:"",source:"none"},i=e.dating;if(i!=null&&i.era||i!=null&&i.reign)return{era:i.era??"",reign:i.reign??"",source:i.certainty==="attested"?"catalog":"edition"};const o=(l=e.lineage)==null?void 0:l.year_text;if(o){const p=Ut(o)??"";return{era:ct(p),reign:ln(o,p)??"",source:"lineage"}}const s=(d=e.publication_info)==null?void 0:d.year;if(s){const p=Ai(s);if(p)return{era:xm(p.from),reign:"",source:"publication"};const h=Ut(s)??jo(s)??((c=kn.find(f=>f.pattern.test(s)))==null?void 0:c.era)??"",m=ln(s,h)??"",u=h||(m?At[m]??"":"");if(u||m)return{era:ct(u),reign:m,source:"publication"}}const a=e.edition||e.title||"";if(a){const p=Ut(a);if(p)return{era:ct(p),reign:ln(a,p)??"",source:"edition"};const h=kn.find(m=>m.pattern.test(a));if(h)return{era:ct(h.era),reign:ln(a,h.era)??h.reign??"",source:"edition"}}return n}function Mi(e){var o,s,a,l,d,c,p,h,m;if(((o=e.dating)==null?void 0:o.year)!=null)return e.dating.year;if(typeof((s=e.lineage)==null?void 0:s.year)=="number")return e.lineage.year;const n=(a=e.publication_info)==null?void 0:a.year;if(n){const u=Ai(n);if(u)return u.from}const i=[(l=e.lineage)==null?void 0:l.year_text,(d=e.publication_info)==null?void 0:d.year,e.edition,e.edition?void 0:e.title].filter(Boolean);for(const u of i){const f=((c=e.publication_info)==null?void 0:c.year)||((p=e.lineage)==null?void 0:p.year_text);if(f&&u!==f&&(Ut(f)||jo(f)))break;const x=u.match(/(?:^|[^\d第卷冊册頁页])(\d{3,4})\s*年/)??u.match(/[((](\d{3,4})\s*(?:[-–—~至]\s*\d{3,4})?\s*年?[))]/);if(x){const w=parseInt(x[1],10);if(w>=100&&w<=2100)return w}const j=u.match(/民[國国]\s*([零〇一二三四五六七八九十廿卅百元\d]+)\s*年/);if(j){const w=Ut(u);if(!w||ct(w)==="民國"){const k=_i(j[1]);if(k!=null&&k>=1&&k<=120)return ym+k}}const y=Ut(u)??((h=kn.find(w=>w.pattern.test(u)))==null?void 0:h.era),S=y?ct(y):void 0,b=ln(u,S)??(Ut(u)||(m=kn.find(w=>w.pattern.test(u)))==null?void 0:m.reign);if(b){const w=sn(b,S);if(w==null)continue;const v=u.indexOf(b),k=v>=0?u.slice(v+b.length):"",z=k.match(/^([零〇一二三四五六七八九十廿卅元]+)年/)??k.match(/^[甲乙丙丁戊己庚辛壬癸][子丑寅卯辰巳午未申酉戌亥]\s*[((]\s*([零〇一二三四五六七八九十廿卅元]+)\s*年?\s*[))]/),C=z?_i(z[1]):void 0;return w+(C?C-1:0)}}}function vo(e){var l,d,c,p,h,m;const n=(l=e.dating)==null?void 0:l.year_range;if(n&&n.length===2)return{from:n[0],to:n[1]};const i=(d=e.lineage)==null?void 0:d.year_range;if(i&&i.length===2)return{from:i[0],to:i[1]};const o=(c=e.lineage)==null?void 0:c.year_text;if(o){const u=o.match(/([宋元明清])\s*末\s*([宋元明清])\s*初/);if(u){const f=Pr[ct(u[1])],x=an[ct(u[2])];if(f!=null&&x!=null)return{from:Math.min(f,x)-20,to:Math.max(f,x)+40}}}const s=(p=e.publication_info)==null?void 0:p.year;if(s){const u=Ai(s);if((u==null?void 0:u.to)!=null)return{from:u.from,to:u.to};const f=s.match(/([宋元明清])\s*末\s*([宋元明清])\s*初/);if(f){const x=Pr[ct(f[1])],j=an[ct(f[2])];if(x!=null&&j!=null)return{from:Math.min(x,j)-20,to:Math.max(x,j)+40}}}const a=[(h=e.publication_info)==null?void 0:h.year,e.edition,e.title].filter(Boolean);for(const u of a){if(!/[間间]/.test(u))continue;const f=Ut(u)??jo(u)??((m=kn.find(y=>y.pattern.test(u)))==null?void 0:m.era),x=f?ct(f):void 0,j=[];for(const y of Object.keys(wn))u.includes(y)&&(x&&At[y]&&At[y]!==x||sn(y,x)!=null&&j.push(y));if(j.length===0){const y=u.match(/([一-鿿])([一-鿿])[間间]/);if(y&&x){for(const S of[y[1],y[2]])for(const b of Object.keys(wn))if(At[b]===x&&!(b[0]!==S&&b[b.length-1]!==S)&&sn(b,x)!=null){j.push(b);break}}}if(j.length>0){const y=j.map(v=>sn(v,x)).filter(v=>v!=null),S=Math.min(...y),b=j.reduce((v,k)=>sn(v,x)>=sn(k,x)?v:k),w=jm(b)??fr(x??"")??Math.max(...y);return{from:S,to:w>S?w:fr(x??At[b]??"")??S}}if(x&&an[x]!=null)return{from:an[x],to:fr(x)??an[x]}}}const an={漢:-202,三國:220,晉:265,南北朝:420,隋:581,唐:618,五代:907,宋:960,遼:916,西夏:1038,金:1115,元:1271,明:1368,清:1644,民國:1912,日本:1600,朝鮮:1392,高麗:918,越南:1400,琉球:1400},km=[{re:/影印|景印|影鈔|影钞|景鈔|景钞/,relation:"影印"},{re:/翻刻|覆刻|覆刊|翻雕|重刊|重雕/,relation:"翻刻"},{re:/傳鈔|传钞|傳抄|传抄/,relation:"傳鈔"},{re:/配補|配补|百衲/,relation:"配補"},{re:/據.{0,12}本|据.{0,12}本/,relation:"據刊"}],wm=/修補|修补|遞修|递修|[明清元宋]修本|後代修|后代修/,Js=/約|约|疑|傳為|传为|舊題|旧题|相傳|相传|待考|未詳|未详|\(疑\)|(疑)/;function Qs(e,n){for(const i of Dl){const o=e.indexOf(i);if(o<0)continue;if(i.length===1){const c=e[o+1]??"";if(!/[刻刊寫写鈔钞抄印本間间初末年時时代人臧藏]/.test(c)&&!ln(e.slice(o),ct(i)))continue}const s=ct(i);if(s===n)continue;const a=e.slice(o),l=ln(a,s)??"";let d;if(l){const c=sn(l,s);if(c!=null){const h=a.slice(a.indexOf(l)+l.length).match(/^([零〇一二三四五六七八九十廿卅元]+)年/),m=h?_i(h[1]):void 0;d=c+(m?m-1:0)}}return{era:s,reign:l,year:d}}for(const i of kn)if(i.pattern.test(e))return{era:ct(i.era),reign:i.reign??""}}function Sm(e){var S,b,w,v,k;const n=Xn(e),i=((S=e.publication_info)==null?void 0:S.year)??"",o=i?Ai(i):void 0;if(!n.era&&!n.reign&&!o)return;const s=e.edition||e.title||"",a=/[間间]/.test(s),l=((b=e.lineage)==null?void 0:b.year_text)??"",d=/末[宋元明清]初|[約约]|推定|前後|前后|左右/.test(l),c=n.source==="publication"&&bm.test(i),p=n.source==="publication"&&/[間间]/.test(i),h=l.match(/([宋元明清])[^、,,]*?[((](\d{3,4})[))][^、,,]*?原刻/);let m;a||d||c||p?m=void 0:h?m=parseInt(h[2],10):m=Mi(e);const u=m==null?vo(e):void 0;let f;n.source==="publication"&&(c||Js.test(i))?f="uncertain":n.source==="lineage"||n.source==="publication"?f="attested":Js.test(s)||!n.reign&&m==null?f="uncertain":f="inferred";const x=n.source==="edition"?`題名「${s}」`:n.source==="lineage"?`版本傳承著錄「${((w=e.lineage)==null?void 0:w.year_text)??((v=e.lineage)==null?void 0:v.year)??""}」`:`出版著錄「${((k=e.publication_info)==null?void 0:k.year)??""}」`,j={era:n.era,reign:n.reign,year:m,yearRange:u,certainty:f,source:n.source==="edition"?"edition":"catalog",basis:x};if(h){const z=l.match(/[、,,]\s*([宋元明清])/);z&&z[1]!==j.era&&(j.laterRepair={era:z[1]})}if(!j.laterRepair&&wm.test(s)){const z=s.match(/([宋元明清])\s*(?:初|末)?\s*(?:修補|修补|遞修|递修|修)/);z&&z[1]!==n.era&&(j.laterRepair={era:z[1]})}const y=km.find(z=>z.re.test(s));if(y){const z=s.search(y.re),C=s.slice(z),_=Qs(C,n.era)??Qs(s,n.era);_&&(j.basedOn={era:_.era,reign:_.reign,year:_.year,relation:y.relation})}return j}const Pr={漢:220,三國:280,晉:420,南北朝:589,隋:618,唐:907,五代:960,宋:1279,遼:1125,西夏:1227,金:1234,元:1368,明:1662,清:1911,民國:1975,日本:1912,朝鮮:1897,高麗:1392,越南:1945,琉球:1879};function fr(e){return Pr[e]}function $i(e){const n=Mi(e);if(n!=null)return n;const i=vo(e);if(i)return i.from;const o=Xn(e).era;return o?an[o]:void 0}const ea=["漢","三國","晉","南北朝","隋","唐","五代","宋","遼","西夏","金","元","明","清","民國","日本","朝鮮","高麗","越南","琉球"];function Br(e){const n=ea.indexOf(e);return n===-1?ea.length:n}function _m(e){const n={belongsTo:[],collected:[],contains:[],derivative:[],studies:[],related:[]};for(const s of e){const a=s.relation;a==="part_of"?n.belongsTo.push(s):a==="collected_in"?n.collected.push(s):a==="has_part"||a==="contains_text_of"?n.contains.push(s):a==="text_carried_by"||a==="studied_by"||a==="derived_from"||a==="followed_by"||a==="has_adaptation"?n.derivative.push(s):a==="studies"||a==="preceded_by"?n.studies.push(s):n.related.push(s)}const i=[],o=(s,a)=>{n[s].length&&i.push({key:s,labelKey:a,items:n[s]})};return o("belongsTo","belongsToWork"),o("collected","collectedIn"),o("contains","containedWorks"),o("derivative","derivativeWorks"),o("studies","studies"),o("related","relatedWorks"),i}function ko(e,n){const i=go(e||[]),o=new Map,s=[];for(const p of i)p.group?(o.has(p.group)||o.set(p.group,[]),o.get(p.group).push(p)):s.push(p);for(const p of o.values())p.sort((h,m)=>{const u=f=>f.group_role==="origin"?0:f.group_role==="mirror"?1:2;return u(h)-u(m)});const a={text:[],image:[],textImage:[],physical:[]};for(const p of s){const h=Vt(p),m=h.includes("text"),u=h.includes("image");m&&u?a.textImage.push(p):m?a.text.push(p):u?a.image.push(p):a.physical.push(p)}const d=["text","image","textImage","physical"].filter(p=>a[p].length>0).map(p=>({key:p,items:a[p]})),c=[...o.entries()].map(([p,h])=>{var m,u;return{key:p,label:((m=n==null?void 0:n[p])==null?void 0:m.label)||p,description:(u=n==null?void 0:n[p])==null?void 0:u.description,items:h}});return{buckets:d,mirrors:c,total:i.length}}function Pi(e,n=Nn("zh-Hant")){const i=[],o=e.metadata||{};o.edition&&i.push(String(o.edition)),e.source_label&&i.push(e.source_label),e.details&&i.push(e.details);const s=Ri(e);return s&&s.expected>0&&i.push(s.missing>0?n("detail.volumeStatsMissing",{found:s.found,expected:s.expected,missing:s.missing}):n("detail.volumeStats",{found:s.found,expected:s.expected})),o.version&&i.push(String(o.version)),i.join(" · ")}function Vl(e,n){if(Pi(e)||n.filter(o=>o.name===e.name).length<2)return"";try{const o=new URL(e.url),s=o.searchParams.get("res")||o.searchParams.get("id");if(s)return s;const a=o.pathname.split("/").filter(Boolean).pop();if(a)return decodeURIComponent(a)}catch{}return""}const $m="同版";function Cm(e){const n=e==null?void 0:e.metadata;return((n==null?void 0:n.item_id)||(n==null?void 0:n.call_number)||"").trim()||void 0}function zm(e){var n;for(const i of((n=e.lineage)==null?void 0:n.related_to)??[]){const o=i.ref??i.book_id;if(i.relation===$m&&o&&o!==e.id)return o}}function Nm(e){const n=new Map(e.map(a=>[a.id,a])),i=a=>{const l=n.get(a);return!!l&&!l.copyOf},o=new Map;for(const a of e)if(a.copyOf&&i(a.copyOf)){const l=o.get(a.copyOf)??[];l.push(a),o.set(a.copyOf,l)}if(o.size===0)return e;const s=[];for(const a of e){if(a.copyOf&&i(a.copyOf))continue;const l=o.get(a.id);if(!l){s.push(a);continue}const d=[...l].sort((c,p)=>(c.callNumber??c.id).localeCompare(p.callNumber??p.id));s.push({...a,copies:d,hasImage:a.hasImage||d.some(c=>c.hasImage)})}return s}function Gl(e,n){var a,l;const i=e.resources||[],o=[],s=[];for(const d of i){const c=Vt(d);c.includes("image")&&o.push(d),c.includes("physical")&&s.push(d)}return{id:e.id,name:e.edition||e.title||e.id,era:Xn(e),year:Mi(e),sortYear:$i(e),images:o,holders:s,locationName:(a=e.current_location)==null?void 0:a.name,callNumber:Cm(s[0]),copyOf:zm(e),summary:e.summary,important:Tm(e.id,n),group:(l=n==null?void 0:n.node_groups)==null?void 0:l[e.id],hasImage:o.length>0}}function Tm(e,n){var d,c;if(!n)return!1;const i=n.default_collection;if(!i)return!1;const o=(d=n.collections)==null?void 0:d[i];if(((o==null?void 0:o.book_ids)??(i==="core"?n.core_books??[]:[])).includes(e))return!0;const a=(o==null?void 0:o.groups)??[],l=(c=n.node_groups)==null?void 0:c[e];return!!l&&a.includes(l)}function Yl(e,n,i={}){const o=new Set((n==null?void 0:n.excluded_books)??[]),s=Nm(e.filter(c=>!o.has(c.id)).map(c=>Gl(c,n)));let a=s;i.era&&(a=a.filter(c=>c.era.era===i.era)),i.scanOnly&&(a=a.filter(c=>c.hasImage)),i.sort==="year"?a=a.map((c,p)=>({r:c,i:p})).sort((c,p)=>{const h=c.r.sortYear,m=p.r.sortYear;return h!=null&&m!=null?h-m||c.i-p.i:h!=null?-1:m!=null?1:c.i-p.i}).map(c=>c.r):a=a.map((c,p)=>({r:c,i:p})).sort((c,p)=>{const h=m=>(m.important?0:1)*2+(m.hasImage?0:1);return h(c.r)-h(p.r)||c.i-p.i}).map(c=>c.r);const d=[...new Set(s.map(c=>c.era.era).filter(Boolean))].sort((c,p)=>Br(c)-Br(p));return{rows:a,allRows:s,eras:d,hasInferredEra:s.some(c=>c.era.source==="edition")}}function Im(e,n){var y,S;if(!n||!n.default_collection||!n.node_groups)return{useGrouping:!1,coreIds:e,groupedIds:[]};const i=(y=n.collections)==null?void 0:y[n.default_collection],o=(i==null?void 0:i.groups)??[],s=(i==null?void 0:i.book_ids)??[],a=o.length>0||s.length>0,l=!a&&n.default_collection==="core"&&Array.isArray(n.core_books)?n.core_books:[];if(!a&&l.length===0)return{useGrouping:!1,coreIds:e,groupedIds:[]};const d=new Set(o),c=new Set([...s,...l]),p=b=>{if(c.has(b))return!0;const w=n.node_groups[b];return w!=null&&d.has(w)},h=[],m=new Map,u=[];for(const b of e)if(!((S=n.excluded_books)!=null&&S.includes(b)))if(p(b))h.push(b);else{const w=n.node_groups[b];w?(m.has(w)||m.set(w,[]),m.get(w).push(b)):u.push(b)}if(u.length+[...m.values()].reduce((b,w)=>b+w.length,0)<3)return{useGrouping:!1,coreIds:e,groupedIds:[]};const x=new Map((n.groups??[]).map(b=>[b.id,b])),j=[...m.entries()].map(([b,w])=>{const v=x.get(b);return{id:b,label:(v==null?void 0:v.label)??b,description:v==null?void 0:v.description,ids:w}});return u.length>0&&j.push({id:"__other__",label:"其他版本",description:void 0,ids:u}),{useGrouping:!0,coreIds:h,groupedIds:j}}const ql=["撰","編","注","校","譯","繪","其他"],Rm=[{cls:"譯",re:/譯|译/},{cls:"繪",re:/繪|绘|畫|画|圖|图|篆|摹/},{cls:"校",re:/^(?!.*[編编輯辑纂])(?=.*(校|訂|订|勘|審|审|考異)).*/},{cls:"注",re:/注|註|疏|箋|笺|解|釋|释|音|義疏|章句|評|评|批|論|论|答/},{cls:"編",re:/編|编|輯|辑|纂|集|選|选|錄|录|彙|汇|續|续|補|补|刪|删|修|次|定/},{cls:"撰",re:/撰|譔|作|著|述|製|制|書|书|記|记|傳|传|題|题|序|跋|讚|贊|赞|頌|颂/}];function wo(e){if(!e||!e.trim())return"撰";const n=e.replace(/[\s-]/g,"");if(!n)return"撰";for(const{cls:i,re:o}of Rm)if(o.test(n))return i;return"其他"}function So(e){if(!e)return"";const n=e.trim();return!n||!/[一-鿿]/.test(n)?"":n}function Kl(e,n="全部"){const i=new Map;for(const s of e){const a=wo(s);i.set(a,(i.get(a)??0)+1)}const o=[{cls:"全部",label:n,count:e.length}];for(const s of ql){const a=i.get(s);a&&o.push({cls:s,label:s,count:a})}return o.length>2?o:[]}function _o(e){return(e._books??[]).map(n=>n.id).filter(n=>typeof n=="string")}function $o(e){const n=e._classifications??[],i=n.find(o=>o.scheme==="zongmu")??n[0];if(i)return{l1:i.l1??"",l2:i.l2??"",l3:i.l3??"",l4:i.l4??"",...i.source?{source:i.source}:{}}}function Xl(e){const n=e._members??[],i=typeof e._member_count=="number"?e._member_count:n.length;return{works:n.filter(o=>o.t==="work").map(o=>({id:o.id,title:o.title??"",volumes:Un(o.vol)})),bookIds:n.filter(o=>o.t!=="work").map(o=>o.id).filter(o=>typeof o=="string"),total:i,truncated:i>n.length}}function Em(e){var n;return(e==null?void 0:e._member_count)||((n=e==null?void 0:e._members)==null?void 0:n.length)||0}function Zl(e,n,i){if(n&&n.books&&n.books.length>0){const l=n.books.map(c=>({id:c.work_id||c.book_id||void 0,title:c.title,section:c.section,volumes:c.volumes||[],subItems:c.sub_items,edition:c.edition,found:c.found_volumes,expected:c.expected_volumes})),d=[...new Set(l.map(c=>c.section).filter(Boolean))];return{rows:l,source:"catalog",sections:d,totalVolumes:n.total_volumes}}const{works:o,bookIds:s}=Xl(e);return o.length>0?{rows:o.map(d=>({id:d.id,title:d.title,volumes:d.volumes})),source:"works",sections:[]}:{rows:s.map(l=>{var d,c;return{id:l,title:((d=i==null?void 0:i.get(l))==null?void 0:d.title)||l,edition:(c=i==null?void 0:i.get(l))==null?void 0:c.edition,volumes:[]}}),source:"books",sections:[]}}function Un(e){if(e==null)return[];if(typeof e=="number")return[e];if(Array.isArray(e))return e.filter(n=>typeof n=="number");if(typeof e=="string"){const n=e.match(/^(\d+)\s*[-–~]\s*(\d+)$/);if(n){const[i,o]=[parseInt(n[1]),parseInt(n[2])];return Array.from({length:Math.max(0,o-i+1)},(s,a)=>i+a)}return e.split(/[,、]/).map(i=>parseInt(i.trim())).filter(i=>!isNaN(i))}return[]}function Bi(e,n="冊"){if(e.length===0)return"";if(e.length===1)return`${e[0]}`;const i=[...e].sort((a,l)=>a-l),o=i[0],s=i[i.length-1];return s-o+1===i.length?`${o}–${s}`:i.length<=3?i.join(", "):`${o}–${s} (${i.length}${n})`}const Lm=["〇","一","二","三","四","五","六","七","八","九"],ta=["","十","百","千"];function In(e){if(!Number.isInteger(e)||e<=0)return"";if(e>=1e8)return String(e);if(e<1e4)return xr(e,!0);const n=Math.floor(e/1e4),i=e%1e4;let o=xr(n,!0)+"萬";return i>0&&(o+=(i<1e3?"〇":"")+xr(i,!1)),o}function xr(e,n){const i=String(e),o=i.length;let s="",a=!1;for(let l=0;l<o;l++){const d=parseInt(i[l]),c=o-1-l;d===0?a=!0:(a&&s&&(s+="〇"),a=!1,n&&d===1&&c===1&&l===0?s+=ta[c]:s+=Lm[d]+ta[c])}return s}function Am(e){return e==null?"":typeof e=="string"?e:"name"in e&&e.name?e.name:"title"in e&&e.title||""}function Mm(e){if(e==null||typeof e=="string")return;const n="url"in e&&e.url?e.url:"type"in e&&e.type==="url"?e.details:void 0;return n&&/^https?:\/\//i.test(n)?n:void 0}function Gt(e,n="卷"){var o,s;const i=e;return i.measure_info?i.measure_info:(o=i.juan_count)!=null&&o.number?In(i.juan_count.number)+n:(s=i.juan_count)!=null&&s.description?i.juan_count.description:""}function Jl(e){var o;if(e.edition_type)return e.edition_type;if((o=e.lineage)!=null&&o.category)return e.lineage.category;const n=e.edition||e.title||"",i=[[/活字|聚珍/,"活字本"],[/石印/,"石印本"],[/油印/,"油印本"],[/曬印|晒印/,"曬印本"],[/影印|景印/,"影印本"],[/寫本|写本|繕寫|缮写/,"寫本"],[/鈔本|抄本/,"抄本"],[/拓本/,"拓本"],[/批校|評本|评本|校本/,"校本"],[/刻本|刊本|梓行|開雕/,"刻本"],[/排印|鉛印|铅印/,"排印本"]];for(const[s,a]of i)if(s.test(n))return a;return""}const Oi={dynasty:[],classification:[],hasImage:!1,hasText:!1,hasCollated:!1,loss:"",sort:""},Ql=new Set(["work","book","entity"]);function Pm(e){return nc(e)||!!e.sort}function Bm(e,n){return n.sort&&Ql.has(e)?n.sort:void 0}const Wi=[{key:"漢",values:["漢","西漢","東漢"]},{key:"魏晉南北朝",values:["三國魏","三國蜀","三國吳","三國","晉","西晉","東晉","南朝宋","南朝齊","南朝梁","南朝陳","北魏","東魏","西魏","北齊","北周"]},{key:"唐",values:["隋","唐","五代","前蜀","後蜀","南唐"]},{key:"宋",values:["宋","北宋","南宋","宋末元初","遼","金"]},{key:"元",values:["元","元末明初"]},{key:"明",values:["明","明末清初"]},{key:"清",values:["清"]}],Fi=[{value:"經部",label:"經部"},{value:"史部",label:"史部"},{value:"子部",label:"子部"},{value:"集部",label:"集部"},{value:"",label:"未分類"}],ec=[{value:"",label:"全部"},{value:"extant",label:"存"},{value:"partially_extant",label:"殘"},{value:"lost",label:"佚"}],tc={work:new Set(["dynasty","classification","hasImage","hasText","hasCollated","loss"]),book:new Set(["dynasty","hasImage","hasText"]),collection:new Set,entity:new Set(["dynasty"])};function Hi(e){return e.dynasty.length+e.classification.length+(e.hasImage?1:0)+(e.hasText?1:0)+(e.hasCollated?1:0)+(e.loss?1:0)}function nc(e){return Hi(e)>0}function Om(e){const n=[];return e.dynasty.length&&n.push("dynasty"),e.classification.length&&n.push("classification"),e.hasImage&&n.push("hasImage"),e.hasText&&n.push("hasText"),e.hasCollated&&n.push("hasCollated"),e.loss&&n.push("loss"),n}function ic(e,n){const i=tc[e];return Om(n).every(o=>i.has(o))}const Pn=e=>JSON.stringify(e);function Wm(e,n){if(!ic(n,e))return null;const i=[];if(e.dynasty.length){const o=Array.from(new Set(e.dynasty.flatMap(s=>{var a;return((a=Wi.find(l=>l.key===s))==null?void 0:a.values)??[]})));o.length===1?i.push(`dynasty = ${Pn(o[0])}`):o.length>1&&i.push(`dynasty IN [${o.map(Pn).join(", ")}]`)}return e.classification.length&&i.push(e.classification.length===1?`classification = ${Pn(e.classification[0])}`:`classification IN [${e.classification.map(Pn).join(", ")}]`),e.hasImage&&i.push("has_image = true"),e.hasText&&i.push("has_text = true"),e.hasCollated&&i.push("has_collated = true"),e.loss&&i.push(`loss_status = ${Pn(e.loss)}`),i.join(" AND ")}const ht={dynasty:"dy",classification:"cls",hasImage:"img",hasText:"txt",hasCollated:"col",loss:"loss",sort:"sort"},rc="_";function Ci(e,n=new URLSearchParams){for(const i of Object.values(ht))n.delete(i);return e.dynasty.length&&n.set(ht.dynasty,e.dynasty.join(",")),e.classification.length&&n.set(ht.classification,e.classification.map(i=>i||rc).join(",")),e.hasImage&&n.set(ht.hasImage,"1"),e.hasText&&n.set(ht.hasText,"1"),e.hasCollated&&n.set(ht.hasCollated,"1"),e.loss&&n.set(ht.loss,e.loss),e.sort&&n.set(ht.sort,e.sort),n}function Fm(e){const n=a=>(e.get(a)??"").split(",").map(l=>l.trim()).filter(Boolean),i=new Set(Wi.map(a=>a.key)),o=new Set(Fi.map(a=>a.value)),s=e.get(ht.loss);return{dynasty:Array.from(new Set(n(ht.dynasty).filter(a=>i.has(a)))),classification:Array.from(new Set(n(ht.classification).map(a=>a===rc?"":a).filter(a=>o.has(a)))),hasImage:e.get(ht.hasImage)==="1",hasText:e.get(ht.hasText)==="1"||e.get(ht.hasCollated)==="1",hasCollated:!1,loss:s==="extant"||s==="partially_extant"||s==="lost"?s:"",sort:["era:asc","era:desc","title:asc","title:desc"].find(a=>a===e.get(ht.sort))??""}}function Hm(e,n){return JSON.stringify([e.dynasty.slice().sort(),e.classification.slice().sort(),e.hasImage,e.hasText,e.hasCollated,e.loss,e.sort])===JSON.stringify([n.dynasty.slice().sort(),n.classification.slice().sort(),n.hasImage,n.hasText,n.hasCollated,n.loss,n.sort])}function na(e,n){return e.includes(n)?e.filter(i=>i!==n):[...e,n]}const Dm=({filters:e,onChange:n})=>{const i=Ae(),o=i.searchV4,{convert:s}=Ue(),[a,l]=g.useState(!1),d=g.useId(),c=Hi(e),p=h=>n({...e,...h});return t.jsxs("aside",{className:"bim-sr-aside","aria-label":s(o.filterTitle),children:[t.jsxs("button",{type:"button",className:"bim-sr-fbtn","aria-expanded":a,"aria-controls":d,onClick:()=>l(h=>!h),children:[t.jsxs("span",{children:[s(o.filterButton),c>0&&t.jsx("span",{className:"bim-sr-fn",children:s(wt(o.filterSelected,{n:c}))})]}),t.jsxs("span",{className:"bim-sr-fa","aria-hidden":"true",children:[s(a?o.collapse:o.expand)," ",a?"▴":"▾"]})]}),t.jsxs("div",{className:"bim-sr-filters",id:d,"data-open":a?"true":"false",...a?{}:{"data-collapsed":"true"},children:[t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{children:s(o.dynasty)}),t.jsx("div",{className:"bim-sr-chips",children:Wi.map(h=>t.jsx("button",{type:"button",className:"bim-sr-chip","aria-pressed":e.dynasty.includes(h.key),onClick:()=>p({dynasty:na(e.dynasty,h.key)}),children:s(h.key)},h.key))})]}),t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{children:s(o.classification)}),Fi.map(h=>t.jsxs("label",{className:"bim-sr-opt",children:[t.jsx("input",{type:"checkbox",checked:e.classification.includes(h.value),onChange:()=>p({classification:na(e.classification,h.value)})}),h.value?s(h.label):i.searchPage.unclassified]},h.value||"_"))]}),t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{children:s(o.resources)}),t.jsxs("label",{className:"bim-sr-opt",children:[t.jsx("input",{type:"checkbox",checked:e.hasImage,onChange:h=>p({hasImage:h.target.checked})}),s(o.hasImage)]}),t.jsxs("label",{className:"bim-sr-opt",children:[t.jsx("input",{type:"checkbox",checked:e.hasText,onChange:h=>p({hasText:h.target.checked})}),s(o.hasText)]})]}),t.jsxs("section",{className:"bim-sr-fg",children:[t.jsx("h3",{id:`${d}-loss`,children:s(o.extant)}),t.jsx("div",{className:"bim-sr-seg",role:"group","aria-labelledby":`${d}-loss`,children:ec.map(h=>t.jsx("button",{type:"button","aria-pressed":e.loss===h.value,onClick:()=>p({loss:h.value}),children:i.searchPage.loss[h.value||"all"]},h.value||"all"))})]}),c>0&&t.jsx("button",{type:"button",className:"bim-sr-clear",onClick:()=>n({...Oi,sort:e.sort}),children:s(o.clearAllFilters)})]})]})};function oc({text:e,query:n}){const i=(n??"").trim();if(!i||!e)return t.jsx(t.Fragment,{children:e});const o=e.toLowerCase(),s=i.toLowerCase(),a=[];let l=0,d=0;for(;l<e.length;){const c=o.indexOf(s,l);if(c<0){a.push(e.slice(l));break}c>l&&a.push(e.slice(l,c)),a.push(t.jsx("mark",{className:"bim-sr-hl",children:e.slice(c,c+s.length)},d++)),l=c+s.length}return t.jsx(t.Fragment,{children:a})}const ia=({entries:e,query:n,onEntryLinkClick:i,typeName:o})=>{const s=Ae(),a=s.searchV4,{convert:l}=Ue(),d=at();return t.jsx("div",{className:"bim-sr-tablewrap",children:t.jsxs("table",{className:"bim-sr-table",children:[t.jsxs("colgroup",{children:[t.jsx("col",{style:{width:"34%"}}),t.jsx("col",{style:{width:"8%"}}),t.jsx("col",{style:{width:"19%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:"12%"}}),t.jsx("col",{style:{width:"14%"}})]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",children:l(a.colTitle)}),t.jsx("th",{scope:"col",children:l(a.colType)}),t.jsx("th",{scope:"col",children:l(a.colAuthor)}),t.jsx("th",{scope:"col",children:l(a.colEra)}),t.jsx("th",{scope:"col",children:l(a.colClass)}),t.jsx("th",{scope:"col",style:{textAlign:"right"},children:l(a.colResource)})]})}),t.jsx("tbody",{children:e.map(c=>{const p=l(c.title||c.primary_name||c.id),h=c.measure_info?l(c.measure_info):c.juan_count?`${c.juan_count}${s.unit.juan}`:"",m=c.type==="entity"?[c.birth_year!=null||c.death_year!=null?`${c.birth_year??"?"}—${c.death_year??"?"}`:""].filter(Boolean).join(""):c.author?`${l(c.author)}${c.role&&c.role!=="author"?` ${l(c.role)}`:""}`:"",u=c.type==="book"?c.era??c.dynasty:c.dynasty,f=u?l(u):"",x=c.classification?l(c.classification):"",j=[];c.has_image&&j.push({label:a.tagImage,cls:"bim-sr-tag--img"}),(c.has_text||c.has_collated)&&j.push({label:a.tagText,cls:""}),c.loss_status==="lost"&&j.push({label:a.tagLost,cls:"bim-sr-tag--lost"});const y=[m,f,x].filter(Boolean).join(" · ");return t.jsxs("tr",{children:[t.jsxs("td",{className:"bim-sr-c-title",children:[t.jsxs("div",{className:"bim-sr-tl",children:[t.jsx("a",{href:d(c.id),onClick:S=>i(c,S),children:t.jsx(oc,{text:p,query:n?l(n):void 0})}),h&&t.jsx("span",{className:"bim-sr-measure",children:h})]}),y&&t.jsx("span",{className:"bim-sr-sub",children:y})]}),t.jsxs("td",{className:"bim-sr-c-type",children:[t.jsx(Tn,{type:c.type,size:6})," ",o(c.type)]}),t.jsx("td",{className:"bim-sr-c-who",children:m||"—"}),t.jsx("td",{className:"bim-sr-c-era",children:f||"—"}),t.jsx("td",{className:"bim-sr-c-cls",children:x||"—"}),t.jsx("td",{className:"bim-sr-c-res",children:j.map(S=>t.jsx("span",{className:`bim-sr-tag ${S.cls}`,children:l(S.label)},S.label))})]},c.id)})})]})})},Um=`
2
2
  .bim-sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
3
3
  .bim-sc { display: flex; flex-direction: column; min-width: 0; padding: 14px 16px 12px; border: 1px solid ${r("rule")}; background: ${r("card-bg")}; color: inherit; text-decoration: none; }
4
4
  .bim-sc:hover { border-color: ${r("rule-dashed")}; box-shadow: ${r("fr-shadow")}; }
@@ -1964,4 +1964,4 @@ ${B0.map((e,n)=>`.bim-rh-band a[data-k="${n}"] { background: color-mix(in srgb,
1964
1964
  .bim-mh-recent li a, .bim-mh-types a, .bim-mh-tl-list a { min-height: 44px; align-items: center; }
1965
1965
  .bim-mh-recent-h button { min-height: 44px; }
1966
1966
  }
1967
- `,Np={item:e=>`/item/${encodeURIComponent(e)}`,node:e=>`/catalog?node=${encodeURIComponent(e)}`};function tn(e){return{...Np,...e??{}}}function Tp(e,n){if(e.lineage)return e.lineage(n);const i=e.item(n),o=i.indexOf("#"),[s,a]=o<0?[i,""]:[i.slice(0,o),i.slice(o)];return`${s}${s.includes("?")?"&":"?"}tab=lineage${a}`}function bs(e,n){return!n||n<=0?0:Math.max(0,Math.min(100,Math.round(e/n*100)))}function Ip(e){const n=e.filter(p=>Number.isFinite(p.birth_year)||Number.isFinite(p.death_year)),i=e.filter(p=>!n.includes(p));if(!n.length)return{min:0,max:0,placed:[],missing:i};const o=p=>{const h=Number.isFinite(p.birth_year)?p.birth_year:p.death_year-50,m=Number.isFinite(p.death_year)?p.death_year:p.birth_year+50;return[Math.min(h,m),Math.max(h,m)]},s=n.map(o),a=Math.min(...s.map(p=>p[0])),l=Math.max(...s.map(p=>p[1])),d=Math.max(1,l-a),c=n.map((p,h)=>({p,from:s[h][0],to:s[h][1]})).sort((p,h)=>p.from-h.from).map(p=>({...p,left:(p.from-a)/d*100,width:Math.max(.8,(p.to-p.from)/d*100)}));return{min:a,max:l,placed:c,missing:i}}function Ii(e,n=Nn("zh-Hant")){return e<0?n("metaHome.yearBC",{n:-e}):String(e)}function U0(e){return{read:e.item,work:e.item,node:e.node}}function Rp({counts:e,links:n}){const{t:i}=re(),o=n==null?void 0:n.type;if(!o)return null;const s=[["all",i("metaHome.typeAll"),null],["work",i("metaHome.typeLabel.work"),e.works],["book",i("metaHome.typeLabel.book"),e.books],["collection",i("metaHome.typeLabel.collection"),e.collections],["entity",i("metaHome.typeLabel.entity"),e.entities]];return t.jsx("ul",{className:"bim-mh-types bim-rh-num","aria-label":i("metaHome.typeChipsLabel"),children:s.map(([a,l,d])=>t.jsx("li",{children:t.jsxs("a",{href:o(a),children:[t.jsx("b",{children:l}),d!=null&&d>0&&t.jsx("small",{children:it(d)})]})},a))})}function Ep(e,n=5){const[i,o]=g.useState(null);g.useEffect(()=>{let a=!1;const l=Qt().slice(0,n);if(!l.length||!e){o([]);return}return Promise.all(l.map(d=>No(e,d))).then(d=>{a||o(d.filter(c=>!c.notFound))}),()=>{a=!0}},[e,n]);const s=g.useCallback(()=>{zo(),o([])},[]);return{entries:i,clear:s}}function V0(e,n,i){const o=e.type==="book"?e.edition||e.era:e.type==="collection"?"":e.dynasty;return o?i(o):Lp(e.type,n)}function Lp(e,n){return n(`metaHome.typeLabel.${e}`)}function Ap({entries:e,onClear:n,links:i}){const{t:o,convert:s}=re(),a=tn(i);return t.jsxs("aside",{className:"bim-mh-recent","aria-labelledby":"bim-mh-recent-h",children:[t.jsxs("div",{className:"bim-mh-recent-h",children:[t.jsx("h2",{id:"bim-mh-recent-h",children:o("metaHome.recentTitle")}),e&&e.length>0&&n&&t.jsx("button",{type:"button",onClick:n,children:o("metaHome.recentClear")})]}),e&&e.length>0&&t.jsx("ol",{children:e.map(l=>t.jsx("li",{children:t.jsxs("a",{href:a.item(l.id),"aria-label":o("metaHome.recentItemLabel",{type:l.type?Lp(l.type,o):"",title:s(l.title)}),children:[t.jsx("i",{className:"bim-mh-ty","aria-hidden":"true",children:l.type?o(`metaHome.typeShort.${l.type}`):""}),t.jsx("span",{children:s(l.title)}),t.jsx("small",{"aria-hidden":"true",children:V0(l,o,s)})]})},l.id))}),e&&e.length===0&&t.jsx("p",{className:"bim-mh-recent-empty",children:o("metaHome.recentEmpty")})]})}function Mp(e,n,i,o=!1){return o&&(e==="done"||e==="in_progress")?n(`metaHome.siteStatus.${e}`):e==="done"||e==="in_progress"||e==="todo"?n(`metaHome.status.${e}`):i(e)}function Pp({rows:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);return e.length?t.jsx("div",{className:"bim-mh-tbl-wrap",tabIndex:0,role:"region","aria-label":i("metaHome.catalogTitle"),children:t.jsxs("table",{className:"bim-mh-tbl",children:[t.jsxs("caption",{children:[i("metaHome.catalogTitle"),t.jsx("small",{children:i("metaHome.catalogNote")})]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",children:i("metaHome.colCatalog")}),t.jsx("th",{scope:"col",className:"bim-mh-r",children:i("metaHome.colRecords")}),t.jsx("th",{scope:"col",className:"bim-mh-r",children:i("metaHome.colMatched")}),t.jsx("th",{scope:"col",children:i("metaHome.colProgress")}),t.jsx("th",{scope:"col",children:i("metaHome.colStatus")})]})}),t.jsx("tbody",{children:e.map(a=>{const l=bs(a.imported,a.total),d=a.work_id??a.collection_id,c=o(a.edition?`${a.name}·${a.edition}`:a.name);return t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:d?t.jsx("a",{href:s.item(d),children:c}):c}),t.jsx("td",{className:"bim-mh-r",children:it(a.total)}),t.jsx("td",{className:"bim-mh-r",children:it(a.imported)}),t.jsx("td",{children:t.jsxs("span",{className:"bim-mh-meter",children:[t.jsx("i",{"aria-hidden":"true",style:{"--bimmh-w":`${l}%`}}),t.jsxs("small",{children:[l,"%"]})]})}),t.jsx("td",{children:a.status&&t.jsx("span",{className:"bim-mh-st","data-st":a.status,children:Mp(a.status,i,o)})})]},a.id||a.name)})})]})}):null}function Bp({items:e,links:n,label:i}){const{convert:o}=re();return t.jsx("ul",{className:"bim-rh-rows","aria-label":i?o(i):void 0,children:e.map(s=>t.jsx("li",{children:t.jsxs("a",{href:n.item(s.id),children:[t.jsx("span",{className:"bim-rh-t",children:o(s.title)}),s.sub&&t.jsx("small",{children:o(s.sub)})]})},s.id))})}function Op({works:e,links:n}){const{t:i}=re(),[o,s]=g.useState(!1);if(!e.length)return null;const a=Kn(e.length);return t.jsxs("div",{className:"bim-rh-grp","data-cap":a?"":void 0,"data-open":o?"":void 0,children:[t.jsxs("h3",{className:"bim-rh-gt",children:[i("metaHome.relatedTitle"),t.jsx("small",{children:i("metaHome.relatedNote")})]}),t.jsx(Bp,{items:e.map(l=>({id:l.id,title:l.title,sub:Xi(l)||void 0})),links:tn(n)}),a&&t.jsx("button",{type:"button",className:"bim-rh-expand","aria-expanded":o,onClick:()=>s(l=>!l),children:o?i("action.collapse"):i("metaHome.allNWorks",{n:e.length})})]})}const Wp="siku_qige";function G0({group:e,links:n}){const{t:i,convert:o}=re(),[s,a]=g.useState(!1);return t.jsxs("div",{className:"bim-rh-grp","data-cap":Kn(e.items.length)?"":void 0,"data-open":s?"":void 0,children:[t.jsxs("h3",{className:"bim-rh-gt",children:[o(e.label),t.jsx("small",{className:"bim-rh-num",children:i("metaHome.nKinds",{n:e.items.length})})]}),t.jsx(Bp,{items:e.items,links:n,label:e.label}),Kn(e.items.length)&&t.jsx("button",{type:"button",className:"bim-rh-expand","aria-expanded":s,onClick:()=>a(l=>!l),children:s?i("action.collapse"):i("metaHome.allNKinds",{n:e.items.length})})]})}function Fp({groups:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);if(!e.length)return null;const a=e.find(c=>c.key===Wp),l=e.filter(c=>c!==a),d=c=>{var p;return((p=c.match(/(文[^\s·・閣阁]+)[閣阁]/))==null?void 0:p[1])??c};return t.jsxs(t.Fragment,{children:[a&&t.jsxs(t.Fragment,{children:[t.jsxs("h3",{className:"bim-rh-gt",children:[o(a.label),t.jsx("small",{children:o(a.items.map(c=>d(c.title)).join("、"))})]}),t.jsx("ul",{className:"bim-mh-ge","aria-label":o(a.label),children:a.items.map(c=>t.jsx("li",{children:t.jsxs("a",{href:s.item(c.id),"aria-label":o(c.title),title:o(c.title),children:[t.jsx("span",{"aria-hidden":"true",children:o(d(c.title))}),d(c.title)!==c.title&&t.jsx("small",{"aria-hidden":"true",children:i("metaHome.pavilion")})]})},c.id))})]}),l.length>0&&t.jsx("div",{className:"bim-mh-cg",style:a?void 0:{marginTop:0},children:l.map(c=>t.jsx(G0,{group:c,links:s},c.key))})]})}const wl=34,Sl=13;function _l(e,n){return e.birth_year==null&&e.death_year==null?"":`${e.birth_year!=null?Ii(e.birth_year,n):"?"}–${e.death_year!=null?Ii(e.death_year,n):"?"}`}function Y0(e,n){const i=n-e,o=i>1200?300:i>400?100:50,s=[];for(let a=Math.ceil(e/o)*o;a<=n;a+=o)s.push(a);return s}function Hp({people:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);if(!e.length)return null;const{min:a,max:l,placed:d,missing:c}=Ip(e),p=[],h=d.map(u=>{const f=u.left>70,x=f?Math.min(u.left,u.left+u.width-Sl):u.left;let j=0;for(;p[j]!=null&&p[j]>x;)j++;return p[j]=f?u.left+u.width:u.left+Math.max(u.width,Sl),{...u,lane:j,end:f}}),m=Math.max(1,l-a);return t.jsxs(t.Fragment,{children:[h.length>0&&t.jsxs("div",{className:"bim-mh-tl",children:[t.jsx("ul",{className:"bim-mh-tl-rows",style:{height:p.length*wl+10},children:h.map(u=>t.jsxs("li",{className:"bim-mh-tl-bar","data-end":u.end?"":void 0,style:{left:`${u.left}%`,top:u.lane*wl+4,width:`${Math.max(u.width,.5)}%`},children:[t.jsx("i",{"aria-hidden":"true",style:{width:"100%"}}),t.jsxs("a",{href:s.item(u.p.id),children:[o(u.p.name),t.jsx("small",{className:"bim-rh-num",children:_l(u.p,i)})]})]},u.p.id))}),t.jsx("div",{className:"bim-mh-tl-axis","aria-hidden":"true",children:Y0(a,l).map(u=>t.jsx("span",{style:{left:`${(u-a)/m*100}%`},children:Ii(u,i)},u))})]}),t.jsx("ul",{className:"bim-mh-tl-list","data-only":h.length?void 0:"",children:(h.length?e:c).map(u=>t.jsx("li",{children:t.jsxs("a",{href:s.item(u.id),children:[t.jsx("span",{children:o(u.name)}),t.jsx("small",{className:"bim-rh-num",children:[u.dynasty?o(u.dynasty):"",_l(u,i)].filter(Boolean).join(" ")})]})},u.id))}),c.length>0&&h.length>0&&t.jsx("p",{className:"bim-mh-tl-foot",children:i("metaHome.missingLife",{names:o(c.map(u=>u.name).join("、"))})})]})}const q0=t.jsxs("svg",{width:"54",height:"34",viewBox:"0 0 54 34",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:[t.jsx("circle",{cx:"27",cy:"5",r:"3.5"}),t.jsx("circle",{cx:"10",cy:"29",r:"3.5"}),t.jsx("circle",{cx:"27",cy:"29",r:"3.5"}),t.jsx("circle",{cx:"44",cy:"29",r:"3.5"}),t.jsx("path",{d:"M27 8.5v17M27 15H10v10.5M27 15h17v10.5"})]});function Dp({works:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);return e.length?t.jsx("ul",{className:"bim-mh-lin",children:e.map(a=>{const l=Xi(a);return t.jsx("li",{children:t.jsxs("a",{href:Tp(s,a.id),children:[q0,t.jsx("b",{children:o(a.title)}),l&&t.jsx("small",{children:o(l)}),t.jsx("span",{children:i("metaHome.viewLineage")})]})},a.id)})}):null}function Up({sites:e}){const{t:n,convert:i}=re(),o=e.filter(a=>a.status!=="todo"&&a.total>0),s=e.filter(a=>!o.includes(a));return e.length?t.jsxs(t.Fragment,{children:[o.length>0&&t.jsx("ul",{className:"bim-mh-cov",children:o.map(a=>{const l=bs(a.imported,a.total);return t.jsxs("li",{children:[a.url?t.jsx("a",{href:a.url,rel:"noopener noreferrer",target:"_blank",children:i(a.name)}):t.jsx("span",{children:i(a.name)}),t.jsx("span",{className:"bim-mh-bar","aria-hidden":"true",style:{"--bimmh-w":`${l}%`}}),t.jsxs("small",{children:[`${it(a.imported)} / ${it(a.total)} ${l}% `,a.status&&t.jsx("span",{className:"bim-mh-st","data-st":a.status,children:Mp(a.status,n,i,!0)})]})]},a.id||a.name)})}),s.length>0&&t.jsx("p",{className:"bim-mh-todo",children:n("metaHome.plannedSites",{names:i(s.map(a=>a.name).join("、"))})})]}):null}const $l=["extant","partially_extant","lost","unknown"];function Vp({stats:e,links:n,version:i,repoUrl:o,downloadHref:s}){const{t:a}=re(),l=["works","books","collections","entities","has_image","has_text","article","poem"].map(p=>[e[p],a(`metaHome.stat.${p}`)]).filter(([p])=>p>0),d=n==null?void 0:n.loss,c=$l.some(p=>{var h;return(((h=e.loss)==null?void 0:h[p])??0)>0});return t.jsxs("div",{className:"bim-mh-data",children:[l.length>0&&t.jsxs("div",{children:[t.jsx("h3",{className:"bim-rh-gt",children:a("metaHome.dataScale")}),t.jsx("ul",{className:"bim-mh-nums",children:l.map(([p,h])=>t.jsxs("li",{children:[t.jsx("b",{className:"bim-rh-num",children:it(p)}),t.jsx("span",{children:h})]},h))})]}),d&&t.jsxs("div",{children:[t.jsx("h3",{className:"bim-rh-gt",children:a("metaHome.byLoss")}),t.jsx("ul",{className:"bim-mh-loss",children:$l.map(p=>{var u;const h=((u=e.loss)==null?void 0:u[p])??0,m=a(`metaHome.lossNote.${p}`);return t.jsx("li",{children:t.jsxs("a",{href:d(p),children:[a(`metaHome.loss.${p}`),t.jsx("small",{className:"bim-rh-num",children:c&&h>0?a("metaHome.lossCount",{n:it(h),note:m}):m})]})},p)})})]}),t.jsxs("div",{className:"bim-mh-lic",children:[t.jsxs("p",{children:[t.jsx("span",{className:"bim-mh-cc0",children:"CC0"}),a("metaHome.license")]}),t.jsxs("p",{children:[a("metaHome.repo"),o?t.jsx("a",{href:o,children:t.jsx("code",{children:"book-index"})}):t.jsx("code",{children:"book-index"}),a("metaHome.repoNote")]}),i&&t.jsxs("p",{children:[a("metaHome.version"),t.jsx("code",{children:i})]}),s&&t.jsx("p",{children:t.jsx("a",{href:s,children:a("metaHome.download")})})]})]})}const Gp={zhi:"zhi",sibu:"sibu",cong:"cong",people:"people",lineage:"lineage",sites:"sites",data:"data"};function K0({sections:e,links:n,head:i,transport:o,catalogHref:s,collectionsHref:a,entitiesHref:l,version:d,repoUrl:c,downloadHref:p,className:h}){var k,z;const{t:m}=re(),u=e,f=tn(n),x=U0(f),j=Gp,y=Ep(o),S={zhi:!!((k=u.shelf)!=null&&k.items.length)||u.catalog_progress.length>0||u.related_catalogs.length>0,sibu:u.bu.length>0||u.unclassified>0,cong:u.collection_groups.length>0,people:u.bibliographers.length>0,lineage:u.lineage.length>0,sites:u.sites.length>0,data:!0},b=Object.keys(j).filter(C=>S[C]),w=C=>m(`metaHome.nav.${C}`),v=(C,_)=>C?t.jsx("a",{className:"bim-rh-more",href:C,children:_}):void 0;return t.jsxs("div",{className:h?`bim-rh bim-mh ${h}`:"bim-rh bim-mh",children:[t.jsx("style",{children:hs+zp}),t.jsxs("div",{className:"bim-mh-head",children:[t.jsxs("div",{className:"bim-mh-q",children:[i,t.jsx(Rp,{counts:u.counts,links:n})]}),o&&t.jsx(Ap,{entries:y.entries,onClear:y.clear,links:n})]}),b.length>1&&t.jsx("nav",{className:"bim-rh-secnav","aria-label":m("metaHome.navLabel"),children:t.jsx("ul",{children:b.map(C=>t.jsx("li",{children:t.jsx("a",{href:`#${j[C]}`,children:w(C)})},C))})}),t.jsxs("div",{className:"bim-rh-main",children:[S.zhi&&t.jsxs(xt,{id:j.zhi,title:w("zhi"),sub:m("metaHome.zhiSub"),children:[u.shelf&&u.shelf.items.length>0&&t.jsx(fs,{topic:{key:"shelf",label:u.shelf.label,shelf:!0,items:u.shelf.items},links:x,showTitle:!1,legendCount:u.shelf.items.some(C=>C.records)?m("metaHome.shelfLegendCount"):null,legendExtra:[m("metaHome.shelfLegendClick")]}),(u.catalog_progress.length>0||u.related_catalogs.length>0)&&t.jsxs("div",{className:"bim-mh-zhi",style:(z=u.shelf)!=null&&z.items.length?void 0:{marginTop:0},children:[t.jsx(Pp,{rows:u.catalog_progress,links:n}),t.jsx(Op,{works:u.related_catalogs,links:n})]})]}),S.sibu&&t.jsx(xt,{id:j.sibu,title:w("sibu"),sub:m("metaHome.sibuSub"),more:v(s,m("metaHome.toCatalog")),children:t.jsx(xs,{bu:u.bu,unclassified:u.unclassified,links:x,unclassifiedNote:m("metaHome.unclassifiedNote")})}),S.cong&&t.jsx(xt,{id:j.cong,title:w("cong"),sub:m("metaHome.congSub"),more:v(a,m("metaHome.allNKindsMore",{n:it(u.counts.collections)})),children:t.jsx(Fp,{groups:u.collection_groups,links:n})}),S.people&&t.jsx(xt,{id:j.people,title:w("people"),sub:m("metaHome.peopleSub"),more:v(l,m("metaHome.allNPeopleMore",{n:it(u.counts.entities)})),children:t.jsx(Hp,{people:u.bibliographers,links:n})}),S.lineage&&t.jsx(xt,{id:j.lineage,title:w("lineage"),sub:m("metaHome.lineageSub"),children:t.jsx(Dp,{works:u.lineage,links:n})}),S.sites&&t.jsx(xt,{id:j.sites,title:w("sites"),sub:m("metaHome.sitesSub"),children:t.jsx(Up,{sites:u.sites})}),t.jsx(xt,{id:j.data,title:w("data"),sub:m("metaHome.dataSub"),children:t.jsx(Vp,{stats:u.stats,links:n,version:d,repoUrl:c,downloadHref:p})})]})]})}const Yp=["_related","_catalogs","_collections","_members","_children"],X0=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),co=e=>X0(e)&&!!e.h;function Z0(e){return e?Yp.some(n=>{const i=e[n];return Array.isArray(i)&&i.some(co)}):!1}function J0(e,n){const i={...e};if(!n)return i;for(const o of Yp){const s=e[o];!Array.isArray(s)||!s.some(co)||(i[o]=s.map(a=>{var c;if(!co(a)||typeof a.title=="string"&&a.title)return a;const l=a.id??a.bid,d=l?(c=n[l])==null?void 0:c.title:void 0;return d?{...a,title:d}:a}))}return i}function Q0(e){let n=null;const i=()=>e.getHubs?(n??(n=e.getHubs().catch(()=>null)),n):Promise.resolve(null);return new Proxy(e,{get(o,s){if(s==="getItem")return async l=>{const d=await o.getItem(l);return d&&J0(d,Z0(d)?await i():null)};const a=Reflect.get(o,s,o);return typeof a=="function"?a.bind(o):a}})}const po=({style:e})=>{const n=g.useContext(Mt),{t:i}=re();if(!n)return null;const{locale:o,setLocale:s}=n,a=o==="zh-Hant",l=()=>s(a?"zh-Hans":"zh-Hant");return t.jsxs("button",{type:"button",onClick:l,title:i(a?"common.toHans":"common.toHant"),style:{display:"inline-flex",alignItems:"center",gap:"2px",padding:"4px 10px",fontSize:"13px",fontWeight:500,lineHeight:1,border:`1px solid ${r("border")}`,borderRadius:"4px",background:r("bg"),color:r("fg"),cursor:"pointer",userSelect:"none",...e},children:[t.jsx("span",{style:{color:a?r("primary"):void 0,fontWeight:a?700:400},children:i("common.localeShortHant")}),t.jsx("span",{style:{opacity:.3},children:"/"}),t.jsx("span",{style:{color:a?void 0:r("primary"),fontWeight:a?400:700},children:i("common.localeShortHans")})]})},uo=({href:e,label:n,size:i=16,className:o,style:s})=>{const{t:a}=re(),l=n??a("common.repoSourceLink");return t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:l,"aria-label":l,className:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:i+8,height:i+8,borderRadius:4,color:r("desc-fg"),textDecoration:"none",transition:"color 120ms, background 120ms",...s},onMouseEnter:d=>{d.currentTarget.style.color=r("fg")},onMouseLeave:d=>{d.currentTarget.style.color=r("desc-fg")},children:t.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})})};function Lr(e){const n=e.text_count;return typeof n=="number"&&n>0}function Ar(e,n){return{id:e,title:n.title??n.primary_name??e,type:n.type??"book"}}function e1(e,n){if(!n)return!1;const i=n.id;return i===void 0||i===e}const t1=({id:e,transport:n,initialDetail:i,initialEntry:o,activeTab:s,onTabChange:a,activeJuan:l,onJuanChange:d,lineageMode:c="list",onLineageModeChange:p,lineageCollection:h,onLineageCollectionChange:m,initialPage:u=1,selectedLineageNodeId:f,onNavigate:x,onBack:j,backLabel:y,renderLink:S,assetBase:b,enrichDetail:w,getSourceLink:v,readLink:k,railTop:z,extraTabs:C=[],showFeedbackTab:_=!0,feedbackApiUrl:I,height:T,footerExtra:N,hideHeaderControls:E=!1,className:W,style:F})=>{const A=g.useMemo(()=>Q0(n),[n]),V=Ae(),{t:ae,convert:xe}=re(),[me]=g.useState(()=>{if(!e1(e,i))return null;const Y={...i},H=o??Ar(e,Y);return w&&w(H,Y),{id:e,entry:H,detail:Y}}),[G,ye]=g.useState((me==null?void 0:me.entry)??null),[ne,U]=g.useState((me==null?void 0:me.detail)??null),[ee,q]=g.useState(!me),[je,R]=g.useState(!1),[oe,$e]=g.useState([]),[ve,Le]=g.useState(!1),[Te,Z]=g.useState(null),[ue,Pe]=g.useState(null),[Me,ke]=g.useState(null),[D,le]=g.useState(!1),ce=g.useRef(null),J=g.useRef(0),[we,Fe]=g.useState(null),Ve=l!==void 0?l:we,Je=g.useCallback(Y=>{d?d(Y):Fe(Y)},[d]),O=g.useCallback(async Y=>{if(!A.getCollectionCatalogs&&!A.getCollectionCatalog){$e([]);return}Le(!0);try{if(A.getCollectionCatalogs)$e(await A.getCollectionCatalogs(Y)||[]);else if(A.getCollectionCatalog){const H=await A.getCollectionCatalog(Y);$e(H?[{resource_id:"",data:H}]:[])}}catch{$e([])}finally{Le(!1)}},[A]),de=g.useCallback(async Y=>{var H,ge;if(!A.getTextManifest||!A.getTextIndex){Z(null),Pe(Y);return}try{const Ce=ze.pickTextVersion(await A.getTextManifest(Y)),be=Ce?await A.getTextIndex(Y,Ce.key):null;Z(be&&be.chapters.length>0?{chapters:be.chapters.map(Q=>({n:Q.n,title:Q.title,file:Q.file})),source:{name:((H=be.source)==null?void 0:H.name)??(Ce==null?void 0:Ce.source_name),license:((ge=be.source)==null?void 0:ge.license)??(Ce==null?void 0:Ce.license)??void 0}}:null)}catch{Z(null)}finally{Pe(Y)}},[A]),Ie=g.useCallback(async(Y,H)=>{const ge=++J.current,Ce=()=>ge!==J.current;le(!0);try{if(A.getLineageGraph){const De=await A.getLineageGraph(Y);if(Ce())return;De&&ke(De)}const be=H.version_graph;if(!be||!be.enabled){Me||ke(null),ce.current=null;return}const Q=_o(H),fe=(await qi(Q,Yi,async De=>{try{return await A.getItem(De)}catch{return null}},Ce)).filter(Boolean);if(Ce())return;ce.current={work:H,books:fe};const Oe=h??be.default_collection??(be.core_books&&be.core_books.length>0?"core":"all"),Se=Oe==="core"&&Array.isArray(be.core_books)&&be.core_books.length>0?"core":Oe??"all";ke(Si(H,fe,Se))}catch{if(Ce())return;ke(null),ce.current=null}finally{Ce()||le(!1)}},[A]),B=g.useRef({initialDetail:i,initialEntry:o});B.current={initialDetail:i,initialEntry:o},g.useEffect(()=>{let Y=!1;J.current++,le(!1);const H=Q=>{Q.type==="collection"?O(e):Q.type==="work"?(Q.version_graph||A.getLineageGraph)&&Ie(e,Q):Q.type==="book"&&Lr(Q)&&de(e)},ge=B.current;let Ce=null;if(me&&me.id===e)Ce=me;else if(ge.initialDetail&&ge.initialDetail.id===e){const Q={...ge.initialDetail},Ee=ge.initialEntry??Ar(e,Q);w&&w(Ee,Q),Ce={entry:Ee,detail:Q}}return Ce?(R(!1),$e(Q=>Q.length?[]:Q),Z(null),ke(null),ce.current=null,ye(Ce.entry),U(Ce.detail),q(!1),H(Ce.detail),()=>{Y=!0}):((async()=>{q(!0),R(!1),ye(null),U(null),$e([]),Z(null),ke(null),ce.current=null;try{const Q=await A.getItem(e);if(Y)return;if(!Q){R(!0);return}const Ee=Q;let fe=null;if(A.getEntry&&(fe=await A.getEntry(e),Y))return;fe||(fe=Ar(e,Ee)),w&&w(fe,Ee),ye(fe),U(Ee),H(Ee)}catch{Y||R(!0)}finally{Y||q(!1)}})(),()=>{Y=!0})},[e,A,me,w,O,Ie,de]),g.useEffect(()=>{const Y=ce.current;!Y||!h||ke(Si(Y.work,Y.books,h))},[h]);const pe=[];if(ne){if(pe.push({key:"basic",label:V.detailTab.basicInfo}),ne.type==="collection"){ve&&oe.length===0&&pe.push({key:"catalog:loading",label:`${V.detailTab.catalog}…`});for(const Y of oe)pe.push({key:`catalog:${Y.resource_id}`,label:Y.short_name?`${xe(Y.short_name)}${V.detailTab.catalogSuffix}`:V.detailTab.collectionCatalog})}(s==="collated"||s==="fulltext")&&pe.push({key:s,label:V.detailTab.fullText}),ne.type==="work"&&(Me||D)&&pe.push({key:"lineage",label:D?`${V.detailTab.lineage}…`:V.detailTab.lineage});for(const Y of C)(Y.position??"before-feedback")==="before-feedback"&&Y.shouldShow(ne)&&pe.push({key:Y.key,label:Y.label});_&&s==="feedback"&&pe.push({key:"feedback",label:V.detailTab.feedback});for(const Y of C)Y.position==="after-feedback"&&Y.shouldShow(ne)&&pe.push({key:Y.key,label:Y.label})}g.useEffect(()=>{if(s!=="emendated"||!ne)return;a("basic");const Y=setTimeout(()=>{var H;(H=document.getElementById("studies"))==null||H.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(Y)},[s,ne,a]);const ie=G&&ne&&v?v({activeTab:s,activeJuan:Ve,entry:G,detail:ne}):null,_e=g.useMemo(()=>{var be,Q,Ee,fe,Oe;if(!ne)return null;const H=(ne.authors??[]).map(Se=>{const De=So(Se.role);return`${Se.dynasty?`〔${xe(Se.dynasty)}〕`:""}${xe(Se.name)}${De?` ${xe(De)}`:""}`}).join(" · ");let ge=!1;try{ge=ze.extractStatus(ne.id)==="draft"}catch{}if(ne.type==="book"){const Se=ne;return{title:xe(Se.title),subtitle:Se.edition?xe(Se.edition):H||void 0,aside:[ge?V.status.draft:"",H&&Se.edition?H:""].filter(Boolean).join(" · ")||void 0,secondLine:void 0}}if(ne.type==="collection"){const Se=ne;return{title:xe(Se.title),subtitle:xe(Gt(Se,V.unit.juan))||void 0,aside:[(be=Se.publication_info)==null?void 0:be.year,ge?V.status.draft:""].filter(Boolean).join(" · ")||void 0,secondLine:H||void 0}}if(ne.type==="entity"){const Se=ne,De=lt=>lt==null?"":lt<0?ae("detail.bce",{n:-lt}):String(lt),pt=((Q=Se.dates)==null?void 0:Q.birth)!=null||((Ee=Se.dates)==null?void 0:Ee.death)!=null?`${De(((fe=Se.dates)==null?void 0:fe.birth)??void 0)||"?"}—${De(((Oe=Se.dates)==null?void 0:Oe.death)??void 0)||"?"}`:"";return{title:xe(Se.primary_name||Se.title),subtitle:[Se.dynasty?`〔${xe(Se.dynasty)}〕`:"",pt].filter(Boolean).join(" ")||void 0,aside:ge?V.status.draft:void 0,secondLine:void 0}}const Ce=xe(Gt(ne,V.unit.juan));return{title:xe(ne.title),subtitle:[Ce,H].filter(Boolean).join(" · ")||void 0,aside:[i1(V,ne.subtype),ge?V.status.draft:""].filter(Boolean).join(" · ")||void 0,secondLine:void 0}},[ne,xe,V,ae]),Re=ne&&Lr(ne)?"text":null,He=()=>{Je(null),a("fulltext")};let Ye=null;if(ne&&k){const Y=k({detail:ne,kind:Re});Y&&(Ye=t.jsx(Gr,{href:Y}))}else Re&&(Ye=t.jsx(Gr,{onClick:He}));const tt=Y=>{if(!ne)return null;const H=Y.replace(/\.[^.]+$/,"");if(k){const ge=k({detail:ne,kind:Re,juan:H});return ge?{href:ge}:null}return{onClick:()=>{Je(H),a("fulltext")}}},et=new Set(C.map(Y=>Y.key)),$=pe.filter(Y=>Y.key.startsWith("catalog:")&&Y.key!=="catalog:loading"||Y.key==="lineage"&&!!Me&&!D||et.has(Y.key)).map(Y=>({key:Y.key,label:Y.label,onClick:()=>a(Y.key)})),M=()=>{var Y;return ne?ne.type==="work"?t.jsx(Xd,{data:ne,transport:A,onNavigate:x,renderLink:S,readAction:Ye,railTop:z,railLinks:$}):ne.type==="book"?t.jsx(ep,{data:ne,transport:A,onNavigate:x,renderLink:S,readAction:Ye,fullText:Te,fullTextPending:Lr(ne)&&!!A.getTextManifest&&ue!==ne.id,chapterLink:tt,railTop:z,railLinks:$}):ne.type==="collection"?t.jsx(tp,{data:ne,catalog:(Y=oe[0])==null?void 0:Y.data,transport:A,onNavigate:x,renderLink:S,readAction:Ye,railTop:z,railLinks:$,catalogAction:oe.length>0?t.jsxs("a",{href:"#catalog",onClick:H=>{H.preventDefault(),a(`catalog:${oe[0].resource_id}`)},children:[xe(V.detailTab.collectionCatalog)," →"]}):null}):t.jsx(ip,{data:ne,transport:A,onNavigate:x,renderLink:S,railTop:z,railLinks:$,assetBase:b}):null},P=()=>{var H,ge,Ce;if(!G||!ne)return null;if(s==="basic"||s==="emendated")return M();if(typeof s=="string"&&s.startsWith("catalog:")){const be=(H=oe.find(Q=>`catalog:${Q.resource_id}`===s))==null?void 0:H.data;return t.jsx(Io,{data:be,onNavigate:x,renderLink:S})}if(s==="collated"||s==="fulltext")return t.jsx(os,{id:e,transport:A,chapter:Ve,onLocationChange:be=>Je(be.chapter),onNavigate:x});if(s==="lineage"){if(!Me)return t.jsx("div",{style:{color:r("label-fg"),padding:"24px 0"},children:ae(D?"detail.loading":"detail.noLineageGraph")});const be=ne.type==="work"?ne:null;return t.jsx(ds,{graph:Me,renderLink:S,graphHeight:Math.max(500,(typeof window<"u"?window.innerHeight:800)-250),defaultMode:c,onModeChange:p,selectedNodeId:f,collection:h??((ge=be==null?void 0:be.version_graph)==null?void 0:ge.default_collection),onCollectionChange:m,collectionsAvailable:(Ce=be==null?void 0:be.version_graph)==null?void 0:Ce.collections,collectionCounts:(()=>{var Oe,Se,De,pt,lt,Ke,Ze;if(!be)return;const Q={},Ee=((Oe=ce.current)==null?void 0:Oe.books)??[];Q.all=(((Se=be._books)==null?void 0:Se.length)??0)-(((pt=(De=be.version_graph)==null?void 0:De.excluded_books)==null?void 0:pt.length)??0);const fe=(lt=be.version_graph)==null?void 0:lt.collections;if(fe)for(const yt of Object.keys(fe))Q[yt]=Si(be,Ee,yt).nodes.filter(K=>K.kind==="book"&&!K.bridge).length;return Q.core==null&&((Ze=(Ke=be.version_graph)==null?void 0:Ke.core_books)!=null&&Ze.length)&&(Q.core=be.version_graph.core_books.length),Q})()})}if(s==="feedback"&&_)return t.jsx(Gd,{resourceId:e,apiUrl:I});const Y=C.find(be=>be.key===s);return Y?Y.render({detail:ne,entry:G,transport:A,onNavigate:x}):null};if(ee)return t.jsx(Hn,{style:{minHeight:T,...F},children:t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingTop:48},children:[180,320,160].map((Y,H)=>t.jsx("div",{style:{height:H===1?40:16,width:Y,opacity:.35,background:r("rule")}},H))})});if(je||!ne||!G||!_e)return t.jsx(Hn,{style:{minHeight:T,...F},children:t.jsx("div",{style:{padding:"64px 0",textAlign:"center",color:r("label-fg"),fontSize:14},children:ae("detail.notFound")})});const X=s==="basic"||s==="emendated",he=[{label:y??V.detailTab.backToIndex,onClick:j}];if(ne.type==="book"&&ne.work_id){const Y=ne.work_id;he.push({label:V.indexType.work,id:Y,onClick:()=>x==null?void 0:x(Y)})}he.push({label:V.indexType[ne.type]});const se=s==="collated"||s==="fulltext",We=typeof N=="string"?V.status[N.trim()]??N:N,Be=t.jsx(Xc,{left:t.jsxs(t.Fragment,{children:[We,We?" · ":"",t.jsx(n1,{id:ne.id,label:V.label.id,copied:V.action.copied,copyLabel:V.action.copy})]}),right:t.jsxs(t.Fragment,{children:[_&&!X&&t.jsx("button",{type:"button",onClick:()=>a("feedback"),style:{background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"inherit",fontSize:12,color:r("meta-fg")},children:V.detailTab.submitVersion}),ie&&t.jsx("a",{href:ie.href,target:"_blank",rel:"noopener noreferrer",className:"bim-d-hit",style:{color:r("meta-fg")},children:V.detailTab.dataLicense})]})});return X?t.jsx("div",{className:W,children:t.jsxs(Hn,{grid:!0,style:{minHeight:T,...F},children:[t.jsx(Yr,{breadcrumb:t.jsx(qr,{items:he}),actions:t.jsxs(t.Fragment,{children:[!E&&t.jsx(po,{style:{border:"none",background:"transparent"}}),!E&&ie&&t.jsx(uo,{...ie})]})}),M(),Be]})}):t.jsx("div",{className:W,children:t.jsxs(Hn,{wide:se,style:{minHeight:T,...F},children:[t.jsx(Yr,{breadcrumb:t.jsxs(t.Fragment,{children:[t.jsx(Po,{char:"籍"}),t.jsx(qr,{items:he})]}),actions:t.jsxs(t.Fragment,{children:[!E&&t.jsx(po,{}),_&&t.jsx("button",{type:"button",onClick:()=>a("feedback"),className:"bim-d-ui",style:{background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"inherit",fontSize:12,color:r("meta-fg")},children:V.detailTab.feedback}),!E&&ie&&t.jsx(uo,{...ie})]})}),t.jsx(Fc,{..._e,aside:se?t.jsxs("button",{type:"button",onClick:()=>a("basic"),className:"bim-d-ui",style:{background:"none",border:"none",padding:"2px 0",cursor:"pointer",fontFamily:"inherit",fontSize:12,color:r("accent"),borderBottom:`1px solid ${r("rule")}`},children:[ae("detail.workInfo")," →"]}):_e.aside}),!se&&pe.length>1&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,margin:"14px 0 0",paddingBottom:2},children:pe.map(Y=>t.jsx(Hc,{label:Y.label,active:Y.key===s||X&&Y.key==="basic",onClick:()=>a(Y.key)},Y.key))}),t.jsx("div",{style:{marginTop:!se&&pe.length>1?8:0},children:P()}),Be]})})};function n1({id:e,label:n,copied:i,copyLabel:o}){const[s,a]=g.useState(!1);return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[t.jsxs("span",{children:[n," ",e]}),t.jsx("button",{type:"button",onClick:()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)}).catch(()=>{})},title:s?i:o,"aria-label":s?i:o,className:"bim-d-hit",style:{background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"inherit",fontSize:14,minWidth:32,minHeight:32,display:"inline-flex",alignItems:"center",justifyContent:"center",color:r("aux-fg")},children:s?"✓":"⧉"})]})}function i1(e,n){return n?e.workSubtype[n]??n:""}const qp=[{name:"zhusha",label:"朱砂"},{name:"indigo",label:"靛青"},{name:"ink",label:"墨"}],Zi="zhusha",Ji="bim-theme";function Kp(e){return e==="zhusha"||e==="indigo"||e==="ink"}function Qi(e){return Kp(e)?e:Zi}function r1(){try{return Qi(window.localStorage.getItem(Ji))}catch{return Zi}}function Xp(e){try{window.localStorage.setItem(Ji,e)}catch{}}function Zp(e){const n=Qi(e);return document.documentElement.setAttribute("data-theme",n),n}function Jp(){return Qi(document.documentElement.getAttribute("data-theme"))}const o1=[{name:"airy",label:"疏朗",hint:"留白分区"},{name:"boxed",label:"界欄",hint:"框線分區"}],ys="airy",er="bim-layout";function Qp(e){return e==="airy"||e==="boxed"}function tr(e){return Qp(e)?e:ys}function s1(){try{return tr(window.localStorage.getItem(er))}catch{return ys}}function a1(e){try{window.localStorage.setItem(er,e)}catch{}}function l1(e){const n=tr(e);return document.documentElement.setAttribute("data-layout",n),n}function c1(){return tr(document.documentElement.getAttribute("data-layout"))}const d1=`try{var t=localStorage.getItem(${JSON.stringify(Ji)});if(t==='indigo'||t==='ink')document.documentElement.setAttribute('data-theme',t);if(localStorage.getItem(${JSON.stringify(er)})==='boxed')document.documentElement.setAttribute('data-layout','boxed')}catch(e){}`,p1={zhusha:"theme-dot-zhusha",indigo:"theme-dot-indigo",ink:"theme-dot-ink"},u1=({onChange:e,style:n})=>{const{t:i}=re(),[o,s]=g.useState(Zi);g.useEffect(()=>{s(Jp())},[]);const a=l=>{s(Zp(l)),Xp(l),e==null||e(l)};return t.jsx("div",{role:"radiogroup","aria-label":i("common.themeLabel"),style:{display:"inline-flex",alignItems:"center",...n},children:qp.map(l=>{const d=o===l.name;return t.jsx("button",{type:"button",role:"radio","aria-checked":d,"aria-label":i(`common.theme.${l.name}`),title:i(`common.theme.${l.name}`),onClick:()=>a(l.name),style:{width:28,height:44,padding:0,border:0,background:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:t.jsx("span",{"aria-hidden":"true",style:{width:14,height:14,borderRadius:"50%",boxSizing:"border-box",background:r(p1[l.name]),boxShadow:d?`0 0 0 2px ${r("page-bg")}, 0 0 0 3.5px ${r("aux-fg")}`:"none"}})},l.name)})})};exports.BidLink=ze.BidLink;exports.BookIndexError=ze.BookIndexError;exports.BookIndexManager=ze.BookIndexManager;exports.BookIndexStorage=ze.BookIndexStorage;exports.BundleStorage=ze.BundleStorage;exports.ConfigError=ze.ConfigError;exports.GithubStorage=ze.GithubStorage;exports.IdGenerationError=ze.IdGenerationError;exports.IdGenerator=ze.IdGenerator;exports.LocalStorage=ze.LocalStorage;exports.MigrationError=ze.MigrationError;exports.StorageError=ze.StorageError;exports.VARIANT_CHARS=ze.VARIANT_CHARS;exports.base36Decode=ze.base36Decode;exports.base36Encode=ze.base36Encode;exports.base58Decode=ze.base58Decode;exports.buildId=ze.buildId;exports.buildPromotionMap=ze.buildPromotionMap;exports.cleanName=ze.cleanName;exports.decodeId=ze.decodeId;exports.decodeIdString=ze.decodeIdString;exports.encodeId=ze.encodeId;exports.extractIdFromUrl=ze.extractIdFromUrl;exports.extractStatus=ze.extractStatus;exports.extractType=ze.extractType;exports.isChapterSegment=ze.isChapterSegment;exports.isTextKey=ze.isTextKey;exports.matchChapterAcrossVersions=ze.matchChapterAcrossVersions;exports.normalizeCatalog=ze.normalizeCatalog;exports.normalizeVariants=ze.normalizeVariants;exports.parseId=ze.parseId;exports.pickTextVersion=ze.pickTextVersion;exports.shardOf=ze.shardOf;exports.smartDecode=ze.smartDecode;exports.textVersionLabel=ze.textVersionLabel;exports.validateResource=ze.validateResource;exports.VARIANT_SUPPLEMENT=Cl.VARIANT_SUPPLEMENT;exports.Badge=Ti;exports.BidUrlProvider=Cu;exports.BookDetailLayout=t1;exports.BookPage=ep;exports.Breadcrumb=qr;exports.CATALOG_ALL_ID=Dt;exports.CATALOG_CSS=rp;exports.CATALOG_NARROW_QUERY=ps;exports.CATALOG_PAGE_SIZE=us;exports.CATALOG_UNCLASSIFIED_ID=cn;exports.CLASSIFICATIONS=Fi;exports.COMMON_TRADITIONAL_CHARS=Bl;exports.CardFoot=Qn;exports.CatalogPage=A0;exports.CatalogPager=pp;exports.CatalogTree=sp;exports.CheckFilter=Bc;exports.Chip=Dc;exports.ChipWall=Tg;exports.CollectionCatalog=Io;exports.CollectionPage=tp;exports.CreateEntityDialog=Bd;exports.DEFAULT_LAYOUT=ys;exports.DEFAULT_META_HOME_LINKS=Np;exports.DEFAULT_READER_PREFS=Eo;exports.DEFAULT_READ_HOME_LINKS=mp;exports.DEFAULT_THEME=Zi;exports.DETAIL_CSS=Wc;exports.DYNASTY_GROUPS=Wi;exports.Dash=Mg;exports.DataTable=Rg;exports.DetailFooter=Xc;exports.DetailGrid=Zn;exports.DetailHeader=Fc;exports.EMPTY_FILTERS=Oi;exports.ENTITY_TEXT_CSS=Qo;exports.EmendatedBySection=gc;exports.EmptyNote=Dg;exports.EntityDetail=dc;exports.EntityMark=ts;exports.EntityPage=ip;exports.EntityPickerDialog=Wd;exports.EntitySelector=Pd;exports.EntityText=mx;exports.ExpandRow=Pg;exports.ExtLink=Ug;exports.FEEDBACK_FAB_OFFSET_VAR=oo;exports.FILTER_SUPPORT=tc;exports.FONT_SIZE_STEPS=Ht;exports.FactList=$g;exports.FeedbackButton=xy;exports.FeedbackDialog=Ud;exports.FeedbackForm=Vd;exports.FeedbackList=ss;exports.FeedbackTab=Gd;exports.FilterChip=Hc;exports.FormInput=kt;exports.FormTextArea=pn;exports.GUJI_MARKDOWN_FIELD=pg;exports.GUJI_TABLE_NOTATION=Zc;exports.GlyphBadge=Po;exports.GujiInteractiveReader=db;exports.GujiTable=Wo;exports.GujiTextViewer=ns;exports.GujiWarpCanvas=Jo;exports.HomePage=io;exports.ImagePanel=Hr;exports.IndexApp=cb;exports.IndexBrowser=Wr;exports.IndexDetail=To;exports.IndexEditor=Fd;exports.IndexView=iy;exports.IntroGrid=_g;exports.LAYOUTS=o1;exports.LAYOUT_STORAGE_KEY=er;exports.LOSS_OPTIONS=ec;exports.LocaleContext=Mt;exports.LocaleProvider=tm;exports.LocaleToggle=po;exports.META_HOME_CSS=zp;exports.META_HOME_SECTION_IDS=Gp;exports.MetaCatalogTable=Pp;exports.MetaCollectionGroups=Fp;exports.MetaDataLicense=Vp;exports.MetaHomeView=K0;exports.MetaLine=dt;exports.MetaLineageCards=Dp;exports.MetaOnlineSites=Up;exports.MetaPeopleTimeline=Hp;exports.MetaRecentPanel=Ap;exports.MetaRelatedCatalogs=Op;exports.MetaTypeChips=Rp;exports.ModeIndicator=Wl;exports.MoreButton=Ng;exports.MoreLink=Ao;exports.PAGE_MAX_WIDTH=vi;exports.PERIOD_NARROW_SHARE=xp;exports.PageFrame=Hn;exports.Quote=Og;exports.READER_CSS=vc;exports.READ_HOME_CSS=hs;exports.READ_HOME_NARROW_QUERY=ni;exports.READ_HOME_SECTION_IDS=Cp;exports.READ_PERIOD_LABELS=O0;exports.RECENT_IDS_STORAGE_KEY=Sn;exports.ROLE_CLASS_ORDER=ql;exports.ReadButton=Gr;exports.ReadFamousWorks=Sp;exports.ReadHomeView=F0;exports.ReadPeriodBand=_p;exports.ReadPicks=jp;exports.ReadPieces=$p;exports.ReadSection=xt;exports.ReadShelf=fs;exports.ReadSibu=xs;exports.ReadStats=yp;exports.ReadTopicGroup=kp;exports.ReadTopics=wp;exports.ReaderMdText=Uo;exports.ReaderShell=Nc;exports.ReaderToc=kc;exports.RelationPanel=Ad;exports.RepoSourceLink=uo;exports.ResourceEditor=Mr;exports.ResourceGroup=Wg;exports.ResourceLine=Fg;exports.ResourceList=yo;exports.ResourceRow=qc;exports.SEARCH_VIEW_STORAGE_KEY=Co;exports.SEVEN_PAVILIONS_KEY=Wp;exports.SNIPPET_MARK_END=Tl;exports.SNIPPET_MARK_START=Nl;exports.SORTABLE_TYPES=Ql;exports.SearchInput=Hl;exports.SearchResults=ac;exports.Sec=ut;exports.Section=Tt;exports.SectionHead=Cg;exports.SideList=dn;exports.SmartBidInput=wi;exports.SourceEditor=Rd;exports.StripWarpRenderer=Zr;exports.SummaryCard=Jn;exports.THEMES=qp;exports.THEME_INIT_SCRIPT=d1;exports.THEME_STORAGE_KEY=Ji;exports.TRADITIONAL_ALLOWLIST=Ol;exports.TabFilter=Di;exports.TableHead=Eg;exports.TableRow=Lg;exports.TagRow=Kc;exports.TagRows=Hg;exports.TextButton=zg;exports.TextReader=os;exports.ThemeToggle=u1;exports.TopStrip=Yr;exports.VersionLineageGraph=Qd;exports.VersionLineageList=Jd;exports.VersionLineageView=ds;exports.VolumeChips=Ig;exports.VolumeLinks=Bo;exports.WorkCard=cp;exports.WorkCardGrid=up;exports.WorkCatalog=kb;exports.WorkPage=Xd;exports.WorkRow=dp;exports.adaptCharCord=vb;exports.adaptEntityJson=cd;exports.adaptNorm=Id;exports.adaptNormDetailed=Td;exports.adaptPunctJson=hb;exports.applyLayout=l1;exports.applyTheme=Zp;exports.authorsLine=Xi;exports.bookIndexUriToId=Xr;exports.bookMarkingOf=Do;exports.bucketResources=ko;exports.buildCatalogTree=$0;exports.buildCollectionTable=Zl;exports.buildLineageGraph=Si;exports.buildMeiliFilter=Wm;exports.buildPageUrl=xo;exports.buildParagraphBlocks=rd;exports.buildVersionRow=Gl;exports.buildVersionTable=Yl;exports.canParagraphize=zi;exports.catalogNodeIdOf=S0;exports.catalogNodeIdsOf=_0;exports.catalogPageCount=T0;exports.catalogTotal=ms;exports.classificationPath=ti;exports.clearAllRecentIds=zo;exports.compareCatalogCards=N0;exports.computeVersionPartition=Im;exports.countActiveFilters=Hi;exports.createTextApi=xc;exports.currentLayout=c1;exports.currentTheme=Jp;exports.defaultEntityHref=bd;exports.defaultWorkLink=ap;exports.deriveDating=Sm;exports.deriveEditionType=Jl;exports.deriveEra=Xn;exports.deriveYear=Mi;exports.deriveYearRange=vo;exports.detailToEditor=Dd;exports.detectGenre=Vi;exports.displayAuthorRole=So;exports.editorToDetail=ny;exports.eraRank=Br;exports.filtersFromParams=Fm;exports.filtersToParams=Ci;exports.findCatalogPath=vn;exports.findTraditionalChars=rm;exports.firstAuthorText=gs;exports.flattenTitles=Kr;exports.flattenToc=zc;exports.fmtCount=it;exports.formatHitCount=bi;exports.formatTemplate=wt;exports.formatVolumeRange=Bi;exports.getDisplayNameFromUrl=$n;exports.getMessages=zn;exports.getStartPage=fo;exports.getT=Nn;exports.getTypeGroupKey=ho;exports.groupRelatedWorks=_m;exports.gujiInlineToPlain=Mc;exports.hasActiveFilters=nc;exports.hasGujiMarkdownV02=ug;exports.hasGujiTableNotation=Vg;exports.hasSearchOptions=Pm;exports.headingKey=rs;exports.headingsFromPunct=kd;exports.iiifVolumeOf=gb;exports.isCountedChar=Vo;exports.isDuiduChapter=no;exports.isLayoutName=Qp;exports.isThemeName=Kp;exports.lineageHref=Tp;exports.loadRecentIds=Qt;exports.measureText=Gt;exports.mergeVolumeResources=go;exports.nestHeadings=Sd;exports.normalizeEra=ct;exports.normalizeLayout=tr;exports.normalizeRole=wo;exports.normalizeTheme=Qi;exports.normalizeVolumeIndex=Un;exports.normalizeVolumes=El;exports.numberToChinese=In;exports.paginationItems=op;exports.parseChineseNumber=_i;exports.parseGujiInline=Ac;exports.parseGujiTable=Qc;exports.parseHeadingKey=wd;exports.parseSourceString=Ed;exports.pct=bs;exports.periodLevel=fp;exports.pickReaderVersion=Cc;exports.readStoredLayout=s1;exports.readStoredTheme=r1;exports.readerVersionOptionLabel=Ur;exports.remapPlainOffsets=dd;exports.removeRecentId=lc;exports.renderFullTextBody=tf;exports.renderProperNames=ad;exports.renderReaderInline=Gi;exports.resolveRecentEntry=No;exports.resourceHref=Cn;exports.resourceNote=Pi;exports.resultTabFromParam=Zm;exports.resultTabToParam=Jm;exports.roleFacets=Kl;exports.rowNo=Ag;exports.sameFilters=Hm;exports.sanitizeHeadings=to;exports.saveRecentId=Or;exports.segmentEntities=pd;exports.shelfColumns=hp;exports.sortFor=Bm;exports.sortYear=$i;exports.spineHeight=gp;exports.splitFullTextTables=Oo;exports.splitHighlightSnippet=mo;exports.splitTableRow=Jc;exports.storeLayout=a1;exports.storeTheme=Xp;exports.stringifySources=Ld;exports.summaryFromEntry=fd;exports.summaryFromItem=gd;exports.timelineLayout=Ip;exports.toCatalogWorkCard=z0;exports.transportSummaryLoader=xd;exports.typeSupportsFilters=ic;exports.useBidUrl=at;exports.useChapterWarpData=vd;exports.useConvert=Ue;exports.useEntitySummaryLoader=es;exports.useI18n=re;exports.useReaderPrefs=$c;exports.useRecentEntries=Ep;exports.useT=Ae;exports.validateLineageGraph=Hy;exports.volumeStats=Ri;exports.withDefaultLinks=en;exports.withMetaLinks=tn;exports.yearText=Ii;
1967
+ `,Np={item:e=>`/item/${encodeURIComponent(e)}`,node:e=>`/catalog?node=${encodeURIComponent(e)}`};function tn(e){return{...Np,...e??{}}}function Tp(e,n){if(e.lineage)return e.lineage(n);const i=e.item(n),o=i.indexOf("#"),[s,a]=o<0?[i,""]:[i.slice(0,o),i.slice(o)];return`${s}${s.includes("?")?"&":"?"}tab=lineage${a}`}function bs(e,n){return!n||n<=0?0:Math.max(0,Math.min(100,Math.round(e/n*100)))}function Ip(e){const n=e.filter(p=>Number.isFinite(p.birth_year)||Number.isFinite(p.death_year)),i=e.filter(p=>!n.includes(p));if(!n.length)return{min:0,max:0,placed:[],missing:i};const o=p=>{const h=Number.isFinite(p.birth_year)?p.birth_year:p.death_year-50,m=Number.isFinite(p.death_year)?p.death_year:p.birth_year+50;return[Math.min(h,m),Math.max(h,m)]},s=n.map(o),a=Math.min(...s.map(p=>p[0])),l=Math.max(...s.map(p=>p[1])),d=Math.max(1,l-a),c=n.map((p,h)=>({p,from:s[h][0],to:s[h][1]})).sort((p,h)=>p.from-h.from).map(p=>({...p,left:(p.from-a)/d*100,width:Math.max(.8,(p.to-p.from)/d*100)}));return{min:a,max:l,placed:c,missing:i}}function Ii(e,n=Nn("zh-Hant")){return e<0?n("metaHome.yearBC",{n:-e}):String(e)}function U0(e){return{read:e.item,work:e.item,node:e.node}}function Rp({counts:e,links:n}){const{t:i}=re(),o=n==null?void 0:n.type;if(!o)return null;const s=[["all",i("metaHome.typeAll"),null],["work",i("metaHome.typeLabel.work"),e.works],["book",i("metaHome.typeLabel.book"),e.books],["collection",i("metaHome.typeLabel.collection"),e.collections],["entity",i("metaHome.typeLabel.entity"),e.entities]];return t.jsx("ul",{className:"bim-mh-types bim-rh-num","aria-label":i("metaHome.typeChipsLabel"),children:s.map(([a,l,d])=>t.jsx("li",{children:t.jsxs("a",{href:o(a),children:[t.jsx("b",{children:l}),d!=null&&d>0&&t.jsx("small",{children:it(d)})]})},a))})}function Ep(e,n=5){const[i,o]=g.useState(null);g.useEffect(()=>{let a=!1;const l=Qt().slice(0,n);if(!l.length||!e){o([]);return}return Promise.all(l.map(d=>No(e,d))).then(d=>{a||o(d.filter(c=>!c.notFound))}),()=>{a=!0}},[e,n]);const s=g.useCallback(()=>{zo(),o([])},[]);return{entries:i,clear:s}}function V0(e,n,i){const o=e.type==="book"?e.edition||e.era:e.type==="collection"?"":e.dynasty;return o?i(o):Lp(e.type,n)}function Lp(e,n){return n(`metaHome.typeLabel.${e}`)}function Ap({entries:e,onClear:n,links:i}){const{t:o,convert:s}=re(),a=tn(i);return t.jsxs("aside",{className:"bim-mh-recent","aria-labelledby":"bim-mh-recent-h",children:[t.jsxs("div",{className:"bim-mh-recent-h",children:[t.jsx("h2",{id:"bim-mh-recent-h",children:o("metaHome.recentTitle")}),e&&e.length>0&&n&&t.jsx("button",{type:"button",onClick:n,children:o("metaHome.recentClear")})]}),e&&e.length>0&&t.jsx("ol",{children:e.map(l=>t.jsx("li",{children:t.jsxs("a",{href:a.item(l.id),"aria-label":o("metaHome.recentItemLabel",{type:l.type?Lp(l.type,o):"",title:s(l.title)}),children:[t.jsx("i",{className:"bim-mh-ty","aria-hidden":"true",children:l.type?o(`metaHome.typeShort.${l.type}`):""}),t.jsx("span",{children:s(l.title)}),t.jsx("small",{"aria-hidden":"true",children:V0(l,o,s)})]})},l.id))}),e&&e.length===0&&t.jsx("p",{className:"bim-mh-recent-empty",children:o("metaHome.recentEmpty")})]})}function Mp(e,n,i,o=!1){return o&&(e==="done"||e==="in_progress")?n(`metaHome.siteStatus.${e}`):e==="done"||e==="in_progress"||e==="todo"?n(`metaHome.status.${e}`):i(e)}function Pp({rows:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);return e.length?t.jsx("div",{className:"bim-mh-tbl-wrap",tabIndex:0,role:"region","aria-label":i("metaHome.catalogTitle"),children:t.jsxs("table",{className:"bim-mh-tbl",children:[t.jsxs("caption",{children:[i("metaHome.catalogTitle"),t.jsx("small",{children:i("metaHome.catalogNote")})]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",children:i("metaHome.colCatalog")}),t.jsx("th",{scope:"col",className:"bim-mh-r",children:i("metaHome.colRecords")}),t.jsx("th",{scope:"col",className:"bim-mh-r",children:i("metaHome.colMatched")}),t.jsx("th",{scope:"col",children:i("metaHome.colProgress")}),t.jsx("th",{scope:"col",children:i("metaHome.colStatus")})]})}),t.jsx("tbody",{children:e.map(a=>{const l=bs(a.imported,a.total),d=a.work_id??a.collection_id,c=o(a.edition?`${a.name}·${a.edition}`:a.name);return t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:d?t.jsx("a",{href:s.item(d),children:c}):c}),t.jsx("td",{className:"bim-mh-r",children:it(a.total)}),t.jsx("td",{className:"bim-mh-r",children:it(a.imported)}),t.jsx("td",{children:t.jsxs("span",{className:"bim-mh-meter",children:[t.jsx("i",{"aria-hidden":"true",style:{"--bimmh-w":`${l}%`}}),t.jsxs("small",{children:[l,"%"]})]})}),t.jsx("td",{children:a.status&&t.jsx("span",{className:"bim-mh-st","data-st":a.status,children:Mp(a.status,i,o)})})]},a.id||a.name)})})]})}):null}function Bp({items:e,links:n,label:i}){const{convert:o}=re();return t.jsx("ul",{className:"bim-rh-rows","aria-label":i?o(i):void 0,children:e.map(s=>t.jsx("li",{children:t.jsxs("a",{href:n.item(s.id),children:[t.jsx("span",{className:"bim-rh-t",children:o(s.title)}),s.sub&&t.jsx("small",{children:o(s.sub)})]})},s.id))})}function Op({works:e,links:n}){const{t:i}=re(),[o,s]=g.useState(!1);if(!e.length)return null;const a=Kn(e.length);return t.jsxs("div",{className:"bim-rh-grp","data-cap":a?"":void 0,"data-open":o?"":void 0,children:[t.jsxs("h3",{className:"bim-rh-gt",children:[i("metaHome.relatedTitle"),t.jsx("small",{children:i("metaHome.relatedNote")})]}),t.jsx(Bp,{items:e.map(l=>({id:l.id,title:l.title,sub:Xi(l)||void 0})),links:tn(n)}),a&&t.jsx("button",{type:"button",className:"bim-rh-expand","aria-expanded":o,onClick:()=>s(l=>!l),children:o?i("action.collapse"):i("metaHome.allNWorks",{n:e.length})})]})}const Wp="siku_qige";function G0({group:e,links:n}){const{t:i,convert:o}=re(),[s,a]=g.useState(!1);return t.jsxs("div",{className:"bim-rh-grp","data-cap":Kn(e.items.length)?"":void 0,"data-open":s?"":void 0,children:[t.jsxs("h3",{className:"bim-rh-gt",children:[o(e.label),t.jsx("small",{className:"bim-rh-num",children:i("metaHome.nKinds",{n:e.items.length})})]}),t.jsx(Bp,{items:e.items,links:n,label:e.label}),Kn(e.items.length)&&t.jsx("button",{type:"button",className:"bim-rh-expand","aria-expanded":s,onClick:()=>a(l=>!l),children:s?i("action.collapse"):i("metaHome.allNKinds",{n:e.items.length})})]})}function Fp({groups:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);if(!e.length)return null;const a=e.find(c=>c.key===Wp),l=e.filter(c=>c!==a),d=c=>{var p;return((p=c.match(/(文[^\s·・閣阁]+)[閣阁]/))==null?void 0:p[1])??c};return t.jsxs(t.Fragment,{children:[a&&t.jsxs(t.Fragment,{children:[t.jsxs("h3",{className:"bim-rh-gt",children:[o(a.label),t.jsx("small",{children:o(a.items.map(c=>d(c.title)).join("、"))})]}),t.jsx("ul",{className:"bim-mh-ge","aria-label":o(a.label),children:a.items.map(c=>t.jsx("li",{children:t.jsxs("a",{href:s.item(c.id),"aria-label":o(c.title),title:o(c.title),children:[t.jsx("span",{"aria-hidden":"true",children:o(d(c.title))}),d(c.title)!==c.title&&t.jsx("small",{"aria-hidden":"true",children:i("metaHome.pavilion")})]})},c.id))})]}),l.length>0&&t.jsx("div",{className:"bim-mh-cg",style:a?void 0:{marginTop:0},children:l.map(c=>t.jsx(G0,{group:c,links:s},c.key))})]})}const wl=34,Sl=13;function _l(e,n){return e.birth_year==null&&e.death_year==null?"":`${e.birth_year!=null?Ii(e.birth_year,n):"?"}–${e.death_year!=null?Ii(e.death_year,n):"?"}`}function Y0(e,n){const i=n-e,o=i>1200?300:i>400?100:50,s=[];for(let a=Math.ceil(e/o)*o;a<=n;a+=o)s.push(a);return s}function Hp({people:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);if(!e.length)return null;const{min:a,max:l,placed:d,missing:c}=Ip(e),p=[],h=d.map(u=>{const f=u.left>70,x=f?Math.min(u.left,u.left+u.width-Sl):u.left;let j=0;for(;p[j]!=null&&p[j]>x;)j++;return p[j]=f?u.left+u.width:u.left+Math.max(u.width,Sl),{...u,lane:j,end:f}}),m=Math.max(1,l-a);return t.jsxs(t.Fragment,{children:[h.length>0&&t.jsxs("div",{className:"bim-mh-tl",children:[t.jsx("ul",{className:"bim-mh-tl-rows",style:{height:p.length*wl+10},children:h.map(u=>t.jsxs("li",{className:"bim-mh-tl-bar","data-end":u.end?"":void 0,style:{left:`${u.left}%`,top:u.lane*wl+4,width:`${Math.max(u.width,.5)}%`},children:[t.jsx("i",{"aria-hidden":"true",style:{width:"100%"}}),t.jsxs("a",{href:s.item(u.p.id),children:[o(u.p.name),t.jsx("small",{className:"bim-rh-num",children:_l(u.p,i)})]})]},u.p.id))}),t.jsx("div",{className:"bim-mh-tl-axis","aria-hidden":"true",children:Y0(a,l).map(u=>t.jsx("span",{style:{left:`${(u-a)/m*100}%`},children:Ii(u,i)},u))})]}),t.jsx("ul",{className:"bim-mh-tl-list","data-only":h.length?void 0:"",children:(h.length?e:c).map(u=>t.jsx("li",{children:t.jsxs("a",{href:s.item(u.id),children:[t.jsx("span",{children:o(u.name)}),t.jsx("small",{className:"bim-rh-num",children:[u.dynasty?o(u.dynasty):"",_l(u,i)].filter(Boolean).join(" ")})]})},u.id))}),c.length>0&&h.length>0&&t.jsx("p",{className:"bim-mh-tl-foot",children:i("metaHome.missingLife",{names:o(c.map(u=>u.name).join("、"))})})]})}const q0=t.jsxs("svg",{width:"54",height:"34",viewBox:"0 0 54 34",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:[t.jsx("circle",{cx:"27",cy:"5",r:"3.5"}),t.jsx("circle",{cx:"10",cy:"29",r:"3.5"}),t.jsx("circle",{cx:"27",cy:"29",r:"3.5"}),t.jsx("circle",{cx:"44",cy:"29",r:"3.5"}),t.jsx("path",{d:"M27 8.5v17M27 15H10v10.5M27 15h17v10.5"})]});function Dp({works:e,links:n}){const{t:i,convert:o}=re(),s=tn(n);return e.length?t.jsx("ul",{className:"bim-mh-lin",children:e.map(a=>{const l=Xi(a);return t.jsx("li",{children:t.jsxs("a",{href:Tp(s,a.id),children:[q0,t.jsx("b",{children:o(a.title)}),l&&t.jsx("small",{children:o(l)}),t.jsx("span",{children:i("metaHome.viewLineage")})]})},a.id)})}):null}function Up({sites:e}){const{t:n,convert:i}=re(),o=e.filter(a=>a.status!=="todo"&&a.total>0),s=e.filter(a=>!o.includes(a));return e.length?t.jsxs(t.Fragment,{children:[o.length>0&&t.jsx("ul",{className:"bim-mh-cov",children:o.map(a=>{const l=bs(a.imported,a.total);return t.jsxs("li",{children:[a.url?t.jsx("a",{href:a.url,rel:"noopener noreferrer",target:"_blank",children:i(a.name)}):t.jsx("span",{children:i(a.name)}),t.jsx("span",{className:"bim-mh-bar","aria-hidden":"true",style:{"--bimmh-w":`${l}%`}}),t.jsxs("small",{children:[`${it(a.imported)} / ${it(a.total)} ${l}% `,a.status&&t.jsx("span",{className:"bim-mh-st","data-st":a.status,children:Mp(a.status,n,i,!0)})]})]},a.id||a.name)})}),s.length>0&&t.jsx("p",{className:"bim-mh-todo",children:n("metaHome.plannedSites",{names:i(s.map(a=>a.name).join("、"))})})]}):null}const $l=["extant","partially_extant","lost","unknown"];function Vp({stats:e,links:n,version:i,repoUrl:o,downloadHref:s}){const{t:a}=re(),l=["works","books","collections","entities","has_image","has_text","article","poem"].map(p=>[e[p],a(`metaHome.stat.${p}`)]).filter(([p])=>p>0),d=n==null?void 0:n.loss,c=$l.some(p=>{var h;return(((h=e.loss)==null?void 0:h[p])??0)>0});return t.jsxs("div",{className:"bim-mh-data",children:[l.length>0&&t.jsxs("div",{children:[t.jsx("h3",{className:"bim-rh-gt",children:a("metaHome.dataScale")}),t.jsx("ul",{className:"bim-mh-nums",children:l.map(([p,h])=>t.jsxs("li",{children:[t.jsx("b",{className:"bim-rh-num",children:it(p)}),t.jsx("span",{children:h})]},h))})]}),d&&t.jsxs("div",{children:[t.jsx("h3",{className:"bim-rh-gt",children:a("metaHome.byLoss")}),t.jsx("ul",{className:"bim-mh-loss",children:$l.map(p=>{var u;const h=((u=e.loss)==null?void 0:u[p])??0,m=a(`metaHome.lossNote.${p}`);return t.jsx("li",{children:t.jsxs("a",{href:d(p),children:[a(`metaHome.loss.${p}`),t.jsx("small",{className:"bim-rh-num",children:c&&h>0?a("metaHome.lossCount",{n:it(h),note:m}):m})]})},p)})})]}),t.jsxs("div",{className:"bim-mh-lic",children:[t.jsxs("p",{children:[t.jsx("span",{className:"bim-mh-cc0",children:"CC BY-SA 4.0"}),a("metaHome.license")]}),t.jsxs("p",{children:[a("metaHome.repo"),o?t.jsx("a",{href:o,children:t.jsx("code",{children:"book-index"})}):t.jsx("code",{children:"book-index"}),a("metaHome.repoNote")]}),i&&t.jsxs("p",{children:[a("metaHome.version"),t.jsx("code",{children:i})]}),s&&t.jsx("p",{children:t.jsx("a",{href:s,children:a("metaHome.download")})})]})]})}const Gp={zhi:"zhi",sibu:"sibu",cong:"cong",people:"people",lineage:"lineage",sites:"sites",data:"data"};function K0({sections:e,links:n,head:i,transport:o,catalogHref:s,collectionsHref:a,entitiesHref:l,version:d,repoUrl:c,downloadHref:p,className:h}){var k,z;const{t:m}=re(),u=e,f=tn(n),x=U0(f),j=Gp,y=Ep(o),S={zhi:!!((k=u.shelf)!=null&&k.items.length)||u.catalog_progress.length>0||u.related_catalogs.length>0,sibu:u.bu.length>0||u.unclassified>0,cong:u.collection_groups.length>0,people:u.bibliographers.length>0,lineage:u.lineage.length>0,sites:u.sites.length>0,data:!0},b=Object.keys(j).filter(C=>S[C]),w=C=>m(`metaHome.nav.${C}`),v=(C,_)=>C?t.jsx("a",{className:"bim-rh-more",href:C,children:_}):void 0;return t.jsxs("div",{className:h?`bim-rh bim-mh ${h}`:"bim-rh bim-mh",children:[t.jsx("style",{children:hs+zp}),t.jsxs("div",{className:"bim-mh-head",children:[t.jsxs("div",{className:"bim-mh-q",children:[i,t.jsx(Rp,{counts:u.counts,links:n})]}),o&&t.jsx(Ap,{entries:y.entries,onClear:y.clear,links:n})]}),b.length>1&&t.jsx("nav",{className:"bim-rh-secnav","aria-label":m("metaHome.navLabel"),children:t.jsx("ul",{children:b.map(C=>t.jsx("li",{children:t.jsx("a",{href:`#${j[C]}`,children:w(C)})},C))})}),t.jsxs("div",{className:"bim-rh-main",children:[S.zhi&&t.jsxs(xt,{id:j.zhi,title:w("zhi"),sub:m("metaHome.zhiSub"),children:[u.shelf&&u.shelf.items.length>0&&t.jsx(fs,{topic:{key:"shelf",label:u.shelf.label,shelf:!0,items:u.shelf.items},links:x,showTitle:!1,legendCount:u.shelf.items.some(C=>C.records)?m("metaHome.shelfLegendCount"):null,legendExtra:[m("metaHome.shelfLegendClick")]}),(u.catalog_progress.length>0||u.related_catalogs.length>0)&&t.jsxs("div",{className:"bim-mh-zhi",style:(z=u.shelf)!=null&&z.items.length?void 0:{marginTop:0},children:[t.jsx(Pp,{rows:u.catalog_progress,links:n}),t.jsx(Op,{works:u.related_catalogs,links:n})]})]}),S.sibu&&t.jsx(xt,{id:j.sibu,title:w("sibu"),sub:m("metaHome.sibuSub"),more:v(s,m("metaHome.toCatalog")),children:t.jsx(xs,{bu:u.bu,unclassified:u.unclassified,links:x,unclassifiedNote:m("metaHome.unclassifiedNote")})}),S.cong&&t.jsx(xt,{id:j.cong,title:w("cong"),sub:m("metaHome.congSub"),more:v(a,m("metaHome.allNKindsMore",{n:it(u.counts.collections)})),children:t.jsx(Fp,{groups:u.collection_groups,links:n})}),S.people&&t.jsx(xt,{id:j.people,title:w("people"),sub:m("metaHome.peopleSub"),more:v(l,m("metaHome.allNPeopleMore",{n:it(u.counts.entities)})),children:t.jsx(Hp,{people:u.bibliographers,links:n})}),S.lineage&&t.jsx(xt,{id:j.lineage,title:w("lineage"),sub:m("metaHome.lineageSub"),children:t.jsx(Dp,{works:u.lineage,links:n})}),S.sites&&t.jsx(xt,{id:j.sites,title:w("sites"),sub:m("metaHome.sitesSub"),children:t.jsx(Up,{sites:u.sites})}),t.jsx(xt,{id:j.data,title:w("data"),sub:m("metaHome.dataSub"),children:t.jsx(Vp,{stats:u.stats,links:n,version:d,repoUrl:c,downloadHref:p})})]})]})}const Yp=["_related","_catalogs","_collections","_members","_children"],X0=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),co=e=>X0(e)&&!!e.h;function Z0(e){return e?Yp.some(n=>{const i=e[n];return Array.isArray(i)&&i.some(co)}):!1}function J0(e,n){const i={...e};if(!n)return i;for(const o of Yp){const s=e[o];!Array.isArray(s)||!s.some(co)||(i[o]=s.map(a=>{var c;if(!co(a)||typeof a.title=="string"&&a.title)return a;const l=a.id??a.bid,d=l?(c=n[l])==null?void 0:c.title:void 0;return d?{...a,title:d}:a}))}return i}function Q0(e){let n=null;const i=()=>e.getHubs?(n??(n=e.getHubs().catch(()=>null)),n):Promise.resolve(null);return new Proxy(e,{get(o,s){if(s==="getItem")return async l=>{const d=await o.getItem(l);return d&&J0(d,Z0(d)?await i():null)};const a=Reflect.get(o,s,o);return typeof a=="function"?a.bind(o):a}})}const po=({style:e})=>{const n=g.useContext(Mt),{t:i}=re();if(!n)return null;const{locale:o,setLocale:s}=n,a=o==="zh-Hant",l=()=>s(a?"zh-Hans":"zh-Hant");return t.jsxs("button",{type:"button",onClick:l,title:i(a?"common.toHans":"common.toHant"),style:{display:"inline-flex",alignItems:"center",gap:"2px",padding:"4px 10px",fontSize:"13px",fontWeight:500,lineHeight:1,border:`1px solid ${r("border")}`,borderRadius:"4px",background:r("bg"),color:r("fg"),cursor:"pointer",userSelect:"none",...e},children:[t.jsx("span",{style:{color:a?r("primary"):void 0,fontWeight:a?700:400},children:i("common.localeShortHant")}),t.jsx("span",{style:{opacity:.3},children:"/"}),t.jsx("span",{style:{color:a?void 0:r("primary"),fontWeight:a?400:700},children:i("common.localeShortHans")})]})},uo=({href:e,label:n,size:i=16,className:o,style:s})=>{const{t:a}=re(),l=n??a("common.repoSourceLink");return t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:l,"aria-label":l,className:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:i+8,height:i+8,borderRadius:4,color:r("desc-fg"),textDecoration:"none",transition:"color 120ms, background 120ms",...s},onMouseEnter:d=>{d.currentTarget.style.color=r("fg")},onMouseLeave:d=>{d.currentTarget.style.color=r("desc-fg")},children:t.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})})};function Lr(e){const n=e.text_count;return typeof n=="number"&&n>0}function Ar(e,n){return{id:e,title:n.title??n.primary_name??e,type:n.type??"book"}}function e1(e,n){if(!n)return!1;const i=n.id;return i===void 0||i===e}const t1=({id:e,transport:n,initialDetail:i,initialEntry:o,activeTab:s,onTabChange:a,activeJuan:l,onJuanChange:d,lineageMode:c="list",onLineageModeChange:p,lineageCollection:h,onLineageCollectionChange:m,initialPage:u=1,selectedLineageNodeId:f,onNavigate:x,onBack:j,backLabel:y,renderLink:S,assetBase:b,enrichDetail:w,getSourceLink:v,readLink:k,railTop:z,extraTabs:C=[],showFeedbackTab:_=!0,feedbackApiUrl:I,height:T,footerExtra:N,hideHeaderControls:E=!1,className:W,style:F})=>{const A=g.useMemo(()=>Q0(n),[n]),V=Ae(),{t:ae,convert:xe}=re(),[me]=g.useState(()=>{if(!e1(e,i))return null;const Y={...i},H=o??Ar(e,Y);return w&&w(H,Y),{id:e,entry:H,detail:Y}}),[G,ye]=g.useState((me==null?void 0:me.entry)??null),[ne,U]=g.useState((me==null?void 0:me.detail)??null),[ee,q]=g.useState(!me),[je,R]=g.useState(!1),[oe,$e]=g.useState([]),[ve,Le]=g.useState(!1),[Te,Z]=g.useState(null),[ue,Pe]=g.useState(null),[Me,ke]=g.useState(null),[D,le]=g.useState(!1),ce=g.useRef(null),J=g.useRef(0),[we,Fe]=g.useState(null),Ve=l!==void 0?l:we,Je=g.useCallback(Y=>{d?d(Y):Fe(Y)},[d]),O=g.useCallback(async Y=>{if(!A.getCollectionCatalogs&&!A.getCollectionCatalog){$e([]);return}Le(!0);try{if(A.getCollectionCatalogs)$e(await A.getCollectionCatalogs(Y)||[]);else if(A.getCollectionCatalog){const H=await A.getCollectionCatalog(Y);$e(H?[{resource_id:"",data:H}]:[])}}catch{$e([])}finally{Le(!1)}},[A]),de=g.useCallback(async Y=>{var H,ge;if(!A.getTextManifest||!A.getTextIndex){Z(null),Pe(Y);return}try{const Ce=ze.pickTextVersion(await A.getTextManifest(Y)),be=Ce?await A.getTextIndex(Y,Ce.key):null;Z(be&&be.chapters.length>0?{chapters:be.chapters.map(Q=>({n:Q.n,title:Q.title,file:Q.file})),source:{name:((H=be.source)==null?void 0:H.name)??(Ce==null?void 0:Ce.source_name),license:((ge=be.source)==null?void 0:ge.license)??(Ce==null?void 0:Ce.license)??void 0}}:null)}catch{Z(null)}finally{Pe(Y)}},[A]),Ie=g.useCallback(async(Y,H)=>{const ge=++J.current,Ce=()=>ge!==J.current;le(!0);try{if(A.getLineageGraph){const De=await A.getLineageGraph(Y);if(Ce())return;De&&ke(De)}const be=H.version_graph;if(!be||!be.enabled){Me||ke(null),ce.current=null;return}const Q=_o(H),fe=(await qi(Q,Yi,async De=>{try{return await A.getItem(De)}catch{return null}},Ce)).filter(Boolean);if(Ce())return;ce.current={work:H,books:fe};const Oe=h??be.default_collection??(be.core_books&&be.core_books.length>0?"core":"all"),Se=Oe==="core"&&Array.isArray(be.core_books)&&be.core_books.length>0?"core":Oe??"all";ke(Si(H,fe,Se))}catch{if(Ce())return;ke(null),ce.current=null}finally{Ce()||le(!1)}},[A]),B=g.useRef({initialDetail:i,initialEntry:o});B.current={initialDetail:i,initialEntry:o},g.useEffect(()=>{let Y=!1;J.current++,le(!1);const H=Q=>{Q.type==="collection"?O(e):Q.type==="work"?(Q.version_graph||A.getLineageGraph)&&Ie(e,Q):Q.type==="book"&&Lr(Q)&&de(e)},ge=B.current;let Ce=null;if(me&&me.id===e)Ce=me;else if(ge.initialDetail&&ge.initialDetail.id===e){const Q={...ge.initialDetail},Ee=ge.initialEntry??Ar(e,Q);w&&w(Ee,Q),Ce={entry:Ee,detail:Q}}return Ce?(R(!1),$e(Q=>Q.length?[]:Q),Z(null),ke(null),ce.current=null,ye(Ce.entry),U(Ce.detail),q(!1),H(Ce.detail),()=>{Y=!0}):((async()=>{q(!0),R(!1),ye(null),U(null),$e([]),Z(null),ke(null),ce.current=null;try{const Q=await A.getItem(e);if(Y)return;if(!Q){R(!0);return}const Ee=Q;let fe=null;if(A.getEntry&&(fe=await A.getEntry(e),Y))return;fe||(fe=Ar(e,Ee)),w&&w(fe,Ee),ye(fe),U(Ee),H(Ee)}catch{Y||R(!0)}finally{Y||q(!1)}})(),()=>{Y=!0})},[e,A,me,w,O,Ie,de]),g.useEffect(()=>{const Y=ce.current;!Y||!h||ke(Si(Y.work,Y.books,h))},[h]);const pe=[];if(ne){if(pe.push({key:"basic",label:V.detailTab.basicInfo}),ne.type==="collection"){ve&&oe.length===0&&pe.push({key:"catalog:loading",label:`${V.detailTab.catalog}…`});for(const Y of oe)pe.push({key:`catalog:${Y.resource_id}`,label:Y.short_name?`${xe(Y.short_name)}${V.detailTab.catalogSuffix}`:V.detailTab.collectionCatalog})}(s==="collated"||s==="fulltext")&&pe.push({key:s,label:V.detailTab.fullText}),ne.type==="work"&&(Me||D)&&pe.push({key:"lineage",label:D?`${V.detailTab.lineage}…`:V.detailTab.lineage});for(const Y of C)(Y.position??"before-feedback")==="before-feedback"&&Y.shouldShow(ne)&&pe.push({key:Y.key,label:Y.label});_&&s==="feedback"&&pe.push({key:"feedback",label:V.detailTab.feedback});for(const Y of C)Y.position==="after-feedback"&&Y.shouldShow(ne)&&pe.push({key:Y.key,label:Y.label})}g.useEffect(()=>{if(s!=="emendated"||!ne)return;a("basic");const Y=setTimeout(()=>{var H;(H=document.getElementById("studies"))==null||H.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(Y)},[s,ne,a]);const ie=G&&ne&&v?v({activeTab:s,activeJuan:Ve,entry:G,detail:ne}):null,_e=g.useMemo(()=>{var be,Q,Ee,fe,Oe;if(!ne)return null;const H=(ne.authors??[]).map(Se=>{const De=So(Se.role);return`${Se.dynasty?`〔${xe(Se.dynasty)}〕`:""}${xe(Se.name)}${De?` ${xe(De)}`:""}`}).join(" · ");let ge=!1;try{ge=ze.extractStatus(ne.id)==="draft"}catch{}if(ne.type==="book"){const Se=ne;return{title:xe(Se.title),subtitle:Se.edition?xe(Se.edition):H||void 0,aside:[ge?V.status.draft:"",H&&Se.edition?H:""].filter(Boolean).join(" · ")||void 0,secondLine:void 0}}if(ne.type==="collection"){const Se=ne;return{title:xe(Se.title),subtitle:xe(Gt(Se,V.unit.juan))||void 0,aside:[(be=Se.publication_info)==null?void 0:be.year,ge?V.status.draft:""].filter(Boolean).join(" · ")||void 0,secondLine:H||void 0}}if(ne.type==="entity"){const Se=ne,De=lt=>lt==null?"":lt<0?ae("detail.bce",{n:-lt}):String(lt),pt=((Q=Se.dates)==null?void 0:Q.birth)!=null||((Ee=Se.dates)==null?void 0:Ee.death)!=null?`${De(((fe=Se.dates)==null?void 0:fe.birth)??void 0)||"?"}—${De(((Oe=Se.dates)==null?void 0:Oe.death)??void 0)||"?"}`:"";return{title:xe(Se.primary_name||Se.title),subtitle:[Se.dynasty?`〔${xe(Se.dynasty)}〕`:"",pt].filter(Boolean).join(" ")||void 0,aside:ge?V.status.draft:void 0,secondLine:void 0}}const Ce=xe(Gt(ne,V.unit.juan));return{title:xe(ne.title),subtitle:[Ce,H].filter(Boolean).join(" · ")||void 0,aside:[i1(V,ne.subtype),ge?V.status.draft:""].filter(Boolean).join(" · ")||void 0,secondLine:void 0}},[ne,xe,V,ae]),Re=ne&&Lr(ne)?"text":null,He=()=>{Je(null),a("fulltext")};let Ye=null;if(ne&&k){const Y=k({detail:ne,kind:Re});Y&&(Ye=t.jsx(Gr,{href:Y}))}else Re&&(Ye=t.jsx(Gr,{onClick:He}));const tt=Y=>{if(!ne)return null;const H=Y.replace(/\.[^.]+$/,"");if(k){const ge=k({detail:ne,kind:Re,juan:H});return ge?{href:ge}:null}return{onClick:()=>{Je(H),a("fulltext")}}},et=new Set(C.map(Y=>Y.key)),$=pe.filter(Y=>Y.key.startsWith("catalog:")&&Y.key!=="catalog:loading"||Y.key==="lineage"&&!!Me&&!D||et.has(Y.key)).map(Y=>({key:Y.key,label:Y.label,onClick:()=>a(Y.key)})),M=()=>{var Y;return ne?ne.type==="work"?t.jsx(Xd,{data:ne,transport:A,onNavigate:x,renderLink:S,readAction:Ye,railTop:z,railLinks:$}):ne.type==="book"?t.jsx(ep,{data:ne,transport:A,onNavigate:x,renderLink:S,readAction:Ye,fullText:Te,fullTextPending:Lr(ne)&&!!A.getTextManifest&&ue!==ne.id,chapterLink:tt,railTop:z,railLinks:$}):ne.type==="collection"?t.jsx(tp,{data:ne,catalog:(Y=oe[0])==null?void 0:Y.data,transport:A,onNavigate:x,renderLink:S,readAction:Ye,railTop:z,railLinks:$,catalogAction:oe.length>0?t.jsxs("a",{href:"#catalog",onClick:H=>{H.preventDefault(),a(`catalog:${oe[0].resource_id}`)},children:[xe(V.detailTab.collectionCatalog)," →"]}):null}):t.jsx(ip,{data:ne,transport:A,onNavigate:x,renderLink:S,railTop:z,railLinks:$,assetBase:b}):null},P=()=>{var H,ge,Ce;if(!G||!ne)return null;if(s==="basic"||s==="emendated")return M();if(typeof s=="string"&&s.startsWith("catalog:")){const be=(H=oe.find(Q=>`catalog:${Q.resource_id}`===s))==null?void 0:H.data;return t.jsx(Io,{data:be,onNavigate:x,renderLink:S})}if(s==="collated"||s==="fulltext")return t.jsx(os,{id:e,transport:A,chapter:Ve,onLocationChange:be=>Je(be.chapter),onNavigate:x});if(s==="lineage"){if(!Me)return t.jsx("div",{style:{color:r("label-fg"),padding:"24px 0"},children:ae(D?"detail.loading":"detail.noLineageGraph")});const be=ne.type==="work"?ne:null;return t.jsx(ds,{graph:Me,renderLink:S,graphHeight:Math.max(500,(typeof window<"u"?window.innerHeight:800)-250),defaultMode:c,onModeChange:p,selectedNodeId:f,collection:h??((ge=be==null?void 0:be.version_graph)==null?void 0:ge.default_collection),onCollectionChange:m,collectionsAvailable:(Ce=be==null?void 0:be.version_graph)==null?void 0:Ce.collections,collectionCounts:(()=>{var Oe,Se,De,pt,lt,Ke,Ze;if(!be)return;const Q={},Ee=((Oe=ce.current)==null?void 0:Oe.books)??[];Q.all=(((Se=be._books)==null?void 0:Se.length)??0)-(((pt=(De=be.version_graph)==null?void 0:De.excluded_books)==null?void 0:pt.length)??0);const fe=(lt=be.version_graph)==null?void 0:lt.collections;if(fe)for(const yt of Object.keys(fe))Q[yt]=Si(be,Ee,yt).nodes.filter(K=>K.kind==="book"&&!K.bridge).length;return Q.core==null&&((Ze=(Ke=be.version_graph)==null?void 0:Ke.core_books)!=null&&Ze.length)&&(Q.core=be.version_graph.core_books.length),Q})()})}if(s==="feedback"&&_)return t.jsx(Gd,{resourceId:e,apiUrl:I});const Y=C.find(be=>be.key===s);return Y?Y.render({detail:ne,entry:G,transport:A,onNavigate:x}):null};if(ee)return t.jsx(Hn,{style:{minHeight:T,...F},children:t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingTop:48},children:[180,320,160].map((Y,H)=>t.jsx("div",{style:{height:H===1?40:16,width:Y,opacity:.35,background:r("rule")}},H))})});if(je||!ne||!G||!_e)return t.jsx(Hn,{style:{minHeight:T,...F},children:t.jsx("div",{style:{padding:"64px 0",textAlign:"center",color:r("label-fg"),fontSize:14},children:ae("detail.notFound")})});const X=s==="basic"||s==="emendated",he=[{label:y??V.detailTab.backToIndex,onClick:j}];if(ne.type==="book"&&ne.work_id){const Y=ne.work_id;he.push({label:V.indexType.work,id:Y,onClick:()=>x==null?void 0:x(Y)})}he.push({label:V.indexType[ne.type]});const se=s==="collated"||s==="fulltext",We=typeof N=="string"?V.status[N.trim()]??N:N,Be=t.jsx(Xc,{left:t.jsxs(t.Fragment,{children:[We,We?" · ":"",t.jsx(n1,{id:ne.id,label:V.label.id,copied:V.action.copied,copyLabel:V.action.copy})]}),right:t.jsxs(t.Fragment,{children:[_&&!X&&t.jsx("button",{type:"button",onClick:()=>a("feedback"),style:{background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"inherit",fontSize:12,color:r("meta-fg")},children:V.detailTab.submitVersion}),ie&&t.jsx("a",{href:ie.href,target:"_blank",rel:"noopener noreferrer",className:"bim-d-hit",style:{color:r("meta-fg")},children:V.detailTab.dataLicense})]})});return X?t.jsx("div",{className:W,children:t.jsxs(Hn,{grid:!0,style:{minHeight:T,...F},children:[t.jsx(Yr,{breadcrumb:t.jsx(qr,{items:he}),actions:t.jsxs(t.Fragment,{children:[!E&&t.jsx(po,{style:{border:"none",background:"transparent"}}),!E&&ie&&t.jsx(uo,{...ie})]})}),M(),Be]})}):t.jsx("div",{className:W,children:t.jsxs(Hn,{wide:se,style:{minHeight:T,...F},children:[t.jsx(Yr,{breadcrumb:t.jsxs(t.Fragment,{children:[t.jsx(Po,{char:"籍"}),t.jsx(qr,{items:he})]}),actions:t.jsxs(t.Fragment,{children:[!E&&t.jsx(po,{}),_&&t.jsx("button",{type:"button",onClick:()=>a("feedback"),className:"bim-d-ui",style:{background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"inherit",fontSize:12,color:r("meta-fg")},children:V.detailTab.feedback}),!E&&ie&&t.jsx(uo,{...ie})]})}),t.jsx(Fc,{..._e,aside:se?t.jsxs("button",{type:"button",onClick:()=>a("basic"),className:"bim-d-ui",style:{background:"none",border:"none",padding:"2px 0",cursor:"pointer",fontFamily:"inherit",fontSize:12,color:r("accent"),borderBottom:`1px solid ${r("rule")}`},children:[ae("detail.workInfo")," →"]}):_e.aside}),!se&&pe.length>1&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,margin:"14px 0 0",paddingBottom:2},children:pe.map(Y=>t.jsx(Hc,{label:Y.label,active:Y.key===s||X&&Y.key==="basic",onClick:()=>a(Y.key)},Y.key))}),t.jsx("div",{style:{marginTop:!se&&pe.length>1?8:0},children:P()}),Be]})})};function n1({id:e,label:n,copied:i,copyLabel:o}){const[s,a]=g.useState(!1);return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[t.jsxs("span",{children:[n," ",e]}),t.jsx("button",{type:"button",onClick:()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)}).catch(()=>{})},title:s?i:o,"aria-label":s?i:o,className:"bim-d-hit",style:{background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"inherit",fontSize:14,minWidth:32,minHeight:32,display:"inline-flex",alignItems:"center",justifyContent:"center",color:r("aux-fg")},children:s?"✓":"⧉"})]})}function i1(e,n){return n?e.workSubtype[n]??n:""}const qp=[{name:"zhusha",label:"朱砂"},{name:"indigo",label:"靛青"},{name:"ink",label:"墨"}],Zi="zhusha",Ji="bim-theme";function Kp(e){return e==="zhusha"||e==="indigo"||e==="ink"}function Qi(e){return Kp(e)?e:Zi}function r1(){try{return Qi(window.localStorage.getItem(Ji))}catch{return Zi}}function Xp(e){try{window.localStorage.setItem(Ji,e)}catch{}}function Zp(e){const n=Qi(e);return document.documentElement.setAttribute("data-theme",n),n}function Jp(){return Qi(document.documentElement.getAttribute("data-theme"))}const o1=[{name:"airy",label:"疏朗",hint:"留白分区"},{name:"boxed",label:"界欄",hint:"框線分區"}],ys="airy",er="bim-layout";function Qp(e){return e==="airy"||e==="boxed"}function tr(e){return Qp(e)?e:ys}function s1(){try{return tr(window.localStorage.getItem(er))}catch{return ys}}function a1(e){try{window.localStorage.setItem(er,e)}catch{}}function l1(e){const n=tr(e);return document.documentElement.setAttribute("data-layout",n),n}function c1(){return tr(document.documentElement.getAttribute("data-layout"))}const d1=`try{var t=localStorage.getItem(${JSON.stringify(Ji)});if(t==='indigo'||t==='ink')document.documentElement.setAttribute('data-theme',t);if(localStorage.getItem(${JSON.stringify(er)})==='boxed')document.documentElement.setAttribute('data-layout','boxed')}catch(e){}`,p1={zhusha:"theme-dot-zhusha",indigo:"theme-dot-indigo",ink:"theme-dot-ink"},u1=({onChange:e,style:n})=>{const{t:i}=re(),[o,s]=g.useState(Zi);g.useEffect(()=>{s(Jp())},[]);const a=l=>{s(Zp(l)),Xp(l),e==null||e(l)};return t.jsx("div",{role:"radiogroup","aria-label":i("common.themeLabel"),style:{display:"inline-flex",alignItems:"center",...n},children:qp.map(l=>{const d=o===l.name;return t.jsx("button",{type:"button",role:"radio","aria-checked":d,"aria-label":i(`common.theme.${l.name}`),title:i(`common.theme.${l.name}`),onClick:()=>a(l.name),style:{width:28,height:44,padding:0,border:0,background:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:t.jsx("span",{"aria-hidden":"true",style:{width:14,height:14,borderRadius:"50%",boxSizing:"border-box",background:r(p1[l.name]),boxShadow:d?`0 0 0 2px ${r("page-bg")}, 0 0 0 3.5px ${r("aux-fg")}`:"none"}})},l.name)})})};exports.BidLink=ze.BidLink;exports.BookIndexError=ze.BookIndexError;exports.BookIndexManager=ze.BookIndexManager;exports.BookIndexStorage=ze.BookIndexStorage;exports.BundleStorage=ze.BundleStorage;exports.ConfigError=ze.ConfigError;exports.GithubStorage=ze.GithubStorage;exports.IdGenerationError=ze.IdGenerationError;exports.IdGenerator=ze.IdGenerator;exports.LocalStorage=ze.LocalStorage;exports.MigrationError=ze.MigrationError;exports.StorageError=ze.StorageError;exports.VARIANT_CHARS=ze.VARIANT_CHARS;exports.base36Decode=ze.base36Decode;exports.base36Encode=ze.base36Encode;exports.base58Decode=ze.base58Decode;exports.buildId=ze.buildId;exports.buildPromotionMap=ze.buildPromotionMap;exports.cleanName=ze.cleanName;exports.decodeId=ze.decodeId;exports.decodeIdString=ze.decodeIdString;exports.encodeId=ze.encodeId;exports.extractIdFromUrl=ze.extractIdFromUrl;exports.extractStatus=ze.extractStatus;exports.extractType=ze.extractType;exports.isChapterSegment=ze.isChapterSegment;exports.isTextKey=ze.isTextKey;exports.matchChapterAcrossVersions=ze.matchChapterAcrossVersions;exports.normalizeCatalog=ze.normalizeCatalog;exports.normalizeVariants=ze.normalizeVariants;exports.parseId=ze.parseId;exports.pickTextVersion=ze.pickTextVersion;exports.shardOf=ze.shardOf;exports.smartDecode=ze.smartDecode;exports.textVersionLabel=ze.textVersionLabel;exports.validateResource=ze.validateResource;exports.VARIANT_SUPPLEMENT=Cl.VARIANT_SUPPLEMENT;exports.Badge=Ti;exports.BidUrlProvider=Cu;exports.BookDetailLayout=t1;exports.BookPage=ep;exports.Breadcrumb=qr;exports.CATALOG_ALL_ID=Dt;exports.CATALOG_CSS=rp;exports.CATALOG_NARROW_QUERY=ps;exports.CATALOG_PAGE_SIZE=us;exports.CATALOG_UNCLASSIFIED_ID=cn;exports.CLASSIFICATIONS=Fi;exports.COMMON_TRADITIONAL_CHARS=Bl;exports.CardFoot=Qn;exports.CatalogPage=A0;exports.CatalogPager=pp;exports.CatalogTree=sp;exports.CheckFilter=Bc;exports.Chip=Dc;exports.ChipWall=Tg;exports.CollectionCatalog=Io;exports.CollectionPage=tp;exports.CreateEntityDialog=Bd;exports.DEFAULT_LAYOUT=ys;exports.DEFAULT_META_HOME_LINKS=Np;exports.DEFAULT_READER_PREFS=Eo;exports.DEFAULT_READ_HOME_LINKS=mp;exports.DEFAULT_THEME=Zi;exports.DETAIL_CSS=Wc;exports.DYNASTY_GROUPS=Wi;exports.Dash=Mg;exports.DataTable=Rg;exports.DetailFooter=Xc;exports.DetailGrid=Zn;exports.DetailHeader=Fc;exports.EMPTY_FILTERS=Oi;exports.ENTITY_TEXT_CSS=Qo;exports.EmendatedBySection=gc;exports.EmptyNote=Dg;exports.EntityDetail=dc;exports.EntityMark=ts;exports.EntityPage=ip;exports.EntityPickerDialog=Wd;exports.EntitySelector=Pd;exports.EntityText=mx;exports.ExpandRow=Pg;exports.ExtLink=Ug;exports.FEEDBACK_FAB_OFFSET_VAR=oo;exports.FILTER_SUPPORT=tc;exports.FONT_SIZE_STEPS=Ht;exports.FactList=$g;exports.FeedbackButton=xy;exports.FeedbackDialog=Ud;exports.FeedbackForm=Vd;exports.FeedbackList=ss;exports.FeedbackTab=Gd;exports.FilterChip=Hc;exports.FormInput=kt;exports.FormTextArea=pn;exports.GUJI_MARKDOWN_FIELD=pg;exports.GUJI_TABLE_NOTATION=Zc;exports.GlyphBadge=Po;exports.GujiInteractiveReader=db;exports.GujiTable=Wo;exports.GujiTextViewer=ns;exports.GujiWarpCanvas=Jo;exports.HomePage=io;exports.ImagePanel=Hr;exports.IndexApp=cb;exports.IndexBrowser=Wr;exports.IndexDetail=To;exports.IndexEditor=Fd;exports.IndexView=iy;exports.IntroGrid=_g;exports.LAYOUTS=o1;exports.LAYOUT_STORAGE_KEY=er;exports.LOSS_OPTIONS=ec;exports.LocaleContext=Mt;exports.LocaleProvider=tm;exports.LocaleToggle=po;exports.META_HOME_CSS=zp;exports.META_HOME_SECTION_IDS=Gp;exports.MetaCatalogTable=Pp;exports.MetaCollectionGroups=Fp;exports.MetaDataLicense=Vp;exports.MetaHomeView=K0;exports.MetaLine=dt;exports.MetaLineageCards=Dp;exports.MetaOnlineSites=Up;exports.MetaPeopleTimeline=Hp;exports.MetaRecentPanel=Ap;exports.MetaRelatedCatalogs=Op;exports.MetaTypeChips=Rp;exports.ModeIndicator=Wl;exports.MoreButton=Ng;exports.MoreLink=Ao;exports.PAGE_MAX_WIDTH=vi;exports.PERIOD_NARROW_SHARE=xp;exports.PageFrame=Hn;exports.Quote=Og;exports.READER_CSS=vc;exports.READ_HOME_CSS=hs;exports.READ_HOME_NARROW_QUERY=ni;exports.READ_HOME_SECTION_IDS=Cp;exports.READ_PERIOD_LABELS=O0;exports.RECENT_IDS_STORAGE_KEY=Sn;exports.ROLE_CLASS_ORDER=ql;exports.ReadButton=Gr;exports.ReadFamousWorks=Sp;exports.ReadHomeView=F0;exports.ReadPeriodBand=_p;exports.ReadPicks=jp;exports.ReadPieces=$p;exports.ReadSection=xt;exports.ReadShelf=fs;exports.ReadSibu=xs;exports.ReadStats=yp;exports.ReadTopicGroup=kp;exports.ReadTopics=wp;exports.ReaderMdText=Uo;exports.ReaderShell=Nc;exports.ReaderToc=kc;exports.RelationPanel=Ad;exports.RepoSourceLink=uo;exports.ResourceEditor=Mr;exports.ResourceGroup=Wg;exports.ResourceLine=Fg;exports.ResourceList=yo;exports.ResourceRow=qc;exports.SEARCH_VIEW_STORAGE_KEY=Co;exports.SEVEN_PAVILIONS_KEY=Wp;exports.SNIPPET_MARK_END=Tl;exports.SNIPPET_MARK_START=Nl;exports.SORTABLE_TYPES=Ql;exports.SearchInput=Hl;exports.SearchResults=ac;exports.Sec=ut;exports.Section=Tt;exports.SectionHead=Cg;exports.SideList=dn;exports.SmartBidInput=wi;exports.SourceEditor=Rd;exports.StripWarpRenderer=Zr;exports.SummaryCard=Jn;exports.THEMES=qp;exports.THEME_INIT_SCRIPT=d1;exports.THEME_STORAGE_KEY=Ji;exports.TRADITIONAL_ALLOWLIST=Ol;exports.TabFilter=Di;exports.TableHead=Eg;exports.TableRow=Lg;exports.TagRow=Kc;exports.TagRows=Hg;exports.TextButton=zg;exports.TextReader=os;exports.ThemeToggle=u1;exports.TopStrip=Yr;exports.VersionLineageGraph=Qd;exports.VersionLineageList=Jd;exports.VersionLineageView=ds;exports.VolumeChips=Ig;exports.VolumeLinks=Bo;exports.WorkCard=cp;exports.WorkCardGrid=up;exports.WorkCatalog=kb;exports.WorkPage=Xd;exports.WorkRow=dp;exports.adaptCharCord=vb;exports.adaptEntityJson=cd;exports.adaptNorm=Id;exports.adaptNormDetailed=Td;exports.adaptPunctJson=hb;exports.applyLayout=l1;exports.applyTheme=Zp;exports.authorsLine=Xi;exports.bookIndexUriToId=Xr;exports.bookMarkingOf=Do;exports.bucketResources=ko;exports.buildCatalogTree=$0;exports.buildCollectionTable=Zl;exports.buildLineageGraph=Si;exports.buildMeiliFilter=Wm;exports.buildPageUrl=xo;exports.buildParagraphBlocks=rd;exports.buildVersionRow=Gl;exports.buildVersionTable=Yl;exports.canParagraphize=zi;exports.catalogNodeIdOf=S0;exports.catalogNodeIdsOf=_0;exports.catalogPageCount=T0;exports.catalogTotal=ms;exports.classificationPath=ti;exports.clearAllRecentIds=zo;exports.compareCatalogCards=N0;exports.computeVersionPartition=Im;exports.countActiveFilters=Hi;exports.createTextApi=xc;exports.currentLayout=c1;exports.currentTheme=Jp;exports.defaultEntityHref=bd;exports.defaultWorkLink=ap;exports.deriveDating=Sm;exports.deriveEditionType=Jl;exports.deriveEra=Xn;exports.deriveYear=Mi;exports.deriveYearRange=vo;exports.detailToEditor=Dd;exports.detectGenre=Vi;exports.displayAuthorRole=So;exports.editorToDetail=ny;exports.eraRank=Br;exports.filtersFromParams=Fm;exports.filtersToParams=Ci;exports.findCatalogPath=vn;exports.findTraditionalChars=rm;exports.firstAuthorText=gs;exports.flattenTitles=Kr;exports.flattenToc=zc;exports.fmtCount=it;exports.formatHitCount=bi;exports.formatTemplate=wt;exports.formatVolumeRange=Bi;exports.getDisplayNameFromUrl=$n;exports.getMessages=zn;exports.getStartPage=fo;exports.getT=Nn;exports.getTypeGroupKey=ho;exports.groupRelatedWorks=_m;exports.gujiInlineToPlain=Mc;exports.hasActiveFilters=nc;exports.hasGujiMarkdownV02=ug;exports.hasGujiTableNotation=Vg;exports.hasSearchOptions=Pm;exports.headingKey=rs;exports.headingsFromPunct=kd;exports.iiifVolumeOf=gb;exports.isCountedChar=Vo;exports.isDuiduChapter=no;exports.isLayoutName=Qp;exports.isThemeName=Kp;exports.lineageHref=Tp;exports.loadRecentIds=Qt;exports.measureText=Gt;exports.mergeVolumeResources=go;exports.nestHeadings=Sd;exports.normalizeEra=ct;exports.normalizeLayout=tr;exports.normalizeRole=wo;exports.normalizeTheme=Qi;exports.normalizeVolumeIndex=Un;exports.normalizeVolumes=El;exports.numberToChinese=In;exports.paginationItems=op;exports.parseChineseNumber=_i;exports.parseGujiInline=Ac;exports.parseGujiTable=Qc;exports.parseHeadingKey=wd;exports.parseSourceString=Ed;exports.pct=bs;exports.periodLevel=fp;exports.pickReaderVersion=Cc;exports.readStoredLayout=s1;exports.readStoredTheme=r1;exports.readerVersionOptionLabel=Ur;exports.remapPlainOffsets=dd;exports.removeRecentId=lc;exports.renderFullTextBody=tf;exports.renderProperNames=ad;exports.renderReaderInline=Gi;exports.resolveRecentEntry=No;exports.resourceHref=Cn;exports.resourceNote=Pi;exports.resultTabFromParam=Zm;exports.resultTabToParam=Jm;exports.roleFacets=Kl;exports.rowNo=Ag;exports.sameFilters=Hm;exports.sanitizeHeadings=to;exports.saveRecentId=Or;exports.segmentEntities=pd;exports.shelfColumns=hp;exports.sortFor=Bm;exports.sortYear=$i;exports.spineHeight=gp;exports.splitFullTextTables=Oo;exports.splitHighlightSnippet=mo;exports.splitTableRow=Jc;exports.storeLayout=a1;exports.storeTheme=Xp;exports.stringifySources=Ld;exports.summaryFromEntry=fd;exports.summaryFromItem=gd;exports.timelineLayout=Ip;exports.toCatalogWorkCard=z0;exports.transportSummaryLoader=xd;exports.typeSupportsFilters=ic;exports.useBidUrl=at;exports.useChapterWarpData=vd;exports.useConvert=Ue;exports.useEntitySummaryLoader=es;exports.useI18n=re;exports.useReaderPrefs=$c;exports.useRecentEntries=Ep;exports.useT=Ae;exports.validateLineageGraph=Hy;exports.volumeStats=Ri;exports.withDefaultLinks=en;exports.withMetaLinks=tn;exports.yearText=Ii;
package/dist/index.d.ts CHANGED
@@ -4031,7 +4031,7 @@ export declare function MetaCollectionGroups({ groups, links }: {
4031
4031
  links?: Partial<MetaHomeLinks>;
4032
4032
  }): JSX.Element | null;
4033
4033
 
4034
- /** 数据与授权:数据规模 8 项、按存佚检索 4 个入口、CC0 授权与数据版本 */
4034
+ /** 数据与授权:数据规模 8 项、按存佚检索 4 个入口、CC BY-SA 4.0 授权与数据版本 */
4035
4035
  export declare function MetaDataLicense({ stats, links, version, repoUrl, downloadHref }: {
4036
4036
  stats: MetaHomeSections['stats'];
4037
4037
  links?: Partial<MetaHomeLinks>;
package/dist/index.js CHANGED
@@ -2132,9 +2132,9 @@ const Ud = St({
2132
2132
  },
2133
2133
  dataScale: "數據規模",
2134
2134
  byLoss: "按存佚檢索",
2135
- license: "古籍元數據以 CC0 公有領域發布,可自由複製、改編、再發布。",
2135
+ license: "古籍元數據以 CC BY-SA 4.0 發布,可自由複製、改編、再發布,但須註明出處,並以相同方式共享。",
2136
2136
  repo: "數據倉庫:",
2137
- repoNote: "(GitHub,CC0)",
2137
+ repoNote: "(GitHub,CC BY-SA 4.0)",
2138
2138
  version: "當前數據版本:",
2139
2139
  download: "引用方式與數據下載 →",
2140
2140
  navLabel: "元數據首頁分區",
@@ -2230,9 +2230,9 @@ const Ud = St({
2230
2230
  },
2231
2231
  dataScale: "数据规模",
2232
2232
  byLoss: "按存佚检索",
2233
- license: "古籍元数据以 CC0 公有领域发布,可自由复制、改编、再发布。",
2233
+ license: "古籍元数据以 CC BY-SA 4.0 发布,可自由复制、改编、再发布,但须注明出处,并以相同方式共享。",
2234
2234
  repo: "数据仓库:",
2235
- repoNote: "(GitHub,CC0)",
2235
+ repoNote: "(GitHub,CC BY-SA 4.0)",
2236
2236
  version: "当前数据版本:",
2237
2237
  download: "引用方式与数据下载 →",
2238
2238
  navLabel: "元数据首页分区",
@@ -22497,7 +22497,7 @@ function Qy({ stats: e, links: t, version: i, repoUrl: o, downloadHref: l }) {
22497
22497
  ] }),
22498
22498
  /* @__PURE__ */ p("div", { className: "bim-mh-lic", children: [
22499
22499
  /* @__PURE__ */ p("p", { children: [
22500
- /* @__PURE__ */ n("span", { className: "bim-mh-cc0", children: "CC0" }),
22500
+ /* @__PURE__ */ n("span", { className: "bim-mh-cc0", children: "CC BY-SA 4.0" }),
22501
22501
  a("metaHome.license")
22502
22502
  ] }),
22503
22503
  /* @__PURE__ */ p("p", { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "book-index-ui",
3
- "version": "0.62.1",
3
+ "version": "0.62.2",
4
4
  "description": "React components for browsing and editing ancient book index metadata",
5
5
  "author": "Li Shaodong",
6
6
  "repository": {