@xopcai/xopc 0.0.311 → 0.0.312
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/README.md +2 -1
- package/README.zh-CN.md +2 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-zKINl7UH.js → agent-avatar-dicebear-BVIJMP8w.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D2ePZKdY.js → agent-defaults-settings-panel-K3hTmu9d.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BiD9STyv.js → agents-D6g_SeWI.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-CKueEVbT.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C94LAxyt.js → app-management-settings-panel-CLg_aXYG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CP01zHvC.js → appearance-settings-CU52MfIT.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-ZpA1-6ad.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-SwWFt5MT.js → archive-plugin-CHO3heHX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DdTFml9l.js → attachment-load-BsmsBCI2.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Kmr5WVFp.js → automations-page-CftigJlf.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-bkijiu-Y.js → automations-workspace-IEAxKRME.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-47UTtDNq.js → binary-plugins-CRCLWBo2.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DvzZkMG8.js → block-editor-D0LDiOTT.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DrUKNL9X.js → browser-automations-page-Djyv3vy-.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-Dhf_MWCf.js → browser-settings-page-CU4VWsmX.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BCubrDf8.js → capabilities-settings-panel-C9XQk3HL.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-e4T1DEfN.js → channels-settings-Bqlhjooi.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Bg_m7HUE.js → chat-terminal-dock-CIsKqdET.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CosCmVsT.js → computer-settings-page-C0YL9J7m.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BL-hSR7_.js → connector-service-page-BmH17JnO.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-C0WWxnxJ.js → connectors-page-zkx8Q-e6.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DqYFVasF.js → date-picker-CDsfv8R0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DCyyFLKp.js → dependency-picker-DvhPj3CZ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CFnnpRA_.js → desktop-pet-Cyg8XMpL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-U5wWRH4c.js → desktop-pet-settings-CE4GOlMM.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BhHxvFO1.js → device-pairing-wizard-CdKJqnnw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DA8WJ3-E.js → extension-debug-page-D-AVJU3q.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C2BIB88m.js → extension-page-DrFoQ9xt.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-kpYo979N.js → extension-settings-page-DxWjESC1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CE9t1yTa.js → gateway-settings-CgXp2zq4.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-C7Ezx8Du.js → home-page-D6Idk732.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-NPk698vI.js → imports-page-BKucJlXI.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DxYitLp8.js → index-PFQHPGgi.js} +45 -45
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BhreF0_O.js → keyboard-shortcuts-settings-BxLXD-yU.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CPmynb3x.js → local-app-workbench-page-BmAqTRb4.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-DOZZBdqj.js → local-apps-page-BAsQJQKJ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-M8kz26yo.js → logs-page-ZjVYXXyM.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-JLqHYQvY.js → management-settings-CSTkYVOZ.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BDpcjR_Z.js → markdown-view-DYGPxPee.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B75SWUJd.js → media-plugins-CQtQzLyg.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-B_Ft0M32.js → note-detail-panel-DuXCt-MM.js} +3 -3
- package/dist/gateway/static/root/assets/notes-page-BjOgBVq5.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CMlQUzT6.js → page-tabs-B6DjkyMM.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-cZ2hszQT.js → preview-open-alternatives-Dn57uLhr.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CPoSbglF.js → product-open-page-H2YMk8TY.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DYttWua0.js → project-detail-page-0zi4-i9X.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-D46drWbl.js → projects-page-B18OxmJj.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-C9n9Nuhi.js → remote-access-hub-z-DxbuaE.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-bMLWRApp.js → runtime-tools-settings-panel-DGsBTbo6.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-Bgba03B_.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-UVJV_7AS.js → schema-form-CblI9WUA.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-C8P6ff91.js → sessions-page-B1t3bMsm.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CBX0Ezhf.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BqzOqonM.js → settings-form-section-BAaVyxJH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DQ9RJ8-b.js → settings-page-CKNPbm5q.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D3Spald3.js → settings-page-layout-DqNCGKxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-C8u601m8.js → setup-status-panel-Bw71C2X3.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BcgYzA7y.js → share-preview-page-BzMfp_HM.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bv-2rZ8e.js → shares-settings-BoVDQolc.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-LM-cgWUS.js → skill-reload-api-DtTptpAt.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-ggmb7rCW.js → skills-page-DIht92q6.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-ADABzrtk.js → skills-page.utils-DLYRiEn3.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DfkcW_Za.js → system-settings-panel-yYs4YgYk.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DC4yqDFd.js → task-detail-page-vgkiGo-D.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CTuwTdMm.js → tunnel-api-BasDYxvx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-5ZDd9XKh.js → use-autosave-CWAUHhcb.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BFKFhdZ0.js → user-model-page-CAGafNfP.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D3urfd-n.js → voice-api-key-field-Kc4UlxZs.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-JzM3Ylbs.js → work-discovery-overlay-BPC_c9dO.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bn2CtRdB.js → workflow-run-setup-panel-DBTciOrq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BiCmt98A.js → workflows-page-CSxHVs1p.js} +1 -1
- package/dist/gateway/static/root/index.html +4 -4
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/product-delivery.js +1 -0
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +43 -16
- package/dist/src/agent/tools/xopc-use-tool.js +60 -3
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +9 -0
- package/dist/src/config/schema.js +8 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -0
- package/dist/src/gateway/scenes/host.js +5 -4
- package/dist/src/gateway/service.js +2 -2
- package/dist/src/scenes/metrics.d.ts +3 -1
- package/dist/src/scenes/metrics.js +7 -1
- package/dist/src/scenes/model.d.ts +3 -0
- package/dist/src/scenes/model.js +10 -0
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/app-link-wamYbNUl.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-B7DmSJQj.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-C32mxSD-.js +0 -8
- package/dist/gateway/static/root/assets/product-delivery-CCC4FJ3Y.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-Dw3hmHAr.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-whpUsAy3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./cn-JdwAhgNB.js";import{i as s,n as c,r as l}from"./locale-store-DA0Z5jM_.js";import{t as u}from"./messages-4BtQKYlM.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{t as f}from"./button-CS04eWY9.js";import{t as p}from"./skeleton-BwbyijEw.js";import{Dl as m,Qi as h,gc as g,jc as _,qc as v,yc as y}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./cn-JdwAhgNB.js";import{i as s,n as c,r as l}from"./locale-store-DA0Z5jM_.js";import{t as u}from"./messages-4BtQKYlM.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{t as f}from"./button-CS04eWY9.js";import{t as p}from"./skeleton-BwbyijEw.js";import{Dl as m,Qi as h,gc as g,jc as _,qc as v,yc as y}from"./index-PFQHPGgi.js";import{n as b,r as x}from"./settings-page-layout-DqNCGKxQ.js";import{h as S,v as C}from"./tunnel-api-BasDYxvx.js";import{t as w}from"./device-pairing-wizard-CdKJqnnw.js";import{n as T}from"./settings-loading-skeleton-CAmWMaOT.js";var E=e(t(),1),D=n();async function O(e){let t=await e.json().catch(()=>null);if(!e.ok||t?.payload===void 0)throw Error(t?.error?.message??`Endpoint management request failed: ${e.status}`);return t.payload}function k(){return l(`/api/endpoint-tools/principals`)}function A(){return l(`/api/endpoint-tools/invocations?limit=50`)}async function j(){return O(await s(k()))}async function M(){return O(await s(A()))}async function N(e){await O(await s(l(`/api/endpoint-tools/principals/${encodeURIComponent(e)}`),{method:`DELETE`}))}var P=r();function F(){let e=i(),[t,n]=a(),r=c(e=>e.language),o=u(r).endpointToolsSettings.deviceAccess,s=d(`connected-devices`,S,{refreshInterval:1e4}),[l,_]=(0,E.useState)(!1),[b,x]=(0,E.useState)(),[T,D]=(0,E.useState)(),[O,k]=(0,E.useState)(!1),[A,j]=(0,E.useState)(!1);(0,E.useEffect)(()=>{let e=t.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(x(e),_(!0),n(e=>{let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t},{replace:!0}))},[t,n]);let M=(0,E.useCallback)(()=>{s.mutate()},[s]),N=async()=>{if(!(!T||O)){k(!0),j(!1);try{await C(T.id),D(void 0),await s.mutate()}catch{j(!0)}finally{k(!1)}}},F=s.data?.filter(e=>!e.revokedAt)??[];return(0,P.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-5`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:o.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:o.hint})]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,P.jsxs)(f,{variant:`secondary`,onClick:()=>{x(`mobile`),_(!0)},children:[(0,P.jsx)(g,{className:`size-4`}),o.addMobile]}),(0,P.jsxs)(f,{variant:`primary`,onClick:()=>e(`/settings/agent-browser?driver=extension`),children:[(0,P.jsx)(m,{className:`size-4`}),o.addLocalBrowser]}),(0,P.jsxs)(f,{variant:`secondary`,onClick:()=>{x(`browser`),_(!0)},children:[(0,P.jsx)(v,{className:`size-4`}),o.addRemoteBrowser]})]})]}),A?(0,P.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:o.revokeFailed}):null,(0,P.jsx)(`div`,{className:`mt-5 divide-y divide-edge-subtle`,children:s.isLoading?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(p,{className:`h-16`}),(0,P.jsx)(p,{className:`h-16`})]}):F.length===0?(0,P.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.empty}):F.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-4`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,P.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:e.platform===`chrome`?(0,P.jsx)(v,{className:`size-4`}):(0,P.jsx)(g,{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,P.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.platform===`chrome`?o.browserTitle:o.mobileTitle,` · `,o.lastSeen,`: `,e.lastSeenAt?new Intl.DateTimeFormat(r,{dateStyle:`medium`,timeStyle:`short`}).format(e.lastSeenAt):o.never]})]})]}),(0,P.jsxs)(f,{variant:`ghost`,onClick:()=>D(e),children:[(0,P.jsx)(y,{className:`size-4`}),o.revoke]})]},e.id))}),(0,P.jsx)(w,{open:l,onOpenChange:_,onPaired:M,targetKind:b}),(0,P.jsx)(h,{open:!!T,title:o.revokeTitle,description:o.revokeDescription.replace(`{{name}}`,T?.displayName??``),confirmLabel:O?o.revoking:o.revoke,cancelLabel:o.cancel,destructive:!0,onConfirm:()=>void N(),onCancel:()=>{O||D(void 0)}})]})}var I=5e3;function L(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function R(e){let t=(0,D.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=o(`rounded-full px-2 py-0.5 text-xs font-medium`,L(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,P.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function z(){let e=c(e=>e.language),t=u(e).endpointToolsSettings,n=d(k(),j,{refreshInterval:I}),r=d(A(),M,{refreshInterval:I}),[i,a]=(0,E.useState)(),[o,s]=(0,E.useState)(!1),[l,p]=(0,E.useState)(!1),m=(0,E.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(n.isLoading&&!n.data||r.isLoading&&!r.data)return(0,P.jsx)(x,{children:(0,P.jsx)(T,{sections:2})});let g=n.data??[],v=r.data??[],S=g.reduce((e,t)=>e+t.endpoints.length,0),C=()=>void Promise.all([n.mutate(),r.mutate()]),w=async()=>{if(!(!i||o)){s(!0),p(!1);try{await N(i.id),a(void 0),await Promise.all([n.mutate(),r.mutate()])}catch{p(!0)}finally{s(!1)}}};return(0,P.jsxs)(x,{children:[(0,P.jsx)(b,{title:t.title,actions:(0,P.jsxs)(f,{variant:`secondary`,onClick:C,children:[(0,P.jsx)(_,{className:`size-4`,"aria-hidden":!0}),t.refresh]})}),n.error||r.error?(0,P.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,P.jsx)(F,{}),(0,P.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[[t.registered,g.length],[t.online,S],[t.recentCalls,v.length]].map(([e,t])=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/20 px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e}),(0,P.jsx)(`p`,{className:`mt-1 text-2xl font-semibold text-fg`,children:t})]},String(e)))}),(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.devicesTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.devicesHint}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[g.length===0?(0,P.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):null,g.map(e=>{let n=e.revokedAt?`revoked`:e.endpoints.length>0?`online`:`offline`;return(0,P.jsxs)(`article`,{className:`rounded-xl bg-surface-base/55 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`h3`,{className:`font-medium text-fg`,children:e.displayName}),(0,P.jsx)(R,{status:n,label:t.status[n]})]}),(0,P.jsxs)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:[e.kind,` · `,e.platform,` · `,e.id]}),(0,P.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[t.lastSeen,`: `,e.lastSeenAt?m.format(e.lastSeenAt):t.never]})]}),e.revokedAt?null:(0,P.jsxs)(f,{variant:`secondary`,className:`text-danger`,onClick:()=>{p(!1),a(e)},children:[(0,P.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t.revoke]})]}),e.endpoints.map(e=>(0,P.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-base p-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-xs text-fg-muted`,children:[(0,P.jsx)(`span`,{children:e.endpointId}),(0,P.jsxs)(`span`,{children:[t.status[e.availability],` · v`,e.appVersion]})]}),(0,P.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.tools.map(({descriptor:e})=>(0,P.jsxs)(`span`,{className:`rounded-md bg-surface-hover/60 px-2 py-1 text-xs text-fg-muted`,title:e.requiredPermissions.join(`, `)||t.noPermissions,children:[e.name,(0,P.jsxs)(`span`,{className:`ml-1 text-fg-subtle`,children:[`· `,e.requiredPermissions.join(`, `)||t.noPermissions]})]},e.name))})]},e.connectionId))]},e.id)})]})]}),(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.callsTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.callsHint}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[v.length===0?(0,P.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noCalls}):null,v.map(e=>(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[m.format(e.startedAt),` · `,e.effect,` · `,e.endpointId]}),e.errorMessage?(0,P.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,P.jsx)(R,{status:e.status,label:t.status[e.status]})]},e.id))]})]}),(0,P.jsx)(h,{open:!!i,title:t.revokeTitle,description:`${t.revokeDescription.replace(`{{name}}`,i?.displayName??``)}${l?`\n\n${t.revokeError}`:``}`,confirmLabel:o?t.revoking:t.revoke,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void w(),onCancel:()=>{o||a(void 0)}})]})}export{z as EndpointToolsManagementSettings};
|
package/dist/gateway/static/root/assets/{markdown-view-BDpcjR_Z.js → markdown-view-DYGPxPee.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{a as r,n as i,t as a}from"./vendor-react-BOUWij0V.js";import{f as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./createLucideIcon-DPHK1VkS.js";import{t as l}from"./download-Dk-ZjtO6.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./cn-JdwAhgNB.js";import{n as p}from"./locale-store-DA0Z5jM_.js";import{t as m}from"./messages-4BtQKYlM.js";import{a as h,n as g,o as _,r as v,s as y,t as b}from"./dist-BGTk37IG.js";import{n as x,r as S,t as ee}from"./app-link-
|
|
1
|
+
import{i as e,r as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{a as r,n as i,t as a}from"./vendor-react-BOUWij0V.js";import{f as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./createLucideIcon-DPHK1VkS.js";import{t as l}from"./download-Dk-ZjtO6.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./cn-JdwAhgNB.js";import{n as p}from"./locale-store-DA0Z5jM_.js";import{t as m}from"./messages-4BtQKYlM.js";import{a as h,n as g,o as _,r as v,s as y,t as b}from"./dist-BGTk37IG.js";import{n as x,r as S,t as ee}from"./app-link-CKueEVbT.js";import{t as te}from"./copy-to-clipboard-HOJ79TWv.js";var ne=c(`file-image`,[[`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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),C=c(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),re=c(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]);function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ae(e){if(Array.isArray(e))return e}function oe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function se(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ce(e,t){return ae(e)||oe(e,t)||le(e,t)||se()}function le(e,t){if(e){if(typeof e==`string`)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}var ue=Object.entries,de=Object.setPrototypeOf,fe=Object.isFrozen,pe=Object.getPrototypeOf,me=Object.getOwnPropertyDescriptor,he=Object.freeze,ge=Object.seal,_e=Object.create,ve=typeof Reflect<`u`&&Reflect,ye=ve.apply,be=ve.construct;he||=function(e){return e},ge||=function(e){return e},ye||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},be||=function(e){return new e(...[...arguments].slice(1))};var xe=Ve(Array.prototype.forEach),Se=Ve(Array.prototype.lastIndexOf),Ce=Ve(Array.prototype.pop),we=Ve(Array.prototype.push),Te=Ve(Array.prototype.splice),Ee=Array.isArray,De=Ve(String.prototype.toLowerCase),Oe=Ve(String.prototype.toString),ke=Ve(String.prototype.match),Ae=Ve(String.prototype.replace),je=Ve(String.prototype.indexOf),Me=Ve(String.prototype.trim),Ne=Ve(Number.prototype.toString),Pe=Ve(Boolean.prototype.toString),Fe=typeof BigInt>`u`?null:Ve(BigInt.prototype.toString),Ie=typeof Symbol>`u`?null:Ve(Symbol.prototype.toString),Le=Ve(Object.prototype.hasOwnProperty),Re=Ve(Object.prototype.toString),ze=Ve(RegExp.prototype.test),Be=He(TypeError);function Ve(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ye(e,t,n)}}function He(e){return function(){return be(e,[...arguments])}}function Ue(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:De;if(de&&de(e,null),!Ee(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(fe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function We(e){for(let t=0;t<e.length;t++)Le(e,t)||(e[t]=null);return e}function Ge(e){let t=_e(null);for(let r of ue(e)){var n=ce(r,2);let i=n[0],a=n[1];Le(e,i)&&(Ee(a)?t[i]=We(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Ge(a):t[i]=a)}return t}function Ke(e){switch(typeof e){case`string`:return e;case`number`:return Ne(e);case`boolean`:return Pe(e);case`bigint`:return Fe?Fe(e):`0`;case`symbol`:return Ie?Ie(e):`Symbol()`;case`undefined`:return Re(e);case`function`:case`object`:{if(e===null)return Re(e);let t=e,n=qe(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Re(e)}return Re(e)}default:return Re(e)}}function qe(e,t){for(;e!==null;){let n=me(e,t);if(n){if(n.get)return Ve(n.get);if(typeof n.value==`function`)return Ve(n.value)}e=pe(e)}function n(){return null}return n}function Je(e){try{return ze(e,``),!0}catch{return!1}}var Ye=he(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Xe=he(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ze=he([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),eee=he([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Qe=he(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),tee=he([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),$e=he([`#text`]),et=he(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),tt=he(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),nt=he(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),rt=he([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),it=ge(/{{[\w\W]*|^[\w\W]*}}/g),at=ge(/<%[\w\W]*|^[\w\W]*%>/g),nee=ge(/\${[\w\W]*/g),ot=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),ree=ge(/^aria-[\-\w]+$/),st=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iee=ge(/^(?:\w+script|data):/i),ct=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aee=ge(/^html$/i),oee=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),lt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ut=function(){return typeof window>`u`?null:window},dt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ft=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ut(),t=e=>pt(e);if(t.version=`3.4.7`,t.removed=[],!e||!e.document||e.document.nodeType!==lt.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=qe(d,`cloneNode`),p=qe(d,`remove`),m=qe(d,`nextSibling`),h=qe(d,`childNodes`),g=qe(d,`parentNode`),_=qe(d,`shadowRoot`),v=qe(d,`attributes`),y=o&&o.prototype?qe(o.prototype,`nodeType`):null,b=o&&o.prototype?qe(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,ee=n,te=ee.implementation,ne=ee.createNodeIterator,C=ee.createDocumentFragment,re=ee.getElementsByTagName,ie=r.importNode,ae=ft();t.isSupported=typeof ue==`function`&&typeof g==`function`&&te&&te.createHTMLDocument!==void 0;let oe=it,se=at,ce=nee,le=ot,de=ree,fe=iee,pe=ct,me=oee,ge=st,ve=null,ye=Ue({},[...Ye,...Xe,...Ze,...Qe,...$e]),be=null,Ne=Ue({},[...et,...tt,...nt,...rt]),Pe=Object.seal(_e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Fe=null,Ie=null,Re=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ve=!0,He=!0,We=!1,mt=!0,ht=!1,gt=!0,_t=!1,vt=!1,yt=!1,bt=!1,xt=!1,St=!1,Ct=!0,wt=!1,Tt=`user-content-`,Et=!0,Dt=!1,Ot={},kt=null,At=Ue({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),jt=null,Mt=Ue({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Nt=null,Pt=Ue({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ft=`http://www.w3.org/1998/Math/MathML`,It=`http://www.w3.org/2000/svg`,Lt=`http://www.w3.org/1999/xhtml`,Rt=Lt,zt=!1,Bt=null,Vt=Ue({},[Ft,It,Lt],Oe),Ht=Ue({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ut=Ue({},[`annotation-xml`]),Wt=Ue({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],qt=null,Jt=null,Yt=n.createElement(`form`),Xt=function(e){return e instanceof RegExp||e instanceof Function},Zt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Jt&&Jt===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ge(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,qt=Gt===`application/xhtml+xml`?Oe:De,ve=Le(e,`ALLOWED_TAGS`)&&Ee(e.ALLOWED_TAGS)?Ue({},e.ALLOWED_TAGS,qt):ye,be=Le(e,`ALLOWED_ATTR`)&&Ee(e.ALLOWED_ATTR)?Ue({},e.ALLOWED_ATTR,qt):Ne,Bt=Le(e,`ALLOWED_NAMESPACES`)&&Ee(e.ALLOWED_NAMESPACES)?Ue({},e.ALLOWED_NAMESPACES,Oe):Vt,Nt=Le(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)?Ue(Ge(Pt),e.ADD_URI_SAFE_ATTR,qt):Pt,jt=Le(e,`ADD_DATA_URI_TAGS`)&&Ee(e.ADD_DATA_URI_TAGS)?Ue(Ge(Mt),e.ADD_DATA_URI_TAGS,qt):Mt,kt=Le(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)?Ue({},e.FORBID_CONTENTS,qt):At,Fe=Le(e,`FORBID_TAGS`)&&Ee(e.FORBID_TAGS)?Ue({},e.FORBID_TAGS,qt):Ge({}),Ie=Le(e,`FORBID_ATTR`)&&Ee(e.FORBID_ATTR)?Ue({},e.FORBID_ATTR,qt):Ge({}),Ot=Le(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ge(e.USE_PROFILES):e.USE_PROFILES:!1,Ve=e.ALLOW_ARIA_ATTR!==!1,He=e.ALLOW_DATA_ATTR!==!1,We=e.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=e.SAFE_FOR_TEMPLATES||!1,gt=e.SAFE_FOR_XML!==!1,_t=e.WHOLE_DOCUMENT||!1,bt=e.RETURN_DOM||!1,xt=e.RETURN_DOM_FRAGMENT||!1,St=e.RETURN_TRUSTED_TYPE||!1,yt=e.FORCE_BODY||!1,Ct=e.SANITIZE_DOM!==!1,wt=e.SANITIZE_NAMED_PROPS||!1,Et=e.KEEP_CONTENT!==!1,Dt=e.IN_PLACE||!1,ge=Je(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:st,Rt=typeof e.NAMESPACE==`string`?e.NAMESPACE:Lt,Ht=Le(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Ge(e.MATHML_TEXT_INTEGRATION_POINTS):Ue({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ut=Le(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Ge(e.HTML_INTEGRATION_POINTS):Ue({},[`annotation-xml`]);let t=Le(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Ge(e.CUSTOM_ELEMENT_HANDLING):_e(null);if(Pe=_e(null),Le(t,`tagNameCheck`)&&Xt(t.tagNameCheck)&&(Pe.tagNameCheck=t.tagNameCheck),Le(t,`attributeNameCheck`)&&Xt(t.attributeNameCheck)&&(Pe.attributeNameCheck=t.attributeNameCheck),Le(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ht&&(He=!1),xt&&(bt=!0),Ot&&(ve=Ue({},$e),be=_e(null),Ot.html===!0&&(Ue(ve,Ye),Ue(be,et)),Ot.svg===!0&&(Ue(ve,Xe),Ue(be,tt),Ue(be,rt)),Ot.svgFilters===!0&&(Ue(ve,Ze),Ue(be,tt),Ue(be,rt)),Ot.mathMl===!0&&(Ue(ve,Qe),Ue(be,nt),Ue(be,rt))),Re.tagCheck=null,Re.attributeCheck=null,Le(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Re.tagCheck=e.ADD_TAGS:Ee(e.ADD_TAGS)&&(ve===ye&&(ve=Ge(ve)),Ue(ve,e.ADD_TAGS,qt))),Le(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Re.attributeCheck=e.ADD_ATTR:Ee(e.ADD_ATTR)&&(be===Ne&&(be=Ge(be)),Ue(be,e.ADD_ATTR,qt))),Le(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)&&Ue(Nt,e.ADD_URI_SAFE_ATTR,qt),Le(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)&&(kt===At&&(kt=Ge(kt)),Ue(kt,e.FORBID_CONTENTS,qt)),Le(e,`ADD_FORBID_CONTENTS`)&&Ee(e.ADD_FORBID_CONTENTS)&&(kt===At&&(kt=Ge(kt)),Ue(kt,e.ADD_FORBID_CONTENTS,qt)),Et&&(ve[`#text`]=!0),_t&&Ue(ve,[`html`,`head`,`body`]),ve.table&&(Ue(ve,[`tbody`]),delete Fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Be(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Be(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);x=e.TRUSTED_TYPES_POLICY,S=x.createHTML(``)}else x===void 0&&(x=dt(u,i)),x!==null&&typeof S==`string`&&(S=x.createHTML(``));(ae.uponSanitizeElement.length>0||ae.uponSanitizeAttribute.length>0)&&ve===ye&&(ve=Ge(ve)),ae.uponSanitizeAttribute.length>0&&be===Ne&&(be=Ge(be)),he&&he(e),Jt=e},Qt=Ue({},[...Xe,...Ze,...eee]),$t=Ue({},[...Qe,...tee]),en=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Rt,tagName:`template`});let n=De(e.tagName),r=De(t.tagName);return Bt[e.namespaceURI]?e.namespaceURI===It?t.namespaceURI===Lt?n===`svg`:t.namespaceURI===Ft?n===`svg`&&(r===`annotation-xml`||Ht[r]):!!Qt[n]:e.namespaceURI===Ft?t.namespaceURI===Lt?n===`math`:t.namespaceURI===It?n===`math`&&Ut[r]:!!$t[n]:e.namespaceURI===Lt?t.namespaceURI===It&&!Ut[r]||t.namespaceURI===Ft&&!Ht[r]?!1:!$t[n]&&(Wt[n]||!Qt[n]):!!(Gt===`application/xhtml+xml`&&Bt[e.namespaceURI]):!1},tn=function(e){we(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},nn=function(e,n){try{we(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{we(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(bt||xt)try{tn(n)}catch{}else try{n.setAttribute(e,``)}catch{}},rn=function(e){let t=null,r=null;if(yt)e=`<remove></remove>`+e;else{let t=ke(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&Rt===Lt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?x.createHTML(e):e;if(Rt===Lt)try{t=new l().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=te.createDocument(Rt,`template`,null);try{t.documentElement.innerHTML=zt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Rt===Lt?re.call(t,_t?`html`:`body`)[0]:_t?t.documentElement:a},an=function(e){return ne.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},on=function(e){e.normalize();let t=ne.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;xe([oe,se,ce],t=>{e=Ae(e,t,` `)}),n.data=e,n=t.nextNode()}},sn=function(e){let t=b?b(e):null;return typeof t!=`string`||qt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},cn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===lt.documentFragment}catch{return!1}},ln=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function un(e,n,r){xe(e,e=>{e.call(t,n,r,Jt)})}let dn=function(e){let n=null;if(un(ae.beforeSanitizeElements,e,null),sn(e))return tn(e),!0;let r=qt(e.nodeName);if(un(ae.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),gt&&e.hasChildNodes()&&!ln(e.firstElementChild)&&ze(/<[/\w!]/g,e.innerHTML)&&ze(/<[/\w!]/g,e.textContent)||gt&&e.namespaceURI===Lt&&r===`style`&&ln(e.firstElementChild)||e.nodeType===lt.progressingInstruction||gt&&e.nodeType===lt.comment&&ze(/<[/\w]/g,e.data))return tn(e),!0;if(Fe[r]||!(Re.tagCheck instanceof Function&&Re.tagCheck(r))&&!ve[r]){if(!Fe[r]&&mn(r)&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,r)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r)))return!1;if(Et&&!kt[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return tn(e),!0}return(y?y(e):e.nodeType)===lt.element&&!en(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ze(/<\/no(script|embed|frames)/i,e.innerHTML)?(tn(e),!0):(ht&&e.nodeType===lt.text&&(n=e.textContent,xe([oe,se,ce],e=>{n=Ae(n,e,` `)}),e.textContent!==n&&(we(t.removed,{element:e.cloneNode()}),e.textContent=n)),un(ae.afterSanitizeElements,e,null),!1)},fn=function(e,t,r){if(Ie[t]||Ct&&(t===`id`||t===`name`)&&(r in n||r in Yt))return!1;let i=be[t]||Re.attributeCheck instanceof Function&&Re.attributeCheck(t,e);if(!(He&&!Ie[t]&&ze(le,t))&&!(Ve&&ze(de,t))){if(!i||Ie[t]){if(!(mn(e)&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,e)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(e))&&(Pe.attributeNameCheck instanceof RegExp&&ze(Pe.attributeNameCheck,t)||Pe.attributeNameCheck instanceof Function&&Pe.attributeNameCheck(t,e))||t===`is`&&Pe.allowCustomizedBuiltInElements&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,r)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r))))return!1}else if(!Nt[t]&&!ze(ge,Ae(r,pe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&je(r,`data:`)===0&&jt[e])&&!(We&&!ze(fe,Ae(r,pe,``)))&&r)return!1}return!0},pn=Ue({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),mn=function(e){return!pn[De(e)]&&ze(me,e)},hn=function(e){un(ae.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||sn(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=qt(o),d=c,f=o===`value`?d:Me(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,un(ae.uponSanitizeAttribute,e,r),f=r.attrValue,wt&&(l===`id`||l===`name`)&&je(f,Tt)!==0&&(nn(o,e),f=Tt+f),gt&&ze(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){nn(o,e);continue}if(l===`attributename`&&ke(f,`href`)){nn(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){nn(o,e);continue}if(!mt&&ze(/\/>/i,f)){nn(o,e);continue}ht&&xe([oe,se,ce],e=>{f=Ae(f,e,` `)});let p=qt(e.nodeName);if(!fn(p,l,f)){nn(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=x.createHTML(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),sn(e)?tn(e):Ce(t.removed)}catch{nn(o,e)}}un(ae.afterSanitizeAttributes,e,null)},gn=function(e){let t=null,n=an(e);for(un(ae.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(un(ae.uponSanitizeShadowNode,t,null),dn(t),hn(t),cn(t.content)&&gn(t.content),(y?y(t):t.nodeType)===lt.element){let e=_?_(t):t.shadowRoot;cn(e)&&(_n(e),gn(e))}un(ae.afterSanitizeShadowDOM,e,null)},_n=function(e){let t=y?y(e):e.nodeType;if(t===lt.element){let t=_?_(e):e.shadowRoot;cn(t)&&(_n(t),gn(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];xe(n,e=>{we(r,e)});for(let e of r)_n(e);if(t===lt.element){let t=b?b(e):null;if(typeof t==`string`&&qt(t)===`template`){let t=e.content;cn(t)&&_n(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(zt=!e,zt&&(e=`<!-->`),typeof e!=`string`&&!ln(e)&&(e=Ke(e),typeof e!=`string`))throw Be(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(vt||Zt(n),t.removed=[],typeof e==`string`&&(Dt=!1),Dt){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=qt(t);if(!ve[e]||Fe[e])throw Be(`root node is forbidden and cannot be sanitized in-place`)}if(sn(e))throw Be(`root node is clobbered and cannot be sanitized in-place`);_n(e)}else if(ln(e))i=rn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===lt.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),_n(a);else{if(!bt&&!ht&&!_t&&e.indexOf(`<`)===-1)return x&&St?x.createHTML(e):e;if(i=rn(e),!i)return bt?null:St?S:``}i&&yt&&tn(i.firstChild);let c=an(Dt?e:i);for(;o=c.nextNode();)dn(o),hn(o),cn(o.content)&&gn(o.content);if(Dt)return ht&&on(e),e;if(bt){if(ht&&on(i),xt)for(s=C.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(be.shadowroot||be.shadowrootmode)&&(s=ie.call(r,s,!0)),s}let l=_t?i.outerHTML:i.innerHTML;return _t&&ve[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ze(aee,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3
3
|
`+l),ht&&xe([oe,se,ce],e=>{l=Ae(l,e,` `)}),x&&St?x.createHTML(l):l},t.setConfig=function(){Zt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),vt=!0},t.clearConfig=function(){Jt=null,vt=!1},t.isValidAttribute=function(e,t,n){return Jt||Zt({}),fn(qt(e),qt(t),n)},t.addHook=function(e,t){typeof t==`function`&&we(ae[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Se(ae[e],t);return n===-1?void 0:Te(ae[e],n,1)[0]}return Ce(ae[e])},t.removeHooks=function(e){ae[e]=[]},t.removeAllHooks=function(){ae=ft()},t}var mt=pt(),ht=e(r(),1),gt=i();function _t(e,t,n){let r=e?.trim();if(!r||!r.startsWith(`/`)||r.startsWith(`//`)||r.includes(`://`)||r.includes(`\\`))return t;let i=r.split(/[?#]/,1)[0]||`/`;return n.some(e=>i===e||i.startsWith(`${e}/`))?r:t}function vt(e,t){let n=t?.trim();if(!n)return e;let r=e.indexOf(`#`),i=r>=0?e.slice(0,r):e,a=r>=0?e.slice(r):``;return`${i}${i.includes(`?`)?`&`:`?`}returnTo=${encodeURIComponent(n)}${a}`}var yt=[`/notes/`,`/tasks/`,`/projects/`];function bt(e,t){let n=e.split(/[?#]/,1)[0]??``;if(!yt.some(e=>n.startsWith(e)))return e;let r=e.slice(n.length).split(`#`,1)[0];return new URLSearchParams(r.startsWith(`?`)?r.slice(1):r).has(`returnTo`)?e:vt(e,t)}function xt(){let e=(0,gt.c)(4),t=s(),n=o(),r;return e[0]!==t.pathname||e[1]!==t.search||e[2]!==n?(r=async e=>{let r=S(e);if(r.kind===`internal-route`)return n(bt(r.route,`${t.pathname}${t.search}`)),{ok:!0,kind:r.kind};if(r.kind===`external-http`){let e=await x(r.url);return e.ok?{ok:!0,kind:r.kind}:e}return{ok:!1,error:`Unsupported link`}},e[0]=t.pathname,e[1]=t.search,e[2]=n,e[3]=r):r=e[3],r}function St(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ct=St();function wt(e){Ct=e}var Tt={exec:()=>null};function Et(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Dt(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(kt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ot=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),kt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Et(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Et(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Et(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Et(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Et(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Et(e=>RegExp(`^ {0,${e}}>`))},At=/^(?:[ \t]*(?:\n|$))+/,jt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ft=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,It=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lt=Dt(It).replace(/bull/g,Ft).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Rt=Dt(It).replace(/bull/g,Ft).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Bt=/^[^\n]+/,Vt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ht=Dt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Vt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ut=Dt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ft).getRegex(),Wt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Gt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kt=Dt(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Gt).replace(`tag`,Wt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qt=Dt(zt).replace(`hr`,Nt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wt).getRegex(),Jt={blockquote:Dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,qt).getRegex(),code:jt,def:Ht,fences:Mt,heading:Pt,hr:Nt,html:Kt,lheading:Lt,list:Ut,newline:At,paragraph:qt,table:Tt,text:Bt},Yt=Dt(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Nt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wt).getRegex(),Xt={...Jt,lheading:Rt,table:Yt,paragraph:Dt(zt).replace(`hr`,Nt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Yt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wt).getRegex()},Zt={...Jt,html:Dt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Gt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Tt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dt(zt).replace(`hr`,Nt).replace(`heading`,` *#{1,6} *[^
|
|
4
4
|
]`).replace(`lheading`,Lt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Qt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,en=/^( {2,}|\\)\n(?!\s*$)/,tn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nn=/[\p{P}\p{S}]/u,rn=/[\s\p{P}\p{S}]/u,an=/[^\s\p{P}\p{S}]/u,on=Dt(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,rn).getRegex(),sn=/(?!~)[\p{P}\p{S}]/u,cn=/(?!~)[\s\p{P}\p{S}]/u,ln=/(?:[^\s\p{P}\p{S}]|~)/u,un=Dt(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ot?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),dn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fn=Dt(dn,`u`).replace(/punct/g,nn).getRegex(),pn=Dt(dn,`u`).replace(/punct/g,sn).getRegex(),mn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,hn=Dt(mn,`gu`).replace(/notPunctSpace/g,an).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),gn=Dt(mn,`gu`).replace(/notPunctSpace/g,ln).replace(/punctSpace/g,cn).replace(/punct/g,sn).getRegex(),_n=Dt(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,an).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),see=Dt(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,nn).getRegex(),cee=Dt(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,an).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),lee=Dt(/\\(punct)/,`gu`).replace(/punct/g,nn).getRegex(),uee=Dt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dee=Dt(Gt).replace(`(?:-->|$)`,`-->`).getRegex(),fee=Dt(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,dee).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,pee=Dt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,vn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yn=Dt(/^!?\[(label)\]\[(ref)\]/).replace(`label`,vn).replace(`ref`,Vt).getRegex(),bn=Dt(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Vt).getRegex(),xn=Dt(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,yn).replace(`nolink`,bn).getRegex(),Sn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Cn={_backpedal:Tt,anyPunctuation:lee,autolink:uee,blockSkip:un,br:en,code:$t,del:Tt,delLDelim:Tt,delRDelim:Tt,emStrongLDelim:fn,emStrongRDelimAst:hn,emStrongRDelimUnd:_n,escape:Qt,link:pee,nolink:bn,punctuation:on,reflink:yn,reflinkSearch:xn,tag:fee,text:tn,url:Tt},mee={...Cn,link:Dt(/^!?\[(label)\]\((.*?)\)/).replace(`label`,vn).getRegex(),reflink:Dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,vn).getRegex()},wn={...Cn,emStrongRDelimAst:gn,emStrongLDelim:pn,delLDelim:see,delRDelim:cee,url:Dt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Sn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Dt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Sn).getRegex()},hee={...wn,br:Dt(en).replace(`{2,}`,`*`).getRegex(),text:Dt(wn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Tn={normal:Jt,gfm:Xt,pedantic:Zt},En={normal:Cn,gfm:wn,breaks:hee,pedantic:mee},gee={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Dn=e=>gee[e];function On(e,t){if(t){if(kt.escapeTest.test(e))return e.replace(kt.escapeReplace,Dn)}else if(kt.escapeTestNoEncode.test(e))return e.replace(kt.escapeReplaceNoEncode,Dn);return e}function kn(e){try{e=encodeURI(e).replace(kt.percentDecode,`%`)}catch{return null}return e}function An(e,t){let n=e.replace(kt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(kt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(kt.slashPipe,`|`);return n}function jn(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Mn(e){let t=e.split(`
|
package/dist/gateway/static/root/assets/{media-plugins-B75SWUJd.js → media-plugins-CQtQzLyg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-4BtQKYlM.js";import{oa as i}from"./index-
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-4BtQKYlM.js";import{oa as i}from"./index-PFQHPGgi.js";import{t as a}from"./preview-open-alternatives-Dn57uLhr.js";import{t as o}from"./use-blob-object-url-D4BFuzZB.js";var s=t();e();var c=n();function l(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`audio`}),t[0]=e,t[1]=n),n}function u(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`video`}),t[0]=e,t[1]=n),n}function d(e){let t=(0,s.c)(8),{props:n,kind:r}=e,a;bb0:{if(!n.binaryBuffer){a=null;break bb0}let e;if(t[0]!==r||t[1]!==n.binaryBuffer||t[2]!==n.descriptor.fileName||t[3]!==n.descriptor.mimeType){let a=i(n.descriptor.fileName)??n.descriptor.mimeType;e=new Blob([n.binaryBuffer],{type:a||`${r}/*`}),t[0]=r,t[1]=n.binaryBuffer,t[2]=n.descriptor.fileName,t[3]=n.descriptor.mimeType,t[4]=e}else e=t[4];a=e}let l=o(a);if(!l)return null;let u;return t[5]!==r||t[6]!==l?(u=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-base p-4 dark:bg-surface-hover/20`,children:r===`audio`?(0,c.jsx)(`audio`,{src:l,controls:!0,className:`w-full max-w-2xl`}):(0,c.jsx)(`video`,{src:l,controls:!0,playsInline:!0,className:`max-h-full max-w-full rounded-md bg-black`})}),t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function f(e){let t=(0,s.c)(12),n;t[0]===e.language?n=t[1]:(n=r(e.language),t[0]=e.language,t[1]=n);let i=n,o=e.descriptor.context===`workspace`,l=o?`${i.workspace.cannotPreviewType} ${i.workspace.openElsewhereHint}`:i.chat.attachmentPreviewOpenElsewhereHint,u=o?i.workspace.openSystemApp:void 0,d=o?i.workspace.chooseApp:void 0,f;return t[2]!==i.chat.attachmentPreviewDownloadFull||t[3]!==e.actions.canChooseOpenWithApp||t[4]!==e.actions.canOpenWithSystemApp||t[5]!==e.actions.onChooseOpenWithApp||t[6]!==e.actions.onDownload||t[7]!==e.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,c.jsx)(a,{message:l,downloadLabel:i.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:e.actions.onOpenWithSystemApp,canOpenWithSystemApp:e.actions.canOpenWithSystemApp,chooseAppLabel:d,onChooseOpenWithApp:e.actions.onChooseOpenWithApp,canChooseOpenWithApp:e.actions.canChooseOpenWithApp})}),t[2]=i.chat.attachmentPreviewDownloadFull,t[3]=e.actions.canChooseOpenWithApp,t[4]=e.actions.canOpenWithSystemApp,t[5]=e.actions.onChooseOpenWithApp,t[6]=e.actions.onDownload,t[7]=e.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}export{l as AudioPreviewPluginView,f as UnsupportedPreviewPluginView,u as VideoPreviewPluginView};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l}from"./popover-select-B-GDnZO9.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./copy-Dv6d4Dvw.js";import{t as f}from"./download-Dk-ZjtO6.js";import{t as p}from"./x-B_N4OPjy.js";import{t as m}from"./cn-JdwAhgNB.js";import{a as h,f as g,n as _,r as v}from"./locale-store-DA0Z5jM_.js";import{t as y}from"./messages-4BtQKYlM.js";import{a as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./dist-BGTk37IG.js";import{t as D}from"./copy-to-clipboard-HOJ79TWv.js";import{i as O}from"./vendor-swr-BIWyz7Rc.js";import{t as k}from"./button-CS04eWY9.js";import{i as A}from"./theme-store-CegIlB8d.js";import{t as j}from"./skeleton-BwbyijEw.js";import{$t as M,An as N,Cn as P,Do as F,Ec as I,En as L,Gn as R,In as ee,Jn as te,Kn as ne,Ll as z,Ln as re,Mi as ie,Mn as ae,Mu as B,Nn as oe,Oi as se,On as ce,Pn as V,Qi as le,Ql as ue,Qt as de,Sn as fe,Ti as pe,Tn as H,Uc as U,Un as me,Wn as he,Xn as W,Xu as ge,Yu as _e,a as G,au as ve,bn as ye,bt as be,c as xe,dc as Se,do as Ce,er as we,fl as Te,hc as Ee,iu as De,jc as Oe,ji as K,jn as q,kn as ke,l as J,mu as Ae,nc as je,nr as Me,o as Ne,qn as Pe,rc as Fe,rr as Ie,ru as Le,s as Re,sl as ze,tc as Be,tr as Ve,wi as Y,wn as He,xc as Ue,xl as X,xn as We,yn as Ge,zc as Ke,zn as qe}from"./index-DxYitLp8.js";var Je=n(),Z=e(t(),1),Q=r(),Ye=(0,Z.createContext)(null);function Xe(){let e=(0,Je.c)(1),t=(0,Z.useContext)(Ye);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:Ze},e[0]=t):t=e[0],t}return t}function Ze(){}function Qe(e){let t=(0,Je.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,o]=(0,Z.useState)(null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(e,t)=>{o({src:e,alt:t})},t[0]=s):s=t[0];let c=s,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={openImage:c},t[1]=l):l=t[1];let u=l,d=a!==null,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e||o(null)},t[2]=f):f=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(b,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=m(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=g):g=t[4];let _=a?.alt||`Image preview`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(T,{className:`sr-only`,children:_}),t[5]=_,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(p,{className:`size-5`,"aria-hidden":!0}),t[7]=y):y=t[7];let x;t[8]===i?x=t[9]:(x=(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:y})}),t[8]=i,t[9]=x);let D;t[10]===a?D=t[11]:(D=a?(0,Q.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=D);let O;t[12]!==x||t[13]!==D||t[14]!==v?(O=(0,Q.jsxs)(C,{children:[h,(0,Q.jsxs)(w,{className:g,"aria-describedby":void 0,children:[v,x,D]})]}),t[12]=x,t[13]=D,t[14]=v,t[15]=O):O=t[15];let k;t[16]!==O||t[17]!==d?(k=(0,Q.jsx)(E,{open:d,onOpenChange:f,children:O}),t[16]=O,t[17]=d,t[18]=k):k=t[18];let A;return t[19]!==n||t[20]!==k?(A=(0,Q.jsxs)(Ye.Provider,{value:u,children:[n,k]}),t[19]=n,t[20]=k,t[21]=A):A=t[21],A}var $e=6e4,et=36e5,$=864e5;function tt(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function nt(e,t,n){let r=t-e;if(r<$e)return n.justNow;if(r<et){let e=Math.floor(r/$e);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=tt(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(e>=i-$)return n.yesterday+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(r<7*$){let e=Math.floor(r/$);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(n.locale,{month:`short`,day:`numeric`})}function rt(e,t,n){let r=tt(t);if(e>=r)return n.today;if(e>=r-$)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(n.locale,{month:`long`,day:`numeric`}):i.toLocaleDateString(n.locale,{year:`numeric`,month:`long`,day:`numeric`})}function it(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function at(e){let t=(0,Je.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,l=c===void 0?`card`:c,d=_(ct),f=y(d).automations.suggestions,p=y(d).automations,h=a(),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=g):g=t[0];let{data:v}=O(o?`automation-suggestion-coverage`:null,st,g),b=o?v?.automations.find(e=>xe(e,o)):void 0,x=b?Ne(b,p):[];if(l===`titleAction`){if(b){let e;t[1]===s?e=t[2]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,s),t[1]=s,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===h?r=t[5]:(r=()=>h(`/automations`),t[4]=h,t[5]=r),(0,Q.jsxs)(`section`,{className:e,children:[n,(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:f.coveredTitle}),(0,Q.jsx)(k,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:f.manage})]})}let e;t[6]===s?e=t[7]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,s),t[6]=s,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(X,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let o;t[9]!==r||t[10]!==n?(o=(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=o):o=t[11];let c;t[12]!==h||t[13]!==i?(c=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=h,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,Q.jsxs)(`section`,{className:e,children:[a,o,(0,Q.jsxs)(k,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,f.setup]})]})}if(b){let e;t[16]===s?e=t[17]:(e=m(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,s),t[16]=s,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===h?r=t[20]:(r=()=>h(`/automations`),t[19]=h,t[20]=r);let i;return t[21]!==f||t[22]!==r?(i=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(k,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:f.manage})}),t[21]=f,t[22]=r,t[23]=i):i=t[23],(0,Q.jsxs)(`section`,{className:e,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:f.coveredTitle}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:Re(f.coveredDescription,{name:b.name})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:p.explain.whyCovered}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(ot)})]}),i]})}let S;t[24]===s?S=t[25]:(S=m(`rounded-lg bg-surface-panel p-3 shadow-surface`,s),t[24]=s,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(X,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==h||t[35]!==i?(D=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=h,t[35]=i,t[36]=D):D=t[36];let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),t[37]=A):A=t[37];let j;t[38]!==f.create||t[39]!==D?(j=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(k,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[A,f.create]})}),t[38]=f.create,t[39]=D,t[40]=j):j=t[40];let M;return t[41]!==j||t[42]!==S||t[43]!==E?(M=(0,Q.jsxs)(`section`,{className:S,children:[E,j]}),t[41]=j,t[42]=S,t[43]=E,t[44]=M):M=t[44],M}function ot(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function st(){return J.list()}function ct(e){return e.language}function lt(e){let t=(0,Je.c)(51),{initial:n,zh:r,busy:i,onClose:a,onSave:o}=e,[s,c]=(0,Z.useState)(n),l;t[0]!==i||t[1]!==a?(l=e=>{!e&&!i&&a()},t[0]=i,t[1]=a,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[3]=u):u=t[3];let d=r?`编辑纪要内容`:`Edit meeting content`,f;t[4]===d?f=t[5]:(f=(0,Q.jsx)(`header`,{className:`border-b border-edge p-4`,children:(0,Q.jsx)(T,{children:d})}),t[4]=d,t[5]=f);let p=r?`人工修改会保留,重新整理不会覆盖。已创建任务保持不变。`:`Your changes survive regeneration. Existing tasks remain unchanged.`,m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[6]=p,t[7]=m);let h=r?`内容`:`Content`,g;t[8]===s?g=t[9]:(g=e=>c({...s,text:e.target.value}),t[8]=s,t[9]=g);let _;t[10]!==s.text||t[11]!==g?(_=(0,Q.jsx)(`textarea`,{className:`mt-1 min-h-32 w-full rounded border border-edge bg-transparent p-2`,value:s.text,onChange:g}),t[10]=s.text,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==_?(v=(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==s||t[17]!==r?(y=s.kind===`actionItems`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`负责人原话`:`Owner as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.owner??``,onChange:e=>c({...s,owner:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`期限原话`:`Date as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.dueDate??``,onChange:e=>c({...s,dueDate:e.target.value})})]})]}):null,t[16]=s,t[17]=r,t[18]=y):y=t[18];let x;t[19]!==s||t[20]!==r?(x=s.kind===`summary`?null:(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!s.ignored,onChange:e=>c({...s,ignored:e.target.checked})}),r?`忽略此项`:`Ignore this item`]}),t[19]=s,t[20]=r,t[21]=x):x=t[21];let S;t[22]!==v||t[23]!==y||t[24]!==x||t[25]!==m?(S=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[m,v,y,x]}),t[22]=v,t[23]=y,t[24]=x,t[25]=m,t[26]=S):S=t[26];let D=r?`取消`:`Cancel`,O;t[27]!==i||t[28]!==a||t[29]!==D?(O=(0,Q.jsx)(k,{disabled:i,onClick:a,children:D}),t[27]=i,t[28]=a,t[29]=D,t[30]=O):O=t[30];let A;t[31]!==i||t[32]!==s.text?(A=i||!s.text.trim(),t[31]=i,t[32]=s.text,t[33]=A):A=t[33];let j;t[34]!==s||t[35]!==o?(j=()=>void o(s),t[34]=s,t[35]=o,t[36]=j):j=t[36];let M=r?`保存修改`:`Save changes`,N;t[37]!==A||t[38]!==j||t[39]!==M?(N=(0,Q.jsx)(k,{variant:`primary`,disabled:A,onClick:j,children:M}),t[37]=A,t[38]=j,t[39]=M,t[40]=N):N=t[40];let P;t[41]!==O||t[42]!==N?(P=(0,Q.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge p-3`,children:[O,N]}),t[41]=O,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==S||t[45]!==P||t[46]!==f?(F=(0,Q.jsxs)(C,{children:[u,(0,Q.jsxs)(w,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(32rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[f,S,P]})]}),t[44]=S,t[45]=P,t[46]=f,t[47]=F):F=t[47];let I;return t[48]!==l||t[49]!==F?(I=(0,Q.jsx)(E,{open:!0,onOpenChange:l,children:F}),t[48]=l,t[49]=F,t[50]=I):I=t[50],I}var ut=e=>`${String(Math.floor(e/6e4)).padStart(2,`0`)}:${String(Math.floor(e/1e3)%60).padStart(2,`0`)}`;function dt({noteId:e}){let t=_(e=>e.language)===`zh`,{data:n,mutate:r,isLoading:i}=O([`note-discussion-document`,e],()=>de(e),{refreshInterval:e=>e&&([`recording`,`stopping`,`sealing`,`organizing`].includes(e.discussion.status)||e.recordingJob?.state===`queued`||e.recordingJob?.state===`running`)?3e3:0}),a=n?.discussion.id,u=`/api/discussions/${encodeURIComponent(a??``)}`,{data:d=[],mutate:m}=O(a?`${u}/actions`:null,e=>h(v(e)),{refreshInterval:1e4}),[g,y]=(0,Z.useState)(`summary`),[x,S]=(0,Z.useState)(``),[D,A]=(0,Z.useState)(`general`),[N,P]=(0,Z.useState)(null),[F,L]=(0,Z.useState)(null),[R,ee]=(0,Z.useState)(null),[te,ne]=(0,Z.useState)(!1),[z,re]=(0,Z.useState)([]),[ie,ae]=(0,Z.useState)(null),[B,oe]=(0,Z.useState)(!1),[se,ce]=(0,Z.useState)(1),V=(0,Z.useRef)(null),le=(0,Z.useRef)(null),[fe,pe]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{let e=()=>{r(),m()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-segment-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-segment-updated`,e)}},[r,m]),(0,Z.useEffect)(()=>{n?.discussion.template&&A(n.discussion.template)},[n?.discussion.template]);async function H(e){if(!B){oe(!0),ae(null);try{await e(),await r(),await m()}catch(e){ae(e instanceof Error?e.message:String(e))}finally{oe(!1)}}}function U(e){V.current&&(V.current.readyState===0?(le.current=e/1e3,V.current.load()):V.current.currentTime=e/1e3,V.current.play().catch(()=>void 0))}async function me(e,t){n?.organization&&await H(async()=>{P((await h(v(`${u}/transcript?revision=${t??n.organization.transcriptRevision}`))).segments.filter(t=>e.includes(t.sequence)))})}let he=(e,n,r)=>n.some(e=>te||!e.ignored)?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold text-fg`,children:e}),n.filter(e=>te||!e.ignored).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,Q.jsxs)(`p`,{className:`flex-1 whitespace-pre-wrap`,children:[e.text,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更`:`Later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B,onClick:()=>ee({kind:r,itemId:e.id,text:e.text,ignored:e.ignored}),children:t?`编辑`:`Edit`}),e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`shrink-0 text-accent-fg`,onClick:()=>void me(e.evidenceSegmentIds,e.evidenceRevision),children:t?`原话`:`Source`}):(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t?`暂无定位`:`No source timing`})]},e.id))]}):null;if(i)return(0,Q.jsx)(j,{className:`h-48 w-full`});if(!n)return null;let{discussion:W,transcript:ge,organization:_e}=n,G=_e?.organization,ve=[`stopping`,`sealing`,`organizing`].includes(W.status),ye=[`recording`,`completed`,`needs_attention`].includes(W.status),be=ge.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(x.toLocaleLowerCase())||e.speakerLabel?.toLocaleLowerCase().includes(x.toLocaleLowerCase()));return(0,Q.jsxs)(`section`,{className:`relative flex h-full min-h-0 w-full flex-col text-fg`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-edge-subtle p-4`,children:[(0,Q.jsx)(ue,{className:`size-4 text-accent`}),(0,Q.jsxs)(`span`,{className:`text-sm font-medium`,children:[ut(W.durationMs??0),` · `,ve?t?`正在整理`:`Processing`:W.status===`completed`?t?`整理完成`:`Ready`:W.status]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsxs)(c,{value:D,"aria-label":t?`纪要模板`:`Summary template`,onChange:e=>A(e.target.value),children:[(0,Q.jsx)(l,{value:`general`,children:t?`通用会议`:`General`}),(0,Q.jsx)(l,{value:`project`,children:t?`项目例会`:`Project`}),(0,Q.jsx)(l,{value:`review`,children:t?`需求评审`:`Review`}),(0,Q.jsx)(l,{value:`interview`,children:t?`客户访谈`:`Interview`})]}),(0,Q.jsxs)(k,{disabled:B||ve||!W.canonicalTranscript,onClick:()=>void H(()=>h(v(`${u}/organize`),{method:`POST`,body:JSON.stringify({template:D})})),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),t?`重新整理`:`Regenerate`]})]})]}),(0,Q.jsxs)(`nav`,{"aria-label":t?`会议内容`:`Meeting content`,className:`flex shrink-0 items-center gap-4 border-b border-edge-subtle px-4 py-2 text-sm`,children:[[`summary`,`transcript`].map(e=>(0,Q.jsx)(`button`,{className:g===e?`font-medium text-accent-fg`:`text-fg-muted`,onClick:()=>y(e),children:e===`summary`?t?`纪要与行动`:`Summary & actions`:t?`逐字稿`:`Transcript`},e)),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(f,{className:`size-3`}),[`md`,`txt`,`srt`].map(e=>(0,Q.jsx)(`a`,{className:`text-accent-fg`,href:v(`${u}/export?format=${e}`),download:!0,children:e.toUpperCase()},e))]})]}),ie?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-2 text-sm text-danger`,children:ie}):null,n.recordingJob?.state===`queued`||n.recordingJob?.state===`running`?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-sm text-fg-muted`,children:t?`录音已上传,正在后台校验与保存。关闭此页面不会中断处理。`:`Recording uploaded. Verification and saving continue in the background, even if you close this page.`}):null,W.status===`needs_attention`?(0,Q.jsxs)(`div`,{className:`flex gap-2 p-4 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:W.failureMessage}),(0,Q.jsx)(`button`,{disabled:B,onClick:()=>void H(()=>M(W.id)),children:t?`重试`:`Retry`})]}):null,_e&&_e.transcriptRevision!==ge.revision?(0,Q.jsx)(`p`,{className:`px-4 py-2 text-xs text-fg-muted`,children:t?`转写已修改,当前纪要引用的是修改前版本。重新整理可生成新版纪要。`:`Transcript changed. This summary cites the previous revision; regenerate to update.`}):null,(0,Q.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:g===`summary`?G?(0,Q.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:G.summaryEditedByUser?t?`概要已人工编辑`:`Overview edited`:``}),(0,Q.jsx)(`button`,{disabled:B||ve,onClick:()=>ee({kind:`summary`,itemId:`summary`,text:G.summary}),children:t?`编辑概要`:`Edit overview`})]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:G.summary}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:te,onChange:e=>ne(e.target.checked)}),t?`显示已忽略项`:`Show ignored items`]}),z.length?(0,Q.jsx)(k,{disabled:B,onClick:()=>void H(async()=>{for(let e of z)await h(v(`${u}/actions/${encodeURIComponent(e)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:_e.revision})});re([])}),children:t?`加入所选 ${z.length} 项任务`:`Add ${z.length} selected tasks`}):null,he(t?`已决定事项`:`Decisions`,G.decisions,`decisions`),G.actionItems.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`下一步行动`:`Next actions`}),G.actionItems.filter(e=>te||!e.ignored).map(e=>{let n=d.find(t=>t.actionId===e.id);return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[!n&&!e.ignored&&(!(e.supersededBy||e.disputedBy)||e.reviewedChangeId===(e.supersededBy??e.disputedBy))?(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`${t?`选择行动`:`Select action`}: ${e.title}`,className:`ui-checkbox`,checked:z.includes(e.id),onChange:t=>re(t.target.checked?[...z,e.id]:z.filter(t=>t!==e.id))}):null,(0,Q.jsxs)(`p`,{className:`flex-1 text-sm font-medium`,children:[e.title,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更,请复核`:`Review later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B||ve,onClick:()=>ee({kind:`actionItems`,itemId:e.id,text:e.title,owner:e.owner,dueDate:e.dueDate,ignored:e.ignored}),children:t?`编辑`:`Edit`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.owner??(t?`负责人未明确`:`Owner unspecified`),` · `,e.dueDate??(t?`期限未明确`:`Date unspecified`)]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs`,children:[e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`text-accent-fg`,onClick:()=>void me(e.evidenceSegmentIds,e.evidenceRevision),children:t?`查看原话`:`Source`}):null,n?n.deleted?(0,Q.jsx)(`span`,{children:t?`关联任务已删除`:`Linked task deleted`}):(0,Q.jsx)(o,{className:`text-accent-fg`,to:`/tasks/${encodeURIComponent(n.taskId)}`,children:n.resolution===`done`?t?`已完成 · 查看任务`:`Done · View task`:t?`查看任务 / 交给助手`:`View task / Delegate`}):e.ignored?null:(0,Q.jsx)(k,{disabled:B||!!(e.supersededBy||e.disputedBy)&&e.reviewedChangeId!==(e.supersededBy??e.disputedBy),onClick:()=>void H(()=>h(v(`${u}/actions/${encodeURIComponent(e.id)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:_e.revision})})),children:t?`加入我的任务`:`Add to my tasks`})]})]},e.id)})]}):null,he(t?`风险`:`Risks`,G.risks,`risks`),he(t?`尚未确定`:`Open questions`,G.openQuestions,`openQuestions`),G.changes?.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`前后变更`:`Changes during the meeting`}),G.changes.map(e=>{let n=[...G.decisions,...G.actionItems,...G.risks,...G.openQuestions],r=n.find(t=>t.id===e.fromId),i=n.find(t=>t.id===e.toId);return!r||!i?null:(0,Q.jsxs)(`article`,{className:`space-y-2 rounded border border-edge p-3 text-sm`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.relation===`supersedes`?t?`后续撤销或替代`:`Later superseded`:t?`存在冲突,尚未明确解决`:`Unresolved conflict`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void me(r.evidenceSegmentIds,r.evidenceRevision),children:`title`in r?r.title:r.text}),(0,Q.jsx)(`span`,{children:`↓`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void me(i.evidenceSegmentIds,i.evidenceRevision),children:`title`in i?i.title:i.text})]},`${e.fromId}:${e.toId}`)})]}):null,G.chapters.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`章节回顾`:`Chapters`}),G.chapters.map((e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`button`,{className:`text-sm text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[ut(e.startedAtMs),` · `,e.title]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary})]},t))]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:ve?t?`录音已保存,纪要正在生成。可以先查看逐字稿。`:`Recording saved. Summary is processing; you can read the transcript.`:t?`录音结束后自动生成纪要。`:`Summary appears after recording ends.`}),ve?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{className:`h-6 w-3/4`}),(0,Q.jsx)(j,{className:`h-24 w-full`})]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-edge px-3`,children:[(0,Q.jsx)(I,{className:`size-4 text-fg-muted`}),(0,Q.jsx)(`input`,{className:`w-full bg-transparent py-2 text-sm outline-none`,placeholder:t?`查找原话或说话人`:`Search words or speaker`,value:x,onChange:e=>{S(e.target.value),ce(1)}})]}),be.slice(0,se*50).map(e=>(0,Q.jsxs)(`article`,{className:`rounded-md border p-3 ${fe>=e.startedAtMs&&fe<e.endedAtMs?`border-accent`:`border-edge-subtle`}`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[(0,Q.jsx)(Ke,{className:`size-3`}),ut(e.startedAtMs)]}),(0,Q.jsx)(`span`,{children:e.speakerLabel??(t?`未区分说话人`:`Speaker unknown`)}),ye&&e.status===`confirmed`?(0,Q.jsx)(`button`,{className:`ml-auto`,onClick:()=>L({segment:e,text:e.displayText??e.rawText??``,speaker:e.speakerLabel??``}),children:t?`校对`:`Edit`}):null]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6`,children:e.displayText??e.rawText??(t?`等待转写`:`Awaiting transcription`)})]},e.sequence)),be.length>se*50?(0,Q.jsx)(k,{onClick:()=>ce(se+1),children:t?`加载更多`:`More`}):null]})}),W.audioAttachmentId&&!W.audioDeletedAt?(0,Q.jsxs)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:[(0,Q.jsx)(`audio`,{ref:V,controls:!0,preload:`metadata`,className:`h-10 w-full`,src:v(`${u}/audio`),onTimeUpdate:()=>pe((V.current?.currentTime??0)*1e3),onLoadedMetadata:()=>{le.current!==null&&V.current&&(V.current.currentTime=le.current,le.current=null)},onError:()=>ae(t?`录音暂不可播放`:`Recording unavailable`)}),(0,Q.jsx)(`a`,{className:`mt-1 block text-right text-xs text-accent-fg`,href:v(`${u}/audio`),download:!0,children:t?`下载录音`:`Download recording`})]}):null,N?(0,Q.jsxs)(`aside`,{"aria-label":t?`原话证据`:`Source evidence`,className:`absolute inset-y-0 right-0 z-10 flex w-[min(26rem,100%)] flex-col border-l border-edge bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(`h3`,{children:t?`原话证据`:`Source evidence`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭`:`Close`,onClick:()=>P(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:N.length?N.map(e=>(0,Q.jsxs)(`article`,{children:[(0,Q.jsxs)(`button`,{className:`mb-2 text-xs text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[ut(e.startedAtMs),` · `,e.speakerLabel??(t?`说话人未明确`:`Unknown speaker`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:e.displayText??e.rawText})]},e.sequence)):(0,Q.jsx)(`p`,{children:t?`此版本暂无可定位原话。`:`No timed source available for this revision.`})})]}):null,R&&_e?(0,Q.jsx)(lt,{initial:R,zh:t,busy:B,onClose:()=>ee(null),onSave:e=>H(async()=>{await h(v(`${u}/summary`),{method:`PATCH`,body:JSON.stringify({...e,expectedRevision:_e.revision})}),ee(null)})},`${R.kind}:${R.itemId}:${_e.revision}`):null,F?(0,Q.jsx)(E,{open:!0,onOpenChange:e=>{e||L(null)},children:(0,Q.jsxs)(C,{children:[(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(w,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(28rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(T,{children:t?`校对逐字稿`:`Edit transcript`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭校对`:`Close editor`,onClick:()=>L(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[(0,Q.jsxs)(`label`,{className:`block text-xs`,children:[t?`本段说话人`:`Speaker for this segment`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:F.speaker,onChange:e=>L({...F,speaker:e.target.value})})]}),F.segment.speakerLabel?(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!F.applyToSpeakerGroup,onChange:e=>L({...F,applyToSpeakerGroup:e.target.checked})}),t?`同时更名所有同标签片段;输入已有标签可合并说话人`:`Rename all segments with this label; use an existing label to merge speakers`]}):null,(0,Q.jsx)(`textarea`,{className:`min-h-32 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:F.text,onChange:e=>L({...F,text:e.target.value})})]}),(0,Q.jsx)(`footer`,{className:`border-t border-edge p-3`,children:(0,Q.jsxs)(k,{variant:`primary`,disabled:B||!F.text.trim(),onClick:()=>void H(async()=>{await h(v(`${u}/segments/${F.segment.sequence}`),{method:`PATCH`,body:JSON.stringify({displayText:F.text,speakerLabel:F.speaker,expectedRevision:F.segment.revision,applyToSpeakerGroup:F.applyToSpeakerGroup,expectedTranscriptRevision:ge.revision})}),L(null)}),children:[(0,Q.jsx)(s,{className:`size-4`}),t?`保存修订`:`Save revision`]})})]})]})}):null]})}var ft={edit:U,ai_edit:Ee,sync:Oe,restore:ge};function pt(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function mt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=_(e=>e.language),o=y(a).notes,s={justNow:o.justNow,minutesAgo:o.minutesAgo,today:o.today,yesterday:o.yesterday,daysAgo:o.daysAgo,locale:g(a)},{data:c}=O(e?[`note-history`,e]:null,()=>V(e)),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[h,v]=(0,Z.useState)(null),b=(0,Z.useCallback)(async t=>{u(!0),v(null);try{await Pe(e,t),f(null),i()}catch{v(o.restoreFailed)}finally{u(!1)}},[e,o.restoreSuccess,o.restoreFailed,i]),x=Date.now();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0}),o.history]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[h?(0,Q.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:h}):null,c?.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>{let r=ft[e.trigger]??U,i=t===e.timestamp,a=d===e.timestamp;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:m(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:pt(e.trigger,o)}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:nt(e.timestamp,x,s)})]}),e.snippet&&(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,Q.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:o.restoreConfirm}),(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),b(e.timestamp)},disabled:l,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:l?`...`:o.restore}),(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:o.restore})})]},e.timestamp)})}):(0,Q.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:o.historyEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:o.historyEmptyDescription})]})]})]})}function ht({noteId:e,note:t,catalyzing:n,onCatalyze:r,onClose:i,noteThreads:o,openingChat:s,onOpenChat:c,onOpenNewChat:l}){let u=y(_(e=>e.language)).notes,d=a(),f=t?.aiDeep?.catalysis,p=f?.report??null,[h,g]=(0,Z.useState)(null),[v,b]=(0,Z.useState)(!1),{data:x,mutate:S,isLoading:C}=O(e?[`note-agent-context-status`,e]:null,()=>q(e),{revalidateOnFocus:!1}),w=(0,Z.useCallback)(async()=>{if(!v){b(!0),g(null);try{await S(()=>me(e),{revalidate:!1})}catch(e){g(`${u.contextRebuildFailed}: ${e instanceof Error?e.message:u.quickCaptureFailedHint}`)}finally{b(!1)}}},[v,S,u.contextRebuildFailed,u.quickCaptureFailedHint,e]),T=(0,Z.useCallback)(async t=>{try{await he(e,t)}catch{}},[e]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ee,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:u.catalysisSectionTitle})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:i,"aria-label":u.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(_e,{className:`size-4 rotate-180`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:u.catalysisSectionDescription}),x?(0,Q.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.contextStatusTitle}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void w(),disabled:C||v,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:v?u.processing:u.contextRebuild}),(0,Q.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5 text-[11px] font-medium`,x.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:x.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:x.status})]}),(0,Q.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:u.contextStatusDetail.replace(`{{attachments}}`,String(x.attachments.length)).replace(`{{tokens}}`,String(x.tokenEstimate??0))}),h?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:h}):null,x.attachments.length>0?(0,Q.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:x.attachments.slice(0,5).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId))}):null]}):null,(0,Q.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?u.processing:p?u.recatalyze:u.catalyzeAction}),p?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.valueHypothesis}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:p.valueHypothesis})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.targetUsers}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.targetUsers.slice(0,5).map(e=>(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.keyQuestions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.keyQuestions.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.mvpPathLabel}),(0,Q.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.mvpPath.slice(0,3).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.risks}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.risks.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.nextActions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.nextActions.slice(0,4).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,Q.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:u.confidenceLabel.replace(`{{percent}}`,String(Math.round(p.confidence*100)))}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackHelpfulAria,children:(0,Q.jsx)(je,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`not_helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackNotHelpfulAria,children:(0,Q.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,Q.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:u.noCatalysisReportHint}),(0,Q.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(ze,{className:`size-4 text-accent`,"aria-hidden":!0}),u.relatedThreadsTitle]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.relatedThreadsDescription})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,disabled:s,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:s?u.openingChat:u.openThread}),(0,Q.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:u.newThread})]})]}),o.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:o.slice(0,5).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>d(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||u.noteDiscussionFallback}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:u.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:u.noThreads})]})]})]})}var gt=[{value:`86400000`,zh:`24 小时`,en:`24 hours`},{value:`604800000`,zh:`7 天`,en:`7 days`},{value:`2592000000`,zh:`30 天`,en:`30 days`}];function _t({open:e,onOpenChange:t,note:n}){let r=_(e=>e.language)===`zh`,i=r?xt:St,{data:a,mutate:o}=O(e?[`note-shares`,n.id]:null,()=>ee(n.id)),u=O(e?`hosted-share-auth-status`:null,se),f=u.data===!0,m=O(e&&f?`hosted-publication-capabilities`:null,pe),h=m.data?.publishing.allowed===!0,g=O(e&&f?[`hosted-note-publications`,n.id]:null,()=>oe(n.id)),[v,y]=(0,Z.useState)(new Set),[A,j]=(0,Z.useState)(`86400000`),[M,N]=(0,Z.useState)(``),[P,F]=(0,Z.useState)(``),[I,te]=(0,Z.useState)(`hosted`),[z,re]=(0,Z.useState)(!1),[ae,B]=(0,Z.useState)(null),[V,le]=(0,Z.useState)(null),[ue,de]=(0,Z.useState)(!1),[fe,H]=(0,Z.useState)(null),U=(0,Z.useMemo)(()=>{let e=new Set;return n.markdown.replace(/xopc-attachment:\/\/notes\/([^/]+)\/([^\s)]+)/gi,(t,r,i)=>{try{decodeURIComponent(r)===n.id&&e.add(decodeURIComponent(i))}catch{}return t}),(n.attachments??[]).filter(t=>e.has(t.id))},[n.attachments,n.id,n.markdown]);(0,Z.useEffect)(()=>{e&&(y(new Set(U.map(e=>e.id))),le(null),de(!1),H(null))},[e,U]);let me=async()=>{re(!0),H(null);try{let e={expectedNoteVersion:n.updatedAt,attachmentIds:[...v],ttlMs:Number(A),maxViews:M.trim()?Number(M):null,description:P.trim()||void 0};I===`hosted`?(le((await L(n.id,e)).shareUrl),await g.mutate()):(le((await ce(n.id,e)).payload.shareUrl),await o())}catch(e){H(e instanceof Error?e.message:String(e))}finally{re(!1)}},he=async(e,t)=>{B(e.id),H(null);try{t===`refresh`?await R(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):await K(e.id),await g.mutate()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}},W=async(e,t)=>{B(e.id),H(null);try{t===`refresh`?await ne(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):t===`extend`?await Y(e.id,864e5):await ie(e.id),await o()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}},ge=async e=>{H(null);try{if(!await D(e)){de(!1),H(i.copyFailed);return}de(!0),window.setTimeout(()=>de(!1),1500)}catch{de(!1),H(i.copyFailed)}};return(0,Q.jsx)(E,{open:e,onOpenChange:t,children:(0,Q.jsxs)(C,{children:[(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(w,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(T,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,Q.jsx)(Ue,{className:`size-4`}),i.title]}),(0,Q.jsx)(x,{className:`mt-1 text-xs text-fg-muted`,children:i.description})]}),(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-fg-muted hover:bg-surface-hover`,"aria-label":i.close,children:(0,Q.jsx)(p,{className:`size-4`})})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Q.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-inset p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.title||i.untitled}),(0,Q.jsx)(`p`,{className:`mt-2 line-clamp-4 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.markdown||i.empty}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:i.privateExcluded})]}),U.length>0?(0,Q.jsxs)(`section`,{className:`mt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.attachments}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:U.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:v.has(e.id),onChange:()=>y(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:`accent-accent`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:bt(e.size)})]},e.id))})]}):null,(0,Q.jsxs)(`section`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.delivery,(0,Q.jsxs)(c,{value:I,onChange:e=>te(e.target.value),children:[(0,Q.jsx)(l,{value:`hosted`,children:i.deliveryHosted}),(0,Q.jsx)(l,{value:`local`,children:i.deliveryLocal})]})]}),I===`hosted`&&u.data===!1?(0,Q.jsx)(`div`,{className:`sm:col-span-2`,children:(0,Q.jsx)(be,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:()=>void u.mutate(!0,{revalidate:!1})})}):null,I===`hosted`&&f&&m.data&&!h?(0,Q.jsx)(`p`,{className:`rounded-lg border border-warning/30 bg-warning-soft px-3 py-2 text-xs text-warning sm:col-span-2`,children:i.hostedDisabled}):null,(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.expires,(0,Q.jsx)(c,{value:A,onChange:e=>j(e.target.value),children:gt.map(e=>(0,Q.jsx)(l,{value:e.value,children:r?e.zh:e.en},e.value))})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.maxViews,(0,Q.jsx)(`input`,{type:`number`,min:1,max:1e3,value:M,onChange:e=>N(e.target.value),placeholder:i.unlimited,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.publicDescription,(0,Q.jsx)(`input`,{value:P,onChange:e=>F(e.target.value),className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]})]}),V?(0,Q.jsx)(`div`,{className:`mt-5 rounded-lg border border-success/25 bg-success-soft p-3`,children:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(`input`,{readOnly:!0,value:V,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none`}),(0,Q.jsxs)(k,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void ge(V),children:[ue?(0,Q.jsx)(s,{className:`size-4`}):(0,Q.jsx)(d,{className:`size-4`}),ue?i.copied:i.copy]}),(0,Q.jsxs)(k,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>window.open(V,`_blank`,`noopener,noreferrer`),children:[(0,Q.jsx)(De,{className:`size-4`}),i.open]})]})}):null,fe?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,children:fe}):null,(a?.items.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.activeLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:a.items.map(e=>(0,Q.jsx)(yt,{share:e,busy:ae===e.id,t:i,onCopy:ge,onAction:W},e.id))})]}):null,(g.data?.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.hostedLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:g.data.map(e=>(0,Q.jsx)(vt,{publication:e,stale:e.source?.version!==String(n.updatedAt),busy:ae===e.id,publishingAllowed:h,t:i,onCopy:ge,onAction:he},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(k,{type:`button`,variant:`ghost`,children:i.close})}),(0,Q.jsxs)(k,{type:`button`,onClick:()=>void me(),disabled:z||I===`hosted`&&(!f||!h),children:[z?(0,Q.jsx)(Te,{className:`size-4 animate-spin`}):(0,Q.jsx)(Ue,{className:`size-4`}),z?i.creating:i.create]})]})]})]})})}function vt(e){let t=(0,Je.c)(64),{publication:n,stale:r,busy:i,publishingAllowed:a,t:o,onCopy:s,onAction:c}=e,l=n.revoked||n.expired,u=l&&`opacity-60`,f;t[0]===u?f=t[1]:(f=m(`rounded-lg border border-edge-subtle p-3`,u),t[0]=u,t[1]=f);let p=r&&!l?o.stale:l?o.inactive:o.active,h;t[2]===p?h=t[3]:(h=(0,Q.jsx)(`span`,{children:p}),t[2]=p,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{children:`·`}),t[4]=g):g=t[4];let _=n.maxViews===null?``:` / ${n.maxViews}`,v;t[5]!==n.viewCount||t[6]!==o.views||t[7]!==_?(v=(0,Q.jsxs)(`span`,{children:[o.views,` `,n.viewCount,_]}),t[5]=n.viewCount,t[6]=o.views,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`·`}),t[9]=y):y=t[9];let b;t[10]!==n.revision||t[11]!==o.revision?(b=(0,Q.jsxs)(`span`,{children:[o.revision,` `,n.revision]}),t[10]=n.revision,t[11]=o.revision,t[12]=b):b=t[12];let x;t[13]!==h||t[14]!==v||t[15]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[h,g,v,y,b]}),t[13]=h,t[14]=v,t[15]=b,t[16]=x):x=t[16];let S;t[17]===n.shareUrl?S=t[18]:(S=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[17]=n.shareUrl,t[18]=S);let C;t[19]!==x||t[20]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]===i?w=t[23]:(w=i?(0,Q.jsx)(Te,{className:`size-4 animate-spin text-fg-muted`}):null,t[22]=i,t[23]=w);let T;t[24]!==C||t[25]!==w?(T=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[C,w]}),t[24]=C,t[25]=w,t[26]=T):T=t[26];let E=!a,D;t[27]!==s||t[28]!==n.shareUrl?(D=()=>void s(n.shareUrl),t[27]=s,t[28]=n.shareUrl,t[29]=D):D=t[29];let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(d,{className:`size-3.5`}),t[30]=O):O=t[30];let A;t[31]!==o.copy||t[32]!==E||t[33]!==D?(A=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:E,onClick:D,children:[O,o.copy]}),t[31]=o.copy,t[32]=E,t[33]=D,t[34]=A):A=t[34];let j=!a,M;t[35]===n.shareUrl?M=t[36]:(M=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=M);let N;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(De,{className:`size-3.5`}),t[37]=N):N=t[37];let P;t[38]!==o.open||t[39]!==j||t[40]!==M?(P=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:j,onClick:M,children:[N,o.open]}),t[38]=o.open,t[39]=j,t[40]=M,t[41]=P):P=t[41];let F;t[42]!==i||t[43]!==l||t[44]!==c||t[45]!==n||t[46]!==a||t[47]!==r||t[48]!==o.refresh?(F=r&&!l?(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i||!a,onClick:()=>void c(n,`refresh`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),o.refresh]}):null,t[42]=i,t[43]=l,t[44]=c,t[45]=n,t[46]=a,t[47]=r,t[48]=o.refresh,t[49]=F):F=t[49];let I;t[50]!==i||t[51]!==c||t[52]!==n||t[53]!==o.revoke?(I=n.revoked?null:(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i,onClick:()=>void c(n,`revoke`),children:[(0,Q.jsx)(Be,{className:`size-3.5`}),o.revoke]}),t[50]=i,t[51]=c,t[52]=n,t[53]=o.revoke,t[54]=I):I=t[54];let L;t[55]!==A||t[56]!==P||t[57]!==F||t[58]!==I?(L=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[A,P,F,I]}),t[55]=A,t[56]=P,t[57]=F,t[58]=I,t[59]=L):L=t[59];let R;return t[60]!==T||t[61]!==f||t[62]!==L?(R=(0,Q.jsxs)(`div`,{className:f,children:[T,L]}),t[60]=T,t[61]=f,t[62]=L,t[63]=R):R=t[63],R}function yt(e){let t=(0,Je.c)(68),{share:n,busy:r,t:i,onCopy:a,onAction:o}=e,s=n.revoked||n.expired,c=s&&`opacity-60`,l;t[0]===c?l=t[1]:(l=m(`rounded-lg border border-edge-subtle p-3`,c),t[0]=c,t[1]=l);let u=n.stale&&!s?i.stale:s?i.inactive:i.active,f;t[2]===u?f=t[3]:(f=(0,Q.jsx)(`span`,{children:u}),t[2]=u,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`span`,{children:`·`}),t[4]=p):p=t[4];let h=n.maxViews===null?``:` / ${n.maxViews}`,g;t[5]!==n.viewCount||t[6]!==i.views||t[7]!==h?(g=(0,Q.jsxs)(`span`,{children:[i.views,` `,n.viewCount,h]}),t[5]=n.viewCount,t[6]=i.views,t[7]=h,t[8]=g):g=t[8];let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(`span`,{children:`·`}),t[9]=_):_=t[9];let v;t[10]===n.expiresAt?v=t[11]:(v=new Date(n.expiresAt).toLocaleDateString(),t[10]=n.expiresAt,t[11]=v);let y;t[12]===v?y=t[13]:(y=(0,Q.jsx)(`span`,{children:v}),t[12]=v,t[13]=y);let b;t[14]!==y||t[15]!==f||t[16]!==g?(b=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[f,p,g,_,y]}),t[14]=y,t[15]=f,t[16]=g,t[17]=b):b=t[17];let x;t[18]===n.shareUrl?x=t[19]:(x=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[18]=n.shareUrl,t[19]=x);let S;t[20]!==b||t[21]!==x?(S=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[b,x]}),t[20]=b,t[21]=x,t[22]=S):S=t[22];let C;t[23]===r?C=t[24]:(C=r?(0,Q.jsx)(Te,{className:`size-4 animate-spin text-fg-muted`}):null,t[23]=r,t[24]=C);let w;t[25]!==S||t[26]!==C?(w=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,C]}),t[25]=S,t[26]=C,t[27]=w):w=t[27];let T;t[28]!==a||t[29]!==n.shareUrl?(T=()=>void a(n.shareUrl),t[28]=a,t[29]=n.shareUrl,t[30]=T):T=t[30];let E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(d,{className:`size-3.5`}),t[31]=E):E=t[31];let D;t[32]!==i.copy||t[33]!==T?(D=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:T,children:[E,i.copy]}),t[32]=i.copy,t[33]=T,t[34]=D):D=t[34];let O;t[35]===n.shareUrl?O=t[36]:(O=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=O);let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(De,{className:`size-3.5`}),t[37]=A):A=t[37];let j;t[38]!==i.open||t[39]!==O?(j=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:O,children:[A,i.open]}),t[38]=i.open,t[39]=O,t[40]=j):j=t[40];let M;t[41]!==r||t[42]!==s||t[43]!==o||t[44]!==n||t[45]!==i.refresh?(M=n.stale&&!s?(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`refresh`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),i.refresh]}):null,t[41]=r,t[42]=s,t[43]=o,t[44]=n,t[45]=i.refresh,t[46]=M):M=t[46];let N;t[47]!==r||t[48]!==s||t[49]!==o||t[50]!==n||t[51]!==i.extend?(N=s?null:(0,Q.jsx)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`extend`),children:i.extend}),t[47]=r,t[48]=s,t[49]=o,t[50]=n,t[51]=i.extend,t[52]=N):N=t[52];let P;t[53]!==r||t[54]!==o||t[55]!==n||t[56]!==i.revoke?(P=n.revoked?null:(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`revoke`),children:[(0,Q.jsx)(Be,{className:`size-3.5`}),i.revoke]}),t[53]=r,t[54]=o,t[55]=n,t[56]=i.revoke,t[57]=P):P=t[57];let F;t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==N||t[62]!==P?(F=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[D,j,M,N,P]}),t[58]=D,t[59]=j,t[60]=M,t[61]=N,t[62]=P,t[63]=F):F=t[63];let I;return t[64]!==w||t[65]!==l||t[66]!==F?(I=(0,Q.jsxs)(`div`,{className:l,children:[w,F]}),t[64]=w,t[65]=l,t[66]=F,t[67]=I):I=t[67],I}function bt(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var xt={title:`分享笔记`,description:`创建一个无需登录即可查看的只读快照。`,close:`关闭`,untitled:`无标题笔记`,empty:`空笔记`,privateExcluded:`不会分享标签、AI 元数据、项目、讨论、历史版本或未引用附件。`,attachments:`包含的附件`,expires:`有效期`,maxViews:`最多查看次数`,unlimited:`不限`,publicDescription:`公开说明(可选)`,create:`创建分享链接`,creating:`创建中…`,copy:`复制`,copied:`已复制`,open:`打开`,activeLinks:`这条笔记的分享`,copyFailed:`无法复制到剪贴板,请手动选择链接并复制。`,delivery:`发布方式`,deliveryHosted:`平台托管(外网稳定访问)`,deliveryLocal:`本机直连(需要隧道或公网部署)`,hostedLinks:`平台托管发布`,revision:`版本`,hostedDisabled:`管理员已暂停你的公网分享能力。已有托管链接当前不可访问,但仍可撤销。`,stale:`旧版本`,inactive:`已失效`,active:`有效`,views:`查看`,refresh:`更新快照`,extend:`延长 24 小时`,revoke:`撤销`},St={title:`Share Note`,description:`Create a read-only snapshot that opens without sign-in.`,close:`Close`,untitled:`Untitled Note`,empty:`Empty Note`,privateExcluded:`Tags, AI metadata, projects, discussions, history, and unreferenced attachments are excluded.`,attachments:`Included attachments`,expires:`Expires`,maxViews:`Maximum views`,unlimited:`Unlimited`,publicDescription:`Public description (optional)`,create:`Create share link`,creating:`Creating…`,copy:`Copy`,copied:`Copied`,open:`Open`,activeLinks:`Shares for this Note`,copyFailed:`Could not copy to the clipboard. Select the link and copy it manually.`,delivery:`Publishing method`,deliveryHosted:`Hosted platform (stable public access)`,deliveryLocal:`Direct from this device (requires public access)`,hostedLinks:`Hosted publications`,revision:`Revision`,hostedDisabled:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but can still be revoked.`,stale:`Older version`,inactive:`Inactive`,active:`Active`,views:`Views`,refresh:`Update snapshot`,extend:`Extend 24 hours`,revoke:`Revoke`};function Ct(e){let t=(0,Je.c)(18),{input:n,labels:r,showLabel:i}=e,a=i===void 0?!0:i,o;t[0]===n?o=t[1]:(o=n(),t[0]=n,t[1]=o);let s=o.source.id,c;t[2]===s?c=t[3]:(c=e=>e.source?.type===`note`&&e.source.id===s&&e.status!==`idle`,t[2]=s,t[3]=c);let l=Ve(c),u;t[4]===s?u=t[5]:(u=e=>e.source?.type===`note`&&e.source.id===s&&e.status===`preparing`,t[4]=s,t[5]=u);let d=Ve(u),f=Ve(wt),p;t[6]!==n||t[7]!==r||t[8]!==d||t[9]!==a?(p=(0,Q.jsx)(we,{input:n,labels:r,disabled:d,showLabel:a}),t[6]=n,t[7]=r,t[8]=d,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==l||t[12]!==r||t[13]!==f?(m=l?(0,Q.jsx)(`button`,{type:`button`,onClick:f,title:r.stop,"aria-label":r.stop,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(Se,{className:`size-3.5`,"aria-hidden":!0})}):null,t[11]=l,t[12]=r,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function wt(e){return e.stop}function Tt(e,t){let n=Me(t.replace(/^\s*(`{3,}|~{3,})[^\n]*$/gm,``).replace(/xopc-attachment:\/\/[^\s)]+/g,``).replace(/^(\s*[-*+]\s+)\[[ xX]\]\s*/gm,`$1`)),r=Me(e);return!r||n.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-D0LDiOTT.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-PFQHPGgi.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-DYGPxPee.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-BMYIfy9x.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-DA0Z5jM_.js","assets/messages-4BtQKYlM.js","assets/cn-JdwAhgNB.js","assets/app-link-CKueEVbT.js","assets/product-delivery-CrAI8ZEa.js","assets/schemas-BaskVM5g.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-DSjfHfaW.css","assets/dist-Che_jiQF.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-B-GDnZO9.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-BTQUDoJ2.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/middleware-Pd0e8Igk.js","assets/gateway-realtime-CGOW0-b4.js","assets/gateway-realtime-store-D4um_sV7.js","assets/files-Be5viEFY.js","assets/tool-activity-BtJkgjFf.js","assets/button-CS04eWY9.js","assets/registry-api-C0DCx3wv.js","assets/gateway-startup-retry-Cf8OxlvY.js","assets/gateway-config-swr-DUDX42qY.js","assets/electron-env-Dit0bHgy.js","assets/activity-store-DVUTs1fk.js","assets/theme-store-CegIlB8d.js","assets/index-1wIKA-kM.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-BdOTO0Yo.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l}from"./popover-select-B-GDnZO9.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./copy-Dv6d4Dvw.js";import{t as f}from"./download-Dk-ZjtO6.js";import{t as p}from"./x-B_N4OPjy.js";import{t as m}from"./cn-JdwAhgNB.js";import{a as h,f as g,n as _,r as v}from"./locale-store-DA0Z5jM_.js";import{t as y}from"./messages-4BtQKYlM.js";import{a as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./dist-BGTk37IG.js";import{t as D}from"./copy-to-clipboard-HOJ79TWv.js";import{i as O}from"./vendor-swr-BIWyz7Rc.js";import{t as k}from"./button-CS04eWY9.js";import{i as A}from"./theme-store-CegIlB8d.js";import{t as j}from"./skeleton-BwbyijEw.js";import{$t as M,An as N,Cn as P,Do as F,Ec as I,En as L,Gn as R,In as ee,Jn as te,Kn as ne,Ll as z,Ln as re,Mi as ie,Mn as ae,Mu as B,Nn as oe,Oi as se,On as ce,Pn as V,Qi as le,Ql as ue,Qt as de,Sn as fe,Ti as pe,Tn as H,Uc as U,Un as me,Wn as he,Xn as W,Xu as ge,Yu as _e,a as G,au as ve,bn as ye,bt as be,c as xe,dc as Se,do as Ce,er as we,fl as Te,hc as Ee,iu as De,jc as Oe,ji as K,jn as q,kn as ke,l as J,mu as Ae,nc as je,nr as Me,o as Ne,qn as Pe,rc as Fe,rr as Ie,ru as Le,s as Re,sl as ze,tc as Be,tr as Ve,wi as Y,wn as He,xc as Ue,xl as X,xn as We,yn as Ge,zc as Ke,zn as qe}from"./index-PFQHPGgi.js";var Je=n(),Z=e(t(),1),Q=r(),Ye=(0,Z.createContext)(null);function Xe(){let e=(0,Je.c)(1),t=(0,Z.useContext)(Ye);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:Ze},e[0]=t):t=e[0],t}return t}function Ze(){}function Qe(e){let t=(0,Je.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,o]=(0,Z.useState)(null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(e,t)=>{o({src:e,alt:t})},t[0]=s):s=t[0];let c=s,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={openImage:c},t[1]=l):l=t[1];let u=l,d=a!==null,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e||o(null)},t[2]=f):f=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(b,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=m(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=g):g=t[4];let _=a?.alt||`Image preview`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(T,{className:`sr-only`,children:_}),t[5]=_,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(p,{className:`size-5`,"aria-hidden":!0}),t[7]=y):y=t[7];let x;t[8]===i?x=t[9]:(x=(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:y})}),t[8]=i,t[9]=x);let D;t[10]===a?D=t[11]:(D=a?(0,Q.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=D);let O;t[12]!==x||t[13]!==D||t[14]!==v?(O=(0,Q.jsxs)(C,{children:[h,(0,Q.jsxs)(w,{className:g,"aria-describedby":void 0,children:[v,x,D]})]}),t[12]=x,t[13]=D,t[14]=v,t[15]=O):O=t[15];let k;t[16]!==O||t[17]!==d?(k=(0,Q.jsx)(E,{open:d,onOpenChange:f,children:O}),t[16]=O,t[17]=d,t[18]=k):k=t[18];let A;return t[19]!==n||t[20]!==k?(A=(0,Q.jsxs)(Ye.Provider,{value:u,children:[n,k]}),t[19]=n,t[20]=k,t[21]=A):A=t[21],A}var $e=6e4,et=36e5,$=864e5;function tt(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function nt(e,t,n){let r=t-e;if(r<$e)return n.justNow;if(r<et){let e=Math.floor(r/$e);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=tt(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(e>=i-$)return n.yesterday+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(r<7*$){let e=Math.floor(r/$);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(n.locale,{month:`short`,day:`numeric`})}function rt(e,t,n){let r=tt(t);if(e>=r)return n.today;if(e>=r-$)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(n.locale,{month:`long`,day:`numeric`}):i.toLocaleDateString(n.locale,{year:`numeric`,month:`long`,day:`numeric`})}function it(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function at(e){let t=(0,Je.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,l=c===void 0?`card`:c,d=_(ct),f=y(d).automations.suggestions,p=y(d).automations,h=a(),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=g):g=t[0];let{data:v}=O(o?`automation-suggestion-coverage`:null,st,g),b=o?v?.automations.find(e=>xe(e,o)):void 0,x=b?Ne(b,p):[];if(l===`titleAction`){if(b){let e;t[1]===s?e=t[2]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,s),t[1]=s,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===h?r=t[5]:(r=()=>h(`/automations`),t[4]=h,t[5]=r),(0,Q.jsxs)(`section`,{className:e,children:[n,(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:f.coveredTitle}),(0,Q.jsx)(k,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:f.manage})]})}let e;t[6]===s?e=t[7]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,s),t[6]=s,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(X,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let o;t[9]!==r||t[10]!==n?(o=(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=o):o=t[11];let c;t[12]!==h||t[13]!==i?(c=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=h,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,Q.jsxs)(`section`,{className:e,children:[a,o,(0,Q.jsxs)(k,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,f.setup]})]})}if(b){let e;t[16]===s?e=t[17]:(e=m(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,s),t[16]=s,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===h?r=t[20]:(r=()=>h(`/automations`),t[19]=h,t[20]=r);let i;return t[21]!==f||t[22]!==r?(i=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(k,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:f.manage})}),t[21]=f,t[22]=r,t[23]=i):i=t[23],(0,Q.jsxs)(`section`,{className:e,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:f.coveredTitle}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:Re(f.coveredDescription,{name:b.name})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:p.explain.whyCovered}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(ot)})]}),i]})}let S;t[24]===s?S=t[25]:(S=m(`rounded-lg bg-surface-panel p-3 shadow-surface`,s),t[24]=s,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(X,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==h||t[35]!==i?(D=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=h,t[35]=i,t[36]=D):D=t[36];let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),t[37]=A):A=t[37];let j;t[38]!==f.create||t[39]!==D?(j=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(k,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[A,f.create]})}),t[38]=f.create,t[39]=D,t[40]=j):j=t[40];let M;return t[41]!==j||t[42]!==S||t[43]!==E?(M=(0,Q.jsxs)(`section`,{className:S,children:[E,j]}),t[41]=j,t[42]=S,t[43]=E,t[44]=M):M=t[44],M}function ot(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function st(){return J.list()}function ct(e){return e.language}function lt(e){let t=(0,Je.c)(51),{initial:n,zh:r,busy:i,onClose:a,onSave:o}=e,[s,c]=(0,Z.useState)(n),l;t[0]!==i||t[1]!==a?(l=e=>{!e&&!i&&a()},t[0]=i,t[1]=a,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[3]=u):u=t[3];let d=r?`编辑纪要内容`:`Edit meeting content`,f;t[4]===d?f=t[5]:(f=(0,Q.jsx)(`header`,{className:`border-b border-edge p-4`,children:(0,Q.jsx)(T,{children:d})}),t[4]=d,t[5]=f);let p=r?`人工修改会保留,重新整理不会覆盖。已创建任务保持不变。`:`Your changes survive regeneration. Existing tasks remain unchanged.`,m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[6]=p,t[7]=m);let h=r?`内容`:`Content`,g;t[8]===s?g=t[9]:(g=e=>c({...s,text:e.target.value}),t[8]=s,t[9]=g);let _;t[10]!==s.text||t[11]!==g?(_=(0,Q.jsx)(`textarea`,{className:`mt-1 min-h-32 w-full rounded border border-edge bg-transparent p-2`,value:s.text,onChange:g}),t[10]=s.text,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==_?(v=(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==s||t[17]!==r?(y=s.kind===`actionItems`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`负责人原话`:`Owner as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.owner??``,onChange:e=>c({...s,owner:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`期限原话`:`Date as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.dueDate??``,onChange:e=>c({...s,dueDate:e.target.value})})]})]}):null,t[16]=s,t[17]=r,t[18]=y):y=t[18];let x;t[19]!==s||t[20]!==r?(x=s.kind===`summary`?null:(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!s.ignored,onChange:e=>c({...s,ignored:e.target.checked})}),r?`忽略此项`:`Ignore this item`]}),t[19]=s,t[20]=r,t[21]=x):x=t[21];let S;t[22]!==v||t[23]!==y||t[24]!==x||t[25]!==m?(S=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[m,v,y,x]}),t[22]=v,t[23]=y,t[24]=x,t[25]=m,t[26]=S):S=t[26];let D=r?`取消`:`Cancel`,O;t[27]!==i||t[28]!==a||t[29]!==D?(O=(0,Q.jsx)(k,{disabled:i,onClick:a,children:D}),t[27]=i,t[28]=a,t[29]=D,t[30]=O):O=t[30];let A;t[31]!==i||t[32]!==s.text?(A=i||!s.text.trim(),t[31]=i,t[32]=s.text,t[33]=A):A=t[33];let j;t[34]!==s||t[35]!==o?(j=()=>void o(s),t[34]=s,t[35]=o,t[36]=j):j=t[36];let M=r?`保存修改`:`Save changes`,N;t[37]!==A||t[38]!==j||t[39]!==M?(N=(0,Q.jsx)(k,{variant:`primary`,disabled:A,onClick:j,children:M}),t[37]=A,t[38]=j,t[39]=M,t[40]=N):N=t[40];let P;t[41]!==O||t[42]!==N?(P=(0,Q.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge p-3`,children:[O,N]}),t[41]=O,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==S||t[45]!==P||t[46]!==f?(F=(0,Q.jsxs)(C,{children:[u,(0,Q.jsxs)(w,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(32rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[f,S,P]})]}),t[44]=S,t[45]=P,t[46]=f,t[47]=F):F=t[47];let I;return t[48]!==l||t[49]!==F?(I=(0,Q.jsx)(E,{open:!0,onOpenChange:l,children:F}),t[48]=l,t[49]=F,t[50]=I):I=t[50],I}var ut=e=>`${String(Math.floor(e/6e4)).padStart(2,`0`)}:${String(Math.floor(e/1e3)%60).padStart(2,`0`)}`;function dt({noteId:e}){let t=_(e=>e.language)===`zh`,{data:n,mutate:r,isLoading:i}=O([`note-discussion-document`,e],()=>de(e),{refreshInterval:e=>e&&([`recording`,`stopping`,`sealing`,`organizing`].includes(e.discussion.status)||e.recordingJob?.state===`queued`||e.recordingJob?.state===`running`)?3e3:0}),a=n?.discussion.id,u=`/api/discussions/${encodeURIComponent(a??``)}`,{data:d=[],mutate:m}=O(a?`${u}/actions`:null,e=>h(v(e)),{refreshInterval:1e4}),[g,y]=(0,Z.useState)(`summary`),[x,S]=(0,Z.useState)(``),[D,A]=(0,Z.useState)(`general`),[N,P]=(0,Z.useState)(null),[F,L]=(0,Z.useState)(null),[R,ee]=(0,Z.useState)(null),[te,ne]=(0,Z.useState)(!1),[z,re]=(0,Z.useState)([]),[ie,ae]=(0,Z.useState)(null),[B,oe]=(0,Z.useState)(!1),[se,ce]=(0,Z.useState)(1),V=(0,Z.useRef)(null),le=(0,Z.useRef)(null),[fe,pe]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{let e=()=>{r(),m()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-segment-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-segment-updated`,e)}},[r,m]),(0,Z.useEffect)(()=>{n?.discussion.template&&A(n.discussion.template)},[n?.discussion.template]);async function H(e){if(!B){oe(!0),ae(null);try{await e(),await r(),await m()}catch(e){ae(e instanceof Error?e.message:String(e))}finally{oe(!1)}}}function U(e){V.current&&(V.current.readyState===0?(le.current=e/1e3,V.current.load()):V.current.currentTime=e/1e3,V.current.play().catch(()=>void 0))}async function me(e,t){n?.organization&&await H(async()=>{P((await h(v(`${u}/transcript?revision=${t??n.organization.transcriptRevision}`))).segments.filter(t=>e.includes(t.sequence)))})}let he=(e,n,r)=>n.some(e=>te||!e.ignored)?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold text-fg`,children:e}),n.filter(e=>te||!e.ignored).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,Q.jsxs)(`p`,{className:`flex-1 whitespace-pre-wrap`,children:[e.text,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更`:`Later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B,onClick:()=>ee({kind:r,itemId:e.id,text:e.text,ignored:e.ignored}),children:t?`编辑`:`Edit`}),e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`shrink-0 text-accent-fg`,onClick:()=>void me(e.evidenceSegmentIds,e.evidenceRevision),children:t?`原话`:`Source`}):(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t?`暂无定位`:`No source timing`})]},e.id))]}):null;if(i)return(0,Q.jsx)(j,{className:`h-48 w-full`});if(!n)return null;let{discussion:W,transcript:ge,organization:_e}=n,G=_e?.organization,ve=[`stopping`,`sealing`,`organizing`].includes(W.status),ye=[`recording`,`completed`,`needs_attention`].includes(W.status),be=ge.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(x.toLocaleLowerCase())||e.speakerLabel?.toLocaleLowerCase().includes(x.toLocaleLowerCase()));return(0,Q.jsxs)(`section`,{className:`relative flex h-full min-h-0 w-full flex-col text-fg`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-edge-subtle p-4`,children:[(0,Q.jsx)(ue,{className:`size-4 text-accent`}),(0,Q.jsxs)(`span`,{className:`text-sm font-medium`,children:[ut(W.durationMs??0),` · `,ve?t?`正在整理`:`Processing`:W.status===`completed`?t?`整理完成`:`Ready`:W.status]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsxs)(c,{value:D,"aria-label":t?`纪要模板`:`Summary template`,onChange:e=>A(e.target.value),children:[(0,Q.jsx)(l,{value:`general`,children:t?`通用会议`:`General`}),(0,Q.jsx)(l,{value:`project`,children:t?`项目例会`:`Project`}),(0,Q.jsx)(l,{value:`review`,children:t?`需求评审`:`Review`}),(0,Q.jsx)(l,{value:`interview`,children:t?`客户访谈`:`Interview`})]}),(0,Q.jsxs)(k,{disabled:B||ve||!W.canonicalTranscript,onClick:()=>void H(()=>h(v(`${u}/organize`),{method:`POST`,body:JSON.stringify({template:D})})),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),t?`重新整理`:`Regenerate`]})]})]}),(0,Q.jsxs)(`nav`,{"aria-label":t?`会议内容`:`Meeting content`,className:`flex shrink-0 items-center gap-4 border-b border-edge-subtle px-4 py-2 text-sm`,children:[[`summary`,`transcript`].map(e=>(0,Q.jsx)(`button`,{className:g===e?`font-medium text-accent-fg`:`text-fg-muted`,onClick:()=>y(e),children:e===`summary`?t?`纪要与行动`:`Summary & actions`:t?`逐字稿`:`Transcript`},e)),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(f,{className:`size-3`}),[`md`,`txt`,`srt`].map(e=>(0,Q.jsx)(`a`,{className:`text-accent-fg`,href:v(`${u}/export?format=${e}`),download:!0,children:e.toUpperCase()},e))]})]}),ie?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-2 text-sm text-danger`,children:ie}):null,n.recordingJob?.state===`queued`||n.recordingJob?.state===`running`?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-sm text-fg-muted`,children:t?`录音已上传,正在后台校验与保存。关闭此页面不会中断处理。`:`Recording uploaded. Verification and saving continue in the background, even if you close this page.`}):null,W.status===`needs_attention`?(0,Q.jsxs)(`div`,{className:`flex gap-2 p-4 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:W.failureMessage}),(0,Q.jsx)(`button`,{disabled:B,onClick:()=>void H(()=>M(W.id)),children:t?`重试`:`Retry`})]}):null,_e&&_e.transcriptRevision!==ge.revision?(0,Q.jsx)(`p`,{className:`px-4 py-2 text-xs text-fg-muted`,children:t?`转写已修改,当前纪要引用的是修改前版本。重新整理可生成新版纪要。`:`Transcript changed. This summary cites the previous revision; regenerate to update.`}):null,(0,Q.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:g===`summary`?G?(0,Q.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:G.summaryEditedByUser?t?`概要已人工编辑`:`Overview edited`:``}),(0,Q.jsx)(`button`,{disabled:B||ve,onClick:()=>ee({kind:`summary`,itemId:`summary`,text:G.summary}),children:t?`编辑概要`:`Edit overview`})]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:G.summary}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:te,onChange:e=>ne(e.target.checked)}),t?`显示已忽略项`:`Show ignored items`]}),z.length?(0,Q.jsx)(k,{disabled:B,onClick:()=>void H(async()=>{for(let e of z)await h(v(`${u}/actions/${encodeURIComponent(e)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:_e.revision})});re([])}),children:t?`加入所选 ${z.length} 项任务`:`Add ${z.length} selected tasks`}):null,he(t?`已决定事项`:`Decisions`,G.decisions,`decisions`),G.actionItems.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`下一步行动`:`Next actions`}),G.actionItems.filter(e=>te||!e.ignored).map(e=>{let n=d.find(t=>t.actionId===e.id);return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[!n&&!e.ignored&&(!(e.supersededBy||e.disputedBy)||e.reviewedChangeId===(e.supersededBy??e.disputedBy))?(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`${t?`选择行动`:`Select action`}: ${e.title}`,className:`ui-checkbox`,checked:z.includes(e.id),onChange:t=>re(t.target.checked?[...z,e.id]:z.filter(t=>t!==e.id))}):null,(0,Q.jsxs)(`p`,{className:`flex-1 text-sm font-medium`,children:[e.title,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更,请复核`:`Review later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B||ve,onClick:()=>ee({kind:`actionItems`,itemId:e.id,text:e.title,owner:e.owner,dueDate:e.dueDate,ignored:e.ignored}),children:t?`编辑`:`Edit`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.owner??(t?`负责人未明确`:`Owner unspecified`),` · `,e.dueDate??(t?`期限未明确`:`Date unspecified`)]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs`,children:[e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`text-accent-fg`,onClick:()=>void me(e.evidenceSegmentIds,e.evidenceRevision),children:t?`查看原话`:`Source`}):null,n?n.deleted?(0,Q.jsx)(`span`,{children:t?`关联任务已删除`:`Linked task deleted`}):(0,Q.jsx)(o,{className:`text-accent-fg`,to:`/tasks/${encodeURIComponent(n.taskId)}`,children:n.resolution===`done`?t?`已完成 · 查看任务`:`Done · View task`:t?`查看任务 / 交给助手`:`View task / Delegate`}):e.ignored?null:(0,Q.jsx)(k,{disabled:B||!!(e.supersededBy||e.disputedBy)&&e.reviewedChangeId!==(e.supersededBy??e.disputedBy),onClick:()=>void H(()=>h(v(`${u}/actions/${encodeURIComponent(e.id)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:_e.revision})})),children:t?`加入我的任务`:`Add to my tasks`})]})]},e.id)})]}):null,he(t?`风险`:`Risks`,G.risks,`risks`),he(t?`尚未确定`:`Open questions`,G.openQuestions,`openQuestions`),G.changes?.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`前后变更`:`Changes during the meeting`}),G.changes.map(e=>{let n=[...G.decisions,...G.actionItems,...G.risks,...G.openQuestions],r=n.find(t=>t.id===e.fromId),i=n.find(t=>t.id===e.toId);return!r||!i?null:(0,Q.jsxs)(`article`,{className:`space-y-2 rounded border border-edge p-3 text-sm`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.relation===`supersedes`?t?`后续撤销或替代`:`Later superseded`:t?`存在冲突,尚未明确解决`:`Unresolved conflict`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void me(r.evidenceSegmentIds,r.evidenceRevision),children:`title`in r?r.title:r.text}),(0,Q.jsx)(`span`,{children:`↓`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void me(i.evidenceSegmentIds,i.evidenceRevision),children:`title`in i?i.title:i.text})]},`${e.fromId}:${e.toId}`)})]}):null,G.chapters.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`章节回顾`:`Chapters`}),G.chapters.map((e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`button`,{className:`text-sm text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[ut(e.startedAtMs),` · `,e.title]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary})]},t))]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:ve?t?`录音已保存,纪要正在生成。可以先查看逐字稿。`:`Recording saved. Summary is processing; you can read the transcript.`:t?`录音结束后自动生成纪要。`:`Summary appears after recording ends.`}),ve?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{className:`h-6 w-3/4`}),(0,Q.jsx)(j,{className:`h-24 w-full`})]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-edge px-3`,children:[(0,Q.jsx)(I,{className:`size-4 text-fg-muted`}),(0,Q.jsx)(`input`,{className:`w-full bg-transparent py-2 text-sm outline-none`,placeholder:t?`查找原话或说话人`:`Search words or speaker`,value:x,onChange:e=>{S(e.target.value),ce(1)}})]}),be.slice(0,se*50).map(e=>(0,Q.jsxs)(`article`,{className:`rounded-md border p-3 ${fe>=e.startedAtMs&&fe<e.endedAtMs?`border-accent`:`border-edge-subtle`}`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[(0,Q.jsx)(Ke,{className:`size-3`}),ut(e.startedAtMs)]}),(0,Q.jsx)(`span`,{children:e.speakerLabel??(t?`未区分说话人`:`Speaker unknown`)}),ye&&e.status===`confirmed`?(0,Q.jsx)(`button`,{className:`ml-auto`,onClick:()=>L({segment:e,text:e.displayText??e.rawText??``,speaker:e.speakerLabel??``}),children:t?`校对`:`Edit`}):null]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6`,children:e.displayText??e.rawText??(t?`等待转写`:`Awaiting transcription`)})]},e.sequence)),be.length>se*50?(0,Q.jsx)(k,{onClick:()=>ce(se+1),children:t?`加载更多`:`More`}):null]})}),W.audioAttachmentId&&!W.audioDeletedAt?(0,Q.jsxs)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:[(0,Q.jsx)(`audio`,{ref:V,controls:!0,preload:`metadata`,className:`h-10 w-full`,src:v(`${u}/audio`),onTimeUpdate:()=>pe((V.current?.currentTime??0)*1e3),onLoadedMetadata:()=>{le.current!==null&&V.current&&(V.current.currentTime=le.current,le.current=null)},onError:()=>ae(t?`录音暂不可播放`:`Recording unavailable`)}),(0,Q.jsx)(`a`,{className:`mt-1 block text-right text-xs text-accent-fg`,href:v(`${u}/audio`),download:!0,children:t?`下载录音`:`Download recording`})]}):null,N?(0,Q.jsxs)(`aside`,{"aria-label":t?`原话证据`:`Source evidence`,className:`absolute inset-y-0 right-0 z-10 flex w-[min(26rem,100%)] flex-col border-l border-edge bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(`h3`,{children:t?`原话证据`:`Source evidence`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭`:`Close`,onClick:()=>P(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:N.length?N.map(e=>(0,Q.jsxs)(`article`,{children:[(0,Q.jsxs)(`button`,{className:`mb-2 text-xs text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[ut(e.startedAtMs),` · `,e.speakerLabel??(t?`说话人未明确`:`Unknown speaker`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:e.displayText??e.rawText})]},e.sequence)):(0,Q.jsx)(`p`,{children:t?`此版本暂无可定位原话。`:`No timed source available for this revision.`})})]}):null,R&&_e?(0,Q.jsx)(lt,{initial:R,zh:t,busy:B,onClose:()=>ee(null),onSave:e=>H(async()=>{await h(v(`${u}/summary`),{method:`PATCH`,body:JSON.stringify({...e,expectedRevision:_e.revision})}),ee(null)})},`${R.kind}:${R.itemId}:${_e.revision}`):null,F?(0,Q.jsx)(E,{open:!0,onOpenChange:e=>{e||L(null)},children:(0,Q.jsxs)(C,{children:[(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(w,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(28rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(T,{children:t?`校对逐字稿`:`Edit transcript`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭校对`:`Close editor`,onClick:()=>L(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[(0,Q.jsxs)(`label`,{className:`block text-xs`,children:[t?`本段说话人`:`Speaker for this segment`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:F.speaker,onChange:e=>L({...F,speaker:e.target.value})})]}),F.segment.speakerLabel?(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!F.applyToSpeakerGroup,onChange:e=>L({...F,applyToSpeakerGroup:e.target.checked})}),t?`同时更名所有同标签片段;输入已有标签可合并说话人`:`Rename all segments with this label; use an existing label to merge speakers`]}):null,(0,Q.jsx)(`textarea`,{className:`min-h-32 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:F.text,onChange:e=>L({...F,text:e.target.value})})]}),(0,Q.jsx)(`footer`,{className:`border-t border-edge p-3`,children:(0,Q.jsxs)(k,{variant:`primary`,disabled:B||!F.text.trim(),onClick:()=>void H(async()=>{await h(v(`${u}/segments/${F.segment.sequence}`),{method:`PATCH`,body:JSON.stringify({displayText:F.text,speakerLabel:F.speaker,expectedRevision:F.segment.revision,applyToSpeakerGroup:F.applyToSpeakerGroup,expectedTranscriptRevision:ge.revision})}),L(null)}),children:[(0,Q.jsx)(s,{className:`size-4`}),t?`保存修订`:`Save revision`]})})]})]})}):null]})}var ft={edit:U,ai_edit:Ee,sync:Oe,restore:ge};function pt(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function mt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=_(e=>e.language),o=y(a).notes,s={justNow:o.justNow,minutesAgo:o.minutesAgo,today:o.today,yesterday:o.yesterday,daysAgo:o.daysAgo,locale:g(a)},{data:c}=O(e?[`note-history`,e]:null,()=>V(e)),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[h,v]=(0,Z.useState)(null),b=(0,Z.useCallback)(async t=>{u(!0),v(null);try{await Pe(e,t),f(null),i()}catch{v(o.restoreFailed)}finally{u(!1)}},[e,o.restoreSuccess,o.restoreFailed,i]),x=Date.now();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0}),o.history]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[h?(0,Q.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:h}):null,c?.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>{let r=ft[e.trigger]??U,i=t===e.timestamp,a=d===e.timestamp;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:m(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:pt(e.trigger,o)}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:nt(e.timestamp,x,s)})]}),e.snippet&&(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,Q.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:o.restoreConfirm}),(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),b(e.timestamp)},disabled:l,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:l?`...`:o.restore}),(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:o.restore})})]},e.timestamp)})}):(0,Q.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:o.historyEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:o.historyEmptyDescription})]})]})]})}function ht({noteId:e,note:t,catalyzing:n,onCatalyze:r,onClose:i,noteThreads:o,openingChat:s,onOpenChat:c,onOpenNewChat:l}){let u=y(_(e=>e.language)).notes,d=a(),f=t?.aiDeep?.catalysis,p=f?.report??null,[h,g]=(0,Z.useState)(null),[v,b]=(0,Z.useState)(!1),{data:x,mutate:S,isLoading:C}=O(e?[`note-agent-context-status`,e]:null,()=>q(e),{revalidateOnFocus:!1}),w=(0,Z.useCallback)(async()=>{if(!v){b(!0),g(null);try{await S(()=>me(e),{revalidate:!1})}catch(e){g(`${u.contextRebuildFailed}: ${e instanceof Error?e.message:u.quickCaptureFailedHint}`)}finally{b(!1)}}},[v,S,u.contextRebuildFailed,u.quickCaptureFailedHint,e]),T=(0,Z.useCallback)(async t=>{try{await he(e,t)}catch{}},[e]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ee,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:u.catalysisSectionTitle})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:i,"aria-label":u.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(_e,{className:`size-4 rotate-180`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:u.catalysisSectionDescription}),x?(0,Q.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.contextStatusTitle}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void w(),disabled:C||v,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:v?u.processing:u.contextRebuild}),(0,Q.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5 text-[11px] font-medium`,x.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:x.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:x.status})]}),(0,Q.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:u.contextStatusDetail.replace(`{{attachments}}`,String(x.attachments.length)).replace(`{{tokens}}`,String(x.tokenEstimate??0))}),h?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:h}):null,x.attachments.length>0?(0,Q.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:x.attachments.slice(0,5).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId))}):null]}):null,(0,Q.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?u.processing:p?u.recatalyze:u.catalyzeAction}),p?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.valueHypothesis}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:p.valueHypothesis})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.targetUsers}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.targetUsers.slice(0,5).map(e=>(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.keyQuestions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.keyQuestions.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.mvpPathLabel}),(0,Q.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.mvpPath.slice(0,3).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.risks}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.risks.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.nextActions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.nextActions.slice(0,4).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,Q.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:u.confidenceLabel.replace(`{{percent}}`,String(Math.round(p.confidence*100)))}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackHelpfulAria,children:(0,Q.jsx)(je,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`not_helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackNotHelpfulAria,children:(0,Q.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,Q.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:u.noCatalysisReportHint}),(0,Q.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(ze,{className:`size-4 text-accent`,"aria-hidden":!0}),u.relatedThreadsTitle]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.relatedThreadsDescription})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,disabled:s,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:s?u.openingChat:u.openThread}),(0,Q.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:u.newThread})]})]}),o.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:o.slice(0,5).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>d(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||u.noteDiscussionFallback}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:u.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:u.noThreads})]})]})]})}var gt=[{value:`86400000`,zh:`24 小时`,en:`24 hours`},{value:`604800000`,zh:`7 天`,en:`7 days`},{value:`2592000000`,zh:`30 天`,en:`30 days`}];function _t({open:e,onOpenChange:t,note:n}){let r=_(e=>e.language)===`zh`,i=r?xt:St,{data:a,mutate:o}=O(e?[`note-shares`,n.id]:null,()=>ee(n.id)),u=O(e?`hosted-share-auth-status`:null,se),f=u.data===!0,m=O(e&&f?`hosted-publication-capabilities`:null,pe),h=m.data?.publishing.allowed===!0,g=O(e&&f?[`hosted-note-publications`,n.id]:null,()=>oe(n.id)),[v,y]=(0,Z.useState)(new Set),[A,j]=(0,Z.useState)(`86400000`),[M,N]=(0,Z.useState)(``),[P,F]=(0,Z.useState)(``),[I,te]=(0,Z.useState)(`hosted`),[z,re]=(0,Z.useState)(!1),[ae,B]=(0,Z.useState)(null),[V,le]=(0,Z.useState)(null),[ue,de]=(0,Z.useState)(!1),[fe,H]=(0,Z.useState)(null),U=(0,Z.useMemo)(()=>{let e=new Set;return n.markdown.replace(/xopc-attachment:\/\/notes\/([^/]+)\/([^\s)]+)/gi,(t,r,i)=>{try{decodeURIComponent(r)===n.id&&e.add(decodeURIComponent(i))}catch{}return t}),(n.attachments??[]).filter(t=>e.has(t.id))},[n.attachments,n.id,n.markdown]);(0,Z.useEffect)(()=>{e&&(y(new Set(U.map(e=>e.id))),le(null),de(!1),H(null))},[e,U]);let me=async()=>{re(!0),H(null);try{let e={expectedNoteVersion:n.updatedAt,attachmentIds:[...v],ttlMs:Number(A),maxViews:M.trim()?Number(M):null,description:P.trim()||void 0};I===`hosted`?(le((await L(n.id,e)).shareUrl),await g.mutate()):(le((await ce(n.id,e)).payload.shareUrl),await o())}catch(e){H(e instanceof Error?e.message:String(e))}finally{re(!1)}},he=async(e,t)=>{B(e.id),H(null);try{t===`refresh`?await R(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):await K(e.id),await g.mutate()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}},W=async(e,t)=>{B(e.id),H(null);try{t===`refresh`?await ne(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):t===`extend`?await Y(e.id,864e5):await ie(e.id),await o()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}},ge=async e=>{H(null);try{if(!await D(e)){de(!1),H(i.copyFailed);return}de(!0),window.setTimeout(()=>de(!1),1500)}catch{de(!1),H(i.copyFailed)}};return(0,Q.jsx)(E,{open:e,onOpenChange:t,children:(0,Q.jsxs)(C,{children:[(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(w,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(T,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,Q.jsx)(Ue,{className:`size-4`}),i.title]}),(0,Q.jsx)(x,{className:`mt-1 text-xs text-fg-muted`,children:i.description})]}),(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-fg-muted hover:bg-surface-hover`,"aria-label":i.close,children:(0,Q.jsx)(p,{className:`size-4`})})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Q.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-inset p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.title||i.untitled}),(0,Q.jsx)(`p`,{className:`mt-2 line-clamp-4 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.markdown||i.empty}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:i.privateExcluded})]}),U.length>0?(0,Q.jsxs)(`section`,{className:`mt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.attachments}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:U.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:v.has(e.id),onChange:()=>y(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:`accent-accent`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:bt(e.size)})]},e.id))})]}):null,(0,Q.jsxs)(`section`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.delivery,(0,Q.jsxs)(c,{value:I,onChange:e=>te(e.target.value),children:[(0,Q.jsx)(l,{value:`hosted`,children:i.deliveryHosted}),(0,Q.jsx)(l,{value:`local`,children:i.deliveryLocal})]})]}),I===`hosted`&&u.data===!1?(0,Q.jsx)(`div`,{className:`sm:col-span-2`,children:(0,Q.jsx)(be,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:()=>void u.mutate(!0,{revalidate:!1})})}):null,I===`hosted`&&f&&m.data&&!h?(0,Q.jsx)(`p`,{className:`rounded-lg border border-warning/30 bg-warning-soft px-3 py-2 text-xs text-warning sm:col-span-2`,children:i.hostedDisabled}):null,(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.expires,(0,Q.jsx)(c,{value:A,onChange:e=>j(e.target.value),children:gt.map(e=>(0,Q.jsx)(l,{value:e.value,children:r?e.zh:e.en},e.value))})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.maxViews,(0,Q.jsx)(`input`,{type:`number`,min:1,max:1e3,value:M,onChange:e=>N(e.target.value),placeholder:i.unlimited,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.publicDescription,(0,Q.jsx)(`input`,{value:P,onChange:e=>F(e.target.value),className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]})]}),V?(0,Q.jsx)(`div`,{className:`mt-5 rounded-lg border border-success/25 bg-success-soft p-3`,children:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(`input`,{readOnly:!0,value:V,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none`}),(0,Q.jsxs)(k,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void ge(V),children:[ue?(0,Q.jsx)(s,{className:`size-4`}):(0,Q.jsx)(d,{className:`size-4`}),ue?i.copied:i.copy]}),(0,Q.jsxs)(k,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>window.open(V,`_blank`,`noopener,noreferrer`),children:[(0,Q.jsx)(De,{className:`size-4`}),i.open]})]})}):null,fe?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,children:fe}):null,(a?.items.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.activeLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:a.items.map(e=>(0,Q.jsx)(yt,{share:e,busy:ae===e.id,t:i,onCopy:ge,onAction:W},e.id))})]}):null,(g.data?.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.hostedLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:g.data.map(e=>(0,Q.jsx)(vt,{publication:e,stale:e.source?.version!==String(n.updatedAt),busy:ae===e.id,publishingAllowed:h,t:i,onCopy:ge,onAction:he},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(k,{type:`button`,variant:`ghost`,children:i.close})}),(0,Q.jsxs)(k,{type:`button`,onClick:()=>void me(),disabled:z||I===`hosted`&&(!f||!h),children:[z?(0,Q.jsx)(Te,{className:`size-4 animate-spin`}):(0,Q.jsx)(Ue,{className:`size-4`}),z?i.creating:i.create]})]})]})]})})}function vt(e){let t=(0,Je.c)(64),{publication:n,stale:r,busy:i,publishingAllowed:a,t:o,onCopy:s,onAction:c}=e,l=n.revoked||n.expired,u=l&&`opacity-60`,f;t[0]===u?f=t[1]:(f=m(`rounded-lg border border-edge-subtle p-3`,u),t[0]=u,t[1]=f);let p=r&&!l?o.stale:l?o.inactive:o.active,h;t[2]===p?h=t[3]:(h=(0,Q.jsx)(`span`,{children:p}),t[2]=p,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{children:`·`}),t[4]=g):g=t[4];let _=n.maxViews===null?``:` / ${n.maxViews}`,v;t[5]!==n.viewCount||t[6]!==o.views||t[7]!==_?(v=(0,Q.jsxs)(`span`,{children:[o.views,` `,n.viewCount,_]}),t[5]=n.viewCount,t[6]=o.views,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`·`}),t[9]=y):y=t[9];let b;t[10]!==n.revision||t[11]!==o.revision?(b=(0,Q.jsxs)(`span`,{children:[o.revision,` `,n.revision]}),t[10]=n.revision,t[11]=o.revision,t[12]=b):b=t[12];let x;t[13]!==h||t[14]!==v||t[15]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[h,g,v,y,b]}),t[13]=h,t[14]=v,t[15]=b,t[16]=x):x=t[16];let S;t[17]===n.shareUrl?S=t[18]:(S=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[17]=n.shareUrl,t[18]=S);let C;t[19]!==x||t[20]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]===i?w=t[23]:(w=i?(0,Q.jsx)(Te,{className:`size-4 animate-spin text-fg-muted`}):null,t[22]=i,t[23]=w);let T;t[24]!==C||t[25]!==w?(T=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[C,w]}),t[24]=C,t[25]=w,t[26]=T):T=t[26];let E=!a,D;t[27]!==s||t[28]!==n.shareUrl?(D=()=>void s(n.shareUrl),t[27]=s,t[28]=n.shareUrl,t[29]=D):D=t[29];let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(d,{className:`size-3.5`}),t[30]=O):O=t[30];let A;t[31]!==o.copy||t[32]!==E||t[33]!==D?(A=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:E,onClick:D,children:[O,o.copy]}),t[31]=o.copy,t[32]=E,t[33]=D,t[34]=A):A=t[34];let j=!a,M;t[35]===n.shareUrl?M=t[36]:(M=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=M);let N;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(De,{className:`size-3.5`}),t[37]=N):N=t[37];let P;t[38]!==o.open||t[39]!==j||t[40]!==M?(P=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:j,onClick:M,children:[N,o.open]}),t[38]=o.open,t[39]=j,t[40]=M,t[41]=P):P=t[41];let F;t[42]!==i||t[43]!==l||t[44]!==c||t[45]!==n||t[46]!==a||t[47]!==r||t[48]!==o.refresh?(F=r&&!l?(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i||!a,onClick:()=>void c(n,`refresh`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),o.refresh]}):null,t[42]=i,t[43]=l,t[44]=c,t[45]=n,t[46]=a,t[47]=r,t[48]=o.refresh,t[49]=F):F=t[49];let I;t[50]!==i||t[51]!==c||t[52]!==n||t[53]!==o.revoke?(I=n.revoked?null:(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i,onClick:()=>void c(n,`revoke`),children:[(0,Q.jsx)(Be,{className:`size-3.5`}),o.revoke]}),t[50]=i,t[51]=c,t[52]=n,t[53]=o.revoke,t[54]=I):I=t[54];let L;t[55]!==A||t[56]!==P||t[57]!==F||t[58]!==I?(L=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[A,P,F,I]}),t[55]=A,t[56]=P,t[57]=F,t[58]=I,t[59]=L):L=t[59];let R;return t[60]!==T||t[61]!==f||t[62]!==L?(R=(0,Q.jsxs)(`div`,{className:f,children:[T,L]}),t[60]=T,t[61]=f,t[62]=L,t[63]=R):R=t[63],R}function yt(e){let t=(0,Je.c)(68),{share:n,busy:r,t:i,onCopy:a,onAction:o}=e,s=n.revoked||n.expired,c=s&&`opacity-60`,l;t[0]===c?l=t[1]:(l=m(`rounded-lg border border-edge-subtle p-3`,c),t[0]=c,t[1]=l);let u=n.stale&&!s?i.stale:s?i.inactive:i.active,f;t[2]===u?f=t[3]:(f=(0,Q.jsx)(`span`,{children:u}),t[2]=u,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`span`,{children:`·`}),t[4]=p):p=t[4];let h=n.maxViews===null?``:` / ${n.maxViews}`,g;t[5]!==n.viewCount||t[6]!==i.views||t[7]!==h?(g=(0,Q.jsxs)(`span`,{children:[i.views,` `,n.viewCount,h]}),t[5]=n.viewCount,t[6]=i.views,t[7]=h,t[8]=g):g=t[8];let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(`span`,{children:`·`}),t[9]=_):_=t[9];let v;t[10]===n.expiresAt?v=t[11]:(v=new Date(n.expiresAt).toLocaleDateString(),t[10]=n.expiresAt,t[11]=v);let y;t[12]===v?y=t[13]:(y=(0,Q.jsx)(`span`,{children:v}),t[12]=v,t[13]=y);let b;t[14]!==y||t[15]!==f||t[16]!==g?(b=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[f,p,g,_,y]}),t[14]=y,t[15]=f,t[16]=g,t[17]=b):b=t[17];let x;t[18]===n.shareUrl?x=t[19]:(x=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[18]=n.shareUrl,t[19]=x);let S;t[20]!==b||t[21]!==x?(S=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[b,x]}),t[20]=b,t[21]=x,t[22]=S):S=t[22];let C;t[23]===r?C=t[24]:(C=r?(0,Q.jsx)(Te,{className:`size-4 animate-spin text-fg-muted`}):null,t[23]=r,t[24]=C);let w;t[25]!==S||t[26]!==C?(w=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,C]}),t[25]=S,t[26]=C,t[27]=w):w=t[27];let T;t[28]!==a||t[29]!==n.shareUrl?(T=()=>void a(n.shareUrl),t[28]=a,t[29]=n.shareUrl,t[30]=T):T=t[30];let E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(d,{className:`size-3.5`}),t[31]=E):E=t[31];let D;t[32]!==i.copy||t[33]!==T?(D=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:T,children:[E,i.copy]}),t[32]=i.copy,t[33]=T,t[34]=D):D=t[34];let O;t[35]===n.shareUrl?O=t[36]:(O=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=O);let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(De,{className:`size-3.5`}),t[37]=A):A=t[37];let j;t[38]!==i.open||t[39]!==O?(j=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:O,children:[A,i.open]}),t[38]=i.open,t[39]=O,t[40]=j):j=t[40];let M;t[41]!==r||t[42]!==s||t[43]!==o||t[44]!==n||t[45]!==i.refresh?(M=n.stale&&!s?(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`refresh`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),i.refresh]}):null,t[41]=r,t[42]=s,t[43]=o,t[44]=n,t[45]=i.refresh,t[46]=M):M=t[46];let N;t[47]!==r||t[48]!==s||t[49]!==o||t[50]!==n||t[51]!==i.extend?(N=s?null:(0,Q.jsx)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`extend`),children:i.extend}),t[47]=r,t[48]=s,t[49]=o,t[50]=n,t[51]=i.extend,t[52]=N):N=t[52];let P;t[53]!==r||t[54]!==o||t[55]!==n||t[56]!==i.revoke?(P=n.revoked?null:(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`revoke`),children:[(0,Q.jsx)(Be,{className:`size-3.5`}),i.revoke]}),t[53]=r,t[54]=o,t[55]=n,t[56]=i.revoke,t[57]=P):P=t[57];let F;t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==N||t[62]!==P?(F=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[D,j,M,N,P]}),t[58]=D,t[59]=j,t[60]=M,t[61]=N,t[62]=P,t[63]=F):F=t[63];let I;return t[64]!==w||t[65]!==l||t[66]!==F?(I=(0,Q.jsxs)(`div`,{className:l,children:[w,F]}),t[64]=w,t[65]=l,t[66]=F,t[67]=I):I=t[67],I}function bt(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var xt={title:`分享笔记`,description:`创建一个无需登录即可查看的只读快照。`,close:`关闭`,untitled:`无标题笔记`,empty:`空笔记`,privateExcluded:`不会分享标签、AI 元数据、项目、讨论、历史版本或未引用附件。`,attachments:`包含的附件`,expires:`有效期`,maxViews:`最多查看次数`,unlimited:`不限`,publicDescription:`公开说明(可选)`,create:`创建分享链接`,creating:`创建中…`,copy:`复制`,copied:`已复制`,open:`打开`,activeLinks:`这条笔记的分享`,copyFailed:`无法复制到剪贴板,请手动选择链接并复制。`,delivery:`发布方式`,deliveryHosted:`平台托管(外网稳定访问)`,deliveryLocal:`本机直连(需要隧道或公网部署)`,hostedLinks:`平台托管发布`,revision:`版本`,hostedDisabled:`管理员已暂停你的公网分享能力。已有托管链接当前不可访问,但仍可撤销。`,stale:`旧版本`,inactive:`已失效`,active:`有效`,views:`查看`,refresh:`更新快照`,extend:`延长 24 小时`,revoke:`撤销`},St={title:`Share Note`,description:`Create a read-only snapshot that opens without sign-in.`,close:`Close`,untitled:`Untitled Note`,empty:`Empty Note`,privateExcluded:`Tags, AI metadata, projects, discussions, history, and unreferenced attachments are excluded.`,attachments:`Included attachments`,expires:`Expires`,maxViews:`Maximum views`,unlimited:`Unlimited`,publicDescription:`Public description (optional)`,create:`Create share link`,creating:`Creating…`,copy:`Copy`,copied:`Copied`,open:`Open`,activeLinks:`Shares for this Note`,copyFailed:`Could not copy to the clipboard. Select the link and copy it manually.`,delivery:`Publishing method`,deliveryHosted:`Hosted platform (stable public access)`,deliveryLocal:`Direct from this device (requires public access)`,hostedLinks:`Hosted publications`,revision:`Revision`,hostedDisabled:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but can still be revoked.`,stale:`Older version`,inactive:`Inactive`,active:`Active`,views:`Views`,refresh:`Update snapshot`,extend:`Extend 24 hours`,revoke:`Revoke`};function Ct(e){let t=(0,Je.c)(18),{input:n,labels:r,showLabel:i}=e,a=i===void 0?!0:i,o;t[0]===n?o=t[1]:(o=n(),t[0]=n,t[1]=o);let s=o.source.id,c;t[2]===s?c=t[3]:(c=e=>e.source?.type===`note`&&e.source.id===s&&e.status!==`idle`,t[2]=s,t[3]=c);let l=Ve(c),u;t[4]===s?u=t[5]:(u=e=>e.source?.type===`note`&&e.source.id===s&&e.status===`preparing`,t[4]=s,t[5]=u);let d=Ve(u),f=Ve(wt),p;t[6]!==n||t[7]!==r||t[8]!==d||t[9]!==a?(p=(0,Q.jsx)(we,{input:n,labels:r,disabled:d,showLabel:a}),t[6]=n,t[7]=r,t[8]=d,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==l||t[12]!==r||t[13]!==f?(m=l?(0,Q.jsx)(`button`,{type:`button`,onClick:f,title:r.stop,"aria-label":r.stop,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(Se,{className:`size-3.5`,"aria-hidden":!0})}):null,t[11]=l,t[12]=r,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function wt(e){return e.stop}function Tt(e,t){let n=Me(t.replace(/^\s*(`{3,}|~{3,})[^\n]*$/gm,``).replace(/xopc-attachment:\/\/[^\s)]+/g,``).replace(/^(\s*[-*+]\s+)\[[ xX]\]\s*/gm,`$1`)),r=Me(e);return!r||n.split(`
|
|
3
3
|
`)[0]===r?n:[r,n].filter(Boolean).join(`
|
|
4
4
|
|
|
5
|
-
`)}var Et=()=>i(()=>import(`./block-editor-DvzZkMG8.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])),Dt=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([49,1,46,5,50,51,3])),Ot=(0,Z.lazy)(()=>Et().then(e=>({default:e.BlockEditor}))),kt=(0,Z.lazy)(()=>Dt().then(e=>({default:e.MarkdownEditor})));function At(){let e=(0,Je.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function jt(e){let t=(0,Je.c)(29),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:ue},t[0]=i.edit,t[1]=a);let o;t[2]===i.source?o=t[3]:(o={id:`source`,label:i.source,Icon:Ae},t[2]=i.source,t[3]=o);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:Le},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==o||t[8]!==c?(l=[a,o,c],t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9];let u=l,d;t[10]!==n||t[11]!==u?(d=u.find(e=>e.id===n)??u[0],t[10]=n,t[11]=u,t[12]=d):d=t[12];let f=d,p=f.Icon,m=Mt,h;t[13]===p?h=t[14]:(h=(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),t[13]=p,t[14]=h);let g;t[15]===f.label?g=t[16]:(g=(0,Q.jsx)(`span`,{children:f.label}),t[15]=f.label,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(B,{className:`size-3 text-fg-subtle`,"aria-hidden":!0}),t[17]=_):_=t[17];let v;t[18]!==f.label||t[19]!==h||t[20]!==g?(v=(0,Q.jsx)(He,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":f.label,className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-edge px-2.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g,_]})}),t[18]=f.label,t[19]=h,t[20]=g,t[21]=v):v=t[21];let y;t[22]!==n||t[23]!==u||t[24]!==r?(y=(0,Q.jsx)(We,{children:(0,Q.jsx)(Ge,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,Q.jsxs)(ye,{onSelect:()=>r(t),onPointerMove:()=>m(t),onFocus:()=>m(t),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(a,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:i}),n===t?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]},t)})})}),t[22]=n,t[23]=u,t[24]=r,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==v?(b=(0,Q.jsxs)(fe,{modal:!1,children:[v,y]}),t[26]=y,t[27]=v,t[28]=b):b=t[28],b}function Mt(e){e===`wysiwyg`&&Et(),e===`source`&&Dt()}function Nt(e){let t=(0,Je.c)(16),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,initialMode:u,onAutoFocusConsumed:d}=e,f=a===void 0?!0:a,p=s===void 0?!0:s,m=l===void 0?!1:l,h=_(Pt),g;t[0]===h?g=t[1]:(g=y(h),t[0]=h,t[1]=g);let v=g.notes.lightboxClose,b;t[2]!==m||t[3]!==o||t[4]!==p||t[5]!==u||t[6]!==n||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==i||t[11]!==f?(b=(0,Q.jsx)(Ft,{noteId:n,onBack:r,onSaved:i,showBackButton:f,backButtonClassName:o,clearHeaderOnCleanup:p,onOpenSearch:c,autoFocus:m,initialMode:u,onAutoFocusConsumed:d}),t[2]=m,t[3]=o,t[4]=p,t[5]=u,t[6]=n,t[7]=d,t[8]=r,t[9]=c,t[10]=i,t[11]=f,t[12]=b):b=t[12];let x;return t[13]!==v||t[14]!==b?(x=(0,Q.jsx)(Qe,{closeLabel:v,children:b}),t[13]=v,t[14]=b,t[15]=x):x=t[15],x}function Pt(e){return e.language}function Ft({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:o=!0,onOpenSearch:c,autoFocus:l=!1,initialMode:u=`wysiwyg`,onAutoFocusConsumed:d}){let f=_(e=>e.language),p=y(f).notes,h=y(f).automations.suggestions,{data:g}=O([`note-discussion-document`,e],()=>de(e)),[v,b]=(0,Z.useState)(!0),x=a(),S=A(e=>e.resolved)===`dark`,{openImage:C}=Xe(),[w,T]=(0,Z.useState)(u),[E,D]=(0,Z.useState)(null),[k,j]=(0,Z.useState)(null),[M,L]=(0,Z.useState)(!1),[R,ee]=(0,Z.useState)(``),[ne,ie]=(0,Z.useState)(360),[B,oe]=(0,Z.useState)(!1),[se,ce]=(0,Z.useState)(!1),[V,ue]=(0,Z.useState)(!1),[pe,U]=(0,Z.useState)(null),[me,he]=(0,Z.useState)(!1),[ge,be]=(0,Z.useState)(null),[xe,Se]=(0,Z.useState)(!1),[we,Te]=(0,Z.useState)(!1),De=(0,Z.useRef)(!1),Oe=(0,Z.useRef)(!1),K=(0,Z.useRef)(null),q=(0,Z.useRef)(null),J=(0,Z.useRef)(null),Ae=(0,Z.useRef)(null),je=(0,Z.useRef)(null),Me=(0,Z.useRef)(null),Ne=(0,Z.useRef)(null),Pe=(0,Z.useRef)(null),Fe=(0,Z.useRef)(null),Le=Ce(e=>e.setPageHeader),Re=Ce(e=>e.clearPageHeader),{data:Y,mutate:X,error:Ke}=O(e?[`note-detail`,e]:null,()=>N(e)),{data:Je=[],mutate:Ye}=O(e?[`note-threads`,e]:null,()=>re(e),{revalidateOnFocus:!1}),Ze=k!==null,Qe=(0,Z.useCallback)(e=>{U(`${p.refreshFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)},[p.quickCaptureFailedHint,p.refreshFailed]);(0,Z.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&X().catch(Qe)};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[X,e,Qe]),(0,Z.useEffect)(()=>{De.current=!1,ee(``),j(null),D(null),Oe.current=!1,Fe.current=null},[e]),(0,Z.useEffect)(()=>{!Y||De.current||(ee(Y.title??``),De.current=!0)},[Y]),(0,Z.useEffect)(()=>{if(!l||!Y||Ze||Fe.current===e)return;let t=window.requestAnimationFrame(()=>{Pe.current?.focus(),d?.()});return Fe.current=e,()=>window.cancelAnimationFrame(t)},[l,Ze,Y,e,d]);let $e=Y?new Date(Y.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,et=(0,Z.useMemo)(()=>r?(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":p.back,className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,F,i),children:(0,Q.jsx)(_e,{className:`size-4`,"aria-hidden":!0})}):null,[i,p.back,t,r]),$=(0,Z.useCallback)(()=>{let t=Ve.getState();t.source?.type===`note`&&t.source.id===e&&t.stop()},[e]),tt=(0,Z.useCallback)(e=>{e!==`preview`&&$(),T(e)},[$]),nt=(0,Z.useCallback)(t=>{$(),ee(t),e&&(Ae.current=t,q.current&&clearTimeout(q.current),q.current=setTimeout(async()=>{let t=Ae.current;if(Ae.current=null,t!==null){L(!0);try{await te(e,{title:t}),await X(),n?.()}catch{}finally{L(!1)}}},600))},[$,e,X,n]),rt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-2`,F),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:R||$e||void 0,children:R||$e}),M?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:p.saving}):null]}),[p.saving,M,$e,R]),it=(0,Z.useCallback)(async(t=!1)=>{ue(!0),U(null);try{let n=await qe(e,{forceNew:t});await X(),await Ye(),x(`/chat/${encodeURIComponent(n.conversationId)}`)}catch(e){U(`${p.chatOpenFailedTitle}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{ue(!1)}},[X,Ye,x,e,p.chatOpenFailedMessage,p.chatOpenFailedTitle]),ot=(0,Z.useCallback)(async()=>{ce(!0),U(null);try{await H(e),await X()}catch(e){U(`${p.catalysisFailed}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{ce(!1)}},[X,e]),st=(0,Z.useCallback)(()=>{D(E===`breakdown`?null:`breakdown`),!Y?.aiDeep?.catalysis?.report&&!se&&ot()},[E,se,ot,Y?.aiDeep?.catalysis?.report]),ct=(0,Z.useCallback)(()=>{let t=k?k.markdown??``:J.current??Y?.markdown??``,n=k?k.title??``:R,r=Tt(n,t);return{source:{type:`note`,id:e,title:n||p.titlePlaceholder},text:r,language:Ie(r,f)}},[f,p.titlePlaceholder,Y?.markdown,e,k,R]),lt=(0,Z.useCallback)(async()=>{K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current),K.current=null,q.current=null;let t=J.current,r=Ae.current;J.current=null,Ae.current=null;let i={};if(t!==null&&(i.markdown=t),r!==null&&(i.title=r),Object.keys(i).length===0)return Y??null;L(!0);try{let t=await te(e,i);return await X(t,{revalidate:!1}),n?.(),t}catch(e){return U(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`),null}finally{L(!1)}},[X,p.saveFailed,p.saveFailedHint,Y,e,n]),ut=(0,Z.useCallback)(async()=>{U(null);let e=await lt();e&&(be(e),he(!0))},[lt]),ft=(0,Z.useCallback)(async()=>{if(!(we||M)){Se(!1),Te(!0),U(null),$(),K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current),K.current=null,q.current=null,J.current=null,Ae.current=null;try{await ke(e),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e}})),n?.(),t()}catch(e){U(`${p.deleteFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}finally{Te(!1)}}},[we,p.deleteFailed,p.quickCaptureFailedHint,e,t,n,M,$]),pt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-1 sm:gap-2`,F),children:[c?(0,Q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":p.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(I,{className:`size-4`,"aria-hidden":!0})}):null,(0,Q.jsx)(Ct,{input:ct,showLabel:!1,labels:{read:p.readAloud,preparing:p.readAloudPreparing,pause:p.readAloudPause,resume:p.readAloudResume,retry:p.readAloudRetry,stop:p.readAloudStop}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:st,disabled:se,"aria-label":p.catalysisSectionTitle,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,E===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:se?p.catalyzing:p.catalyzeButton})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>it(!1),"aria-label":p.openChatButton,disabled:V,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,Q.jsx)(ze,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:V?p.openingChat:p.openChatButton})]}),(0,Q.jsx)(jt,{mode:w,onModeChange:tt,labels:{edit:p.modeEdit,source:p.modeSource,preview:p.modePreview}}),(0,Q.jsxs)(fe,{modal:!1,children:[(0,Q.jsx)(He,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":p.noteActions,title:p.noteActions,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(ve,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(We,{children:(0,Q.jsxs)(Ge,{align:`end`,sideOffset:6,className:`z-50 min-w-40 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(ye,{onSelect:()=>void ut(),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Ue,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),f===`zh`?`分享`:`Share`]}),(0,Q.jsxs)(ye,{onSelect:()=>D(E===`history`?null:`history`),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(z,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:p.history}),E===`history`?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]}),(0,Q.jsx)(P,{className:`my-1 h-px bg-edge-subtle`}),(0,Q.jsxs)(ye,{disabled:we||M,onSelect:()=>Se(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,Q.jsx)(Be,{className:`size-4`,"aria-hidden":!0}),p.delete]})]})})]})]}),[se,st,it,w,p.history,p.modeEdit,p.modePreview,p.modeSource,V,E,c,p.searchDialogTitle,p.readAloud,p.readAloudPause,p.readAloudPreparing,p.readAloudResume,p.readAloudRetry,p.readAloudStop,tt,ct,ut,we,M,f,p.delete,Se]);(0,Z.useLayoutEffect)(()=>(Le({startExtra:et,main:Y?rt:null,end:Y?pt:null}),()=>{o&&Re()}),[o,Re,pt,rt,et,Y,Le]);let gt=(0,Z.useCallback)(t=>{e&&($(),J.current=t,K.current&&clearTimeout(K.current),K.current=setTimeout(async()=>{let t=J.current;if(J.current=null,t!==null){L(!0),U(null);try{await te(e,{markdown:t}),await X(),n?.()}catch(e){U(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`)}finally{L(!1)}}},600))},[$,e,X,p.saveFailed,p.saveFailedHint,n]),vt=(0,Z.useCallback)(t=>{ae(e,t.timestamp).then(e=>{e&&($(),j(e))})},[e,$]),yt=(0,Z.useCallback)(()=>{$(),D(null),j(null)},[$]),bt=(0,Z.useCallback)(()=>{$(),D(null),j(null),X().catch(Qe),n?.()},[X,n,Qe,$]);if((0,Z.useEffect)(()=>()=>{K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current);let t=J.current,n=Ae.current;J.current=null,Ae.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&te(e,r).catch(()=>void 0)},[e]),Y===void 0)return Ke?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:p.home.loadFailed}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void X().catch(Qe),className:`rounded-lg border border-edge px-3 py-2 text-sm text-fg hover:bg-surface-hover`,children:p.home.retry}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-fg-muted hover:text-fg`,children:p.back})]}):(0,Q.jsx)(At,{});if(Y===null)return(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:p.notFoundTitle}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:p.notFoundDescription}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:p.back})]});let xt=Ze?k.title??``:R,St=Ze?k.markdown??``:J.current??Y.markdown??``,wt=new Date(Y.createdAt).getTime(),Et=Number.isFinite(wt)&&Date.now()-wt<3600*1e3?(0,Q.jsx)(at,{title:h.noteCreatedTitle,description:h.noteCreatedDescription,prompt:h.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[pe?(0,Q.jsx)(`p`,{className:`mb-3 shrink-0 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:pe}):null,(0,Q.jsx)(G,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsx)(G,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),g?(0,Q.jsxs)(`div`,{className:`mb-2 flex shrink-0 gap-4 text-sm`,children:[(0,Q.jsx)(`button`,{className:v?`text-accent-fg`:`text-fg-muted`,onClick:()=>b(!0),children:f===`zh`?`会议`:`Meeting`}),(0,Q.jsx)(`button`,{className:v?`text-fg-muted`:`text-accent-fg`,onClick:()=>b(!1),children:f===`zh`?`我的笔记`:`My notes`})]}):null,(0,Q.jsxs)(`div`,{ref:je,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel xl:flex-row`,children:[g&&v?(0,Q.jsx)(dt,{noteId:e}):null,(0,Q.jsx)(`div`,{className:g&&v?`hidden`:`min-h-0 min-w-0 flex-1`,children:Ze?(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,children:[xt&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:xt}),St?(0,Q.jsx)(W,{noteId:e,content:St,className:`opacity-80`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]}):(0,Q.jsxs)(Q.Fragment,{children:[w===`wysiwyg`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Pe,type:`text`,value:R,onChange:e=>nt(e.target.value),onCompositionStart:()=>{Oe.current=!0},onCompositionEnd:()=>{Oe.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!Oe.current&&!t.isComposing&&(e.preventDefault(),(je.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Et]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(At,{}),children:(0,Q.jsx)(Ot,{initialContent:Y.markdown??``,onChange:gt,noteId:e},`wysiwyg-${e}`)})})]}),w===`source`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Pe,type:`text`,value:R,onChange:e=>nt(e.target.value),placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Et]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(At,{}),children:(0,Q.jsx)(kt,{initialContent:Y.markdown??``,onChange:gt,isDark:S},`source-${e}`)})})]}),w===`preview`&&(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&C(t.currentSrc||t.src,t.alt)},children:[R&&!Y.markdown.trimStart().startsWith(`# ${R.trim()}\n`)&&Y.markdown.trim()!==`# ${R.trim()}`&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:R}),Y.markdown?(0,Q.jsx)(W,{noteId:e,content:Y.markdown,className:`[&_img]:cursor-zoom-in`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]})]})})]})]}),(0,Q.jsx)(`div`,{ref:Me,className:m(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!B&&`transition-[width] duration-300 ease-in-out`),style:{width:E?ne:0},children:(0,Q.jsxs)(`div`,{ref:Ne,className:`flex min-h-0 flex-1 flex-col`,style:{width:ne},children:[(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),oe(!0);let n=e.clientX,r=ne,i=e.pointerId,a=0,o=ne,s=ne,c=()=>{a=0,s=o,E&&Me.current?.style.setProperty(`width`,`${s}px`),Ne.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}oe(!1),ie(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:m(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,B&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:E===`history`?(0,Q.jsx)(mt,{noteId:e,activeTimestamp:k?.timestamp??null,onSelect:vt,onClose:yt,onRestored:bt}):E===`breakdown`?(0,Q.jsx)(ht,{noteId:e,note:Y??null,catalyzing:se,onCatalyze:ot,onClose:()=>D(null),noteThreads:Je,openingChat:V,onOpenChat:()=>it(!1),onOpenNewChat:()=>it(!0)}):null})]})})]}),ge?(0,Q.jsx)(_t,{open:me,onOpenChange:he,note:ge}):null,(0,Q.jsx)(le,{open:xe,title:p.deleteConfirmTitle,description:p.deleteConfirmDescription.replace(`{{title}}`,Y.title||p.titlePlaceholder),confirmLabel:p.deleteConfirmLabel,cancelLabel:p.deleteCancelLabel,destructive:!0,onConfirm:()=>void ft(),onCancel:()=>Se(!1)})]})}export{Xe as a,nt as i,it as n,rt as r,Nt as t};
|
|
5
|
+
`)}var Et=()=>i(()=>import(`./block-editor-D0LDiOTT.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])),Dt=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([49,1,46,5,50,51,3])),Ot=(0,Z.lazy)(()=>Et().then(e=>({default:e.BlockEditor}))),kt=(0,Z.lazy)(()=>Dt().then(e=>({default:e.MarkdownEditor})));function At(){let e=(0,Je.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function jt(e){let t=(0,Je.c)(29),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:ue},t[0]=i.edit,t[1]=a);let o;t[2]===i.source?o=t[3]:(o={id:`source`,label:i.source,Icon:Ae},t[2]=i.source,t[3]=o);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:Le},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==o||t[8]!==c?(l=[a,o,c],t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9];let u=l,d;t[10]!==n||t[11]!==u?(d=u.find(e=>e.id===n)??u[0],t[10]=n,t[11]=u,t[12]=d):d=t[12];let f=d,p=f.Icon,m=Mt,h;t[13]===p?h=t[14]:(h=(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),t[13]=p,t[14]=h);let g;t[15]===f.label?g=t[16]:(g=(0,Q.jsx)(`span`,{children:f.label}),t[15]=f.label,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(B,{className:`size-3 text-fg-subtle`,"aria-hidden":!0}),t[17]=_):_=t[17];let v;t[18]!==f.label||t[19]!==h||t[20]!==g?(v=(0,Q.jsx)(He,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":f.label,className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-edge px-2.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g,_]})}),t[18]=f.label,t[19]=h,t[20]=g,t[21]=v):v=t[21];let y;t[22]!==n||t[23]!==u||t[24]!==r?(y=(0,Q.jsx)(We,{children:(0,Q.jsx)(Ge,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,Q.jsxs)(ye,{onSelect:()=>r(t),onPointerMove:()=>m(t),onFocus:()=>m(t),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(a,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:i}),n===t?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]},t)})})}),t[22]=n,t[23]=u,t[24]=r,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==v?(b=(0,Q.jsxs)(fe,{modal:!1,children:[v,y]}),t[26]=y,t[27]=v,t[28]=b):b=t[28],b}function Mt(e){e===`wysiwyg`&&Et(),e===`source`&&Dt()}function Nt(e){let t=(0,Je.c)(16),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,initialMode:u,onAutoFocusConsumed:d}=e,f=a===void 0?!0:a,p=s===void 0?!0:s,m=l===void 0?!1:l,h=_(Pt),g;t[0]===h?g=t[1]:(g=y(h),t[0]=h,t[1]=g);let v=g.notes.lightboxClose,b;t[2]!==m||t[3]!==o||t[4]!==p||t[5]!==u||t[6]!==n||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==i||t[11]!==f?(b=(0,Q.jsx)(Ft,{noteId:n,onBack:r,onSaved:i,showBackButton:f,backButtonClassName:o,clearHeaderOnCleanup:p,onOpenSearch:c,autoFocus:m,initialMode:u,onAutoFocusConsumed:d}),t[2]=m,t[3]=o,t[4]=p,t[5]=u,t[6]=n,t[7]=d,t[8]=r,t[9]=c,t[10]=i,t[11]=f,t[12]=b):b=t[12];let x;return t[13]!==v||t[14]!==b?(x=(0,Q.jsx)(Qe,{closeLabel:v,children:b}),t[13]=v,t[14]=b,t[15]=x):x=t[15],x}function Pt(e){return e.language}function Ft({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:o=!0,onOpenSearch:c,autoFocus:l=!1,initialMode:u=`wysiwyg`,onAutoFocusConsumed:d}){let f=_(e=>e.language),p=y(f).notes,h=y(f).automations.suggestions,{data:g}=O([`note-discussion-document`,e],()=>de(e)),[v,b]=(0,Z.useState)(!0),x=a(),S=A(e=>e.resolved)===`dark`,{openImage:C}=Xe(),[w,T]=(0,Z.useState)(u),[E,D]=(0,Z.useState)(null),[k,j]=(0,Z.useState)(null),[M,L]=(0,Z.useState)(!1),[R,ee]=(0,Z.useState)(``),[ne,ie]=(0,Z.useState)(360),[B,oe]=(0,Z.useState)(!1),[se,ce]=(0,Z.useState)(!1),[V,ue]=(0,Z.useState)(!1),[pe,U]=(0,Z.useState)(null),[me,he]=(0,Z.useState)(!1),[ge,be]=(0,Z.useState)(null),[xe,Se]=(0,Z.useState)(!1),[we,Te]=(0,Z.useState)(!1),De=(0,Z.useRef)(!1),Oe=(0,Z.useRef)(!1),K=(0,Z.useRef)(null),q=(0,Z.useRef)(null),J=(0,Z.useRef)(null),Ae=(0,Z.useRef)(null),je=(0,Z.useRef)(null),Me=(0,Z.useRef)(null),Ne=(0,Z.useRef)(null),Pe=(0,Z.useRef)(null),Fe=(0,Z.useRef)(null),Le=Ce(e=>e.setPageHeader),Re=Ce(e=>e.clearPageHeader),{data:Y,mutate:X,error:Ke}=O(e?[`note-detail`,e]:null,()=>N(e)),{data:Je=[],mutate:Ye}=O(e?[`note-threads`,e]:null,()=>re(e),{revalidateOnFocus:!1}),Ze=k!==null,Qe=(0,Z.useCallback)(e=>{U(`${p.refreshFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)},[p.quickCaptureFailedHint,p.refreshFailed]);(0,Z.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&X().catch(Qe)};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[X,e,Qe]),(0,Z.useEffect)(()=>{De.current=!1,ee(``),j(null),D(null),Oe.current=!1,Fe.current=null},[e]),(0,Z.useEffect)(()=>{!Y||De.current||(ee(Y.title??``),De.current=!0)},[Y]),(0,Z.useEffect)(()=>{if(!l||!Y||Ze||Fe.current===e)return;let t=window.requestAnimationFrame(()=>{Pe.current?.focus(),d?.()});return Fe.current=e,()=>window.cancelAnimationFrame(t)},[l,Ze,Y,e,d]);let $e=Y?new Date(Y.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,et=(0,Z.useMemo)(()=>r?(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":p.back,className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,F,i),children:(0,Q.jsx)(_e,{className:`size-4`,"aria-hidden":!0})}):null,[i,p.back,t,r]),$=(0,Z.useCallback)(()=>{let t=Ve.getState();t.source?.type===`note`&&t.source.id===e&&t.stop()},[e]),tt=(0,Z.useCallback)(e=>{e!==`preview`&&$(),T(e)},[$]),nt=(0,Z.useCallback)(t=>{$(),ee(t),e&&(Ae.current=t,q.current&&clearTimeout(q.current),q.current=setTimeout(async()=>{let t=Ae.current;if(Ae.current=null,t!==null){L(!0);try{await te(e,{title:t}),await X(),n?.()}catch{}finally{L(!1)}}},600))},[$,e,X,n]),rt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-2`,F),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:R||$e||void 0,children:R||$e}),M?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:p.saving}):null]}),[p.saving,M,$e,R]),it=(0,Z.useCallback)(async(t=!1)=>{ue(!0),U(null);try{let n=await qe(e,{forceNew:t});await X(),await Ye(),x(`/chat/${encodeURIComponent(n.conversationId)}`)}catch(e){U(`${p.chatOpenFailedTitle}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{ue(!1)}},[X,Ye,x,e,p.chatOpenFailedMessage,p.chatOpenFailedTitle]),ot=(0,Z.useCallback)(async()=>{ce(!0),U(null);try{await H(e),await X()}catch(e){U(`${p.catalysisFailed}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{ce(!1)}},[X,e]),st=(0,Z.useCallback)(()=>{D(E===`breakdown`?null:`breakdown`),!Y?.aiDeep?.catalysis?.report&&!se&&ot()},[E,se,ot,Y?.aiDeep?.catalysis?.report]),ct=(0,Z.useCallback)(()=>{let t=k?k.markdown??``:J.current??Y?.markdown??``,n=k?k.title??``:R,r=Tt(n,t);return{source:{type:`note`,id:e,title:n||p.titlePlaceholder},text:r,language:Ie(r,f)}},[f,p.titlePlaceholder,Y?.markdown,e,k,R]),lt=(0,Z.useCallback)(async()=>{K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current),K.current=null,q.current=null;let t=J.current,r=Ae.current;J.current=null,Ae.current=null;let i={};if(t!==null&&(i.markdown=t),r!==null&&(i.title=r),Object.keys(i).length===0)return Y??null;L(!0);try{let t=await te(e,i);return await X(t,{revalidate:!1}),n?.(),t}catch(e){return U(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`),null}finally{L(!1)}},[X,p.saveFailed,p.saveFailedHint,Y,e,n]),ut=(0,Z.useCallback)(async()=>{U(null);let e=await lt();e&&(be(e),he(!0))},[lt]),ft=(0,Z.useCallback)(async()=>{if(!(we||M)){Se(!1),Te(!0),U(null),$(),K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current),K.current=null,q.current=null,J.current=null,Ae.current=null;try{await ke(e),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e}})),n?.(),t()}catch(e){U(`${p.deleteFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}finally{Te(!1)}}},[we,p.deleteFailed,p.quickCaptureFailedHint,e,t,n,M,$]),pt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-1 sm:gap-2`,F),children:[c?(0,Q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":p.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(I,{className:`size-4`,"aria-hidden":!0})}):null,(0,Q.jsx)(Ct,{input:ct,showLabel:!1,labels:{read:p.readAloud,preparing:p.readAloudPreparing,pause:p.readAloudPause,resume:p.readAloudResume,retry:p.readAloudRetry,stop:p.readAloudStop}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:st,disabled:se,"aria-label":p.catalysisSectionTitle,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,E===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:se?p.catalyzing:p.catalyzeButton})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>it(!1),"aria-label":p.openChatButton,disabled:V,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,Q.jsx)(ze,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:V?p.openingChat:p.openChatButton})]}),(0,Q.jsx)(jt,{mode:w,onModeChange:tt,labels:{edit:p.modeEdit,source:p.modeSource,preview:p.modePreview}}),(0,Q.jsxs)(fe,{modal:!1,children:[(0,Q.jsx)(He,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":p.noteActions,title:p.noteActions,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(ve,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(We,{children:(0,Q.jsxs)(Ge,{align:`end`,sideOffset:6,className:`z-50 min-w-40 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(ye,{onSelect:()=>void ut(),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Ue,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),f===`zh`?`分享`:`Share`]}),(0,Q.jsxs)(ye,{onSelect:()=>D(E===`history`?null:`history`),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(z,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:p.history}),E===`history`?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]}),(0,Q.jsx)(P,{className:`my-1 h-px bg-edge-subtle`}),(0,Q.jsxs)(ye,{disabled:we||M,onSelect:()=>Se(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,Q.jsx)(Be,{className:`size-4`,"aria-hidden":!0}),p.delete]})]})})]})]}),[se,st,it,w,p.history,p.modeEdit,p.modePreview,p.modeSource,V,E,c,p.searchDialogTitle,p.readAloud,p.readAloudPause,p.readAloudPreparing,p.readAloudResume,p.readAloudRetry,p.readAloudStop,tt,ct,ut,we,M,f,p.delete,Se]);(0,Z.useLayoutEffect)(()=>(Le({startExtra:et,main:Y?rt:null,end:Y?pt:null}),()=>{o&&Re()}),[o,Re,pt,rt,et,Y,Le]);let gt=(0,Z.useCallback)(t=>{e&&($(),J.current=t,K.current&&clearTimeout(K.current),K.current=setTimeout(async()=>{let t=J.current;if(J.current=null,t!==null){L(!0),U(null);try{await te(e,{markdown:t}),await X(),n?.()}catch(e){U(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`)}finally{L(!1)}}},600))},[$,e,X,p.saveFailed,p.saveFailedHint,n]),vt=(0,Z.useCallback)(t=>{ae(e,t.timestamp).then(e=>{e&&($(),j(e))})},[e,$]),yt=(0,Z.useCallback)(()=>{$(),D(null),j(null)},[$]),bt=(0,Z.useCallback)(()=>{$(),D(null),j(null),X().catch(Qe),n?.()},[X,n,Qe,$]);if((0,Z.useEffect)(()=>()=>{K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current);let t=J.current,n=Ae.current;J.current=null,Ae.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&te(e,r).catch(()=>void 0)},[e]),Y===void 0)return Ke?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:p.home.loadFailed}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void X().catch(Qe),className:`rounded-lg border border-edge px-3 py-2 text-sm text-fg hover:bg-surface-hover`,children:p.home.retry}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-fg-muted hover:text-fg`,children:p.back})]}):(0,Q.jsx)(At,{});if(Y===null)return(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:p.notFoundTitle}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:p.notFoundDescription}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:p.back})]});let xt=Ze?k.title??``:R,St=Ze?k.markdown??``:J.current??Y.markdown??``,wt=new Date(Y.createdAt).getTime(),Et=Number.isFinite(wt)&&Date.now()-wt<3600*1e3?(0,Q.jsx)(at,{title:h.noteCreatedTitle,description:h.noteCreatedDescription,prompt:h.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[pe?(0,Q.jsx)(`p`,{className:`mb-3 shrink-0 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:pe}):null,(0,Q.jsx)(G,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsx)(G,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),g?(0,Q.jsxs)(`div`,{className:`mb-2 flex shrink-0 gap-4 text-sm`,children:[(0,Q.jsx)(`button`,{className:v?`text-accent-fg`:`text-fg-muted`,onClick:()=>b(!0),children:f===`zh`?`会议`:`Meeting`}),(0,Q.jsx)(`button`,{className:v?`text-fg-muted`:`text-accent-fg`,onClick:()=>b(!1),children:f===`zh`?`我的笔记`:`My notes`})]}):null,(0,Q.jsxs)(`div`,{ref:je,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel xl:flex-row`,children:[g&&v?(0,Q.jsx)(dt,{noteId:e}):null,(0,Q.jsx)(`div`,{className:g&&v?`hidden`:`min-h-0 min-w-0 flex-1`,children:Ze?(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,children:[xt&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:xt}),St?(0,Q.jsx)(W,{noteId:e,content:St,className:`opacity-80`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]}):(0,Q.jsxs)(Q.Fragment,{children:[w===`wysiwyg`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Pe,type:`text`,value:R,onChange:e=>nt(e.target.value),onCompositionStart:()=>{Oe.current=!0},onCompositionEnd:()=>{Oe.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!Oe.current&&!t.isComposing&&(e.preventDefault(),(je.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Et]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(At,{}),children:(0,Q.jsx)(Ot,{initialContent:Y.markdown??``,onChange:gt,noteId:e},`wysiwyg-${e}`)})})]}),w===`source`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Pe,type:`text`,value:R,onChange:e=>nt(e.target.value),placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Et]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(At,{}),children:(0,Q.jsx)(kt,{initialContent:Y.markdown??``,onChange:gt,isDark:S},`source-${e}`)})})]}),w===`preview`&&(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&C(t.currentSrc||t.src,t.alt)},children:[R&&!Y.markdown.trimStart().startsWith(`# ${R.trim()}\n`)&&Y.markdown.trim()!==`# ${R.trim()}`&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:R}),Y.markdown?(0,Q.jsx)(W,{noteId:e,content:Y.markdown,className:`[&_img]:cursor-zoom-in`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]})]})})]})]}),(0,Q.jsx)(`div`,{ref:Me,className:m(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!B&&`transition-[width] duration-300 ease-in-out`),style:{width:E?ne:0},children:(0,Q.jsxs)(`div`,{ref:Ne,className:`flex min-h-0 flex-1 flex-col`,style:{width:ne},children:[(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),oe(!0);let n=e.clientX,r=ne,i=e.pointerId,a=0,o=ne,s=ne,c=()=>{a=0,s=o,E&&Me.current?.style.setProperty(`width`,`${s}px`),Ne.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}oe(!1),ie(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:m(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,B&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:E===`history`?(0,Q.jsx)(mt,{noteId:e,activeTimestamp:k?.timestamp??null,onSelect:vt,onClose:yt,onRestored:bt}):E===`breakdown`?(0,Q.jsx)(ht,{noteId:e,note:Y??null,catalyzing:se,onCatalyze:ot,onClose:()=>D(null),noteThreads:Je,openingChat:V,onOpenChat:()=>it(!1),onOpenNewChat:()=>it(!0)}):null})]})})]}),ge?(0,Q.jsx)(_t,{open:me,onOpenChange:he,note:ge}):null,(0,Q.jsx)(le,{open:xe,title:p.deleteConfirmTitle,description:p.deleteConfirmDescription.replace(`{{title}}`,Y.title||p.titlePlaceholder),confirmLabel:p.deleteConfirmLabel,cancelLabel:p.deleteCancelLabel,destructive:!0,onConfirm:()=>void ft(),onCancel:()=>Se(!1)})]})}export{Xe as a,nt as i,it as n,rt as r,Nt as t};
|