texlite 0.19.0 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESIGN.md +127 -14
- package/OPERATIONS.md +47 -5
- package/README.md +4 -0
- package/README.zh-CN.md +3 -0
- package/dist/client/assets/AdminUsers-D5vhK_Ae.js +1 -0
- package/dist/client/assets/AdminUsers-D5vhK_Ae.js.br +0 -0
- package/dist/client/assets/AdminUsers-D5vhK_Ae.js.gz +0 -0
- package/dist/client/assets/{AgentIcon-BlHvdrRo.js → AgentIcon-C97W4Mt-.js} +1 -1
- package/dist/client/assets/AgentIcon-C97W4Mt-.js.br +0 -0
- package/dist/client/assets/AgentIcon-C97W4Mt-.js.gz +0 -0
- package/dist/client/assets/{AgentIcon-DE7FEpRY.css → AgentIcon-DxrC-zx_.css} +1 -1
- package/dist/client/assets/AgentIcon-DxrC-zx_.css.br +0 -0
- package/dist/client/assets/AgentIcon-DxrC-zx_.css.gz +0 -0
- package/dist/client/assets/AgentManagement-D6I_GDL_.js +1 -0
- package/dist/client/assets/AgentManagement-D6I_GDL_.js.br +0 -0
- package/dist/client/assets/AgentManagement-D6I_GDL_.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-fsHpIB_c.js +2 -0
- package/dist/client/assets/AgentTerminal-fsHpIB_c.js.br +0 -0
- package/dist/client/assets/AgentTerminal-fsHpIB_c.js.gz +0 -0
- package/dist/client/assets/{AgentTerminalSurface-D0MLcJmw.js → AgentTerminalSurface-C11baRxh.js} +2 -2
- package/dist/client/assets/AgentTerminalSurface-C11baRxh.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-C11baRxh.js.gz +0 -0
- package/dist/client/assets/AvatarSettingsDialog-B80aSza0.js +1 -0
- package/dist/client/assets/AvatarSettingsDialog-B80aSza0.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-B80aSza0.js.gz +0 -0
- package/dist/client/assets/CitationLibraryDialog-DE7W81FW.js +1 -0
- package/dist/client/assets/CitationLibraryDialog-DE7W81FW.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-DE7W81FW.js.gz +0 -0
- package/dist/client/assets/Dashboard-DAPwKNNH.js +5 -0
- package/dist/client/assets/Dashboard-DAPwKNNH.js.br +0 -0
- package/dist/client/assets/Dashboard-DAPwKNNH.js.gz +0 -0
- package/dist/client/assets/GitDialog-BzyA_IgU.js +3 -0
- package/dist/client/assets/GitDialog-BzyA_IgU.js.br +0 -0
- package/dist/client/assets/GitDialog-BzyA_IgU.js.gz +0 -0
- package/dist/client/assets/GitHubAccountDialog-tigrQQNz.js +1 -0
- package/dist/client/assets/GitHubAccountDialog-tigrQQNz.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-tigrQQNz.js.gz +0 -0
- package/dist/client/assets/{GitHubIcon-BPTVKTrM.js → GitHubIcon-BqDow-CN.js} +1 -1
- package/dist/client/assets/HistoryDialog-407q3Fe6.js +8 -0
- package/dist/client/assets/HistoryDialog-407q3Fe6.js.br +0 -0
- package/dist/client/assets/HistoryDialog-407q3Fe6.js.gz +0 -0
- package/dist/client/assets/{LatexEditor-BDpqgoOa.js → LatexEditor-BYiVPD_b.js} +26 -26
- package/dist/client/assets/LatexEditor-BYiVPD_b.js.br +0 -0
- package/dist/client/assets/LatexEditor-BYiVPD_b.js.gz +0 -0
- package/dist/client/assets/{PdfPreview-C2puKgCh.js → PdfPreview-Bbzop29j.js} +1 -1
- package/dist/client/assets/PdfPreview-Bbzop29j.js.br +0 -0
- package/dist/client/assets/PdfPreview-Bbzop29j.js.gz +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-CsT5Pj4j.js +1 -0
- package/dist/client/assets/ProjectIconPickerDialog-CsT5Pj4j.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-CsT5Pj4j.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-BfvAiyC6.js +4 -0
- package/dist/client/assets/ProjectSettings-BfvAiyC6.js.br +0 -0
- package/dist/client/assets/ProjectSettings-BfvAiyC6.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-DHVcaXR0.js +30 -0
- package/dist/client/assets/ProjectWorkspace-DHVcaXR0.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-DHVcaXR0.js.gz +0 -0
- package/dist/client/assets/{QuickOpenDialog-CEYxIk4l.js → QuickOpenDialog-DKq9iNJ5.js} +1 -1
- package/dist/client/assets/QuickOpenDialog-DKq9iNJ5.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-DKq9iNJ5.js.gz +0 -0
- package/dist/client/assets/SaveButton-C8W1DGzx.js +1 -0
- package/dist/client/assets/{SelectionHistoryDialog-DBL6vVD4.js → SelectionHistoryDialog-cDxbuXmO.js} +2 -2
- package/dist/client/assets/SelectionHistoryDialog-cDxbuXmO.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-cDxbuXmO.js.gz +0 -0
- package/dist/client/assets/SuccessNotice-ubBtzzi_.js +1 -0
- package/dist/client/assets/SystemMetricsDialog-GZbYEHna.js +1 -0
- package/dist/client/assets/SystemMetricsDialog-GZbYEHna.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-GZbYEHna.js.gz +0 -0
- package/dist/client/assets/TagColorSelect-D-zwdawC.js +1 -0
- package/dist/client/assets/TagManagementDialog-BN3tlXuW.js +1 -0
- package/dist/client/assets/TagManagementDialog-BN3tlXuW.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-BN3tlXuW.js.gz +0 -0
- package/dist/client/assets/{WordCountDialog-DaHxqArj.js → WordCountDialog-C4okQWS3.js} +1 -1
- package/dist/client/assets/WordCountDialog-C4okQWS3.js.br +0 -0
- package/dist/client/assets/WordCountDialog-C4okQWS3.js.gz +0 -0
- package/dist/client/assets/{arrow-down-BySB1dS6.js → arrow-down-BiIGj4-X.js} +1 -1
- package/dist/client/assets/check-DfWHdQ1s.js +1 -0
- package/dist/client/assets/chevron-up-lyMKml7P.js +1 -0
- package/dist/client/assets/{chktex-B2-niLAo.js → chktex-Dm6IIkcR.js} +1 -1
- package/dist/client/assets/{circle-check-CfK-oqlC.js → circle-check-DjXwnxuR.js} +1 -1
- package/dist/client/assets/{clock-3-C_8q2yLj.js → clock-3-D-XeFtkK.js} +1 -1
- package/dist/client/assets/{dist-CIxSPQK5.js → dist-ByqeNQqT.js} +1 -1
- package/dist/client/assets/dist-ByqeNQqT.js.br +0 -0
- package/dist/client/assets/dist-ByqeNQqT.js.gz +0 -0
- package/dist/client/assets/{eye-DpIOhQ2p.js → eye-BvCLgqrq.js} +1 -1
- package/dist/client/assets/{hard-drive-DRbINIYf.js → hard-drive-Crh-l_oh.js} +1 -1
- package/dist/client/assets/i18n-O9QnEo2t.js +13 -0
- package/dist/client/assets/i18n-O9QnEo2t.js.br +0 -0
- package/dist/client/assets/i18n-O9QnEo2t.js.gz +0 -0
- package/dist/client/assets/index-7d5TfVNx.css +1 -0
- package/dist/client/assets/index-7d5TfVNx.css.br +0 -0
- package/dist/client/assets/index-7d5TfVNx.css.gz +0 -0
- package/dist/client/assets/index-DFEpXxLs.js +42 -0
- package/dist/client/assets/index-DFEpXxLs.js.br +0 -0
- package/dist/client/assets/index-DFEpXxLs.js.gz +0 -0
- package/dist/client/assets/{info-DB-RajXx.js → info-g1IBvVg6.js} +1 -1
- package/dist/client/assets/{minimize-2-DtsKyo4M.js → minimize-2-BHKmubQs.js} +1 -1
- package/dist/client/assets/{minus-CdwrG9Yo.js → minus-BmWzkFwz.js} +1 -1
- package/dist/client/assets/plus-CoYCCEFJ.js +1 -0
- package/dist/client/assets/{refresh-cw-c6Tzy-hb.js → refresh-cw-Di6Huxb4.js} +1 -1
- package/dist/client/assets/relativeTime-CFNodf1I.js +1 -0
- package/dist/client/assets/relativeTime-CFNodf1I.js.br +0 -0
- package/dist/client/assets/relativeTime-CFNodf1I.js.gz +0 -0
- package/dist/client/assets/{search-Cy8DgYGb.js → search-l36unLLS.js} +1 -1
- package/dist/client/assets/{spellCheck-DEQIFH7w.js → spellCheck-DiNvmZKv.js} +1 -1
- package/dist/client/assets/spellCheck-DiNvmZKv.js.br +0 -0
- package/dist/client/assets/spellCheck-DiNvmZKv.js.gz +0 -0
- package/dist/client/assets/tags-yjr9KRc8.js +1 -0
- package/dist/client/assets/{terminal-DaAc1558.js → terminal-P09ZGT83.js} +1 -1
- package/dist/client/assets/{type-Cm3TiSO6.js → type-C7rzXWVU.js} +1 -1
- package/dist/client/assets/{user-plus-BLC3_SFQ.js → user-plus-CqyV7OV4.js} +1 -1
- package/dist/client/index.html +3 -3
- package/dist/server/agents/adapters/claude.js +170 -9
- package/dist/server/agents/adapters/opencode.js +15 -3
- package/dist/server/agents/sessions.js +18 -8
- package/dist/server/collaboration.js +2 -1
- package/dist/server/db.js +5 -0
- package/dist/server/projects.js +2 -1
- package/dist/server/routes/projectShared.js +7 -1
- package/dist/server/routes/projects.js +15 -9
- package/dist/server/routes/users.js +7 -1
- package/dist/shared/projectCatalog.js +1 -0
- package/dist/shared/sourceCommentAnchors.js +52 -4
- package/dist/shared/userManagement.js +1 -0
- package/package.json +1 -1
- package/dist/client/assets/AdminUsers-DXWi8wl0.js +0 -1
- package/dist/client/assets/AdminUsers-DXWi8wl0.js.br +0 -0
- package/dist/client/assets/AdminUsers-DXWi8wl0.js.gz +0 -0
- package/dist/client/assets/AgentIcon-BlHvdrRo.js.br +0 -0
- package/dist/client/assets/AgentIcon-BlHvdrRo.js.gz +0 -0
- package/dist/client/assets/AgentIcon-DE7FEpRY.css.br +0 -0
- package/dist/client/assets/AgentIcon-DE7FEpRY.css.gz +0 -0
- package/dist/client/assets/AgentManagement-CDWaxEmP.js +0 -1
- package/dist/client/assets/AgentManagement-CDWaxEmP.js.br +0 -0
- package/dist/client/assets/AgentManagement-CDWaxEmP.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-BXH3gHWm.js +0 -2
- package/dist/client/assets/AgentTerminal-BXH3gHWm.js.br +0 -0
- package/dist/client/assets/AgentTerminal-BXH3gHWm.js.gz +0 -0
- package/dist/client/assets/AgentTerminalSurface-D0MLcJmw.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-D0MLcJmw.js.gz +0 -0
- package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js +0 -1
- package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js.gz +0 -0
- package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js +0 -1
- package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js.gz +0 -0
- package/dist/client/assets/Dashboard-Dzq1oMZU.js +0 -5
- package/dist/client/assets/Dashboard-Dzq1oMZU.js.br +0 -0
- package/dist/client/assets/Dashboard-Dzq1oMZU.js.gz +0 -0
- package/dist/client/assets/GitDialog-CzgguGGW.js +0 -3
- package/dist/client/assets/GitDialog-CzgguGGW.js.br +0 -0
- package/dist/client/assets/GitDialog-CzgguGGW.js.gz +0 -0
- package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js +0 -1
- package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js.gz +0 -0
- package/dist/client/assets/HistoryDialog-Bw3GHfbM.js +0 -8
- package/dist/client/assets/HistoryDialog-Bw3GHfbM.js.br +0 -0
- package/dist/client/assets/HistoryDialog-Bw3GHfbM.js.gz +0 -0
- package/dist/client/assets/LatexEditor-BDpqgoOa.js.br +0 -0
- package/dist/client/assets/LatexEditor-BDpqgoOa.js.gz +0 -0
- package/dist/client/assets/PdfPreview-C2puKgCh.js.br +0 -0
- package/dist/client/assets/PdfPreview-C2puKgCh.js.gz +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js +0 -1
- package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-B_y5nRgp.js +0 -4
- package/dist/client/assets/ProjectSettings-B_y5nRgp.js.br +0 -0
- package/dist/client/assets/ProjectSettings-B_y5nRgp.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js +0 -30
- package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js.gz +0 -0
- package/dist/client/assets/QuickOpenDialog-CEYxIk4l.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-CEYxIk4l.js.gz +0 -0
- package/dist/client/assets/SelectionHistoryDialog-DBL6vVD4.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-DBL6vVD4.js.gz +0 -0
- package/dist/client/assets/SuccessNotice-C8XV7MAJ.js +0 -1
- package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js +0 -1
- package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js.gz +0 -0
- package/dist/client/assets/TagColorSelect-CfJaFovr.js +0 -1
- package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js +0 -1
- package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-DaHxqArj.js.br +0 -0
- package/dist/client/assets/WordCountDialog-DaHxqArj.js.gz +0 -0
- package/dist/client/assets/binary-B57nBiwS.js +0 -1
- package/dist/client/assets/check-B-GEn6vk.js +0 -1
- package/dist/client/assets/chevron-up-B0yLKMZJ.js +0 -1
- package/dist/client/assets/dist-CIxSPQK5.js.br +0 -0
- package/dist/client/assets/dist-CIxSPQK5.js.gz +0 -0
- package/dist/client/assets/i18n-BzlyqR_B.js +0 -13
- package/dist/client/assets/i18n-BzlyqR_B.js.br +0 -0
- package/dist/client/assets/i18n-BzlyqR_B.js.gz +0 -0
- package/dist/client/assets/index-BHHBwQuG.css +0 -1
- package/dist/client/assets/index-BHHBwQuG.css.br +0 -0
- package/dist/client/assets/index-BHHBwQuG.css.gz +0 -0
- package/dist/client/assets/index-h0BVkT8k.js +0 -42
- package/dist/client/assets/index-h0BVkT8k.js.br +0 -0
- package/dist/client/assets/index-h0BVkT8k.js.gz +0 -0
- package/dist/client/assets/plus-PHvPlka_.js +0 -1
- package/dist/client/assets/relativeTime-Cf5dzFc9.js +0 -1
- package/dist/client/assets/relativeTime-Cf5dzFc9.js.br +0 -0
- package/dist/client/assets/relativeTime-Cf5dzFc9.js.gz +0 -0
- package/dist/client/assets/spellCheck-DEQIFH7w.js.br +0 -0
- package/dist/client/assets/spellCheck-DEQIFH7w.js.gz +0 -0
- package/dist/client/assets/tags-BQ0exG-g.js +0 -1
- package/dist/client/assets/terminalPreferences-CgacIg2F.js +0 -1
- package/dist/client/assets/terminalPreferences-CgacIg2F.js.br +0 -0
- package/dist/client/assets/terminalPreferences-CgacIg2F.js.gz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{$ as r,L as i,P as a,R as o,V as s,at as c,nt as l,rt as u,st as d,tt as f}from"./relativeTime-CFNodf1I.js";import{t as p}from"./check-DfWHdQ1s.js";import{t as m}from"./chevron-up-lyMKml7P.js";import{n as h,t as g}from"./tags-yjr9KRc8.js";import{t as _}from"./plus-CoYCCEFJ.js";import{t as v}from"./SaveButton-C8W1DGzx.js";import{t as y}from"./search-l36unLLS.js";import{C as b,E as x,b as S,c as C,j as w,s as ee,y as te}from"./index-DFEpXxLs.js";import{a as T,c as E,l as D,n as O,r as k,t as ne}from"./dist-ByqeNQqT.js";import{t as re}from"./SuccessNotice-ubBtzzi_.js";import{t as A}from"./TagColorSelect-D-zwdawC.js";import{citationBibtexLimitLabel as ie,citationVenue as j,parseBibEntriesResult as ae,parseSingleBibEntry as oe}from"./citationLibrary-BzlqZiFU.js";var M={name:`import`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m8 11 4 4 4-4`,key:`1dohi6`}],[`path`,{d:`M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4`,key:`1ywtjm`}]]};M.node;var N=S(M),P={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};P.node;var se=S(P),F=e(t(),1),I=n();function ce({tags:e,selectedId:t,onSelect:n,onManage:r}){let{t:i}=w(),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(1/0),[l,d]=(0,F.useState)(),f=(0,F.useRef)(null),p=t?[...e.filter(e=>e.id===t),...e.filter(e=>e.id!==t)]:e;(0,F.useLayoutEffect)(()=>{let e=f.current;if(!e)return;let t=()=>{let t=Array.from(e.querySelectorAll(`button`)),n=[...new Set(t.map(e=>e.offsetTop))][2],r=n===void 0?t:t.filter(e=>e.offsetTop<n);c(r.length),d(r.length?Math.max(...r.map(e=>e.offsetTop+e.offsetHeight)):void 0)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e,t]);let h=s<e.length+1;return(0,I.jsxs)(`div`,{className:`citation-tag-bar`,children:[(0,I.jsxs)(`div`,{className:`citation-tag-filter-catalog`,children:[(0,I.jsx)(`div`,{className:`citation-tag-filter-clip`,style:!a&&h?{maxHeight:l}:void 0,children:(0,I.jsxs)(`div`,{className:`citation-tag-filters`,ref:f,children:[(0,I.jsx)(`button`,{type:`button`,className:t?``:`active`,"aria-pressed":!t,onClick:()=>n(``),children:i(`citationLibrary.allTags`)}),p.map((e,r)=>{let i=!a&&r+1>=s;return(0,I.jsxs)(`button`,{type:`button`,className:t===e.id?`active`:``,"aria-pressed":t===e.id,"aria-hidden":i||void 0,tabIndex:i?-1:0,title:e.name,onClick:()=>n(t===e.id?``:e.id),children:[(0,I.jsx)(`span`,{className:`citation-tag-dot tag-${e.color}`}),(0,I.jsx)(`span`,{className:`citation-tag-name`,children:e.name})]},e.id)})]})}),e.length===0&&(0,I.jsx)(`span`,{className:`muted`,children:i(`citationLibrary.noTags`)}),h&&(0,I.jsxs)(`button`,{type:`button`,className:`citation-tag-expand`,"aria-expanded":a,onClick:()=>o(e=>!e),children:[a?(0,I.jsx)(m,{size:13}):(0,I.jsx)(u,{size:13}),i(a?`citationTagManagement.collapse`:`citationTagManagement.expand`)]})]}),(0,I.jsxs)(`button`,{type:`button`,className:`citation-tag-manage`,onClick:r,children:[(0,I.jsx)(g,{size:14}),i(`citationTagManagement.title`)]})]})}async function L(e,t){try{if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}}catch{}let n=t();if(!n?.isConnected||typeof document.execCommand!=`function`)throw Error(`Clipboard unavailable`);let r=document.activeElement,i=window.getSelection(),a=i?Array.from({length:i.rangeCount},(e,t)=>i.getRangeAt(t).cloneRange()):[],o=document.createElement(`textarea`);o.value=e,o.readOnly=!0,o.tabIndex=-1,o.setAttribute(`aria-hidden`,`true`),o.style.cssText=`position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none`,n.append(o);try{if(o.focus({preventScroll:!0}),o.select(),!document.execCommand(`copy`))throw Error(`Copy rejected`)}finally{if(o.remove(),r instanceof HTMLElement&&r.isConnected&&r.focus({preventScroll:!0}),i){i.removeAllRanges();for(let e of a)i.addRange(e)}}}function R({citationKey:e,bibtex:t,onTags:n,onEdit:i,onDelete:a,deleting:s=!1}){let{t:c}=w(),[l,u]=(0,F.useState)(`idle`),d=(0,F.useRef)(null),f=(0,F.useRef)(!1),m=(0,F.useRef)(0),_=(0,F.useRef)(void 0);(0,F.useEffect)(()=>(u(`idle`),()=>{m.current++,clearTimeout(_.current)}),[t]);let v=async()=>{let e=++m.current;clearTimeout(_.current),u(`copying`);try{if(await L(t,()=>d.current),e!==m.current)return;u(`copied`)}catch{if(e!==m.current)return;u(`error`)}_.current=setTimeout(()=>u(`idle`),2e3)};return(0,I.jsxs)(`span`,{ref:d,className:`citation-entry-controls`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`citation-copy-button${l===`copied`?` is-copied`:l===`error`?` is-error`:``}`,disabled:l===`copying`,onClick:()=>void v(),children:[l===`copying`?(0,I.jsx)(te,{className:`spin`,size:13,"aria-hidden":!0}):l===`copied`?(0,I.jsx)(p,{size:13,"aria-hidden":!0}):(0,I.jsx)(h,{size:13,"aria-hidden":!0}),(0,I.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:c(`citationLibraryActions.${l===`idle`?`copyBibtex`:l===`error`?`copyFailed`:l}`)})]}),(n||i||a)&&(0,I.jsxs)(ne,{modal:!1,children:[(0,I.jsx)(D,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`citation-entry-menu-trigger`,disabled:s,"aria-label":c(`citationLibraryActions.entryActions`,{key:e}),children:(0,I.jsx)(r,{size:17,"aria-hidden":!0})})}),(0,I.jsx)(T,{children:(0,I.jsxs)(O,{className:`citation-entry-menu`,align:`end`,sideOffset:5,collisionPadding:8,onCloseAutoFocus:e=>{f.current&&e.preventDefault(),f.current=!1},children:[n&&(0,I.jsxs)(k,{onSelect:()=>{f.current=!0,n()},children:[(0,I.jsx)(g,{size:14,"aria-hidden":!0}),c(`citationLibrary.tags`)]}),i&&(0,I.jsxs)(k,{onSelect:()=>{f.current=!0,i()},children:[(0,I.jsx)(se,{size:14,"aria-hidden":!0}),c(`common.edit`)]}),a&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(E,{className:`citation-entry-menu-separator`}),(0,I.jsxs)(k,{className:`danger-text`,onSelect:()=>{f.current=!0,a()},children:[(0,I.jsx)(o,{size:14,"aria-hidden":!0}),c(`common.delete`)]})]})]})})]})]})}function le({tags:e,onClose:t,onUpdated:n,onDeleted:r}){let{t:i}=w(),[a,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(`green`),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)(``),[h,g]=(0,F.useState)(`green`),[y,S]=(0,F.useState)(!1),[T,E]=(0,F.useState)(``),D=re(),[O,k]=(0,F.useState)(null),[ne,ie]=(0,F.useState)(``),j=async e=>{let t=(e?p:a).trim();if(!y&&t){S(!0),E(``),D.clear();try{let r=await x(e?`/api/citations/tags/${encodeURIComponent(e.id)}`:`/api/citations/tags`,{method:e?`PATCH`:`POST`,body:JSON.stringify({name:t,color:e?h:l})});n(r.tag),e?f(r.tag):c(``),D.show(e?`edit:${e.id}`:r.created===!1?`exists`:`create`)}catch(e){E(b(e))}finally{S(!1)}}},ae=async()=>{if(O&&!y){S(!0),ie(``),D.clear();try{await x(`/api/citations/tags/${encodeURIComponent(O.id)}`,{method:`DELETE`}),r(O.id),d?.id===O.id&&f(null),k(null)}catch(e){ie(b(e))}finally{S(!1)}}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(C,{open:!0,wide:!0,className:`tag-management-modal management-dialog`,title:i(`citationTagManagement.title`),description:i(`citationTagManagement.description`),onOpenChange:e=>{!e&&!y&&t()},footer:(0,I.jsx)(`button`,{disabled:y,onClick:t,children:i(`common.close`)}),children:(0,I.jsxs)(`div`,{className:`tag-management`,children:[T&&(0,I.jsx)(`p`,{className:`error dialog-error`,role:`alert`,children:T}),(0,I.jsxs)(`fieldset`,{disabled:y,className:`citation-tag-management-fields`,children:[(0,I.jsxs)(`form`,{className:`tag-management-create`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,I.jsxs)(`label`,{className:`tag-management-field`,children:[(0,I.jsx)(`span`,{children:i(`tags.name`)}),(0,I.jsx)(`input`,{autoFocus:!0,maxLength:32,value:a,placeholder:i(`citationLibrary.newTagPlaceholder`),onChange:e=>c(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`tag-management-field tag-management-color`,children:[(0,I.jsx)(`span`,{children:i(`tags.color`)}),(0,I.jsx)(A,{value:l,onChange:u,disabled:y})]}),(0,I.jsxs)(`button`,{type:`submit`,className:`primary`,disabled:!a.trim(),children:[y?(0,I.jsx)(te,{className:`spin`,size:14}):(0,I.jsx)(_,{size:14}),(0,I.jsx)(`span`,{role:`status`,children:i(D.message===`create`?`common.done`:D.message===`exists`?`citationTagManagement.exists`:`citationLibrary.createTag`)})]})]}),e.length===0?(0,I.jsx)(`p`,{className:`tag-management-empty`,children:i(`citationLibrary.noTags`)}):(0,I.jsx)(`div`,{className:`tag-management-list`,children:e.map(e=>(0,I.jsxs)(`article`,{className:`tag-management-item${d?.id===e.id?` editing`:``}`,children:[(0,I.jsxs)(`div`,{className:`tag-management-item-main`,children:[(0,I.jsx)(`span`,{className:`tag-dot tag-${e.color}`,"aria-hidden":!0}),(0,I.jsx)(`strong`,{title:e.name,children:e.name})]}),(0,I.jsxs)(`div`,{className:`tag-management-item-actions`,children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":i(`citationTagManagement.edit`,{tag:e.name}),onClick:()=>{f(e),m(e.name),g(e.color),E(``)},children:(0,I.jsx)(s,{size:14})}),(0,I.jsx)(`button`,{type:`button`,className:`danger-text`,"aria-label":i(`citationTagManagement.delete`,{tag:e.name}),onClick:()=>{k(e),ie(``)},children:(0,I.jsx)(o,{size:14})})]}),d?.id===e.id&&(0,I.jsxs)(`form`,{className:`tag-management-edit`,onSubmit:t=>{t.preventDefault(),j(e)},children:[(0,I.jsxs)(`label`,{className:`tag-management-field`,children:[(0,I.jsx)(`span`,{children:i(`tags.rename`)}),(0,I.jsx)(`input`,{maxLength:32,value:p,onChange:e=>m(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`tag-management-field tag-management-color`,children:[(0,I.jsx)(`span`,{children:i(`tags.color`)}),(0,I.jsx)(A,{value:h,onChange:g,disabled:y})]}),(0,I.jsxs)(`div`,{className:`tag-management-edit-actions`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>{f(null),E(``)},children:i(`common.cancel`)}),(0,I.jsx)(v,{type:`submit`,saving:y,feedback:D.message===`edit:${e.id}`?i(`editor.saved`):``,disabled:!p.trim(),children:i(`common.save`)})]})]})]},e.id))})]})]})}),(0,I.jsx)(ee,{open:!!O,title:i(`tags.deleteTitle`),description:i(`citationTagManagement.deleteDescription`,{tag:O?.name??``}),confirmLabel:i(`common.delete`),danger:!0,busy:y,error:ne,onCancel:()=>{y||k(null)},onConfirm:()=>void ae()})]})}var ue={status:`empty`,entries:[]};function de({open:e,onOpenChange:t,page:n=!1,onBack:r,currentFile:o=``,currentSource:s=``,readOnly:u=!1,currentUserId:m,maxBibtexBytes:h,onInsert:g}){let{t:v}=w(),[S,T]=(0,F.useState)(`library`),[E,D]=(0,F.useState)(``),[O,k]=(0,F.useState)(``),[ne,A]=(0,F.useState)([]),[j,M]=(0,F.useState)(1),[N,P]=(0,F.useState)({page:1,pageSize:60,total:0,totalPages:0}),[se,L]=(0,F.useState)(0),[R,de]=(0,F.useState)([]),[he,ge]=(0,F.useState)(!1),[z,B]=(0,F.useState)(null),[_e,V]=(0,F.useState)([]),[ve,ye]=(0,F.useState)(!1),[be,xe]=(0,F.useState)(!1),[H,U]=(0,F.useState)(null),[W,G]=(0,F.useState)(null),[Se,Ce]=(0,F.useState)(``),[we,K]=(0,F.useState)(!1),[Te,Ee]=(0,F.useState)(``),[De,Oe]=(0,F.useState)(null),[ke,Ae]=(0,F.useState)(null),[je,q]=(0,F.useState)(``),[J,Y]=(0,F.useState)(``),X=re();(0,F.useEffect)(()=>{e||ge(!1)},[e]);let[Me,Z]=(0,F.useState)(new Map),[Ne,Pe]=(0,F.useState)(!1),[Fe,Ie]=(0,F.useState)(0),Q=!!(/\.bib$/i.test(o)&&g),Le=(0,F.useMemo)(()=>e&&Q?ae(s,h):ue,[e,s,Q,h]),Re=Le.status===`too-large`,ze=Le.status===`invalid`,$=Le.entries,Be=(0,F.useMemo)(()=>new Set($.map(e=>e.citationKey.toLowerCase())),[$]);(0,F.useEffect)(()=>{if(!e)return;let t=new AbortController,n=window.setTimeout(()=>{xe(!0),Y(``);let e=new URLSearchParams;E.trim()&&e.set(`q`,E.trim()),O&&e.set(`tag`,O),e.set(`page`,String(j)),e.set(`pageSize`,`60`),x(`/api/citations?${e.toString()}`,{signal:t.signal}).then(e=>{A(e.entries),P(e.pagination),e.pagination.page!==j&&M(e.pagination.page)}).catch(e=>{e instanceof Error&&e.name===`AbortError`||Y(b(e))}).finally(()=>{t.signal.aborted||xe(!1)})},E.trim()?180:0);return()=>{window.clearTimeout(n),t.abort()}},[e,E,O,j,se]),(0,F.useEffect)(()=>{if(!e)return;let t=new AbortController;return x(`/api/citations/tags`,{signal:t.signal}).then(e=>de(e.tags)).catch(e=>{e instanceof Error&&e.name===`AbortError`||Y(b(e))}),()=>t.abort()},[e]),(0,F.useEffect)(()=>{if(!e||!Q){Z(new Map),Pe(!1);return}let t=new AbortController,n=[...new Set($.map(e=>e.citationKey))];return n.length?(Pe(!0),x(`/api/citations/lookup`,{method:`POST`,body:JSON.stringify({keys:n}),signal:t.signal}).then(e=>{Z(new Map(e.matches.map(e=>[e.citationKey.toLowerCase(),e])))}).catch(e=>{e instanceof Error&&e.name===`AbortError`||Y(b(e))}).finally(()=>{t.signal.aborted||Pe(!1)}),()=>t.abort()):(Z(new Map),Pe(!1),()=>t.abort())},[e,Q,$,Fe]),(0,F.useEffect)(()=>{e&&(T(`library`),D(``),k(``),M(1),P({page:1,pageSize:60,total:0,totalPages:0}),G(null),K(!1),Ee(``),B(null),Oe(null),Ae(null),q(``),Y(``),X.clear(),Z(new Map))},[e,Q]);let Ve=async e=>{X.clear(),U(e.citationKey),Y(``);try{let t=Me.get(e.citationKey.toLowerCase()),n=await x(`/api/citations`,{method:`POST`,body:JSON.stringify({bibtex:e.bibtex,citationKey:e.citationKey,entryType:e.entryType,title:e.title,authors:e.authors,year:e.year,overwrite:!!t,expectedRevision:t?.revision})});A(e=>[n.entry,...e.filter(e=>e.id!==n.entry.id&&e.citationKey.toLowerCase()!==n.entry.citationKey.toLowerCase())]),Z(e=>new Map(e).set(n.entry.citationKey.toLowerCase(),{id:n.entry.id,citationKey:n.entry.citationKey,revision:n.entry.revision})),B(n.entry),V(n.entry.tags.map(e=>e.id)),X.show(`entry:${e.citationKey.toLowerCase()}`),M(1),L(e=>e+1)}catch(e){Y(b(e)),Ie(e=>e+1)}finally{U(null)}},He=async()=>{if(W){X.clear(),U(W.citationKey),Y(``);try{let e=oe(Se,h);if(!e){Y(v(`citationErrors.invalid`));return}let t=await x(`/api/citations/${encodeURIComponent(W.id)}`,{method:`PATCH`,body:JSON.stringify({bibtex:e.bibtex,citationKey:e.citationKey,entryType:e.entryType,title:e.title,authors:e.authors,year:e.year,expectedRevision:W.revision})});A(e=>[t.entry,...e.filter(e=>e.id!==t.entry.id)]),Z(e=>{let n=new Map(e);return n.delete(W.citationKey.toLowerCase()),n.set(t.entry.citationKey.toLowerCase(),{id:t.entry.id,citationKey:t.entry.citationKey,revision:t.entry.revision}),n}),G(e=>e?.id===t.entry.id?t.entry:e),X.show(`edit:${t.entry.id}`),M(1),L(e=>e+1)}catch(e){Y(b(e))}finally{U(null)}}},Ue=async()=>{if(Te.trim()){X.clear(),U(`__new__`),Y(``);try{let e=oe(Te,h);if(!e){Y(v(`citationErrors.invalid`));return}let t=await x(`/api/citations`,{method:`POST`,body:JSON.stringify({bibtex:e.bibtex,citationKey:e.citationKey,entryType:e.entryType,title:e.title,authors:e.authors,year:e.year})});A(e=>[t.entry,...e.filter(e=>e.id!==t.entry.id&&e.citationKey.toLowerCase()!==t.entry.citationKey.toLowerCase())]),Z(e=>new Map(e).set(t.entry.citationKey.toLowerCase(),{id:t.entry.id,citationKey:t.entry.citationKey,revision:t.entry.revision})),K(!1),Ee(``),X.show(`add`),B(t.entry),V(t.entry.tags.map(e=>e.id)),M(1),L(e=>e+1)}catch(e){Y(b(e))}finally{U(null)}}},We=e=>{de(t=>[...t.filter(t=>t.id!==e.id),e].sort((e,t)=>e.name.localeCompare(t.name)));let t=t=>({...t,tags:t.tags.map(t=>t.id===e.id?e:t)});A(e=>e.map(t)),B(e=>e?t(e):null),G(e=>e?t(e):null)},Ge=e=>{de(t=>t.filter(t=>t.id!==e));let t=t=>({...t,tags:t.tags.filter(t=>t.id!==e)});A(e=>e.map(t)),B(e=>e?t(e):null),G(e=>e?t(e):null),V(t=>t.filter(t=>t!==e)),O===e&&(k(``),M(1))},Ke=e=>{X.clear(),G(null),K(!1),B(e),V(e.tags.map(e=>e.id))},qe=async()=>{if(z){X.clear(),ye(!0),Y(``);try{let e=await x(`/api/citations/${encodeURIComponent(z.id)}/tags`,{method:`PATCH`,body:JSON.stringify({tagIds:_e,expectedRevision:z.revision})});A(t=>t.map(t=>t.id===e.entry.id?e.entry:t)),Z(t=>new Map(t).set(e.entry.citationKey.toLowerCase(),{id:e.entry.id,citationKey:e.entry.citationKey,revision:e.entry.revision})),B(t=>t?.id===e.entry.id?e.entry:t),V(e.entry.tags.map(e=>e.id)),X.show(`tags:${e.entry.id}`),L(e=>e+1)}catch(e){Y(b(e))}finally{ye(!1)}}},Je=async e=>{Oe(e.id),q(``);try{await x(`/api/citations/${encodeURIComponent(e.id)}`,{method:`DELETE`}),A(t=>t.filter(t=>t.id!==e.id)),Z(t=>{let n=new Map(t);return n.delete(e.citationKey.toLowerCase()),n}),W?.id===e.id&&G(null),z?.id===e.id&&B(null),M(1),L(e=>e+1),Ae(null)}catch(e){q(b(e))}finally{Oe(null)}},Ye=(0,I.jsxs)(`div`,{className:`citation-library-dialog`,children:[(0,I.jsxs)(`div`,{className:`citation-library-tabs`,role:`tablist`,"aria-label":v(`citationLibrary.title`),children:[(0,I.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":S===`library`,className:S===`library`?`active`:``,onClick:()=>T(`library`),children:[(0,I.jsx)(c,{size:15}),v(`citationLibrary.myLibrary`),(0,I.jsx)(`span`,{children:N.total})]}),Q&&(0,I.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":S===`current`,className:S===`current`?`active`:``,onClick:()=>T(`current`),children:[(0,I.jsx)(_,{size:15}),v(`citationLibrary.currentFile`),(0,I.jsx)(`span`,{children:$.length})]})]}),J&&!(n&&(z||W))&&(0,I.jsx)(`p`,{className:`error dialog-error`,children:J}),S===`library`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`citation-library-search-row`,children:[(0,I.jsxs)(`label`,{className:`citation-library-search`,children:[(0,I.jsx)(y,{size:15}),(0,I.jsx)(`input`,{autoFocus:!0,placeholder:v(`citationLibrary.searchPlaceholder`),value:E,onChange:e=>{D(e.target.value),M(1)}}),(0,I.jsx)(`span`,{children:v(`citationLibrary.searchHint`)})]}),(0,I.jsxs)(`button`,{type:`button`,className:`citation-add-entry-button`,onClick:()=>{X.clear(),K(!0),G(null),B(null)},children:[(0,I.jsx)(_,{size:14}),(0,I.jsx)(`span`,{role:`status`,children:v(X.message===`add`?`common.done`:`citationLibraryActions.addEntry`)})]})]}),(0,I.jsx)(ce,{tags:R,selectedId:O,onSelect:e=>{k(e),M(1)},onManage:()=>ge(!0)}),we&&(0,I.jsxs)(`div`,{className:`citation-edit-panel`,children:[(0,I.jsxs)(`div`,{className:`citation-edit-header`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`strong`,{children:v(`citationLibraryActions.addEntryTitle`)}),(0,I.jsx)(`small`,{children:v(`citationLibraryActions.addEntryDescription`)})]}),(0,I.jsx)(`button`,{type:`button`,"aria-label":v(`common.close`),onClick:()=>K(!1),children:(0,I.jsx)(a,{size:15})})]}),(0,I.jsx)(`textarea`,{autoFocus:!0,value:Te,onChange:e=>Ee(e.target.value),placeholder:v(`citationLibraryActions.addEntryPlaceholder`),spellCheck:!1,rows:9}),(0,I.jsxs)(`div`,{className:`citation-edit-actions`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>K(!1),children:v(`common.cancel`)}),(0,I.jsxs)(`button`,{type:`button`,className:`primary`,disabled:!Te.trim()||H===`__new__`,onClick:()=>void Ue(),children:[H===`__new__`?(0,I.jsx)(te,{className:`spin`,size:14}):(0,I.jsx)(p,{size:14}),v(`citationLibraryActions.addEntry`)]})]})]}),be&&!W&&!z?(0,I.jsxs)(`div`,{className:`citation-library-empty`,children:[(0,I.jsx)(te,{className:`spin`,size:22}),(0,I.jsx)(`span`,{children:v(`common.loading`)})]}):ne.length===0?(0,I.jsxs)(`div`,{className:`citation-library-empty`,children:[(0,I.jsx)(c,{size:28}),(0,I.jsx)(`strong`,{children:v(`citationLibrary.emptyTitle`)}),(0,I.jsx)(`span`,{children:v(O?`citationLibrary.noTagMatches`:`citationLibrary.emptyDescription`)})]}):(0,I.jsx)(`div`,{className:`citation-entry-list`,children:ne.map(e=>(0,I.jsxs)(`div`,{className:`citation-entry-item`,children:[(0,I.jsx)(fe,{entry:e,selected:z?.id===e.id||W?.id===e.id,alreadyInFile:!n&&Be.has(e.citationKey.toLowerCase()),importDisabled:u,deleting:De===e.id,onImport:g?async()=>{await g(e)&&t(!1)}:void 0,onEdit:e.ownerId===m?()=>{X.clear(),B(null),K(!1),G(e),Ce(e.bibtex)}:void 0,onTags:e.ownerId===m?()=>Ke(e):void 0,onDelete:e.ownerId===m?()=>{Ae(e),q(``)}:void 0,t:v}),!n&&z?.id===e.id&&(0,I.jsx)(pe,{feedback:X.message===`tags:${z.id}`?v(`editor.saved`):``,entry:z,tags:R,selectedIds:_e,saving:ve,onClose:()=>B(null),onToggle:e=>V(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),onSave:()=>void qe(),t:v}),!n&&W?.id===e.id&&(0,I.jsx)(me,{feedback:X.message===`edit:${W.id}`?v(`editor.saved`):``,title:v(`citationLibrary.editTitle`,{key:W.citationKey}),value:Se,saving:H===W.citationKey,onChange:Ce,onClose:()=>G(null),onSave:()=>void He(),t:v})]},e.id))}),N.totalPages>1&&(0,I.jsxs)(`nav`,{className:`citation-library-pagination`,"aria-label":v(`citationLibraryPagination.pageOf`,{page:N.page,totalPages:N.totalPages,count:N.total}),children:[(0,I.jsxs)(`button`,{type:`button`,disabled:N.page<=1,onClick:()=>M(e=>Math.max(1,e-1)),children:[(0,I.jsx)(l,{size:14}),v(`citationLibraryPagination.previous`)]}),(0,I.jsx)(`span`,{children:v(`citationLibraryPagination.pageOf`,{page:N.page,totalPages:N.totalPages,count:N.total})}),(0,I.jsxs)(`button`,{type:`button`,disabled:N.page>=N.totalPages,onClick:()=>M(e=>Math.min(N.totalPages,e+1)),children:[v(`citationLibraryPagination.next`),(0,I.jsx)(f,{size:14})]})]})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`citation-current-heading`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`strong`,{children:v(`citationLibrary.currentFileTitle`)}),(0,I.jsx)(`span`,{children:v(`citationLibrary.currentFileDescription`)})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>T(`library`),children:[(0,I.jsx)(l,{size:14}),v(`citationLibrary.backToLibrary`)]})]}),Re&&(0,I.jsxs)(`p`,{className:`warning citation-library-warning`,children:[(0,I.jsx)(i,{size:15}),v(`citationLibrary.fileTooLarge`,{size:ie(h)})]}),ze&&(0,I.jsxs)(`p`,{className:`warning citation-library-warning`,children:[(0,I.jsx)(i,{size:15}),v(`citationLibrary.fileInvalid`)]}),$.length===0?(0,I.jsxs)(`div`,{className:`citation-library-empty`,children:[(0,I.jsx)(c,{size:28}),(0,I.jsx)(`strong`,{children:v(`citationLibrary.noEntries`)}),(0,I.jsx)(`span`,{children:v(Re?`citationLibrary.fileTooLargeHint`:ze?`citationLibrary.fileInvalidHint`:`citationLibrary.noEntriesDescription`)})]}):(0,I.jsx)(`div`,{className:`citation-entry-list`,children:$.map((e,t)=>(0,I.jsxs)(`div`,{className:`citation-entry-item`,children:[(0,I.jsx)(fe,{saveFeedback:X.message===`entry:${e.citationKey.toLowerCase()}`?v(`editor.saved`):``,entry:e,saved:Me.has(e.citationKey.toLowerCase()),saving:H===e.citationKey,saveDisabled:Ne,onSave:()=>void Ve(e),t:v}),!n&&z?.citationKey.toLowerCase()===e.citationKey.toLowerCase()&&(0,I.jsx)(pe,{feedback:X.message===`tags:${z.id}`?v(`editor.saved`):``,entry:z,tags:R,selectedIds:_e,saving:ve,onClose:()=>B(null),onToggle:e=>V(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),onSave:()=>void qe(),t:v})]},`${e.citationKey}-${t}`))})]})]}),Xe=(0,I.jsx)(ee,{open:!!ke,title:v(`citationLibrary.deleteTitle`),description:v(`citationLibrary.deleteDescription`,{key:ke?.citationKey??``}),confirmLabel:v(`common.delete`),danger:!0,error:je,busy:!!De,onCancel:()=>{Ae(null),q(``)},onConfirm:()=>{let e=ke;e&&Je(e)}}),Ze=e&&he&&(0,I.jsx)(le,{tags:R,onClose:()=>ge(!1),onUpdated:We,onDeleted:Ge});return n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`section`,{className:`citation-library-page management-page`,children:[(0,I.jsxs)(`header`,{className:`section-title citation-library-page-header`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{children:[(0,I.jsx)(c,{"aria-hidden":!0,size:25}),v(`citationLibrary.title`)]}),(0,I.jsx)(`p`,{children:v(`citationLibraryHomeDescription`)})]}),r&&(0,I.jsxs)(`button`,{type:`button`,className:`dashboard-back-button`,onClick:r,children:[(0,I.jsx)(d,{size:14}),v(`navigation.backToProjects`)]})]}),Ye]}),z&&(0,I.jsx)(C,{open:!0,className:`management-dialog`,title:v(`citationLibrary.tagsTitle`,{key:z.citationKey}),description:v(`citationLibrary.tags`),onOpenChange:e=>{e||(B(null),Y(``))},children:(0,I.jsxs)(I.Fragment,{children:[J&&(0,I.jsx)(`p`,{className:`error dialog-error`,children:J}),(0,I.jsx)(pe,{feedback:X.message===`tags:${z.id}`?v(`editor.saved`):``,entry:z,tags:R,selectedIds:_e,saving:ve,modal:!0,onClose:()=>{B(null),Y(``)},onToggle:e=>V(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),onSave:()=>void qe(),t:v})]})}),W&&(0,I.jsx)(C,{open:!0,extraWide:!0,className:`management-dialog`,title:v(`citationLibrary.editTitle`,{key:W.citationKey}),description:v(`citationLibrary.title`),onOpenChange:e=>{e||(G(null),Y(``))},children:(0,I.jsxs)(I.Fragment,{children:[J&&(0,I.jsx)(`p`,{className:`error dialog-error`,children:J}),(0,I.jsx)(me,{feedback:X.message===`edit:${W.id}`?v(`editor.saved`):``,title:v(`citationLibrary.editTitle`,{key:W.citationKey}),value:Se,saving:H===W.citationKey,modal:!0,onChange:Ce,onClose:()=>{G(null),Y(``)},onSave:()=>void He(),t:v})]})}),Xe,Ze]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(C,{open:e,extraWide:!0,className:`citation-library-modal management-dialog`,title:v(`citationLibrary.title`),description:v(Q?`citationLibrary.description`:`citationLibraryHomeDescription`,{file:o}),onOpenChange:t,footer:(0,I.jsx)(`button`,{onClick:()=>t(!1),children:v(`common.close`)}),children:Ye}),Xe,Ze]})}function fe({entry:e,selected:t,alreadyInFile:n,saved:r,saving:i,saveFeedback:a,saveDisabled:o,importDisabled:s,deleting:c,onSave:l,onImport:u,onEdit:d,onTags:f,onDelete:m,t:h}){let g=`id`in e,_=g?e:null,y=j(e);return(0,I.jsxs)(`article`,{className:`citation-entry-card${t?` selected`:``}${n?` already-in-file`:``}`,title:n?h(`citationErrors.alreadyInFile`,{key:e.citationKey}):void 0,children:[(0,I.jsxs)(`div`,{className:`citation-entry-main`,children:[(0,I.jsxs)(`div`,{className:`citation-entry-heading`,children:[(0,I.jsx)(`code`,{children:e.citationKey}),(0,I.jsxs)(`span`,{children:[`@`,e.entryType]}),y&&(0,I.jsx)(`span`,{className:`citation-entry-venue`,title:y,children:y}),r&&(0,I.jsxs)(`em`,{children:[(0,I.jsx)(p,{size:11}),h(`citationLibrary.savedLabel`)]})]}),(0,I.jsx)(`strong`,{title:e.title||h(`citationLibrary.untitled`),children:e.title||h(`citationLibrary.untitled`)}),(0,I.jsxs)(`p`,{children:[e.authors||h(`citationLibrary.authorUnknown`),e.year&&(0,I.jsxs)(`span`,{children:[` · `,e.year]})]}),_&&_.tags.length>0&&(0,I.jsx)(`div`,{className:`citation-entry-tags`,children:_.tags.map(e=>(0,I.jsxs)(`span`,{className:`citation-tag-pill tag-${e.color}`,children:[(0,I.jsx)(`span`,{className:`citation-tag-dot`}),e.name]},e.id))})]}),(0,I.jsxs)(`div`,{className:`citation-entry-actions`,children:[l&&(0,I.jsx)(v,{iconSize:13,saving:i||o,feedback:a,onClick:l,children:h(i?`citationLibrary.saving`:r?`citationLibrary.update`:`citationLibrary.save`)}),u&&(0,I.jsxs)(`button`,{type:`button`,disabled:s||n,title:n?h(`citationErrors.alreadyInFile`,{key:e.citationKey}):h(s?`citationLibrary.importRequiresWrite`:`citationLibrary.importToFile`),onClick:()=>void u(),children:[(0,I.jsx)(N,{size:13}),h(`citationLibrary.import`)]}),(0,I.jsx)(R,{citationKey:e.citationKey,bibtex:e.bibtex,deleting:c,onTags:_?f:void 0,onEdit:g?d:void 0,onDelete:g?m:void 0})]})]})}function pe({entry:e,tags:t,selectedIds:n,saving:r,feedback:i,modal:o=!1,onClose:s,onToggle:c,onSave:l,t:u}){let d=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`citation-tag-choice-list`,children:t.length===0?(0,I.jsx)(`span`,{className:`muted`,children:u(`citationLibrary.noTagsToAssign`)}):t.map(e=>(0,I.jsxs)(`label`,{children:[(0,I.jsx)(`input`,{type:`checkbox`,disabled:r,checked:n.includes(e.id),onChange:()=>c(e.id)}),(0,I.jsx)(`span`,{className:`citation-tag-dot tag-${e.color}`}),e.name]},e.id))}),(0,I.jsxs)(`div`,{className:`citation-edit-actions`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:s,children:u(`common.cancel`)}),(0,I.jsx)(v,{saving:r,feedback:i,disabled:t.length===0,onClick:l,children:u(`citationLibrary.saveTags`)})]})]});return o?(0,I.jsx)(`div`,{className:`citation-modal-form`,children:d}):(0,I.jsxs)(`div`,{className:`citation-tag-editor`,children:[(0,I.jsxs)(`div`,{className:`citation-edit-header`,children:[(0,I.jsx)(`strong`,{children:u(`citationLibrary.tagsTitle`,{key:e.citationKey})}),(0,I.jsx)(`button`,{type:`button`,"aria-label":u(`common.close`),onClick:s,children:(0,I.jsx)(a,{size:15})})]}),d]})}function me({title:e,value:t,saving:n,feedback:r,modal:i=!1,onChange:o,onClose:s,onSave:c,t:l}){let u=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`textarea`,{autoFocus:!i,disabled:n,value:t,onChange:e=>o(e.target.value),spellCheck:!1,rows:12}),(0,I.jsxs)(`div`,{className:`citation-edit-actions`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:s,children:l(`common.cancel`)}),(0,I.jsx)(v,{saving:n,feedback:r,disabled:!t.trim(),onClick:c,children:l(`common.save`)})]})]});return i?(0,I.jsx)(`div`,{className:`citation-modal-form citation-edit-panel`,children:u}):(0,I.jsxs)(`div`,{className:`citation-edit-panel`,children:[(0,I.jsxs)(`div`,{className:`citation-edit-header`,children:[(0,I.jsx)(`strong`,{children:e}),(0,I.jsx)(`button`,{type:`button`,"aria-label":l(`common.close`),onClick:s,children:(0,I.jsx)(a,{size:15})})]}),u]})}export{de as CitationLibraryDialog};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AvatarSettingsDialog-B80aSza0.js","./rolldown-runtime-XKyaHtl9.js","./react-DUEFWlB7.js","./relativeTime-CFNodf1I.js","./basePath-B5-c90eh.js","./index-DFEpXxLs.js","./i18nInstance-CIMFwH0l.js","./i18n-O9QnEo2t.js","./vite-runtime-CRzLMJPS.js","./index-7d5TfVNx.css","./check-DfWHdQ1s.js","./SaveButton-C8W1DGzx.js","./circle-check-DjXwnxuR.js","./search-l36unLLS.js","./SystemMetricsDialog-GZbYEHna.js","./clock-3-D-XeFtkK.js","./info-g1IBvVg6.js","./refresh-cw-Di6Huxb4.js","./CitationLibraryDialog-DE7W81FW.js","./chevron-up-lyMKml7P.js","./tags-yjr9KRc8.js","./plus-CoYCCEFJ.js","./dist-ByqeNQqT.js","./SuccessNotice-ubBtzzi_.js","./TagColorSelect-D-zwdawC.js","./citationLibrary-BzlqZiFU.js","./AdminUsers-D5vhK_Ae.js","./user-plus-CqyV7OV4.js","./AgentManagement-D6I_GDL_.js","./arrow-down-BiIGj4-X.js","./AgentIcon-C97W4Mt-.js","./AgentIcon-DxrC-zx_.css","./TagManagementDialog-BN3tlXuW.js","./ProjectIconPickerDialog-CsT5Pj4j.js","./GitHubAccountDialog-tigrQQNz.js","./GitHubIcon-BqDow-CN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n,t as r}from"./react-DUEFWlB7.js";import{n as i,t as a}from"./i18n-O9QnEo2t.js";import{r as o,t as s}from"./basePath-B5-c90eh.js";import{t as c}from"./vite-runtime-CRzLMJPS.js";import{$ as l,B as u,D as d,E as f,F as p,G as m,H as h,I as ee,J as g,K as te,L as ne,P as re,Q as _,R as v,U as ie,V as ae,W as y,X as oe,Y as b,Z as se,at as ce,b as le,et as ue,f as de,i as fe,it as pe,k as me,n as he,nt as ge,o as _e,ot as ve,q as ye,r as be,rt as xe,st as Se,t as Ce,tt as we,w as Te,x as Ee,y as De,z as Oe}from"./relativeTime-CFNodf1I.js";import{n as ke,t as Ae}from"./tags-yjr9KRc8.js";import{n as x,r as je,t as Me}from"./GitHubIcon-BqDow-CN.js";import{t as Ne}from"./hard-drive-Crh-l_oh.js";import{n as Pe,t as Fe}from"./terminal-P09ZGT83.js";import{C as S,D as Ie,E as C,S as Le,a as Re,b as w,c as ze,i as Be,j as Ve,r as He,s as Ue,t as We,x as Ge,y as Ke}from"./index-DFEpXxLs.js";var qe={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};qe.node;var Je=w(qe),T={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};T.node;var Ye=w(T),E={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};E.node;var Xe=w(E),Ze={name:`arrow-down-up`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`m21 8-4-4-4 4`,key:`1c9v7m`}],[`path`,{d:`M17 4v16`,key:`7dpous`}]]};Ze.node;var Qe=w(Ze),D={name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]};D.node;var $e=w(D),et={name:`atom`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z`,key:`1l2ple`}],[`path`,{d:`M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z`,key:`1wam0m`}]]};et.node;var tt=w(et),nt={name:`beaker`,size:24,node:[[`path`,{d:`M4.5 3h15`,key:`c7n0jr`}],[`path`,{d:`M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3`,key:`m1uhx7`}],[`path`,{d:`M6 14h12`,key:`4cwo0f`}]]};nt.node;var rt=w(nt),O={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};O.node;var it=w(O),at={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};at.node;var ot=w(at),st={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};st.node;var ct=w(st),k={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};k.node;var lt=w(k),ut={name:`brain-circuit`,size:24,node:[[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 012 2v1`,key:`6s3bw4`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M12 9a4.17 4.17 0 01-3 4`,key:`13l7kh`}],[`path`,{d:`M16 8V5a2 2 0 012-2`,key:`gais5y`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}],[`path`,{d:`M6.294 6.294A3 3 0 1112 5v13a4 4 0 11-7.967-.518`,key:`m2z1wm`}],[`circle`,{cx:`16`,cy:`13`,r:`0.5`,fill:`currentColor`,key:`9zzywh`}],[`circle`,{cx:`18`,cy:`3`,r:`0.5`,fill:`currentColor`,key:`i2xui6`}],[`circle`,{cx:`20`,cy:`21`,r:`0.5`,fill:`currentColor`,key:`1dobdp`}],[`circle`,{cx:`20`,cy:`8`,r:`0.5`,fill:`currentColor`,key:`r9nqlq`}]]};ut.node;var A=w(ut),j={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};j.node;var dt=w(j),ft={name:`calculator`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`line`,{x1:`8`,x2:`16`,y1:`6`,y2:`6`,key:`x4nwl0`}],[`line`,{x1:`16`,x2:`16`,y1:`14`,y2:`18`,key:`wjye3r`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]};ft.node;var pt=w(ft),mt={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};mt.node;var ht=w(mt),gt={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};gt.node;var M=w(gt),_t={name:`chart-line`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]],aliases:[`line-chart`]};_t.node;var N=w(_t),vt={name:`chart-no-axes-combined`,size:24,node:[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]};vt.node;var P=w(vt),yt={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};yt.node;var bt=w(yt),xt={name:`chart-scatter`,size:24,node:[[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}],[`circle`,{cx:`18.5`,cy:`5.5`,r:`.5`,fill:`currentColor`,key:`lysivs`}],[`circle`,{cx:`11.5`,cy:`11.5`,r:`.5`,fill:`currentColor`,key:`byv1b8`}],[`circle`,{cx:`7.5`,cy:`16.5`,r:`.5`,fill:`currentColor`,key:`nkw3mc`}],[`circle`,{cx:`17.5`,cy:`14.5`,r:`.5`,fill:`currentColor`,key:`1gjh6j`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}]],aliases:[`scatter-chart`]};xt.node;var St=w(xt),Ct={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};Ct.node;var F=w(Ct),I={name:`circuit-board`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]};I.node;var wt=w(I),Tt={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};Tt.node;var Et=w(Tt),L={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};L.node;var Dt=w(L),Ot={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Ot.node;var R=w(Ot),kt={name:`database`,size:24,node:[[`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`}]]};kt.node;var At=w(kt),z={name:`dna`,size:24,node:[[`path`,{d:`m10 16 1.5 1.5`,key:`11lckj`}],[`path`,{d:`m14 8-1.5-1.5`,key:`1ohn8i`}],[`path`,{d:`M15 2c-1.798 1.998-2.518 3.995-2.807 5.993`,key:`80uv8i`}],[`path`,{d:`m16.5 10.5 1 1`,key:`696xn5`}],[`path`,{d:`m17 6-2.891-2.891`,key:`xu6p2f`}],[`path`,{d:`M2 15c6.667-6 13.333 0 20-6`,key:`1pyr53`}],[`path`,{d:`m20 9 .891.891`,key:`3xwk7g`}],[`path`,{d:`M3.109 14.109 4 15`,key:`q76aoh`}],[`path`,{d:`m6.5 12.5 1 1`,key:`cs35ky`}],[`path`,{d:`m7 18 2.891 2.891`,key:`1sisit`}],[`path`,{d:`M9 22c1.798-1.998 2.518-3.995 2.807-5.993`,key:`q3hbxp`}]]};z.node;var jt=w(z),B={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};B.node;var Mt=w(B),Nt={name:`file-chart-column-increasing`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M12 18v-4`,key:`q1q25u`}],[`path`,{d:`M16 18v-6`,key:`15y0np`}]],aliases:[`file-bar-chart`]};Nt.node;var V=w(Nt),Pt={name:`file-pen-line`,size:24,node:[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`,key:`ukzhwg`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`,key:`1klhew`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`,key:`rxaxab`}],[`path`,{d:`M8 18h1`,key:`13wk12`}]],aliases:[`file-signature`]};Pt.node;var Ft=w(Pt),It={name:`file-stack`,size:24,node:[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]};It.node;var Lt=w(It),Rt={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Rt.node;var zt=w(Rt),Bt={name:`folder-archive`,size:24,node:[[`circle`,{cx:`15`,cy:`19`,r:`2`,key:`u2pros`}],[`path`,{d:`M20.9 19.8A2 2 0 0 0 22 18V8a2 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 2h5.1`,key:`1jj40k`}],[`path`,{d:`M15 11v-1`,key:`cntcp`}],[`path`,{d:`M15 17v-2`,key:`1279jj`}]]};Bt.node;var Vt=w(Bt),Ht={name:`folder-kanban`,size:24,node:[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]};Ht.node;var Ut=w(Ht),H={name:`folder`,size:24,node:[[`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`}]]};H.node;var U=w(H),Wt={name:`graduation-cap`,size:24,node:[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]};Wt.node;var Gt=w(Wt),W={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};W.node;var Kt=w(W),qt={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};qt.node;var G=w(qt),Jt={name:`library`,size:24,node:[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]};Jt.node;var K=w(Jt),Yt={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};Yt.node;var Xt=w(Yt),Zt={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Zt.node;var Qt=w(Zt),q={name:`map`,size:24,node:[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]};q.node;var $t=w(q),J={name:`microscope`,size:24,node:[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]};J.node;var en=w(J),tn={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};tn.node;var nn=w(tn),rn={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};rn.node;var an=w(rn),Y={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};Y.node;var X=w(Y),on={name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]};on.node;var sn=w(on),Z={name:`notebook-pen`,size:24,node:[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]};Z.node;var cn=w(Z),ln={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};ln.node;var un=w(ln),dn={name:`pen-tool`,size:24,node:[[`path`,{d:`m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18`,key:`93nyr4`}],[`path`,{d:`M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z`,key:`lnux7s`}],[`path`,{d:`m3 3 6.586 6.586`,key:`1igwcn`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};dn.node;var fn=w(dn),pn={name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]};pn.node;var mn=w(pn),hn={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};hn.node;var gn=w(hn),_n={name:`regex`,size:24,node:[[`path`,{d:`M17 3v10`,key:`15fgeh`}],[`path`,{d:`m12.67 5.5 8.66 5`,key:`1gpheq`}],[`path`,{d:`m12.67 10.5 8.66-5`,key:`1dkfa6`}],[`path`,{d:`M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z`,key:`swwfx4`}]]};_n.node;var vn=w(_n),yn={name:`rocket`,size:24,node:[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]};yn.node;var bn=w(yn),xn={name:`rotate-ccw-clock`,size:24,node:[[`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`}]],aliases:[`history`]};xn.node;var Sn=w(xn),Cn={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};Cn.node;var wn=w(Cn),Tn={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Tn.node;var En=w(Tn),Dn={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Dn.node;var On=w(Dn),kn={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};kn.node;var An=w(kn),jn={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};jn.node;var Mn=w(jn),Nn={name:`target`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};Nn.node;var Pn=w(Nn),Fn={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};Fn.node;var In=w(Fn),Ln={name:`test-tube-diagonal`,size:24,node:[[`path`,{d:`M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3`,key:`1ub6xw`}],[`path`,{d:`m16 2 6 6`,key:`1gw87d`}],[`path`,{d:`M12 16H4`,key:`1cjfip`}]],aliases:[`test-tube-2`]};Ln.node;var Rn=w(Ln),zn={name:`test-tubes`,size:24,node:[[`path`,{d:`M9 2v17.5A2.5 2.5 0 0 1 6.5 22A2.5 2.5 0 0 1 4 19.5V2`,key:`1hjrqt`}],[`path`,{d:`M20 2v17.5a2.5 2.5 0 0 1-2.5 2.5a2.5 2.5 0 0 1-2.5-2.5V2`,key:`16lc8n`}],[`path`,{d:`M3 2h7`,key:`7s29d5`}],[`path`,{d:`M14 2h7`,key:`7sicin`}],[`path`,{d:`M9 16H4`,key:`1bfye3`}],[`path`,{d:`M20 16h-5`,key:`ddnjpe`}]]};zn.node;var Bn=w(zn),Vn={name:`university`,size:24,node:[[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 16h.01`,key:`plv8zi`}],[`path`,{d:`M22 7a1 1 0 0 0-1-1h-2a2 2 0 0 1-1.143-.359L13.143 2.36a2 2 0 0 0-2.286-.001L6.143 5.64A2 2 0 0 1 5 6H3a1 1 0 0 0-1 1v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2z`,key:`1ogmi3`}],[`path`,{d:`M6 12h.01`,key:`c2rlol`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}],[`circle`,{cx:`12`,cy:`10`,r:`2`,key:`1yojzk`}]],aliases:[`school-2`]};Vn.node;var Hn=w(Vn),Un={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Un.node;var Wn=w(Un),Gn={name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]};Gn.node;var Kn=w(Gn),qn={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};qn.node;var Jn=w(qn),Q=t(n(),1),$=r(),Yn=[{value:`light`,icon:Mn},{value:`dark`,icon:an},{value:`system`,icon:nn}];function Xn(){let{t:e}=Ve(),t=He();return(0,$.jsx)(`div`,{className:`theme-switcher`,role:`group`,"aria-label":e(`theme.title`),children:Yn.map(({value:n,icon:r})=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":t===n,onClick:()=>We(n),children:[(0,$.jsx)(r,{"aria-hidden":!0,size:14}),(0,$.jsx)(`span`,{children:e(`theme.${n}`)})]},n))})}var Zn=(0,Q.lazy)(()=>c(()=>import(`./AvatarSettingsDialog-B80aSza0.js`).then(e=>({default:e.AvatarSettingsDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));function Qn({user:e,onGitHub:t,onSignOut:n,onUserChange:r}){let{t:a,i18n:o}=Ve(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,ee]=(0,Q.useState)(``),g=(0,Q.useRef)(!1),te=(0,Q.useRef)(!1),ne=(0,Q.useRef)(null),re=(0,Q.useId)(),_=e.displayName||e.username,v=async()=>{if(!g.current){g.current=!0,m(!0),ee(``);try{await n()}catch(e){ee(S(e))}finally{g.current=!1,m(!1)}}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Te,{open:s,onOpenChange:e=>{c(e),e&&ee(``)},children:[(0,$.jsx)(me,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`user-menu-trigger`,"aria-label":a(`account.menu`,{name:_}),children:[(0,$.jsx)(Ee,{userId:e.id,name:_,username:e.username,avatarStyle:e.avatarStyle,className:`user-menu-avatar`}),(0,$.jsx)(`span`,{className:`user-menu-name`,children:_}),(0,$.jsx)(xe,{size:14,"aria-hidden":`true`})]})}),(0,$.jsx)(d,{children:(0,$.jsxs)(f,{ref:ne,tabIndex:-1,className:`user-menu-content`,align:`end`,sideOffset:10,collisionPadding:12,"aria-label":a(`account.menu`,{name:_}),onOpenAutoFocus:e=>{e.preventDefault(),ne.current?.focus()},onCloseAutoFocus:e=>{te.current&&e.preventDefault(),te.current=!1},children:[(0,$.jsxs)(`div`,{className:`user-menu-profile`,children:[(0,$.jsx)(Ee,{userId:e.id,name:_,username:e.username,avatarStyle:e.avatarStyle,className:`user-menu-avatar`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`strong`,{children:_}),(0,$.jsxs)(`span`,{children:[`@`,e.username]})]}),(0,$.jsx)(`button`,{type:`button`,className:`user-menu-github`,"aria-label":a(`account.openGithubSettings`),"data-tooltip":a(`account.githubTitle`),onClick:()=>{te.current=!0,c(!1),t()},children:(0,$.jsx)(Me,{size:19})})]}),(0,$.jsxs)(`div`,{className:`user-menu-settings`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`user-menu-avatar-setting`,onClick:()=>{te.current=!0,c(!1),u(!0)},children:[(0,$.jsxs)(`span`,{className:`user-menu-setting-label`,children:[(0,$.jsx)(Wn,{size:16,"aria-hidden":!0}),a(`account.avatarTitle`)]}),(0,$.jsx)(we,{size:14,"aria-hidden":!0})]}),(0,$.jsxs)(`div`,{className:`user-menu-language`,children:[(0,$.jsxs)(`label`,{htmlFor:re,children:[(0,$.jsx)(G,{size:16,"aria-hidden":`true`}),a(`common.language`)]}),(0,$.jsxs)(`div`,{className:`user-menu-language-select`,children:[(0,$.jsxs)(`select`,{id:re,value:i(o.resolvedLanguage),onChange:e=>void o.changeLanguage(e.target.value),children:[(0,$.jsx)(`option`,{value:`en`,children:a(`common.languageEnglish`)}),(0,$.jsx)(`option`,{value:`zh`,children:a(`common.languageChinese`)}),(0,$.jsx)(`option`,{value:`zh-Hant`,children:a(`common.languageTraditionalChinese`)})]}),(0,$.jsx)(xe,{size:13,"aria-hidden":`true`})]})]}),(0,$.jsxs)(`div`,{className:`user-menu-theme`,children:[(0,$.jsxs)(`span`,{className:`user-menu-setting-label`,children:[(0,$.jsx)(un,{size:16,"aria-hidden":`true`}),a(`theme.title`)]}),(0,$.jsx)(Xn,{})]})]}),h&&(0,$.jsx)(`p`,{className:`user-menu-error`,role:`alert`,children:h}),(0,$.jsxs)(`button`,{type:`button`,className:`user-menu-signout`,disabled:p,"aria-busy":p,onClick:()=>void v(),children:[p?(0,$.jsx)(Ke,{size:16,className:`spin`,"aria-hidden":`true`}):(0,$.jsx)(Qt,{size:16,"aria-hidden":`true`}),a(`auth.logout`)]})]})})]}),l&&(0,$.jsx)(Be,{title:a(`account.avatarTitle`),onClose:()=>u(!1),children:(0,$.jsx)(Zn,{user:e,onClose:()=>u(!1),onSaved:e=>r?.(e)})})]})}var $n={npm:`npm install --global texlite@latest
|
|
3
|
+
texlite restart`,docker:`git pull --ff-only
|
|
4
|
+
./scripts/compose.sh pull
|
|
5
|
+
./scripts/compose.sh up -d`};function er({userId:e}){let{t}=Ve(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(`npm`),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(``),f=(0,Q.useRef)(!1),p=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{let e=new AbortController,t=!1,n=async()=>{if(!(document.visibilityState===`hidden`||t)){t=!0;try{let t=await C(`/api/admin/updates`,{signal:e.signal});if(e.signal.aborted||t.update?.latestVersion===p.current)return;r(t.update)}catch{}finally{t=!1}}};n();let i=window.setInterval(()=>{n()},18e5),a=()=>{document.visibilityState===`visible`&&n()};return document.addEventListener(`visibilitychange`,a),()=>{e.abort(),window.clearInterval(i),document.removeEventListener(`visibilitychange`,a)}},[e]);let m=async()=>{if(n&&!f.current){f.current=!0,l(!0),d(``);try{await C(`/api/admin/updates/dismiss`,{method:`POST`,body:JSON.stringify({version:n.latestVersion})}),p.current=n.latestVersion,r(e=>e?.latestVersion===n.latestVersion?null:e),a(!1)}catch(e){d(S(e))}finally{f.current=!1,l(!1)}}};return n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`update-notice`,role:`status`,children:[(0,$.jsx)(F,{"aria-hidden":!0,size:17}),(0,$.jsx)(`span`,{children:t(`updates.available`,{version:n.latestVersion})}),(0,$.jsx)(`button`,{type:`button`,className:`update-notice-details`,onClick:()=>{s(n.method),a(!0)},children:t(`updates.howToUpdate`)}),(0,$.jsx)(`button`,{type:`button`,className:`update-notice-dismiss`,disabled:c,onClick:()=>void m(),"aria-label":t(`updates.dismiss`),title:t(`updates.dismiss`),children:(0,$.jsx)(re,{"aria-hidden":!0,size:16})})]}),u&&!i&&(0,$.jsx)(`p`,{className:`error`,role:`alert`,children:u}),(0,$.jsxs)(ze,{open:i,onOpenChange:a,title:t(`updates.title`),description:t(`updates.versions`,{current:n.currentVersion,latest:n.latestVersion}),footer:(0,$.jsxs)(`button`,{type:`button`,className:`update-dismiss-action`,disabled:c,onClick:()=>void m(),children:[(0,$.jsx)(it,{"aria-hidden":!0,size:15}),t(`updates.dismiss`)]}),children:[(0,$.jsx)(`div`,{className:`update-methods`,role:`group`,"aria-label":t(`updates.method`),children:[`npm`,`docker`].map(e=>(0,$.jsx)(`button`,{type:`button`,"aria-pressed":o===e,"aria-controls":`update-instructions`,onClick:()=>s(e),children:e===`npm`?`npm`:`Docker`},e))}),(0,$.jsxs)(`div`,{id:`update-instructions`,children:[(0,$.jsx)(`p`,{className:`update-command-hint`,children:t(o===`npm`?`updates.npmHint`:`updates.dockerHint`)}),(0,$.jsx)(`pre`,{className:`update-commands`,children:(0,$.jsx)(`code`,{children:$n[o]})}),(0,$.jsx)(`p`,{className:`muted update-command-hint`,children:t(o===`npm`?`updates.restartHint`:`updates.imageHint`)})]}),(0,$.jsx)(`div`,{className:`update-links`,children:(0,$.jsxs)(`a`,{href:`https://github.com/SWUFE-DB-Group/TexLite/releases`,target:`_blank`,rel:`noreferrer`,children:[t(`updates.releaseNotes`),(0,$.jsx)(je,{"aria-hidden":!0,size:12})]})}),u&&(0,$.jsx)(`p`,{className:`error`,role:`alert`,children:u})]})]}):null}var tr=`file-text.book-open.notebook-pen.book-marked.scroll-text.library.graduation-cap.presentation.image.folder-kanban.microscope.flask-conical.test-tube-diagonal.atom.dna.telescope.earth.map.languages.university.code-2.file-code-2.database.server.network.circuit-board.brain.brain-circuit.bot.shield-check.workflow.sigma.calculator.chart-no-axes-combined.line-chart.bar-chart-3.pie-chart.chart-scatter.file-spreadsheet.file-chart-column-increasing.lightbulb.rocket.target.sparkles.file-pen-line.file-stack.folder.folder-open.folder-archive.archive.bookmark.newspaper.notepad-text.sticky-note.pen-tool.quote.list-tree.file-search.beaker.test-tubes.folder-git-2.git-branch.terminal.braces.regex.cpu.hard-drive.cloud.users-round.calendar-days`.split(`.`),nr=new Set(tr);function rr(e){return typeof e==`string`&&nr.has(e)}function ir(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t.length>96?null:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t)?t:null}var ar={"file-text":g,"book-open":pe,"notebook-pen":cn,"book-marked":ce,"scroll-text":u,library:K,"graduation-cap":Gt,presentation:mn,image:Kt,"folder-kanban":Ut,microscope:en,"flask-conical":zt,"test-tube-diagonal":Rn,atom:tt,dna:jt,telescope:In,earth:Mt,map:$t,languages:G,university:Hn,"code-2":Dt,"file-code-2":se,database:At,server:wn,network:X,"circuit-board":wt,brain:dt,"brain-circuit":A,bot:ct,"shield-check":En,workflow:Jn,sigma:Pe,calculator:pt,"chart-no-axes-combined":P,"line-chart":N,"bar-chart-3":M,"pie-chart":bt,"chart-scatter":St,"file-spreadsheet":b,"file-chart-column-increasing":V,lightbulb:Xt,rocket:bn,target:Pn,sparkles:On,"file-pen-line":Ft,"file-stack":Lt,folder:U,"folder-open":ye,"folder-archive":Vt,archive:Xe,bookmark:ot,newspaper:sn,"notepad-text":h,"sticky-note":An,"pen-tool":fn,quote:gn,"list-tree":y,"file-search":oe,beaker:rt,"test-tubes":Bn,"folder-git-2":x,"git-branch":m,terminal:Fe,braces:lt,regex:vn,cpu:R,"hard-drive":Ne,cloud:Et,"users-round":Kn,"calendar-days":ht},or=tr.map(e=>({name:e}));function sr(e){let t=Array.from(e.trim())[0];return t?t.toLocaleUpperCase():`?`}function cr({icon:e,fallback:t,size:n=18}){let r=rr(e)?ar[e]:null;if(r)return(0,$.jsx)(r,{"aria-hidden":`true`,size:n,strokeWidth:1.9});let i=ir(e);if(i){let e=`url(${s(`/api/project-icons/${encodeURIComponent(i)}`)})`;return(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`project-icon-external-glyph`,style:{maskImage:e,WebkitMaskImage:e}})}return(0,$.jsx)(`span`,{"aria-hidden":`true`,children:t})}function lr({icon:e,projectName:t,editable:n=!1,onEdit:r,editLabel:i,title:a,className:o=``}){let s=(0,$.jsx)(cr,{icon:e,fallback:sr(t)}),c=`project-icon-avatar${n?` editable`:``}${o?` ${o}`:``}`;return n&&r?(0,$.jsx)(`button`,{type:`button`,className:c,title:i,"aria-label":i,onClick:r,children:s}):(0,$.jsx)(`span`,{className:c,title:a,"aria-hidden":`true`,children:s})}function ur({project:e,currentUser:t,showArchived:n,archiveBusy:r,menuOpen:i,t:a,variant:o,onToggleMenu:c,onCloseMenu:u,onAssignTags:d,onRename:f,onDuplicate:p,onArchive:m,onTransfer:h,onDelete:ee}){let g=(0,Q.useRef)(null),te=e.permission===`owner`,ne=t.role===`admin`||t.canCreateProjects,re=e.ownerId===t.id,_=e.permission===`owner`;(0,Q.useEffect)(()=>{if(!i)return;let e=e=>{e.target instanceof Node&&!g.current?.contains(e.target)&&u()},t=e=>{e.key===`Escape`&&u()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i,u]);let ie=[{id:`tags`,label:a(`tags.assign`),icon:(0,$.jsx)(Ae,{"aria-hidden":!0,size:15}),section:`main`,onSelect:d},...te?[{id:`rename`,label:a(`projects.rename`),icon:(0,$.jsx)(ae,{"aria-hidden":!0,size:15}),section:`main`,onSelect:f}]:[],...ne?[{id:`duplicate`,label:a(`projects.duplicate`),icon:(0,$.jsx)(ke,{"aria-hidden":!0,size:15}),section:`main`,onSelect:p}]:[],{id:`download`,label:a(`projects.download`),icon:(0,$.jsx)(ue,{"aria-hidden":!0,size:15}),section:`main`,href:s(`/api/projects/${e.id}/download`)},{id:`archive`,label:a(n?`projects.unarchive`:`projects.archive`),icon:n?(0,$.jsx)(Ye,{"aria-hidden":!0,size:15}):(0,$.jsx)(Xe,{"aria-hidden":!0,size:15}),section:`main`,disabled:r,onSelect:m},...re?[{id:`transfer`,label:a(`projects.transfer`),icon:(0,$.jsx)($e,{"aria-hidden":!0,size:15}),section:`main`,onSelect:h}]:[],..._?[{id:`delete`,label:a(`common.delete`),icon:(0,$.jsx)(v,{"aria-hidden":!0,size:15}),section:`danger`,onSelect:ee}]:[]],y=ie.filter(e=>e.section===`main`),oe=ie.filter(e=>e.section===`danger`),b=e=>{e.disabled||(u(),e.onSelect?.())};return(0,$.jsxs)(`div`,{ref:g,className:`project-action-menu-root project-action-menu-${o}`,onClick:e=>e.stopPropagation(),children:[(0,$.jsx)(`button`,{type:`button`,className:`project-action-menu-trigger`,"aria-label":a(`projects.projectActions`,{project:e.name}),"aria-expanded":i,"aria-controls":`project-actions-${e.id}`,onClick:e=>{e.stopPropagation(),c()},children:(0,$.jsx)(l,{"aria-hidden":!0,size:19})}),i&&(0,$.jsxs)(`div`,{id:`project-actions-${e.id}`,className:`project-action-menu`,role:`group`,"aria-label":a(`projects.projectActions`,{project:e.name}),children:[y.map(e=>e.href?(0,$.jsxs)(`a`,{href:e.href,download:!0,onClick:e=>{e.stopPropagation(),u()},children:[e.icon,e.label]},e.id):(0,$.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:t=>{t.stopPropagation(),b(e)},children:[e.icon,e.label]},e.id)),oe.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`project-action-menu-separator`,"aria-hidden":`true`}),oe.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`danger`,onClick:t=>{t.stopPropagation(),b(e)},children:[e.icon,e.label]},e.id))]})]})]})}function dr({project:e,removing:t=!1,onRemovalEnd:n,currentUser:r,showArchived:i,archiveBusy:a,menuOpen:o,t:s,formatCreatedDate:c,formatUpdatedTime:l,formatExactTime:u,onOpenProject:d,onOpenMention:f,onToggleMenu:p,onCloseMenu:m,onAssignTags:h,onRename:ee,onDuplicate:g,onArchive:te,onTransfer:ne,onDelete:re,onChooseIcon:_}){let v=e.ownerDisplayName??e.ownerUsername??s(`projects.deletedUser`),ae=e.lastModifiedDisplayName??e.lastModifiedUsername??s(`projects.deletedUser`);return(0,$.jsxs)(`article`,{ref:t?be:void 0,inert:t?!0:void 0,"aria-hidden":t?!0:void 0,className:`project-card project-list-row${e.ownerId===r.id?` owned-project`:``}${o?` project-list-menu-open`:``}${t?` deletion-exit`:``}`,onAnimationEnd:e=>{e.target===e.currentTarget&&t&&n?.()},onClick:e=>{e.target===e.currentTarget&&d()},children:[(0,$.jsx)(lr,{icon:e.icon,projectName:e.name,title:e.name,editable:e.permission===`owner`,editLabel:s(`projectIcons.change`),onEdit:_,className:`project-list-avatar`}),(0,$.jsx)(`span`,{className:`project-list-summary`,children:(0,$.jsxs)(`button`,{type:`button`,className:`project-list-cell-open project-list-summary-open`,onClick:d,"aria-label":s(`projects.openProject`,{project:e.name}),children:[(0,$.jsxs)(`span`,{className:`project-list-title-line`,children:[(0,$.jsx)(`strong`,{className:`project-list-title`,title:e.name,children:e.name}),!!(e.unresolvedCommentCount&&e.unresolvedCommentCount>0)&&(0,$.jsxs)(`span`,{className:`project-comments-badge unresolved`,title:s(`projects.unresolvedCommentsTooltip`,{count:e.commentCount??e.unresolvedCommentCount,unresolved:e.unresolvedCommentCount,total:e.commentCount??e.unresolvedCommentCount}),children:[(0,$.jsx)(ie,{"aria-hidden":!0,size:10}),(0,$.jsx)(`span`,{children:s(`projects.unresolvedCount`,{count:e.unresolvedCommentCount})})]})]}),e.tags?.length>0&&(0,$.jsx)(`span`,{className:`project-list-tags`,children:e.tags.map(e=>(0,$.jsx)(`span`,{className:`tag tag-${e.color} project-list-tag`,title:e.name,children:e.name},e.id))})]})}),(0,$.jsxs)(`button`,{type:`button`,className:`project-list-cell-open project-list-owner`,onClick:d,title:v,"aria-label":s(`projects.openProject`,{project:e.name}),children:[(0,$.jsxs)(`span`,{className:`sr-only`,children:[s(`projects.owner`),`: `]}),v]}),(0,$.jsxs)(`button`,{type:`button`,className:`project-list-cell-open project-list-created`,onClick:d,title:u(e.createdAt),"aria-label":s(`projects.openProject`,{project:e.name}),children:[(0,$.jsxs)(`span`,{className:`sr-only`,children:[s(`projects.created`),`: `]}),(0,$.jsx)(`time`,{dateTime:e.createdAt,children:c(e.createdAt)})]}),(0,$.jsxs)(`button`,{type:`button`,className:`project-list-cell-open project-list-modified`,onClick:d,title:u(e.updatedAt),"aria-label":s(`projects.openProject`,{project:e.name}),children:[(0,$.jsxs)(`span`,{className:`sr-only`,children:[s(`projects.modified`),`: `]}),(0,$.jsx)(`time`,{dateTime:e.updatedAt,children:l(e.updatedAt)}),(0,$.jsx)(`small`,{children:s(`projects.byUser`,{user:ae})})]}),e.unreadMentionCount&&e.unreadMentionCount>0?(0,$.jsxs)(`button`,{className:`project-mentions-badge project-list-mentions`,type:`button`,title:s(`projects.unreadMentionsTooltip`,{count:e.unreadMentionCount}),onClick:f,children:[(0,$.jsx)(ve,{"aria-hidden":!0,size:10}),(0,$.jsx)(`span`,{children:e.unreadMentionCount})]}):(0,$.jsx)(`span`,{className:`project-list-mentions`}),(0,$.jsx)(ur,{variant:`list`,project:e,currentUser:r,showArchived:i,archiveBusy:a,menuOpen:o,t:s,onToggleMenu:p,onCloseMenu:m,onAssignTags:h,onRename:ee,onDuplicate:g,onArchive:te,onTransfer:ne,onDelete:re})]})}var fr=[`all`,`owned`,`shared`],pr={all:`projects.allProjects`,owned:`projects.ownedByMe`,shared:`projects.sharedWithMe`};function mr({value:e,counts:t,onChange:n}){let{t:r}=Ve();return(0,$.jsx)(`div`,{className:`project-ownership-tabs`,role:`tablist`,"aria-label":r(`projects.ownership`),children:fr.map((i,a)=>(0,$.jsxs)(`button`,{id:`project-tab-${i}`,type:`button`,role:`tab`,"aria-selected":e===i,"aria-controls":`project-catalog-panel`,tabIndex:e===i?0:-1,onClick:()=>n(i),onKeyDown:e=>{let t;if(e.key===`ArrowRight`)t=(a+1)%fr.length;else if(e.key===`ArrowLeft`)t=(a+fr.length-1)%fr.length;else if(e.key===`Home`)t=0;else if(e.key===`End`)t=fr.length-1;else return;e.preventDefault(),n(fr[t]),e.currentTarget.parentElement?.querySelector(`#project-tab-${fr[t]}`)?.focus()},children:[(0,$.jsx)(`span`,{children:r(pr[i])}),t[i]>0&&(0,$.jsx)(`sup`,{children:t[i]})]},i))})}var hr=e({Dashboard:()=>Dr}),gr=e=>e.id,_r=[],vr=(e,t,n,r,i,a)=>JSON.stringify([e,t,n,r,i,a]),yr=(0,Q.lazy)(()=>c(()=>import(`./SystemMetricsDialog-GZbYEHna.js`).then(e=>({default:e.SystemMetricsDialog})),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,15,16,17]),import.meta.url)),br=(0,Q.lazy)(()=>c(()=>import(`./CitationLibraryDialog-DE7W81FW.js`).then(e=>({default:e.CitationLibraryDialog})),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,19,20,21,11,12,13,22,23,24,25]),import.meta.url)),xr=(0,Q.lazy)(()=>c(()=>import(`./AdminUsers-D5vhK_Ae.js`).then(e=>({default:e.AdminUsers})),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,12,13,27,23]),import.meta.url)),Sr=(0,Q.lazy)(()=>c(()=>import(`./AgentManagement-D6I_GDL_.js`).then(e=>({default:e.AgentManagement})),__vite__mapDeps([28,1,2,29,5,6,7,4,8,9,3,16,17,11,12,30,31,23]),import.meta.url)),Cr=(0,Q.lazy)(()=>c(()=>import(`./TagManagementDialog-BN3tlXuW.js`).then(e=>({default:e.TagManagementDialog})),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,21,11,12,23,24,10,22]),import.meta.url)),wr=(0,Q.lazy)(()=>c(()=>import(`./ProjectIconPickerDialog-CsT5Pj4j.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([33,1,2,11,12,5,6,7,4,8,9,13]),import.meta.url)),Tr=(0,Q.lazy)(()=>c(()=>import(`./GitHubAccountDialog-tigrQQNz.js`).then(e=>({default:e.GitHubAccountDialog})),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,35,11,12,23]),import.meta.url));function Er(e){return e instanceof Error&&e.name===`AbortError`}function Dr({site:e,user:t,initialData:n,onDataChange:r,onUser:i,onOpenProject:c}){let{t:l}=Ve(),[u,d]=(0,Q.useState)(()=>n?.projects??[]),[f,m]=(0,Q.useState)(()=>n?.tags??[]),[h,g]=(0,Q.useState)(()=>n?.pagination??{page:1,pageSize:20,total:n?.projects.length??0,totalPages:+!!n?.projects.length}),[v,ae]=(0,Q.useState)(()=>n?.counts??{all:0,owned:0,shared:0}),[y,oe]=(0,Q.useState)(()=>n?.filters.ownership??`all`),[b,se]=(0,Q.useState)(!1),[ue,pe]=(0,Q.useState)(!1),me=_e(t.id),{showExecutionReminder:xe}=de(),[Te,Ee]=(0,Q.useState)(!1),[ke,x]=(0,Q.useState)(!1),[je,Me]=(0,Q.useState)(!1),[Ne,Pe]=(0,Q.useState)(``),[Fe,w]=(0,Q.useState)(``),[He,We]=(0,Q.useState)(``),[qe,T]=(0,Q.useState)(``),[Ye,E]=(0,Q.useState)(``),[Ze,D]=(0,Q.useState)(``),[et,tt]=(0,Q.useState)(!1),[nt,rt]=(0,Q.useState)(``),[O,it]=(0,Q.useState)(!1),[at,ot]=(0,Q.useState)(!1),[st,ct]=(0,Q.useState)(``),[k,lt]=(0,Q.useState)(null),[ut,A]=(0,Q.useState)(``),[j,dt]=(0,Q.useState)(null),[ft,pt]=(0,Q.useState)(null),mt=(0,Q.useRef)(null),gt=(0,Q.useRef)(null),[M,_t]=(0,Q.useState)(!1),[N,vt]=(0,Q.useState)(()=>n?.filters.search??``),[P,yt]=(0,Q.useState)(()=>n?.filters.tag??``),[bt,xt]=(0,Q.useState)(!1),[St,Ct]=(0,Q.useState)(!1),[F,I]=(0,Q.useState)(null),[wt,Tt]=(0,Q.useState)(null),[Et,L]=(0,Q.useState)(null),[Dt,Ot]=(0,Q.useState)(``),[R,kt]=(0,Q.useState)(!1),[At,z]=(0,Q.useState)(null),[jt,B]=(0,Q.useState)(``),[Mt,Nt]=(0,Q.useState)(!1),[V,Pt]=(0,Q.useState)(null),[Ft,It]=(0,Q.useState)(!1),[Lt,Rt]=(0,Q.useState)(null),[zt,Bt]=(0,Q.useState)(null),[Vt,Ht]=(0,Q.useState)([]),[Ut,H]=(0,Q.useState)(``),[U,Wt]=(0,Q.useState)(!1),[Gt,W]=(0,Q.useState)(``),[Kt,qt]=(0,Q.useState)(()=>localStorage.getItem(o(`texlite-project-view`))===`list`?`list`:`grid`),[G,Jt]=(0,Q.useState)(()=>n?.filters.sort??(localStorage.getItem(o(`texlite-project-sort`))===`created`?`created`:`updated`)),[K,Yt]=(0,Q.useState)(()=>n?.filters.archived??!1),[Xt,Zt]=(0,Q.useState)(``),[Qt,q]=(0,Q.useState)(null),[$t,J]=(0,Q.useState)(()=>n?.pagination.page??1),en=he(),[tn,nn]=(0,Q.useState)(()=>n?vr(n.filters.ownership,n.filters.archived,n.pagination.page,n.filters.search,n.filters.tag,n.filters.sort):``),[rn,an]=(0,Q.useState)(0),Y=()=>an(e=>e+1),X=(0,Q.useRef)(0),on=(0,Q.useRef)(null),sn=vr(y,K,$t,N,P,G),Z=tn===sn,{entries:cn,finishExit:ln}=fe(Z?u:_r,{scopeKey:`${sn}|${Kt}|${b}|${ke}`,deletedKey:Lt,keyOf:gr,duration:250}),un=(e,t,n,r,i,a)=>{let o=new URLSearchParams({page:String(n),pageSize:`20`,sort:a,scope:e});t&&o.set(`archived`,`1`),r.trim()&&o.set(`search`,r.trim()),i&&o.set(`tag`,i),Pe(``);let s=++X.current;on.current?.abort();let c=new AbortController;return on.current=c,Promise.all([C(`/api/projects?${o.toString()}`,{signal:c.signal}),C(`/api/tags`,{signal:c.signal})]).then(([n,o])=>{s===X.current&&(d(n.projects),m(o.tags),g(n.pagination),J(n.pagination.page),ae(n.counts),nn(vr(e,t,n.pagination.page,r,i,a)))}).catch(e=>{!Er(e)&&s===X.current&&Pe(S(e))}).finally(()=>{on.current===c&&(on.current=null)})};(0,Q.useEffect)(()=>(un(y,K,$t,N,P,G),()=>on.current?.abort()),[y,K,$t,N,P,G,rn]),(0,Q.useEffect)(()=>{Z&&r({projects:u,tags:f,pagination:h,counts:v,filters:{ownership:y,archived:K,search:N,tag:P,sort:G}})},[u,f,h,v,tn,sn]),(0,Q.useEffect)(()=>{if(!bt)return;let e=e=>{e.target instanceof Node&&!gt.current?.contains(e.target)&&xt(!1)},t=e=>{e.key===`Escape`&&xt(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[bt]);let dn=e=>{q(null),qt(e),localStorage.setItem(o(`texlite-project-view`),e)},fn=e=>{Jt(e),J(1),localStorage.setItem(o(`texlite-project-sort`),e)},pn=e=>{e!==y&&(oe(e),J(1),q(null))},mn=e=>{Yt(e),J(1)},hn=e=>{yt(e),J(1)},gn=async()=>{if(nt.trim()&&!O){it(!0),w(``);try{let{project:e}=await C(`/api/projects`,{method:`POST`,body:JSON.stringify({name:nt})});tt(!1),rt(``),c(e.id)}catch(e){w(S(e))}finally{it(!1)}}},_n=async()=>{if(!k)return;let t=k,n=e.maxUploadSizeMB;if(t.size>n*1024*1024)return A(l(`errors.fileTooLarge`,{size:n}));_t(!0),A(``),dt(`uploading`),pt(0);let r=new FormData;r.append(`file`,t);try{let{project:e}=await Ie(`/api/projects/import?name=${encodeURIComponent(st.trim())}`,r,{onProgress:(e,t)=>{pt(t?Math.min(99,Math.floor(e/t*100)):null)},onUploadComplete:()=>{pt(null),dt(`processing`)}});ot(!1),lt(null),ct(``),c(e.id)}catch(e){A(S(e))}finally{_t(!1),dt(null),pt(null)}},vn=e=>{M||(e&&!e.name.toLocaleLowerCase().endsWith(`.zip`)?A(l(`errors.zipOnly`)):(A(``),lt(e),e&&!st&&ct(e.name.replace(/\.zip$/i,``))))},yn=async()=>{await C(`/api/auth/logout`,{method:`POST`}),i(null)},bn=async e=>{if(!F)return;let t=F.tags.some(t=>t.id===e.id);We(``);try{let n=(await C(t?`/api/projects/${F.id}/tags/${e.id}`:`/api/projects/${F.id}/tags`,t?{method:`DELETE`}:{method:`POST`,body:JSON.stringify({tagId:e.id})})).project;I(n),d(e=>e.map(e=>e.id===n.id?n:e)),Y()}catch(e){We(S(e))}},xn=e=>{m(t=>[...t,e].sort((e,t)=>e.name.localeCompare(t.name)))},Cn=e=>{let t=t=>t.map(t=>t.id===e.id?e:t);m(e=>t(e).sort((e,t)=>e.name.localeCompare(t.name))),d(e=>e.map(e=>({...e,tags:t(e.tags)}))),I(e=>e?{...e,tags:t(e.tags)}:null),Y()},wn=e=>{m(t=>t.filter(t=>t.id!==e)),d(t=>t.map(t=>({...t,tags:t.tags.filter(t=>t.id!==e)}))),I(t=>t?{...t,tags:t.tags.filter(t=>t.id!==e)}:null),yt(t=>t===e?``:t),J(1),Y()},Tn=async(e,t)=>{let n=await C(`/api/projects/${e}/icon`,{method:`PATCH`,body:JSON.stringify({icon:t})});d(e=>{let t=e.map(e=>e.id===n.project.id?n.project:e);return G===`updated`?t.sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)||e.name.localeCompare(t.name)):t}),Y()},En=async()=>{if(Et&&Dt.trim()&&!R){kt(!0),T(``);try{let e=await C(`/api/projects/${Et.id}`,{method:`PATCH`,body:JSON.stringify({name:Dt})});d(t=>t.map(t=>t.id===e.project.id?e.project:t)),L(null),Ot(``),Y()}catch(e){T(S(e))}finally{kt(!1)}}},Dn=async()=>{if(At&&jt.trim()){Nt(!0),E(``);try{await C(`/api/projects/${At.id}/duplicate`,{method:`POST`,body:JSON.stringify({name:jt})}),z(null),B(``),Y()}catch(e){E(S(e))}finally{Nt(!1)}}},kn=async()=>{if(!V||Ft)return;It(!0),D(``);let e=X.current;try{await C(`/api/projects/${V.id}`,{method:`DELETE`}),e===X.current&&(Rt(V.id),Mn(V,`delete`)),Pt(null),Y()}catch(e){D(S(e))}finally{It(!1)}},An=async e=>{Bt(e),H(``),Ht([]),W(``),Wt(!0);try{let t=await C(`/api/users`);Ht(t.users.filter(t=>t.id!==e.ownerId))}catch(e){W(S(e))}finally{Wt(!1)}},jn=async()=>{if(zt&&Ut){Wt(!0),W(``);try{await C(`/api/projects/${zt.id}/owner`,{method:`PUT`,body:JSON.stringify({userId:Ut})}),Bt(null),H(``),Y()}catch(e){W(S(e))}finally{Wt(!1)}}},Mn=(e,n)=>{d(t=>t.filter(t=>t.id!==e.id)),n===`delete`&&ae(n=>({...n,all:Math.max(0,n.all-1),[e.ownerId===t.id?`owned`:`shared`]:Math.max(0,n[e.ownerId===t.id?`owned`:`shared`]-1)}));let r=Math.max(0,h.total-1),i=Math.ceil(r/h.pageSize),a=i===0?1:Math.min($t,i);g({...h,page:a,total:r,totalPages:i}),J(a)},Nn=async e=>{let t=!K;Zt(e.id),Pe(``);let n=X.current;try{await C(`/api/projects/${e.id}/archive`,{method:t?`PUT`:`DELETE`}),n===X.current&&Mn(e,`archive`),Y()}catch(e){Pe(S(e))}finally{Zt(``)}},Pn=async e=>{try{let t=(await C(`/api/projects/${e.id}/mentions?unread=1&limit=1`)).mentions[0];c(e.id,t?.id)}catch(e){Pe(S(e))}},Fn=e=>le(e,a.resolvedLanguage),In=e=>le(e,a.resolvedLanguage??`en`,{year:`numeric`,month:`2-digit`,day:`2-digit`}),Ln=e=>Ce(e,a.resolvedLanguage??`en`,en,(e,t)=>l(e,t));return(0,$.jsxs)(`div`,{className:`page`,children:[(0,$.jsxs)(`header`,{className:`topbar`,children:[(0,$.jsxs)(`a`,{className:`brand-link`,href:s(`/`),"aria-label":e.siteName,children:[(0,$.jsx)(Le,{siteName:e.siteName}),(0,$.jsx)(`span`,{className:`site-title`,children:e.siteName})]}),(0,$.jsxs)(`div`,{className:`top-actions`,children:[t.role===`admin`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{className:`ghost`,onClick:()=>Ee(!0),children:[(0,$.jsx)(Je,{"aria-hidden":!0,size:14}),l(`metrics.title`)]}),(0,$.jsxs)(`button`,{className:`ghost${b?` top-return-action`:``}`,onClick:()=>{se(e=>!e),pe(!1),x(!1)},children:[b?(0,$.jsx)(Se,{"aria-hidden":!0,size:14}):(0,$.jsx)(p,{"aria-hidden":!0,size:14}),l(b?`users.back`:`users.manage`)]})]}),(0,$.jsxs)(`button`,{className:`ghost${ke?` top-return-action`:``}`,onClick:()=>{se(!1),pe(!1),x(e=>!e)},children:[ke?(0,$.jsx)(Se,{"aria-hidden":!0,size:14}):(0,$.jsx)(ce,{"aria-hidden":!0,size:14}),l(ke?`users.back`:`citationLibrary.title`)]}),(t.role===`admin`||me.visible)&&(0,$.jsxs)(`button`,{className:`ghost${ue?` top-return-action`:``}`,onClick:()=>{pe(e=>!e),se(!1),x(!1)},children:[ue?(0,$.jsx)(Se,{size:14}):(0,$.jsx)(Oe,{size:14}),l(ue?`agents.back`:t.role===`admin`?`agents.title`:`agents.tasks`),xe&&!ue&&me.activeCount>0&&(0,$.jsx)(`sup`,{className:`agent-active-count`,"aria-label":l(`agents.activeCount`,{count:me.activeCount}),children:me.activeCount})]}),(0,$.jsx)(Qn,{user:t,onGitHub:()=>Me(!0),onSignOut:yn,onUserChange:i})]})]}),t.role===`admin`&&(0,$.jsx)(`div`,{className:`dashboard-update`,children:(0,$.jsx)(er,{userId:t.id},t.id)}),ue?(0,$.jsx)(`main`,{className:`dashboard`,children:(0,$.jsx)(Re,{onClose:()=>pe(!1),children:(0,$.jsx)(Sr,{user:t,onBack:()=>pe(!1)})})}):b?(0,$.jsx)(`main`,{className:`dashboard`,children:(0,$.jsx)(Re,{onClose:()=>se(!1),children:(0,$.jsx)(xr,{currentUser:t,minPasswordLength:e.minPasswordLength,onBack:()=>se(!1)})})}):ke?(0,$.jsx)(`main`,{className:`dashboard`,children:(0,$.jsx)(Re,{onClose:()=>x(!1),children:(0,$.jsx)(br,{page:!0,open:!0,onOpenChange:x,onBack:()=>x(!1),currentUserId:t.id,maxBibtexBytes:e.maxCitationBibtexBytes})})}):(0,$.jsxs)(`main`,{className:`dashboard`,children:[(0,$.jsxs)(`div`,{className:`section-title`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`h1`,{children:[(0,$.jsx)(ye,{"aria-hidden":!0,size:25}),l(`projects.title`)]}),(0,$.jsx)(`p`,{className:`muted`,children:t.canCreateProjects?l(`projects.subtitle`):l(`projects.restricted`)})]}),(0,$.jsxs)(`div`,{className:`section-actions`,children:[(0,$.jsxs)(`button`,{onClick:()=>Ct(!0),children:[(0,$.jsx)(Ae,{"aria-hidden":!0,size:15}),l(`tags.manage`)]}),t.canCreateProjects&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{onClick:()=>{A(``),ot(!0)},children:[(0,$.jsx)(ee,{"aria-hidden":!0,size:15}),l(`projects.upload`)]}),(0,$.jsxs)(`button`,{className:`primary`,onClick:()=>{w(``),tt(!0)},children:[(0,$.jsx)(te,{"aria-hidden":!0,size:15}),l(`projects.new`)]})]})]})]}),(0,$.jsx)(mr,{value:y,counts:v,onChange:pn}),Ne&&(0,$.jsx)(`p`,{className:`error`,children:Ne}),(0,$.jsxs)(`div`,{className:`project-catalog-layout`,children:[(0,$.jsxs)(`aside`,{ref:gt,className:`project-tag-sidebar${P?` has-active-filter`:``}`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`project-tag-toggle`,title:l(`projects.filterTags`),"aria-label":l(`projects.filterTags`),"aria-expanded":bt,"aria-controls":`dashboard-tag-filters`,onClick:()=>xt(e=>!e),children:[(0,$.jsxs)(`span`,{className:`project-tag-toggle-copy`,children:[(0,$.jsx)(Ae,{"aria-hidden":!0,size:15}),(0,$.jsx)(`span`,{children:l(`projects.filterTags`)})]}),(0,$.jsx)(we,{className:`project-tag-toggle-chevron`,"aria-hidden":!0,size:15})]}),bt&&(0,$.jsxs)(`div`,{id:`dashboard-tag-filters`,className:`project-tag-filters`,role:`group`,"aria-label":l(`projects.filterTags`),children:[(0,$.jsx)(`button`,{type:`button`,className:P?``:`active`,"aria-pressed":!P,onClick:()=>hn(``),children:l(`projects.allTags`)}),f.length>0?f.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:P===e.id?`active`:``,title:e.name,"aria-pressed":P===e.id,onClick:()=>hn(P===e.id?``:e.id),children:[(0,$.jsx)(Or,{color:e.color}),(0,$.jsx)(`span`,{children:e.name})]},e.id)):(0,$.jsx)(`p`,{className:`project-tag-empty`,children:l(`tags.none`)})]})]}),(0,$.jsx)(`div`,{className:`project-catalog-content`,children:(0,$.jsxs)(`section`,{id:`project-catalog-panel`,role:`tabpanel`,"aria-labelledby":`project-tab-${y}`,"aria-busy":!Z&&!Ne,children:[(0,$.jsxs)(`div`,{className:`project-toolbar`,children:[(0,$.jsx)(`input`,{type:`search`,placeholder:l(`projects.search`),value:N,onChange:e=>{vt(e.target.value),J(1)}}),(0,$.jsxs)(`div`,{className:`project-scope`,role:`group`,"aria-label":l(`projects.scope`),children:[(0,$.jsxs)(`button`,{className:K?``:`active`,onClick:()=>mn(!1),"aria-pressed":!K,children:[(0,$.jsx)(ye,{size:14}),l(`projects.active`)]}),(0,$.jsxs)(`button`,{className:K?`active`:``,onClick:()=>mn(!0),"aria-pressed":K,children:[(0,$.jsx)(Xe,{size:14}),l(`projects.archived`)]})]}),(0,$.jsxs)(`label`,{className:`project-sort`,children:[(0,$.jsx)(Qe,{size:14}),(0,$.jsx)(`span`,{children:l(`projects.sortBy`)}),(0,$.jsxs)(`select`,{value:G,onChange:e=>fn(e.target.value),children:[(0,$.jsx)(`option`,{value:`updated`,children:l(`projects.sortModified`)}),(0,$.jsx)(`option`,{value:`created`,children:l(`projects.sortCreated`)})]})]}),(0,$.jsxs)(`div`,{className:`view-toggle`,children:[(0,$.jsx)(`button`,{className:Kt===`grid`?`active`:``,onClick:()=>dn(`grid`),title:l(`projects.grid`),children:`▦`}),(0,$.jsx)(`button`,{className:Kt===`list`?`active`:``,onClick:()=>dn(`list`),title:l(`projects.list`),children:`☷`})]})]}),!Z&&!Ne&&(0,$.jsxs)(`div`,{className:`project-catalog-loading`,role:`status`,children:[(0,$.jsx)(Ke,{className:`spin`,size:17,"aria-hidden":!0}),l(`common.loading`)]}),(0,$.jsxs)(`div`,{className:`project-grid ${Kt===`list`?`list-view`:``}${Qt?` project-list-menu-active`:``}`,children:[Kt===`list`&&cn.length>0&&(0,$.jsxs)(`div`,{className:`project-list-header`,"aria-hidden":`true`,children:[(0,$.jsx)(`span`,{className:`project-list-header-avatar`}),(0,$.jsx)(`span`,{children:l(`projects.title`)}),(0,$.jsx)(`span`,{children:l(`projects.owner`)}),(0,$.jsx)(`span`,{className:`project-list-header-created`,children:l(`projects.created`)}),(0,$.jsx)(`span`,{children:l(`projects.modified`)}),(0,$.jsx)(`span`,{className:`project-list-header-mentions`,children:l(`projects.mentionsColumn`)}),(0,$.jsx)(`span`,{className:`project-list-header-actions`,children:l(`projects.actions`)})]}),Kt===`list`?cn.map(({item:e,removeAt:n})=>(0,$.jsx)(dr,{project:e,removing:n!==null,onRemovalEnd:()=>ln(e.id),currentUser:t,showArchived:K,archiveBusy:Xt===e.id,menuOpen:Qt===e.id,t:l,formatCreatedDate:In,formatUpdatedTime:Ln,formatExactTime:Fn,onOpenProject:()=>{q(null),c(e.id)},onOpenMention:()=>void Pn(e),onToggleMenu:()=>q(t=>t===e.id?null:e.id),onCloseMenu:()=>q(t=>t===e.id?null:t),onAssignTags:()=>{We(``),I(e)},onRename:()=>{T(``),L(e),Ot(e.name)},onDuplicate:()=>{E(``),z(e),B(`${e.name} (1)`)},onArchive:()=>void Nn(e),onTransfer:()=>void An(e),onDelete:()=>{Pt(e),D(``)},onChooseIcon:()=>Tt(e)},e.id)):cn.map(({item:e,removeAt:n})=>(0,$.jsxs)(`article`,{ref:n===null?void 0:be,inert:n!==null||void 0,"aria-hidden":n!==null||void 0,className:`project-card project-grid-card${e.ownerId===t.id?` owned-project`:``}${Qt===e.id?` project-card-menu-open`:``}${n===null?``:` deletion-exit`}`,onAnimationEnd:t=>{t.target===t.currentTarget&&n!==null&&ln(e.id)},role:`button`,tabIndex:0,"aria-label":l(`projects.openProject`,{project:e.name}),onClick:()=>{q(null),c(e.id)},onKeyDown:t=>{t.target!==t.currentTarget||t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),q(null),c(e.id))},children:[(0,$.jsxs)(`div`,{className:`project-card-meta-row`,children:[(0,$.jsxs)(`div`,{className:`project-card-badges`,children:[(0,$.jsx)(`span`,{className:`owner-badge`,title:e.ownerDisplayName??e.ownerUsername??l(`projects.deletedUser`),children:e.ownerDisplayName??e.ownerUsername??l(`projects.deletedUser`)}),!!(e.unreadMentionCount&&e.unreadMentionCount>0)&&(0,$.jsxs)(`button`,{className:`project-mentions-badge`,type:`button`,title:l(`projects.unreadMentionsTooltip`,{count:e.unreadMentionCount}),"aria-label":l(`projects.unreadMentionsTooltip`,{count:e.unreadMentionCount}),onClick:t=>{t.stopPropagation(),Pn(e)},children:[(0,$.jsx)(ve,{"aria-hidden":!0,size:11}),(0,$.jsx)(`span`,{children:e.unreadMentionCount})]})]}),(0,$.jsx)(ur,{variant:`grid`,project:e,currentUser:t,showArchived:K,archiveBusy:Xt===e.id,menuOpen:Qt===e.id,t:l,onToggleMenu:()=>q(t=>t===e.id?null:e.id),onCloseMenu:()=>q(t=>t===e.id?null:t),onAssignTags:()=>{We(``),I(e)},onRename:()=>{T(``),L(e),Ot(e.name)},onDuplicate:()=>{E(``),z(e),B(`${e.name} (1)`)},onArchive:()=>void Nn(e),onTransfer:()=>void An(e),onDelete:()=>{Pt(e),D(``)}})]}),(0,$.jsxs)(`div`,{className:`project-card-title-row`,children:[(0,$.jsx)(`span`,{className:`project-card-icon-control`,onClick:e.permission===`owner`?e=>e.stopPropagation():void 0,children:(0,$.jsx)(lr,{icon:e.icon,projectName:e.name,title:e.name,editable:e.permission===`owner`,editLabel:l(`projectIcons.change`),onEdit:()=>Tt(e),className:`project-card-icon`})}),(0,$.jsx)(`strong`,{className:`project-card-title`,title:e.name,children:e.name})]}),(0,$.jsx)(`div`,{className:`project-card-tags`,"aria-label":l(`tags.assignTitle`,{project:e.name}),title:e.tags?.map(e=>e.name).join(`, `)||void 0,children:e.tags?.map(e=>(0,$.jsx)(`span`,{className:`tag tag-${e.color}`,title:e.name,children:e.name},e.id))}),(0,$.jsxs)(`dl`,{className:`project-meta`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`dt`,{className:`project-meta-created-label`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(ht,{"aria-hidden":!0,size:13}),l(`projects.created`)]}),!!(e.unresolvedCommentCount&&e.unresolvedCommentCount>0)&&(0,$.jsxs)(`span`,{className:`project-comments-badge unresolved`,title:l(`projects.unresolvedCommentsTooltip`,{count:e.commentCount??e.unresolvedCommentCount,unresolved:e.unresolvedCommentCount,total:e.commentCount??e.unresolvedCommentCount}),children:[(0,$.jsx)(ie,{"aria-hidden":!0,size:11}),(0,$.jsx)(`span`,{children:l(`projects.unresolvedCount`,{count:e.unresolvedCommentCount})})]})]}),(0,$.jsx)(`dd`,{children:(0,$.jsx)(`time`,{dateTime:e.createdAt,children:Fn(e.createdAt)})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`dt`,{children:[(0,$.jsx)(Sn,{"aria-hidden":!0,size:13}),l(`projects.modified`)]}),(0,$.jsxs)(`dd`,{title:Fn(e.updatedAt),children:[(0,$.jsx)(`time`,{dateTime:e.updatedAt,children:Ln(e.updatedAt)}),(0,$.jsxs)(`span`,{className:`project-modified-by`,children:[` · `,l(`projects.byUser`,{user:e.lastModifiedDisplayName??e.lastModifiedUsername??l(`projects.deletedUser`)})]})]})]})]})]},e.id)),Z&&cn.length===0&&(N.trim()||P?(0,$.jsx)(`div`,{className:`empty`,children:l(`projects.noMatches`)}):K?(0,$.jsxs)(`div`,{className:`project-empty project-empty-archived`,children:[(0,$.jsx)(`span`,{className:`project-empty-icon`,children:(0,$.jsx)(Xe,{"aria-hidden":`true`,size:25,strokeWidth:1.5})}),(0,$.jsx)(`h2`,{children:l(`projects.noArchived`)}),(0,$.jsx)(`p`,{children:l(`projects.noArchivedDescription`)}),(0,$.jsxs)(`button`,{type:`button`,className:`project-empty-action`,onClick:()=>mn(!1),children:[(0,$.jsx)(Se,{"aria-hidden":`true`,size:14}),l(`projects.backToActive`)]})]}):y===`shared`?(0,$.jsxs)(`div`,{className:`project-empty`,children:[(0,$.jsx)(`span`,{className:`project-empty-icon`,children:(0,$.jsx)(p,{size:28,"aria-hidden":!0})}),(0,$.jsx)(`h2`,{children:l(`projects.noShared`)}),(0,$.jsx)(`p`,{children:l(`projects.emptyRestricted`)})]}):(0,$.jsxs)(`div`,{className:`project-empty`,children:[(0,$.jsx)(`span`,{className:`project-empty-icon`,children:(0,$.jsx)(On,{size:28})}),(0,$.jsx)(`h2`,{children:l(`projects.emptyTitle`)}),(0,$.jsx)(`p`,{children:t.canCreateProjects?l(`projects.emptyDescription`):l(`projects.emptyRestricted`)})]}))]}),Z&&h.totalPages>1&&(0,$.jsxs)(`nav`,{className:`project-pagination`,"aria-label":l(`projects.pagination`),children:[(0,$.jsxs)(`button`,{disabled:h.page<=1,onClick:()=>J(e=>Math.max(1,e-1)),title:l(`projects.previousPage`),children:[(0,$.jsx)(ge,{size:15}),l(`projects.previousPage`)]}),(0,$.jsx)(`span`,{children:l(`projects.pageOf`,{page:h.page,totalPages:h.totalPages,count:h.total})}),(0,$.jsxs)(`button`,{disabled:h.page>=h.totalPages,onClick:()=>J(e=>Math.min(h.totalPages,e+1)),title:l(`projects.nextPage`),children:[(0,$.jsx)(we,{size:15}),l(`projects.nextPage`)]})]})]})})]}),(0,$.jsx)(ze,{open:et,title:l(`projects.new`),description:l(`projects.newDescription`),onOpenChange:e=>{(e||!O)&&(tt(e),e||w(``))},footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{disabled:O,onClick:()=>tt(!1),children:l(`common.cancel`)}),(0,$.jsxs)(`button`,{className:`primary`,disabled:O||!nt.trim(),"aria-busy":O,onClick:()=>void gn(),children:[O&&(0,$.jsx)(Ke,{className:`spin`,size:14}),l(O?`common.loading`:`common.create`)]})]}),children:(0,$.jsxs)($.Fragment,{children:[Fe&&(0,$.jsx)(`p`,{className:`error dialog-error`,children:Fe}),(0,$.jsxs)(`label`,{className:`form-field`,children:[l(`projects.name`),(0,$.jsx)(`input`,{autoFocus:!0,value:nt,onChange:e=>{rt(e.target.value),w(``)},onKeyDown:e=>{e.key===`Enter`&&gn()}})]})]})}),(0,$.jsx)(ze,{open:at,title:l(`projects.upload`),description:l(`projects.uploadDescription`,{size:e.maxUploadSizeMB}),onOpenChange:e=>{(e||!M)&&(ot(e),e||A(``))},footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{disabled:M,onClick:()=>{ot(!1),A(``)},children:l(`common.cancel`)}),(0,$.jsxs)(`button`,{className:`primary`,disabled:!k||M,"aria-busy":M,onClick:()=>void _n(),children:[M&&(0,$.jsx)(Ke,{className:`spin`,size:14}),l(M?j===`processing`?`projects.processing`:`projects.uploading`:`projects.import`)]})]}),children:(0,$.jsxs)(`div`,{className:`form-stack`,children:[ut&&(0,$.jsx)(`p`,{className:`error import-error`,children:ut}),(0,$.jsxs)(`div`,{className:`upload-picker${k?` has-file`:``}${M?` is-disabled`:``}`,onDragOver:e=>{e.preventDefault(),M||(e.dataTransfer.dropEffect=`copy`)},onDrop:e=>{e.preventDefault(),M||vn(e.dataTransfer.files[0]??null)},children:[(0,$.jsx)(`input`,{ref:mt,className:`sr-only`,type:`file`,accept:`.zip,application/zip`,disabled:M,onChange:e=>vn(e.target.files?.[0]??null)}),(0,$.jsx)(_,{size:34}),(0,$.jsxs)(`div`,{className:`upload-picker-copy`,children:[(0,$.jsx)(`strong`,{children:k?.name??l(`projects.chooseZip`)}),(0,$.jsx)(`span`,{children:k?l(`projects.selectedFileSize`,{size:De(k.size,{maximumUnit:`MB`})}):l(`projects.dropZip`)})]}),(0,$.jsxs)(`button`,{type:`button`,disabled:M,onClick:()=>mt.current?.click(),children:[(0,$.jsx)(ee,{size:15}),l(`projects.browse`)]}),k&&(0,$.jsx)(`button`,{className:`upload-clear`,type:`button`,disabled:M,title:l(`projects.clearFile`),"aria-label":l(`projects.clearFile`),onClick:()=>{vn(null),mt.current&&(mt.current.value=``)},children:(0,$.jsx)(re,{size:14})})]}),(0,$.jsxs)(`label`,{className:`form-field`,children:[l(`projects.name`),(0,$.jsx)(`input`,{disabled:M,value:st,onChange:e=>ct(e.target.value)})]}),M&&(0,$.jsxs)(`div`,{className:`project-import-progress`,role:`status`,"aria-live":`polite`,children:[(0,$.jsxs)(`div`,{className:`project-import-progress-label`,children:[(0,$.jsx)(`span`,{children:l(j===`processing`?`projects.processing`:`projects.uploading`)}),j===`uploading`&&ft!==null&&(0,$.jsxs)(`small`,{"aria-hidden":`true`,children:[ft,`%`]})]}),(0,$.jsx)(`progress`,{"aria-label":l(`projects.uploadProgress`),max:100,value:j===`uploading`?ft??void 0:void 0}),j===`processing`&&(0,$.jsx)(`small`,{className:`import-progress-hint`,children:l(`projects.processingHint`)})]})]})}),St&&(0,$.jsx)(Be,{title:l(`tags.manage`),onClose:()=>Ct(!1),children:(0,$.jsx)(Cr,{open:!0,onOpenChange:Ct,onTagCreated:xn,onTagUpdated:Cn,onTagDeleted:wn})}),wt&&(0,$.jsx)(Be,{title:l(`projectIcons.title`),onClose:()=>Tt(null),children:(0,$.jsx)(wr,{project:wt,open:!0,onOpenChange:e=>{e||Tt(null)},onSave:Tn})}),(0,$.jsx)(ze,{open:!!F,title:l(`tags.assignTitle`,{project:F?.name??``}),description:l(`tags.assignDescription`),onOpenChange:e=>{e||(I(null),We(``))},footer:(0,$.jsx)(`button`,{onClick:()=>{I(null),We(``)},children:l(`common.close`)}),children:(0,$.jsxs)(`div`,{className:`tag-assignment-list`,children:[He&&(0,$.jsx)(`p`,{className:`error dialog-error`,children:He}),f.map(e=>(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:!!F?.tags.some(t=>t.id===e.id),onChange:()=>void bn(e)}),(0,$.jsx)(Or,{color:e.color}),(0,$.jsx)(`span`,{children:e.name})]},e.id)),f.length===0&&(0,$.jsx)(`p`,{className:`muted`,children:l(`tags.empty`)})]})}),(0,$.jsx)(ze,{open:!!Et,title:l(`projects.renameTitle`),onOpenChange:e=>{(e||!R)&&(e||(L(null),T(``)))},footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{disabled:R,onClick:()=>{L(null),T(``)},children:l(`common.cancel`)}),(0,$.jsxs)(`button`,{className:`primary`,disabled:R||!Dt.trim(),"aria-busy":R,onClick:()=>void En(),children:[R&&(0,$.jsx)(Ke,{className:`spin`,size:14}),l(R?`common.loading`:`projects.rename`)]})]}),children:(0,$.jsxs)($.Fragment,{children:[qe&&(0,$.jsx)(`p`,{className:`error dialog-error`,children:qe}),(0,$.jsxs)(`label`,{className:`form-field`,children:[l(`projects.name`),(0,$.jsx)(`input`,{autoFocus:!0,value:Dt,onChange:e=>{Ot(e.target.value),T(``)},onKeyDown:e=>{e.key===`Enter`&&En()}})]})]})}),(0,$.jsx)(ze,{open:!!At,title:l(`projects.duplicateTitle`),description:l(`projects.duplicateDescription`,{project:At?.name??``}),onOpenChange:e=>{!e&&!Mt&&(z(null),B(``),E(``))},footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{disabled:Mt,onClick:()=>{z(null),B(``),E(``)},children:l(`common.cancel`)}),(0,$.jsx)(`button`,{className:`primary`,disabled:Mt||!jt.trim(),onClick:()=>void Dn(),children:l(Mt?`projects.duplicating`:`projects.duplicate`)})]}),children:(0,$.jsxs)($.Fragment,{children:[Ye&&(0,$.jsx)(`p`,{className:`error dialog-error`,children:Ye}),(0,$.jsxs)(`label`,{className:`form-field`,children:[l(`projects.name`),(0,$.jsx)(`input`,{autoFocus:!0,value:jt,onChange:e=>{B(e.target.value),E(``)},onKeyDown:e=>{e.key===`Enter`&&Dn()}})]})]})}),(0,$.jsx)(ze,{open:!!zt,title:l(`projects.transferOwnership`),description:l(`projects.transferDescription`,{project:zt?.name??``}),onOpenChange:e=>{!e&&!U&&(Bt(null),H(``),W(``))},footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{disabled:U,onClick:()=>{Bt(null),H(``),W(``)},children:l(`common.cancel`)}),(0,$.jsxs)(`button`,{className:`primary`,disabled:U||!Ut,onClick:()=>void jn(),children:[U?(0,$.jsx)(Ke,{className:`spin`,size:14}):(0,$.jsx)($e,{size:14}),l(`projects.transfer`)]})]}),children:(0,$.jsxs)(`div`,{className:`form-stack`,children:[Gt&&(0,$.jsx)(`p`,{className:`error dialog-error`,children:Gt}),(0,$.jsxs)(`label`,{className:`form-field`,children:[l(`projects.newOwner`),(0,$.jsxs)(`select`,{disabled:U||Vt.length===0,value:Ut,onChange:e=>H(e.target.value),children:[(0,$.jsx)(`option`,{value:``,children:U?l(`common.loading`):Vt.length>0?l(`projects.chooseNewOwner`):l(`projects.noTransferUsers`)}),Vt.map(e=>(0,$.jsxs)(`option`,{value:e.id,children:[e.displayName??e.username,` (@`,e.username,`)`]},e.id))]})]}),(0,$.jsxs)(`p`,{className:`warning`,children:[(0,$.jsx)(ne,{size:15}),l(`projects.transferWarning`)]})]})}),(0,$.jsx)(Ue,{open:!!V,title:l(`projects.deleteTitle`),description:l(`projects.deleteDescription`,{project:V?.name??``}),confirmLabel:l(Ft?`common.loading`:`common.delete`),danger:!0,busy:Ft,error:Ze,onCancel:()=>{Ft||(Pt(null),D(``))},onConfirm:()=>void kn()})]}),Te&&(0,$.jsx)(Be,{title:l(`metrics.title`),onClose:()=>Ee(!1),children:(0,$.jsx)(yr,{open:!0,onOpenChange:Ee})}),je&&(0,$.jsx)(Be,{title:l(`account.githubTitle`),onClose:()=>Me(!1),children:(0,$.jsx)(Tr,{open:!0,onOpenChange:Me})}),(0,$.jsx)(Ge,{})]})}function Or({color:e}){return(0,$.jsx)(`span`,{className:`tag-dot tag-${e}`})}export{Dr as Dashboard,rr as a,Je as c,sr as i,cr as n,ir as o,or as r,R as s,hr as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{G as r,b as ee,rt as i,tt as a}from"./relativeTime-CFNodf1I.js";import{n as te,r as ne,t as o}from"./GitHubIcon-BqDow-CN.js";import{t as s}from"./eye-BvCLgqrq.js";import{n as re,t as ie}from"./minus-BmWzkFwz.js";import{t as ae}from"./minimize-2-BHKmubQs.js";import{t as oe}from"./plus-CoYCCEFJ.js";import{E as c,b as l,c as u,j as se,y as d}from"./index-DFEpXxLs.js";import{L as ce}from"./ProjectWorkspace-DHVcaXR0.js";var f={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};f.node;var le=l(f),p={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};p.node;var m=l(p),h={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};h.node;var g=l(h),_={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};_.node;var ue=l(_),v=e(t(),1),y=n();function b({open:e,project:t,onOpenChange:n,onBeforeMutation:l}){let{t:f,i18n:p}=se(),[h,_]=(0,v.useState)(null),[b,S]=(0,v.useState)([]),[C,w]=(0,v.useState)(()=>x(t.name)),[T,E]=(0,v.useState)(!0),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[fe,F]=(0,v.useState)(!1),[I,L]=(0,v.useState)(!0),[R,z]=(0,v.useState)(!0),[B,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(``),[K,q]=(0,v.useState)(!1),[J,Y]=(0,v.useState)(10),X=(0,v.useRef)(null),pe=async(e=!1)=>{let n=await c(`/api/projects/${t.id}/git`);if(_(n.status),e&&(L(!n.status.tokenConfigured),z(!n.status.remoteUrl)),n.status.initialized&&n.status.latestCommit){let e=await c(`/api/projects/${t.id}/git/history`);S(e.commits)}else S([])};(0,v.useEffect)(()=>{e?(U(``),G(``),A(null),q(!1),w(x(t.name)),V(`load`),l().then(()=>pe(!0)).catch(e=>U(e instanceof Error?e.message:f(`errors.generic`))).finally(()=>V(``))):(document.fullscreenElement&&document.exitFullscreen().catch(()=>void 0),q(!1))},[e,t.id]),(0,v.useEffect)(()=>{let e=()=>q(document.fullscreenElement===X.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,v.useEffect)(()=>{if(!K)return;let e=e=>{e.key===`Escape`&&!document.fullscreenElement&&q(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[K]);let Z=async(e,t,n,r)=>{V(e),U(``),G(``);try{await t(),n&&G(n)}catch(e){let t=e instanceof Error?e.message:f(`errors.generic`);U(r?`${r}: ${t}`:t)}finally{V(``)}},me=()=>Z(`repository`,async()=>{let e=await c(`/api/projects/${t.id}/git/repository`,{method:`POST`,body:JSON.stringify({name:C,private:T})});_(e.status),z(!1)},f(`git.repositoryCreated`)),he=()=>Z(`commit`,async()=>{if(!await l())throw Error(f(`errors.collaborationUnavailable`));let e=await c(`/api/projects/${t.id}/git/commit`,{method:`POST`,body:JSON.stringify({message:D})});_(e.status),S(t=>[e.commit,...t.filter(t=>t.sha!==e.commit.sha)].slice(0,100)),O(``),A(null)},f(`git.committed`),f(`git.commitFailed`)),ge=()=>Z(`push`,async()=>{if(!await l())throw Error(f(`errors.collaborationUnavailable`));let e=await c(`/api/projects/${t.id}/git/push`,{method:`POST`});_(e.status)},f(`git.pushed`),f(`git.pushFailed`)),Q=e=>Z(`diff`,async()=>{if(!await l())throw Error(f(`errors.collaborationUnavailable`));let n=e?`?revision=${encodeURIComponent(e)}`:``,r=await c(`/api/projects/${t.id}/git/diff${n}`);A({...r,revision:e})}),$=e=>{k?.revision===e?(A(null),q(!1),document.fullscreenElement&&document.exitFullscreen().catch(()=>void 0)):Q(e)},_e=async()=>{if(K){document.fullscreenElement&&await document.exitFullscreen().catch(()=>void 0),q(!1);return}let e=X.current;if(e?.requestFullscreen)try{await e.requestFullscreen()}catch{}q(!0)},ve=()=>{let e=j;e&&(M(null),Z(`checkout`,async()=>{if(!await l())throw Error(f(`errors.collaborationUnavailable`));await c(`/api/projects/${t.id}/git/checkout`,{method:`POST`,body:JSON.stringify({revision:e===`branch`?null:e.sha,force:N})}),window.location.reload()}))},ye=()=>{F(!1),Z(`discard`,async()=>{if(!await l())throw Error(f(`errors.collaborationUnavailable`));await c(`/api/projects/${t.id}/git/discard`,{method:`POST`}),window.location.reload()})},be=B===`load`&&!h;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u,{open:e,extraWide:!0,className:K?`git-dialog-modal-fullscreen`:void 0,title:f(`git.title`),description:f(`git.description`),onOpenChange:n,footer:(0,y.jsx)(`button`,{onClick:()=>n(!1),children:f(`common.close`)}),children:(0,y.jsxs)(`div`,{className:`git-dialog`,children:[be&&(0,y.jsxs)(`div`,{className:`git-loading`,children:[(0,y.jsx)(d,{className:`spin`,size:22}),f(`common.loading`)]}),H&&(0,y.jsx)(`p`,{className:`git-message error`,role:`alert`,children:H}),W&&(0,y.jsxs)(`p`,{className:`git-message success`,role:`status`,children:[(0,y.jsx)(r,{size:14}),W]}),h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`section`,{className:`git-section`,children:[(0,y.jsxs)(`button`,{className:`git-section-toggle`,type:`button`,"aria-expanded":I,onClick:()=>L(e=>!e),children:[(0,y.jsxs)(`span`,{className:`git-section-heading`,children:[(0,y.jsx)(o,{size:16}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`strong`,{children:f(`git.authentication`)}),(0,y.jsx)(`small`,{children:h.tokenConfigured?f(`git.connectedAs`,{login:h.githubLogin}):f(`git.authenticationHint`)})]})]}),I?(0,y.jsx)(i,{size:16}):(0,y.jsx)(a,{size:16})]}),I&&(0,y.jsx)(`div`,{className:`git-section-content`,children:(0,y.jsx)(`p`,{className:`git-account-guidance`,children:h.tokenConfigured?f(`git.accountTokenManaged`,{login:h.githubLogin}):f(`git.accountTokenMissing`)})})]}),(0,y.jsxs)(`section`,{className:`git-section`,children:[(0,y.jsxs)(`button`,{className:`git-section-toggle`,type:`button`,"aria-expanded":R,onClick:()=>z(e=>!e),children:[(0,y.jsxs)(`span`,{className:`git-section-heading`,children:[(0,y.jsx)(te,{size:16}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`strong`,{children:f(`git.repository`)}),(0,y.jsx)(`small`,{children:h.remoteUrl?h.repositoryName??h.remoteUrl:h.initialized?f(`git.localReady`):f(`git.localPending`)})]})]}),R?(0,y.jsx)(i,{size:16}):(0,y.jsx)(a,{size:16})]}),R&&(0,y.jsx)(`div`,{className:`git-section-content`,children:h.remoteUrl?(0,y.jsxs)(`div`,{className:`git-repository-card`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`strong`,{children:h.repositoryName??f(`git.origin`)}),(0,y.jsxs)(`small`,{children:[h.branch??f(`git.detachedAt`,{revision:h.latestCommit?.shortSha??`HEAD`}),` · `,h.dirty?f(`git.changedFiles`,{count:h.changedFiles}):f(`git.clean`)]})]}),h.repositoryHtmlUrl&&(0,y.jsxs)(`a`,{href:h.repositoryHtmlUrl,target:`_blank`,rel:`noreferrer`,children:[(0,y.jsx)(ne,{size:14}),f(`git.openGitHub`)]})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`label`,{className:`form-field`,children:[f(`git.repositoryName`),(0,y.jsx)(`input`,{value:C,onChange:e=>w(e.target.value)})]}),(0,y.jsxs)(`label`,{className:`checkbox-field`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>E(e.target.checked)}),f(`git.privateRepository`)]}),(0,y.jsxs)(`button`,{className:`git-primary-action`,disabled:!!B||!h.tokenConfigured||!C.trim(),onClick:me,children:[B===`repository`?(0,y.jsx)(d,{className:`spin`,size:14}):(0,y.jsx)(o,{size:14}),f(`git.createRepository`)]})]})})]}),h.initialized&&(0,y.jsxs)(`section`,{className:`git-section`,children:[(0,y.jsxs)(`div`,{className:`git-section-heading`,children:[(0,y.jsx)(g,{size:16}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`strong`,{children:f(`git.commitAndPush`)}),(0,y.jsx)(`small`,{children:h.branch?f(`git.identity`,{username:t.ownerUsername}):f(`git.detachedHead`)})]})]}),(0,y.jsxs)(`label`,{className:`form-field`,children:[f(`git.commitMessage`),(0,y.jsx)(`textarea`,{rows:3,value:D,placeholder:f(`git.commitPlaceholder`),onChange:e=>O(e.target.value)})]}),(0,y.jsxs)(`div`,{className:`git-action-row`,children:[(0,y.jsxs)(`button`,{title:h.dirty?void 0:f(`git.noChangesToCommit`),disabled:!!B||!h.branch||!h.dirty||!D.trim(),onClick:he,children:[B===`commit`?(0,y.jsx)(d,{className:`spin`,size:14}):(0,y.jsx)(g,{size:14}),f(`git.commit`)]}),(0,y.jsxs)(`button`,{title:h.ahead===0&&h.branch&&h.remoteUrl&&h.tokenConfigured&&h.latestCommit?f(`git.noUnpushedCommits`):void 0,disabled:!!B||!h.branch||!h.tokenConfigured||!h.remoteUrl||!h.latestCommit||h.ahead===0,onClick:ge,children:[B===`push`?(0,y.jsx)(d,{className:`spin`,size:14}):(0,y.jsx)(le,{size:14}),f(`git.push`),h.ahead>0&&(0,y.jsx)(`span`,{className:`git-count`,children:h.ahead})]}),(0,y.jsxs)(`button`,{disabled:!!B||!h.latestCommit,onClick:()=>void Q(),children:[B===`diff`?(0,y.jsx)(d,{className:`spin`,size:14}):(0,y.jsx)(s,{size:14}),f(`git.workingDiff`)]}),(0,y.jsxs)(`button`,{className:`git-discard-button`,title:h.restorable?f(`git.discardChanges`):f(`git.noChangesToDiscard`),disabled:!!B||!h.latestCommit||!h.restorable,onClick:()=>F(!0),children:[(0,y.jsx)(ce,{size:14}),f(`git.discardChanges`)]}),!h.branch&&(0,y.jsxs)(`button`,{disabled:!!B,onClick:()=>{P(!1),M(`branch`)},children:[(0,y.jsx)(r,{size:14}),f(`git.returnToBranch`,{branch:h.defaultBranch})]})]})]}),k&&(0,y.jsxs)(`section`,{ref:X,className:`git-section git-diff-section${K?` is-fullscreen`:``}`,children:[(0,y.jsxs)(`div`,{className:`git-diff-heading`,children:[(0,y.jsxs)(`div`,{className:`git-section-heading`,children:[(0,y.jsx)(s,{size:16}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`strong`,{children:f(`git.diffTitle`)}),(0,y.jsxs)(`small`,{children:[k.title,k.truncated?` · ${f(`git.diffTruncated`)}`:``]})]})]}),(0,y.jsxs)(`div`,{className:`git-diff-controls`,children:[(0,y.jsxs)(`div`,{className:`git-diff-font-controls`,role:`group`,"aria-label":f(`git.diffFontSize`),children:[(0,y.jsx)(`button`,{type:`button`,className:`git-diff-font-button`,disabled:J<=8,title:f(`git.diffFontDecrease`),"aria-label":f(`git.diffFontDecrease`),onClick:()=>Y(e=>Math.max(8,e-1)),children:(0,y.jsx)(ie,{size:14})}),(0,y.jsxs)(`span`,{className:`git-diff-font-value`,"aria-live":`polite`,children:[J,`px`]}),(0,y.jsx)(`button`,{type:`button`,className:`git-diff-font-button`,disabled:J>=24,title:f(`git.diffFontIncrease`),"aria-label":f(`git.diffFontIncrease`),onClick:()=>Y(e=>Math.min(24,e+1)),children:(0,y.jsx)(oe,{size:14})})]}),(0,y.jsx)(`button`,{type:`button`,className:`git-diff-fullscreen`,title:f(K?`git.exitFullscreenDiff`:`git.fullscreenDiff`),"aria-label":f(K?`git.exitFullscreenDiff`:`git.fullscreenDiff`),onClick:()=>void _e(),children:K?(0,y.jsx)(ae,{size:15}):(0,y.jsx)(re,{size:15})})]})]}),(0,y.jsx)(de,{content:k.diff,empty:f(`git.noChanges`),fontSize:J})]}),h.initialized&&(0,y.jsxs)(`section`,{className:`git-section`,children:[(0,y.jsxs)(`div`,{className:`git-section-heading`,children:[(0,y.jsx)(r,{size:16}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`strong`,{children:f(`git.history`)}),(0,y.jsx)(`small`,{children:f(`git.historyHint`)})]})]}),(0,y.jsxs)(`div`,{className:`git-history`,children:[b.map(e=>{let t=k?.revision===e.sha;return(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`code`,{children:e.shortSha}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`strong`,{children:e.message}),(0,y.jsxs)(`small`,{children:[e.authorName,` · `,ee(e.authoredAt,p.resolvedLanguage)]})]}),(0,y.jsxs)(`span`,{"data-texlite-tooltip-always":!0,children:[(0,y.jsx)(`button`,{type:`button`,className:t?`is-active`:void 0,title:f(t?`git.hideCommitDiff`:`git.viewCommitDiff`),"aria-label":f(t?`git.hideCommitDiff`:`git.viewCommitDiff`),"aria-pressed":t,disabled:!!B,onClick:()=>$(e.sha),children:t?(0,y.jsx)(m,{size:14}):(0,y.jsx)(s,{size:14})}),(0,y.jsx)(`button`,{type:`button`,title:f(`git.checkoutVersion`),disabled:!!B,onClick:()=>{P(!1),M(e)},children:(0,y.jsx)(ue,{size:14})})]})]},e.sha)}),b.length===0&&(0,y.jsx)(`p`,{className:`muted`,children:f(`git.noCommits`)})]})]})]})]})}),(0,y.jsx)(u,{open:!!j,title:f(j===`branch`?`git.returnTitle`:`git.checkoutTitle`),description:j===`branch`?f(`git.returnDescription`,{branch:h?.defaultBranch??`main`}):f(`git.checkoutDescription`,{revision:j?.shortSha??``,message:j?.message??``}),onOpenChange:e=>{e||M(null)},footer:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{onClick:()=>M(null),children:f(`common.cancel`)}),(0,y.jsx)(`button`,{className:N?`danger`:`primary`,onClick:ve,children:f(`git.checkout`)})]}),children:(0,y.jsxs)(`label`,{className:`git-force-checkout`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:N,onChange:e=>P(e.target.checked)}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`strong`,{children:f(`git.forceCheckout`)}),(0,y.jsx)(`small`,{children:f(`git.forceCheckoutDescription`)})]})]})}),(0,y.jsx)(u,{open:fe,title:f(`git.discardTitle`),description:f(`git.discardDescription`),onOpenChange:F,footer:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{onClick:()=>F(!1),children:f(`common.cancel`)}),(0,y.jsx)(`button`,{className:`danger`,onClick:ye,children:f(`git.discardConfirm`)})]}),children:(0,y.jsx)(y.Fragment,{})})]})}function de({content:e,empty:t,fontSize:n}){return e.trim()?(0,y.jsx)(`pre`,{className:`git-diff`,style:{fontSize:`${n}px`},children:e.split(`
|
|
2
|
+
`).map((e,t)=>{let n=e.startsWith(`+`)&&!e.startsWith(`+++`)?`addition`:e.startsWith(`-`)&&!e.startsWith(`---`)?`deletion`:e.startsWith(`@@`)?`hunk`:e.startsWith(`diff `)?`header`:``;return(0,y.jsxs)(`span`,{className:n,children:[e,`
|
|
3
|
+
`]},t)})}):(0,y.jsx)(`div`,{className:`git-diff-empty`,children:t})}function x(e){return e.trim().replace(/\s+/g,`-`).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^[.-]+|[.-]+$/g,``).slice(0,100)||`texlite-project`}export{b as GitDialog};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{R as r}from"./relativeTime-CFNodf1I.js";import{r as i,t as a}from"./GitHubIcon-BqDow-CN.js";import{t as o}from"./SaveButton-C8W1DGzx.js";import{C as s,E as c,c as l,j as u,y as d}from"./index-DFEpXxLs.js";import{t as f}from"./SuccessNotice-ubBtzzi_.js";var p=e(t(),1),m=n();function h(){let{t:e}=u();return(0,m.jsxs)(`div`,{className:`git-token-guidance`,children:[(0,m.jsx)(`strong`,{children:e(`git.recommendedAccessTitle`)}),(0,m.jsxs)(`span`,{children:[e(`git.recommendedAccessBeforeAll`),(0,m.jsx)(`em`,{className:`git-token-highlight`,children:`All repositories`}),e(`git.recommendedAccessBeforeAdministration`),(0,m.jsx)(`em`,{className:`git-token-highlight`,children:`Administration`}),e(`git.recommendedAccessBetweenPermissions`),(0,m.jsx)(`em`,{className:`git-token-highlight`,children:`Contents`}),e(`git.recommendedAccessAfterPermissions`)]})]})}function g({open:e,onOpenChange:t}){let{t:n}=u(),[g,_]=(0,p.useState)(null),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),{message:w,show:T,clear:E}=f();(0,p.useEffect)(()=>{e&&(x(`load`),C(``),E(),y(``),c(`/api/account/github`).then(e=>_(e.status)).catch(e=>C(s(e))).finally(()=>x(e=>e===`load`?``:e)))},[e,E]);let D=async()=>{if(!b){x(`save`),C(``),E();try{let e=await c(`/api/account/github`,{method:`PUT`,body:JSON.stringify({token:v})});_(e.status),y(``),T(`save`)}catch(e){C(s(e))}finally{x(``)}}},O=async()=>{if(!b){x(`remove`),C(``),E();try{let e=await c(`/api/account/github`,{method:`DELETE`});_(e.status),y(``),T(`remove`)}catch(e){C(s(e))}finally{x(``)}}};return(0,m.jsx)(l,{open:e,title:n(`account.githubTitle`),description:n(`account.githubDescription`),onOpenChange:e=>{b||t(e)},footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`button`,{disabled:!!b,onClick:()=>t(!1),children:n(`common.close`)}),(0,m.jsx)(o,{saving:b===`save`,feedback:w===`save`?n(`editor.saved`):``,disabled:!!b||v.trim().length<20,onClick:()=>void D(),children:n(`git.saveToken`)})]}),children:(0,m.jsxs)(`div`,{className:`git-dialog account-github-dialog`,children:[b===`load`&&!g&&(0,m.jsxs)(`div`,{className:`git-loading`,children:[(0,m.jsx)(d,{className:`spin`,size:20}),n(`common.loading`)]}),S&&(0,m.jsx)(`p`,{className:`git-message error dialog-error`,children:S}),g&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(h,{}),g.tokenConfigured&&(0,m.jsxs)(`div`,{className:`git-account`,children:[(0,m.jsx)(a,{size:17}),(0,m.jsx)(`span`,{children:n(`git.connectedAs`,{login:g.githubLogin})}),(0,m.jsxs)(`button`,{className:`danger-text`,disabled:!!b,onClick:()=>void O(),children:[b===`remove`?(0,m.jsx)(d,{className:`spin`,size:14}):(0,m.jsx)(r,{size:14}),n(`git.removeToken`)]})]}),(0,m.jsxs)(`label`,{className:`form-field`,children:[g.tokenConfigured?n(`git.replaceToken`):n(`git.token`),(0,m.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,autoCapitalize:`none`,autoCorrect:`off`,value:v,placeholder:n(`git.tokenPlaceholder`),onChange:e=>{y(e.target.value),E()}})]}),(0,m.jsx)(`div`,{className:`git-inline-actions`,children:(0,m.jsxs)(`a`,{href:`https://github.com/settings/personal-access-tokens/new`,target:`_blank`,rel:`noreferrer`,children:[n(`git.createToken`),(0,m.jsx)(i,{size:12})]})}),(0,m.jsx)(`p`,{className:`muted account-github-encryption-note`,children:n(`account.githubEncryption`)})]})]})})}export{g as GitHubAccountDialog};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-DUEFWlB7.js";import{b as t}from"./index-
|
|
1
|
+
import{t as e}from"./react-DUEFWlB7.js";import{b as t}from"./index-DFEpXxLs.js";var n={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};n.node;var r=t(n),i={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};i.node;var a=t(i),o=e();function s({size:e=24,...t}){return(0,o.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,...t,children:[(0,o.jsx)(`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`}),(0,o.jsx)(`path`,{d:`M9 18c-4.51 2-5-2-7-2`})]})}export{a as n,r,s as t};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{J as r,R as i,Z as a,b as o,y as s}from"./relativeTime-CFNodf1I.js";import{t as c}from"./circle-check-DjXwnxuR.js";import{t as l}from"./clock-3-D-XeFtkK.js";import{t as u}from"./hard-drive-Crh-l_oh.js";import{n as d,t as f}from"./minus-BmWzkFwz.js";import{t as p}from"./minimize-2-BHKmubQs.js";import{t as m}from"./plus-CoYCCEFJ.js";import{t as h}from"./SaveButton-C8W1DGzx.js";import{t as g}from"./search-l36unLLS.js";import{C as _,E as v,T as y,b,c as ee,j as te,s as ne,y as x}from"./index-DFEpXxLs.js";import{t as re}from"./SuccessNotice-ubBtzzi_.js";import{r as S}from"./dist-Dxkdrap6.js";import{B as ie,F as C,L as ae,P as w}from"./ProjectWorkspace-DHVcaXR0.js";var T={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};T.node;var oe=b(T),E={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};E.node;var se=b(E),D=e(t(),1),O=55296,k=2048,A=63487,j=4e4;function M(e,t){if(e===t)return e?[[0,e]]:[];let n=[``],r=new Map,i=(e,t)=>{let i=[];for(let a=0;a<e.length;){let o=e.indexOf(`
|
|
2
|
+
`,a),s=o<0?e.length:o+1,c=e.slice(a,s),l=r.get(c);if(l===void 0&&(n.length===t&&(c=e.slice(a),s=e.length,l=r.get(c)),l===void 0)){let e=n.length;l=String.fromCharCode(e<O?e:e+k),n.push(c),r.set(c,l)}i.push(l),a=s}return i.join(``)},a=i(e,j),o=i(t,A);return S(a,o,{checkLines:!1,timeout:1}).map(([e,t])=>[e,Array.from(t,e=>{let t=e.charCodeAt(0),r=t<O?t:t-k;return n[r]}).join(``)])}function ce(e,t,n,r=`历史版本`,i=`当前版本`,a=3){let o=t.replace(/\r\n/g,`
|
|
3
|
+
`),s=n.replace(/\r\n/g,`
|
|
4
|
+
`);if(o===s)return{diffText:``,additions:0,deletions:0,hasChanges:!1};let c=M(o,s),l=[],u=1,d=1,f=0,p=0;for(let[e,t]of c){if(!t)continue;let n=t.split(`
|
|
5
|
+
`);n[n.length-1]===``&&n.pop();for(let t of n)e===0?l.push({op:0,text:t,oldNum:u++,newNum:d++}):e===-1?(p++,l.push({op:-1,text:t,oldNum:u++,newNum:d})):e===1&&(f++,l.push({op:1,text:t,oldNum:u,newNum:d++}))}if(f===0&&p===0)return{diffText:``,additions:0,deletions:0,hasChanges:!1};let m=[],h=-1,g=-1;for(let e=0;e<l.length;e++)if(l[e].op!==0){let t=Math.max(0,e-a),n=Math.min(l.length-1,e+a);h===-1?(h=t,g=n):t<=g+1?g=Math.max(g,n):(m.push({start:h,end:g}),h=t,g=n)}h!==-1&&m.push({start:h,end:g});let _=[`--- a/${e} (${r})`,`+++ b/${e} (${i})`];for(let e of m){let t=l.slice(e.start,e.end+1),n=t.filter(e=>e.op<=0).length,r=t.filter(e=>e.op>=0).length,i=t[0],a=n===0?0:i.oldNum,o=r===0?0:i.newNum;_.push(`@@ -${a},${n} +${o},${r} @@`);for(let e of t){let t=e.op===-1?`-`:e.op===1?`+`:` `;_.push(`${t}${e.text}`)}}return{diffText:_.join(`
|
|
6
|
+
`),additions:f,deletions:p,hasChanges:!0}}function le(e,t){try{let n=new Date(e);if(Number.isNaN(n.getTime()))return e;let r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()?o(n,t,{hour:`2-digit`,minute:`2-digit`}):o(n,t,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return e}}function ue(e,t,n){if(e.label)return e.label;let r=le(e.createdAt,n);if(e.changedPaths.length===1)return`${e.changedPaths[0].split(`/`).pop()||e.changedPaths[0]} (${r})`;if(e.changedPaths.length===2)return`${e.changedPaths[0].split(`/`).pop()||e.changedPaths[0]}, ${e.changedPaths[1].split(`/`).pop()||e.changedPaths[1]} (${r})`;if(e.changedPaths.length>2)return`${e.changedPaths[0].split(`/`).pop()||e.changedPaths[0]} +${e.changedPaths.length-1} (${r})`;let i=e.author?.name||e.author?.username;return i?`${i} @ ${r}`:`${t} (${r})`}function de(e){if(!e)return!1;let t=C(e);return t===`text`||t===`other`}var N=n();function fe({open:e,projectId:t,onOpenChange:n,onSaved:r}){let{t:i}=te(),[a,o]=(0,D.useState)([]),[s,c]=(0,D.useState)(``),[l,u]=(0,D.useState)(``),[d,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(``),h=(0,D.useRef)(null),y=(0,D.useRef)(!1);(0,D.useEffect)(()=>{if(!e)return;let n=new AbortController;return h.current=n,o([]),c(``),u(``),f(!0),m(``),y.current=!1,v(`/api/projects/${t}/history/files`,{signal:n.signal}).then(e=>{n.signal.aborted||o(e.files)}).catch(e=>{n.signal.aborted||u(_(e))}).finally(()=>{n.signal.aborted||f(!1)}),()=>{n.abort(),h.current===n&&(h.current=null)}},[e,t]);let b=async(e,n)=>{let i=h.current;if(!(!i||i.signal.aborted||d||y.current)){y.current=!0,m(e),u(``);try{let a=await v(`/api/projects/${t}/history/files`,{method:`PATCH`,body:JSON.stringify({path:e,included:n}),signal:i.signal});if(i.signal.aborted)return;o(a.files),r()}catch(e){i.signal.aborted||u(_(e))}finally{i.signal.aborted||(y.current=!1,m(``))}}},ne=(0,D.useMemo)(()=>a.filter(e=>e.path.toLowerCase().includes(s.trim().toLowerCase())),[a,s]);return(0,N.jsx)(ee,{open:e,wide:!0,className:`history-tracking-modal`,title:i(`history.manageFiles`),description:i(`history.trackingDescription`),onOpenChange:n,footer:(0,N.jsx)(`button`,{type:`button`,onClick:()=>n(!1),children:i(`common.close`)}),children:(0,N.jsxs)(`div`,{className:`history-tracking`,children:[(0,N.jsx)(`p`,{className:`muted`,children:i(`history.trackingHint`)}),(0,N.jsxs)(`label`,{className:`history-tracking-search`,children:[(0,N.jsx)(g,{size:15,"aria-hidden":!0}),(0,N.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:i(`history.searchFiles`),"aria-label":i(`history.searchFiles`)})]}),l&&(0,N.jsx)(`p`,{className:`error`,role:`alert`,children:l}),d?(0,N.jsxs)(`p`,{className:`muted`,children:[(0,N.jsx)(x,{className:`spin`,size:15}),i(`common.loading`)]}):(0,N.jsxs)(`div`,{className:`history-tracking-grid`,"aria-busy":!!p,children:[ne.map(e=>{let t=e.path.lastIndexOf(`/`),n=e.path.slice(t+1),r=t<0?`./`:e.path.slice(0,t+1);return(0,N.jsxs)(`div`,{className:`history-tracking-card${e.included?` included`:``}${e.missing?` missing`:``}`,children:[(0,N.jsxs)(`label`,{children:[(0,N.jsx)(w,{path:e.path,size:21}),(0,N.jsxs)(`span`,{className:`history-tracking-path`,children:[(0,N.jsx)(`strong`,{title:e.path,children:n}),(0,N.jsx)(`small`,{title:r,children:r})]}),(0,N.jsx)(`input`,{type:`checkbox`,checked:e.included,disabled:!!p||e.missing,onChange:t=>void b(e.path,t.target.checked)})]}),(0,N.jsxs)(`div`,{className:`history-tracking-card-footer`,children:[(0,N.jsx)(`small`,{children:e.missing?i(`history.fileMissing`):e.override===null?e.defaultIncluded?i(`history.defaultTracked`):i(`history.defaultUntracked`):i(`history.customTracking`)}),p===e.path?(0,N.jsx)(x,{className:`spin`,size:14,"aria-label":i(`common.loading`)}):e.override!==null&&(0,N.jsx)(`button`,{type:`button`,disabled:!!p,onClick:()=>void b(e.path,null),title:i(`history.resetTracking`),"aria-label":i(`history.resetTracking`),children:(0,N.jsx)(ae,{size:14})})]})]},e.path)}),ne.length===0&&(0,N.jsx)(`p`,{className:`muted`,children:i(`history.noMatchingFiles`)})]})]})})}var pe=100;function P({open:e,project:t,onOpenChange:n,onBeforeMutation:g}){let _=re(),{t:b,i18n:S}=te(),[C,w]=(0,D.useState)([]),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(``),[A,j]=(0,D.useState)(null),[M,P]=(0,D.useState)(``),[L,R]=(0,D.useState)(null),[me,he]=(0,D.useState)(0),[z,ge]=(0,D.useState)(`commit`),[_e,ve]=(0,D.useState)(11),[B,V]=(0,D.useState)(!1),[ye,be]=(0,D.useState)(``),[H,xe]=(0,D.useState)(null),[U,Se]=(0,D.useState)(null),[W,G]=(0,D.useState)(``),[Ce,we]=(0,D.useState)(null),[K,Te]=(0,D.useState)(!1),[Ee,q]=(0,D.useState)(``),[De,Oe]=(0,D.useState)(!1),[ke,Ae]=(0,D.useState)(0),je=(0,D.useRef)(null),J=(0,D.useRef)(null),Y=(0,D.useRef)(null),Me=(0,D.useRef)(O),Ne=(0,D.useRef)(t.id),Pe=(0,D.useRef)(!1),X=(0,D.useRef)(null);Me.current=O,Ne.current=t.id;let Fe=t.permission!==`read`,Ie=t.permission===`owner`,Z=!!W||K;(0,D.useEffect)(()=>{if(_.clear(),!e){Oe(!1),Y.current?.abort(),Y.current=null,X.current!==null&&window.clearTimeout(X.current),X.current=null,J.current?.abort(),J.current=null,Te(!1),document.fullscreenElement&&document.exitFullscreen().catch(()=>void 0),V(!1);return}J.current?.abort(),J.current=null;let n=new AbortController;return G(`load`),q(``),R(null),we(null),Te(!1),v(`/api/projects/${t.id}/history?limit=${pe}`,{signal:n.signal}).then(e=>{n.signal.aborted||(w(e.versions),E(e.stats),we(e.nextCursor),k(t=>e.versions.some(e=>e.id===t)?t:e.versions[0]?.id??``))}).catch(e=>{I(e)||q(F(e))}).finally(()=>{n.signal.aborted||G(``)}),()=>n.abort()},[e,t.id,ke]),(0,D.useEffect)(()=>()=>{J.current?.abort(),J.current=null,Y.current?.abort(),Y.current=null,X.current!==null&&window.clearTimeout(X.current)},[t.id]),(0,D.useEffect)(()=>{Y.current?.abort(),Y.current=null,_.clear()},[O]);let Le=async()=>{let e=Ce;if(!e||K||W)return;J.current?.abort();let n=new AbortController;J.current=n,Te(!0),q(``);try{let r=new URLSearchParams({limit:String(pe),before:e}),i=await v(`/api/projects/${t.id}/history?${r.toString()}`,{signal:n.signal});if(n.signal.aborted)return;w(e=>{let t=new Set(e.map(e=>e.id));return[...e,...i.versions.filter(e=>!t.has(e.id))]}),E(i.stats),we(i.nextCursor)}catch(e){I(e)||q(F(e))}finally{J.current===n&&(J.current=null,Te(!1))}};(0,D.useEffect)(()=>{let e=()=>V(document.fullscreenElement===je.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,D.useEffect)(()=>{if(!B)return;let e=e=>{e.key===`Escape`&&!document.fullscreenElement&&V(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[B]),(0,D.useEffect)(()=>{if(!e||!O){j(null);return}let n=new AbortController;return G(`detail`),R(null),v(`/api/projects/${t.id}/history/${O}`,{signal:n.signal}).then(e=>{if(n.signal.aborted)return;j(e),be(e.version.label??``);let t=e.version.changedPaths.find(t=>e.files.some(e=>e.path===t))??``;P(t)}).catch(e=>{!n.signal.aborted&&!I(e)&&q(F(e))}).finally(()=>{n.signal.aborted||G(e=>e===`detail`?``:e)}),()=>n.abort()},[e,t.id,O]);let Q=L?.previousVersion??null,Re=A?.files.find(e=>e.path===M),ze=Re?.textContent??de(M),Be=Re?.deleted===!0;(0,D.useEffect)(()=>{if(!e||!O||!M||!ze){Pe.current=!1,R(null),G(e=>e===`compare`?``:e);return}let n=new AbortController;R(null),G(`compare`);let r=Pe.current;Pe.current=!1,r||q(``);let i=z===`commit`?`&against=__previous__`:``;return v(`/api/projects/${t.id}/history/${O}/file?path=${encodeURIComponent(M)}${i}`,{signal:n.signal}).then(e=>{n.signal.aborted||R(e)}).catch(e=>{!n.signal.aborted&&!I(e)&&q(F(e))}).finally(()=>{n.signal.aborted||G(e=>e===`compare`?``:e)}),()=>n.abort()},[e,t.id,O,M,ze,z,me]);let $=(0,D.useMemo)(()=>{if(!A)return[];let e=new Set(A.version.changedPaths);return A.files.filter(t=>e.has(t.path))},[A]);(0,D.useEffect)(()=>{$.length>0&&!$.some(e=>e.path===M)?P($[0].path):$.length===0&&M&&P(``)},[$,M]);let Ve=async()=>{if(B){document.fullscreenElement&&await document.exitFullscreen().catch(()=>void 0),V(!1);return}let e=je.current;if(e?.requestFullscreen)try{await e.requestFullscreen()}catch{}V(!0)},He=async(e,n=!1)=>{let r=t.id;Y.current?.abort();let i=new AbortController;Y.current=i;try{let t=await v(`/api/projects/${r}/history/${e}`,{signal:i.signal});return i.signal.aborted||Ne.current!==r||Me.current!==e?!1:(j(t),be(t.version.label??``),P(e=>e&&t.files.some(t=>t.path===e)?e:t.version.changedPaths.find(e=>t.files.some(t=>t.path===e))??``),R(null),n&&(Pe.current=!0),he(e=>e+1),w(e=>e.map(e=>e.id===t.version.id?t.version:e)),!0)}finally{Y.current===i&&(Y.current=null)}},Ue=async()=>{if(A){G(`label`),q(``),_.clear();try{let e=await v(`/api/projects/${t.id}/history/${A.version.id}`,{method:`PATCH`,body:JSON.stringify({label:ye.trim()||null,snapshotHash:A.version.snapshotHash})});j(t=>t?.version.id===e.version.id?{...t,version:e.version}:t),w(t=>t.map(t=>t.id===e.version.id?e.version:t)),E(e.stats),_.show(e.version.id),e.retentionScheduled&&(X.current!==null&&window.clearTimeout(X.current),X.current=window.setTimeout(()=>{X.current=null,v(`/api/projects/${t.id}/history?limit=1`).then(e=>{E(e.stats)}).catch(()=>void 0)},e.retentionRefreshAfterMs))}catch(e){if(e instanceof y&&e.code===`HISTORY_VERSION_CHANGED`)try{if(!await He(A.version.id,!0))return}catch(e){if(I(e))return;q(F(e));return}q(F(e))}finally{G(``)}}},We=async()=>{let e=U;if(e){Se(null),G(`delete`),q(``);try{if(!await g())throw Error(b(`errors.collaborationUnavailable`));let n=e===`all`?`/api/projects/${t.id}/history`:`/api/projects/${t.id}/history/${e.id}`,r=await v(n,{method:`DELETE`});if(E(r.stats),e===`all`)w([]),k(``),j(null),R(null),we(null);else{let t=C.filter(t=>t.id!==e.id);w(t),O===e.id&&(k(t[0]?.id??``),j(null),R(null))}}catch(e){q(F(e))}finally{G(``)}}},Ge=async()=>{let e=H;if(e&&A){xe(null),G(`restore`),q(``);try{if(!await g())throw Error(b(`errors.collaborationUnavailable`));await v(`/api/projects/${t.id}/history/${A.version.id}/restore`,{method:`POST`,body:JSON.stringify(e===`project`?{snapshotHash:A.version.snapshotHash}:{path:e,snapshotHash:A.version.snapshotHash})}),window.location.reload()}catch(e){if(e instanceof y&&e.code===`HISTORY_VERSION_CHANGED`)try{if(!await He(A.version.id,!0)){G(``);return}}catch(e){if(I(e)){G(``);return}q(F(e)),G(``);return}q(F(e)),G(``)}}},Ke=A?.version.author?.name||A?.version.author?.username||(A?.version.reason===`autosave`?b(`history.reasons.autosave`):b(`editor.deletedUser`)),qe=A?le(A.version.createdAt,S.resolvedLanguage):``,Je=(0,D.useMemo)(()=>{if(!L||!A)return{diffText:``,additions:0,deletions:0,hasChanges:!1};if(z===`commit`){let e=L.comparison,t=L.historical,n=Q?`${Q.label||b(`history.reasons.${Q.reason}`)} (${le(Q.createdAt,S.resolvedLanguage)})`:`/dev/null`,r=`${A.version.label||b(`history.reasons.${A.version.reason}`)} (${qe})`;return ce(L.path,e,t,n,r)}{let e=L.historical,t=L.comparison,n=`${A.version.label||b(`history.reasons.${A.version.reason}`)} (${qe})`,r=b(`history.currentVersion`);return ce(L.path,e,t,n,r)}},[L,A,z,Q,qe,b,S.resolvedLanguage]),Ye=A?b(`history.reasons.${A.version.reason}`):``,Xe=A?ue(A.version,Ye,S.resolvedLanguage):``,Ze=U&&U!==`all`?ue(U,b(`history.reasons.${U.reason}`),S.resolvedLanguage):``,Qe=Fe&&A?(0,N.jsxs)(`button`,{type:`button`,className:`history-restore-project`,disabled:Z,title:b(`history.restoreProjectTitle`),onClick:()=>xe(`project`),children:[(0,N.jsx)(ae,{size:14}),b(`history.restoreProject`)]}):null;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ee,{open:e,extraWide:!0,draggable:!0,className:`history-dialog-modal`,title:b(`history.projectSnapshots`),description:b(`history.description`),onOpenChange:n,footer:(0,N.jsxs)(N.Fragment,{children:[Fe&&(0,N.jsxs)(`button`,{type:`button`,className:`history-manage-files`,disabled:Z,onClick:()=>Oe(!0),children:[(0,N.jsx)(oe,{size:15,"aria-hidden":!0}),(0,N.jsx)(`span`,{children:b(`history.manageFiles`)})]}),(0,N.jsx)(`button`,{type:`button`,className:`history-close`,onClick:()=>n(!1),children:b(`common.close`)})]}),children:(0,N.jsxs)(`div`,{className:`history-dialog`,children:[Ee&&(0,N.jsx)(`p`,{className:`error history-message`,children:Ee}),W===`load`&&C.length===0?(0,N.jsxs)(`div`,{className:`history-loading`,children:[(0,N.jsx)(x,{className:`spin`,size:22}),b(`common.loading`)]}):(0,N.jsxs)(`div`,{className:`history-dialog-layout`,children:[(0,N.jsxs)(`aside`,{className:`history-timeline`,children:[Ie&&T&&(0,N.jsxs)(`div`,{className:`history-stats${T.storageLimitExceeded?` exceeded`:``}`,children:[(0,N.jsxs)(`header`,{children:[(0,N.jsxs)(`span`,{children:[(0,N.jsx)(u,{size:14}),b(`history.storage`)]}),(0,N.jsx)(`button`,{type:`button`,disabled:Z||C.length===0,title:b(`history.clearAll`),"aria-label":b(`history.clearAll`),onClick:()=>Se(`all`),children:(0,N.jsx)(i,{size:13})})]}),(0,N.jsx)(`strong`,{children:b(`history.storageUsage`,{used:s(T.totalBytes,{trimTrailingZero:!0}),limit:s(T.maxStorageBytes,{trimTrailingZero:!0})})}),(0,N.jsx)(`progress`,{max:T.maxStorageBytes,value:Math.min(T.totalBytes,T.maxStorageBytes)}),(0,N.jsx)(`small`,{children:b(`history.storageBreakdown`,{objects:s(T.objectBytes,{trimTrailingZero:!0}),metadata:s(T.metadataBytes,{trimTrailingZero:!0}),protected:s(T.protectedBytes,{trimTrailingZero:!0})})}),(0,N.jsxs)(`small`,{children:[b(`history.versionUsage`,{count:T.maxVersions,versions:T.ordinaryVersionCount,limit:T.maxVersions>0?T.maxVersions:`∞`}),T.labeledVersionCount>0?` · ${b(`history.protectedVersions`,{count:T.labeledVersionCount})}`:``]}),T.storageLimitExceeded&&(0,N.jsx)(`small`,{className:`history-storage-warning`,children:b(`history.storageExceeded`)})]}),C.map(e=>{let t=b(`history.reasons.${e.reason}`),n=ue(e,t,S.resolvedLanguage),r=e.author?.name||e.author?.username||(e.reason===`autosave`?b(`history.reasons.autosave`):b(`editor.deletedUser`));return(0,N.jsxs)(`button`,{className:e.id===O?`active`:``,onClick:()=>k(e.id),children:[(0,N.jsx)(ie,{size:15}),(0,N.jsxs)(`span`,{children:[(0,N.jsxs)(`div`,{className:`history-item-heading`,children:[(0,N.jsx)(`strong`,{title:n,children:n}),(0,N.jsx)(`span`,{className:`history-reason-badge reason-${e.reason}`,children:t})]}),(0,N.jsx)(`small`,{children:o(e.createdAt,S.resolvedLanguage)}),(0,N.jsxs)(`small`,{children:[(0,N.jsx)(`span`,{className:`history-author-name`,"data-tooltip":e.author?.username?`@${e.author.username}`:void 0,"data-texlite-tooltip-always":!0,children:r}),` · `,b(`history.changedCount`,{count:e.changedPaths.length})]})]})]},e.id)}),Ce&&(0,N.jsx)(`div`,{className:`history-load-more`,children:(0,N.jsxs)(`button`,{type:`button`,disabled:Z,"aria-busy":K,onClick:()=>void Le(),children:[K?(0,N.jsx)(x,{className:`spin`,size:13}):(0,N.jsx)(l,{size:13}),b(K?`common.loading`:`history.loadOlder`)]})}),C.length===0&&(0,N.jsx)(`p`,{className:`muted padded`,children:b(`history.empty`)})]}),(0,N.jsx)(`section`,{className:`history-detail`,children:A&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`header`,{className:`history-detail-header`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`history-detail-title-row`,children:[(0,N.jsx)(`strong`,{title:Xe,children:Xe}),(0,N.jsx)(`span`,{className:`history-reason-badge reason-${A.version.reason}`,children:Ye})]}),(0,N.jsxs)(`div`,{className:`history-snapshot-meta`,children:[(0,N.jsxs)(`span`,{className:`history-snapshot-time`,children:[(0,N.jsx)(l,{size:12,"aria-hidden":!0}),(0,N.jsx)(`time`,{dateTime:A.version.createdAt,title:o(A.version.createdAt,S.resolvedLanguage),children:o(A.version.createdAt,S.resolvedLanguage,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}),A.version.author?(0,N.jsxs)(`span`,{className:`history-snapshot-attribution`,children:[(0,N.jsx)(`span`,{children:b(`history.lastChangedBy`)}),(0,N.jsx)(`strong`,{children:Ke})]}):(0,N.jsx)(`span`,{className:`history-snapshot-origin`,children:Ye}),(0,N.jsxs)(`span`,{className:`history-snapshot-file-count`,children:[(0,N.jsx)(r,{size:12,"aria-hidden":!0}),b(`history.fileCount`,{count:A.version.fileCount})]})]})]}),!Ie&&Qe]}),Ie&&(0,N.jsxs)(`div`,{className:`history-snapshot-actions`,children:[(0,N.jsxs)(`button`,{type:`button`,className:`history-delete-action`,disabled:Z,title:b(`history.deleteVersionTitle`),onClick:()=>Se(A.version),children:[(0,N.jsx)(i,{size:14}),b(`history.deleteVersion`)]}),Qe]}),Fe&&(0,N.jsxs)(`div`,{className:`history-label`,children:[(0,N.jsxs)(`label`,{children:[(0,N.jsx)(se,{size:14}),(0,N.jsx)(`input`,{value:ye,maxLength:80,"aria-label":b(`history.labelPlaceholder`),placeholder:b(`history.labelPlaceholder`),onChange:e=>be(e.target.value)})]}),(0,N.jsx)(h,{className:`history-label-save`,iconSize:13,feedback:_.message===A.version.id?b(`editor.saved`):``,saving:W===`label`,disabled:Z||ye.trim()===(A.version.label??``),onClick:()=>void Ue(),children:b(`history.saveLabel`)})]}),(0,N.jsxs)(`div`,{className:`history-files`,children:[(0,N.jsx)(`div`,{className:`history-files-toolbar`,children:(0,N.jsxs)(`div`,{className:`history-files-heading`,children:[(0,N.jsx)(a,{size:13}),(0,N.jsx)(`span`,{children:b(`history.changedFilesHeading`,{count:$.length})})]})}),$.length>0?(0,N.jsxs)(`div`,{className:`history-file-tabs-row`,children:[(0,N.jsx)(`div`,{className:`history-file-list`,children:$.map(e=>(0,N.jsxs)(`button`,{type:`button`,className:e.path===M?`active`:``,title:e.path,onClick:()=>P(e.path),children:[(0,N.jsx)(r,{size:13}),(0,N.jsx)(`span`,{children:e.path})]},e.path))}),Fe&&(0,N.jsx)(`div`,{className:`history-file-actions`,children:(0,N.jsxs)(`button`,{type:`button`,disabled:!M||Be||Z,title:b(`history.restoreFileTitle`),onClick:()=>xe(M),children:[(0,N.jsx)(ae,{size:13}),b(`history.restoreFile`)]})})]}):(0,N.jsx)(`p`,{className:`muted padded-small`,children:b(`history.noChangedFiles`)})]}),M&&!ze?(0,N.jsxs)(`p`,{className:`history-attachment-change`,children:[(0,N.jsx)(r,{size:14}),(0,N.jsx)(`span`,{children:b(Be?`history.nonTextFileDeleted`:`history.nonTextFileChanged`,{path:M})})]}):(0,N.jsx)(`div`,{ref:je,className:`history-comparison${B?` is-fullscreen`:``}`,children:M?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`header`,{children:[(0,N.jsxs)(`div`,{className:`history-comparison-meta`,children:[(0,N.jsx)(`strong`,{children:M}),(0,N.jsxs)(`small`,{className:`history-commit-summary`,children:[z===`commit`?(0,N.jsx)(`span`,{children:b(Q?`history.changedAt`:`history.createdAt`,{time:qe})}):(0,N.jsx)(`span`,{children:b(`history.comparingCurrent`)}),Je.hasChanges&&(0,N.jsxs)(`span`,{className:`history-diff-stats`,children:[(0,N.jsxs)(`span`,{className:`addition`,children:[`+`,Je.additions]}),` `,(0,N.jsxs)(`span`,{className:`deletion`,children:[`-`,Je.deletions]})]})]})]}),(0,N.jsxs)(`div`,{className:`history-diff-controls`,children:[(0,N.jsx)(`div`,{className:`history-diff-control-group`,children:(0,N.jsxs)(`div`,{className:`history-mode-toggle`,role:`group`,"aria-label":b(`history.diffMode`),children:[(0,N.jsx)(`button`,{type:`button`,className:z===`commit`?`active`:``,"aria-pressed":z===`commit`,onClick:()=>ge(`commit`),title:b(`history.diffModeCommitHint`),children:(0,N.jsx)(`span`,{children:b(`history.diffModeCommit`)})}),(0,N.jsx)(`button`,{type:`button`,className:z===`current`?`active`:``,"aria-pressed":z===`current`,onClick:()=>ge(`current`),title:b(`history.diffModeCurrentHint`),children:(0,N.jsx)(`span`,{children:b(`history.diffModeCurrent`)})})]})}),(0,N.jsx)(`span`,{className:`history-diff-control-divider`,"aria-hidden":`true`}),(0,N.jsx)(`div`,{className:`history-diff-control-group`,children:(0,N.jsxs)(`div`,{className:`git-diff-font-controls`,role:`group`,"aria-label":b(`git.diffFontSize`),children:[(0,N.jsx)(`button`,{type:`button`,className:`git-diff-font-button`,disabled:_e<=8,title:b(`git.diffFontDecrease`),"aria-label":b(`git.diffFontDecrease`),onClick:()=>ve(e=>Math.max(8,e-1)),children:(0,N.jsx)(f,{size:14})}),(0,N.jsxs)(`span`,{className:`git-diff-font-value`,"aria-live":`polite`,children:[_e,`px`]}),(0,N.jsx)(`button`,{type:`button`,className:`git-diff-font-button`,disabled:_e>=24,title:b(`git.diffFontIncrease`),"aria-label":b(`git.diffFontIncrease`),onClick:()=>ve(e=>Math.min(24,e+1)),children:(0,N.jsx)(m,{size:14})})]})}),(0,N.jsx)(`span`,{className:`history-diff-control-divider`,"aria-hidden":`true`}),(0,N.jsx)(`div`,{className:`history-diff-control-group`,children:(0,N.jsx)(`button`,{type:`button`,className:`git-diff-fullscreen`,title:b(B?`git.exitFullscreenDiff`:`git.fullscreenDiff`),"aria-label":b(B?`git.exitFullscreenDiff`:`git.fullscreenDiff`),onClick:()=>void Ve(),children:B?(0,N.jsx)(p,{size:15}):(0,N.jsx)(d,{size:15})})})]})]}),W===`compare`&&!L?(0,N.jsxs)(`div`,{className:`history-comparison-empty`,children:[(0,N.jsx)(x,{className:`spin`,size:24}),(0,N.jsx)(`span`,{children:b(`common.loading`)})]}):L?Je.hasChanges?(0,N.jsx)(`pre`,{className:`git-diff history-git-diff`,style:{fontSize:`${_e}px`},children:Je.diffText.split(`
|
|
7
|
+
`).map((e,t)=>{let n=e.startsWith(`+`)&&!e.startsWith(`+++`)?`addition`:e.startsWith(`-`)&&!e.startsWith(`---`)?`deletion`:e.startsWith(`@@`)?`hunk`:e.startsWith(`diff `)||e.startsWith(`---`)||e.startsWith(`+++`)?`header`:``;return(0,N.jsxs)(`span`,{className:n,children:[e,`
|
|
8
|
+
`]},t)})}):(0,N.jsxs)(`div`,{className:`git-diff-empty history-diff-empty`,children:[(0,N.jsx)(c,{size:24}),(0,N.jsx)(`span`,{children:b(z===`commit`?`history.noDifferencesInCommit`:`history.noDifferences`)})]}):(0,N.jsxs)(`div`,{className:`history-comparison-empty`,children:[(0,N.jsx)(r,{size:24}),(0,N.jsx)(`span`,{children:b(`apiErrors.historyPreviewUnsupported`)})]})]}):(0,N.jsxs)(`div`,{className:`history-comparison-empty`,children:[(0,N.jsx)(ie,{size:25}),(0,N.jsx)(`span`,{children:$.length===0?b(`history.noChangedFiles`):b(`history.chooseFile`)})]})})]})})]})]})}),(0,N.jsx)(fe,{open:e&&De,projectId:t.id,onOpenChange:Oe,onSaved:()=>{Ae(e=>e+1),he(e=>e+1)}}),(0,N.jsx)(ne,{open:!!H,title:b(H===`project`?`history.restoreProjectTitle`:`history.restoreFileTitle`),description:H===`project`?b(A?.scoped?`history.restoreTrackedDescription`:`history.restoreProjectDescription`):b(`history.restoreFileDescription`,{path:H??``}),confirmLabel:b(`history.restore`),danger:!0,onCancel:()=>xe(null),onConfirm:()=>void Ge()}),(0,N.jsx)(ne,{open:!!U,title:b(U===`all`?`history.clearAllTitle`:`history.deleteVersionTitle`),description:U===`all`?b(`history.clearAllDescription`):b(`history.deleteVersionDescription`,{name:Ze}),confirmLabel:b(U===`all`?`history.clearAll`:`history.deleteVersion`),danger:!0,onCancel:()=>Se(null),onConfirm:()=>void We()})]})}function F(e){return e instanceof Error?e.message:String(e)}function I(e){return e instanceof Error&&e.name===`AbortError`}export{P as HistoryDialog};
|
|
Binary file
|
|
Binary file
|