BibexPy 2.0.0__py3-none-any.whl
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.
- bibex_core/MergeDB.py +1189 -0
- bibex_core/__init__.py +13 -0
- bibex_core/modules/__init__.py +35 -0
- bibex_core/modules/api_utils.py +1172 -0
- bibex_core/modules/c1_utils.py +423 -0
- bibex_core/modules/file_utils.py +71 -0
- bibex_core/modules/ml_utils.py +332 -0
- bibex_core/modules/post_process.py +50 -0
- bibex_core/modules/stats_utils.py +216 -0
- bibex_core/scp2xlsx.py +235 -0
- bibex_core/wos2xlsx.py +159 -0
- bibex_core/xlsx2vos.py +185 -0
- bibexpy/__init__.py +9 -0
- bibexpy/__main__.py +6 -0
- bibexpy/_server/__init__.py +1 -0
- bibexpy/_server/config.py +92 -0
- bibexpy/_server/jobs/__init__.py +3 -0
- bibexpy/_server/jobs/runner.py +301 -0
- bibexpy/_server/main.py +211 -0
- bibexpy/_server/models/__init__.py +0 -0
- bibexpy/_server/models/project.py +25 -0
- bibexpy/_server/routers/__init__.py +0 -0
- bibexpy/_server/routers/audit.py +65 -0
- bibexpy/_server/routers/convert.py +101 -0
- bibexpy/_server/routers/disambiguate.py +177 -0
- bibexpy/_server/routers/downloads.py +26 -0
- bibexpy/_server/routers/enrich.py +42 -0
- bibexpy/_server/routers/export.py +116 -0
- bibexpy/_server/routers/export_folder.py +97 -0
- bibexpy/_server/routers/filter.py +131 -0
- bibexpy/_server/routers/jobs.py +72 -0
- bibexpy/_server/routers/merge.py +437 -0
- bibexpy/_server/routers/prepare.py +241 -0
- bibexpy/_server/routers/projects.py +49 -0
- bibexpy/_server/routers/quality.py +288 -0
- bibexpy/_server/routers/records.py +204 -0
- bibexpy/_server/routers/report.py +111 -0
- bibexpy/_server/routers/settings.py +383 -0
- bibexpy/_server/routers/system.py +209 -0
- bibexpy/_server/routers/tools.py +257 -0
- bibexpy/_server/routers/upload.py +110 -0
- bibexpy/_server/services/__init__.py +0 -0
- bibexpy/_server/services/analyses.py +364 -0
- bibexpy/_server/services/audit.py +340 -0
- bibexpy/_server/services/bibex_adapter.py +47 -0
- bibexpy/_server/services/bibtex_writer.py +104 -0
- bibexpy/_server/services/converter.py +205 -0
- bibexpy/_server/services/disambiguation/__init__.py +19 -0
- bibexpy/_server/services/disambiguation/blocking.py +581 -0
- bibexpy/_server/services/disambiguation/cache.py +47 -0
- bibexpy/_server/services/disambiguation/deepseek_client.py +203 -0
- bibexpy/_server/services/disambiguation/orcid.py +261 -0
- bibexpy/_server/services/disambiguation/pipeline.py +985 -0
- bibexpy/_server/services/disambiguation/similarity.py +91 -0
- bibexpy/_server/services/enricher.py +338 -0
- bibexpy/_server/services/exporter.py +112 -0
- bibexpy/_server/services/filter_engine.py +300 -0
- bibexpy/_server/services/merger.py +202 -0
- bibexpy/_server/services/methodology.py +102 -0
- bibexpy/_server/services/report_export.py +300 -0
- bibexpy/_server/services/ris_writer.py +62 -0
- bibexpy/_server/services/smart_merger.py +967 -0
- bibexpy/_server/services/storage.py +165 -0
- bibexpy/_web/404/index.html +1 -0
- bibexpy/_web/404.html +1 -0
- bibexpy/_web/_next/static/chunks/117-7ad5186126fa076d.js +2 -0
- bibexpy/_web/_next/static/chunks/156-75beffb8ae92a7f3.js +1 -0
- bibexpy/_web/_next/static/chunks/169-301c04fcec22686f.js +4 -0
- bibexpy/_web/_next/static/chunks/2-ecc1c36a5632ac61.js +1 -0
- bibexpy/_web/_next/static/chunks/244-be343e0f8aa00fb5.js +1 -0
- bibexpy/_web/_next/static/chunks/367-b7457c2b95f6932b.js +1 -0
- bibexpy/_web/_next/static/chunks/382-9cd163eed632e241.js +1 -0
- bibexpy/_web/_next/static/chunks/392-afa8bfa4c1a9893d.js +1 -0
- bibexpy/_web/_next/static/chunks/507-63607ded9f83c1aa.js +1 -0
- bibexpy/_web/_next/static/chunks/624-cae565632f47217d.js +1 -0
- bibexpy/_web/_next/static/chunks/739-a00c6b9c0f11813e.js +1 -0
- bibexpy/_web/_next/static/chunks/862-8e1bd5f93c082c02.js +1 -0
- bibexpy/_web/_next/static/chunks/app/_not-found/page-873ba59b5eb7c342.js +1 -0
- bibexpy/_web/_next/static/chunks/app/layout-0d5fc68ac8971a04.js +1 -0
- bibexpy/_web/_next/static/chunks/app/page-cf2bea5edc74459a.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/convert/page-ab6dd645ae113b64.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/disambiguate/page-dd98482cc47344e9.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/enrich/page-4727e431468514e9.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/export/page-f9005d164bb22cb0.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/layout-07755fda55b3ae1f.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/merge/page-45b95318ea7beccf.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/records/page-bfad80457da9eb0b.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/report/page-f05767e74158e995.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/[id]/upload/page-8df78ca9cdecbcb8.js +1 -0
- bibexpy/_web/_next/static/chunks/app/projects/page-99960711ac6a13e9.js +1 -0
- bibexpy/_web/_next/static/chunks/app/settings/page-002df809d6c5a227.js +1 -0
- bibexpy/_web/_next/static/chunks/app/tools/page-27eee1c6a590859f.js +1 -0
- bibexpy/_web/_next/static/chunks/fd9d1056-f2718be92181f426.js +1 -0
- bibexpy/_web/_next/static/chunks/framework-f66176bb897dc684.js +1 -0
- bibexpy/_web/_next/static/chunks/main-app-d138a6e2f8c847f6.js +1 -0
- bibexpy/_web/_next/static/chunks/main-c4b9ddbf514503ef.js +1 -0
- bibexpy/_web/_next/static/chunks/pages/_app-72b849fbd24ac258.js +1 -0
- bibexpy/_web/_next/static/chunks/pages/_error-7ba65e1336b92748.js +1 -0
- bibexpy/_web/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- bibexpy/_web/_next/static/chunks/webpack-c81f7fd28659d64f.js +1 -0
- bibexpy/_web/_next/static/css/1c4638f3e39cf127.css +3 -0
- bibexpy/_web/_next/static/ypx2IQAkZiSaFiKWnzZGB/_buildManifest.js +1 -0
- bibexpy/_web/_next/static/ypx2IQAkZiSaFiKWnzZGB/_ssgManifest.js +1 -0
- bibexpy/_web/images/PROMPTS.md +83 -0
- bibexpy/_web/images/about-illustration.png +0 -0
- bibexpy/_web/images/authors/alperen-sahin.jpg +0 -0
- bibexpy/_web/images/authors/burak-can-kara.jpg +0 -0
- bibexpy/_web/images/authors/taskin-dirsehan.jpg +0 -0
- bibexpy/_web/images/bibexpy-logo-full.png +0 -0
- bibexpy/_web/images/bibexpy-logo-header.png +0 -0
- bibexpy/_web/images/bibexpy-logo-in.png +0 -0
- bibexpy/_web/images/bibexpy-logo.webp +0 -0
- bibexpy/_web/images/hero-illustration.png +0 -0
- bibexpy/_web/images/loader.gif +0 -0
- bibexpy/_web/images/workflow-diagram.png +0 -0
- bibexpy/_web/index.html +1 -0
- bibexpy/_web/index.txt +11 -0
- bibexpy/_web/projects/_/convert/index.html +1 -0
- bibexpy/_web/projects/_/convert/index.txt +12 -0
- bibexpy/_web/projects/_/disambiguate/index.html +1 -0
- bibexpy/_web/projects/_/disambiguate/index.txt +12 -0
- bibexpy/_web/projects/_/enrich/index.html +1 -0
- bibexpy/_web/projects/_/enrich/index.txt +12 -0
- bibexpy/_web/projects/_/export/index.html +1 -0
- bibexpy/_web/projects/_/export/index.txt +12 -0
- bibexpy/_web/projects/_/merge/index.html +1 -0
- bibexpy/_web/projects/_/merge/index.txt +12 -0
- bibexpy/_web/projects/_/records/index.html +1 -0
- bibexpy/_web/projects/_/records/index.txt +12 -0
- bibexpy/_web/projects/_/report/index.html +1 -0
- bibexpy/_web/projects/_/report/index.txt +12 -0
- bibexpy/_web/projects/_/upload/index.html +1 -0
- bibexpy/_web/projects/_/upload/index.txt +12 -0
- bibexpy/_web/projects/index.html +1 -0
- bibexpy/_web/projects/index.txt +11 -0
- bibexpy/_web/settings/index.html +1 -0
- bibexpy/_web/settings/index.txt +11 -0
- bibexpy/_web/tools/README.md +65 -0
- bibexpy/_web/tools/bibexcel.svg +6 -0
- bibexpy/_web/tools/bibliometrix.png +0 -0
- bibexpy/_web/tools/biblioshiny.svg +12 -0
- bibexpy/_web/tools/citavi.svg +6 -0
- bibexpy/_web/tools/citespace.svg +7 -0
- bibexpy/_web/tools/citnetexplorer.svg +8 -0
- bibexpy/_web/tools/endnote.svg +6 -0
- bibexpy/_web/tools/excel.svg +1 -0
- bibexpy/_web/tools/gephi.svg +66 -0
- bibexpy/_web/tools/histcite.svg +7 -0
- bibexpy/_web/tools/index.html +1 -0
- bibexpy/_web/tools/index.txt +11 -0
- bibexpy/_web/tools/jabref.svg +122 -0
- bibexpy/_web/tools/latex.svg +1 -0
- bibexpy/_web/tools/mendeley.svg +1 -0
- bibexpy/_web/tools/openrefine.svg +15 -0
- bibexpy/_web/tools/overleaf.svg +1 -0
- bibexpy/_web/tools/papers.svg +7 -0
- bibexpy/_web/tools/powerbi.svg +1 -0
- bibexpy/_web/tools/python.svg +1 -0
- bibexpy/_web/tools/r.svg +1 -0
- bibexpy/_web/tools/refworks.svg +5 -0
- bibexpy/_web/tools/scite.svg +5 -0
- bibexpy/_web/tools/tableau.svg +1 -0
- bibexpy/_web/tools/vosviewer.png +0 -0
- bibexpy/_web/tools/zotero.svg +1 -0
- bibexpy/cli.py +242 -0
- bibexpy-2.0.0.dist-info/METADATA +105 -0
- bibexpy-2.0.0.dist-info/RECORD +171 -0
- bibexpy-2.0.0.dist-info/WHEEL +5 -0
- bibexpy-2.0.0.dist-info/entry_points.txt +2 -0
- bibexpy-2.0.0.dist-info/licenses/LICENSE +674 -0
- bibexpy-2.0.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150],{2357:function(e,t,s){Promise.resolve().then(s.bind(s,7365))},7365:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return et}});var a=s(7437),n=s(2265),l=s(7648),r=s(7855),i=s(9835),d=s(4392),c=s(7523),o=s(2669),x=s(4972),m=s(2735),u=s(8124),h=s(1723),g=s(2934),p=s(2489),b=s(4822),f=s(401),j=s(1649),N=s(8736),v=s(6865),w=s(1769),y=s(470),k=s(3953),S=s(2023),C=s(4924),Z=s(9397),_=s(8867),T=s(1817),E=s(8930),L=s(7782),z=s(5499),I=s(3554),D=s(4502);let F={simple:{label:"Simple",icon:k.Z,tone:"text-slate-700",iconBg:"bg-slate-100",ring:"ring-slate-200"},enhanced:{label:"Enhanced",icon:S.Z,tone:"text-brand-700",iconBg:"bg-brand-50",ring:"ring-brand-200"},smart:{label:"Smart",icon:x.Z,tone:"text-brand-700",iconBg:"bg-brand-100",ring:"ring-brand-200"},unknown:{label:"Legacy",icon:C.Z,tone:"text-slate-500",iconBg:"bg-slate-50",ring:"ring-slate-200"}};function B(e){var t,s;let{projectId:l,summary:c,analysis:o,onNewAnalysis:x,onDeleted:m}=e,u=(0,I.NT)(),[h,p]=(0,n.useState)(!1),[b,f]=(0,n.useState)(!1),[j,N]=(0,n.useState)(null),v=null!==(t=o.method)&&void 0!==t?t:"unknown",w=v in F?v:"unknown",y=F[w],k=y.icon,S=c.general;async function C(){f(!0),N(null);try{await r.hi.deleteAnalysis(l,o.id),p(!1),m()}catch(e){N((0,r.NS)(u,e,"analyses.deleteFailed"))}finally{f(!1)}}return(0,a.jsx)(i.Zb,{className:(0,D.cn)("ring-2",y.ring),children:(0,a.jsxs)(i.eW,{className:"p-5",children:[j&&(0,a.jsx)("div",{className:"mb-3 px-3 py-1.5 rounded-md bg-danger-soft border border-danger/30 text-xs text-red-700",children:j}),(0,a.jsxs)("div",{className:"flex items-start gap-4 flex-wrap",children:[(0,a.jsx)("div",{className:(0,D.cn)("w-14 h-14 rounded-xl flex items-center justify-center flex-shrink-0",y.iconBg),children:(0,a.jsx)(k,{className:(0,D.cn)("h-7 w-7",y.tone)})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)("span",{className:"text-xs uppercase tracking-wider font-bold text-brand-700 inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-50 border border-brand-200",children:[(0,a.jsx)(g.Z,{className:"h-3 w-3"})," ",u("analyses.activeBadge")]}),(0,a.jsx)("span",{className:(0,D.cn)("text-xs font-bold uppercase tracking-wider px-1.5 py-0.5 rounded",y.iconBg,y.tone),children:u("analyses.method.".concat(w))})]}),(0,a.jsx)("h2",{className:"text-lg font-bold text-ink mt-1.5 truncate",title:o.label,children:o.label}),(0,a.jsxs)("div",{className:"text-[11px] text-muted mt-0.5 font-mono truncate",title:o.id,children:[o.id," \xb7 ",(s=o.created_at)?new Date(1e3*s).toLocaleString(void 0,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"—"," \xb7 ",o.file_count," ",u("common.files")," \xb7 ",(0,r.td)(o.total_size)]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,a.jsxs)(d.z,{variant:"secondary",onClick:x,className:"flex items-center gap-1.5",children:[(0,a.jsx)(Z.Z,{className:"h-4 w-4"})," ",u("analyses.newAnalysis")]}),(0,a.jsx)(M,{confirmDelete:h,setConfirmDelete:p,deleting:b,onDelete:C,t:u})]})]}),S&&(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mt-4",children:[(0,a.jsx)(W,{label:u("analyses.statRecords"),value:S.total_records.toLocaleString()}),(0,a.jsx)(W,{label:"WoS",value:S.wos_records.toLocaleString()}),(0,a.jsx)(W,{label:"Scopus",value:S.scopus_records.toLocaleString()}),(0,a.jsx)(W,{label:u("analyses.statDedup"),value:"".concat((100*S.dedup_rate).toFixed(1),"%"),sub:"".concat(S.duplicates_removed.toLocaleString()," ").concat(u("analyses.statDuplicates"))})]}),S&&(0,a.jsx)(A,{general:S,createdAt:o.created_at})]})})}function A(e){var t;let{general:s,createdAt:n}=e,l=(0,I.NT)(),r=(0,z.p)(),i=n?new Date(1e3*n).toLocaleDateString(void 0,{day:"2-digit",month:"long",year:"numeric"}):"—",d=null!==(t=s.total_input)&&void 0!==t?t:s.wos_records+s.scopus_records,c=l("merge.narrative.template",{date:i,scopus:s.scopus_records.toLocaleString(),wos:s.wos_records.toLocaleString(),total_input:d.toLocaleString(),duplicates:s.duplicates_removed.toLocaleString(),total:s.total_records.toLocaleString()});async function o(){try{await navigator.clipboard.writeText(c),r(l("merge.narrative.copied"),{tone:"success"})}catch(e){}}return(0,a.jsxs)("div",{className:"mt-4 rounded-lg border border-border bg-bg-soft/40 p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)(N.Z,{className:"h-3.5 w-3.5 text-brand-600 flex-shrink-0"}),(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted flex-1",children:l("merge.narrative.title")}),(0,a.jsxs)("button",{onClick:o,className:"text-xs flex items-center gap-1 text-brand-600 hover:text-brand-700 flex-shrink-0",children:[(0,a.jsx)(_.Z,{className:"h-3.5 w-3.5"})," ",l("merge.narrative.copy")]})]}),(0,a.jsx)("p",{className:"text-xs text-ink leading-relaxed",children:c}),(0,a.jsx)("p",{className:"text-[10px] text-muted mt-1.5",children:l("merge.narrative.hint")})]})}function W(e){let{label:t,value:s,sub:n}=e;return(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-bg-soft px-3 py-2",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted font-semibold",children:t}),(0,a.jsx)("div",{className:"text-lg font-bold text-ink tabular-nums",children:s}),n&&(0,a.jsx)("div",{className:"text-[10px] text-muted tabular-nums",children:n})]})}function M(e){let{confirmDelete:t,setConfirmDelete:s,deleting:n,onDelete:l,t:r}=e;return t?(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsxs)(d.z,{variant:"ghost",className:"h-9 text-xs text-danger hover:bg-danger-soft px-2.5",disabled:n,onClick:l,children:[n?(0,a.jsx)(T.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(E.Z,{className:"h-3.5 w-3.5"}),r("analyses.deleteConfirm")]}),(0,a.jsx)(d.z,{variant:"ghost",className:"h-9 text-xs px-2.5",disabled:n,onClick:()=>s(!1),children:r("common.cancel")})]}):(0,a.jsx)("button",{onClick:()=>s(!0),className:"h-9 w-9 inline-flex items-center justify-center rounded-md text-muted hover:text-danger hover:bg-danger-soft",title:r("common.delete"),children:(0,a.jsx)(L.Z,{className:"h-4 w-4"})})}var O=s(875),U=s(407),H=s(5621);let R={simple:{label:"Simple",icon:k.Z,tone:"text-slate-700",bg:"bg-slate-50"},enhanced:{label:"Enhanced",icon:S.Z,tone:"text-brand-700",bg:"bg-brand-50"},smart:{label:"Smart",icon:x.Z,tone:"text-emerald-700",bg:"bg-emerald-50"},unknown:{label:"Legacy",icon:C.Z,tone:"text-slate-500",bg:"bg-slate-50"}};function J(e){let{projectId:t,items:s,busy:l,onChanged:c}=e,o=(0,I.NT)(),[x,m]=(0,n.useState)(!1),[u,h]=(0,n.useState)(null),[g,p]=(0,n.useState)(null),[b,f]=(0,n.useState)(null);if(0===s.length)return null;async function j(e){h(e),f(null);try{await r.hi.activateAnalysis(t,e),c()}catch(e){f((0,r.NS)(o,e,"analyses.activationFailed"))}finally{h(null)}}async function N(e){h(e),f(null);try{await r.hi.deleteAnalysis(t,e),p(null),c()}catch(e){f((0,r.NS)(o,e,"analyses.deleteFailed"))}finally{h(null)}}return(0,a.jsxs)(i.Zb,{children:[(0,a.jsxs)("button",{onClick:()=>m(!x),className:"w-full px-5 py-3 flex items-center gap-3 text-left hover:bg-bg-soft transition-colors",children:[x?(0,a.jsx)(O.Z,{className:"h-4 w-4 text-muted"}):(0,a.jsx)(U.Z,{className:"h-4 w-4 text-muted"}),(0,a.jsx)(H.Z,{className:"h-4 w-4 text-muted"}),(0,a.jsxs)("span",{className:"font-medium text-sm flex-1",children:[o("analyses.otherAnalyses")," ",(0,a.jsxs)("span",{className:"text-muted font-normal",children:["(",s.length,")"]})]}),(0,a.jsx)("span",{className:"text-[11px] text-muted",children:x?o("analyses.hide"):o("analyses.show")})]}),x&&(0,a.jsxs)(i.eW,{className:"pt-0 border-t border-border",children:[b&&(0,a.jsxs)("div",{className:"mb-2 px-3 py-1.5 rounded-md bg-danger-soft border border-danger/30 text-xs text-red-700 flex items-center gap-2",children:[(0,a.jsx)(v.Z,{className:"h-3.5 w-3.5"})," ",b]}),(0,a.jsx)("p",{className:"text-[11px] text-muted mb-2",children:o("analyses.otherAnalysesHint")}),(0,a.jsx)("div",{className:"space-y-2",children:s.map(e=>{var t;let s=e.method in R?e.method:"unknown",n=R[s],i=n.icon;return(0,a.jsx)("div",{className:"rounded-lg border border-border bg-white px-3 py-2.5 hover:border-border-strong",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:(0,D.cn)("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",n.bg),children:(0,a.jsx)(i,{className:(0,D.cn)("h-4 w-4",n.tone)})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-ink truncate",children:e.label}),(0,a.jsx)("span",{className:(0,D.cn)("text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded font-medium",n.bg,n.tone),children:o("analyses.method.".concat(s))}),"legacy_migration"===e.source&&(0,a.jsxs)("span",{className:"text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded font-medium bg-slate-100 text-slate-600 flex items-center gap-0.5",children:[(0,a.jsx)(H.Z,{className:"h-3 w-3"})," ",o("analyses.legacy")]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-muted",children:[(0,a.jsx)("span",{children:(t=e.created_at)?new Date(1e3*t).toLocaleString(void 0,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[e.file_count," ",o("common.files")]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("span",{children:(0,r.td)(e.total_size)})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,a.jsxs)(d.z,{variant:"ghost",className:"h-7 text-xs px-2",disabled:l||u===e.id,onClick:()=>j(e.id),children:[u===e.id?(0,a.jsx)(T.Z,{className:"h-3 w-3 animate-spin"}):null,o("analyses.activate")]}),g===e.id?(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(d.z,{variant:"ghost",className:"h-7 text-xs px-2 text-danger hover:bg-danger-soft",disabled:u===e.id,onClick:()=>N(e.id),children:o("analyses.deleteConfirm")}),(0,a.jsx)(d.z,{variant:"ghost",className:"h-7 text-xs px-2",disabled:u===e.id,onClick:()=>p(null),children:o("common.cancel")})]}):(0,a.jsx)("button",{className:"h-7 w-7 inline-flex items-center justify-center rounded-md text-muted hover:text-danger hover:bg-danger-soft",disabled:l||u===e.id,onClick:()=>p(e.id),title:o("common.delete"),children:(0,a.jsx)(E.Z,{className:"h-3.5 w-3.5"})})]})]})},e.id)})})]})]})}var P=s(3835),q=s(7689),Q=s(9322);function V(e){let{onUpload:t,accept:s}=e,l=(0,I.NT)(),[i,d]=(0,n.useState)(!1),[c,o]=(0,n.useState)(null),[x,m]=(0,n.useState)(null),u=(0,n.useCallback)(async e=>{o(null),m(null),d(!0);try{await t(e),m(l("data.filesUploaded",{n:e.length}))}catch(e){o((0,r.NS)(l,e,"data.uploadFailed"))}finally{d(!1)}},[t,l]),{getRootProps:h,getInputProps:p,isDragActive:b}=(0,P.uI)({onDrop:u,accept:null!=s?s:{"text/csv":[".csv"],"text/plain":[".txt",".isi"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"]},disabled:i});return(0,a.jsxs)("div",{...h(),className:(0,D.cn)("rounded-xl border-2 border-dashed bg-bg-soft p-10 text-center cursor-pointer transition",b?"border-brand-500 bg-brand-50":"border-border hover:border-brand-300 hover:bg-bg",i&&"opacity-60 cursor-progress"),children:[(0,a.jsx)("input",{...p()}),(0,a.jsx)("div",{className:"w-14 h-14 rounded-full bg-[#0c2847] text-cyan-200 flex items-center justify-center mx-auto mb-3",children:i?(0,a.jsx)(T.Z,{className:"h-6 w-6 animate-spin"}):(0,a.jsx)(q.Z,{className:"h-6 w-6"})}),(0,a.jsx)("p",{className:"font-semibold text-ink",children:b?l("data.dropToUpload"):l("data.dragDrop")}),(0,a.jsxs)("p",{className:"text-sm text-muted mt-1",children:["Scopus ",(0,a.jsx)("code",{className:"text-xs bg-white px-1.5 py-0.5 rounded border border-border",children:".csv"}),", Web of Science ",(0,a.jsx)("code",{className:"text-xs bg-white px-1.5 py-0.5 rounded border border-border",children:".txt"}),", Excel ",(0,a.jsx)("code",{className:"text-xs bg-white px-1.5 py-0.5 rounded border border-border",children:".xlsx"})]}),x&&(0,a.jsxs)("p",{className:"mt-4 inline-flex items-center gap-2 text-success text-sm font-medium",children:[(0,a.jsx)(g.Z,{className:"h-4 w-4"})," ",x]}),c&&(0,a.jsxs)("p",{className:"mt-4 inline-flex items-center gap-2 text-danger text-sm",children:[(0,a.jsx)(Q.Z,{className:"h-4 w-4"})," ",c]})]})}function X(e){let{projectId:t,files:s,variant:l,onStartMerge:c,starting:o,onChanged:m}=e,u=(0,I.NT)(),h=(0,z.N)(),[g,p]=(0,n.useState)(!1),[b,f]=(0,n.useState)(null),j=s.filter(e=>"scopus_csv"===e.kind),w=s.filter(e=>"wos_txt"===e.kind),y=s.length>0;async function k(e){f(null);try{await r.hi.uploadFiles(t,e),p(!1),m()}catch(e){f((0,r.NS)(u,e,"data.uploadFailed"))}}async function S(e){if(await h({message:u("data.deleteFileConfirm",{name:e}),tone:"danger"})){f(null);try{await r.hi.deleteFile(t,e),m()}catch(e){f((0,r.NS)(u,e))}}}return"empty"!==l&&y?(0,a.jsxs)(i.Zb,{children:[(0,a.jsxs)(i.Ol,{children:[(0,a.jsx)(N.Z,{className:"h-4 w-4 text-muted"}),(0,a.jsx)("h2",{className:"font-semibold flex-1",children:u("merge.uploadTitle")}),(0,a.jsxs)("span",{className:"text-xs text-muted",children:[s.length," ",u("common.files")]})]}),(0,a.jsxs)(i.eW,{className:"space-y-4",children:[b&&(0,a.jsx)(G,{msg:b}),"stale"===l&&(0,a.jsxs)("div",{className:"rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 flex items-start gap-2",children:[(0,a.jsx)(v.Z,{className:"h-3.5 w-3.5 flex-shrink-0 mt-0.5"}),(0,a.jsx)("span",{children:u("merge.staleHint")})]}),g?(0,a.jsx)(V,{onUpload:k}):(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsx)(Y,{title:u("data.scopus"),sub:"CSV",files:j,projectId:t,onDelete:S,t:u}),(0,a.jsx)(Y,{title:u("data.wos"),sub:"TXT",files:w,projectId:t,onDelete:S,t:u})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,a.jsxs)(d.z,{variant:"ghost",onClick:()=>p(e=>!e),disabled:o,children:[(0,a.jsx)(Z.Z,{className:"h-4 w-4"})," ",g?u("common.cancel"):u("data.addMoreFiles")]}),(0,a.jsxs)(d.z,{onClick:c,disabled:o||g,className:"bg-success px-6 text-base font-semibold hover:bg-success/90",children:[o?(0,a.jsx)(T.Z,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(x.Z,{className:"h-4 w-4"}),u("algoCard.startBtnSmart")]})]})]})]}):(0,a.jsxs)(i.Zb,{children:[(0,a.jsxs)(i.Ol,{children:[(0,a.jsx)(N.Z,{className:"h-4 w-4 text-muted"}),(0,a.jsx)("h2",{className:"font-semibold",children:u("data.prepareSectionTitle")})]}),(0,a.jsxs)(i.eW,{className:"space-y-3",children:[b&&(0,a.jsx)(G,{msg:b}),(0,a.jsx)(V,{onUpload:k})]})]})}function Y(e){let{title:t,sub:s,files:n,projectId:l,onDelete:i,t:d}=e;return(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-bg-soft/40 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted",children:[t," ",(0,a.jsxs)("span",{className:"text-muted/60",children:["\xb7 ",s]})]}),0===n.length?(0,a.jsx)("div",{className:"py-1 text-xs italic text-muted/60",children:d("data.noFilesYet")}):(0,a.jsx)("ul",{className:"space-y-1",children:n.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)(N.Z,{className:"h-4 w-4 flex-shrink-0 text-muted"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono text-xs",title:e.name,children:e.name}),(0,a.jsx)("span",{className:"text-[11px] text-muted tabular-nums",children:(0,r.td)(e.size)}),(0,a.jsx)("a",{href:r.hi.downloadFromUrl(l,"raw",e.name),download:e.name,className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted hover:bg-brand-50 hover:text-brand-600",title:d("common.download"),children:(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{onClick:()=>i(e.name),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted hover:text-danger",title:d("common.delete"),children:(0,a.jsx)(E.Z,{className:"h-3.5 w-3.5"})})]},e.name))})]})}function G(e){let{msg:t}=e;return(0,a.jsx)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-3 py-2 text-xs text-red-700",children:t})}var K=s(8763),$=s(1348),ee=s(4765);function et(){var e,t,s;let i=(0,$.v)(),d=(0,I.NT)(),{tArr:m,tObjArr:u}=(0,I.QT)(),[h,g]=(0,n.useState)(null),[p,b]=(0,n.useState)(null),[f,j]=(0,n.useState)([]),[N,v]=(0,n.useState)([]),[w,k]=(0,n.useState)(null),[S,C]=(0,n.useState)(null),[Z,_]=(0,n.useState)(!1),[T,E]=(0,n.useState)(!1),[L,z]=(0,n.useState)(!1),[D,F]=(0,n.useState)(!1),[A,W]=(0,n.useState)(!1),M=(0,n.useCallback)(async()=>{try{let[e,t,s]=await Promise.all([r.hi.mergeSummary(i),r.hi.listAnalyses(i),r.hi.listFiles(i)]);b(e),v(t.items),k(t.active_id),j(s)}catch(e){C((0,r.NS)(d,e))}},[i]);async function O(){_(!0),C(null);try{let{job_id:e}=await r.hi.startMerge(i);g(e),z(!1)}catch(e){C((0,r.NS)(d,e))}finally{_(!1)}}(0,n.useEffect)(()=>{M()},[M]);let U=(0,n.useCallback)(()=>{M(),z(!1),W(!1);try{window.dispatchEvent(new Event("bibexpy:status"))}catch(e){}},[M]),H=(0,n.useCallback)(()=>{M();try{window.dispatchEvent(new Event("bibexpy:status"))}catch(e){}},[M]),R=!!(null==p?void 0:p.has_merge),P=null==p?void 0:p.method,q=null!==(t=N.find(e=>e.id===w))&&void 0!==t?t:null,Q=N.filter(e=>e.id!==w),V=f.length>0,Y=!!(null==p?void 0:p.stale),G=R&&(Y||A);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.m,{title:d("analyses.title"),subtitle:d("analyses.subtitle"),badges:[{label:d("analyses.stepBadge"),tone:"neutral"}],right:(0,a.jsx)(ee.L,{onHistory:()=>E(!0),nextOptions:R?[{href:"/projects/".concat(i,"/export"),label:d("merge.next.downloadTitle"),tone:"brand"},{href:"/projects/".concat(i,"/records"),label:d("merge.next.advancedTitle"),onClick:function(){try{var e;let t=null==p?void 0:null===(e=p.analysis)||void 0===e?void 0:e.id;t&&localStorage.setItem((0,K.T0)(i,t),"1"),window.dispatchEvent(new Event("bibexpy:status"))}catch(e){}},tone:"emerald"}]:null})}),(0,a.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-6 space-y-5",children:[S&&(0,a.jsx)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-4 py-2 text-sm text-red-700",children:S}),h&&(0,a.jsx)(c.D,{jobId:h,onComplete:U,onClose:()=>g(null)}),G&&!h&&(0,a.jsx)("div",{id:"add-data",children:(0,a.jsx)(X,{projectId:i,files:f,variant:Y?"stale":"ready",onStartMerge:O,starting:Z||!!h,onChanged:M})}),G&&q&&(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-border bg-bg-soft/50 px-4 py-3",children:[(0,a.jsx)(x.Z,{className:"h-5 w-5 flex-shrink-0 text-muted"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate text-sm font-medium text-ink",children:q.label}),(0,a.jsxs)("div",{className:"text-[11px] text-muted",children:[Y?d("merge.oldMerge"):d("merge.currentMerge")," \xb7 ",q.file_count," ",d("common.files")]})]}),!Y&&(0,a.jsx)("button",{onClick:()=>W(!1),className:"flex-shrink-0 text-xs text-muted underline hover:text-ink",children:d("merge.backToActive")}),(0,a.jsx)(l.default,{href:"/projects/".concat(i,"/export"),className:"flex-shrink-0 text-xs text-muted underline hover:text-ink",children:d("merge.next.downloadTitle")})]}),R&&!G&&q&&p&&(0,a.jsx)(B,{projectId:i,summary:p,analysis:q,onNewAnalysis:function(){W(!0);try{window.scrollTo({top:0,behavior:"smooth"})}catch(e){}},onDeleted:H}),R&&!G&&p&&(0,a.jsx)(es,{projectId:i,analysisId:null!==(s=null===(e=p.analysis)||void 0===e?void 0:e.id)&&void 0!==s?s:""}),Q.length>0&&(0,a.jsx)(J,{projectId:i,items:Q,busy:Z||!!h,onChanged:H}),(0,a.jsx)(ea,{open:D,onClose:()=>F(!1),tone:"success",icon:(0,a.jsx)(x.Z,{className:"h-5 w-5"}),title:d("algoCard.smart.title"),tagline:d("algoCard.smart.tagline"),speed:d("algoCard.smart.speedHint"),details:{howItWorks:m("algoCard.smart.howItWorks"),useCases:m("algoCard.smart.useCases"),outputs:u("algoCard.smart.outputs"),limitations:m("algoCard.smart.limitations"),citation:{title:d("algoCard.smart.citation.title"),journal:d("algoCard.smart.citation.journal"),related:m("algoCard.smart.citation.related")}},onStart:()=>{F(!1),O()},buttonLabel:d("algoCard.startBtnSmart"),isActive:"smart"===P}),!R&&!h&&(0,a.jsx)("div",{id:"add-data",children:(0,a.jsx)(X,{projectId:i,files:f,variant:V?"ready":"empty",onStartMerge:O,starting:Z,onChanged:M})})]}),(0,a.jsx)(y.N,{projectId:i,open:T,onClose:()=>E(!1)})]})}function es(e){let{projectId:t,analysisId:s}=e,n=(0,I.NT)();return(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsxs)(l.default,{href:"/projects/".concat(t,"/export"),className:"group flex flex-col items-center justify-center gap-2.5 rounded-2xl border-2 border-brand-200 bg-gradient-to-b from-brand-50/60 to-white px-6 py-9 text-center transition hover:border-brand-400 hover:shadow-card",children:[(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-brand-500 text-white shadow-soft transition group-hover:scale-105",children:(0,a.jsx)(m.Z,{className:"h-8 w-8"})}),(0,a.jsx)("div",{className:"text-lg font-bold text-ink",children:n("merge.next.downloadTitle")}),(0,a.jsx)("div",{className:"max-w-xs text-sm text-muted",children:n("merge.next.downloadBody")})]}),(0,a.jsxs)(l.default,{href:"/projects/".concat(t,"/records"),onClick:function(){try{s&&localStorage.setItem((0,K.T0)(t,s),"1"),window.dispatchEvent(new Event("bibexpy:status"))}catch(e){}},className:"group flex flex-col items-center justify-center gap-2.5 rounded-2xl border-2 border-border bg-white px-6 py-9 text-center transition hover:border-emerald-400 hover:shadow-card",children:[(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-emerald-500 text-white shadow-soft transition group-hover:scale-105",children:(0,a.jsx)(u.Z,{className:"h-8 w-8"})}),(0,a.jsx)("div",{className:"text-lg font-bold text-ink",children:n("merge.next.advancedTitle")}),(0,a.jsx)("div",{className:"max-w-xs text-sm text-muted",children:n("merge.next.advancedBody")})]})]})}function ea(e){let{open:t,onClose:s,tone:l,icon:r,title:i,tagline:c,speed:o,details:x,onStart:m,buttonLabel:u,isActive:y}=e,k=(0,I.NT)();if((0,n.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",e),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=""}},[t,s]),!t)return null;let S={brand:{icon:"bg-brand-100 text-brand-700",btn:"bg-brand-500 hover:bg-brand-600",text:"text-brand-700",accent:"text-brand-500"},accent:{icon:"bg-brand-500 text-white",btn:"bg-brand-700 hover:bg-brand-800",text:"text-brand-800",accent:"text-brand-700"},success:{icon:"bg-success text-white",btn:"bg-success hover:bg-success/90",text:"text-emerald-800",accent:"text-success"}}[l];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{onClick:s,className:"fixed inset-0 bg-ink/40 backdrop-blur-sm z-50"}),(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden pointer-events-auto w-full max-w-3xl",style:{maxHeight:"85vh"},children:[(0,a.jsxs)("div",{className:"px-6 py-4 border-b border-border flex items-start gap-3",children:[(0,a.jsx)("div",{className:(0,D.cn)("w-11 h-11 rounded-xl flex items-center justify-center flex-shrink-0",S.icon),children:r}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"font-bold text-xl text-ink",children:i}),(0,a.jsx)("p",{className:"text-sm text-muted italic",children:c}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-bg-soft text-muted text-[11px]",children:[(0,a.jsx)(h.Z,{className:"h-3 w-3"})," ",o]}),y&&(0,a.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full bg-success-soft text-emerald-700 border border-success/40",children:[(0,a.jsx)(g.Z,{className:"h-2.5 w-2.5 inline mr-0.5"})," ",k("analyses.activeBadge")]})]})]}),(0,a.jsx)("button",{onClick:s,className:"p-1.5 rounded-md hover:bg-bg-soft text-muted hover:text-ink",children:(0,a.jsx)(p.Z,{className:"h-5 w-5"})})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-5",children:[(0,a.jsxs)("section",{children:[(0,a.jsxs)("h3",{className:(0,D.cn)("text-xs font-bold uppercase tracking-wider mb-2 flex items-center gap-1.5",S.text),children:[(0,a.jsx)(b.Z,{className:"h-3.5 w-3.5"})," ",k("algoCard.howItWorks")]}),(0,a.jsx)("ol",{className:"space-y-1.5",children:x.howItWorks.map((e,t)=>(0,a.jsxs)("li",{className:"text-sm text-ink flex gap-2.5 leading-relaxed",children:[(0,a.jsx)("span",{className:(0,D.cn)("w-5 h-5 rounded-full text-[10px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5","brand"===l?"bg-brand-100 text-brand-700":"accent"===l?"bg-brand-500 text-white":"bg-success-soft text-emerald-700"),children:t+1}),(0,a.jsx)("span",{children:e})]},t))})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("h3",{className:(0,D.cn)("text-xs font-bold uppercase tracking-wider mb-2 flex items-center gap-1.5",S.text),children:[(0,a.jsx)(f.Z,{className:"h-3.5 w-3.5"})," ",k("algoCard.useCases")]}),(0,a.jsx)("ul",{className:"space-y-1.5",children:x.useCases.map((e,t)=>(0,a.jsxs)("li",{className:"text-sm text-ink flex items-start gap-2",children:[(0,a.jsx)(f.Z,{className:(0,D.cn)("h-3.5 w-3.5 mt-0.5 flex-shrink-0",S.accent)}),(0,a.jsx)("span",{children:e})]},t))})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("h3",{className:(0,D.cn)("text-xs font-bold uppercase tracking-wider mb-2 flex items-center gap-1.5",S.text),children:[(0,a.jsx)(j.Z,{className:"h-3.5 w-3.5"})," ",k("algoCard.outputs")]}),(0,a.jsx)("ul",{className:"space-y-1.5",children:x.outputs.map(e=>(0,a.jsxs)("li",{className:"text-sm flex items-start gap-2 leading-relaxed",children:[(0,a.jsx)(N.Z,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0 text-muted"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("code",{className:"font-mono text-xs bg-bg-soft px-1.5 py-0.5 rounded",children:e.name}),(0,a.jsxs)("span",{className:"text-muted ml-2 text-xs",children:["— ",e.desc]})]})]},e.name))})]}),x.limitations.length>0&&(0,a.jsxs)("section",{children:[(0,a.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-2 flex items-center gap-1.5 text-warning",children:[(0,a.jsx)(v.Z,{className:"h-3.5 w-3.5"})," ",k("algoCard.limitations")]}),(0,a.jsx)("ul",{className:"space-y-1.5",children:x.limitations.map((e,t)=>(0,a.jsxs)("li",{className:"text-sm text-ink flex items-start gap-2",children:[(0,a.jsx)("span",{className:"text-warning mt-0.5 flex-shrink-0",children:"•"}),(0,a.jsx)("span",{children:e})]},t))})]}),x.citation&&(0,a.jsxs)("section",{className:"rounded-lg border border-success/30 bg-success-soft/40 px-4 py-3",children:[(0,a.jsxs)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-2 flex items-center gap-1.5 text-emerald-800",children:[(0,a.jsx)(w.Z,{className:"h-3.5 w-3.5"})," ",k("algoCard.citation")]}),(0,a.jsxs)("p",{className:"text-sm text-ink leading-relaxed",children:[(0,a.jsx)("strong",{children:x.citation.title})," — ",x.citation.journal]}),x.citation.related&&x.citation.related.length>0&&(0,a.jsxs)("details",{className:"mt-2",children:[(0,a.jsxs)("summary",{className:"text-xs text-emerald-800 cursor-pointer hover:underline",children:[k("algoCard.related")," (",x.citation.related.length,")"]}),(0,a.jsx)("ul",{className:"mt-1.5 space-y-0.5 pl-4",children:x.citation.related.map((e,t)=>(0,a.jsx)("li",{className:"text-xs text-muted leading-relaxed",children:e},t))})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-3 border-t border-border flex items-center justify-between bg-bg-soft/30",children:[(0,a.jsx)("span",{className:"text-xs text-muted",children:k("algoCard.escClose")}),(0,a.jsx)(d.z,{onClick:()=>{m(),s()},className:(0,D.cn)("font-semibold",S.btn),children:y?"".concat(u," (").concat(k("algoCard.rerun"),")"):u})]})]})})]})}},4392:function(e,t,s){"use strict";s.d(t,{z:function(){return i}});var a=s(7437),n=s(2265),l=s(4502);let r={primary:"bg-primary text-white hover:bg-primary-hover shadow-sm",secondary:"bg-white text-ink border border-border hover:bg-bg-soft",ghost:"text-ink hover:bg-bg-soft",danger:"bg-danger text-white hover:bg-red-700 shadow-sm",success:"bg-success text-white hover:bg-emerald-600 shadow-sm"},i=(0,n.forwardRef)(function(e,t){let{className:s,variant:n="primary",size:i="md",...d}=e;return(0,a.jsx)("button",{ref:t,className:(0,l.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-brand-500/40","sm"===i?"px-3 py-1.5 text-sm":"px-4 py-2 text-sm",r[n],s),...d})})},7523:function(e,t,s){"use strict";s.d(t,{D:function(){return m}});var a=s(7437),n=s(2265),l=s(7855),r=s(2934),i=s(9322),d=s(1817),c=s(2489),o=s(4392),x=s(3554);function m(e){let{jobId:t,onComplete:s,onClose:m}=e,u=(0,x.NT)(),[h,g]=(0,n.useState)(null),p=(0,n.useRef)(s);(0,n.useEffect)(()=>{p.current=s},[s]);let b=(0,n.useRef)(!1);if((0,n.useEffect)(()=>{b.current=!1;let e=new EventSource(l.hi.jobStreamUrl(t));return e.addEventListener("update",t=>{try{let a=JSON.parse(t.data);if(g(a),["completed","failed","cancelled"].includes(a.status)&&!b.current){var s;b.current=!0,e.close(),null===(s=p.current)||void 0===s||s.call(p,a)}}catch(e){}}),e.addEventListener("done",()=>{e.close()}),e.onerror=()=>{e.close()},()=>{e.close()}},[t]),!h)return(0,a.jsx)("div",{className:"text-muted text-sm",children:u("jobs.starting")});let f=Math.round(100*h.progress),j="queued"===h.status||"running"===h.status;return(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-bg-card shadow-card p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["completed"===h.status&&(0,a.jsx)("span",{className:"w-7 h-7 rounded-full bg-success-soft flex items-center justify-center",children:(0,a.jsx)(r.Z,{className:"h-4 w-4 text-success"})}),"failed"===h.status&&(0,a.jsx)("span",{className:"w-7 h-7 rounded-full bg-danger-soft flex items-center justify-center",children:(0,a.jsx)(i.Z,{className:"h-4 w-4 text-danger"})}),j&&(0,a.jsx)("span",{className:"w-7 h-7 rounded-full bg-[#0c2847] flex items-center justify-center",children:(0,a.jsx)(d.Z,{className:"h-4 w-4 animate-spin text-cyan-300"})}),(0,a.jsx)("span",{className:"font-semibold text-ink",children:(0,l.Pr)(u,h)}),(0,a.jsxs)("span",{className:"ml-auto text-sm font-medium text-ink tabular-nums",children:[f,"%"]}),j&&(0,a.jsx)(o.z,{size:"sm",variant:"ghost",onClick:()=>l.hi.cancelJob(h.id),title:u("jobs.cancel"),children:(0,a.jsx)(c.Z,{className:"h-4 w-4"})}),!j&&m&&(0,a.jsx)(o.z,{size:"sm",variant:"ghost",onClick:m,title:u("common.close"),children:(0,a.jsx)(c.Z,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"h-2 rounded-full bg-bg-soft overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-brand-500 to-accent transition-all",style:{width:"".concat(f,"%")}})}),h.error&&(0,a.jsx)("div",{className:"text-sm text-red-700 bg-danger-soft border border-danger/30 rounded-lg p-2 whitespace-pre-wrap",children:h.error}),h.log_tail.length>0&&(0,a.jsx)("pre",{className:"text-xs text-muted bg-bg-soft rounded-lg p-2.5 max-h-40 overflow-y-auto whitespace-pre-wrap font-mono",children:h.log_tail.join("\n")}),"completed"===h.status&&null!=h.result&&(0,a.jsxs)("details",{className:"text-xs",children:[(0,a.jsx)("summary",{className:"text-muted cursor-pointer hover:text-ink",children:u("jobs.result")}),(0,a.jsx)("pre",{className:"mt-2 bg-bg-soft rounded-lg p-2 max-h-60 overflow-auto font-mono",children:JSON.stringify(h.result,null,2)})]})]})}}},function(e){e.O(0,[156,507,624,244,382,367,971,117,744],function(){return e(e.s=2357)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[837],{573:function(e,t,l){Promise.resolve().then(l.bind(l,1847))},1847:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return eL}});var s=l(7437),r=l(2265),a=l(7648),n=l(7855),i=l(9835),o=l(4392),d=l(740),c=l(2489),u=l(1047),x=l(4656),m=l(2521),h=l(7945),p=l(91),b=l(2096),g=l(1150),f=l(2720),v=l(8124),j=l(5277),N=l(4286),y=l(2023),w=l(875),k=l(407),C=l(3247),S=l(9397),D=l(3554),_=l(4502);function Z(e){var t,l,a,n,i,o,y,w,k,C,S,_,Z,q,R,F,B,O,U,V,W,H,J,Y,G,K,Q,X,$,ee,et,el,es,er,ea,en,ei,eo,ed,ec,eu,ex,em,eh,ep,eb,eg;let{spec:ef,facetsAll:ev,onChange:ej,onReset:eN}=e,ey=(0,D.NT)(),ew=(0,r.useMemo)(()=>{var e,t,l,s,r,a,n,i,o,d,c,u;let x;return x=0,ef.year&&(null!=ef.year.min||null!=ef.year.max)&&x++,ef.citation_count&&(null!=ef.citation_count.min||null!=ef.citation_count.max)&&x++,(null===(e=ef.doc_type)||void 0===e?void 0:e.length)&&x++,(null===(t=ef.language)||void 0===t?void 0:t.length)&&x++,(null===(l=ef.db_source)||void 0===l?void 0:l.length)&&x++,(null===(s=ef.journal)||void 0===s?void 0:s.length)&&x++,(null===(r=ef.authors)||void 0===r?void 0:r.length)&&x++,(null===(a=ef.wc_categories)||void 0===a?void 0:a.length)&&x++,(null===(n=ef.sc_categories)||void 0===n?void 0:n.length)&&x++,(null===(i=ef.fulltext)||void 0===i?void 0:i.query)&&x++,ef.quality&&(null!==(c=null===(o=ef.quality.missing)||void 0===o?void 0:o.length)&&void 0!==c?c:0)+(null!==(u=null===(d=ef.quality.has)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0&&x++,x},[ef]);return(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("h2",{className:"font-semibold flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(d.Z,{className:"h-4 w-4 text-brand-500"})," ",ey("records.openFilter"),ew>0&&(0,s.jsx)("span",{className:"ml-1 px-1.5 py-0.5 rounded-full bg-brand-500 text-white text-[10px] font-bold",children:ew})]}),ew>0&&(0,s.jsxs)("button",{onClick:eN,className:"text-[11px] text-muted hover:text-danger flex items-center gap-1",children:[(0,s.jsx)(c.Z,{className:"h-3 w-3"})," ",ey("common.reset")]})]}),(0,s.jsx)(T,{spec:ef,facetsAll:ev,onChange:ej}),(0,s.jsx)(I,{title:ey("records.filter.year"),icon:(0,s.jsx)(u.Z,{className:"h-3.5 w-3.5"}),active:!!ef.year,onClear:()=>ej({...ef,year:void 0}),children:(0,s.jsx)(z,{value:ef.year,min:null==ev?void 0:null===(t=ev.year)||void 0===t?void 0:t.min,max:null==ev?void 0:null===(l=ev.year)||void 0===l?void 0:l.max,histogram:null!==(K=null==ev?void 0:null===(n=ev.year)||void 0===n?void 0:null===(a=n.histogram)||void 0===a?void 0:a.map(e=>({key:e.year,count:e.count})))&&void 0!==K?K:[],onChange:e=>ej({...ef,year:e})})}),(0,s.jsx)(I,{title:ey("records.filter.citationCount"),icon:(0,s.jsx)(x.Z,{className:"h-3.5 w-3.5"}),active:!!ef.citation_count,onClear:()=>ej({...ef,citation_count:void 0}),children:(0,s.jsx)(E,{value:ef.citation_count,min:null==ev?void 0:null===(i=ev.citation_count)||void 0===i?void 0:i.min,max:null==ev?void 0:null===(o=ev.citation_count)||void 0===o?void 0:o.max,onChange:e=>ej({...ef,citation_count:e}),hint:(null==ev?void 0:ev.citation_count)?ey("records.filter.citationHint",{mean:Math.round(ev.citation_count.mean),max:ev.citation_count.max}):void 0})}),(0,s.jsx)(I,{title:ey("records.filter.docType"),icon:(0,s.jsx)(m.Z,{className:"h-3.5 w-3.5"}),active:(null!==(Q=null===(y=ef.doc_type)||void 0===y?void 0:y.length)&&void 0!==Q?Q:0)>0,count:null===(w=ef.doc_type)||void 0===w?void 0:w.length,onClear:()=>ej({...ef,doc_type:void 0}),children:(0,s.jsx)(A,{placeholder:ey("records.filter.docTypeSearch"),options:null!==(X=null==ev?void 0:ev.doc_type)&&void 0!==X?X:[],selected:null!==($=ef.doc_type)&&void 0!==$?$:[],onChange:e=>ej({...ef,doc_type:e.length?e:void 0})})}),(0,s.jsx)(I,{title:ey("records.filter.language"),icon:(0,s.jsx)(h.Z,{className:"h-3.5 w-3.5"}),active:(null!==(ee=null===(k=ef.language)||void 0===k?void 0:k.length)&&void 0!==ee?ee:0)>0,count:null===(C=ef.language)||void 0===C?void 0:C.length,onClear:()=>ej({...ef,language:void 0}),children:(0,s.jsx)(A,{placeholder:ey("records.filter.languageSearch"),options:null!==(et=null==ev?void 0:ev.language)&&void 0!==et?et:[],selected:null!==(el=ef.language)&&void 0!==el?el:[],onChange:e=>ej({...ef,language:e.length?e:void 0})})}),(0,s.jsx)(I,{title:ey("records.filter.dbSource"),icon:(0,s.jsx)(p.Z,{className:"h-3.5 w-3.5"}),active:(null!==(es=null===(S=ef.db_source)||void 0===S?void 0:S.length)&&void 0!==es?es:0)>0,count:null===(_=ef.db_source)||void 0===_?void 0:_.length,onClear:()=>ej({...ef,db_source:void 0}),children:(0,s.jsx)(A,{placeholder:ey("records.filter.dbSourceSearch"),options:null!==(er=null==ev?void 0:ev.db_source)&&void 0!==er?er:[],selected:null!==(ea=ef.db_source)&&void 0!==ea?ea:[],onChange:e=>ej({...ef,db_source:e.length?e:void 0})})}),(0,s.jsx)(I,{title:ey("records.filter.journal"),icon:(0,s.jsx)(b.Z,{className:"h-3.5 w-3.5"}),active:(null!==(en=null===(Z=ef.journal)||void 0===Z?void 0:Z.length)&&void 0!==en?en:0)>0,count:null===(q=ef.journal)||void 0===q?void 0:q.length,onClear:()=>ej({...ef,journal:void 0}),children:(0,s.jsx)(L,{values:null!==(ei=ef.journal)&&void 0!==ei?ei:[],options:null!==(eo=null==ev?void 0:null===(R=ev.journal_top)||void 0===R?void 0:R.map(e=>e.value))&&void 0!==eo?eo:[],counts:Object.fromEntries(null!==(ed=null==ev?void 0:null===(F=ev.journal_top)||void 0===F?void 0:F.map(e=>[e.value,e.count]))&&void 0!==ed?ed:[]),onChange:e=>ej({...ef,journal:e.length?e:void 0}),placeholder:ey("records.filter.journalPlaceholder"),subtitle:ey("records.filter.journalSubtitle")})}),(0,s.jsx)(I,{title:ey("records.filter.authors"),icon:(0,s.jsx)(g.Z,{className:"h-3.5 w-3.5"}),active:(null!==(ec=null===(B=ef.authors)||void 0===B?void 0:B.length)&&void 0!==ec?ec:0)>0,count:null===(O=ef.authors)||void 0===O?void 0:O.length,onClear:()=>ej({...ef,authors:void 0}),children:(0,s.jsx)(L,{values:null!==(eu=ef.authors)&&void 0!==eu?eu:[],options:[],counts:{},onChange:e=>ej({...ef,authors:e.length?e:void 0}),placeholder:ey("records.filter.authorsPlaceholder"),subtitle:ey("records.filter.authorsSubtitle")})}),(0,s.jsx)(I,{title:ey("records.filter.wcCategories"),icon:(0,s.jsx)(f.Z,{className:"h-3.5 w-3.5"}),active:(null!==(ex=null===(U=ef.wc_categories)||void 0===U?void 0:U.length)&&void 0!==ex?ex:0)>0,count:null===(V=ef.wc_categories)||void 0===V?void 0:V.length,onClear:()=>ej({...ef,wc_categories:void 0}),children:(0,s.jsx)(L,{values:null!==(em=ef.wc_categories)&&void 0!==em?em:[],options:[],counts:{},onChange:e=>ej({...ef,wc_categories:e.length?e:void 0}),placeholder:ey("records.filter.wcPlaceholder")})}),(0,s.jsx)(I,{title:ey("records.filter.scCategories"),icon:(0,s.jsx)(v.Z,{className:"h-3.5 w-3.5"}),active:(null!==(eh=null===(W=ef.sc_categories)||void 0===W?void 0:W.length)&&void 0!==eh?eh:0)>0,count:null===(H=ef.sc_categories)||void 0===H?void 0:H.length,onClear:()=>ej({...ef,sc_categories:void 0}),children:(0,s.jsx)(L,{values:null!==(ep=ef.sc_categories)&&void 0!==ep?ep:[],options:[],counts:{},onChange:e=>ej({...ef,sc_categories:e.length?e:void 0}),placeholder:ey("records.filter.scPlaceholder")})}),(0,s.jsx)(I,{title:ey("records.filter.fulltext"),icon:(0,s.jsx)(j.Z,{className:"h-3.5 w-3.5"}),active:!!(null===(J=ef.fulltext)||void 0===J?void 0:J.query),highlight:!0,onClear:()=>ej({...ef,fulltext:void 0}),children:(0,s.jsx)(M,{value:ef.fulltext,onChange:e=>ej({...ef,fulltext:e})})}),(0,s.jsx)(I,{title:ey("records.filter.quality"),icon:(0,s.jsx)(N.Z,{className:"h-3.5 w-3.5"}),active:!!ef.quality&&(null!==(eb=null===(Y=ef.quality.missing)||void 0===Y?void 0:Y.length)&&void 0!==eb?eb:0)+(null!==(eg=null===(G=ef.quality.has)||void 0===G?void 0:G.length)&&void 0!==eg?eg:0)>0,onClear:()=>ej({...ef,quality:void 0}),children:(0,s.jsx)(P,{value:ef.quality,onChange:e=>ej({...ef,quality:e})})})]})}function T(e){var t,l,r,a,n,i,o,d;let{spec:c,facetsAll:u,onChange:x}=e,m=(0,D.NT)(),h=null==u?void 0:null===(t=u.year)||void 0===t?void 0:t.max,p=[{label:m("records.filter.last5Years"),active:!!((null===(l=c.year)||void 0===l?void 0:l.min)&&h&&c.year.min===h-4),apply:()=>x({...c,year:h?{min:h-4,max:h}:c.year})},{label:m("records.filter.last10Years"),active:!!((null===(r=c.year)||void 0===r?void 0:r.min)&&h&&c.year.min===h-9),apply:()=>x({...c,year:h?{min:h-9,max:h}:c.year})},{label:m("records.filter.hasDoi"),active:!!(null===(n=c.quality)||void 0===n?void 0:null===(a=n.has)||void 0===a?void 0:a.includes("DI")),apply:()=>{var e,t;let l=new Set(null!==(t=null===(e=c.quality)||void 0===e?void 0:e.has)&&void 0!==t?t:[]);l.has("DI")?l.delete("DI"):l.add("DI");let s=[...l];x({...c,quality:{...c.quality,has:s.length?s:void 0}})}},{label:m("records.filter.hasAbstract"),active:!!(null===(o=c.quality)||void 0===o?void 0:null===(i=o.has)||void 0===i?void 0:i.includes("AB")),apply:()=>{var e,t;let l=new Set(null!==(t=null===(e=c.quality)||void 0===e?void 0:e.has)&&void 0!==t?t:[]);l.has("AB")?l.delete("AB"):l.add("AB");let s=[...l];x({...c,quality:{...c.quality,has:s.length?s:void 0}})}},{label:m("records.filter.highCitation"),active:(null===(d=c.citation_count)||void 0===d?void 0:d.min)===10,apply:()=>x({...c,citation_count:{min:10}})}];return(0,s.jsxs)("div",{className:"rounded-lg border border-brand-200/60 bg-brand-50/40 px-2 py-2",children:[(0,s.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-brand-700 mb-1.5 flex items-center gap-1",children:[(0,s.jsx)(y.Z,{className:"h-3 w-3"})," ",m("records.filter.quickFilters")]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:p.map(e=>(0,s.jsx)("button",{onClick:e.apply,className:(0,_.cn)("text-[11px] px-2 py-0.5 rounded-full border transition",e.active?"bg-brand-500 text-white border-brand-500":"bg-white border-border text-ink hover:border-brand-400"),children:e.label},e.label))})]})}function I(e){let{title:t,icon:l,children:a,active:n,count:i,highlight:o,onClear:d}=e,u=(0,D.NT)(),[x,m]=(0,r.useState)(!!n||o);return(0,r.useEffect)(()=>{n&&m(!0)},[n]),(0,s.jsxs)("div",{className:(0,_.cn)("border rounded-md bg-white transition",n?"border-brand-500/60 shadow-soft":"border-border"),children:[(0,s.jsxs)("div",{className:"w-full flex items-center gap-2 px-3 py-2 text-[13px] font-medium rounded-md hover:bg-bg-soft",children:[(0,s.jsxs)("button",{onClick:()=>m(e=>!e),className:"flex items-center gap-2 flex-1 min-w-0 text-left",children:[x?(0,s.jsx)(w.Z,{className:"h-3 w-3 text-muted flex-shrink-0"}):(0,s.jsx)(k.Z,{className:"h-3 w-3 text-muted flex-shrink-0"}),l&&(0,s.jsx)("span",{className:(0,_.cn)("flex-shrink-0",n?"text-brand-500":"text-muted"),children:l}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:t})]}),null!=i&&i>0&&(0,s.jsx)("span",{className:"flex-shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-brand-100 text-brand-700",children:i}),n&&null==i&&(0,s.jsx)("span",{className:"flex-shrink-0 w-1.5 h-1.5 rounded-full bg-brand-500"}),n&&d&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),d()},title:u("records.filter.clearThis"),className:"flex-shrink-0 text-muted hover:text-danger p-0.5 -mr-0.5",children:(0,s.jsx)(c.Z,{className:"h-3 w-3"})})]}),x&&(0,s.jsx)("div",{className:"px-3 pb-3 pt-1",children:a})]})}function z(e){var t,l;let{value:r,min:a,max:n,histogram:i,onChange:o}=e,d=null!=r?r:{},c=null!=a?a:1900,u=null!=n?n:new Date().getFullYear(),x=null!==(t=d.min)&&void 0!==t?t:c,m=null!==(l=d.max)&&void 0!==l?l:u,h=Math.max(1,...i.map(e=>e.count)),p=Math.max(1,u-c);function b(e,t){let l=Math.max(c,Math.min(e,t)),s=Math.min(u,Math.max(t,e));o(l===c&&s===u?void 0:{min:l,max:s})}let g=(0,D.NT)(),f=(x-c)/p*100,v=(m-c)/p*100;return(0,s.jsxs)("div",{className:"space-y-2.5",children:[i.length>0&&(0,s.jsx)("div",{className:"flex items-end gap-px h-14 px-0.5",children:i.map(e=>{let t=e.key>=x&&e.key<=m;return(0,s.jsxs)("div",{className:"flex-1 h-full flex items-end group relative cursor-help","aria-label":g("records.filter.yearCount",{year:e.key,count:e.count}),children:[(0,s.jsx)("div",{className:(0,_.cn)("w-full rounded-t-sm transition-colors group-hover:brightness-110",t?"bg-gradient-to-t from-brand-500 to-brand-400":"bg-border"),style:{height:"".concat(e.count/h*100,"%"),minHeight:2}}),(0,s.jsx)("div",{className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-1 z-20 hidden whitespace-nowrap rounded bg-ink px-1.5 py-0.5 text-[10px] font-medium text-white shadow-soft group-hover:block",children:g("records.filter.yearCount",{year:e.key,count:e.count})})]},e.key)})}),(0,s.jsxs)("div",{className:"relative h-7 px-1",children:[(0,s.jsx)("div",{className:"absolute left-1 right-1 top-1/2 -translate-y-1/2 h-1 rounded-full bg-bg-soft",children:(0,s.jsx)("div",{className:"absolute top-0 bottom-0 bg-brand-500 rounded-full",style:{left:"".concat(f,"%"),right:"".concat(100-v,"%")}})}),(0,s.jsx)("input",{type:"range",min:c,max:u,step:1,value:x,onChange:e=>b(Number(e.target.value),m),className:"dual-range absolute inset-0 w-full appearance-none bg-transparent pointer-events-none",style:{zIndex:x>u-5?5:3}}),(0,s.jsx)("input",{type:"range",min:c,max:u,step:1,value:m,onChange:e=>b(x,Number(e.target.value)),className:"dual-range absolute inset-0 w-full appearance-none bg-transparent pointer-events-none",style:{zIndex:4}})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"number",min:c,max:u,value:x,onChange:e=>{b(""===e.target.value?c:Number(e.target.value),m)},className:"w-full rounded-md border border-border bg-white px-2 py-1 text-xs tabular-nums focus:outline-none focus:border-brand-500"}),(0,s.jsx)("span",{className:"text-muted text-xs",children:"—"}),(0,s.jsx)("input",{type:"number",min:c,max:u,value:m,onChange:e=>{b(x,""===e.target.value?u:Number(e.target.value))},className:"w-full rounded-md border border-border bg-white px-2 py-1 text-xs tabular-nums focus:outline-none focus:border-brand-500"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted",children:[(0,s.jsxs)("span",{children:[g("records.filter.range"),": ",c,"–",u]}),(0,s.jsx)("span",{className:"tabular-nums",children:g("records.filter.yearsSelected",{n:m-x+1})})]})]})}function E(e){var t,l;let{value:r,min:a,max:n,onChange:i,hint:o}=e,d=null!=r?r:{};return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"number",placeholder:String(null!=a?a:"min"),value:null!==(t=d.min)&&void 0!==t?t:"",onChange:e=>{let t=""===e.target.value?void 0:Number(e.target.value),l={...d,min:t};i(null==l.min&&null==l.max?void 0:l)},className:"w-full rounded-md border border-border bg-white px-2 py-1.5 text-xs tabular-nums focus:outline-none focus:border-brand-500"}),(0,s.jsx)("span",{className:"text-muted text-xs",children:"—"}),(0,s.jsx)("input",{type:"number",placeholder:String(null!=n?n:"max"),value:null!==(l=d.max)&&void 0!==l?l:"",onChange:e=>{let t=""===e.target.value?void 0:Number(e.target.value),l={...d,max:t};i(null==l.min&&null==l.max?void 0:l)},className:"w-full rounded-md border border-border bg-white px-2 py-1.5 text-xs tabular-nums focus:outline-none focus:border-brand-500"})]}),o&&(0,s.jsx)("p",{className:"text-[10px] text-muted",children:o})]})}function A(e){let{placeholder:t,options:l,selected:a,onChange:n}=e,i=(0,D.NT)();if(0===l.length)return(0,s.jsx)("p",{className:"text-xs text-muted py-1",children:i("common.noData")});let o=new Set(a),[d,u]=(0,r.useState)("");function x(e){let t=new Set(a);t.has(e)?t.delete(e):t.add(e),n([...t])}let m=l.length>6,h=d?l.filter(e=>e.value.toLowerCase().includes(d.toLowerCase())):l;return(0,s.jsxs)("div",{className:"space-y-1.5",children:[m&&(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(C.Z,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted"}),(0,s.jsx)("input",{value:d,onChange:e=>u(e.target.value),placeholder:t,className:"w-full rounded-md border border-border bg-white pl-7 pr-2 py-1.5 text-xs focus:outline-none focus:border-brand-500"})]}),a.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:a.map(e=>(0,s.jsxs)("button",{onClick:()=>x(e),className:"text-[11px] px-1.5 py-0.5 rounded bg-brand-500 text-white flex items-center gap-1 hover:bg-brand-600",children:[e," ",(0,s.jsx)(c.Z,{className:"h-2.5 w-2.5"})]},e))}),(0,s.jsx)("div",{className:"max-h-44 overflow-y-auto space-y-0.5 -mx-1 px-1",children:0===h.length?(0,s.jsx)("p",{className:"text-[11px] text-muted py-2 text-center",children:i("records.filter.noMatch")}):h.slice(0,200).map(e=>{let t=o.has(e.value);return(0,s.jsxs)("label",{className:(0,_.cn)("flex items-center gap-2 text-xs cursor-pointer rounded px-1.5 py-1 hover:bg-bg-soft",t&&"bg-brand-50"),children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>x(e.value),className:"accent-brand-500 h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"flex-1 truncate",title:e.value,children:e.value}),(0,s.jsx)("span",{className:"text-[10px] text-muted tabular-nums",children:e.count})]},e.value)})})]})}function L(e){let{values:t,options:l,counts:a,onChange:n,placeholder:i,subtitle:o}=e,d=(0,D.NT)(),[u,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(!1),p=(0,r.useRef)(null);function b(e){let l=e.trim();l&&(t.includes(l)||(n([...t,l]),x(""),h(!1)))}(0,r.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&h(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let g=u?l.filter(e=>e.toLowerCase().includes(u.toLowerCase())&&!t.includes(e)).slice(0,8):l.filter(e=>!t.includes(e)).slice(0,8);return(0,s.jsxs)("div",{className:"space-y-1.5",ref:p,children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(C.Z,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted"}),(0,s.jsx)("input",{value:u,onChange:e=>{x(e.target.value),h(!0)},onFocus:()=>h(!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),b(u)):"Escape"===e.key&&h(!1)},placeholder:i,className:"w-full rounded-md border border-border bg-white pl-7 pr-7 py-1.5 text-xs focus:outline-none focus:border-brand-500"}),u&&(0,s.jsx)("button",{onClick:()=>b(u),className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-brand-50 text-brand-600",title:d("records.filter.add"),children:(0,s.jsx)(S.Z,{className:"h-3 w-3"})}),m&&g.length>0&&(0,s.jsx)("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 rounded-md border border-border bg-white shadow-soft max-h-52 overflow-y-auto",children:g.map(e=>(0,s.jsxs)("button",{onClick:()=>b(e),className:"w-full text-left px-2 py-1 text-xs hover:bg-brand-50 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"flex-1 truncate",title:e,children:e}),null!=a[e]&&(0,s.jsx)("span",{className:"text-[10px] text-muted tabular-nums",children:a[e]})]},e))})]}),o&&(0,s.jsx)("p",{className:"text-[10px] text-muted",children:o}),t.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map((e,l)=>(0,s.jsxs)("button",{onClick:()=>n(t.filter((e,t)=>t!==l)),className:"text-[11px] px-1.5 py-0.5 rounded bg-brand-500 text-white flex items-center gap-1 hover:bg-brand-600",children:[e," ",(0,s.jsx)(c.Z,{className:"h-2.5 w-2.5"})]},l))})]})}function M(e){var t,l;let{value:r,onChange:a}=e,n=(0,D.NT)(),i=[{key:"TI",label:n("recordDetail.fields.TI")},{key:"AB",label:n("recordDetail.fields.AB")},{key:"DE",label:n("recordDetail.fields.DE")},{key:"ID",label:n("recordDetail.fields.ID")}],o=null!==(t=null==r?void 0:r.fields)&&void 0!==t?t:["TI","AB","DE","ID"],d=new Set(o);return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("input",{type:"text",value:null!==(l=null==r?void 0:r.query)&&void 0!==l?l:"",onChange:e=>{let t=e.target.value;a(t.trim()?{query:t,fields:o}:void 0)},placeholder:n("records.filter.fulltextPlaceholder"),className:"w-full rounded-md border border-border bg-white px-2 py-1.5 text-sm font-mono focus:outline-none focus:border-brand-500"}),(0,s.jsx)("p",{className:"text-[10px] text-muted",children:n("records.filter.fulltextHint")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 pt-1",children:i.map(e=>{let t=d.has(e.key);return(0,s.jsx)("button",{onClick:()=>{let t=new Set(o);t.has(e.key)?t.delete(e.key):t.add(e.key);let l=[...t];a((null==r?void 0:r.query)?{query:r.query,fields:l.length?l:void 0}:void 0)},className:(0,_.cn)("text-[10px] px-1.5 py-0.5 rounded border",t?"bg-brand-500 text-white border-brand-500":"bg-white border-border text-muted"),title:e.label,children:e.key},e.key)})})]})}function P(e){var t,l;let{value:r,onChange:a}=e,n=(0,D.NT)(),i=[{k:"DI",l:"DOI"},{k:"AB",l:n("recordDetail.fields.AB")},{k:"DE",l:n("recordDetail.fields.DE")},{k:"ID",l:n("recordDetail.fields.ID")},{k:"WC",l:n("recordDetail.fields.WC")},{k:"SC",l:n("recordDetail.fields.SC")},{k:"TC",l:n("recordDetail.fields.TC")}],o=new Set(null!==(t=null==r?void 0:r.missing)&&void 0!==t?t:[]),d=new Set(null!==(l=null==r?void 0:r.has)&&void 0!==l?l:[]);function c(e,t){let l=[...e],s=[...t];a(0===l.length&&0===s.length?void 0:{missing:l.length?l:void 0,has:s.length?s:void 0})}return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-[10px] text-muted mb-1",children:[n("records.filter.qualityHasLabel"),":"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:i.map(e=>{let t=d.has(e.k);return(0,s.jsx)("button",{onClick:()=>{let t=new Set(d);t.has(e.k)?t.delete(e.k):(t.add(e.k),o.delete(e.k)),c(o,t)},className:(0,_.cn)("text-[10px] px-1.5 py-0.5 rounded border tabular-nums",t?"bg-success text-white border-success":"bg-white border-border text-muted hover:border-success"),title:e.l,children:e.k},"h"+e.k)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-[10px] text-muted mb-1",children:[n("records.filter.qualityMissingLabel"),":"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:i.map(e=>{let t=o.has(e.k);return(0,s.jsx)("button",{onClick:()=>{let t=new Set(o);t.has(e.k)?t.delete(e.k):(t.add(e.k),d.delete(e.k)),c(t,d)},className:(0,_.cn)("text-[10px] px-1.5 py-0.5 rounded border tabular-nums",t?"bg-danger text-white border-danger":"bg-white border-border text-muted hover:border-danger"),title:e.l,children:e.k},"m"+e.k)})})]})]})}var q=l(2451),R=l(2135),F=l(4156),B=l(5675),O=l(8930),U=l(3003),V=l(2208),W=l(7769),H=l(1594),J=l(4525),Y=l(6732);function G(e,t){var l;let s="recordDetail.fields.".concat(t),r=e(s);return r!==s?r:null!==(l=({AB_LEN:e("records.columns.abLen"),AF_FULL:e("records.columns.afFull")})[t])&&void 0!==l?l:t}let K={TI:360,AU:220,SO:240,JI:180,PY:70,TC:70,DT:110,LA:90,DI:200,AB:480,DE:220,ID:220,C1:320,WC:220,SC:220,DB:80},Q=new Set(["TI","AU","SO","PY","TC","DT","LA"]),X=new Set(["UID"]);function $(e){var t;let{data:l,onPage:a,onRowClick:n,storageKey:i="bibex.records.table",selected:d,onSelectionChange:c,rowKey:u,onEditRow:x,onDeleteRow:m}=e,h=(0,D.NT)(),{total:p,offset:b,limit:g,columns:f,records:v}=l,j=Math.min(b+g,p),N=e=>u?u(e):e.UID||e.DI||e.UT||JSON.stringify(e).slice(0,80),y=!!c,C=!!(x||m),S=y||C,Z=null!=d?d:new Set,T=v.map(N),I=T.length>0&&T.every(e=>Z.has(e)),z=!I&&T.some(e=>Z.has(e));function E(){if(!c)return;let e=new Set(Z);I?T.forEach(t=>e.delete(t)):T.forEach(t=>e.add(t)),c(e)}let[A,L]=(0,r.useState)([]),[M,P]=(0,r.useState)(()=>{try{let e=localStorage.getItem("".concat(i,".visibility"));if(e){let t=JSON.parse(e);for(let e of X)t[e]=!1;return t}}catch(e){}let e={};for(let t of f)e[t]=!X.has(t)&&Q.has(t);return e}),[U,V]=(0,r.useState)(()=>{try{let e=localStorage.getItem("".concat(i,".sizing"));if(e)return JSON.parse(e)}catch(e){}return{}});(0,r.useEffect)(()=>{P(e=>{let t={...e},l=!1;for(let e of f)e in t||(t[e]=Q.has(e),l=!0);return l?t:e})},[f]),(0,r.useEffect)(()=>{try{localStorage.setItem("".concat(i,".visibility"),JSON.stringify(M))}catch(e){}},[M,i]),(0,r.useEffect)(()=>{try{localStorage.setItem("".concat(i,".sizing"),JSON.stringify(U))}catch(e){}},[U,i]);let W=(0,r.useMemo)(()=>f.map(e=>{var t;return{id:e,accessorKey:e,header:G(h,e),size:null!==(t=K[e])&&void 0!==t?t:140,minSize:60,maxSize:800,cell:t=>{let l=t.getValue();return null==l||""===l?(0,s.jsx)("span",{className:"text-slate-300",children:"—"}):"PY"===e||"TC"===e||"NR"===e?(0,s.jsx)("span",{className:"font-mono tabular-nums",children:l}):"DI"===e?(0,s.jsx)("a",{href:"https://doi.org/".concat(l),target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),className:"text-brand-600 hover:underline truncate block",children:l}):(0,s.jsx)("span",{className:"truncate block",title:l,children:l})}}}),[f]),$=(0,H.b7)({data:v,columns:W,state:{sorting:A,columnVisibility:M,columnSizing:U},onSortingChange:L,onColumnVisibilityChange:P,onColumnSizingChange:V,getCoreRowModel:(0,J.sC)(),getSortedRowModel:(0,J.tj)(),columnResizeMode:"onChange",enableColumnResizing:!0}),es=(0,r.useRef)(null),er=$.getRowModel().rows,ea=(0,Y.MG)({count:er.length,getScrollElement:()=>es.current,estimateSize:()=>36,overscan:8}),en=Math.max(1,Math.ceil(p/g)),ei=Math.floor(b/g)+1,[eo,ed]=(0,r.useState)(!1),ec=Object.values(M).filter(e=>e).length||f.length;return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-sm text-muted",children:[(0,s.jsxs)("span",{className:"text-ink font-semibold",children:[(0===p?0:b+1).toLocaleString(),"–",j.toLocaleString()]})," ","/ ",p.toLocaleString()," ",h("common.records")]}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,s.jsx)(ee,{table:$,cols:f,open:eo,setOpen:ed,visibleCount:ec,totalCount:f.length}),(0,s.jsx)("div",{className:"h-5 w-px bg-border mx-1"}),(0,s.jsx)(o.z,{size:"sm",variant:"secondary",disabled:1===ei,onClick:()=>a(0),title:h("records.firstPage"),children:(0,s.jsx)(et,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(o.z,{size:"sm",variant:"secondary",disabled:1===ei,onClick:()=>a(Math.max(0,b-g)),children:(0,s.jsx)(q.Z,{className:"h-3.5 w-3.5"})}),(0,s.jsxs)("span",{className:"text-xs text-muted px-2 tabular-nums",children:[ei," / ",en]}),(0,s.jsx)(o.z,{size:"sm",variant:"secondary",disabled:j>=p,onClick:()=>a(b+g),children:(0,s.jsx)(k.Z,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(o.z,{size:"sm",variant:"secondary",disabled:j>=p,onClick:()=>a((en-1)*g),title:h("records.lastPage"),children:(0,s.jsx)(el,{className:"h-3.5 w-3.5"})})]})]}),(0,s.jsx)("div",{className:"rounded-xl border border-border bg-bg-card shadow-card overflow-hidden",children:(0,s.jsx)("div",{ref:es,className:"overflow-auto",style:{height:Math.min(640,Math.max(280,36*er.length+44))},children:(0,s.jsxs)("table",{className:"text-xs border-separate border-spacing-0",style:{width:$.getTotalSize(),tableLayout:"fixed"},children:[(0,s.jsx)("thead",{className:"sticky top-0 z-20",children:$.getHeaderGroups().map(e=>(0,s.jsxs)("tr",{children:[S&&(0,s.jsx)("th",{style:{width:C?96:36},className:"sticky left-0 z-30 bg-bg-soft border-b border-border px-2 py-2.5 text-center",children:y&&(0,s.jsx)("input",{type:"checkbox",checked:I,ref:e=>{e&&(e.indeterminate=z)},onChange:E,className:"accent-brand-500 h-3.5 w-3.5",title:I?h("records.unselectPage"):h("records.selectAllInPage")})}),e.headers.map(e=>{let t=e.column.getCanSort(),l=e.column.getIsSorted();return(0,s.jsxs)("th",{style:{width:e.getSize()},className:"relative bg-bg-soft border-b border-border text-left px-3 py-2.5 font-semibold text-[11px] uppercase tracking-wide text-muted select-none group",children:[(0,s.jsxs)("div",{onClick:t?e.column.getToggleSortingHandler():void 0,className:(0,_.cn)("flex items-center gap-1.5 truncate",t&&"cursor-pointer hover:text-ink"),children:[(0,s.jsx)("span",{className:"truncate",children:(0,H.ie)(e.column.columnDef.header,e.getContext())}),t&&(0,s.jsx)("span",{className:"flex-shrink-0 opacity-60",children:"asc"===l?(0,s.jsx)(R.Z,{className:"h-3 w-3"}):"desc"===l?(0,s.jsx)(w.Z,{className:"h-3 w-3"}):(0,s.jsx)(F.Z,{className:"h-3 w-3"})})]}),e.column.getCanResize()&&(0,s.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:(0,_.cn)("absolute right-0 top-0 h-full w-1.5 cursor-col-resize select-none touch-none","bg-transparent hover:bg-brand-500/40 active:bg-brand-500",e.column.getIsResizing()&&"bg-brand-500")})]},e.id)})]},e.id))}),(0,s.jsx)("tbody",{children:0===er.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:$.getVisibleFlatColumns().length+(S?1:0),className:"text-center py-12 text-muted",children:h("records.noResults")})}):(0,s.jsxs)(s.Fragment,{children:[(null===(t=ea.getVirtualItems()[0])||void 0===t?void 0:t.start)>0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:$.getVisibleFlatColumns().length+(S?1:0),style:{height:ea.getVirtualItems()[0].start,padding:0,border:0}})}),ea.getVirtualItems().map(e=>{let t=er[e.index],l=y&&Z.has(N(t.original));return(0,s.jsxs)("tr",{className:(0,_.cn)("group cursor-pointer transition",l?"bg-brand-50/80":e.index%2==0?"bg-bg-card":"bg-bg-soft/40",l?"hover:bg-brand-100/80":"hover:bg-brand-50/60"),onClick:e=>{e.target.closest("[data-no-row-click]")||null==n||n(t.original)},children:[S&&(0,s.jsx)("td",{"data-no-row-click":!0,style:{width:C?96:36},className:(0,_.cn)("sticky left-0 z-10 border-b border-border/60 px-2 py-2",l?"bg-brand-50/80":e.index%2==0?"bg-bg-card":"bg-bg-soft/40"),onClick:e=>e.stopPropagation(),children:(0,s.jsxs)("div",{className:"flex items-center justify-center gap-1",children:[y&&(0,s.jsx)("input",{type:"checkbox",checked:l,onChange:()=>(function(e){if(!c)return;let t=new Set(Z),l=N(e);t.has(l)?t.delete(l):t.add(l),c(t)})(t.original),className:"accent-brand-500 h-3.5 w-3.5"}),x&&(0,s.jsx)("button",{onClick:()=>x(t.original),className:"text-muted hover:text-brand-600 p-0.5 rounded",title:h("records.editRow"),children:(0,s.jsx)(B.Z,{className:"h-3.5 w-3.5"})}),m&&(0,s.jsx)("button",{onClick:()=>m(t.original),className:"text-muted hover:text-danger p-0.5 rounded",title:h("records.deleteRow"),children:(0,s.jsx)(O.Z,{className:"h-3.5 w-3.5"})})]})}),t.getVisibleCells().map(e=>(0,s.jsx)("td",{style:{width:e.column.getSize()},className:"border-b border-border/60 px-3 py-2 align-top text-ink overflow-hidden",children:(0,s.jsx)("div",{className:"truncate",children:(0,H.ie)(e.column.columnDef.cell,e.getContext())})},e.id))]},t.id)}),(()=>{let e=ea.getVirtualItems();if(0===e.length)return null;let t=e[e.length-1],l=ea.getTotalSize()-t.end;return l<=0?null:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:$.getVisibleFlatColumns().length+(S?1:0),style:{height:l,padding:0,border:0}})})})()]})})]})})}),(0,s.jsx)("p",{className:"text-[11px] text-muted",children:h("records.tableHint")})]})}function ee(e){let{table:t,cols:l,open:a,setOpen:n,visibleCount:i,totalCount:d}=e,c=(0,D.NT)(),u=(0,r.useRef)(null),[x,m]=(0,r.useState)("");(0,r.useEffect)(()=>{if(a)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){u.current&&!u.current.contains(e.target)&&n(!1)}},[a,n]);let h=l.filter(e=>{if(X.has(e))return!1;if(!x)return!0;let t=x.toLowerCase();return e.toLowerCase().includes(t)||G(c,e).toLowerCase().includes(t)});return(0,s.jsxs)("div",{className:"relative",ref:u,children:[(0,s.jsxs)(o.z,{size:"sm",variant:"secondary",onClick:()=>n(!a),title:c("records.columns.configure"),children:[(0,s.jsx)(U.Z,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"hidden md:inline",children:c("records.columns.short")}),(0,s.jsxs)("span",{className:"text-[10px] text-muted ml-1",children:[i,"/",d]})]}),a&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1.5 w-72 rounded-lg border border-border bg-white shadow-soft z-50 overflow-hidden",children:[(0,s.jsx)("div",{className:"p-2 border-b border-border",children:(0,s.jsx)("input",{autoFocus:!0,value:x,onChange:e=>m(e.target.value),placeholder:c("records.columns.searchPlaceholder"),className:"w-full rounded-md border border-border bg-bg-soft px-2 py-1.5 text-sm focus:outline-none focus:border-brand-500"})}),(0,s.jsxs)("div",{className:"px-2 py-1.5 flex items-center gap-2 border-b border-border text-xs",children:[(0,s.jsx)("button",{onClick:()=>t.toggleAllColumnsVisible(!0),className:"text-brand-600 hover:underline",children:c("records.columns.all")}),(0,s.jsx)("span",{className:"text-border",children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>{t.getAllLeafColumns().forEach(e=>{e.toggleVisibility(Q.has(e.id))})},className:"text-brand-600 hover:underline",children:c("records.columns.defaults")}),(0,s.jsx)("span",{className:"text-border",children:"\xb7"}),(0,s.jsx)("button",{onClick:()=>t.toggleAllColumnsVisible(!1),className:"text-brand-600 hover:underline",children:c("records.columns.none")})]}),(0,s.jsx)("div",{className:"max-h-72 overflow-y-auto py-1",children:0===h.length?(0,s.jsx)("p",{className:"text-xs text-muted px-3 py-3 text-center",children:c("records.columns.noMatch")}):h.map(e=>{let l=t.getColumn(e);if(!l)return null;let r=l.getIsVisible();return(0,s.jsxs)("button",{onClick:()=>l.toggleVisibility(),className:"w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-bg-soft",children:[r?(0,s.jsx)(V.Z,{className:"h-3.5 w-3.5 text-brand-500"}):(0,s.jsx)(W.Z,{className:"h-3.5 w-3.5 text-muted"}),(0,s.jsx)("span",{className:(0,_.cn)("font-mono text-xs w-12 flex-shrink-0",r?"text-ink":"text-muted"),children:e}),(0,s.jsx)("span",{className:(0,_.cn)("truncate",r?"text-ink":"text-muted"),children:G(c,e)})]},e)})})]})]})}function et(e){let{className:t}=e;return(0,s.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("polyline",{points:"11 17 6 12 11 7"}),(0,s.jsx)("polyline",{points:"18 17 13 12 18 7"})]})}function el(e){let{className:t}=e;return(0,s.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("polyline",{points:"13 17 18 12 13 7"}),(0,s.jsx)("polyline",{points:"6 17 11 12 6 7"})]})}var es=l(1769),er=l(5805),ea=l(8736),en=l(6362),ei=l(1817),eo=l(3229),ed=l(8420),ec=l(401),eu=l(8867),ex=l(5499);function em(e){let{record:t,projectId:l,onClose:a,onSaved:i,startEditing:o=!1}=e,d=(0,D.NT)(),u=(0,ex.p)(),m=(0,r.useMemo)(()=>[{title:d("recordDetail.groups.citation"),icon:(0,s.jsx)(es.Z,{className:"h-4 w-4"}),fields:[{key:"TI",label:d("recordDetail.fields.TI"),format:"wrap"},{key:"SO",label:d("recordDetail.fields.SO"),format:"wrap"},{key:"JI",label:d("recordDetail.fields.JI"),format:"compact"},{key:"PY",label:d("recordDetail.fields.PY")},{key:"VL",label:d("recordDetail.fields.VL")},{key:"IS",label:d("recordDetail.fields.IS")},{key:"BP",label:d("recordDetail.fields.BP")},{key:"EP",label:d("recordDetail.fields.EP")},{key:"PG",label:d("recordDetail.fields.PG")},{key:"DT",label:d("recordDetail.fields.DT")},{key:"LA",label:d("recordDetail.fields.LA")},{key:"DI",label:d("recordDetail.fields.DI"),format:"doi"},{key:"UT",label:d("recordDetail.fields.UT"),format:"compact"},{key:"PM",label:d("recordDetail.fields.PM"),format:"compact"},{key:"PU",label:d("recordDetail.fields.PU")},{key:"DB",label:d("recordDetail.fields.DB")}]},{title:d("recordDetail.groups.authors"),icon:(0,s.jsx)(er.Z,{className:"h-4 w-4"}),fields:[{key:"AU",label:d("recordDetail.fields.AU"),format:"wrap"},{key:"AF",label:d("recordDetail.fields.AF"),format:"wrap"},{key:"C1",label:d("recordDetail.fields.C1"),format:"list"},{key:"RP",label:d("recordDetail.fields.RP"),format:"wrap"},{key:"EM",label:d("recordDetail.fields.EM"),format:"wrap"},{key:"OI",label:d("recordDetail.fields.OI"),format:"list"},{key:"RI",label:d("recordDetail.fields.RI"),format:"list"}]},{title:d("recordDetail.groups.categories"),icon:(0,s.jsx)(f.Z,{className:"h-4 w-4"}),fields:[{key:"DE",label:d("recordDetail.fields.DE"),format:"list"},{key:"ID",label:d("recordDetail.fields.ID"),format:"list"},{key:"WC",label:d("recordDetail.fields.WC"),format:"list"},{key:"SC",label:d("recordDetail.fields.SC"),format:"list"}]},{title:d("recordDetail.groups.citations"),icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),fields:[{key:"TC",label:d("recordDetail.fields.TC")},{key:"Z9",label:d("recordDetail.fields.Z9")},{key:"U1",label:d("recordDetail.fields.U1")},{key:"U2",label:d("recordDetail.fields.U2")},{key:"NR",label:d("recordDetail.fields.NR")},{key:"CR",label:d("recordDetail.fields.CR"),format:"long"}]},{title:d("recordDetail.groups.abstract"),icon:(0,s.jsx)(ea.Z,{className:"h-4 w-4"}),fields:[{key:"AB",label:d("recordDetail.fields.AB"),format:"long"}]}],[d]),[h,p]=(0,r.useState)(!1),[b,g]=(0,r.useState)(!1),[v,j]=(0,r.useState)({}),[N,y]=(0,r.useState)(!1),[w,k]=(0,r.useState)({}),[C,S]=(0,r.useState)(t);t!==C&&(S(t),k({}));let Z=(0,r.useRef)(a);if(Z.current=a,(0,r.useEffect)(()=>{if(!t){p(!1);return}requestAnimationFrame(()=>p(!0));let e=e=>{"Escape"===e.key&&Z.current()};return document.addEventListener("keydown",e),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=""}},[t]),(0,r.useEffect)(()=>{if(t){if(o){let e={};for(let l of Object.keys(t))e[l]=null==t[l]?"":String(t[l]);j(e),g(!0)}else g(!1)}},[t,o]),!t)return null;let T={...t,...w};async function I(){y(!0);try{let e={};for(let t of Object.keys(v)){let l=null==T[t]?"":String(T[t]);v[t]!==l&&(e[t]=v[t])}if(0===Object.keys(e).length){g(!1);return}await n.hi.updateRecord(l,{uid:T.UID||void 0,doi:T.DI||void 0,fields:e}),u(d("recordDetail.saved",{n:Object.keys(e).length}),{tone:"success"}),k(t=>({...t,...e})),g(!1),null==i||i()}catch(e){u((0,n.NS)(d,e,"recordDetail.saveFailed"),{tone:"danger"})}finally{y(!1)}}let z=T.TI||"(".concat(d("recordDetail.noTitle"),")"),E=T.AU||T.AF||"",A=T.PY||"",L=T.SO||T.JI||"",M=T.DI||"",P=m.map(e=>({...e,fields:e.fields.filter(e=>{let t=T[e.key];return null!=t&&""!==t})})).filter(e=>e.fields.length>0),q=new Set(m.flatMap(e=>e.fields.map(e=>e.key))),R=Object.keys(T).filter(e=>!q.has(e)&&null!=T[e]&&""!==T[e]).sort();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{onClick:a,className:(0,_.cn)("fixed inset-0 bg-ink/30 backdrop-blur-sm z-40 transition-opacity",h?"opacity-100":"opacity-0")}),(0,s.jsxs)("div",{className:(0,_.cn)("fixed top-0 right-0 h-full w-full max-w-2xl bg-white shadow-2xl z-50 flex flex-col","transition-transform duration-200 ease-out",h?"translate-x-0":"translate-x-full"),children:[(0,s.jsxs)("div",{className:"px-5 py-4 border-b border-border flex items-start gap-3",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[11px] font-medium text-muted uppercase tracking-wide mb-1.5",children:[(0,s.jsx)("span",{children:d("recordDetail.title")}),T.DB&&(0,s.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-brand-50 text-brand-700",children:T.DB}),A&&(0,s.jsxs)("span",{children:["\xb7 ",A]})]}),(0,s.jsx)("h2",{className:"font-semibold text-base leading-snug text-ink",children:z}),E&&(0,s.jsx)("p",{className:"text-xs text-muted mt-1 line-clamp-2",children:E}),L&&(0,s.jsx)("p",{className:"text-xs text-muted italic mt-0.5",children:L}),M&&!b&&(0,s.jsxs)("a",{href:"https://doi.org/".concat(M),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-brand-600 hover:underline mt-1.5 font-mono",children:[M,(0,s.jsx)(en.Z,{className:"h-3 w-3"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[b?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:I,disabled:N,className:"inline-flex items-center gap-1.5 text-xs font-semibold px-3 py-1.5 rounded-md bg-brand-500 hover:bg-brand-600 text-white disabled:opacity-50",children:[N?(0,s.jsx)(ei.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(eo.Z,{className:"h-3.5 w-3.5"}),d("recordDetail.save")]}),(0,s.jsx)("button",{onClick:()=>g(!1),disabled:N,className:"text-xs px-2.5 py-1.5 rounded-md text-muted hover:text-ink hover:bg-bg-soft",children:d("common.cancel")})]}):(0,s.jsxs)("button",{onClick:function(){let e={};for(let t of Object.keys(T))e[t]=null==T[t]?"":String(T[t]);j(e),g(!0)},className:"inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-md border border-border text-muted hover:text-brand-700 hover:border-brand-400",children:[(0,s.jsx)(B.Z,{className:"h-3.5 w-3.5"})," ",d("recordDetail.edit")]}),(0,s.jsx)("button",{onClick:a,className:"p-1.5 rounded-md hover:bg-bg-soft text-muted hover:text-ink",title:"".concat(d("common.close")," (Esc)"),children:(0,s.jsx)(c.Z,{className:"h-5 w-5"})})]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:b?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-[11px] text-muted",children:d("recordDetail.editHint")}),m.map(e=>(0,s.jsxs)("section",{children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted mb-2",children:[(0,s.jsx)("span",{className:"text-brand-500",children:e.icon}),e.title]}),(0,s.jsx)("div",{className:"space-y-2",children:e.fields.map(e=>{var t;return(0,s.jsx)(eh,{k:e.key,label:e.label,format:e.format,value:null!==(t=v[e.key])&&void 0!==t?t:"",onChange:t=>j(l=>({...l,[e.key]:t}))},e.key)})})]},e.title)),R.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted mb-2",children:[(0,s.jsx)(ed.Z,{className:"h-4 w-4 text-brand-500"}),d("recordDetail.otherFields")]}),(0,s.jsx)("div",{className:"space-y-2",children:R.map(e=>{var t;return(0,s.jsx)(eh,{k:e,label:e,format:"compact",value:null!==(t=v[e])&&void 0!==t?t:"",onChange:t=>j(l=>({...l,[e]:t}))},e)})})]})]}):(0,s.jsxs)(s.Fragment,{children:[P.map(e=>(0,s.jsxs)("section",{children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted mb-2",children:[(0,s.jsx)("span",{className:"text-brand-500",children:e.icon}),e.title]}),(0,s.jsx)("dl",{className:"space-y-1.5",children:e.fields.map(e=>(0,s.jsx)(ep,{k:e.key,label:e.label,value:T[e.key],format:e.format},e.key))})]},e.title)),R.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted mb-2",children:[(0,s.jsx)(ed.Z,{className:"h-4 w-4 text-brand-500"}),d("recordDetail.otherFields")]}),(0,s.jsx)("dl",{className:"space-y-1.5",children:R.map(e=>(0,s.jsx)(ep,{k:e,label:e,value:T[e],format:"compact"},e))})]})]})})]})]})}function eh(e){let{k:t,label:l,value:r,format:a="compact",onChange:n}=e;return(0,s.jsxs)("div",{className:"grid grid-cols-[120px_1fr] gap-2 items-start text-xs",children:[(0,s.jsxs)("label",{className:"text-muted font-medium pt-1.5 truncate",title:"".concat(l," (").concat(t,")"),children:[l,(0,s.jsx)("span",{className:"ml-1 text-[10px] font-mono opacity-60",children:t})]}),"long"===a||"wrap"===a||"list"===a?(0,s.jsx)("textarea",{value:r,onChange:e=>n(e.target.value),rows:"long"===a?4:2,className:"w-full rounded-md border border-border bg-white px-2 py-1 text-[12px] text-ink focus:outline-none focus:border-brand-500"}):(0,s.jsx)("input",{value:r,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-border bg-white px-2 py-1 text-[12px] text-ink focus:outline-none focus:border-brand-500"})]})}function ep(e){let{k:t,label:l,value:a,format:n="compact"}=e,i=(0,D.NT)(),[o,d]=(0,r.useState)(!1);async function c(){try{await navigator.clipboard.writeText(a),d(!0),setTimeout(()=>d(!1),1200)}catch(e){}}let u="list"===n?a.split(/[;|]\s*/).map(e=>e.trim()).filter(Boolean):null;return(0,s.jsxs)("div",{className:"grid grid-cols-[120px_1fr_auto] gap-2 items-start group text-xs",children:[(0,s.jsxs)("dt",{className:"text-muted font-medium pt-0.5 truncate",title:"".concat(l," (").concat(t,")"),children:[(0,s.jsx)("span",{children:l}),(0,s.jsx)("span",{className:"ml-1 text-[10px] font-mono opacity-60",children:t})]}),(0,s.jsx)("dd",{className:"min-w-0",children:"doi"===n?(0,s.jsx)("a",{href:"https://doi.org/".concat(a),target:"_blank",rel:"noreferrer",className:"text-brand-600 hover:underline font-mono break-all",children:a}):"list"===n&&u?(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[u.slice(0,30).map((e,t)=>(0,s.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-soft border border-border text-[11px]",children:e},t)),u.length>30&&(0,s.jsxs)("span",{className:"text-[11px] text-muted",children:["+",u.length-30]})]}):"long"===n?(0,s.jsx)("p",{className:"text-ink whitespace-pre-wrap leading-relaxed text-[12px] max-h-56 overflow-y-auto pr-2",children:a}):"wrap"===n?(0,s.jsx)("p",{className:"text-ink break-words",children:a}):(0,s.jsx)("p",{className:"text-ink truncate",title:a,children:a})}),(0,s.jsx)("button",{onClick:c,className:"opacity-0 group-hover:opacity-100 transition p-1 rounded hover:bg-bg-soft text-muted",title:i("common.copy"),children:o?(0,s.jsx)(ec.Z,{className:"h-3 w-3 text-success"}):(0,s.jsx)(eu.Z,{className:"h-3 w-3"})})]})}var eb=l(6865);function eg(e){let{projectId:t,selected:l,onClear:a,onChanged:i}=e,d=(0,D.NT)(),u=(0,ex.p)(),x=l.size,[m,h]=(0,r.useState)(null),[p,b]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),[v,j]=(0,r.useState)(null);if(0===x)return null;async function N(){f(!0),j(null);try{let{uids:e,dois:s}=function(){let e=[],t=[];for(let s of l)s.startsWith("r_")&&s.length<20?e.push(s):/^10\./.test(s)?t.push(s):e.push(s);return{uids:e,dois:t}}();if(0===e.length&&0===s.length){j(d("bulk.noSelected"));return}let r=await n.hi.deleteRecords(t,{uids:e,dois:s,reason:p||void 0});u(d("bulk.deletedToast",{deleted:r.deleted,kept:r.kept})+(r.snapshot?"\n".concat(d("disambiguate.snapshot"),": ").concat(r.snapshot):""),{tone:"success"}),a(),h(null),b(""),i()}catch(e){j((0,n.NS)(d,e,"bulk.deleteFailed"))}finally{f(!1)}}return(0,s.jsxs)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-30",children:[(0,s.jsxs)("div",{className:(0,_.cn)("rounded-2xl bg-ink text-white shadow-2xl border border-ink-soft px-4 py-3","flex items-center gap-3 backdrop-blur-md min-w-[420px] max-w-[680px]"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-8 h-8 rounded-lg bg-brand-500 flex items-center justify-center font-bold text-sm tabular-nums",children:x}),(0,s.jsx)("span",{className:"text-sm font-medium",children:d("bulk.recordsSelected")})]}),(0,s.jsx)("div",{className:"h-6 w-px bg-white/20"}),null===m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.z,{size:"sm",variant:"secondary",onClick:()=>h("delete"),className:"bg-danger/30 hover:bg-danger/50 text-white border-0",children:[(0,s.jsx)(O.Z,{className:"h-3.5 w-3.5"}),d("common.delete")]}),(0,s.jsxs)("button",{onClick:a,className:"ml-auto text-xs text-white/60 hover:text-white flex items-center gap-1",children:[(0,s.jsx)(c.Z,{className:"h-3 w-3"})," ",d("bulk.clearSelection")]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,s.jsx)(eb.Z,{className:"h-4 w-4 text-warning flex-shrink-0"}),(0,s.jsx)("input",{value:p,onChange:e=>b(e.target.value),placeholder:d("bulk.reasonPlaceholder"),className:"flex-1 bg-white/10 border border-white/20 rounded px-2 py-1 text-xs text-white placeholder:text-white/40 focus:outline-none focus:border-brand-400"})]}),(0,s.jsx)(o.z,{size:"sm",variant:"secondary",onClick:()=>h(null),disabled:g,className:"bg-white/10 text-white border-0",children:d("common.cancel")}),(0,s.jsxs)(o.z,{size:"sm",onClick:N,disabled:g,className:"bg-danger hover:bg-danger/80 text-white",children:[g?(0,s.jsx)(ei.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(O.Z,{className:"h-3.5 w-3.5"}),d("common.delete")," (",x,")"]})]})]}),v&&(0,s.jsx)("div",{className:"mt-2 rounded-lg border border-danger bg-danger/90 text-white px-3 py-2 text-xs text-center",children:v})]})}var ef=l(470),ev=l(7168),ej=l(933),eN=l(5554),ey=l(1548),ew=l(7090);function ek(e){let{projectId:t,onApplied:l}=e,a=(0,D.NT)(),d=(0,ex.N)(),c=(0,ex.p)(),[u,x]=(0,r.useState)([]),[m,h]=(0,r.useState)({}),[p,b]=(0,r.useState)(!0),[g,f]=(0,r.useState)(!1),[v,j]=(0,r.useState)(null),[N,y]=(0,r.useState)(.88),[C,S]=(0,r.useState)("pending"),[Z,T]=(0,r.useState)(!1),I=(0,r.useCallback)(async()=>{b(!0),j(null);try{let e=await n.hi.listBorderline(t);x(e),h({})}catch(e){j((0,n.NS)(a,e,"borderline.loadFailed"))}finally{b(!1)}},[t]);(0,r.useEffect)(()=>{I()},[I]);let z=(0,r.useMemo)(()=>"pending"===C?u.filter(e=>"pending"===e.status):u,[u,C]),E=(0,r.useMemo)(()=>({pending:u.filter(e=>"pending"===e.status).length,accept:u.filter(e=>"accept"===e.status).length,reject:u.filter(e=>"reject"===e.status).length,skip:u.filter(e=>"skip"===e.status).length,decided:Object.keys(m).length}),[u,m]),A=(0,r.useMemo)(()=>z.filter(e=>"pending"===e.status),[z]),L=A.length>0&&A.every(e=>"accept"===m[e.pair_id]);async function M(){if(0===E.decided)return;let e=Object.values(m).filter(e=>"accept"===e).length,s=Object.values(m).filter(e=>"reject"===e).length,r=Object.values(m).filter(e=>"skip"===e).length;if(await d({message:"".concat(e," ").concat(a("borderline.accepted"),", ").concat(s," ").concat(a("borderline.rejected"),", ").concat(r," ").concat(a("borderline.skip"),"."),detail:a("borderline.bulkConfirm")})){f(!0),j(null);try{let e=Object.entries(m).map(e=>{let[t,l]=e;return{pair_id:t,decision:l}}),s=await n.hi.decideBorderline(t,e);c(a("borderline.appliedToast",{applied:s.applied,pending:s.pending_after})+(s.snapshot?"\n".concat(a("disambiguate.snapshot"),": ").concat(s.snapshot):""),{tone:"success"}),await I(),null==l||l()}catch(e){j((0,n.NS)(a,e,"borderline.applyFailed"))}finally{f(!1)}}}return p||0===u.length?null:(0,s.jsxs)(i.Zb,{children:[(0,s.jsxs)(i.Ol,{children:[(0,s.jsxs)("button",{onClick:()=>T(e=>!e),className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-expanded":Z,children:[Z?(0,s.jsx)(w.Z,{className:"h-4 w-4 text-white/70 flex-shrink-0"}):(0,s.jsx)(k.Z,{className:"h-4 w-4 text-white/70 flex-shrink-0"}),(0,s.jsx)(eb.Z,{className:"h-4 w-4 text-warning flex-shrink-0"}),(0,s.jsx)("span",{className:"font-semibold text-sm truncate",children:a("borderline.title")}),E.pending>0&&(0,s.jsx)("span",{className:"flex-shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-warning-soft text-amber-700",children:E.pending})]}),Z?(0,s.jsxs)("button",{onClick:I,className:"text-xs text-white/70 hover:text-white flex items-center gap-1 flex-shrink-0",title:a("borderline.refresh"),children:[(0,s.jsx)(ev.Z,{className:"h-3 w-3"})," ",a("borderline.refresh")]}):(0,s.jsx)("span",{className:"text-xs text-white/70 flex-shrink-0",children:a("borderline.reviewToggle")})]}),Z&&(0,s.jsxs)(i.eW,{className:"space-y-3",children:[v&&(0,s.jsx)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-3 py-2 text-xs text-red-700",children:v}),(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-bg-soft/40 p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs",children:[(0,s.jsxs)("span",{className:"font-medium text-ink",children:[E.pending," ",a("borderline.pending")]}),(0,s.jsx)("span",{className:"text-muted",children:"\xb7"}),(0,s.jsxs)("span",{className:"text-success",children:[E.accept," ",a("borderline.accepted")]}),(0,s.jsx)("span",{className:"text-muted",children:"\xb7"}),(0,s.jsxs)("span",{className:"text-danger",children:[E.reject," ",a("borderline.rejected")]}),(0,s.jsx)("span",{className:"text-muted",children:"\xb7"}),(0,s.jsxs)("span",{className:"text-muted",children:[E.skip," ",a("borderline.skip")]}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>S("pending"),className:(0,_.cn)("text-[10px] px-2 py-0.5 rounded border","pending"===C?"bg-brand-500 text-white border-brand-500":"bg-white text-muted border-border"),children:a("borderline.filterPending")}),(0,s.jsxs)("button",{onClick:()=>S("all"),className:(0,_.cn)("text-[10px] px-2 py-0.5 rounded border","all"===C?"bg-brand-500 text-white border-brand-500":"bg-white text-muted border-border"),children:[a("borderline.filterAll")," (",u.length,")"]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-muted",children:["JW ≥",(0,s.jsx)(ew.Y,{text:a("help.jw")}),(0,s.jsx)("input",{type:"number",step:.01,min:.8,max:.92,value:N,onChange:e=>y(parseFloat(e.target.value)||.88),className:"w-20 rounded border border-border bg-white px-2 py-0.5 text-xs tabular-nums"})]}),(0,s.jsxs)("button",{onClick:function(){let e={...m};for(let t of u)"pending"===t.status&&t.jw_title>=N&&(e[t.pair_id]="accept");h(e)},className:"text-xs px-2 py-0.5 rounded border border-success/40 bg-success-soft text-emerald-700 hover:bg-success-soft/80 flex items-center gap-1",children:[(0,s.jsx)(ej.Z,{className:"h-3 w-3"})," ",a("borderline.bulkMark")]}),(0,s.jsxs)("button",{onClick:function(){h(e=>{let t={...e};for(let e of A)L?delete t[e.pair_id]:t[e.pair_id]="accept";return t})},disabled:0===A.length,title:a("borderline.selectAllHint"),className:"text-xs px-2 py-0.5 rounded border border-brand-300 bg-brand-50 text-brand-700 hover:bg-brand-100 flex items-center gap-1 disabled:opacity-50",children:[(0,s.jsx)(eN.Z,{className:"h-3 w-3"}),L?a("borderline.clearVisible"):a("borderline.selectAllVisible")]}),(0,s.jsxs)(o.z,{size:"sm",onClick:M,disabled:g||0===E.decided,className:"ml-auto bg-success hover:bg-success/90",children:[g?(0,s.jsx)(ei.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(ec.Z,{className:"h-3.5 w-3.5"}),a("borderline.applySelection")," (",E.decided,")"]})]})]}),0===z.length&&(0,s.jsx)("div",{className:"text-center py-12 text-muted text-sm",children:0===E.pending?a("borderline.noBorderline"):a("borderline.noFilterMatch")}),(0,s.jsx)("div",{className:"space-y-2",children:z.map(e=>(0,s.jsx)(eC,{pair:e,decision:m[e.pair_id],onDecision:t=>{var l;return l=e.pair_id,void h(e=>{let s={...e};return s[l]===t?delete s[l]:s[l]=t,s})}},e.pair_id))})]})]})}function eC(e){let{pair:t,decision:l,onDecision:r}=e,a=(0,D.NT)(),n=t.jw_title>=.88?"bg-success-soft text-emerald-700 border-success/40":t.jw_title>=.82?"bg-warning-soft text-amber-700 border-warning/40":"bg-danger-soft text-red-700 border-danger/40";return(0,s.jsxs)("div",{className:(0,_.cn)("rounded-lg border bg-white p-3 transition","accept"===l?"border-success ring-2 ring-success/30":"reject"===l?"border-danger ring-2 ring-danger/30":"skip"===l?"border-muted ring-2 ring-muted/30":"border-border"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2 text-xs flex-wrap",children:[(0,s.jsx)("span",{className:"font-mono text-[10px] bg-bg-soft px-1.5 py-0.5 rounded text-muted",children:t.pair_id}),(0,s.jsxs)("span",{className:(0,_.cn)("text-[10px] font-bold px-1.5 py-0.5 rounded border",n),children:["JW ",t.jw_title.toFixed(3)]}),(0,s.jsxs)("span",{className:"text-[10px] text-muted",children:[a("borderline.confShort")," ",t.confidence.toFixed(2)]}),(0,s.jsx)("span",{className:"text-[10px] text-muted truncate flex-1",title:t.reason,children:t.reason}),t.llm_suggestion&&(0,s.jsxs)("span",{className:(0,_.cn)("text-[10px] font-bold px-1.5 py-0.5 rounded flex items-center gap-1","same"===t.llm_suggestion.verdict?"bg-success-soft text-emerald-700":"different"===t.llm_suggestion.verdict?"bg-danger-soft text-red-700":"bg-bg-soft text-muted"),children:[(0,s.jsx)(y.Z,{className:"h-2.5 w-2.5"}),"LLM: ",t.llm_suggestion.verdict.toUpperCase()," (",(100*t.llm_suggestion.confidence).toFixed(0),"%)"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[(0,s.jsx)(eS,{label:"WoS",record:t.wos,compare:t.scopus}),(0,s.jsx)(eS,{label:"Scopus",record:t.scopus,compare:t.wos})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(o.z,{size:"sm",onClick:()=>r("accept"),className:(0,_.cn)("flex-1 justify-center","accept"===l?"bg-success hover:bg-success/90 text-white":"bg-white border border-success/40 text-emerald-700 hover:bg-success-soft"),children:[(0,s.jsx)(ec.Z,{className:"h-3.5 w-3.5"}),a("accept"===l?"borderline.acceptAccepted":"borderline.accept")]}),(0,s.jsxs)(o.z,{size:"sm",onClick:()=>r("reject"),className:(0,_.cn)("flex-1 justify-center","reject"===l?"bg-danger hover:bg-danger/90 text-white":"bg-white border border-danger/40 text-red-700 hover:bg-danger-soft"),children:[(0,s.jsx)(c.Z,{className:"h-3.5 w-3.5"}),a("reject"===l?"borderline.rejectRejected":"borderline.reject")]}),(0,s.jsxs)(o.z,{size:"sm",onClick:()=>r("skip"),className:(0,_.cn)("justify-center","skip"===l?"bg-muted text-white":"bg-white border border-border text-muted hover:bg-bg-soft"),children:[(0,s.jsx)(ey.Z,{className:"h-3.5 w-3.5"}),a("borderline.skip")]})]})]})}function eS(e){var t,l,r,a,n,i,o,d;let{label:c,record:u,compare:x}=e,m=(0,D.NT)();return(0,s.jsxs)("div",{className:"rounded border border-border bg-bg-soft/30 p-2 space-y-1 text-[11px]",children:[(0,s.jsx)("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted",children:c}),(0,s.jsx)(eD,{label:m("borderline.fields.title"),v:u.title,other:x.title}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,s.jsx)(eD,{label:m("borderline.fields.year"),v:null!==(t=u.year)&&void 0!==t?t:"",other:null!==(l=x.year)&&void 0!==l?l:""}),(0,s.jsx)(eD,{label:m("borderline.fields.surname"),v:null!==(r=u.surname)&&void 0!==r?r:"",other:null!==(a=x.surname)&&void 0!==a?a:""})]}),(0,s.jsx)(eD,{label:m("borderline.fields.journal"),v:null!==(n=u.journal)&&void 0!==n?n:"",other:null!==(i=x.journal)&&void 0!==i?i:""}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,s.jsx)(eD,{label:m("borderline.fields.volume"),v:null!==(o=u.volume)&&void 0!==o?o:"",other:null!==(d=x.volume)&&void 0!==d?d:""}),u.doi?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-[9px] uppercase text-muted",children:m("borderline.fields.doi")}),(0,s.jsxs)("a",{href:"https://doi.org/".concat(u.doi),target:"_blank",rel:"noreferrer",className:"text-brand-600 hover:underline truncate inline-flex items-center gap-0.5 max-w-full",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("span",{className:"truncate font-mono text-[10px]",children:u.doi}),(0,s.jsx)(en.Z,{className:"h-2.5 w-2.5 flex-shrink-0"})]})]}):(0,s.jsx)(eD,{label:m("borderline.fields.doi"),v:"—",other:""})]})]})}function eD(e){let{label:t,v:l,other:r}=e,a=(0,D.NT)(),n=String(null!=l?l:"").trim(),i=String(null!=r?r:"").trim(),o=n&&i&&n.toLowerCase()!==i.toLowerCase();return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-[9px] uppercase text-muted",children:t}),(0,s.jsx)("div",{className:(0,_.cn)("truncate",o?"text-warning font-medium":"text-ink"),title:n,children:n||(0,s.jsxs)("span",{className:"text-muted/60",children:["(",a("common.none").toLowerCase(),")"]})})]})}var e_=l(2669),eZ=l(6595),eT=l(6858),eI=l(8872),ez=l(1348),eE=l(4765);let eA={};function eL(){let e=(0,ez.v)(),t=(0,D.NT)(),l=(0,ex.N)(),[d,u]=(0,r.useState)(eA),[x,m]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),[b,g]=(0,r.useState)([]),[f,v]=(0,r.useState)(""),[j,N]=(0,r.useState)(null),[y,w]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),[_,T]=(0,r.useState)(new Set),[I,z]=(0,r.useState)(!1),[E,A]=(0,r.useState)(!1),L=(0,r.useRef)(null),M=(0,r.useRef)(null),P=(0,r.useRef)(null),q=(0,r.useCallback)(async function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;M.current&&M.current.abort(),P.current&&(window.clearTimeout(P.current),P.current=null);let r=new AbortController;M.current=r,z(!0);try{let t=await n.hi.filterRecords(e,{spec:d,offset:l,limit:50,include_facets:!0},r.signal);if(r.signal.aborted)return;m(t),p(null)}catch(a){if(r.signal.aborted||a instanceof DOMException&&"AbortError"===a.name)return;let e=a instanceof Error?a.message:String(a);if((e.includes("Failed to fetch")||e.includes("NetworkError")||e.includes("ERR_"))&&s<1){P.current=window.setTimeout(()=>{q(l,s+1)},800);return}p((0,n.NS)(t,a,"records.queryFailed")),m(null)}finally{r.signal.aborted||z(!1)}},[e,d,t]);(0,r.useEffect)(()=>(L.current&&window.clearTimeout(L.current),L.current=window.setTimeout(()=>{q(0)},250),()=>{L.current&&window.clearTimeout(L.current),P.current&&window.clearTimeout(P.current),M.current&&M.current.abort()}),[q]),(0,r.useEffect)(()=>{n.hi.listPresets(e).then(g).catch(()=>{})},[e]);let R=(0,r.useMemo)(()=>Object.entries(d).filter(e=>{let[,t]=e;if(null==t)return!1;if(Array.isArray(t))return t.length>0;if("object"==typeof t){if("query"in t)return!!t.query;if("min"in t||"max"in t)return null!=t.min||null!=t.max;if("missing"in t||"has"in t){var l,s,r,a;return(null!==(r=null===(l=t.missing)||void 0===l?void 0:l.length)&&void 0!==r?r:0)+(null!==(a=null===(s=t.has)||void 0===s?void 0:s.length)&&void 0!==a?a:0)>0}}return!1}).length,[d]);async function F(){f.trim()&&(await n.hi.savePreset(e,f.trim(),d),await n.hi.addAuditEntry(e,{kind:"filter_save",title:t("records.presets.savedAuditTitle",{name:f.trim()}),details:{filter_count:R,spec:d},user_action:"save_preset"}).catch(()=>{}),v(""),g(await n.hi.listPresets(e)))}async function B(s){await l({message:t("records.presets.deleteConfirm",{name:s}),tone:"danger"})&&(await n.hi.deletePreset(e,s),j===s&&N(null),g(await n.hi.listPresets(e)))}async function O(s){let r=s.UID||void 0,a=s.DI||void 0;if((r||a)&&await l({message:t("records.deleteRowConfirm"),tone:"danger"}))try{await n.hi.deleteRecords(e,r?{uids:[r]}:{dois:[a]}),T(e=>{let t=new Set(e);return r&&t.delete(r),t}),q(0)}catch(e){p((0,n.NS)(t,e,"records.queryFailed"))}}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e_.m,{title:t("records.title"),subtitle:t("records.subtitle"),badges:[{label:t("records.stepBadge"),tone:"neutral"}],right:(0,s.jsx)(eE.L,{onHistory:()=>A(!0),nextHref:"/projects/".concat(e,"/enrich"),nextLabel:t("nav.ai")})}),(0,s.jsxs)("div",{className:"max-w-[1480px] mx-auto px-6 py-6 space-y-4",children:[h&&(0,s.jsxs)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-4 py-2 text-sm text-red-700",children:[h,h.includes("Merge")||h.includes("Birleştir")||h.includes("merge")?(0,s.jsx)(a.default,{href:"/projects/".concat(e,"/merge"),className:"ml-2 underline",children:t("records.goToMerge")}):null]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[300px_1fr] gap-4",children:[(0,s.jsxs)("aside",{className:"space-y-3",children:[(0,s.jsxs)(i.Zb,{children:[(0,s.jsxs)(i.Ol,{className:"py-2.5",children:[(0,s.jsxs)("span",{className:"font-semibold text-sm flex items-center gap-1.5",children:[(0,s.jsx)(eZ.Z,{className:"h-3.5 w-3.5 text-warning"})," ",t("records.presets.title")]}),(0,s.jsx)("span",{className:"text-[10px] text-muted ml-auto",children:b.length})]}),(0,s.jsxs)(i.eW,{className:"space-y-2 py-2.5",children:[(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)("input",{value:f,onChange:e=>v(e.target.value),onKeyDown:e=>{"Enter"===e.key&&F()},placeholder:t("records.presets.namePlaceholder"),className:"flex-1 rounded-md border border-border bg-white px-2 py-1.5 text-xs focus:outline-none focus:border-brand-500"}),(0,s.jsx)(o.z,{size:"sm",variant:"secondary",onClick:F,disabled:!f.trim()||0===R,title:t("records.presets.save"),children:(0,s.jsx)(eo.Z,{className:"h-3.5 w-3.5"})})]}),0===R&&(0,s.jsx)("p",{className:"text-[10px] text-muted",children:t("records.presets.hint")}),0===b.length?(0,s.jsxs)("p",{className:"text-xs text-muted py-1",children:[t("records.presets.noPresets"),"."]}):(0,s.jsx)("ul",{className:"space-y-0.5",children:b.map(e=>(0,s.jsx)("li",{className:"group",children:(0,s.jsxs)("div",{className:"flex items-center gap-1 rounded text-xs ".concat(j===e.name?"bg-brand-50":""),children:[(0,s.jsxs)("button",{onClick:()=>{u(e.spec),N(e.name)},className:"flex-1 text-left truncate px-2 py-1.5 rounded flex items-center gap-1.5 hover:bg-bg-soft ".concat(j===e.name?"text-brand-700 font-medium":"text-ink"),children:[(0,s.jsx)(k.Z,{className:"h-3 w-3 flex-shrink-0 ".concat(j===e.name?"text-brand-500":"text-muted")}),e.name]}),(0,s.jsx)("button",{onClick:()=>B(e.name),className:"opacity-0 group-hover:opacity-100 p-1 text-muted hover:text-danger transition",title:t("records.presets.delete"),children:(0,s.jsx)(c.Z,{className:"h-3 w-3"})})]})},e.name))})]})]}),(0,s.jsx)(i.Zb,{children:(0,s.jsx)(i.eW,{className:"py-3",children:(0,s.jsx)(Z,{spec:d,facetsAll:null==x?void 0:x.facets_all,onChange:e=>{u(e),N(null)},onReset:()=>{u(eA),N(null)}})})})]}),(0,s.jsxs)("section",{className:"space-y-3 min-w-0",children:[(0,s.jsx)(eM,{data:x,activeCount:R,loading:I,spec:d,onClear:()=>u(eA)}),(0,s.jsx)(ek,{projectId:e,onApplied:()=>q(0)}),x?(0,s.jsx)($,{data:x,onPage:q,onRowClick:e=>{w(e),S(!1)},onEditRow:e=>{w(e),S(!0)},onDeleteRow:O,selected:_,onSelectionChange:T}):h?null:(0,s.jsx)(i.Zb,{children:(0,s.jsx)(i.eW,{className:"text-center py-12 text-muted text-sm",children:t("common.loading")})}),x&&x.total>0&&(0,s.jsx)(eq,{projectId:e})]})]})]}),(0,s.jsx)(em,{record:y,projectId:e,startEditing:C,onSaved:()=>q(0),onClose:()=>{w(null),S(!1)}}),(0,s.jsx)(eg,{projectId:e,selected:_,onClear:()=>T(new Set),onChanged:()=>{q(0)}}),(0,s.jsx)(ef.N,{projectId:e,open:E,onClose:()=>A(!1)})]})}function eM(e){var t,l;let{data:r,activeCount:a,loading:n,spec:i,onClear:o}=e,d=(0,D.NT)();if(!r)return null;let u=null!==(l=null===(t=r.facets_all)||void 0===t?void 0:t.total)&&void 0!==l?l:r.total,x=u>0?Math.round(r.total/u*100):100;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-bg-card shadow-card px-4 py-3 flex items-center gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-ink tabular-nums",children:r.total.toLocaleString()}),(0,s.jsx)("span",{className:"text-xs text-muted",children:d("records.matchingRecords")})]}),(0,s.jsx)("div",{className:"h-8 w-px bg-border"}),(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-muted tabular-nums",children:u.toLocaleString()}),(0,s.jsxs)("span",{className:"text-xs text-muted",children:[d("common.total").toLowerCase()," \xb7 ",x,"%"]})]}),(0,s.jsx)("div",{className:"flex-1 min-w-[120px] max-w-xs",children:(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-bg-soft overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-brand-500 transition-all",style:{width:"".concat(x,"%")}})})}),a>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eP,{spec:i}),(0,s.jsxs)("button",{onClick:o,className:"text-xs text-muted hover:text-danger flex items-center gap-1",children:[(0,s.jsx)(c.Z,{className:"h-3 w-3"})," ",d("records.filter.clearAll")]})]}),n&&(0,s.jsx)("span",{className:"text-[11px] text-brand-600 animate-pulse ml-auto",children:d("common.loading")})]})}function eP(e){var t,l,r,a,n,i,o,d,c,u,x,m,h,p,b,g;let{spec:f}=e,v=(0,D.NT)(),j=[];return(f.year&&(null!=f.year.min||null!=f.year.max)&&j.push({label:"".concat(v("records.filter.year")," ").concat(null!==(h=f.year.min)&&void 0!==h?h:"?","–").concat(null!==(p=f.year.max)&&void 0!==p?p:"?")}),f.citation_count&&(null!=f.citation_count.min||null!=f.citation_count.max)&&j.push({label:"".concat(v("records.filter.citationCount")," ").concat(null!==(b=f.citation_count.min)&&void 0!==b?b:0,"–").concat(null!==(g=f.citation_count.max)&&void 0!==g?g:"∞")}),(null===(t=f.doc_type)||void 0===t?void 0:t.length)&&j.push({label:"".concat(v("records.filter.docType"),": ").concat(f.doc_type.length)}),(null===(l=f.language)||void 0===l?void 0:l.length)&&j.push({label:"".concat(v("records.filter.language"),": ").concat(f.language.length)}),(null===(r=f.db_source)||void 0===r?void 0:r.length)&&j.push({label:"".concat(v("records.filter.dbSource"),": ").concat(f.db_source.length)}),(null===(a=f.journal)||void 0===a?void 0:a.length)&&j.push({label:"".concat(v("records.filter.journal"),": ").concat(f.journal.length)}),(null===(n=f.authors)||void 0===n?void 0:n.length)&&j.push({label:"".concat(v("records.filter.authors"),": ").concat(f.authors.length)}),(null===(i=f.wc_categories)||void 0===i?void 0:i.length)&&j.push({label:"WC: ".concat(f.wc_categories.length)}),(null===(o=f.sc_categories)||void 0===o?void 0:o.length)&&j.push({label:"SC: ".concat(f.sc_categories.length)}),(null===(d=f.fulltext)||void 0===d?void 0:d.query)&&j.push({label:"".concat(v("common.search"),': "').concat(f.fulltext.query.slice(0,20)).concat(f.fulltext.query.length>20?"…":"",'"')}),(null===(u=f.quality)||void 0===u?void 0:null===(c=u.has)||void 0===c?void 0:c.length)&&j.push({label:"".concat(v("records.filter.qualityHas").toLowerCase(),": ").concat(f.quality.has.join(","))}),(null===(m=f.quality)||void 0===m?void 0:null===(x=m.missing)||void 0===x?void 0:x.length)&&j.push({label:"".concat(v("records.filter.qualityMissing").toLowerCase(),": ").concat(f.quality.missing.join(","))}),0===j.length)?null:(0,s.jsx)("div",{className:"flex items-center gap-1 flex-wrap",children:j.map((e,t)=>(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-brand-50 text-brand-700 border border-brand-200",children:e.label},t))})}function eq(e){let{projectId:t}=e,l=(0,D.NT)();return(0,s.jsx)(i.Zb,{className:"overflow-hidden",children:(0,s.jsxs)(i.eW,{className:"p-0",children:[(0,s.jsxs)("div",{className:"px-5 py-3 border-b border-border bg-gradient-to-r from-cyan-50/70 via-cyan-50/40 to-emerald-50/40",children:[(0,s.jsx)("h3",{className:"font-semibold text-sm text-ink",children:l("records.nextStepTitle")}),(0,s.jsx)("p",{className:"text-xs text-muted mt-0.5",children:l("records.nextStepSubtitle")})]}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 divide-y md:divide-y-0 md:divide-x divide-border",children:[(0,s.jsx)(a.default,{href:"/projects/".concat(t,"/enrich"),className:"group block px-5 py-4 hover:bg-cyan-50/40 transition",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-cyan-100 to-cyan-200 text-cyan-700 flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(y.Z,{className:"h-5 w-5"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"font-semibold text-sm text-ink",children:l("records.nextStepAITitle")}),(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-cyan-100 text-cyan-700 font-medium uppercase tracking-wide",children:l("records.nextStepAIBadge")})]}),(0,s.jsx)("p",{className:"text-xs text-muted mt-1 leading-relaxed",children:l("records.nextStepAIBody")}),(0,s.jsxs)("div",{className:"mt-2.5 flex items-center gap-1 text-xs font-medium text-cyan-700 group-hover:text-cyan-900",children:[l("records.nextStepAIBtn"),(0,s.jsx)(eT.Z,{className:"h-3.5 w-3.5 group-hover:translate-x-0.5 transition-transform"})]})]})]})}),(0,s.jsx)(a.default,{href:"/projects/".concat(t,"/export"),className:"group block px-5 py-4 hover:bg-emerald-50/40 transition",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-emerald-100 to-emerald-200 text-emerald-700 flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(eI.Z,{className:"h-5 w-5"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"font-semibold text-sm text-ink",children:l("records.nextStepExportTitle")}),(0,s.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-emerald-100 text-emerald-700 font-medium uppercase tracking-wide flex items-center gap-0.5",children:[(0,s.jsx)(ey.Z,{className:"h-2.5 w-2.5"}),l("records.nextStepExportBadge")]})]}),(0,s.jsx)("p",{className:"text-xs text-muted mt-1 leading-relaxed",children:l("records.nextStepExportBody")}),(0,s.jsxs)("div",{className:"mt-2.5 flex items-center gap-1 text-xs font-medium text-emerald-700 group-hover:text-emerald-900",children:[l("records.nextStepExportBtn"),(0,s.jsx)(eT.Z,{className:"h-3.5 w-3.5 group-hover:translate-x-0.5 transition-transform"})]})]})]})})]})]})})}},4392:function(e,t,l){"use strict";l.d(t,{z:function(){return i}});var s=l(7437),r=l(2265),a=l(4502);let n={primary:"bg-primary text-white hover:bg-primary-hover shadow-sm",secondary:"bg-white text-ink border border-border hover:bg-bg-soft",ghost:"text-ink hover:bg-bg-soft",danger:"bg-danger text-white hover:bg-red-700 shadow-sm",success:"bg-success text-white hover:bg-emerald-600 shadow-sm"},i=(0,r.forwardRef)(function(e,t){let{className:l,variant:r="primary",size:i="md",...o}=e;return(0,s.jsx)("button",{ref:t,className:(0,a.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-brand-500/40","sm"===i?"px-3 py-1.5 text-sm":"px-4 py-2 text-sm",n[r],l),...o})})},7090:function(e,t,l){"use strict";l.d(t,{Y:function(){return n}});var s=l(7437),r=l(5368),a=l(4502);function n(e){let{text:t,className:l}=e;return(0,s.jsxs)("span",{className:(0,a.cn)("relative inline-flex group align-middle",l),children:[(0,s.jsx)("button",{type:"button","aria-label":t,className:"text-muted hover:text-brand-600 focus:text-brand-600 focus:outline-none cursor-help",children:(0,s.jsx)(r.Z,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 bottom-full z-50 mb-1 hidden w-56 max-w-[15rem] -translate-x-1/2 whitespace-normal rounded-md bg-ink px-2 py-1.5 text-[11px] font-normal leading-snug text-white shadow-soft group-hover:block group-focus-within:block",children:t})]})}}},function(e){e.O(0,[156,507,169,244,382,367,971,117,744],function(){return e(e.s=573)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[147],{8491:function(e,t,a){Promise.resolve().then(a.bind(a,3860))},3860:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return A}});var s=a(7437),r=a(2265),n=a(7648),l=a(7855),i=a(9835),d=a(4392),o=a(2669),c=a(9205);let h=(0,c.Z)("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=a(7689),x=a(8736),m=a(3953),p=a(6595),b=a(8930),y=a(2023),g=a(4972),f=a(3581),k=a(9076),j=a(2735),v=a(8920),w=a(5621);let N=(0,c.Z)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);var Z=a(6865),M=a(1817),_=a(3554),S=a(4502),L=a(5499),K=a(1348);let q={project_create:{icon:(0,s.jsx)(h,{className:"h-4 w-4"}),tone:"info",labelKey:"audit.kinds.project_create"},upload:{icon:(0,s.jsx)(u.Z,{className:"h-4 w-4"}),tone:"info",labelKey:"audit.kinds.upload"},convert:{icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),tone:"info",labelKey:"audit.kinds.convert"},merge:{icon:(0,s.jsx)(m.Z,{className:"h-4 w-4"}),tone:"brand",labelKey:"audit.kinds.merge"},filter_save:{icon:(0,s.jsx)(p.Z,{className:"h-4 w-4"}),tone:"warning",labelKey:"audit.kinds.filter_save"},records_delete:{icon:(0,s.jsx)(b.Z,{className:"h-4 w-4"}),tone:"danger",labelKey:"audit.kinds.records_delete"},enrich_api:{icon:(0,s.jsx)(y.Z,{className:"h-4 w-4"}),tone:"brand",labelKey:"audit.kinds.enrich_api"},enrich_ml:{icon:(0,s.jsx)(g.Z,{className:"h-4 w-4"}),tone:"brand",labelKey:"audit.kinds.enrich_ml"},enrich_selected_requested:{icon:(0,s.jsx)(y.Z,{className:"h-4 w-4"}),tone:"brand",labelKey:"audit.kinds.enrich_selected"},disambiguate:{icon:(0,s.jsx)(y.Z,{className:"h-4 w-4"}),tone:"accent",labelKey:"audit.kinds.disambiguate"},snapshot:{icon:(0,s.jsx)(f.Z,{className:"h-4 w-4"}),tone:"neutral",labelKey:"audit.kinds.snapshot"},snapshot_restore:{icon:(0,s.jsx)(k.Z,{className:"h-4 w-4"}),tone:"warning",labelKey:"audit.kinds.snapshot_restore"},export:{icon:(0,s.jsx)(j.Z,{className:"h-4 w-4"}),tone:"success",labelKey:"audit.kinds.export"},report:{icon:(0,s.jsx)(v.Z,{className:"h-4 w-4"}),tone:"neutral",labelKey:"audit.kinds.report"}},C={info:"bg-info-soft text-blue-700 border-info/30",brand:"bg-brand-50 text-brand-700 border-brand-200",warning:"bg-warning-soft text-amber-700 border-warning/30",danger:"bg-danger-soft text-red-700 border-danger/30",accent:"bg-brand-50 text-accent border-brand-200",success:"bg-success-soft text-emerald-700 border-success/30",neutral:"bg-bg-soft text-muted border-border"};function A(){var e,t,a;let n=(0,K.v)(),d=(0,_.NT)(),[c,h]=(0,r.useState)([]),[u,m]=(0,r.useState)(null),[p,b]=(0,r.useState)(null),[g,k]=(0,r.useState)(!0);(0,r.useEffect)(()=>{let e=!0;return Promise.all([l.hi.listAudit(n,1e3),l.hi.auditSummary(n),l.hi.qualityStats(n).catch(()=>null)]).then(t=>{let[a,s,r]=t;e&&(h(a),m(s),b(r),k(!1))}).catch(()=>k(!1)),()=>{e=!1}},[n]);let j=(0,L.N)(),v=(0,L.p)(),N=(0,r.useCallback)(async()=>{let[e,t,a]=await Promise.all([l.hi.listAudit(n,1e3),l.hi.auditSummary(n),l.hi.qualityStats(n).catch(()=>null)]);h(e),m(t),b(a)},[n]);async function Z(e){if(await j({title:d("audit.restoreTitle"),message:d("audit.restoreConfirm"),confirmLabel:d("audit.restore"),tone:"danger"}))try{let t=await l.hi.restoreRecordSnapshot(n,e);v(d("audit.restoredToast",{n:t.restored}),{tone:"success"}),await N()}catch(e){v((0,l.NS)(d,e,"audit.restoreFailed"),{tone:"danger"})}}if(g)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.m,{title:d("report.title"),subtitle:d("report.subtitle")}),(0,s.jsx)("div",{className:"max-w-6xl mx-auto px-6 py-8 text-center text-muted",children:d("common.loading")})]});let M=(null==u?void 0:u.first_ts)?new Date(1e3*u.first_ts):null,A=(null==u?void 0:u.last_ts)?new Date(1e3*u.last_ts):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.m,{title:d("report.title"),subtitle:d("report.subtitle")}),(0,s.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-6 space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,s.jsx)(O,{icon:(0,s.jsx)(w.Z,{className:"h-4 w-4"}),label:d("report.totalOperations"),value:null!==(e=null==u?void 0:u.total.toLocaleString())&&void 0!==e?e:"0"}),(0,s.jsx)(O,{icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),label:d("report.recordCount"),value:null!==(t=null==p?void 0:p.total_records.toLocaleString())&&void 0!==t?t:"—"}),(0,s.jsx)(O,{icon:(0,s.jsx)(y.Z,{className:"h-4 w-4"}),label:d("records.quality.healthScore"),value:p?"".concat(Math.round(100*p.health_score),"%"):"—",tone:p&&p.health_score>=.9?"success":p&&p.health_score>=.7?"warning":"danger"}),(0,s.jsx)(O,{icon:(0,s.jsx)(f.Z,{className:"h-4 w-4"}),label:d("report.firstLast"),value:M&&A?"".concat(M.toLocaleDateString()," → ").concat(A.toLocaleDateString()):"—",small:!0})]}),u&&u.total>0&&(0,s.jsxs)(i.Zb,{children:[(0,s.jsx)(i.Ol,{children:(0,s.jsx)("h2",{className:"font-semibold text-sm",children:d("report.categoryDist")})}),(0,s.jsx)(i.eW,{children:(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2",children:Object.entries(u.by_kind).sort((e,t)=>t[1]-e[1]).map(e=>{var t;let[a,r]=e,n=null!==(t=q[a])&&void 0!==t?t:{icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),tone:"neutral",labelKey:""},l=n.labelKey?d(n.labelKey):a;return(0,s.jsxs)("div",{className:(0,S.cn)("border rounded-lg px-3 py-2.5",C[n.tone]),children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide opacity-80",children:[n.icon," ",l]}),(0,s.jsx)("div",{className:"text-xl font-bold mt-1 tabular-nums",children:r})]},a)})})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start",children:[(0,s.jsx)(z,{id:n}),(0,s.jsx)(H,{projectId:n,hasOps:(null!==(a=null==u?void 0:u.total)&&void 0!==a?a:0)>0})]}),(0,s.jsxs)(i.Zb,{children:[(0,s.jsxs)(i.Ol,{children:[(0,s.jsx)("h2",{className:"font-semibold text-sm flex-1",children:d("report.chronological")}),(0,s.jsxs)("span",{className:"text-xs text-muted",children:[c.length," ",d("audit.operations")]})]}),(0,s.jsx)(i.eW,{children:0===c.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(w.Z,{className:"h-10 w-10 mx-auto text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-sm text-muted",children:d("audit.noEntries")}),(0,s.jsx)("p",{className:"text-[11px] text-muted mt-1",children:d("audit.subtitle")})]}):(0,s.jsxs)("ol",{className:"relative space-y-0",children:[(0,s.jsx)("div",{className:"absolute left-[18px] top-2 bottom-2 w-px bg-border"}),c.map((e,t)=>(0,s.jsx)(D,{entry:e,idx:c.length-t,onRestore:Z},t))]})})]})]})]})}function z(e){let{id:t}=e,a=(0,_.NT)();return(0,s.jsxs)(i.Zb,{children:[(0,s.jsxs)(i.Ol,{children:[(0,s.jsx)(v.Z,{className:"h-4 w-4 text-brand-600"}),(0,s.jsx)("h2",{className:"font-semibold text-sm",children:a("report.rawLogs.title")})]}),(0,s.jsxs)(i.eW,{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-xs text-muted",children:a("report.rawLogs.desc")}),(0,s.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:["md","txt","pdf"].map(e=>(0,s.jsxs)("a",{href:l.hi.reportLogUrl(t,e),target:"_blank",rel:"noreferrer",className:"text-sm font-semibold px-3.5 py-2 rounded-lg border border-border bg-white hover:border-brand-400 hover:bg-brand-50 text-ink hover:text-brand-700 flex items-center gap-2 transition shadow-soft",children:[(0,s.jsx)(j.Z,{className:"h-4 w-4"})," ",e.toUpperCase()]},e))})]})]})}function H(e){let{projectId:t,hasOps:a}=e,o=(0,_.NT)(),[c,h]=(0,r.useState)(null),[u,x]=(0,r.useState)(null),[m,p]=(0,r.useState)(""),[b,g]=(0,r.useState)(!1),[f,k]=(0,r.useState)(null);async function v(){g(!0),k(null);try{let e=await l.hi.generateMethodology(t);h((null==e?void 0:e.text)?e:null)}catch(e){k((0,l.NS)(o,e,"report.methodology.failed"))}finally{g(!1)}}(0,r.useEffect)(()=>{let e=!0;return l.hi.getMethodology(t).then(t=>{e&&h((null==t?void 0:t.text)?t:null)}).catch(()=>{}),l.hi.disambiguateStatus(t).then(t=>{e&&(x(t.configured),p(t.model||""))}).catch(()=>{e&&x(!1)}),()=>{e=!1}},[t]);let w=!!(null==c?void 0:c.text);return(0,s.jsxs)(i.Zb,{className:"border-brand-200",children:[(0,s.jsxs)(i.Ol,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,s.jsx)(N,{className:"h-4 w-4 text-brand-600"}),(0,s.jsx)("h2",{className:"font-semibold text-sm",children:o("report.methodology.title")})]}),w&&(0,s.jsx)("div",{className:"flex items-center gap-1",children:["md","txt","pdf"].map(e=>(0,s.jsxs)("a",{href:l.hi.methodologyUrl(t,e),target:"_blank",rel:"noreferrer",className:"text-xs font-semibold px-2.5 py-1 rounded-md border border-border bg-white hover:border-brand-400 text-muted hover:text-brand-700 flex items-center gap-1.5 transition",children:[(0,s.jsx)(j.Z,{className:"h-3.5 w-3.5"})," ",e.toUpperCase()]},e))})]}),(0,s.jsxs)(i.eW,{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-xs text-muted",children:o("report.methodology.desc")}),!1===u&&(0,s.jsxs)("div",{className:"rounded-lg border border-warning/40 bg-warning-soft px-3 py-2 text-sm text-amber-900 flex gap-2",children:[(0,s.jsx)(Z.Z,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[o("report.methodology.notConfigured")," ",(0,s.jsx)(n.default,{href:"/settings",className:"underline font-medium",children:o("report.methodology.settingsLink")})]})]}),f&&(0,s.jsx)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-3 py-2 text-sm text-red-700",children:f}),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)(d.z,{onClick:v,disabled:b||!1===u||!a,size:"sm",children:[b?(0,s.jsx)(M.Z,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(N,{className:"h-4 w-4"}),w?o("report.methodology.regenerate"):o("report.methodology.generate")]}),!a&&(0,s.jsx)("span",{className:"text-xs text-muted",children:o("report.methodology.noOperations")}),b&&(0,s.jsx)("span",{className:"text-xs text-muted",children:o("report.methodology.generating")}),u&&m&&(0,s.jsxs)("span",{className:"text-[11px] text-muted ml-auto",children:[o("disambiguate.modelLabel"),": ",(0,s.jsx)("code",{className:"font-mono bg-bg-soft px-1 rounded",children:m})]})]}),!w&&!b&&(0,s.jsxs)("div",{className:"rounded-lg border border-dashed border-border bg-bg-soft/40 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted mb-1.5",children:o("report.methodology.sampleLabel")}),(0,s.jsx)("pre",{className:"whitespace-pre-wrap font-sans text-[12px] leading-relaxed text-muted/80",children:"## Data sources\nA total of 1,204 bibliographic records were retrieved from Web of Science (n = 712) and Scopus (n = 492).\n\n## Deduplication and merging\nThe two sources were merged following established record-linkage practice; after deduplication, 737 unique records remained.\n\n## Screening and enrichment\nRecords published before 2013 were excluded, and missing DOIs and abstracts were completed by querying CrossRef and OpenAlex.\n\n## Author disambiguation\nAuthor name variants were normalized and homonymous names were separated. Data preparation was performed using BibexPy (Kara et al., 2025)."})]}),w&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"rounded-lg border border-border bg-white px-4 py-3 max-h-[28rem] overflow-y-auto",children:(0,s.jsx)("pre",{className:"whitespace-pre-wrap font-sans text-[13px] leading-relaxed text-ink",children:c.text})}),(0,s.jsxs)("p",{className:"text-[11px] text-muted flex items-center gap-1.5",children:[(0,s.jsx)(y.Z,{className:"h-3 w-3"}),o("report.methodology.draftNote"),(null==c?void 0:c.generated_at)&&(0,s.jsxs)("span",{className:"ml-auto",children:[o("report.methodology.generatedAt"),": ",new Date(1e3*c.generated_at).toLocaleString()]})]})]})]})]})}function O(e){let{icon:t,label:a,value:r,tone:n="brand",small:l}=e;return(0,s.jsxs)("div",{className:(0,S.cn)("border rounded-xl px-4 py-3",C[n]),children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide opacity-80",children:[t," ",a]}),(0,s.jsx)("div",{className:(0,S.cn)("font-bold mt-1.5 tabular-nums",l?"text-sm":"text-2xl"),children:r})]})}function D(e){var t;let{entry:a,idx:r,onRestore:n}=e,i=(0,_.NT)(),d=null!==(t=q[a.kind])&&void 0!==t?t:{icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),tone:"neutral",labelKey:""},o=d.labelKey?i(d.labelKey):a.kind,c=new Date(1e3*a.ts).toLocaleString(void 0,{dateStyle:"short",timeStyle:"medium"});return(0,s.jsxs)("li",{className:"relative pl-10 py-3",children:[(0,s.jsx)("div",{className:(0,S.cn)("absolute left-2 top-3.5 w-8 h-8 rounded-full flex items-center justify-center border-2",C[d.tone]),children:d.icon}),(0,s.jsxs)("div",{className:"bg-bg-soft/50 rounded-lg px-3 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsxs)("span",{className:(0,S.cn)("text-[10px] font-semibold uppercase tracking-wide",C[d.tone].split(" ")[1]),children:["#",r," \xb7 ",o]}),(0,s.jsx)("span",{className:"text-[10px] text-muted ml-auto",children:c})]}),(0,s.jsx)("p",{className:"text-sm font-medium mt-1 text-ink",children:(0,l.Pr)(i,a)}),a.details&&Object.keys(a.details).length>0&&(0,s.jsxs)("details",{className:"mt-1.5",children:[(0,s.jsx)("summary",{className:"text-[11px] text-brand-600 hover:underline cursor-pointer",children:i("audit.showDetails")}),(0,s.jsx)("pre",{className:"mt-1 bg-white border border-border rounded p-2 text-[10px] overflow-x-auto text-muted whitespace-pre-wrap",children:JSON.stringify(a.details,null,2)})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1.5",children:[a.snapshot&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"text-[10px] text-muted font-mono flex items-center gap-1",children:[(0,s.jsx)(f.Z,{className:"h-3 w-3"})," ",a.snapshot.split(/[\\/]/).pop()]}),(0,s.jsxs)("button",{onClick:()=>n(a.snapshot),className:"text-[10px] font-semibold text-amber-700 hover:text-amber-900 flex items-center gap-1 px-2 py-0.5 rounded-md border border-warning/40 bg-warning-soft/60 hover:bg-warning-soft transition",title:i("audit.restoreTitle"),children:[(0,s.jsx)(k.Z,{className:"h-3 w-3"})," ",i("audit.restore")]})]}),a.user_action&&(0,s.jsx)("span",{className:"text-[10px] text-muted italic",children:a.user_action})]})]})]})}},4392:function(e,t,a){"use strict";a.d(t,{z:function(){return i}});var s=a(7437),r=a(2265),n=a(4502);let l={primary:"bg-primary text-white hover:bg-primary-hover shadow-sm",secondary:"bg-white text-ink border border-border hover:bg-bg-soft",ghost:"text-ink hover:bg-bg-soft",danger:"bg-danger text-white hover:bg-red-700 shadow-sm",success:"bg-success text-white hover:bg-emerald-600 shadow-sm"},i=(0,r.forwardRef)(function(e,t){let{className:a,variant:r="primary",size:i="md",...d}=e;return(0,s.jsx)("button",{ref:t,className:(0,n.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-brand-500/40","sm"===i?"px-3 py-1.5 text-sm":"px-4 py-2 text-sm",l[r],a),...d})})},4972:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])},3581:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]])},401:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},2934:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},5368:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},3953:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Combine",[["path",{d:"M10 18H5a3 3 0 0 1-3-3v-1",key:"ru65g8"}],["path",{d:"M14 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2",key:"e30een"}],["path",{d:"M20 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2",key:"2ahx8o"}],["path",{d:"m7 21 3-3-3-3",key:"127cv2"}],["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}]])},2735:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},8872:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]])},5751:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]])},5621:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},3245:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},1817:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},6337:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},9076:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},8920:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},2023:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},6595:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},8930:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},6865:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},7689:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},2489:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},function(e){e.O(0,[156,244,382,971,117,744],function(){return e(e.s=8491)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[16],{3265:function(e,n,t){Promise.resolve().then(t.bind(t,74))},74:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return s}});var u=t(2265),r=t(9376),o=t(1348);function s(){let e=(0,o.v)(),n=(0,r.useRouter)();return(0,u.useEffect)(()=>{e&&"_"!==e&&n.replace("/projects/".concat(e,"/merge"))},[e,n]),null}},1348:function(e,n,t){"use strict";t.d(n,{v:function(){return r}});var u=t(9376);function r(){let e=(0,u.useParams)(),n=null==e?void 0:e.id;if(n&&"_"!==n)return decodeURIComponent(n);{let e=window.location.pathname.match(/\/projects\/([^/]+)/);if(e&&e[1]&&"_"!==e[1])return decodeURIComponent(e[1])}return null!=n?n:"_"}},9376:function(e,n,t){"use strict";var u=t(5475);t.o(u,"useParams")&&t.d(n,{useParams:function(){return u.useParams}}),t.o(u,"usePathname")&&t.d(n,{usePathname:function(){return u.usePathname}}),t.o(u,"useRouter")&&t.d(n,{useRouter:function(){return u.useRouter}})}},function(e){e.O(0,[971,117,744],function(){return e(e.s=3265)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[895],{7820:function(e,t,n){Promise.resolve().then(n.bind(n,6))},6:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=n(7437),r=n(2265),s=n(7648),c=n(7855),i=n(4392),d=n(9835),l=n(2669),o=n(9397),h=n(1817),u=n(6475),m=n(8736),p=n(6858),f=n(8930),x=n(3554),y=n(5499);function k(){let e=(0,x.NT)(),t=(0,y.N)(),[n,k]=(0,r.useState)(null),[g,j]=(0,r.useState)(null),[b,v]=(0,r.useState)(""),[w,Z]=(0,r.useState)(!1);async function M(){try{k(await c.hi.listProjects())}catch(t){j((0,c.NS)(e,t))}}async function N(t){if(t.preventDefault(),b.trim()){Z(!0),j(null);try{let e=await c.hi.createProject(b.trim());v(""),await M(),window.location.href="/projects/".concat(e.id,"/merge")}catch(t){j((0,c.NS)(e,t)),Z(!1)}}}async function z(n,a){if(await t({title:e("projects.deleteConfirm"),message:'"'.concat(a,'"'),detail:e("projects.deleteWarning"),tone:"danger"}))try{await c.hi.deleteProject(n),await M()}catch(t){j((0,c.NS)(e,t))}}return(0,r.useEffect)(()=>{M()},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.m,{title:e("projects.title"),subtitle:e("projects.subtitle"),badges:[{label:e("nav.projects"),tone:"neutral"}]}),(0,a.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-8 space-y-6",children:[g&&(0,a.jsx)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-4 py-2 text-sm text-red-700",children:g}),(0,a.jsx)(d.Zb,{children:(0,a.jsx)(d.eW,{children:(0,a.jsxs)("form",{onSubmit:N,className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"w-9 h-9 rounded-lg bg-[#0c2847] text-cyan-200 flex items-center justify-center",children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})}),(0,a.jsx)("input",{value:b,onChange:e=>v(e.target.value),placeholder:e("projects.newProjectPlaceholder"),className:"flex-1 rounded-lg border border-border bg-white px-3 py-2 text-sm focus:outline-none focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20",maxLength:120}),(0,a.jsxs)(i.z,{type:"submit",disabled:w||!b.trim(),children:[w?(0,a.jsx)(h.Z,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(o.Z,{className:"h-4 w-4"}),e("projects.create")]})]})})}),null===n?(0,a.jsx)("p",{className:"text-muted text-sm",children:e("common.loading")}):0===n.length?(0,a.jsx)(d.Zb,{children:(0,a.jsxs)(d.eW,{className:"text-center py-14 text-muted",children:[(0,a.jsx)(u.Z,{className:"h-12 w-12 mx-auto mb-3 text-border"}),(0,a.jsx)("p",{className:"font-medium text-ink mb-1",children:e("projects.noProjects")}),(0,a.jsx)("p",{className:"text-sm",children:e("projects.noProjectsHint")})]})}):(0,a.jsx)("div",{className:"grid md:grid-cols-2 gap-3",children:n.map(t=>(0,a.jsx)(d.Zb,{className:"hover:shadow-soft transition",children:(0,a.jsxs)(d.eW,{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[#0c2847] text-cyan-200 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(u.Z,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)(s.default,{href:"/projects/".concat(t.id,"/merge"),className:"font-semibold text-ink hover:text-brand-600 truncate block",children:t.name}),(0,a.jsxs)("p",{className:"text-xs text-muted mt-1 flex items-center gap-3 flex-wrap",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(m.Z,{className:"h-3 w-3"}),e("projects.fileCount",{n:t.file_count})]}),(0,a.jsx)("span",{children:(0,c.td)(t.raw_size_bytes)}),(0,a.jsx)("span",{children:new Date(t.created_at).toLocaleDateString()})]})]}),(0,a.jsx)(s.default,{href:"/projects/".concat(t.id,"/merge"),children:(0,a.jsx)(i.z,{variant:"ghost",size:"sm",children:(0,a.jsx)(p.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(i.z,{variant:"ghost",size:"sm",onClick:()=>z(t.id,t.name),title:e("common.delete"),children:(0,a.jsx)(f.Z,{className:"h-4 w-4 text-muted hover:text-danger"})})]})},t.id))})]})]})}},4392:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var a=n(7437),r=n(2265),s=n(4502);let c={primary:"bg-primary text-white hover:bg-primary-hover shadow-sm",secondary:"bg-white text-ink border border-border hover:bg-bg-soft",ghost:"text-ink hover:bg-bg-soft",danger:"bg-danger text-white hover:bg-red-700 shadow-sm",success:"bg-success text-white hover:bg-emerald-600 shadow-sm"},i=(0,r.forwardRef)(function(e,t){let{className:n,variant:r="primary",size:i="md",...d}=e;return(0,a.jsx)("button",{ref:t,className:(0,s.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-brand-500/40","sm"===i?"px-3 py-1.5 text-sm":"px-4 py-2 text-sm",c[r],n),...d})})},6858:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},4972:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])},401:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},2934:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},5368:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},3953:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Combine",[["path",{d:"M10 18H5a3 3 0 0 1-3-3v-1",key:"ru65g8"}],["path",{d:"M14 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2",key:"e30een"}],["path",{d:"M20 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2",key:"2ahx8o"}],["path",{d:"m7 21 3-3-3-3",key:"127cv2"}],["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}]])},8872:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]])},5751:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]])},6475:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},3245:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},1817:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},6337:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},9397:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8920:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},8930:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},6865:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2489:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(9205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},function(e){e.O(0,[156,244,382,971,117,744],function(){return e(e.s=7820)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[938],{128:function(e,t,s){Promise.resolve().then(s.bind(s,7034))},7034:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return K}});var n=s(7437),r=s(2265),a=s(7648),l=s(7855),i=s(7090),d=s(9835),o=s(4392),c=s(2669),x=s(4938),u=s(2735),m=s(8736),h=s(9897),p=s(4428),b=s(6475),f=s(1817),g=s(9548),v=s(2489),j=s(265),N=s(407),y=s(4924),w=s(9322),k=s(401),L=s(3554),_=s(4502);let S={home:(0,n.jsx)(x.Z,{className:"h-3.5 w-3.5"}),downloads:(0,n.jsx)(u.Z,{className:"h-3.5 w-3.5"}),documents:(0,n.jsx)(m.Z,{className:"h-3.5 w-3.5"}),desktop:(0,n.jsx)(h.Z,{className:"h-3.5 w-3.5"}),computer:(0,n.jsx)(p.Z,{className:"h-3.5 w-3.5"})};function P(e){var t,s,a,i,d,c;let{open:x,initialPath:u,onClose:m,onSelect:h}=e,P=(0,L.NT)(),[C,E]=(0,r.useState)(null),[M,O]=(0,r.useState)(!1),[R,T]=(0,r.useState)(null),[D,A]=(0,r.useState)(!1),[I,z]=(0,r.useState)(null),[B,U]=(0,r.useState)(!1),F=!!window.showDirectoryPicker,K=(0,r.useCallback)(async e=>{O(!0),T(null);try{let t=await l.hi.browseFolder(e);E(t)}catch(e){T((0,l.NS)(P,e,"folderPicker.nativePickerLoadError"))}finally{O(!1)}},[P]);async function H(){if(window.showDirectoryPicker){T(null),z(null);try{let e=await window.showDirectoryPicker({mode:"read"});U(!0);try{let t=await l.hi.findFolderByName(e.name);1===t.matches.length?(h(t.matches[0].path),m()):0===t.matches.length?T(P("folderPicker.nativePickerNoPath",{name:e.name})):z(t)}finally{U(!1)}}catch(e){"AbortError"!==e.name&&T((0,l.NS)(P,e,"folderPicker.nativePickerError"))}}}if((0,r.useEffect)(()=>{if(!x){A(!1);return}requestAnimationFrame(()=>A(!0)),K(u||"");let e=e=>{"Escape"===e.key&&m()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[x,u,K,m]),!x)return null;let W=function(e,t){if(!e)return[];let s=[],n="",r="windows"===t?"\\":"/";for(let a of e.split(/[\\/]+/).filter(Boolean))n=n?(n.endsWith(":"),n+r+a):"unix"===t?"/"+a:a,s.push({label:a,path:n});return s}(null!==(t=null==C?void 0:C.current)&&void 0!==t?t:"",null!==(s=null==C?void 0:C.platform)&&void 0!==s?s:"unix");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onClick:m,className:(0,_.cn)("fixed inset-0 bg-ink/40 backdrop-blur-sm z-[60] transition-opacity",D?"opacity-100":"opacity-0")}),(0,n.jsx)("div",{className:(0,_.cn)("fixed inset-0 z-[70] flex items-center justify-center p-4 pointer-events-none",D?"opacity-100":"opacity-0"),children:(0,n.jsxs)("div",{className:(0,_.cn)("w-full max-w-3xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden pointer-events-auto","transition-transform duration-200",D?"scale-100":"scale-95"),style:{height:"min(620px, 85vh)"},children:[(0,n.jsxs)("div",{className:"px-5 py-3 border-b border-border flex items-center gap-3",children:[(0,n.jsx)(b.Z,{className:"h-5 w-5 text-brand-500"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("h2",{className:"font-semibold text-sm",children:P("folderPicker.title")}),(0,n.jsx)("p",{className:"text-[11px] text-muted",children:P("folderPicker.subtitle")})]}),F&&(0,n.jsxs)("button",{onClick:H,disabled:B,className:"text-xs px-2.5 py-1.5 rounded-md border border-border bg-white hover:border-brand-400 hover:bg-brand-50 text-ink flex items-center gap-1.5 disabled:opacity-50",title:P("folderPicker.nativePickerTip"),children:[B?(0,n.jsx)(f.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(g.Z,{className:"h-3.5 w-3.5"}),P("folderPicker.nativePicker")]}),(0,n.jsx)("button",{onClick:m,className:"p-1.5 rounded-md hover:bg-bg-soft text-muted hover:text-ink",children:(0,n.jsx)(v.Z,{className:"h-5 w-5"})})]}),I&&I.matches.length>1&&(0,n.jsxs)("div",{className:"px-5 py-3 border-b border-border bg-info-soft/50",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-info mb-2",children:P("folderPicker.nativePickerMultipleMatches",{name:I.name,count:I.matches.length})}),(0,n.jsxs)("div",{className:"space-y-1",children:[I.matches.map(e=>(0,n.jsx)("button",{onClick:()=>{h(e.path),m()},className:"w-full text-left text-xs px-3 py-1.5 rounded bg-white border border-border hover:border-brand-400 hover:bg-brand-50 font-mono truncate",children:e.path},e.path)),(0,n.jsx)("button",{onClick:()=>z(null),className:"text-[11px] text-muted hover:text-ink underline",children:P("folderPicker.cancelManual")})]})]}),(0,n.jsxs)("div",{className:"px-5 py-2 border-b border-border flex items-center gap-1 text-xs bg-bg-soft/40 overflow-x-auto",children:[(0,n.jsx)("button",{onClick:()=>{var e;return K(null!==(e=null==C?void 0:C.parent)&&void 0!==e?e:"")},disabled:null==C?void 0:C.is_root,className:"p-1 rounded hover:bg-bg-soft disabled:opacity-30 disabled:cursor-not-allowed text-muted hover:text-ink",title:P("folderPicker.upBtn"),children:(0,n.jsx)(j.Z,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("div",{className:"w-px h-4 bg-border mx-1"}),(0,n.jsxs)("button",{onClick:()=>K(""),className:"px-1.5 py-0.5 hover:bg-bg-soft rounded text-muted hover:text-ink flex items-center gap-1",title:P("folderPicker.computerTip"),children:[(0,n.jsx)(p.Z,{className:"h-3 w-3"})," ",P("folderPicker.computer")]}),W.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(N.Z,{className:"h-3 w-3 text-muted/50 flex-shrink-0"}),(0,n.jsx)("button",{onClick:()=>K(e.path),className:"px-1.5 py-0.5 hover:bg-bg-soft rounded text-ink truncate max-w-[140px]",title:e.path,children:e.label})]},t))]}),(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,n.jsxs)("aside",{className:"w-44 border-r border-border bg-bg-soft/30 overflow-y-auto p-2 space-y-0.5 flex-shrink-0",children:[(0,n.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted px-2 py-1",children:P("folderPicker.quickAccess")}),(null!==(a=null==C?void 0:C.shortcuts)&&void 0!==a?a:[]).map(e=>{var t;return(0,n.jsxs)("button",{onClick:()=>K(e.path),className:"w-full text-left flex items-center gap-2 px-2 py-1.5 text-xs rounded hover:bg-white text-ink",children:[(0,n.jsx)("span",{className:"text-muted",children:null!==(t=S[e.icon])&&void 0!==t?t:(0,n.jsx)(y.Z,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("span",{className:"truncate",children:e.label})]},e.label)})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:M?(0,n.jsxs)("div",{className:"flex items-center justify-center py-16 text-muted",children:[(0,n.jsx)(f.Z,{className:"h-5 w-5 animate-spin mr-2"})," ",P("folderPicker.loading")]}):R?(0,n.jsxs)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft/40 px-3 py-3 text-sm text-red-700 flex items-start gap-2",children:[(0,n.jsx)(w.Z,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium",children:R}),(0,n.jsx)("button",{onClick:()=>K(""),className:"text-xs underline mt-1 hover:opacity-80",children:P("folderPicker.backToRoot")})]})]}):0===(null!==(i=null==C?void 0:C.entries)&&void 0!==i?i:[]).length?(0,n.jsx)("div",{className:"text-center py-12 text-muted text-sm",children:P("folderPicker.emptyFolder")}):(0,n.jsx)("div",{className:"grid grid-cols-2 gap-1",children:(null!==(d=null==C?void 0:C.entries)&&void 0!==d?d:[]).map(e=>(0,n.jsx)(Z,{entry:e,onOpen:()=>K(e.path)},e.path))})})]}),(0,n.jsxs)("div",{className:"px-5 py-3 border-t border-border flex items-center gap-3 bg-bg-soft/30",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-[10px] text-muted uppercase tracking-wide",children:P("folderPicker.toSelect")}),(0,n.jsx)("div",{className:"text-xs font-mono text-ink truncate",title:null!==(c=null==C?void 0:C.current)&&void 0!==c?c:"",children:(null==C?void 0:C.current)||P("folderPicker.nothingSelected")})]}),(0,n.jsx)(o.z,{variant:"secondary",onClick:m,size:"sm",children:P("folderPicker.cancel")}),(0,n.jsxs)(o.z,{onClick:()=>{(null==C?void 0:C.current)&&h(C.current),m()},disabled:!(null==C?void 0:C.current),size:"sm",children:[(0,n.jsx)(k.Z,{className:"h-3.5 w-3.5"}),P("folderPicker.selectThis")]})]})]})})]})}function Z(e){let{entry:t,onOpen:s}=e;return(0,n.jsxs)("button",{onClick:s,onDoubleClick:s,className:"text-left flex items-center gap-2 px-2.5 py-1.5 text-xs rounded hover:bg-brand-50 group transition",children:[t.is_drive?(0,n.jsx)(p.Z,{className:"h-3.5 w-3.5 text-brand-500 flex-shrink-0"}):(0,n.jsx)(y.Z,{className:"h-3.5 w-3.5 text-warning flex-shrink-0 group-hover:text-brand-500"}),(0,n.jsx)("span",{className:"truncate flex-1",title:t.path,children:t.name}),(0,n.jsx)(N.Z,{className:"h-3 w-3 text-muted/40 opacity-0 group-hover:opacity-100 transition"})]})}var C=s(2934),E=s(7945),M=s(3245),O=s(91),R=s(2023),T=s(9076),D=s(3229),A=s(4822),I=s(6362),z=s(6748),B=s(7769),U=s(2208);function F(e,t,s){let n=e(t);return n===t?null!=s?s:t:n}function K(){let e=(0,L.NT)(),{locale:t,setLocale:s,tArr:i}=(0,L.QT)(),[x,u]=(0,r.useState)(null),[m,h]=(0,r.useState)({}),[b,f]=(0,r.useState)(new Set),[g,v]=(0,r.useState)(new Set),[j,N]=(0,r.useState)(!0),[y,k]=(0,r.useState)(!1),[S,P]=(0,r.useState)(null),[Z,A]=(0,r.useState)(null),I=(0,r.useCallback)(async()=>{N(!0),P(null);try{let e=await l.hi.getSettings();u(e);let t={};for(let s of e.fields)t[s.key]=s.value;h(t),f(new Set)}catch(t){P((0,l.NS)(e,t))}finally{N(!1)}},[]);function z(e,t){h(s=>({...s,[e]:t})),f(t=>new Set(t).add(e))}async function B(){if(0!==b.size){k(!0),P(null);try{let e={};for(let s of b){var t;let n=null==x?void 0:x.fields.find(e=>e.key===s);if(!n)continue;let r=null!==(t=m[s])&&void 0!==t?t:"";if("bool"===n.type)e[s]="true"===r||"1"===r||"evet"===r.toLowerCase();else if("float"===n.type){let t=parseFloat(r);Number.isNaN(t)||(e[s]=t)}else e[s]=r}await l.hi.updateSettings(e),A(Date.now()),setTimeout(I,600)}catch(t){P((0,l.NS)(e,t,"settings.saveFailed"))}finally{k(!1)}}}(0,r.useEffect)(()=>{I()},[I]);let U=b.size>0,K={};if(x)for(let e of x.fields){var V;K[e.group]=null!==(V=K[e.group])&&void 0!==V?V:[],K[e.group].push(e)}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.m,{title:e("settings.title"),subtitle:e("settings.subtitle"),right:(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)(a.default,{href:"/projects",children:(0,n.jsx)("button",{className:"text-xs text-white/90 hover:text-white px-3 py-1.5 rounded-md bg-white/10 hover:bg-white/20",children:e("nav.projects")})})})}),(0,n.jsxs)("div",{className:"max-w-3xl mx-auto px-6 py-6 space-y-4",children:[S&&(0,n.jsxs)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-4 py-2 text-sm text-red-700 flex items-center gap-2",children:[(0,n.jsx)(w.Z,{className:"h-4 w-4"})," ",S]}),Z&&(0,n.jsxs)("div",{className:"rounded-lg border border-success/30 bg-success-soft px-4 py-2 text-sm text-emerald-700 flex items-center gap-2",children:[(0,n.jsx)(C.Z,{className:"h-4 w-4"})," ",e("settings.saved")]}),(0,n.jsxs)(d.Zb,{children:[(0,n.jsxs)(d.Ol,{children:[(0,n.jsx)(E.Z,{className:"h-4 w-4 text-brand-600"}),(0,n.jsx)("h2",{className:"font-semibold text-sm flex-1",children:e("settings.language")})]}),(0,n.jsxs)(d.eW,{className:"py-3",children:[(0,n.jsx)("p",{className:"text-xs text-muted mb-3",children:e("settings.languageHint")}),(0,n.jsx)("div",{className:"flex items-center gap-2",children:["en","tr"].map(r=>(0,n.jsx)("button",{onClick:()=>s(r),className:(0,_.cn)("px-4 py-2 rounded-md text-sm font-medium transition border",t===r?"bg-brand-500 text-white border-brand-500":"bg-white text-ink border-border hover:border-border-strong"),children:"en"===r?e("settings.english"):e("settings.turkish")},r))})]})]}),x&&(0,n.jsx)(d.Zb,{children:(0,n.jsxs)(d.eW,{className:"py-3 space-y-1.5",children:[i("settings.infoNotes").map((e,t)=>(0,n.jsxs)("div",{className:"text-xs text-muted flex items-start gap-1.5",children:[(0,n.jsx)(M.Z,{className:"h-3.5 w-3.5 text-info mt-0.5 flex-shrink-0"}),(0,n.jsx)("span",{children:e})]},t)),x.env_file&&(0,n.jsxs)("div",{className:"text-[10px] text-muted/70 font-mono mt-1.5",children:[".env: ",x.env_file]})]})}),j?(0,n.jsx)(d.Zb,{children:(0,n.jsx)(d.eW,{className:"text-center py-12 text-muted text-sm",children:e("common.loading")})}):x&&Object.keys(K).map(t=>{var s;return(0,n.jsxs)(d.Zb,{children:[(0,n.jsxs)(d.Ol,{children:["storage"===t?(0,n.jsx)(p.Z,{className:"h-4 w-4 text-brand-500"}):"api"===t?(0,n.jsx)(O.Z,{className:"h-4 w-4 text-brand-500"}):(0,n.jsx)(R.Z,{className:"h-4 w-4 text-brand-500"}),(0,n.jsx)("h2",{className:"font-semibold text-sm",children:F(e,"settings.groups.".concat(t),null!==(s=x.groups[t])&&void 0!==s?s:t)})]}),(0,n.jsx)(d.eW,{className:"space-y-3",children:"llm"===t?(0,n.jsx)(H,{fields:K[t],values:m,touched:b,reveal:g,providers:x.llm_providers,onChange:z,onToggleReveal:e=>{v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})}}):K[t].map(e=>{var t,s;return"STORAGE_DIR"===e.key?(0,n.jsx)(W,{field:e,value:null!==(t=m[e.key])&&void 0!==t?t:"",touched:b.has(e.key),onChange:t=>z(e.key,t)},e.key):(0,n.jsx)(G,{field:e,value:null!==(s=m[e.key])&&void 0!==s?s:"",touched:b.has(e.key),revealed:g.has(e.key),onChange:t=>z(e.key,t),onToggleReveal:()=>{v(t=>{let s=new Set(t);return s.has(e.key)?s.delete(e.key):s.add(e.key),s})}},e.key)})})]},t)}),(0,n.jsx)("div",{className:"sticky bottom-4 z-10",children:(0,n.jsxs)("div",{className:(0,_.cn)("rounded-xl border bg-white shadow-soft px-4 py-3 flex items-center gap-3 transition-all",U?"border-brand-500":"border-border"),children:[(0,n.jsx)("span",{className:"text-sm",children:U?(0,n.jsx)("span",{className:"text-ink font-medium tabular-nums",children:e("settings.changesPending",{n:b.size})}):(0,n.jsx)("span",{className:"text-muted",children:e("settings.allSaved")})}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[U&&(0,n.jsxs)(o.z,{variant:"secondary",size:"sm",onClick:function(){if(!x)return;let e={};for(let t of x.fields)e[t.key]=t.value;h(e),f(new Set)},disabled:y,children:[(0,n.jsx)(T.Z,{className:"h-3.5 w-3.5"})," ",e("settings.revert")]}),(0,n.jsxs)(o.z,{onClick:B,disabled:!U||y,children:[(0,n.jsx)(D.Z,{className:"h-4 w-4"}),y?e("settings.saving"):e("common.save")]})]})]})})]})]})}function H(e){var t,s,a,l,i,d;let{fields:o,values:c,touched:x,reveal:u,providers:m,onChange:h,onToggleReveal:p}=e,b=(0,L.NT)(),f=c.LLM_PROVIDER||"deepseek",g=(0,r.useMemo)(()=>{var e;return null!==(e=m.find(e=>e.id===f))&&void 0!==e?e:m[0]},[m,f]),v=o.find(e=>"LLM_API_KEY"===e.key),j=o.find(e=>"LLM_BASE_URL"===e.key);o.find(e=>"LLM_MODEL"===e.key);let N=o.find(e=>"DISAMBIGUATION_ENABLED"===e.key),y=o.find(e=>"DISAMBIGUATION_BLOCKING_THRESHOLD"===e.key),w=o.find(e=>"DISAMBIGUATION_AUTO_APPROVE_THRESHOLD"===e.key),k="custom"===f,S=!!(null==g?void 0:g.models.find(e=>e.id===(c.LLM_MODEL||"")));return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(A.Z,{className:"h-3.5 w-3.5 text-muted"}),(0,n.jsx)("label",{className:"text-sm font-medium text-ink flex-1",children:b("settings.llmProvider")}),(0,n.jsx)("span",{className:"text-[10px] text-muted font-mono",children:"LLM_PROVIDER"}),x.has("LLM_PROVIDER")&&(0,n.jsx)("span",{className:"text-[10px] text-warning bg-warning-soft px-1.5 py-0.5 rounded-full",children:b("settings.changed")})]}),(0,n.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-1.5",children:m.map(e=>(0,n.jsxs)("button",{onClick:()=>(function(e){h("LLM_PROVIDER",e);let t=m.find(t=>t.id===e);if(t&&"custom"!==t.id&&(h("LLM_BASE_URL",t.base_url),t.models.length>0)){let e=c.LLM_MODEL||"";t.models.some(t=>t.id===e)||h("LLM_MODEL",t.models[0].id)}})(e.id),className:(0,_.cn)("rounded-lg border px-3 py-2 text-xs font-medium transition text-left",f===e.id?"border-brand-500 bg-brand-50 text-brand-700 ring-2 ring-brand-500/20":"border-border bg-white text-ink hover:border-brand-300"),children:[(0,n.jsx)("div",{children:F(b,"settings.providers.".concat(e.id),e.label)}),e.id===f&&e.key_url&&(0,n.jsxs)("a",{href:e.key_url,target:"_blank",rel:"noreferrer",className:"text-[10px] text-brand-600 hover:underline mt-0.5 inline-flex items-center gap-0.5",onClick:e=>e.stopPropagation(),children:[b("settings.getApiKey")," ",(0,n.jsx)(I.Z,{className:"h-2.5 w-2.5"})]})]},e.id))})]}),k&&(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-ink flex-1",children:"Base URL"}),(0,n.jsx)("span",{className:"text-[10px] text-muted font-mono",children:"LLM_BASE_URL"})]}),(0,n.jsx)("input",{type:"text",value:null!==(t=c.LLM_BASE_URL)&&void 0!==t?t:"",onChange:e=>h("LLM_BASE_URL",e.target.value),placeholder:"https://api.together.ai/v1",className:(0,_.cn)("w-full rounded-md border bg-white px-3 py-1.5 text-sm font-mono focus:outline-none focus:ring-2 transition",x.has("LLM_BASE_URL")?"border-brand-500 ring-brand-500/20":"border-border focus:border-brand-500")}),(0,n.jsx)("p",{className:"text-[11px] text-muted",children:b("settings.baseUrlHint")})]}),!k&&j&&(0,n.jsxs)("div",{className:"text-[11px] text-muted px-1",children:["Base URL: ",(0,n.jsx)("span",{className:"font-mono",children:null==g?void 0:g.base_url})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-ink flex-1",children:b("settings.modelLabel")}),(0,n.jsx)("span",{className:"text-[10px] text-muted font-mono",children:"LLM_MODEL"}),x.has("LLM_MODEL")&&(0,n.jsx)("span",{className:"text-[10px] text-warning bg-warning-soft px-1.5 py-0.5 rounded-full",children:b("settings.changed")})]}),g&&g.models.length>0&&!k?(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-1.5",children:g.models.map(e=>{let t=(c.LLM_MODEL||"")===e.id;return(0,n.jsxs)("button",{onClick:()=>h("LLM_MODEL",e.id),className:(0,_.cn)("text-left rounded-lg border px-3 py-2 text-xs transition",t?"border-brand-500 bg-brand-50 text-brand-700 ring-1 ring-brand-500/20":"border-border bg-white text-ink hover:border-brand-300"),children:[(0,n.jsx)("div",{className:"font-mono text-[11px] font-semibold",children:e.id}),(0,n.jsx)("div",{className:"text-[10px] text-muted mt-0.5",children:e.label})]},e.id)})}):(0,n.jsx)("input",{type:"text",value:null!==(s=c.LLM_MODEL)&&void 0!==s?s:"",onChange:e=>h("LLM_MODEL",e.target.value),placeholder:b("settings.modelPlaceholder"),className:(0,_.cn)("w-full rounded-md border bg-white px-3 py-1.5 text-sm font-mono focus:outline-none focus:ring-2 transition",x.has("LLM_MODEL")?"border-brand-500 ring-brand-500/20":"border-border focus:border-brand-500")}),!k&&!S&&c.LLM_MODEL&&(0,n.jsxs)("p",{className:"text-[11px] text-warning",children:["⚠ ",b("settings.modelNotInList")]})]}),v&&(0,n.jsx)(G,{field:v,value:null!==(a=c[v.key])&&void 0!==a?a:"",touched:x.has(v.key),revealed:u.has(v.key),onChange:e=>h(v.key,e),onToggleReveal:()=>p(v.key)}),(0,n.jsxs)("div",{className:"border-t border-border pt-3 space-y-3",children:[(0,n.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted",children:b("settings.disambiguationPipeline")}),N&&(0,n.jsx)(G,{field:N,value:null!==(l=c[N.key])&&void 0!==l?l:"",touched:x.has(N.key),revealed:!1,onChange:e=>h(N.key,e),onToggleReveal:()=>{}}),y&&(0,n.jsx)(G,{field:y,value:null!==(i=c[y.key])&&void 0!==i?i:"",touched:x.has(y.key),revealed:!1,onChange:e=>h(y.key,e),onToggleReveal:()=>{},helpText:b("help.blockingThreshold")}),w&&(0,n.jsx)(G,{field:w,value:null!==(d=c[w.key])&&void 0!==d?d:"",touched:x.has(w.key),revealed:!1,onChange:e=>h(w.key,e),onToggleReveal:()=>{},helpText:b("help.autoApprove")})]})]})}function W(e){var t;let{field:s,value:a,touched:i,onChange:d}=e,c=(0,L.NT)(),[x,u]=(0,r.useState)(null),[m,h]=(0,r.useState)(!1),[p,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(!1);async function y(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(a.trim()){h(!0);try{let t=await l.hi.validatePath(a,e);u(t)}catch(e){u(null)}finally{h(!1)}}}return(0,r.useEffect)(()=>{!p&&a.trim()&&(v(!0),l.hi.validatePath(a).then(u).catch(()=>{}))},[a,p]),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(b.Z,{className:"h-3.5 w-3.5 text-muted"}),(0,n.jsx)("label",{className:"text-sm font-medium text-ink flex-1",children:F(c,"settings.fields.".concat(s.key,".label"),s.label)}),(0,n.jsx)("span",{className:"text-[10px] text-muted font-mono",children:s.key}),i&&(0,n.jsx)("span",{className:"text-[10px] text-warning bg-warning-soft px-1.5 py-0.5 rounded-full",children:c("settings.changed")})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:"text",value:a,onChange:e=>{d(e.target.value),u(null)},placeholder:null!==(t=s.default)&&void 0!==t?t:c("settings.pathPlaceholder"),className:(0,_.cn)("flex-1 rounded-md border bg-white px-3 py-1.5 text-sm font-mono focus:outline-none focus:ring-2 transition",i?"border-brand-500 ring-brand-500/20":"border-border focus:border-brand-500 focus:ring-brand-500/20")}),(0,n.jsxs)(o.z,{variant:"secondary",size:"sm",onClick:()=>N(!0),title:c("settings.browseFolder"),children:[(0,n.jsx)(g.Z,{className:"h-3.5 w-3.5"}),c("settings.browseFolder")]}),(0,n.jsxs)(o.z,{variant:"secondary",size:"sm",onClick:()=>y(!1),disabled:!a.trim()||m,title:c("settings.validatePath"),children:[m?(0,n.jsx)(f.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(C.Z,{className:"h-3.5 w-3.5"}),c("settings.check")]})]}),(0,n.jsx)(P,{open:j,initialPath:(null==x?void 0:x.exists)?a:"",onClose:()=>N(!1),onSelect:e=>{d(e),u(null),v(!1)}}),x&&(0,n.jsxs)("div",{className:(0,_.cn)("rounded-lg border px-3 py-2 text-xs space-y-1",x.valid?"border-success/40 bg-success-soft/40 text-emerald-900":x.exists?"border-warning/40 bg-warning-soft/40 text-amber-900":"border-danger/40 bg-danger-soft/40 text-red-900"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[x.valid?(0,n.jsx)(C.Z,{className:"h-3.5 w-3.5"}):(0,n.jsx)(w.Z,{className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{className:"font-medium",children:c(x.valid?"settings.pathStatus.ready":x.exists&&!x.is_dir?"settings.pathStatus.notDir":x.exists?"settings.pathStatus.notWritable":"settings.pathStatus.missing")}),x.valid&&null!=x.project_count&&(0,n.jsx)("span",{className:"ml-auto text-[10px]",children:c("settings.nProjectsExist",{n:x.project_count})})]}),x.resolved&&x.resolved!==a&&(0,n.jsxs)("div",{className:"text-[10px] opacity-75 font-mono",children:["↳ ",x.resolved]}),!x.exists&&(0,n.jsx)("button",{onClick:()=>y(!0),disabled:m,className:"text-[11px] underline hover:opacity-80",children:c("settings.createThisFolder")})]}),s.hint&&(0,n.jsxs)("p",{className:"text-[11px] text-muted flex items-start gap-1",children:[(0,n.jsx)(M.Z,{className:"h-3 w-3 mt-0.5 flex-shrink-0"}),(0,n.jsx)("span",{children:F(c,"settings.fields.".concat(s.key,".hint"),s.hint)})]})]})}function G(e){var t;let{field:s,value:r,touched:a,revealed:l,onChange:d,onToggleReveal:o,helpText:c}=e,x=(0,L.NT)();if(s.secret,"bool"===s.type){let e="true"===r||"1"===r||"boolean"==typeof r&&r;return(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-ink",children:F(x,"settings.fields.".concat(s.key,".label"),s.label)}),(0,n.jsx)("p",{className:"text-[11px] text-muted font-mono",children:s.key})]}),(0,n.jsx)("button",{onClick:()=>d(e?"false":"true"),className:(0,_.cn)("relative inline-flex h-6 w-11 items-center rounded-full transition",e?"bg-brand-500":"bg-bg-soft"),children:(0,n.jsx)("span",{className:(0,_.cn)("inline-block h-4 w-4 transform rounded-full bg-white transition shadow",e?"translate-x-6":"translate-x-1")})}),a&&(0,n.jsx)("span",{className:"text-[10px] text-warning",children:x("settings.changed")})]})}return(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[s.secret&&(0,n.jsx)(z.Z,{className:"h-3.5 w-3.5 text-muted"}),(0,n.jsxs)("div",{className:"flex-1 flex items-center gap-1.5 min-w-0",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-ink truncate",children:F(x,"settings.fields.".concat(s.key,".label"),s.label)}),c&&(0,n.jsx)(i.Y,{text:c})]}),(0,n.jsx)("span",{className:"text-[10px] text-muted font-mono",children:s.key}),s.is_set&&!a&&(0,n.jsx)("span",{className:"text-[10px] text-success bg-success-soft px-1.5 py-0.5 rounded-full",children:x("settings.defined")}),a&&(0,n.jsx)("span",{className:"text-[10px] text-warning bg-warning-soft px-1.5 py-0.5 rounded-full",children:x("settings.changed")})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:!s.secret||l||a?"text":"password",value:r,onChange:e=>d(e.target.value),placeholder:null!==(t=s.default)&&void 0!==t?t:s.secret?x("settings.apiKeyPlaceholder"):"",className:(0,_.cn)("flex-1 rounded-md border bg-white px-3 py-1.5 text-sm focus:outline-none focus:ring-2 transition",a?"border-brand-500 ring-brand-500/20":"border-border focus:border-brand-500 focus:ring-brand-500/20",s.secret&&"font-mono")}),s.secret&&(0,n.jsx)("button",{type:"button",onClick:o,className:"p-1.5 rounded-md border border-border bg-white text-muted hover:text-ink hover:border-brand-300 transition",title:x(l?"common.hide":"common.show"),children:l?(0,n.jsx)(B.Z,{className:"h-3.5 w-3.5"}):(0,n.jsx)(U.Z,{className:"h-3.5 w-3.5"})})]}),s.secret&&s.is_set&&!a&&(0,n.jsx)("p",{className:"text-[10px] text-muted",children:x("settings.maskedKeyNote")})]})}},4392:function(e,t,s){"use strict";s.d(t,{z:function(){return i}});var n=s(7437),r=s(2265),a=s(4502);let l={primary:"bg-primary text-white hover:bg-primary-hover shadow-sm",secondary:"bg-white text-ink border border-border hover:bg-bg-soft",ghost:"text-ink hover:bg-bg-soft",danger:"bg-danger text-white hover:bg-red-700 shadow-sm",success:"bg-success text-white hover:bg-emerald-600 shadow-sm"},i=(0,r.forwardRef)(function(e,t){let{className:s,variant:r="primary",size:i="md",...d}=e;return(0,n.jsx)("button",{ref:t,className:(0,a.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-brand-500/40","sm"===i?"px-3 py-1.5 text-sm":"px-4 py-2 text-sm",l[r],s),...d})})},9835:function(e,t,s){"use strict";s.d(t,{Ol:function(){return l},Zb:function(){return a},eW:function(){return i}});var n=s(7437),r=s(4502);function a(e){let{className:t,...s}=e;return(0,n.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-bg-card shadow-card",t),...s})}function l(e){let{className:t,...s}=e;return(0,n.jsx)("div",{className:(0,r.cn)("px-5 py-3.5 flex items-center gap-2 rounded-t-xl bg-[#0c2847] text-white","[&_h2]:text-white [&_h3]:text-white [&_.text-muted]:text-slate-400",t),...s})}function i(e){let{className:t,...s}=e;return(0,n.jsx)("div",{className:(0,r.cn)("p-5",t),...s})}},7090:function(e,t,s){"use strict";s.d(t,{Y:function(){return l}});var n=s(7437),r=s(5368),a=s(4502);function l(e){let{text:t,className:s}=e;return(0,n.jsxs)("span",{className:(0,a.cn)("relative inline-flex group align-middle",s),children:[(0,n.jsx)("button",{type:"button","aria-label":t,className:"text-muted hover:text-brand-600 focus:text-brand-600 focus:outline-none cursor-help",children:(0,n.jsx)(r.Z,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 bottom-full z-50 mb-1 hidden w-56 max-w-[15rem] -translate-x-1/2 whitespace-normal rounded-md bg-ink px-2 py-1.5 text-[11px] font-normal leading-snug text-white shadow-soft group-hover:block group-focus-within:block",children:t})]})}},2669:function(e,t,s){"use strict";s.d(t,{m:function(){return h}});var n=s(7437),r=s(4502),a=s(7648),l=s(9376),i=s(401),d=s(6337),o=s(3554),c=s(1348),x=s(8763);function u(){let e=(0,c.v)(),t=(0,l.usePathname)(),s=(0,o.NT)(),{isEnabled:u}=(0,x.vH)(e);if(!(t&&/^\/projects\/[^/]+\/[^/]+/.test(t)))return null;let m=x.u$.findIndex(s=>null==t?void 0:t.startsWith("/projects/".concat(e,"/").concat(s.slug)));return(0,n.jsx)("nav",{className:"border-b border-border bg-gradient-to-b from-white to-bg-soft/30",children:(0,n.jsx)("ol",{className:"mx-auto flex max-w-6xl items-center px-4 py-3.5 sm:px-6",children:x.u$.map((t,l)=>{var o;let c="/projects/".concat(e,"/").concat(t.slug),h=l===m,p=h||u(t.slug),b=p&&m>=0&&l<m,f=t.icon,g=l===x.u$.length-1,v=!g&&u(x.u$[l+1].slug),j=(0,n.jsxs)("span",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("span",{className:(0,r.cn)("flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full text-sm font-bold transition",h?"bg-brand-500 text-white ring-4 ring-brand-100":b?"bg-brand-500 text-white":p?"border-2 border-border bg-white text-muted group-hover:border-brand-300":"border-2 border-dashed border-border bg-bg-soft text-muted/40"),children:b?(0,n.jsx)(i.Z,{className:"h-4 w-4"}):p?l+1:(0,n.jsx)(d.Z,{className:"h-3.5 w-3.5"})}),(0,n.jsxs)("span",{className:"hidden items-center gap-1.5 sm:flex",children:[(0,n.jsx)(f,{className:(0,r.cn)("h-4 w-4 flex-shrink-0",h?"text-brand-600":b?"text-brand-500":p?"text-muted":"text-muted/40")}),(0,n.jsx)("span",{className:(0,r.cn)("whitespace-nowrap text-[13px] font-medium leading-tight",h?"font-bold text-brand-700":p?"text-ink":"text-muted/40"),children:s(t.labelKey)})]})]});return(0,n.jsxs)("li",{className:(0,r.cn)("flex items-center",g?"flex-initial":"flex-1"),children:[p?(0,n.jsx)(a.default,{href:c,"aria-current":h?"step":void 0,className:"group flex-shrink-0 rounded-lg px-1.5 py-1 transition hover:bg-white/70",children:j}):(0,n.jsx)("span",{title:s("records"===(o=t.slug)||"enrich"===o?"nav.lockNeedAdvanced":"nav.lockNeedMerge"),"aria-disabled":"true",className:"flex-shrink-0 cursor-not-allowed select-none px-1.5 py-1",children:j}),!g&&(0,n.jsx)("span",{className:(0,r.cn)("mx-2 h-0.5 flex-1 rounded-full transition sm:mx-3",b?"bg-brand-400":v?"bg-brand-200":"bg-border")})]},t.slug)})})})}let m={neutral:"bg-white/15 text-white border-white/20",live:"bg-emerald-400/20 text-emerald-50 border-emerald-300/40",info:"bg-cyan-400/20 text-cyan-50 border-cyan-300/40"};function h(e){let{title:t,subtitle:s,badges:a,right:l,className:i}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("section",{className:(0,r.cn)("bg-[#081c32] text-white",i),children:(0,n.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[a&&a.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:a.map((e,t)=>{var s;return(0,n.jsx)("span",{className:(0,r.cn)("inline-flex items-center px-2.5 py-1 rounded-md border text-[11px] font-semibold uppercase tracking-wide",m[null!==(s=e.tone)&&void 0!==s?s:"neutral"]),children:e.label},t)})}),(0,n.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h1",{className:"text-3xl font-bold leading-tight",children:t}),s&&(0,n.jsx)("p",{className:"text-white/80 mt-1.5 text-sm max-w-2xl",children:s})]}),l&&(0,n.jsx)("div",{className:"text-white/90 text-sm",children:l})]})]})}),(0,n.jsx)(u,{})]})}},8763:function(e,t,s){"use strict";s.d(t,{T0:function(){return u},u$:function(){return x},vH:function(){return m}});var n=s(2265),r=s(9376),a=s(3953),l=s(5751),i=s(4972),d=s(8872),o=s(8920),c=s(7855);let x=[{slug:"merge",labelKey:"nav.analyses",icon:a.Z},{slug:"records",labelKey:"nav.records",icon:l.Z},{slug:"enrich",labelKey:"nav.ai",icon:i.Z},{slug:"export",labelKey:"nav.export",icon:d.Z},{slug:"report",labelKey:"nav.report",icon:o.Z}],u=(e,t)=>"bibexpy_adv_".concat(e,"_").concat(t);function m(e){let t=(0,r.usePathname)(),[s,a]=(0,n.useState)(!1),[l,i]=(0,n.useState)(!1),[d,o]=(0,n.useState)(!1),x=(0,n.useCallback)(async()=>{if(e)try{var t;let s=await c.hi.mergeSummary(e),n=!!(null==s?void 0:s.has_merge);a(n);let r=null==s?void 0:null===(t=s.analysis)||void 0===t?void 0:t.id,l=!1;if(n&&r)try{l="1"===localStorage.getItem(u(e,r))}catch(e){}i(l)}catch(e){}finally{o(!0)}},[e]);(0,n.useEffect)(()=>{x()},[x,t]),(0,n.useEffect)(()=>{let e=()=>x();return window.addEventListener("bibexpy:status",e),()=>window.removeEventListener("bibexpy:status",e)},[x]);let m=(0,n.useCallback)(e=>{if(!d)return!0;switch(e){case"merge":default:return!0;case"export":case"report":return s;case"records":case"enrich":return s&&l}},[d,s,l]);return{merged:s,advanced:l,loaded:d,isEnabled:m,refresh:x}}},1348:function(e,t,s){"use strict";s.d(t,{v:function(){return r}});var n=s(9376);function r(){let e=(0,n.useParams)(),t=null==e?void 0:e.id;if(t&&"_"!==t)return decodeURIComponent(t);{let e=window.location.pathname.match(/\/projects\/([^/]+)/);if(e&&e[1]&&"_"!==e[1])return decodeURIComponent(e[1])}return null!=t?t:"_"}}},function(e){e.O(0,[156,392,244,971,117,744],function(){return e(e.s=128)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[843],{7876:function(e,t,r){Promise.resolve().then(r.bind(r,7867))},7867:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return M}});var s=r(7437),l=r(2265),n=r(7855),o=r(9835),a=r(4392),i=r(2669),c=r(5866),d=r(8736),x=r(9857),u=r(1649),m=r(91),p=r(1769),b=r(7342),h=r(9525),g=r(2934),f=r(2489),v=r(7689),y=r(9322),j=r(2735),w=r(1817),k=r(3554),N=r(4502);let Z=[{id:"wos",icon:(0,s.jsx)(d.Z,{className:"h-4 w-4"}),exts:["txt","isi"]},{id:"scopus_csv",icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),exts:["csv"]},{id:"xlsx",icon:(0,s.jsx)(u.Z,{className:"h-4 w-4"}),exts:["xlsx"]},{id:"csv",icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),exts:["csv"]},{id:"tsv",icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),exts:["tsv","txt"]}],S=[{id:"wos",icon:(0,s.jsx)(d.Z,{className:"h-4 w-4"}),primary:["bibliometrix","biblioshiny","vosviewer"],secondary:["citespace","histcite","bibexcel"]},{id:"vos",icon:(0,s.jsx)(m.Z,{className:"h-4 w-4"}),primary:["vosviewer"],secondary:["gephi","openrefine"]},{id:"bib",icon:(0,s.jsx)(p.Z,{className:"h-4 w-4"}),primary:["zotero","jabref","mendeley","latex","overleaf"],secondary:["endnote","citavi"]},{id:"ris",icon:(0,s.jsx)(b.Z,{className:"h-4 w-4"}),primary:["endnote","zotero","mendeley","citavi"],secondary:["refworks","papers"]},{id:"xlsx",icon:(0,s.jsx)(u.Z,{className:"h-4 w-4"}),primary:["excel","biblioshiny","tableau"],secondary:["powerbi","python","r"]},{id:"csv",icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),primary:["biblioshiny","python","r","excel"],secondary:["openrefine","tableau","powerbi"]},{id:"tsv",icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),primary:["vosviewer","openrefine"],secondary:["python","r","excel"]}];function M(){let e=(0,k.NT)(),[t,r]=(0,l.useState)(null),[d,x]=(0,l.useState)(null),[u,m]=(0,l.useState)("wos"),[p,b]=(0,l.useState)(""),[M,z]=(0,l.useState)(!1),[T,H]=(0,l.useState)(null),[_,O]=(0,l.useState)(null),[V,q]=(0,l.useState)(!1),E=(0,l.useRef)(null);function F(t){if(H(null),O(null),!t){r(null),x(null);return}if(t.size>104857600){H(e("tools.fileTooBig"));return}r(t);let s=function(e){let t=e.toLowerCase().split(".").pop()||"";return"xlsx"===t||"xls"===t?"xlsx":"tsv"===t?"tsv":"txt"===t||"isi"===t?"wos":null}(t.name);s&&!d&&x(s)}async function L(){if(!t){H(e("tools.noFileSelected"));return}if(!d){H(e("tools.step2Title"));return}z(!0),H(null),O(null);try{let e=await n.hi.toolsConvert(t,d,u,p.trim()||void 0);O(e),C(e.blob,e.filename)}catch(t){H((0,n.NS)(e,t,"tools.errTitle"))}finally{z(!1)}}function R(){r(null),x(null),b(""),O(null),H(null),E.current&&(E.current.value="")}let A=S.find(e=>e.id===u);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.m,{title:e("tools.title"),subtitle:e("tools.subtitle"),badges:[{label:"Beta",tone:"neutral"}]}),(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-8 space-y-6",children:[(0,s.jsxs)(o.Zb,{children:[(0,s.jsxs)(o.Ol,{children:[(0,s.jsx)(h.Z,{className:"h-4 w-4 text-brand-600"}),(0,s.jsx)("h2",{className:"font-semibold text-sm flex-1",children:e("tools.converterTitle")})]}),(0,s.jsxs)(o.eW,{className:"space-y-6",children:[(0,s.jsx)("p",{className:"text-sm text-muted leading-relaxed",children:e("tools.converterSubtitle")}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted mb-1.5",children:e("tools.step1Title")}),(0,s.jsxs)("div",{onDragOver:e=>{e.preventDefault(),q(!0)},onDragLeave:()=>q(!1),onDrop:e=>{e.preventDefault(),q(!1);let t=e.dataTransfer.files[0];t&&F(t)},onClick:()=>{var e;return null===(e=E.current)||void 0===e?void 0:e.click()},className:(0,N.cn)("rounded-xl border-2 border-dashed transition cursor-pointer","px-6 py-8 flex flex-col items-center gap-2 text-center",V?"border-brand-500 bg-brand-50":t?"border-success/40 bg-success-soft/30":"border-border bg-bg-soft/40 hover:border-brand-300 hover:bg-brand-50/40"),children:[(0,s.jsx)("input",{ref:E,type:"file",accept:".txt,.csv,.tsv,.xlsx,.xls,.isi",onChange:e=>{var t,r;return F(null!==(r=null===(t=e.target.files)||void 0===t?void 0:t[0])&&void 0!==r?r:null)},className:"hidden"}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.Z,{className:"h-7 w-7 text-success"}),(0,s.jsx)("p",{className:"text-sm font-medium text-ink",children:e("tools.fileSelected",{name:t.name,size:(0,n.td)(t.size)})}),(0,s.jsxs)("button",{onClick:e=>{e.stopPropagation(),R()},className:"text-[11px] text-muted hover:text-danger underline mt-1",children:[(0,s.jsx)(f.Z,{className:"h-3 w-3 inline mr-0.5"}),e("common.cancel")]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.Z,{className:"h-7 w-7 text-muted/60"}),(0,s.jsx)("p",{className:"text-sm font-medium text-ink",children:V?e("tools.dropToUpload"):e("tools.dropOrClick")}),(0,s.jsx)("p",{className:"text-[11px] text-muted",children:e("tools.step1Hint")})]})]})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted mb-1.5",children:e("tools.step2Title")}),(0,s.jsx)("p",{className:"text-xs text-muted mb-2",children:e("tools.step2Hint")}),(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2",children:Z.map(t=>{let r=d===t.id;return(0,s.jsxs)("button",{onClick:()=>x(t.id),disabled:M,className:(0,N.cn)("text-left rounded-lg border-2 px-3 py-2 transition disabled:opacity-50",r?"border-brand-500 bg-brand-50/60":"border-border bg-white hover:border-brand-300"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[(0,s.jsx)("span",{className:r?"text-brand-600":"text-muted",children:t.icon}),(0,s.jsx)("span",{className:(0,N.cn)("text-xs font-semibold",r&&"text-brand-700"),children:e("tools.sourceFormats.".concat(t.id))})]}),(0,s.jsx)("div",{className:"text-[10px] text-muted font-mono",children:t.exts.map(e=>".".concat(e)).join(" / ")})]},t.id)})})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted mb-1.5",children:e("tools.step3Title")}),(0,s.jsx)("p",{className:"text-xs text-muted mb-2",children:e("tools.step3Hint")}),(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2",children:S.map(t=>{let r=u===t.id;return(0,s.jsx)("button",{onClick:()=>m(t.id),disabled:M,className:(0,N.cn)("text-left rounded-lg border-2 px-3 py-2 transition disabled:opacity-50",r?"border-brand-500 bg-brand-50/60 shadow-soft":"border-border bg-white hover:border-brand-300"),children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:r?"text-brand-600":"text-muted",children:t.icon}),(0,s.jsx)("span",{className:(0,N.cn)("text-xs font-semibold",r&&"text-brand-700"),children:e("tools.targetFormats.".concat(t.id))})]})},t.id)})}),(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("label",{className:"block text-[11px] text-muted mb-1",children:e("tools.outputName")}),(0,s.jsx)("input",{value:p,onChange:e=>b(e.target.value),placeholder:e("tools.outputNamePlaceholder"),disabled:M,className:"w-full rounded-md border border-border bg-white px-3 py-1.5 text-sm focus:outline-none focus:border-brand-500 disabled:opacity-50"})]})]}),T&&(0,s.jsxs)("div",{className:"rounded-lg border border-danger/30 bg-danger-soft px-4 py-2 text-sm text-red-700 flex items-start gap-2",children:[(0,s.jsx)(y.Z,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium",children:e("tools.errTitle")}),(0,s.jsx)("div",{className:"text-xs text-red-700/80 mt-0.5",children:T})]})]}),_&&(0,s.jsxs)("div",{className:"rounded-lg border border-success/30 bg-success-soft/40 px-4 py-3 text-sm flex items-start gap-3",children:[(0,s.jsx)(g.Z,{className:"h-5 w-5 text-success mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"font-semibold text-emerald-800",children:e("tools.successMsg",{records:_.records,columns:_.columns})}),(0,s.jsx)("div",{className:"text-xs text-emerald-700/80 mt-0.5 font-mono truncate",children:_.filename})]}),(0,s.jsxs)(a.z,{size:"sm",variant:"secondary",onClick:function(){_&&C(_.blob,_.filename)},children:[(0,s.jsx)(j.Z,{className:"h-3.5 w-3.5"}),e("tools.downloadAgain")]}),(0,s.jsx)(a.z,{size:"sm",variant:"ghost",onClick:R,children:e("tools.resetBtn")})]}),(0,s.jsx)("div",{className:"flex justify-end pt-2 border-t border-border",children:(0,s.jsx)(a.z,{onClick:L,disabled:M||!t||!d,size:"md",children:M?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 animate-spin"})," ",e("tools.converting")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{className:"h-4 w-4"})," ",e("tools.convertBtn")]})})})]})]}),(0,s.jsxs)(o.Zb,{children:[(0,s.jsxs)(o.Ol,{children:[(0,s.jsx)("h2",{className:"font-semibold text-sm flex-1",children:e("tools.section.ecosystem")}),(0,s.jsx)("span",{className:"text-xs text-muted",children:e("tools.targetFormats.".concat(u))})]}),(0,s.jsxs)(o.eW,{children:[(0,s.jsx)("p",{className:"text-xs text-muted mb-3",children:e("tools.section.ecosystemHint")}),(0,s.jsx)(c.kC,{primary:A.primary,secondary:A.secondary})]})]})]})]})}function C(e,t){let r=URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(r),1500)}},4392:function(e,t,r){"use strict";r.d(t,{z:function(){return a}});var s=r(7437),l=r(2265),n=r(4502);let o={primary:"bg-primary text-white hover:bg-primary-hover shadow-sm",secondary:"bg-white text-ink border border-border hover:bg-bg-soft",ghost:"text-ink hover:bg-bg-soft",danger:"bg-danger text-white hover:bg-red-700 shadow-sm",success:"bg-success text-white hover:bg-emerald-600 shadow-sm"},a=(0,l.forwardRef)(function(e,t){let{className:r,variant:l="primary",size:a="md",...i}=e;return(0,s.jsx)("button",{ref:t,className:(0,n.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-brand-500/40","sm"===a?"px-3 py-1.5 text-sm":"px-4 py-2 text-sm",o[l],r),...i})})},9835:function(e,t,r){"use strict";r.d(t,{Ol:function(){return o},Zb:function(){return n},eW:function(){return a}});var s=r(7437),l=r(4502);function n(e){let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("rounded-xl border border-border bg-bg-card shadow-card",t),...r})}function o(e){let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("px-5 py-3.5 flex items-center gap-2 rounded-t-xl bg-[#0c2847] text-white","[&_h2]:text-white [&_h3]:text-white [&_.text-muted]:text-slate-400",t),...r})}function a(e){let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("p-5",t),...r})}},2669:function(e,t,r){"use strict";r.d(t,{m:function(){return p}});var s=r(7437),l=r(4502),n=r(7648),o=r(9376),a=r(401),i=r(6337),c=r(3554),d=r(1348),x=r(8763);function u(){let e=(0,d.v)(),t=(0,o.usePathname)(),r=(0,c.NT)(),{isEnabled:u}=(0,x.vH)(e);if(!(t&&/^\/projects\/[^/]+\/[^/]+/.test(t)))return null;let m=x.u$.findIndex(r=>null==t?void 0:t.startsWith("/projects/".concat(e,"/").concat(r.slug)));return(0,s.jsx)("nav",{className:"border-b border-border bg-gradient-to-b from-white to-bg-soft/30",children:(0,s.jsx)("ol",{className:"mx-auto flex max-w-6xl items-center px-4 py-3.5 sm:px-6",children:x.u$.map((t,o)=>{var c;let d="/projects/".concat(e,"/").concat(t.slug),p=o===m,b=p||u(t.slug),h=b&&m>=0&&o<m,g=t.icon,f=o===x.u$.length-1,v=!f&&u(x.u$[o+1].slug),y=(0,s.jsxs)("span",{className:"flex items-center gap-2.5",children:[(0,s.jsx)("span",{className:(0,l.cn)("flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full text-sm font-bold transition",p?"bg-brand-500 text-white ring-4 ring-brand-100":h?"bg-brand-500 text-white":b?"border-2 border-border bg-white text-muted group-hover:border-brand-300":"border-2 border-dashed border-border bg-bg-soft text-muted/40"),children:h?(0,s.jsx)(a.Z,{className:"h-4 w-4"}):b?o+1:(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5"})}),(0,s.jsxs)("span",{className:"hidden items-center gap-1.5 sm:flex",children:[(0,s.jsx)(g,{className:(0,l.cn)("h-4 w-4 flex-shrink-0",p?"text-brand-600":h?"text-brand-500":b?"text-muted":"text-muted/40")}),(0,s.jsx)("span",{className:(0,l.cn)("whitespace-nowrap text-[13px] font-medium leading-tight",p?"font-bold text-brand-700":b?"text-ink":"text-muted/40"),children:r(t.labelKey)})]})]});return(0,s.jsxs)("li",{className:(0,l.cn)("flex items-center",f?"flex-initial":"flex-1"),children:[b?(0,s.jsx)(n.default,{href:d,"aria-current":p?"step":void 0,className:"group flex-shrink-0 rounded-lg px-1.5 py-1 transition hover:bg-white/70",children:y}):(0,s.jsx)("span",{title:r("records"===(c=t.slug)||"enrich"===c?"nav.lockNeedAdvanced":"nav.lockNeedMerge"),"aria-disabled":"true",className:"flex-shrink-0 cursor-not-allowed select-none px-1.5 py-1",children:y}),!f&&(0,s.jsx)("span",{className:(0,l.cn)("mx-2 h-0.5 flex-1 rounded-full transition sm:mx-3",h?"bg-brand-400":v?"bg-brand-200":"bg-border")})]},t.slug)})})})}let m={neutral:"bg-white/15 text-white border-white/20",live:"bg-emerald-400/20 text-emerald-50 border-emerald-300/40",info:"bg-cyan-400/20 text-cyan-50 border-cyan-300/40"};function p(e){let{title:t,subtitle:r,badges:n,right:o,className:a}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("section",{className:(0,l.cn)("bg-[#081c32] text-white",a),children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[n&&n.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:n.map((e,t)=>{var r;return(0,s.jsx)("span",{className:(0,l.cn)("inline-flex items-center px-2.5 py-1 rounded-md border text-[11px] font-semibold uppercase tracking-wide",m[null!==(r=e.tone)&&void 0!==r?r:"neutral"]),children:e.label},t)})}),(0,s.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold leading-tight",children:t}),r&&(0,s.jsx)("p",{className:"text-white/80 mt-1.5 text-sm max-w-2xl",children:r})]}),o&&(0,s.jsx)("div",{className:"text-white/90 text-sm",children:o})]})]})}),(0,s.jsx)(u,{})]})}},5866:function(e,t,r){"use strict";r.d(t,{kC:function(){return u}});var s=r(7437),l=r(2265),n=r(4502);let o={vosviewer:{label:"VOSviewer",color:"text-amber-700",logoSrc:"/tools/vosviewer.png",logoHasName:!0,tip:"VOSviewer — Network visualization (co-authorship, co-citation, keyword co-occurrence maps)"},bibliometrix:{label:"bibliometrix",color:"text-blue-800",logoSrc:"/tools/bibliometrix.png",logoHasName:!0,tip:"bibliometrix — R package for comprehensive science mapping (Aria & Cuccurullo)"},biblioshiny:{label:"biblioshiny",color:"text-sky-700",logoSrc:"/tools/biblioshiny.svg",tip:"Web UI for bibliometrix (no coding required)"},citespace:{label:"CiteSpace",color:"text-emerald-700",logoSrc:"/tools/citespace.svg",tip:"Citation network & research-front detection"},bibexcel:{label:"BibExcel",color:"text-green-700",logoSrc:"/tools/bibexcel.svg",tip:"Lightweight bibliometric data preprocessing"},histcite:{label:"HistCite",color:"text-purple-700",logoSrc:"/tools/histcite.svg",tip:"Historiographic citation analysis"},gephi:{label:"Gephi",color:"text-slate-700",logoSrc:"/tools/gephi.svg",tip:"General-purpose network visualization"},citnetexplorer:{label:"CitNetExplorer",color:"text-teal-700",logoSrc:"/tools/citnetexplorer.svg",tip:"Direct citation network exploration"},zotero:{label:"Zotero",color:"text-red-700",logoSrc:"/tools/zotero.svg",tip:"Open-source reference manager"},mendeley:{label:"Mendeley",color:"text-rose-700",logoSrc:"/tools/mendeley.svg",tip:"Elsevier reference manager (free tier)"},jabref:{label:"JabRef",color:"text-orange-700",logoSrc:"/tools/jabref.svg",tip:"Java open-source BibTeX editor"},endnote:{label:"EndNote",color:"text-indigo-700",logoSrc:"/tools/endnote.svg",tip:"Clarivate reference manager"},citavi:{label:"Citavi",color:"text-fuchsia-700",logoSrc:"/tools/citavi.svg",tip:"Reference + knowledge management (Lumivero)"},refworks:{label:"RefWorks",color:"text-violet-700",logoSrc:"/tools/refworks.svg",tip:"ProQuest cloud-based reference manager"},papers:{label:"Papers",color:"text-cyan-700",logoSrc:"/tools/papers.svg",tip:"ReadCube reference manager"},latex:{label:"LaTeX",color:"text-stone-700",logoSrc:"/tools/latex.svg",tip:"Typesetting system — works with .bib"},overleaf:{label:"Overleaf",color:"text-green-700",logoSrc:"/tools/overleaf.svg",tip:"Web-based LaTeX editor"},excel:{label:"Excel",color:"text-emerald-700",logoSrc:"/tools/excel.svg",tip:"Microsoft spreadsheet — opens .xlsx natively"},tableau:{label:"Tableau",color:"text-blue-700",logoSrc:"/tools/tableau.svg",tip:"Salesforce BI / dashboards"},powerbi:{label:"Power BI",color:"text-yellow-700",logoSrc:"/tools/powerbi.svg",tip:"Microsoft BI / dashboards"},python:{label:"Python",color:"text-yellow-700",logoSrc:"/tools/python.svg",tip:"pandas / NetworkX / matplotlib"},r:{label:"R",color:"text-blue-700",logoSrc:"/tools/r.svg",tip:"Statistical computing — base of bibliometrix"},openrefine:{label:"OpenRefine",color:"text-lime-700",logoSrc:"/tools/openrefine.svg",tip:"Data cleaning / transformation for messy CSV/TSV"},scite:{label:"Scite",color:"text-indigo-700",logoSrc:"/tools/scite.svg",tip:"Smart citations & assistant"}},a={vosviewer:"bg-amber-500",bibliometrix:"bg-blue-700",biblioshiny:"bg-sky-500",citespace:"bg-emerald-500",bibexcel:"bg-green-500",histcite:"bg-purple-500",gephi:"bg-slate-500",citnetexplorer:"bg-teal-500",zotero:"bg-red-600",mendeley:"bg-rose-500",jabref:"bg-orange-500",endnote:"bg-indigo-500",citavi:"bg-fuchsia-500",refworks:"bg-violet-500",papers:"bg-cyan-500",latex:"bg-stone-500",overleaf:"bg-green-600",excel:"bg-emerald-600",tableau:"bg-blue-500",powerbi:"bg-yellow-500",python:"bg-yellow-600",r:"bg-blue-600",openrefine:"bg-lime-500",scite:"bg-indigo-500"};function i(e){let{tool:t,className:r}=e,i=o[t],[c,d]=(0,l.useState)(!1);return(null==i?void 0:i.logoSrc)&&!c?(0,s.jsx)("img",{src:i.logoSrc,alt:"","aria-hidden":"true",onError:()=>d(!0),className:(0,n.cn)("flex-shrink-0 object-contain",r)}):(0,s.jsx)("span",{className:(0,n.cn)("flex flex-shrink-0 items-center justify-center rounded text-[9px] font-bold text-white",a[t],r),children:i.label.charAt(0).toUpperCase()})}function c(e){let{tool:t}=e,r=o[t],[a,i]=(0,l.useState)(!1);if(!r)return null;let c=!!r.logoSrc&&!a,d=!r.logoHasName||!c;return(0,s.jsxs)("span",{title:r.tip,className:(0,n.cn)("inline-flex items-center gap-2 rounded-lg border border-border bg-white px-2.5 py-1.5","shadow-soft hover:border-brand-400 transition"),children:[c&&(0,s.jsx)("img",{src:r.logoSrc,onError:()=>i(!0),alt:r.label,className:"h-6 max-w-[132px] object-contain flex-shrink-0"}),d&&(0,s.jsx)("span",{className:(0,n.cn)("text-sm font-bold whitespace-nowrap",r.color),children:r.label})]})}function d(e){let{tool:t,tier:r="primary"}=e,l=o[t];return l?(0,s.jsxs)("span",{title:l.tip,className:(0,n.cn)("inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-white py-0.5 pl-0.5 pr-2","hover:border-brand-300 transition","secondary"===r&&"opacity-70"),children:[(0,s.jsx)(i,{tool:t,className:"h-4 w-4 rounded-sm"}),(0,s.jsx)("span",{className:(0,n.cn)("text-[11px] font-medium whitespace-nowrap",l.color),children:l.label})]}):null}let x=new Set(["vosviewer","bibliometrix"]);function u(e){let{primary:t,secondary:r,limit:l}=e,n=[...(null!=t?t:[]).map(e=>({t:e,tier:"primary"})),...(null!=r?r:[]).map(e=>({t:e,tier:"secondary"}))],o=n.filter(e=>x.has(e.t)),a=n.filter(e=>!x.has(e.t)),i=l?a.slice(0,Math.max(0,l-o.length)):a,u=a.length-i.length;return(0,s.jsxs)("div",{className:"space-y-3",children:[o.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>{let{t}=e;return(0,s.jsx)(c,{tool:t},t)})}),(i.length>0||u>0)&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[i.map(e=>{let{t,tier:r}=e;return(0,s.jsx)(d,{tool:t,tier:r},t)}),u>0&&(0,s.jsxs)("span",{className:"text-[10px] text-muted px-2 py-0.5 rounded-full border border-border/60 bg-bg-soft",children:["+",u]})]})]})}},8763:function(e,t,r){"use strict";r.d(t,{T0:function(){return u},u$:function(){return x},vH:function(){return m}});var s=r(2265),l=r(9376),n=r(3953),o=r(5751),a=r(4972),i=r(8872),c=r(8920),d=r(7855);let x=[{slug:"merge",labelKey:"nav.analyses",icon:n.Z},{slug:"records",labelKey:"nav.records",icon:o.Z},{slug:"enrich",labelKey:"nav.ai",icon:a.Z},{slug:"export",labelKey:"nav.export",icon:i.Z},{slug:"report",labelKey:"nav.report",icon:c.Z}],u=(e,t)=>"bibexpy_adv_".concat(e,"_").concat(t);function m(e){let t=(0,l.usePathname)(),[r,n]=(0,s.useState)(!1),[o,a]=(0,s.useState)(!1),[i,c]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{if(e)try{var t;let r=await d.hi.mergeSummary(e),s=!!(null==r?void 0:r.has_merge);n(s);let l=null==r?void 0:null===(t=r.analysis)||void 0===t?void 0:t.id,o=!1;if(s&&l)try{o="1"===localStorage.getItem(u(e,l))}catch(e){}a(o)}catch(e){}finally{c(!0)}},[e]);(0,s.useEffect)(()=>{x()},[x,t]),(0,s.useEffect)(()=>{let e=()=>x();return window.addEventListener("bibexpy:status",e),()=>window.removeEventListener("bibexpy:status",e)},[x]);let m=(0,s.useCallback)(e=>{if(!i)return!0;switch(e){case"merge":default:return!0;case"export":case"report":return r;case"records":case"enrich":return r&&o}},[i,r,o]);return{merged:r,advanced:o,loaded:i,isEnabled:m,refresh:x}}},1348:function(e,t,r){"use strict";r.d(t,{v:function(){return l}});var s=r(9376);function l(){let e=(0,s.useParams)(),t=null==e?void 0:e.id;if(t&&"_"!==t)return decodeURIComponent(t);{let e=window.location.pathname.match(/\/projects\/([^/]+)/);if(e&&e[1]&&"_"!==e[1])return decodeURIComponent(e[1])}return null!=t?t:"_"}},1769:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},4972:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])},401:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9322:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},2934:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3953:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Combine",[["path",{d:"M10 18H5a3 3 0 0 1-3-3v-1",key:"ru65g8"}],["path",{d:"M14 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2",key:"e30een"}],["path",{d:"M20 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2",key:"2ahx8o"}],["path",{d:"m7 21 3-3-3-3",key:"127cv2"}],["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}]])},91:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},2735:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},7342:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]])},8872:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]])},1649:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]])},9857:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("FileType",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]])},5751:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]])},1817:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},6337:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},8920:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},7689:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},9525:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]])},2489:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(9205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},function(e){e.O(0,[156,244,971,117,744],function(){return e(e.s=7876)}),_N_E=e.O()}]);
|