@xopcai/xopc 0.0.284 → 0.0.285
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CwbIMGLY.js → activity-store-B0BTIk9j.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DjiOld-S.js → agent-avatar-dicebear-Dc-0QZTQ.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CcmqK1Sc.js +1 -0
- package/dist/gateway/static/root/assets/agents-B_7PVt7S.js +1 -0
- package/dist/gateway/static/root/assets/api-COG_Tzpv.js +1 -0
- package/dist/gateway/static/root/assets/{api-3lphBVuY.js → api-Coly9ab6.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B2nwCXxE.js → app-management-settings-panel-TWBO-msg.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BXO4Ej88.js → appearance-settings-CpTZ2KuT.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-6qxxKFsK.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-6ZRqNjla.js → archive-plugin-z_u6alob.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CmPZalcW.js → attachment-load-C2nS04TC.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Bc3WbK5n.js → automations-page-aIBsw9zR.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BRQlU4qk.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-OWR6cxpc.js → binary-plugins-CGmXoZnl.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Ca-tDQXm.js → block-editor-CtvzCZhC.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Dxy2_p3U.js → browser-automation-inputs-BOTU1isH.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CibQIxpi.js → browser-automations-page-BwU5V8J0.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DDjbDeHQ.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DM1Bcf1x.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-Bq36CUxL.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-Bh-G9mdZ.js → channels-status-swr-Dfi0Desh.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-lbzbSpV3.js → chat-terminal-dock-B0MvcO6j.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-L8JehrxF.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-tYvbTfZT.js → date-picker-DXOvbHCr.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-B8yo7-7V.js → dependency-picker-BEnC-eS0.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BUGkGB4-.js → desktop-pet-DtPNvznL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DNeVGZNp.js → desktop-pet-settings-CYyjcSn6.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-BPMGvAKE.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CiK0QI2p.js → extension-debug-page-H_aPMGXW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CirPNHJd.js → extension-page-C1JnpeMt.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Baua1_Le.js → extension-settings-page-C75kCOqe.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Co4hHe0i.js → gateway-config-swr-G2lQt7Ak.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BCF732TU.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DBPNJG-e.js → gateway-startup-retry-GP31PUrG.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DTM_kYpE.js → heartbeat-settings-C7fjiowt.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DZXeXdUL.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D0rMTumD.js → image-generation-api-CKFhfHSw.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-GROumhj8.js +1 -0
- package/dist/gateway/static/root/assets/{index-C9aQA4Dr.js → index-ChIrvv3t.js} +47 -47
- package/dist/gateway/static/root/assets/index-R1VNlHjj.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CMUaF61L.js → keyboard-shortcuts-settings-zcI822m_.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CAEKGTAg.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CHxyT09t.js → local-apps-page-BtgDJ92Q.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DO6JJ1l2.js → locale-store-DlOv7896.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DHZ4BEkG.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-jXbA2S54.js → management-settings-DasZxCyD.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CKInRsDh.js → markdown-view-6oYdBahT.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BaPkSvW7.js → media-plugins-CxthbBvk.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-BgZRsCkG.js → messages-Ls1Aaiqd.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BcWq3ddw.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-DfZ8QWyv.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CdYemUOu.js → page-tabs-BG39KidE.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DzgF1yYO.js → preview-open-alternatives-Bevpbq9f.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-page-D2U_xQaS.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-iQ-eW6Aj.js → product-open-page-Bi1seZpM.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CzlGTW4F.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-mQsM-TsP.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DMNudT60.js → registry-api-D0ddwBFj.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cb56JcO1.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-u_wVepf7.js → runtime-tools-settings-panel-Wkru8_My.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-YdZj2xdI.js → schema-form-CSMRzj9Y.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Hj9uFcIO.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CV4-_EVA.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Bw6xKOX5.js → settings-form-section-wcAdCkK8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CV8kVdnE.js → settings-page-BcQGAnCs.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DzxmsaQG.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BHwjHlrV.js → share-preview-page-DQocUl-1.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-xlJh1ccG.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-wSXJRSxX.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DRKdb6O5.js → skills-page-AmqtBJo7.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DYfaLtts.js → skills-page.utils-DtlfCgJp.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CWrWpKV-.js → system-settings-panel-Ct698Nf-.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-sQpwq5-c.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-CDc7Wqy5.js → theme-store-ng8KJsAT.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Bmsy-5Fs.js → tunnel-api-Boajol0M.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-D-FRib85.js → use-autosave-BSyxRHt2.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DIEHnAER.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-iQ7EBzII.js → voice-api-key-field-SE3OQI1s.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DNMWA2tx.js → voice-config-api-VNuCmdFe.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BesuhDlH.js → work-discovery-overlay-Dn1vy2oq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Du81FoCy.js → workflow-run-setup-panel-BJEfGY-k.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DgRNIyr7.js +6 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/proactive.js +13 -4
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/coding/workspace-revision.js +1 -1
- package/dist/src/agent/commands/command-isolation.js +1 -1
- package/dist/src/agent/tools/factory.js +7 -3
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +10 -2
- package/dist/src/cli/command-manifest.js +2 -2
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +2 -2
- package/dist/src/cli/commands/gateway/run-foreground.js +3 -0
- package/dist/src/cli/commands/import.js +54 -6
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/platform.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/index.js +1 -1
- package/dist/src/discussions/action-tasks.js +1 -1
- package/dist/src/discussions/edits.js +1 -1
- package/dist/src/discussions/index.js +1 -1
- package/dist/src/discussions/organizer.js +1 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/discussions/service.js +2 -2
- package/dist/src/endpoint-tools/invocation-service.d.ts +2 -0
- package/dist/src/endpoint-tools/invocation-service.js +48 -19
- package/dist/src/gateway/heartbeat/check-store.d.ts +18 -0
- package/dist/src/gateway/heartbeat/check-store.js +73 -0
- package/dist/src/gateway/heartbeat/service.d.ts +12 -3
- package/dist/src/gateway/heartbeat/service.js +62 -45
- package/dist/src/gateway/hono/routes/discussions.js +2 -2
- package/dist/src/gateway/hono/routes/imports.js +18 -6
- package/dist/src/gateway/hono/routes/proactive-control.js +2 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service.d.ts +7 -0
- package/dist/src/gateway/service.js +24 -9
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/imports/importService.d.ts +17 -12
- package/dist/src/imports/importService.js +67 -70
- package/dist/src/imports/inventory.d.ts +11 -0
- package/dist/src/imports/inventory.js +202 -0
- package/dist/src/imports/productImport.d.ts +4 -4
- package/dist/src/imports/productImport.js +201 -108
- package/dist/src/imports/runtime.js +7 -2
- package/dist/src/imports/scanner.d.ts +1 -1
- package/dist/src/imports/scanner.js +4 -4
- package/dist/src/imports/types.d.ts +53 -0
- package/dist/src/infra/background-task.d.ts +2 -0
- package/dist/src/infra/background-task.js +25 -0
- package/dist/src/infra/process-diagnostics.d.ts +5 -0
- package/dist/src/infra/process-diagnostics.js +97 -0
- package/dist/src/infra/unhandled-rejections.js +6 -3
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/knowledge/ingestion-service.js +1 -0
- package/dist/src/media-shared/http/ssrf-guard.js +1 -1
- package/dist/src/notifications/proactive-policy.js +7 -5
- package/dist/src/proactive/execution/authorization.d.ts +2 -0
- package/dist/src/proactive/execution/authorization.js +10 -1
- package/dist/src/proactive/execution/context.js +1 -0
- package/dist/src/proactive/execution/repository.d.ts +2 -0
- package/dist/src/proactive/execution/repository.js +19 -2
- package/dist/src/proactive/execution/worker.js +14 -4
- package/dist/src/proactive/experience.d.ts +4 -1
- package/dist/src/proactive/experience.js +3 -0
- package/dist/src/proactive/follow-ups.d.ts +5 -0
- package/dist/src/proactive/follow-ups.js +18 -7
- package/dist/src/proactive/inbox/cards.js +2 -1
- package/dist/src/proactive/inbox/delivery.js +6 -7
- package/dist/src/proactive/inbox/digest.d.ts +1 -1
- package/dist/src/proactive/inbox/digest.js +23 -13
- package/dist/src/proactive/inbox/notification-policy.d.ts +1 -1
- package/dist/src/proactive/inbox/notification-policy.js +9 -6
- package/dist/src/proactive/inbox/repository.js +3 -2
- package/dist/src/proactive/inbox/service.d.ts +6 -0
- package/dist/src/proactive/inbox/service.js +18 -0
- package/dist/src/proactive/inbox/types.d.ts +1 -0
- package/dist/src/proactive/policy/presence.d.ts +1 -1
- package/dist/src/proactive/policy/presence.js +7 -5
- package/dist/src/proactive/policy/service.d.ts +8 -5
- package/dist/src/proactive/policy/service.js +12 -12
- package/dist/src/proactive/scenarios/control.d.ts +3 -3
- package/dist/src/proactive/scenarios/control.js +12 -2
- package/dist/src/proactive/source-freshness.d.ts +8 -0
- package/dist/src/proactive/source-freshness.js +27 -0
- package/dist/src/proactive/status.d.ts +2 -0
- package/dist/src/proactive/status.js +21 -0
- package/dist/src/proactive/temporal/worker.js +2 -1
- package/dist/src/realtime/runtime.js +31 -5
- package/dist/src/realtime/writer.js +16 -9
- package/dist/src/storage/sqlite/import-repository.d.ts +2 -3
- package/dist/src/storage/sqlite/import-repository.js +3 -3
- package/dist/src/storage/sqlite/import-selection-repository.d.ts +15 -0
- package/dist/src/storage/sqlite/import-selection-repository.js +28 -0
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +2 -2
- package/dist/src/storage/sqlite/migrations/175_import_selections.sql +8 -0
- package/dist/src/storage/sqlite/migrations/176_proactive_quality.sql +5 -0
- package/dist/src/storage/sqlite/migrations/177_proactive_check_controls.sql +25 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/work-discovery/candidate-discovery.js +1 -1
- package/dist/src/work-discovery/probe.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D9qP10BK.js +0 -1
- package/dist/gateway/static/root/assets/agents-D-bkOuAl.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BKwBBwJN.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B2-f9qZu.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Dtn4rMeq.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DiwtR9MD.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-pTdR1q1K.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BSQ7Hs2w.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-CYkT7ecp.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CzpSYWex.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CSSJvdd6.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-XqVVYbAp.js +0 -1
- package/dist/gateway/static/root/assets/index-B_Sg5BKz.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-CZSgTYuI.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-z5ktnEzX.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-DSaZfkna.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CePEyv_C.js +0 -8
- package/dist/gateway/static/root/assets/proactive-page-Cy2Gm2f8.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BliwYpns.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Dm-BqnQn.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C_XuQ9XR.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Drt1aS2G.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BAUd06_9.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BHI9e5Tw.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DOAOjZBQ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DU0VQpHj.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DiPgMmBM.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DxRaRdA0.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CZikdgNw.js +0 -6
|
@@ -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{t as i}from"./cn-JdwAhgNB.js";import{n as a}from"./locale-store-DO6JJ1l2.js";import{t as o}from"./messages-BgZRsCkG.js";import{t as s}from"./electron-env-DH5wF8X8.js";import{ai as c,an as l,ci as u,ii as d,li as f,oi as p,si as m,ui as h}from"./index-C9aQA4Dr.js";import{n as g,r as _}from"./settings-page-layout-DYelDcMV.js";var v=n(),y=e(t(),1),b=r(),x=m(),S=x?`⌘`:`Ctrl`;function C(e){let t=(0,v.c)(54),{title:n,description:r,shortcut:s,otherShortcut:c,defaultShortcut:d,setShortcut:p,legacyRecordingEvent:m,notice:h}=e,g=a(T),_;t[0]===g?_=t[1]:(_=o(g),t[0]=g,t[1]=_);let S=_.keyboardShortcutsSettings,[C,E]=(0,y.useState)(!1),[D,O]=(0,y.useState)(null),k,A;t[2]!==m||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(l,{detail:e})),m&&window.dispatchEvent(new CustomEvent(m,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(l,{detail:e})),m&&window.dispatchEvent(new CustomEvent(m,{detail:e}))}},A=[m,C],t[2]=m,t[3]=C,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,y.useEffect)(k,A);let j;t[6]!==S.quickCaptureShortcutConflict||t[7]!==c||t[8]!==C||t[9]!==p?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){E(!1);return}let t=f(e.nativeEvent);if(!t)return;let n=x?`meta`:`control`;if(new Set([`${n}+k`,`${n}+n`,`${n}+b`,`${n}+,`]).has(t)||t===c){O(S.quickCaptureShortcutConflict);return}p(t),O(null),E(!1)},t[6]=S.quickCaptureShortcutConflict,t[7]=c,t[8]=C,t[9]=p,t[10]=j):j=t[10];let M=j,N;t[11]===n?N=t[12]:(N=(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[11]=n,t[12]=N);let P;t[13]===r?P=t[14]:(P=(0,b.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r}),t[13]=r,t[14]=P);let F;t[15]!==N||t[16]!==P?(F=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[N,P]}),t[15]=N,t[16]=P,t[17]=F):F=t[17];let I;t[18]===s?I=t[19]:(I=u(s).map(w),t[18]=s,t[19]=I);let L;t[20]===I?L=t[21]:(L=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:I}),t[20]=I,t[21]=L);let R;t[22]!==F||t[23]!==L?(R=(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,L]}),t[22]=F,t[23]=L,t[24]=R):R=t[24];let z,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=i(`rounded-lg bg-accent px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),B=()=>{O(null),E(!0)},t[25]=z,t[26]=B):(z=t[25],B=t[26]);let V;t[27]!==S.quickCaptureShortcutChange||t[28]!==M?(V=(0,b.jsx)(`button`,{type:`button`,className:z,onClick:B,onKeyDown:M,children:S.quickCaptureShortcutChange}),t[27]=S.quickCaptureShortcutChange,t[28]=M,t[29]=V):V=t[29];let H;t[30]!==d||t[31]!==p?(H=()=>{p(d()),O(null)},t[30]=d,t[31]=p,t[32]=H):H=t[32];let U;t[33]!==S.quickCaptureShortcutReset||t[34]!==H?(U=(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-sm 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`,onClick:H,children:S.quickCaptureShortcutReset}),t[33]=S.quickCaptureShortcutReset,t[34]=H,t[35]=U):U=t[35];let W;t[36]!==S.quickCaptureShortcutRecording||t[37]!==M||t[38]!==C?(W=C?(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg border border-accent bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg outline-none`,onKeyDown:M,onClick:()=>E(!1),children:S.quickCaptureShortcutRecording}):null,t[36]=S.quickCaptureShortcutRecording,t[37]=M,t[38]=C,t[39]=W):W=t[39];let G;t[40]!==V||t[41]!==U||t[42]!==W?(G=(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[V,U,W]}),t[40]=V,t[41]=U,t[42]=W,t[43]=G):G=t[43];let K;t[44]===D?K=t[45]:(K=D?(0,b.jsx)(`p`,{className:`mt-2 text-sm text-danger-fg`,children:D}):null,t[44]=D,t[45]=K);let q;t[46]===h?q=t[47]:(q=h?(0,b.jsx)(`div`,{className:`mt-3 border-t border-edge pt-3`,children:h}):null,t[46]=h,t[47]=q);let J;return t[48]!==R||t[49]!==G||t[50]!==K||t[51]!==q||t[52]!==n?(J=(0,b.jsxs)(`section`,{className:`rounded-xl bg-surface-base px-4 py-3.5 sm:px-5 sm:py-4`,"aria-label":n,children:[R,G,K,q]}),t[48]=R,t[49]=G,t[50]=K,t[51]=q,t[52]=n,t[53]=J):J=t[53],J}function w(e,t){return(0,b.jsx)(L,{children:e},`${e}-${String(t)}`)}function T(e){return e.language}function E(){let e=(0,v.c)(8),t=a(A),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=h(k),s=h(O),l=c(D),u;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==i||e[6]!==l?(u=(0,b.jsx)(C,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:i,otherShortcut:l,defaultShortcut:p,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=i,e[6]=l,e[7]=u):u=e[7],u}function D(e){return e.shortcut}function O(e){return e.setShortcut}function k(e){return e.shortcut}function A(e){return e.language}function j(){let e=(0,v.c)(9),t=a(F),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=c(P),s=c(N),l=h(M),u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(I,{}),e[2]=u):u=e[2];let f;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==l||e[6]!==s||e[7]!==i?(f=(0,b.jsx)(C,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:i,otherShortcut:l,defaultShortcut:d,setShortcut:s,notice:u}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=l,e[6]=s,e[7]=i,e[8]=f):f=e[8],f}function M(e){return e.shortcut}function N(e){return e.setShortcut}function P(e){return e.shortcut}function F(e){return e.language}function I(){let e=o(a(e=>e.language)).keyboardShortcutsSettings,t=window.electronAPI?.system,n=s()&&window.electronAPI?.platform===`darwin`,[r,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!n||!t)return;let e=!0,r=()=>{t.getPermissions().then(t=>{e&&c(t.accessibility===`granted`)}).catch(()=>void 0)};return r(),window.addEventListener(`focus`,r),()=>{e=!1,window.removeEventListener(`focus`,r)}},[n,t]),!n||!t?null:(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsx)(`p`,{className:`max-w-[65ch] text-xs text-fg-muted`,children:r?e.voiceInputAccessibilityGranted:e.voiceInputAccessibilityDescription}),r?null:(0,b.jsx)(`button`,{type:`button`,disabled:l,className:i(`rounded-lg border border-edge-strong bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:text-fg-disabled`),onClick:async()=>{u(!0);try{c((await t.requestAccessibility()).status===`granted`)}finally{u(!1)}},children:l?e.voiceInputAccessibilityRequesting:e.voiceInputAccessibilityEnable})]})}function L(e){let t=(0,v.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,b.jsx)(`kbd`,{className:`inline-flex min-w-[1.5rem] items-center justify-center rounded-md border border-edge-subtle bg-surface-hover/60 px-1.5 py-0.5 font-mono text-xs font-medium text-fg-muted shadow-[0_1px_0_0_var(--color-edge-subtle)]`,children:n}),t[0]=n,t[1]=r),r}function R(e){let t=(0,v.c)(14),{keys:n,label:r,note:i}=e,a;t[0]===r?a=t[1]:(a=(0,b.jsx)(`span`,{className:`text-sm text-fg`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,b.jsxs)(`span`,{className:`ml-1.5 text-xs text-fg-muted`,children:[`(`,i,`)`]}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=n.map(z),t[7]=n,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==s||t[12]!==l?(u=(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[s,l]}),t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function z(e){return(0,b.jsx)(L,{children:e},e)}function B(e){let t=(0,v.c)(11),{title:n,shortcuts:r}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`rounded-xl bg-surface-base px-4 sm:px-5`),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,b.jsx)(`h2`,{className:`pb-1 pt-3.5 text-sm font-semibold text-fg sm:pt-4`,children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r.map(V),t[3]=r,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,b.jsx)(`div`,{className:`grid gap-1 pb-3 sm:pb-4`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==o||t[8]!==c||t[9]!==n?(l=(0,b.jsxs)(`section`,{className:a,"aria-label":n,children:[o,c]}),t[7]=o,t[8]=c,t[9]=n,t[10]=l):l=t[10],l}function V(e){return(0,b.jsx)(R,{...e},e.label)}function H(){let e=(0,v.c)(134),t=a(K),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=h(G),l=c(W),d;if(e[2]!==r.categoryChat||e[3]!==r.categoryEditor||e[4]!==r.categoryGlobal||e[5]!==r.categoryNavigation||e[6]!==r.chatForceSend||e[7]!==r.chatNewLine||e[8]!==r.chatSend||e[9]!==r.chatVoiceInput||e[10]!==r.editorBulletList||e[11]!==r.editorHeading1||e[12]!==r.editorHeading2||e[13]!==r.editorHeading3||e[14]!==r.editorOrderedList||e[15]!==r.editorTaskList||e[16]!==r.globalNewChat||e[17]!==r.globalOpenSettings||e[18]!==r.globalToggleWindow||e[19]!==r.globalVoiceInput||e[20]!==r.globalVoiceInputMacNote||e[21]!==r.globalVoiceInputWindowsNote||e[22]!==r.navCloseDialog||e[23]!==r.navCommandPalette||e[24]!==r.navQuickCapture||e[25]!==r.navToggleFullscreen||e[26]!==r.navToggleSidebar||e[27]!==i||e[28]!==l){if(d=[],s()){let t=window.electronAPI?.platform===`darwin`?`Fn`:`Alt`,n=window.electronAPI?.platform===`darwin`?r.globalVoiceInputMacNote:r.globalVoiceInputWindowsNote,i;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(i=[S,`Shift`,`Space`],e[30]=i):i=e[30];let a;e[31]===r.globalToggleWindow?a=e[32]:(a={keys:i,label:r.globalToggleWindow},e[31]=r.globalToggleWindow,e[32]=a);let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=[t],e[33]=o):o=e[33];let s;e[34]!==r.globalVoiceInput||e[35]!==n?(s={keys:o,label:r.globalVoiceInput,note:n},e[34]=r.globalVoiceInput,e[35]=n,e[36]=s):s=e[36];let c;e[37]!==a||e[38]!==s?(c=[a,s],e[37]=a,e[38]=s,e[39]=c):c=e[39];let l;e[40]!==r.categoryGlobal||e[41]!==c?(l={title:r.categoryGlobal,shortcuts:c},e[40]=r.categoryGlobal,e[41]=c,e[42]=l):l=e[42],d.push(l)}let t=r.categoryNavigation,n;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(n=[S,`N`],e[43]=n):n=e[43];let a;e[44]===r.globalNewChat?a=e[45]:(a={keys:n,label:r.globalNewChat},e[44]=r.globalNewChat,e[45]=a);let o;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(o=[S,`K`],e[46]=o):o=e[46];let c;e[47]===r.navCommandPalette?c=e[48]:(c={keys:o,label:r.navCommandPalette},e[47]=r.navCommandPalette,e[48]=c);let f;e[49]===i?f=e[50]:(f=u(i),e[49]=i,e[50]=f);let p;e[51]!==r.navQuickCapture||e[52]!==f?(p={keys:f,label:r.navQuickCapture},e[51]=r.navQuickCapture,e[52]=f,e[53]=p):p=e[53];let m;e[54]===r.navToggleSidebar?m=e[55]:(m=s()?[{keys:[S,`B`],label:r.navToggleSidebar}]:[],e[54]=r.navToggleSidebar,e[55]=m);let h;e[56]===r.navToggleFullscreen?h=e[57]:(h=s()?[{keys:[`F11`],label:r.navToggleFullscreen}]:[],e[56]=r.navToggleFullscreen,e[57]=h);let g;e[58]===r.globalOpenSettings?g=e[59]:(g=s()?[{keys:[S,`,`],label:r.globalOpenSettings}]:[],e[58]=r.globalOpenSettings,e[59]=g);let _;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=[`Esc`],e[60]=_):_=e[60];let v;e[61]===r.navCloseDialog?v=e[62]:(v={keys:_,label:r.navCloseDialog},e[61]=r.navCloseDialog,e[62]=v);let y;e[63]!==g||e[64]!==v||e[65]!==a||e[66]!==c||e[67]!==p||e[68]!==m||e[69]!==h?(y=[a,c,p,...m,...h,...g,v],e[63]=g,e[64]=v,e[65]=a,e[66]=c,e[67]=p,e[68]=m,e[69]=h,e[70]=y):y=e[70];let b;e[71]!==r.categoryNavigation||e[72]!==y?(b={title:t,shortcuts:y},e[71]=r.categoryNavigation,e[72]=y,e[73]=b):b=e[73],d.push(b);let x=r.categoryChat,C;e[74]===Symbol.for(`react.memo_cache_sentinel`)?(C=[`Enter`],e[74]=C):C=e[74];let w;e[75]===r.chatSend?w=e[76]:(w={keys:C,label:r.chatSend},e[75]=r.chatSend,e[76]=w);let T;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(T=[`Shift`,`Enter`],e[77]=T):T=e[77];let E;e[78]===r.chatNewLine?E=e[79]:(E={keys:T,label:r.chatNewLine},e[78]=r.chatNewLine,e[79]=E);let D;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(D=[S,`Enter`],e[80]=D):D=e[80];let O;e[81]===r.chatForceSend?O=e[82]:(O={keys:D,label:r.chatForceSend},e[81]=r.chatForceSend,e[82]=O);let k;e[83]===l?k=e[84]:(k=u(l),e[83]=l,e[84]=k);let A;e[85]!==r.chatVoiceInput||e[86]!==k?(A={keys:k,label:r.chatVoiceInput},e[85]=r.chatVoiceInput,e[86]=k,e[87]=A):A=e[87];let j;e[88]!==w||e[89]!==E||e[90]!==O||e[91]!==A?(j=[w,E,O,A],e[88]=w,e[89]=E,e[90]=O,e[91]=A,e[92]=j):j=e[92];let M;e[93]!==r.categoryChat||e[94]!==j?(M={title:x,shortcuts:j},e[93]=r.categoryChat,e[94]=j,e[95]=M):M=e[95],d.push(M);let N;e[96]===Symbol.for(`react.memo_cache_sentinel`)?(N=[S,`Shift`,`1`],e[96]=N):N=e[96];let P;e[97]===r.editorHeading1?P=e[98]:(P={keys:N,label:r.editorHeading1},e[97]=r.editorHeading1,e[98]=P);let F;e[99]===Symbol.for(`react.memo_cache_sentinel`)?(F=[S,`Shift`,`2`],e[99]=F):F=e[99];let I;e[100]===r.editorHeading2?I=e[101]:(I={keys:F,label:r.editorHeading2},e[100]=r.editorHeading2,e[101]=I);let L;e[102]===Symbol.for(`react.memo_cache_sentinel`)?(L=[S,`Shift`,`3`],e[102]=L):L=e[102];let R;e[103]===r.editorHeading3?R=e[104]:(R={keys:L,label:r.editorHeading3},e[103]=r.editorHeading3,e[104]=R);let z;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(z=[S,`Shift`,`8`],e[105]=z):z=e[105];let B;e[106]===r.editorBulletList?B=e[107]:(B={keys:z,label:r.editorBulletList},e[106]=r.editorBulletList,e[107]=B);let V;e[108]===Symbol.for(`react.memo_cache_sentinel`)?(V=[S,`Shift`,`9`],e[108]=V):V=e[108];let H;e[109]===r.editorOrderedList?H=e[110]:(H={keys:V,label:r.editorOrderedList},e[109]=r.editorOrderedList,e[110]=H);let U;e[111]===Symbol.for(`react.memo_cache_sentinel`)?(U=[S,`Shift`,`0`],e[111]=U):U=e[111];let W;e[112]===r.editorTaskList?W=e[113]:(W={keys:U,label:r.editorTaskList},e[112]=r.editorTaskList,e[113]=W);let G;e[114]!==P||e[115]!==I||e[116]!==R||e[117]!==B||e[118]!==H||e[119]!==W?(G=[P,I,R,B,H,W],e[114]=P,e[115]=I,e[116]=R,e[117]=B,e[118]=H,e[119]=W,e[120]=G):G=e[120];let K;e[121]!==r.categoryEditor||e[122]!==G?(K={title:r.categoryEditor,shortcuts:G},e[121]=r.categoryEditor,e[122]=G,e[123]=K):K=e[123],d.push(K),e[2]=r.categoryChat,e[3]=r.categoryEditor,e[4]=r.categoryGlobal,e[5]=r.categoryNavigation,e[6]=r.chatForceSend,e[7]=r.chatNewLine,e[8]=r.chatSend,e[9]=r.chatVoiceInput,e[10]=r.editorBulletList,e[11]=r.editorHeading1,e[12]=r.editorHeading2,e[13]=r.editorHeading3,e[14]=r.editorOrderedList,e[15]=r.editorTaskList,e[16]=r.globalNewChat,e[17]=r.globalOpenSettings,e[18]=r.globalToggleWindow,e[19]=r.globalVoiceInput,e[20]=r.globalVoiceInputMacNote,e[21]=r.globalVoiceInputWindowsNote,e[22]=r.navCloseDialog,e[23]=r.navCommandPalette,e[24]=r.navQuickCapture,e[25]=r.navToggleFullscreen,e[26]=r.navToggleSidebar,e[27]=i,e[28]=l,e[29]=d}else d=e[29];let f;e[124]!==r.pageTitle||e[125]!==r.subtitle?(f=(0,b.jsx)(g,{title:r.pageTitle,subtitle:r.subtitle}),e[124]=r.pageTitle,e[125]=r.subtitle,e[126]=f):f=e[126];let p,m;e[127]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,b.jsx)(E,{}),m=(0,b.jsx)(j,{}),e[127]=p,e[128]=m):(p=e[127],m=e[128]);let y;e[129]===d?y=e[130]:(y=d.map(U),e[129]=d,e[130]=y);let x;return e[131]!==f||e[132]!==y?(x=(0,b.jsxs)(_,{gap:`gap-6`,children:[f,p,m,y]}),e[131]=f,e[132]=y,e[133]=x):x=e[133],x}function U(e){return(0,b.jsx)(B,{...e},e.title)}function W(e){return e.shortcut}function G(e){return e.shortcut}function K(e){return e.language}export{H as KeyboardShortcutsSettingsPanel};
|
|
1
|
+
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"./cn-JdwAhgNB.js";import{n as a}from"./locale-store-DlOv7896.js";import{t as o}from"./messages-Ls1Aaiqd.js";import{t as s}from"./electron-env-DH5wF8X8.js";import{ai as c,ci as l,ii as u,ni as d,oi as f,ri as p,rn as m,si as h}from"./index-ChIrvv3t.js";import{n as g,r as _}from"./settings-page-layout-DYelDcMV.js";var v=n(),y=e(t(),1),b=r(),x=c(),S=x?`⌘`:`Ctrl`;function C(e){let t=(0,v.c)(54),{title:n,description:r,shortcut:s,otherShortcut:c,defaultShortcut:l,setShortcut:u,legacyRecordingEvent:d,notice:p}=e,g=a(T),_;t[0]===g?_=t[1]:(_=o(g),t[0]=g,t[1]=_);let S=_.keyboardShortcutsSettings,[C,E]=(0,y.useState)(!1),[D,O]=(0,y.useState)(null),k,A;t[2]!==d||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(m,{detail:e})),d&&window.dispatchEvent(new CustomEvent(d,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(m,{detail:e})),d&&window.dispatchEvent(new CustomEvent(d,{detail:e}))}},A=[d,C],t[2]=d,t[3]=C,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,y.useEffect)(k,A);let j;t[6]!==S.quickCaptureShortcutConflict||t[7]!==c||t[8]!==C||t[9]!==u?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){E(!1);return}let t=h(e.nativeEvent);if(!t)return;let n=x?`meta`:`control`;if(new Set([`${n}+k`,`${n}+n`,`${n}+b`,`${n}+,`]).has(t)||t===c){O(S.quickCaptureShortcutConflict);return}u(t),O(null),E(!1)},t[6]=S.quickCaptureShortcutConflict,t[7]=c,t[8]=C,t[9]=u,t[10]=j):j=t[10];let M=j,N;t[11]===n?N=t[12]:(N=(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[11]=n,t[12]=N);let P;t[13]===r?P=t[14]:(P=(0,b.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r}),t[13]=r,t[14]=P);let F;t[15]!==N||t[16]!==P?(F=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[N,P]}),t[15]=N,t[16]=P,t[17]=F):F=t[17];let I;t[18]===s?I=t[19]:(I=f(s).map(w),t[18]=s,t[19]=I);let L;t[20]===I?L=t[21]:(L=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:I}),t[20]=I,t[21]=L);let R;t[22]!==F||t[23]!==L?(R=(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,L]}),t[22]=F,t[23]=L,t[24]=R):R=t[24];let z,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=i(`rounded-lg bg-accent px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),B=()=>{O(null),E(!0)},t[25]=z,t[26]=B):(z=t[25],B=t[26]);let V;t[27]!==S.quickCaptureShortcutChange||t[28]!==M?(V=(0,b.jsx)(`button`,{type:`button`,className:z,onClick:B,onKeyDown:M,children:S.quickCaptureShortcutChange}),t[27]=S.quickCaptureShortcutChange,t[28]=M,t[29]=V):V=t[29];let H;t[30]!==l||t[31]!==u?(H=()=>{u(l()),O(null)},t[30]=l,t[31]=u,t[32]=H):H=t[32];let U;t[33]!==S.quickCaptureShortcutReset||t[34]!==H?(U=(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-sm 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`,onClick:H,children:S.quickCaptureShortcutReset}),t[33]=S.quickCaptureShortcutReset,t[34]=H,t[35]=U):U=t[35];let W;t[36]!==S.quickCaptureShortcutRecording||t[37]!==M||t[38]!==C?(W=C?(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg border border-accent bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg outline-none`,onKeyDown:M,onClick:()=>E(!1),children:S.quickCaptureShortcutRecording}):null,t[36]=S.quickCaptureShortcutRecording,t[37]=M,t[38]=C,t[39]=W):W=t[39];let G;t[40]!==V||t[41]!==U||t[42]!==W?(G=(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[V,U,W]}),t[40]=V,t[41]=U,t[42]=W,t[43]=G):G=t[43];let K;t[44]===D?K=t[45]:(K=D?(0,b.jsx)(`p`,{className:`mt-2 text-sm text-danger-fg`,children:D}):null,t[44]=D,t[45]=K);let q;t[46]===p?q=t[47]:(q=p?(0,b.jsx)(`div`,{className:`mt-3 border-t border-edge pt-3`,children:p}):null,t[46]=p,t[47]=q);let J;return t[48]!==R||t[49]!==G||t[50]!==K||t[51]!==q||t[52]!==n?(J=(0,b.jsxs)(`section`,{className:`rounded-xl bg-surface-base px-4 py-3.5 sm:px-5 sm:py-4`,"aria-label":n,children:[R,G,K,q]}),t[48]=R,t[49]=G,t[50]=K,t[51]=q,t[52]=n,t[53]=J):J=t[53],J}function w(e,t){return(0,b.jsx)(L,{children:e},`${e}-${String(t)}`)}function T(e){return e.language}function E(){let e=(0,v.c)(8),t=a(A),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=l(k),s=l(O),c=p(D),d;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==i||e[6]!==c?(d=(0,b.jsx)(C,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:i,otherShortcut:c,defaultShortcut:u,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=i,e[6]=c,e[7]=d):d=e[7],d}function D(e){return e.shortcut}function O(e){return e.setShortcut}function k(e){return e.shortcut}function A(e){return e.language}function j(){let e=(0,v.c)(9),t=a(F),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=p(P),s=p(N),c=l(M),u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(I,{}),e[2]=u):u=e[2];let f;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==c||e[6]!==s||e[7]!==i?(f=(0,b.jsx)(C,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:i,otherShortcut:c,defaultShortcut:d,setShortcut:s,notice:u}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=c,e[6]=s,e[7]=i,e[8]=f):f=e[8],f}function M(e){return e.shortcut}function N(e){return e.setShortcut}function P(e){return e.shortcut}function F(e){return e.language}function I(){let e=o(a(e=>e.language)).keyboardShortcutsSettings,t=window.electronAPI?.system,n=s()&&window.electronAPI?.platform===`darwin`,[r,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!n||!t)return;let e=!0,r=()=>{t.getPermissions().then(t=>{e&&c(t.accessibility===`granted`)}).catch(()=>void 0)};return r(),window.addEventListener(`focus`,r),()=>{e=!1,window.removeEventListener(`focus`,r)}},[n,t]),!n||!t?null:(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsx)(`p`,{className:`max-w-[65ch] text-xs text-fg-muted`,children:r?e.voiceInputAccessibilityGranted:e.voiceInputAccessibilityDescription}),r?null:(0,b.jsx)(`button`,{type:`button`,disabled:l,className:i(`rounded-lg border border-edge-strong bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:text-fg-disabled`),onClick:async()=>{u(!0);try{c((await t.requestAccessibility()).status===`granted`)}finally{u(!1)}},children:l?e.voiceInputAccessibilityRequesting:e.voiceInputAccessibilityEnable})]})}function L(e){let t=(0,v.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,b.jsx)(`kbd`,{className:`inline-flex min-w-[1.5rem] items-center justify-center rounded-md border border-edge-subtle bg-surface-hover/60 px-1.5 py-0.5 font-mono text-xs font-medium text-fg-muted shadow-[0_1px_0_0_var(--color-edge-subtle)]`,children:n}),t[0]=n,t[1]=r),r}function R(e){let t=(0,v.c)(14),{keys:n,label:r,note:i}=e,a;t[0]===r?a=t[1]:(a=(0,b.jsx)(`span`,{className:`text-sm text-fg`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,b.jsxs)(`span`,{className:`ml-1.5 text-xs text-fg-muted`,children:[`(`,i,`)`]}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=n.map(z),t[7]=n,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==s||t[12]!==l?(u=(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[s,l]}),t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function z(e){return(0,b.jsx)(L,{children:e},e)}function B(e){let t=(0,v.c)(11),{title:n,shortcuts:r}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`rounded-xl bg-surface-base px-4 sm:px-5`),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,b.jsx)(`h2`,{className:`pb-1 pt-3.5 text-sm font-semibold text-fg sm:pt-4`,children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r.map(V),t[3]=r,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,b.jsx)(`div`,{className:`grid gap-1 pb-3 sm:pb-4`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==o||t[8]!==c||t[9]!==n?(l=(0,b.jsxs)(`section`,{className:a,"aria-label":n,children:[o,c]}),t[7]=o,t[8]=c,t[9]=n,t[10]=l):l=t[10],l}function V(e){return(0,b.jsx)(R,{...e},e.label)}function H(){let e=(0,v.c)(134),t=a(K),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=l(G),c=p(W),u;if(e[2]!==r.categoryChat||e[3]!==r.categoryEditor||e[4]!==r.categoryGlobal||e[5]!==r.categoryNavigation||e[6]!==r.chatForceSend||e[7]!==r.chatNewLine||e[8]!==r.chatSend||e[9]!==r.chatVoiceInput||e[10]!==r.editorBulletList||e[11]!==r.editorHeading1||e[12]!==r.editorHeading2||e[13]!==r.editorHeading3||e[14]!==r.editorOrderedList||e[15]!==r.editorTaskList||e[16]!==r.globalNewChat||e[17]!==r.globalOpenSettings||e[18]!==r.globalToggleWindow||e[19]!==r.globalVoiceInput||e[20]!==r.globalVoiceInputMacNote||e[21]!==r.globalVoiceInputWindowsNote||e[22]!==r.navCloseDialog||e[23]!==r.navCommandPalette||e[24]!==r.navQuickCapture||e[25]!==r.navToggleFullscreen||e[26]!==r.navToggleSidebar||e[27]!==i||e[28]!==c){if(u=[],s()){let t=window.electronAPI?.platform===`darwin`?`Fn`:`Alt`,n=window.electronAPI?.platform===`darwin`?r.globalVoiceInputMacNote:r.globalVoiceInputWindowsNote,i;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(i=[S,`Shift`,`Space`],e[30]=i):i=e[30];let a;e[31]===r.globalToggleWindow?a=e[32]:(a={keys:i,label:r.globalToggleWindow},e[31]=r.globalToggleWindow,e[32]=a);let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=[t],e[33]=o):o=e[33];let s;e[34]!==r.globalVoiceInput||e[35]!==n?(s={keys:o,label:r.globalVoiceInput,note:n},e[34]=r.globalVoiceInput,e[35]=n,e[36]=s):s=e[36];let c;e[37]!==a||e[38]!==s?(c=[a,s],e[37]=a,e[38]=s,e[39]=c):c=e[39];let l;e[40]!==r.categoryGlobal||e[41]!==c?(l={title:r.categoryGlobal,shortcuts:c},e[40]=r.categoryGlobal,e[41]=c,e[42]=l):l=e[42],u.push(l)}let t=r.categoryNavigation,n;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(n=[S,`N`],e[43]=n):n=e[43];let a;e[44]===r.globalNewChat?a=e[45]:(a={keys:n,label:r.globalNewChat},e[44]=r.globalNewChat,e[45]=a);let o;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(o=[S,`K`],e[46]=o):o=e[46];let l;e[47]===r.navCommandPalette?l=e[48]:(l={keys:o,label:r.navCommandPalette},e[47]=r.navCommandPalette,e[48]=l);let d;e[49]===i?d=e[50]:(d=f(i),e[49]=i,e[50]=d);let p;e[51]!==r.navQuickCapture||e[52]!==d?(p={keys:d,label:r.navQuickCapture},e[51]=r.navQuickCapture,e[52]=d,e[53]=p):p=e[53];let m;e[54]===r.navToggleSidebar?m=e[55]:(m=s()?[{keys:[S,`B`],label:r.navToggleSidebar}]:[],e[54]=r.navToggleSidebar,e[55]=m);let h;e[56]===r.navToggleFullscreen?h=e[57]:(h=s()?[{keys:[`F11`],label:r.navToggleFullscreen}]:[],e[56]=r.navToggleFullscreen,e[57]=h);let g;e[58]===r.globalOpenSettings?g=e[59]:(g=s()?[{keys:[S,`,`],label:r.globalOpenSettings}]:[],e[58]=r.globalOpenSettings,e[59]=g);let _;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=[`Esc`],e[60]=_):_=e[60];let v;e[61]===r.navCloseDialog?v=e[62]:(v={keys:_,label:r.navCloseDialog},e[61]=r.navCloseDialog,e[62]=v);let y;e[63]!==g||e[64]!==v||e[65]!==a||e[66]!==l||e[67]!==p||e[68]!==m||e[69]!==h?(y=[a,l,p,...m,...h,...g,v],e[63]=g,e[64]=v,e[65]=a,e[66]=l,e[67]=p,e[68]=m,e[69]=h,e[70]=y):y=e[70];let b;e[71]!==r.categoryNavigation||e[72]!==y?(b={title:t,shortcuts:y},e[71]=r.categoryNavigation,e[72]=y,e[73]=b):b=e[73],u.push(b);let x=r.categoryChat,C;e[74]===Symbol.for(`react.memo_cache_sentinel`)?(C=[`Enter`],e[74]=C):C=e[74];let w;e[75]===r.chatSend?w=e[76]:(w={keys:C,label:r.chatSend},e[75]=r.chatSend,e[76]=w);let T;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(T=[`Shift`,`Enter`],e[77]=T):T=e[77];let E;e[78]===r.chatNewLine?E=e[79]:(E={keys:T,label:r.chatNewLine},e[78]=r.chatNewLine,e[79]=E);let D;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(D=[S,`Enter`],e[80]=D):D=e[80];let O;e[81]===r.chatForceSend?O=e[82]:(O={keys:D,label:r.chatForceSend},e[81]=r.chatForceSend,e[82]=O);let k;e[83]===c?k=e[84]:(k=f(c),e[83]=c,e[84]=k);let A;e[85]!==r.chatVoiceInput||e[86]!==k?(A={keys:k,label:r.chatVoiceInput},e[85]=r.chatVoiceInput,e[86]=k,e[87]=A):A=e[87];let j;e[88]!==w||e[89]!==E||e[90]!==O||e[91]!==A?(j=[w,E,O,A],e[88]=w,e[89]=E,e[90]=O,e[91]=A,e[92]=j):j=e[92];let M;e[93]!==r.categoryChat||e[94]!==j?(M={title:x,shortcuts:j},e[93]=r.categoryChat,e[94]=j,e[95]=M):M=e[95],u.push(M);let N;e[96]===Symbol.for(`react.memo_cache_sentinel`)?(N=[S,`Shift`,`1`],e[96]=N):N=e[96];let P;e[97]===r.editorHeading1?P=e[98]:(P={keys:N,label:r.editorHeading1},e[97]=r.editorHeading1,e[98]=P);let F;e[99]===Symbol.for(`react.memo_cache_sentinel`)?(F=[S,`Shift`,`2`],e[99]=F):F=e[99];let I;e[100]===r.editorHeading2?I=e[101]:(I={keys:F,label:r.editorHeading2},e[100]=r.editorHeading2,e[101]=I);let L;e[102]===Symbol.for(`react.memo_cache_sentinel`)?(L=[S,`Shift`,`3`],e[102]=L):L=e[102];let R;e[103]===r.editorHeading3?R=e[104]:(R={keys:L,label:r.editorHeading3},e[103]=r.editorHeading3,e[104]=R);let z;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(z=[S,`Shift`,`8`],e[105]=z):z=e[105];let B;e[106]===r.editorBulletList?B=e[107]:(B={keys:z,label:r.editorBulletList},e[106]=r.editorBulletList,e[107]=B);let V;e[108]===Symbol.for(`react.memo_cache_sentinel`)?(V=[S,`Shift`,`9`],e[108]=V):V=e[108];let H;e[109]===r.editorOrderedList?H=e[110]:(H={keys:V,label:r.editorOrderedList},e[109]=r.editorOrderedList,e[110]=H);let U;e[111]===Symbol.for(`react.memo_cache_sentinel`)?(U=[S,`Shift`,`0`],e[111]=U):U=e[111];let W;e[112]===r.editorTaskList?W=e[113]:(W={keys:U,label:r.editorTaskList},e[112]=r.editorTaskList,e[113]=W);let G;e[114]!==P||e[115]!==I||e[116]!==R||e[117]!==B||e[118]!==H||e[119]!==W?(G=[P,I,R,B,H,W],e[114]=P,e[115]=I,e[116]=R,e[117]=B,e[118]=H,e[119]=W,e[120]=G):G=e[120];let K;e[121]!==r.categoryEditor||e[122]!==G?(K={title:r.categoryEditor,shortcuts:G},e[121]=r.categoryEditor,e[122]=G,e[123]=K):K=e[123],u.push(K),e[2]=r.categoryChat,e[3]=r.categoryEditor,e[4]=r.categoryGlobal,e[5]=r.categoryNavigation,e[6]=r.chatForceSend,e[7]=r.chatNewLine,e[8]=r.chatSend,e[9]=r.chatVoiceInput,e[10]=r.editorBulletList,e[11]=r.editorHeading1,e[12]=r.editorHeading2,e[13]=r.editorHeading3,e[14]=r.editorOrderedList,e[15]=r.editorTaskList,e[16]=r.globalNewChat,e[17]=r.globalOpenSettings,e[18]=r.globalToggleWindow,e[19]=r.globalVoiceInput,e[20]=r.globalVoiceInputMacNote,e[21]=r.globalVoiceInputWindowsNote,e[22]=r.navCloseDialog,e[23]=r.navCommandPalette,e[24]=r.navQuickCapture,e[25]=r.navToggleFullscreen,e[26]=r.navToggleSidebar,e[27]=i,e[28]=c,e[29]=u}else u=e[29];let d;e[124]!==r.pageTitle||e[125]!==r.subtitle?(d=(0,b.jsx)(g,{title:r.pageTitle,subtitle:r.subtitle}),e[124]=r.pageTitle,e[125]=r.subtitle,e[126]=d):d=e[126];let m,h;e[127]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(E,{}),h=(0,b.jsx)(j,{}),e[127]=m,e[128]=h):(m=e[127],h=e[128]);let y;e[129]===u?y=e[130]:(y=u.map(U),e[129]=u,e[130]=y);let x;return e[131]!==d||e[132]!==y?(x=(0,b.jsxs)(_,{gap:`gap-6`,children:[d,m,h,y]}),e[131]=d,e[132]=y,e[133]=x):x=e[133],x}function U(e){return(0,b.jsx)(B,{...e},e.title)}function W(e){return e.shortcut}function G(e){return e.shortcut}function K(e){return e.language}export{H as KeyboardShortcutsSettingsPanel};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,p as a,t as o}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as s}from"./check-DUBLcKHA.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as te}from"./clock-3-DnrAnuyZ.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./loader-circle-CifKLtgG.js";import{t as u}from"./x-B_N4OPjy.js";import{n as d,r as f}from"./locale-store-DlOv7896.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./dist-BGTk37IG.js";import{a as ne,i as b}from"./vendor-swr-BIWyz7Rc.js";import{t as x}from"./button-BA45yciM.js";import{t as S}from"./skeleton-BwbyijEw.js";import{$c as C,Da as w,Dc as re,Ec as ie,Hr as T,Mc as ae,Nc as oe,Pa as se,Ru as ce,Wc as le,Wl as ue,Xs as de,Zs as fe,dc as pe,du as me,fo as he,gc as ge,kl as _e,mo as ve,zl as ye}from"./index-ChIrvv3t.js";import{n as be,t as xe}from"./tab-completion-input-D64VNmiA.js";import{t as Se}from"./tab-completion-input.utils-BP3NH_du.js";import{a as Ce,c as we,l as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./api-Coly9ab6.js";var E=e(t(),1),je=`build-xopc-local-app`;function Me(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function Ne(e){return e.find(e=>Me(e)===`coder`)??null}function Pe(e,t){let n=new URLSearchParams({skill:je}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var D=new Set([`document`,`content`,`interaction`,`criteria`]),Fe=new Set([`passed`,`failed`,`skipped`]);function Ie(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.source!==`xopc-local-app-preview`||t.version!==1)return null;if(t.type===`ready`)return{type:`ready`,detail:{}};if(t.type===`criteria`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.scenarios)||e.scenarios.length>10)return null;let n=e.scenarios.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||!t.id.trim()||t.id.length>80||typeof t.name!=`string`||!t.name.trim()||t.name.length>120||t.status!==`passed`&&t.status!==`failed`||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,name:t.name,status:t.status,message:t.message.slice(0,500),failureKind:`scenario`}});if(n.some(e=>e===null))return null;let r=typeof e.scenarioCount==`number`&&Number.isInteger(e.scenarioCount)&&e.scenarioCount>=0&&e.scenarioCount<=10?e.scenarioCount:n.length;return{type:`criteria`,detail:{status:e.status,scenarioCount:r,scenarios:n}}}if(t.type===`acceptance`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.checks))return null;let n=e.checks.slice(0,10).map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return!D.has(t.id)||!Fe.has(t.status)||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,status:t.status,message:t.message.slice(0,500)}});if(!n.length||n.some(e=>e===null))return null;let r=typeof e.interactiveCount==`number`&&Number.isFinite(e.interactiveCount)&&e.interactiveCount>=0?Math.min(Math.floor(e.interactiveCount),1e4):0;return{type:`acceptance`,detail:{status:e.status,checks:n,interactiveCount:r}}}if(t.type!==`error`||!t.detail||typeof t.detail!=`object`)return null;let n=t.detail;return n.kind!==`script_error`&&n.kind!==`unhandled_rejection`||typeof n.message!=`string`||!n.message.trim()?null:{type:`error`,detail:{kind:n.kind,message:n.message.slice(0,500),filename:typeof n.filename==`string`?n.filename.slice(0,500):void 0,line:typeof n.line==`number`?n.line:void 0,column:typeof n.column==`number`?n.column:void 0}}}function Le(e){return e?.checks.filter(e=>e.status===`failed`).map(e=>e.message)??[]}function Re(e){let t=e.filename?` (${e.filename}${e.line?`:${e.line}${e.column?`:${e.column}`:``}`:``})`:``;return`${e.message}${t}`}var ze=Object.freeze({source:`xopc-local-app-host`,version:1,type:`connect`});function Be(e,t){let n=null,r=()=>{n?.close();let r=new MessageChannel;n=r.port1,n.onmessage=e=>t(e.data),n.start(),e.contentWindow?.postMessage(ze,`*`,[r.port2])};return e.addEventListener(`load`,r),r(),()=>{e.removeEventListener(`load`,r),n?.close()}}var Ve=n(),O=r();function He(e){let t=(0,Ve.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:o,onRunScenario:s,onAskCoder:c}=e;if(!n.length)return null;let u=a?`产品场景`:`Product scenarios`,d;t[0]===u?d=t[1]:(d=(0,O.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:u}),t[0]=u,t[1]=d);let f=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,p;t[2]===f?p=t[3]:(p=(0,O.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:f}),t[2]=f,t[3]=p);let m;t[4]!==d||t[5]!==p?(m=(0,O.jsxs)(`div`,{children:[d,p]}),t[4]=d,t[5]=p,t[6]=m):m=t[6];let h=i!==null,g;t[7]===i?g=t[8]:(g=i===`all`?(0,O.jsx)(l,{className:`size-3 animate-spin`}):(0,O.jsx)(re,{className:`size-3`}),t[7]=i,t[8]=g);let _=a?`全部重跑`:`Run all`,v;t[9]!==o||t[10]!==h||t[11]!==g||t[12]!==_?(v=(0,O.jsxs)(x,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:o,disabled:h,children:[g,_]}),t[9]=o,t[10]=h,t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==m||t[15]!==v?(y=(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[m,v]}),t[14]=m,t[15]=v,t[16]=y):y=t[16];let ne=a?`产品场景验收结果`:`Product scenario acceptance results`,b;if(t[17]!==c||t[18]!==s||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==c||t[25]!==s||t[26]!==r||t[27]!==i||t[28]!==a?(e=e=>{let t=r[e.id],n=i===`all`||i===e.id?`running`:t?.status??`pending`;return(0,O.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,O.jsx)(l,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,O.jsx)(ee,{className:`size-3.5 text-success`}):n===`failed`?(0,O.jsx)(me,{className:`size-3.5 text-danger`}):(0,O.jsx)(te,{className:`size-3.5 text-fg-subtle`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,O.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,O.jsx)(x,{variant:`ghost`,className:`size-7 shrink-0 rounded-lg p-0`,onClick:()=>s(e.id),disabled:i!==null,"aria-label":a?`重跑${e.name}`:`Rerun ${e.name}`,title:a?`单独重跑`:`Rerun scenario`,children:(0,O.jsx)(re,{className:`size-3`})})]}),n===`running`?(0,O.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,O.jsxs)(`div`,{className:`mt-1.5`,children:[(0,O.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,O.jsxs)(x,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>c(e,t),children:[(0,O.jsx)(C,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,O.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,O.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=c,t[25]=s,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],b=n.map(e),t[17]=c,t[18]=s,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=b}else b=t[23];let S;t[30]!==ne||t[31]!==b?(S=(0,O.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":ne,children:b}),t[30]=ne,t[31]=b,t[32]=S):S=t[32];let w;return t[33]!==y||t[34]!==S?(w=(0,O.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[y,S]}),t[33]=y,t[34]=S,t[35]=w):w=t[35],w}var Ue=`allow-scripts allow-forms`;function We(e,t){return T(e,t)}function Ge(e,t,n){return!!(t&&n&&e.sourceHash===t&&e.status===n.status&&e.interactiveCount===n.interactiveCount&&JSON.stringify(e.checks)===JSON.stringify(n.checks))}function k(){let{appId:e}=a(),t=e===`new`,n=d(e=>e.language)===`zh`,r=d(e=>e.language),te=i(),{mutate:T}=ne(),me=he(e=>e.moveToFront),je=ve(e=>e.setPageHeader),Me=ve(e=>e.clearPageHeader),{data:D,isLoading:Fe,error:ze,mutate:Ve}=b(!t&&e?[`local-app`,e]:null,()=>Ee(e)),{data:k,isLoading:Ke,mutate:A}=b(!t&&e?[`local-app-validation`,e]:null,()=>Te(e)),[qe,Je]=(0,E.useState)(``),[Ye,Xe]=(0,E.useState)(``),[j,M]=(0,E.useState)(!1),[Ze,N]=(0,E.useState)(null),[Qe,$e]=(0,E.useState)(!1),[et,tt]=(0,E.useState)(!1),[nt,rt]=(0,E.useState)(0),[it,at]=(0,E.useState)(``),[P,ot]=(0,E.useState)(!1),[st,ct]=(0,E.useState)(!1),[F,I]=(0,E.useState)(`booting`),[lt,ut]=(0,E.useState)(null),[L,dt]=(0,E.useState)(null),[R,ft]=(0,E.useState)({}),[z,pt]=(0,E.useState)(`all`),[B,V]=(0,E.useState)(0),[mt,ht]=(0,E.useState)(0),[gt,_t]=(0,E.useState)(null),[H,vt]=(0,E.useState)(null),[U,yt]=(0,E.useState)([]),[W,bt]=(0,E.useState)(!1),xt=(0,E.useRef)(new Set),G=(0,E.useRef)(null),St=(0,E.useRef)(null),Ct=(0,E.useRef)(null),K=(0,E.useRef)(null),q=(0,E.useRef)(``),J=k?.acceptanceScenarios??[],Y=(0,E.useMemo)(()=>{if(!J.length)return null;let e=J.map(e=>R[e.id]).filter(e=>!!e);return e.length===J.length?{status:e.some(e=>e.status===`failed`)?`failed`:`passed`,scenarioCount:J.length,scenarios:e}:null},[J,R]),X=(0,E.useMemo)(()=>{if(!L)return null;if(!k?.acceptanceScenarioCount)return L;if(!Y)return null;let e=Y.scenarios.find(e=>e.status===`failed`),t={id:`criteria`,status:Y.status,message:e?`${e.name}: ${e.message}`:`${Y.scenarioCount} product scenario(s) passed`},n=[...L.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:L.interactiveCount}},[L,Y,k?.acceptanceScenarioCount]),wt=(0,E.useCallback)(async(e,t)=>{let n=Ne(await se(e.projectId))??await w(e.projectId,`coder`);xt.current.add(n.key),te(Pe(n.key,t))},[te]),Z=(0,E.useCallback)(async(e=!0)=>{if(!D)return null;ct(!0);try{let t=await Te(D.id);return await A(t,{revalidate:!1}),e&&(K.current=t.sourceHash??null,pt(`all`),V(0),rt(e=>e+1)),t}catch(e){return N(e instanceof Error?e.message:String(e)),null}finally{ct(!1)}},[D,A]);(0,E.useEffect)(()=>{if(!D)return;let e=!1;se(D.projectId).then(t=>{e||(xt.current=new Set(t.filter(e=>(e.routing?.agentId??e.agentId)?.toLowerCase()===`coder`).map(e=>e.key)))}).catch(()=>{});let t=e=>{let t=e.detail?.key;!t||!xt.current.has(t)||(G.current!==null&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>{G.current=null,Z(!0)},750))};return window.addEventListener(`session-transcript-updated`,t),()=>{e=!0,window.removeEventListener(`session-transcript-updated`,t),G.current!==null&&window.clearTimeout(G.current)}},[D,Z]),(0,E.useEffect)(()=>{yt(D?.acceptanceRuns??[])},[D?.acceptanceRuns]),(0,E.useEffect)(()=>{K.current=null},[D?.id]),(0,E.useEffect)(()=>{!k?.sourceHash||K.current||(K.current=k.sourceHash,pt(`all`),V(0),rt(e=>e+1))},[k?.sourceHash]),(0,E.useLayoutEffect)(()=>{if(!D)return;I(`booting`),ut(null),dt(null),vt(null),bt(!1),q.current=``;let e=window.setTimeout(()=>I(e=>e===`failed`?e:`timeout`),7e3),t=St.current?Be(St.current,t=>{let n=Ie(t);if(n){if(n.type===`ready`){I(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),dt(n.detail),vt(K.current);return}n.type!==`criteria`&&(window.clearTimeout(e),ut(n.detail),I(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[D,nt]),(0,E.useLayoutEffect)(()=>{if(!D||k?.status!==`healthy`||!J.length){_t(null);return}let e=z===`all`?J[B]:J.find(e=>e.id===z),t=e?[e]:[];if(!t.length)return;_t(z),ft(e=>{if(z===`all`&&B===0)return{};let t={...e};return delete t[z],t});let r=!1,i=e=>{ft(n=>{let r={...n};for(let n of t)r[n.id]={id:n.id,name:n.name,status:`failed`,message:e,failureKind:`runner`};return r}),_t(null)},a=window.setTimeout(()=>i(r?n?`场景在 10 秒内未完成。`:`Scenario did not finish within 10 seconds.`:n?`验收执行器未能连接,请重新验收。`:`The acceptance runner did not connect. Run acceptance again.`),1e4),o=Ct.current?Be(Ct.current,e=>{let t=Ie(e);t&&(t.type===`ready`?r=!0:t.type===`criteria`?(window.clearTimeout(a),ft(e=>{let n={...e};for(let e of t.detail.scenarios)(n[e.id]?.status!==`failed`||e.status===`failed`)&&(n[e.id]=e);return n}),z===`all`&&B+1<J.length?(V(e=>e+1),ht(e=>e+1)):_t(null)):t.type===`error`&&(window.clearTimeout(a),i(Re(t.detail))))}):()=>{};return()=>{window.clearTimeout(a),o()}},[J,D,mt,z,B,nt,k?.status,n]),(0,E.useEffect)(()=>{if(!D||!X||!H||H!==k?.sourceHash)return;let e=`${D.id}:${H}:${JSON.stringify(X)}`;q.current!==e&&(q.current=e,bt(!0),Ce(D.id,H,X).then(t=>{q.current===e&&yt(e=>[t,...e.filter(e=>e.id!==t.id)].toSorted((e,t)=>t.createdAt-e.createdAt).slice(0,20))}).catch(t=>{q.current===e&&(q.current=``,N(t instanceof Error?t.message:String(t)))}).finally(()=>{q.current===e&&bt(!1)}))},[X,H,D,k?.sourceHash]);let Q=(0,E.useCallback)(async e=>{if(D){ot(!0),N(null);try{await wt(D,e)}catch(e){N(e instanceof Error?e.message:String(e)),ot(!1)}}},[D,wt]);(0,E.useLayoutEffect)(()=>(je({startExtra:(0,O.jsx)(o,{to:`/local-apps`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`返回本地应用`:`Back to local apps`,children:(0,O.jsx)(ce,{className:`size-4`})}),main:(0,O.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:D?.name||(n?`创建本地应用`:`Create local app`)}),end:D?(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(x,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,O.jsxs)(o,{to:`/projects/${encodeURIComponent(D.projectId)}`,children:[(0,O.jsx)(ye,{className:`size-4`}),`Project`]})}),(0,O.jsxs)(x,{className:`h-9`,onClick:()=>void Q(),disabled:P,children:[P?(0,O.jsx)(l,{className:`size-4 animate-spin`}):(0,O.jsx)(C,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>Me()),[D,P,Me,Q,je,n]);async function Tt(e){e.preventDefault(),M(!0),N(null);try{let e=await Ae({name:qe,idea:Ye});await T(`local-apps-list`);let t=n?`请基于 APP_BRIEF.md 完成这个本地应用的首版。先检查现有草稿,再实现最小可用版本并运行校验;完成后告诉我可以如何预览。`:`Build the first usable version of this local app from APP_BRIEF.md. Inspect the existing draft, implement the smallest useful version, run validation, and tell me how to preview it.`;try{await wt(e,t)}catch{te(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){N(e instanceof Error?e.message:String(e))}finally{M(!1)}}async function Et(){if(D){M(!0),N(null);try{let e=await Oe(D.id);await Ve(e,{revalidate:!1}),await A(),await Promise.all([T(`local-apps-list`),T(`gateway-extensions-list`)]),me(`ext:${e.extensionId}:app`),$e(!1)}catch(e){N(e instanceof Error?e.message:String(e))}finally{M(!1)}}}async function Dt(e,t=!1){M(!0),N(null);try{let n=await e();return await Ve(n,{revalidate:!1}),await A(),await Promise.all([T(`local-apps-list`),T(`gateway-extensions-list`)]),t&&me(`ext:${n.extensionId}:app`),!0}catch(e){return N(e instanceof Error?e.message:String(e)),!1}finally{M(!1)}}async function Ot(e){D&&await Dt(()=>ke(D.id,e),e)}async function kt(e){D&&await Dt(()=>De(D.id,e),!0)}async function At(){D&&await Dt(()=>we(D.id))&&tt(!1)}function jt(){let e=Array.from(new Set([...k?.issues.map(e=>e.message)??[],...lt?[Re(lt)]:[],...X?.checks.filter(e=>e.status===`failed`&&e.id!==`criteria`).map(e=>e.message)??[],...Object.values(R).filter(e=>e.status===`failed`).map(e=>`${e.name}: ${e.failureKind===`runner`?`[验收执行器] `:``}${e.message}`),...F===`timeout`?[n?`预览在 7 秒内未完成启动,可能存在白屏或阻塞。`:`The preview did not finish booting within 7 seconds and may be blank or blocked.`]:[]]));if(!e.length)return;let t=e.map(e=>`- ${e}`).join(`
|
|
2
|
+
`);Q(n?`请修复当前本地应用草稿的校验问题,保持扩展 ID 和已安装版本不变。先复现并判断问题来自应用行为还是验收执行器,不要通过弱化断言绕过问题。修复后运行完整校验。\n\n${t}`:`Fix the current local-app draft validation issues without changing the extension id or installed release. Reproduce first and determine whether each issue comes from app behavior or the acceptance runner; do not weaken assertions to bypass it. Run the full validation afterward.\n\n${t}`)}function Mt(){pt(`all`),V(0),ht(e=>e+1)}function Nt(e){pt(e),V(0),ht(e=>e+1)}function Pt(e,t){let r=t.failureKind===`runner`?n?`验收执行器`:`acceptance runner`:n?`产品场景`:`product scenario`;Q(n?`请修复本地应用的${r}问题“${e.name}”。当前失败信息:${t.message}\n\n保持扩展 ID 和场景原意不变;先复现并判断问题来自应用行为还是验收执行器,不要通过弱化断言绕过问题。修复后运行完整校验。`:`Fix the local-app ${r} issue "${e.name}". Current failure: ${t.message}\n\nPreserve the extension id and scenario intent. Reproduce first and determine whether the issue comes from app behavior or the runner; do not weaken assertions to bypass it. Run the full validation afterward.`)}let Ft=U.findIndex(e=>Ge(e,H,X)),$=Ft>=0?U[Ft]:null,It=Ft>=0?U[Ft+1]??null:U[0]??null,Lt=Le(X),Rt=It?It.checks.filter(e=>e.status===`failed`).map(e=>e.message):[],zt=k?.status===`failed`||F===`failed`||F===`timeout`||X?.status===`failed`||Object.values(R).some(e=>e.status===`failed`),Bt=Rt.filter(e=>!Lt.includes(e)).length;async function Vt(){let e=await Z(!1);if(e?.status===`healthy`&&e.sourceHash!==H){K.current=e.sourceHash??null,V(0),rt(e=>e+1);return}e?.status===`healthy`&&F===`healthy`&&X?.status===`passed`&&$&&$.sourceHash===e.sourceHash&&$e(!0)}return t?(0,O.jsx)(`div`,{className:`flex min-h-0 flex-1 bg-surface-panel p-3 sm:p-5 xl:p-6`,children:(0,O.jsxs)(`div`,{className:`mx-auto grid w-full max-w-6xl overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base shadow-surface lg:grid-cols-[minmax(280px,0.8fr)_minmax(0,1.5fr)]`,children:[(0,O.jsxs)(`form`,{onSubmit:Tt,className:`flex flex-col border-b border-edge-subtle p-5 lg:border-b-0 lg:border-r`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[(0,O.jsx)(pe,{className:`size-4`}),n?`告诉 Coder 你的想法`:`Tell Coder your idea`]}),(0,O.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:n?`你想创建什么?`:`What do you want to create?`}),(0,O.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`我们会建立一个 Coder Project,并把应用上下文和开发 Skill 带入对话。`:`We will create a Coder Project and carry the app context and development skill into chat.`}),(0,O.jsxs)(`label`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:[n?`应用名称`:`App name`,(0,O.jsx)(xe,{value:qe,onChange:e=>Je(e.target.value),suggestion:Se(n?`例如:阅读清单`:`e.g. Reading list`),onAcceptSuggestion:Je,required:!0,className:`mt-2 w-full rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:阅读清单`:`e.g. Reading list`})]}),(0,O.jsxs)(`label`,{className:`mt-4 text-xs font-medium text-fg-muted`,children:[n?`描述你的想法`:`Describe your idea`,(0,O.jsx)(be,{value:Ye,onChange:e=>Xe(e.target.value),suggestion:Se(n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`),onAcceptSuggestion:Xe,required:!0,rows:7,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`})]}),Ze?(0,O.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:Ze}):null,(0,O.jsxs)(x,{type:`submit`,variant:`primary`,className:`mt-5 h-10`,disabled:j||!qe.trim()||!Ye.trim(),children:[j?(0,O.jsx)(l,{className:`size-4 animate-spin`}):(0,O.jsx)(C,{className:`size-4`}),n?`进入 Coder 对话`:`Continue with Coder`]})]}),(0,O.jsx)(`div`,{className:`hidden min-h-[620px] place-items-center bg-surface-panel p-8 lg:grid`,children:(0,O.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,O.jsx)(`div`,{className:`mx-auto flex size-16 items-center justify-center rounded-2xl border border-edge bg-surface-base text-accent shadow-surface`,children:(0,O.jsx)(le,{className:`size-7`})}),(0,O.jsx)(`h3`,{className:`mt-5 text-base font-semibold text-fg`,children:n?`创建后,这里就是实时预览`:`Your live preview appears here`}),(0,O.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`你可以先体验草稿,再决定是否把它添加到左侧导航。`:`Try the draft first, then decide whether to add it to the sidebar.`})]})})]})}):Fe?(0,O.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_260px]`,children:[(0,O.jsx)(S,{className:`rounded-xl`}),(0,O.jsx)(S,{className:`rounded-xl`}),(0,O.jsx)(S,{className:`rounded-xl`})]}):ze||!D?(0,O.jsx)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:ze instanceof Error?ze.message:n?`找不到应用`:`App not found`}):(0,O.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 overflow-hidden bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_300px]`,children:[(0,O.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-accent`,children:[(0,O.jsx)(pe,{className:`size-4`}),n?`创作对话`:`Build conversation`]}),(0,O.jsx)(`div`,{className:`mt-4 rounded-xl bg-surface-panel p-3 text-sm leading-6 text-fg`,children:D.idea}),(0,O.jsxs)(`div`,{className:`mt-4 rounded-xl bg-accent-soft p-3`,children:[(0,O.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[(0,O.jsx)(ee,{className:`size-4`}),n?`草稿已准备好`:`Draft is ready`]}),(0,O.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`继续迭代会进入对应 Project,由 Coder 读取应用上下文和专属 skill。`:`Continue in the Project where Coder has the app context and dedicated skill.`})]}),(0,O.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),Q(it)},children:[(0,O.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`local-app-change-request`,children:n?`下一步想改什么?`:`What should change next?`}),(0,O.jsx)(be,{id:`local-app-change-request`,value:it,onChange:e=>at(e.target.value),suggestion:Se(n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`),onAcceptSuggestion:at,rows:4,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`}),(0,O.jsxs)(x,{type:`submit`,className:`mt-2 w-full`,disabled:P||!it.trim(),children:[P?(0,O.jsx)(l,{className:`size-4 animate-spin`}):(0,O.jsx)(C,{className:`size-4`}),n?`让 Coder 修改`:`Ask Coder to update`]})]}),(0,O.jsxs)(x,{variant:`ghost`,className:`mt-2 w-full`,onClick:()=>void Q(),disabled:P,children:[(0,O.jsx)(ye,{className:`size-4`}),n?`打开已有开发对话`:`Open development chat`]})]}),(0,O.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,O.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-edge-subtle px-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,O.jsx)(`span`,{className:`size-2 rounded-full ${k?.status===`failed`||F===`failed`||F===`timeout`||X?.status===`failed`?`bg-danger`:k?.status===`healthy`&&F===`healthy`&&X?.status===`passed`&&$?.sourceHash===k.sourceHash&&!W?`bg-success`:`bg-fg-subtle`}`}),F===`failed`||F===`timeout`?n?`预览运行异常`:`Preview runtime issue`:k?.status===`failed`||X?.status===`failed`?n?`自动验收未通过`:`Acceptance needs attention`:F===`booting`||!X?n?`自动验收中`:`Running acceptance`:W||$?.sourceHash!==k?.sourceHash?n?`正在保存验收快照`:`Saving acceptance snapshot`:n?`草稿已通过验收`:`Draft accepted`]}),(0,O.jsxs)(x,{variant:`ghost`,className:`h-8 px-2`,onClick:()=>void Z(!0),disabled:st,children:[st?(0,O.jsx)(l,{className:`size-3.5 animate-spin`}):(0,O.jsx)(re,{className:`size-3.5`}),n?`重新验收`:`Run again`]})]}),(0,O.jsx)(`iframe`,{ref:St,title:`${D.name} preview`,src:f(D.previewUrl),sandbox:Ue,className:`min-h-0 w-full flex-1 bg-white`,onError:()=>{ut({kind:`script_error`,message:`Preview document failed to load`}),I(`failed`)}},nt),k?.status===`healthy`&&k.acceptanceScenarioCount>0?(0,O.jsx)(`iframe`,{ref:Ct,title:`${D.name} acceptance runner`,src:`${f(D.previewUrl)}?xopcAcceptance=1&xopcScenario=${encodeURIComponent(z===`all`?J[B]?.id??``:z)}`,sandbox:Ue,"aria-hidden":`true`,tabIndex:-1,className:`pointer-events-none fixed left-[-200vw] top-0 h-[720px] w-[1024px] opacity-0`},`criteria-${nt}-${mt}-${B}`):null]}),(0,O.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n?`发布状态`:`Release status`}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:D.installationState===`not_installed`?n?`尚未安装`:`Not installed`:D.enabled?n?`版本 ${D.activeVersion} 正在使用`:`Version ${D.activeVersion} is active`:n?`已禁用,版本仍保留`:`Disabled, release retained`})]}),(0,O.jsx)(`span`,{className:`mt-1 size-2.5 rounded-full ${D.enabled?`bg-success`:`bg-fg-subtle`}`,"aria-hidden":!0})]}),(0,O.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-3 text-xs`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前草稿`:`Draft`}),(0,O.jsxs)(`dd`,{className:`mt-1 font-medium text-fg`,children:[`v`,D.draftVersion]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`已安装`:`Installed`}),(0,O.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:D.activeVersion?`v${D.activeVersion}`:`—`})]})]}),(0,O.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,O.jsx)(ue,{className:`size-4 text-accent`}),n?`草稿检查`:`Draft checks`]}),Ke||st?(0,O.jsx)(l,{className:`size-3.5 animate-spin text-fg-muted`}):k?.status===`healthy`?(0,O.jsx)(ee,{className:`size-4 text-success`}):(0,O.jsx)(de,{className:`size-4 text-danger`})]}),k?(0,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsx)(`p`,{className:`text-xs leading-5 ${k.status===`healthy`?`text-fg-muted`:`text-danger`}`,children:k.status===`healthy`?k.hasDraftChanges?n?`${k.changedFileCount} 个文件有改动,可以安装新版本。`:`${k.changedFileCount} changed files are ready for a new release.`:n?`草稿与当前安装版本一致。`:`Draft matches the installed release.`:k.issues[0]?.message}),k.changedFiles.length?(0,O.jsx)(`ul`,{className:`mt-2 space-y-1`,children:k.changedFiles.slice(0,4).map(e=>(0,O.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,O.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,O.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,k.changedFileCount>4?(0,O.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-subtle`,children:n?`还有 ${k.changedFileCount-4} 个文件`:`${k.changedFileCount-4} more files`}):null,(0,O.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,O.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,O.jsx)(`span`,{className:`size-2 rounded-full ${F===`healthy`?`bg-success`:F===`booting`?`bg-fg-subtle`:`bg-danger`}`}),n?`预览运行`:`Preview runtime`]}),(0,O.jsx)(`p`,{className:`mt-1 text-xs leading-5 ${F===`failed`||F===`timeout`?`text-danger`:`text-fg-muted`}`,children:lt?Re(lt):F===`healthy`?n?`已成功启动,未发现未捕获异常。`:`Started successfully with no uncaught errors.`:F===`timeout`?n?`7 秒内未完成启动,可能出现白屏或阻塞。`:`Did not finish booting within 7 seconds.`:n?`正在等待应用启动。`:`Waiting for the app to start.`})]}),(0,O.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,O.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,O.jsx)(`span`,{className:`size-2 rounded-full ${X?.status===`passed`?`bg-success`:X?.status===`failed`?`bg-danger`:`bg-fg-subtle`}`}),n?`自动验收`:`Automatic acceptance`]}),X?(0,O.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:X.checks.map(e=>(0,O.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px] leading-4 ${e.status===`failed`?`text-danger`:`text-fg-muted`}`,children:[(0,O.jsx)(`span`,{className:`mt-1 size-1.5 shrink-0 rounded-full ${e.status===`failed`?`bg-danger`:e.status===`passed`?`bg-success`:`bg-fg-subtle`}`}),(0,O.jsx)(`span`,{children:e.message})]},e.id))}):(0,O.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:k?.acceptanceScenarioCount?n?`正在检查页面基础质量和 ${k.acceptanceScenarioCount} 个产品场景。`:`Checking page quality and ${k.acceptanceScenarioCount} product scenario(s).`:n?`正在检查页面内容和基础交互。`:`Checking rendered content and basic interaction.`}),W?(0,O.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-[11px] text-fg-muted`,children:[(0,O.jsx)(l,{className:`size-3 animate-spin`}),n?`正在保存当前源码对应的验收快照…`:`Saving the acceptance snapshot for this source…`]}):$?(0,O.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-fg-muted`,children:It?n?`相比上次:已修复 ${Bt} 项,仍有 ${Lt.length} 项。`:`Since the previous run: ${Bt} fixed, ${Lt.length} remaining.`:n?`首个验收快照已保存。`:`First acceptance snapshot saved.`}):null,(0,O.jsx)(He,{scenarios:J,results:R,runningTarget:gt,zh:n,onRunAll:Mt,onRunScenario:Nt,onAskCoder:Pt})]}),zt?(0,O.jsxs)(x,{className:`mt-3 w-full`,onClick:jt,disabled:P,children:[(0,O.jsx)(C,{className:`size-4`}),n?`让 Coder 修复`:`Ask Coder to fix`]}):null]}):(0,O.jsx)(S,{className:`mt-2 h-12 rounded-lg`})]}),(0,O.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,O.jsx)(ge,{className:`size-4 text-accent`}),n?`权限`:`Permissions`]}),(0,O.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(k?.permissions??D.permissions).map(e=>(0,O.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:e},e))})]}),(0,O.jsx)(x,{variant:`primary`,className:`mt-5 w-full`,onClick:()=>void Vt(),disabled:j||Ke||st||W||k?.status===`failed`||F!==`healthy`||X?.status!==`passed`||!$||$.sourceHash!==k?.sourceHash||D.installationState===`installed`&&k?.hasDraftChanges===!1,children:D.installationState===`installed`?n?`安装当前更新`:`Install current update`:n?`添加到左侧导航`:`Add to sidebar`}),D.installationState===`installed`?(0,O.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,O.jsxs)(x,{className:`min-w-0 flex-1`,onClick:()=>void Ot(!D.enabled),disabled:j,children:[D.enabled?(0,O.jsx)(oe,{className:`size-4`}):(0,O.jsx)(ae,{className:`size-4`}),D.enabled?n?`禁用`:`Disable`:n?`启用`:`Enable`]}),(0,O.jsx)(x,{variant:`ghost`,className:`text-danger hover:text-danger`,onClick:()=>tt(!0),disabled:j,"aria-label":n?`卸载应用`:`Uninstall app`,children:(0,O.jsx)(fe,{className:`size-4`})})]}):null,(0,O.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4`,children:[(0,O.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,O.jsx)(_e,{className:`size-4`}),n?`版本历史`:`Release history`]}),D.releases.length?(0,O.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,children:D.releases.map(e=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[`v`,e.version,e.isActive?(0,O.jsx)(`span`,{className:`rounded-full bg-success-soft px-1.5 py-0.5 text-[10px] text-success`,children:n?`当前`:`Active`}):null]}),(0,O.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-fg-subtle`,children:We(e.createdAt,r)})]}),e.isActive?null:(0,O.jsxs)(x,{variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>void kt(e.id),disabled:j,children:[(0,O.jsx)(ie,{className:`size-3.5`}),n?`恢复`:`Restore`]})]},e.id))}):(0,O.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n?`安装首个版本后,可以从这里恢复。`:`Install the first version to enable recovery.`})]}),Ze?(0,O.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-danger`,role:`alert`,children:Ze}):null]}),(0,O.jsx)(y,{open:Qe,onOpenChange:$e,children:(0,O.jsxs)(g,{children:[(0,O.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,O.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(560px,calc(100vh-32px))] w-[min(520px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-2xl focus:outline-none`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{className:`text-base font-semibold text-fg`,children:n?`确认安装到 XOPC`:`Confirm installation`}),(0,O.jsx)(m,{className:`mt-1 text-sm text-fg-muted`,children:n?`当前草稿会成为左侧导航中的可用版本。`:`The current draft will become the version available in the sidebar.`})]}),(0,O.jsx)(h,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,O.jsx)(u,{className:`size-4`})})]}),(0,O.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,O.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:D.name}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:D.extensionId})]}),(0,O.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`本次迭代`:`This iteration`}),(0,O.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-3 text-xs`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`文件变化`:`Changed files`}),(0,O.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:k?.changedFileCount??0})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`自动验收`:`Acceptance`}),(0,O.jsxs)(`dd`,{className:`mt-1 flex items-center gap-1.5 font-medium text-success`,children:[(0,O.jsx)(ee,{className:`size-3.5`}),n?`已通过并保存`:`Passed and saved`]})]})]}),k?.changedFiles.length?(0,O.jsx)(`ul`,{className:`mt-3 space-y-1`,children:k.changedFiles.slice(0,5).map(e=>(0,O.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,O.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,O.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,(0,O.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`请求权限`:`Requested permissions`}),(0,O.jsx)(`ul`,{className:`mt-2 space-y-2`,children:(k?.permissions??D.permissions).map(e=>(0,O.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,O.jsx)(s,{className:`size-4 text-success`}),e,D.installationState===`installed`&&k?.permissionDelta.added.includes(e)?(0,O.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-0.5 text-[10px] text-warning`,children:n?`新增`:`New`}):null]},e))}),D.installationState===`installed`&&k?.permissionDelta.added.length?(0,O.jsx)(`p`,{className:`mt-4 rounded-xl bg-warning-soft p-3 text-xs leading-5 text-warning`,children:n?`此更新增加了权限,请确认这些能力符合你的修改意图。`:`This update adds permissions. Confirm they match the change you requested.`}):null,(0,O.jsx)(`p`,{className:`mt-5 rounded-xl bg-accent-soft p-3 text-xs leading-5 text-accent-fg`,children:n?`Phase 1 应用只能使用界面主题和本地存储,不能访问网络或运行系统命令。`:`Phase 1 apps can use theme and local storage only. They cannot access the network or run system commands.`})]}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,O.jsx)(h,{asChild:!0,children:(0,O.jsx)(x,{children:n?`取消`:`Cancel`})}),(0,O.jsxs)(x,{variant:`primary`,onClick:()=>void Et(),disabled:j,children:[j?(0,O.jsx)(l,{className:`size-4 animate-spin`}):(0,O.jsx)(c,{className:`size-4`}),n?`确认安装`:`Install`]})]})]})]})}),(0,O.jsx)(y,{open:et,onOpenChange:tt,children:(0,O.jsxs)(g,{children:[(0,O.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,O.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(420px,calc(100vh-32px))] w-[min(500px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-2xl focus:outline-none`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{className:`text-base font-semibold text-fg`,children:n?`卸载当前应用?`:`Uninstall this app?`}),(0,O.jsx)(m,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:n?`应用会从侧栏移除,但 Project、源码、版本历史和本地数据都会保留。`:`The app leaves the sidebar, while its Project, source, release history, and local data remain.`})]}),(0,O.jsx)(h,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,O.jsx)(u,{className:`size-4`})})]}),(0,O.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,O.jsxs)(`div`,{className:`rounded-xl bg-surface-panel p-4`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:D.name}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`之后可从任意保留版本重新安装。`:`You can reinstall any retained release later.`})]})}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,O.jsx)(h,{asChild:!0,children:(0,O.jsx)(x,{children:n?`取消`:`Cancel`})}),(0,O.jsxs)(x,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void At(),disabled:j,children:[j?(0,O.jsx)(l,{className:`size-4 animate-spin`}):(0,O.jsx)(fe,{className:`size-4`}),n?`卸载但保留 Project`:`Uninstall and keep Project`]})]})]})]})})]})}export{k as LocalAppWorkbenchPage};
|
package/dist/gateway/static/root/assets/{local-apps-page-CHxyT09t.js → local-apps-page-BtgDJ92Q.js}
RENAMED
|
@@ -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{t as i}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as a}from"./plus-Q2yW6OE7.js";import{n as o}from"./locale-store-
|
|
1
|
+
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"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as a}from"./plus-Q2yW6OE7.js";import{n as o}from"./locale-store-DlOv7896.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{t as c}from"./button-BA45yciM.js";import{t as l}from"./skeleton-BwbyijEw.js";import{Eu as u,Lu as d,mo as f}from"./index-ChIrvv3t.js";import{i as p}from"./api-Coly9ab6.js";var m=n(),h=e(t(),1),g=r();function _(){let e=(0,m.c)(20),t=o(x)===`zh`,n=f(b),r=f(y),{data:l,isLoading:_,error:S}=s(`local-apps-list`,p),C,w;e[0]!==r||e[1]!==n||e[2]!==t?(C=()=>(n({startExtra:null,main:(0,g.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t?`应用工坊`:`App Workshop`}),end:(0,g.jsx)(c,{asChild:!0,variant:`primary`,className:`h-9`,children:(0,g.jsxs)(i,{to:`/local-apps/new`,children:[(0,g.jsx)(a,{className:`size-4`}),t?`创建应用`:`Create app`]})})}),()=>r()),w=[r,n,t],e[0]=r,e[1]=n,e[2]=t,e[3]=C,e[4]=w):(C=e[3],w=e[4]),(0,h.useLayoutEffect)(C,w);let T=t?`把自己的工具放进 XOPC`:`Put your own tools inside XOPC`,E;e[5]===T?E=e[6]:(E=(0,g.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:T}),e[5]=T,e[6]=E);let D=t?`每个应用都会自动创建一个由 Coder 负责的 Project,可预览、安装到侧栏,并持续迭代。`:`Every app gets a Coder-owned Project for previewing, installing in the sidebar, and ongoing iteration.`,O;e[7]===D?O=e[8]:(O=(0,g.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:D}),e[7]=D,e[8]=O);let k;e[9]!==E||e[10]!==O?(k=(0,g.jsxs)(`div`,{className:`mb-7 max-w-2xl`,children:[E,O]}),e[9]=E,e[10]=O,e[11]=k):k=e[11];let A;e[12]!==l||e[13]!==S||e[14]!==_||e[15]!==t?(A=_?(0,g.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:3}).map(v)}):S?(0,g.jsx)(`p`,{className:`rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:S instanceof Error?S.message:String(S)}):l?.length?(0,g.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,g.jsxs)(i,{to:`/local-apps/${encodeURIComponent(e.id)}`,className:`group flex min-h-44 flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,g.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:(0,g.jsx)(u,{className:`size-5`})}),(0,g.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:e.installationState===`not_installed`?t?`草稿`:`Draft`:e.enabled?t?`已在侧栏`:`In sidebar`:t?`已禁用`:`Disabled`})]}),(0,g.jsx)(`h3`,{className:`mt-4 truncate text-sm font-semibold text-fg`,children:e.name}),(0,g.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description||e.idea}),(0,g.jsxs)(`div`,{className:`mt-auto flex items-center justify-end pt-3 text-xs font-medium text-accent`,children:[t?`打开工作台`:`Open workbench`,(0,g.jsx)(d,{className:`ml-1 size-3.5 transition-transform group-hover:translate-x-0.5`})]})]},e.id))}):(0,g.jsxs)(`div`,{className:`px-6 py-16 text-center`,children:[(0,g.jsx)(u,{className:`mx-auto size-8 text-fg-subtle`}),(0,g.jsx)(`h3`,{className:`mt-4 text-sm font-semibold text-fg`,children:t?`还没有本地应用`:`No local apps yet`}),(0,g.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-sm text-fg-muted`,children:t?`描述你想解决的问题,XOPC 会创建应用骨架和可持续开发的 Project。`:`Describe the problem and XOPC will create an app scaffold and an ongoing Project.`}),(0,g.jsx)(c,{asChild:!0,variant:`primary`,className:`mt-5`,children:(0,g.jsxs)(i,{to:`/local-apps/new`,children:[(0,g.jsx)(a,{className:`size-4`}),t?`创建第一个应用`:`Create your first app`]})})]}),e[12]=l,e[13]=S,e[14]=_,e[15]=t,e[16]=A):A=e[16];let j;return e[17]!==k||e[18]!==A?(j=(0,g.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-panel px-3 py-8 sm:px-5 xl:px-6`,children:(0,g.jsxs)(`div`,{className:`mx-auto max-w-6xl`,children:[k,A]})}),e[17]=k,e[18]=A,e[19]=j):j=e[19],j}function v(e,t){return(0,g.jsx)(l,{className:`h-44 rounded-xl`},t)}function y(e){return e.clearPageHeader}function b(e){return e.setPageHeader}function x(e){return e.language}export{_ as LocalAppsPage};
|
package/dist/gateway/static/root/assets/{locale-store-DO6JJ1l2.js → locale-store-DlOv7896.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./messages-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./messages-Ls1Aaiqd.js";var r=e(t(),1),i=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},a=(e=>e?i(e):i),o=e=>e;function s(e,t=o){let n=r.useSyncExternalStore(e.subscribe,r.useCallback(()=>t(e.getState()),[e,t]),r.useCallback(()=>t(e.getInitialState()),[e,t]));return r.useDebugValue(n),n}var c=e=>{let t=a(e),n=e=>s(t,e);return Object.assign(n,t),n},l=(e=>e?c(e):c);function u(e){let t=(e??``).trim().toLowerCase().replace(/_/g,`-`);return t&&(t===`zh`||t.startsWith(`zh-`))?`zh`:`en`}function d(){if(typeof navigator>`u`)return`en`;let e=(navigator.language||navigator.languages?.[0]||``).trim();return e?u(e):`en`}function f(e){return e===`zh`?`zh-CN`:`en`}function p(e){document.documentElement.setAttribute(`lang`,f(e)),document.title=n(e).appTitle}function m(){return K.getState().language}function h(e,t,n){let r=e.trim().toLowerCase();return!!(!r||r===`http ${t}`||n&&r===n.trim().toLowerCase()||t===429&&(r===`rate_limited`||r===`too many requests`||r===`too many authentication attempts`)||t===500&&r===`internal server error`)}function g(e,t,r){let i=r?.trim()??``;if(i&&!h(i,e,t))return i;let a=n(m()).api;return e>=500?e===502?a.errorBadGateway:e===503?a.errorServiceUnavailable:e===504?a.errorGatewayTimeout:e===500?a.errorInternal:a.errorServer.replace(`{{status}}`,String(e)):e===404?a.errorNotFound:e===403?a.errorForbidden:e===429?a.errorRateLimited:a.errorRequest.replace(`{{status}}`,String(e))}var _=`xopc.token`,v=`xopc.language`;function y(){try{return localStorage.getItem(_)||``}catch{return``}}function b(){try{localStorage.removeItem(_)}catch{}}function x(){return S()||d()}function S(){try{let e=localStorage.getItem(v);return e===`en`||e===`zh`?e:null}catch{return null}}function C(e){try{localStorage.setItem(v,e)}catch(e){console.error(`Failed to save language:`,e)}}var w=l(e=>({baseUrl:typeof window<`u`?window.location.origin:``,sessionKey:void 0,tokenDialogOpen:!1,tokenExpired:!1,setBrowserSession:t=>{b(),e({sessionKey:t,tokenDialogOpen:!1,tokenExpired:!1}),window.dispatchEvent(new CustomEvent(`gateway-authenticated`))},clearBrowserSession:()=>{fetch(`/api/browser-session`,{method:`DELETE`,credentials:`same-origin`,redirect:`error`,signal:AbortSignal.timeout(8e3)}).catch(()=>{}),e({sessionKey:void 0})},openTokenDialog:()=>e({tokenDialogOpen:!0}),closeTokenDialog:()=>e({tokenDialogOpen:!1}),onUnauthorized:()=>{e({sessionKey:void 0,tokenDialogOpen:!1,tokenExpired:!0}),window.dispatchEvent(new CustomEvent(`gateway-auth-expired`))}}));async function T(e){return fetch(`/api/browser-session`,{method:`POST`,credentials:`same-origin`,redirect:`error`,signal:AbortSignal.timeout(8e3),headers:{Authorization:`Bearer ${e}`}})}async function E(){try{let e=await fetch(`/api/browser-session`,{credentials:`same-origin`,redirect:`error`,signal:AbortSignal.timeout(8e3)});if(e.ok){let t=await e.json();if(t.sessionKey){w.getState().setBrowserSession(t.sessionKey);return}}if(e.status!==401)return;let t=window.electronAPI?.gateway?.getCredential,n=typeof t==`function`?await t():y();if(!n)return;let r=await T(n);if(!r.ok)return;let i=await r.json();i.sessionKey&&w.getState().setBrowserSession(i.sessionKey)}catch{}}var D=null,O=null;function k(){D||=new Promise(e=>{O=e})}function A(){D&&(O?.(),D=null,O=null)}typeof window<`u`&&window.addEventListener(`gateway-authenticated`,A);async function j(e,t){D&&await D;let n=new Headers(t?.headers),r=t?.body,i=typeof FormData<`u`&&r instanceof FormData;!n.has(`Content-Type`)&&!i&&n.set(`Content-Type`,`application/json`);let a=await fetch(e,{...t,credentials:`same-origin`,redirect:`error`,headers:n});return a.status===401&&(k(),w.getState().onUnauthorized()),a}async function M(e,t){let n=await j(e,t);if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message,r=g(n.status,n.statusText,t),i=n.headers.get(`Retry-After`),a=i==null?NaN:Number(i);throw Object.assign(Error(r),{status:n.status,body:e,...Number.isFinite(a)&&a>=0?{retryAfterMs:a*1e3}:{}})}return n.json()}function N(){return window.location.origin}function P(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${N()}${t}`}var F,I,L,R;function z(e){return e===`en`||e===`zh`}function B(e){C(e),p(e)}function V(e){window.electronAPI?.locale?.setLanguage(e).catch(()=>{})}function H(e,t){return e?.token===t.token&&e.language===t.language}async function U(){for(;I;){let e=I;I=void 0,F=e,(await Promise.allSettled([M(P(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:e.language})}),M(P(`/api/user-model/assertions`),{method:`POST`,body:JSON.stringify({scope:{type:`global`},subject:{type:`user`,id:`self`},predicate:`preference.locale`,cardinality:`single`,kind:`preference`,value:e.language===`zh`?`zh-CN`:`en`,statement:e.language===`zh`?`The user prefers Chinese.`:`The user prefers English.`,volatility:`slow`,declaredImportance:.8})})])).every(e=>e.status===`fulfilled`)&&(L=e),F=void 0}}function W(){R||=U().finally(()=>{R=void 0,I&&W()})}function G(e){let t=w.getState().sessionKey;if(!t)return;let n={token:t,language:e};if(H(F,n)){I=void 0;return}H(I,n)||!F&&H(L,n)||(I=n,W())}var K=l(e=>({language:x(),setLanguage:t=>{B(t),e({language:t}),V(t),G(t)}}));function q(){G(K.getState().language);let e=w.subscribe((e,t)=>{e.sessionKey&&e.sessionKey!==t.sessionKey&&G(K.getState().language)}),t=window.electronAPI?.locale;if(!t)return e;let n=!1,r=S();r?V(r):t.getLanguage().then(e=>{n||!z(e)||(B(e),K.setState({language:e}),G(e))});let i=t.onChanged(e=>{n||!z(e)||(B(e),K.setState({language:e}),G(e))});return()=>{n=!0,i(),e()}}export{M as a,w as c,p as d,f,j as i,x as l,K as n,T as o,l as p,P as r,E as s,q as t,g as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{h as i}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{d as a,f as o,n as s,p as c,r as l,u}from"./popover-select-DGmMQt4t.js";import{t as d}from"./download-Dk-ZjtO6.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./cn-JdwAhgNB.js";import{a as m,c as h,n as g,r as _}from"./locale-store-DlOv7896.js";import{t as v}from"./messages-Ls1Aaiqd.js";import{a as y,n as b,o as x,r as S,s as C,t as w}from"./dist-BGTk37IG.js";import{t as T}from"./copy-to-clipboard-HOJ79TWv.js";import{t as E}from"./button-BA45yciM.js";import{t as D}from"./skeleton-BwbyijEw.js";import{i as O,o as k,s as A}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Dc as j,Fl as M,Il as N,Oo as P,Sc as F,To as I,Ul as L,Xa as R,Yi as z,ba as B,bu as ee,ec as V,ll as te,lu as H,zt as U}from"./index-ChIrvv3t.js";var W=e(t(),1),G=n();function K(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.sessionKey&&t.set(`sessionKey`,e.sessionKey),e.sessionId&&t.set(`sessionId`,e.sessionId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function q(e){return m(_(`/api/logs${K(e)}`))}async function J(){return(await m(_(`/api/logs/files`))).files??[]}async function Y(){return(await m(_(`/api/logs/modules`))).modules??[]}async function X(){let e=await m(_(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function Z(){return(await m(_(`/api/logs/dir`))).dir??``}async function Q(){return(await m(_(`/api/logs/level`))).level??`info`}async function ne(e,t){return m(_(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function re(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await m(_(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var ie=500,ae=class{_callbacks;_cleanup;constructor(e){this._callbacks=e}connect(e,t){this.disconnect();let n=new Set(e?.length?e:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);this._cleanup=R(`logs`,{onEvent:e=>{if(e.event!==`log.entry`||!e.data||typeof e.data!=`object`)return;let r=e.data;!n.has(r.level)||t&&r.module!==t||this._callbacks.onEntry(r)},onGap:()=>this._callbacks.onError(`Live log replay gap; refresh the log query`)}),this._callbacks.onConnected()}disconnect(){this._cleanup?.(),this._cleanup=void 0}};function oe(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,ie)}var se=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function ce(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function le(e){return e.toSorted((e,t)=>ce(t)-ce(e))}var ue=new Set(se),de=[`error`,`fatal`],fe=[`warn`,`error`,`fatal`],pe=[`info`,`warn`,`error`,`fatal`];function me(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();ue.has(e)&&t.add(e)}return t}function he(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ge(e,t){return e.size===t.length?t.every(t=>e.has(t)):!1}function _e(e){return e.size===0?`all`:ge(e,de)?`errors`:ge(e,fe)?`warnPlus`:ge(e,pe)?`infoPlus`:e.size===se.length&&se.every(t=>e.has(t))?`verbose`:`custom`}function ve(e){let t=_e(e);return t===`custom`?`other`:t}function ye(e){switch(e){case`all`:return new Set;case`errors`:return new Set(de);case`warnPlus`:return new Set(fe);case`infoPlus`:return new Set(pe);case`verbose`:return new Set(se)}}function be(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function xe(e){return String(e.module||e.service||e.extension||`—`)}function Se(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function Ce(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function we(e){try{return new Date(e).toLocaleString()}catch{return e}}function Te(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ee(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function De(e){return String(e).toLowerCase()}function Oe(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function ke(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function Ae(e){let t=e.err??e.meta?.err;if(!t||typeof t!=`object`)return null;let n=t;return{name:typeof n.name==`string`?n.name:void 0,message:typeof n.message==`string`?n.message:void 0,stack:typeof n.stack==`string`?n.stack:void 0}}function je(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&xe(e)!==t.moduleFilter||t.requestIdFilter&&e.requestId!==t.requestIdFilter||t.sessionIdFilter&&e.sessionId!==t.sessionIdFilter&&e.sessionKey!==t.sessionIdFilter)return!1;if(t.dateFrom){let n=new Date(t.dateFrom).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r<n)return!1}if(t.dateTo){let n=new Date(t.dateTo).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r>n)return!1}if(t.debouncedSearch){let n=t.debouncedSearch.toLowerCase();if(![e.message,xe(e),Oe(e),e.requestId,e.sessionKey,e.sessionId,Ae(e)?.message,Ae(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Me(e,t){let n=[];for(let r of se){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Ne(e,t){switch(t.type){case`setSearchInput`:return e.searchInput===t.value?e:{...e,searchInput:t.value};case`setDebouncedSearch`:return e.debouncedSearch===t.value?e:{...e,debouncedSearch:t.value};case`setLevels`:return he(e.selectedLevels,t.value)?e:{...e,selectedLevels:t.value};case`toggleLevel`:{let n=new Set(e.selectedLevels);return n.has(t.level)?n.delete(t.level):n.add(t.level),{...e,selectedLevels:n}}case`setModule`:return e.moduleFilter===t.value?e:{...e,moduleFilter:t.value};case`setRequestIdFilter`:return e.requestIdFilter===t.value?e:{...e,requestIdFilter:t.value};case`setSessionIdFilter`:return e.sessionIdFilter===t.value?e:{...e,sessionIdFilter:t.value};case`setDateFrom`:return e.dateFrom===t.value?e:{...e,dateFrom:t.value};case`setDateTo`:return e.dateTo===t.value?e:{...e,dateTo:t.value};case`setAutoRefresh`:return e.autoRefresh===t.value?e:{...e,autoRefresh:t.value};case`syncFromUrl`:{let n=t.payload;return e.searchInput===n.searchInput&&e.debouncedSearch===n.debouncedSearch&&he(e.selectedLevels,n.selectedLevels)&&e.moduleFilter===n.moduleFilter&&e.requestIdFilter===n.requestIdFilter&&e.sessionIdFilter===n.sessionIdFilter&&e.dateFrom===n.dateFrom&&e.dateTo===n.dateTo&&e.autoRefresh===n.autoRefresh?e:{...e,...n}}case`clearAll`:return{searchInput:``,debouncedSearch:``,selectedLevels:new Set,moduleFilter:``,requestIdFilter:``,sessionIdFilter:``,dateFrom:``,dateTo:``,autoRefresh:e.autoRefresh}}}var Pe={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function Fe(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:le(t.logs),hasMore:t.hasMore};case`queryError`:return t.resetLogs?{...e,loading:!1,error:t.message,logs:[],hasMore:!1}:{...e,loading:!1,error:t.message};case`appendSuccess`:return{...e,loading:!1,logs:le([...e.logs,...t.logs]),hasMore:t.hasMore};case`metaSuccess`:return{...e,modules:t.modules,stats:t.stats,files:t.files};case`filesSuccess`:return{...e,files:t.files,logDir:t.logDir};case`filesClear`:return{...e,files:[]};case`liveTick`:return{...e,logs:le(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:le(oe(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:le(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function Ie(e){let t=v(e).logs,n=h(e=>e.sessionKey),r=!!n,[a,o]=i(),s=(0,W.useRef)(a),[c,l]=(0,W.useReducer)(Ne,void 0,()=>{let e=s.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:me(e.get(`level`)),moduleFilter:e.get(`module`)??``,requestIdFilter:e.get(`requestId`)??``,sessionIdFilter:e.get(`sessionId`)??``,dateFrom:e.get(`from`)??``,dateTo:e.get(`to`)??``,autoRefresh:e.get(`live`)===`1`}}),[u,d]=(0,W.useReducer)(Fe,Pe),[f,p]=(0,W.useState)(null),[m,g]=(0,W.useState)(!1),[_,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)([]),[w,T]=(0,W.useState)(!1),{searchInput:E,debouncedSearch:D,selectedLevels:O,moduleFilter:k,requestIdFilter:A,sessionIdFilter:j,dateFrom:M,dateTo:N,autoRefresh:P}=c,{logs:F,loading:I,error:L,hasMore:R,modules:z,files:ee,stats:V,logDir:te}=u,H=(0,W.useCallback)(e=>l({type:`setSearchInput`,value:e}),[]),U=(0,W.useCallback)(e=>l({type:`setLevels`,value:e}),[]),G=(0,W.useCallback)(e=>l({type:`setModule`,value:e}),[]),K=(0,W.useCallback)(e=>l({type:`setRequestIdFilter`,value:e}),[]),Q=(0,W.useCallback)(e=>l({type:`setSessionIdFilter`,value:e}),[]),ne=(0,W.useCallback)(e=>l({type:`setDateFrom`,value:e}),[]),ie=(0,W.useCallback)(e=>l({type:`setDateTo`,value:e}),[]),oe=(0,W.useCallback)(e=>l({type:`setAutoRefresh`,value:e}),[]),se=(0,W.useMemo)(()=>ve(O),[O]),ce=e=>{if(e===`other`){y(!0);return}l({type:`setLevels`,value:ye(e)})},le=D.length>0||O.size>0||!!k||!!A||!!j||!!M||!!N,ue=+(D.length>0)+ +(O.size>0)+ +!!k+ +!!A+ +!!j+(M||N?1:0);(0,W.useEffect)(()=>{let e=setTimeout(()=>l({type:`setDebouncedSearch`,value:E.trim()}),300);return()=>clearTimeout(e)},[E]),(0,W.useEffect)(()=>{let e=a.get(`q`)??``;l({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:me(a.get(`level`)),moduleFilter:a.get(`module`)??``,requestIdFilter:a.get(`requestId`)??``,sessionIdFilter:a.get(`sessionId`)??``,dateFrom:a.get(`from`)??``,dateTo:a.get(`to`)??``,autoRefresh:a.get(`live`)===`1`}})},[a]),(0,W.useEffect)(()=>{let e=new URLSearchParams(a),t=D.trim();t?e.set(`q`,t):e.delete(`q`),O.size>0?e.set(`level`,Array.from(O).sort().join(`,`)):e.delete(`level`),k?e.set(`module`,k):e.delete(`module`),A?e.set(`requestId`,A):e.delete(`requestId`),j?e.set(`sessionId`,j):e.delete(`sessionId`),M?e.set(`from`,M):e.delete(`from`),N?e.set(`to`,N):e.delete(`to`),P?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&o(e,{replace:!0})},[P,M,N,D,k,A,j,a,O,o]);let de=(0,W.useMemo)(()=>({q:D||void 0,level:O.size>0?Array.from(O):void 0,module:k||void 0,requestId:A||void 0,sessionId:j||void 0,from:M||void 0,to:N||void 0,limit:50}),[D,O,k,A,j,M,N]),fe=(0,W.useMemo)(()=>({debouncedSearch:D,selectedLevels:O,moduleFilter:k,requestIdFilter:A,sessionIdFilter:j,dateFrom:M,dateTo:N}),[D,O,k,A,j,M,N]),pe=(0,W.useRef)(fe);return pe.current=fe,(0,W.useEffect)(()=>{if(!r)return;let e=!1;return T(!0),re({from:M||void 0,to:N||void 0,limit:12}).then(t=>{e||C(t)}).catch(()=>{e||C([])}).finally(()=>{e||T(!1)}),()=>{e=!0}},[r,M,N]),(0,W.useEffect)(()=>{if(!r)return;let e=!1;return d({type:`queryStart`}),(async()=>{try{let t=await q({...de,offset:0});if(e)return;d({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||d({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,de,t.loadError]),(0,W.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([Y(),X(),J()]);e||d({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,W.useEffect)(()=>{if(!r||!m)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([J(),Z()]);e||d({type:`filesSuccess`,files:t,logDir:n})}catch{e||d({type:`filesClear`})}})(),()=>{e=!0}},[r,m]),(0,W.useEffect)(()=>{if(!P||!r)return;let e=new ae({onConnected:()=>{},onEntry:e=>{je(e,pe.current)&&d({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(O.size>0?Array.from(O):void 0,k||void 0);let t=window.setInterval(()=>{X().then(e=>{d({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[P,r,n,O,k]),(0,W.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),2e3);return()=>clearTimeout(e)},[b]),{L:t,hasToken:r,logs:F,loading:I,error:L,hasMore:R,searchInput:E,setSearchInput:H,selectedLevels:O,setSelectedLevels:U,moduleFilter:k,setModuleFilter:G,requestIdFilter:A,sessionIdFilter:j,dateFrom:M,setDateFrom:ne,dateTo:N,setDateTo:ie,modules:z,files:ee,stats:V,selectedLog:f,setSelectedLog:p,filesOpen:m,setFilesOpen:g,filtersOpen:_,setFiltersOpen:y,logDir:te,autoRefresh:P,setAutoRefresh:oe,copiedDetail:b,setCopiedDetail:x,hasActiveFilters:le,activeFilterCount:ue,clearFilters:()=>l({type:`clearAll`}),toggleDialogLevel:e=>l({type:`toggleLevel`,level:e}),handleLoadMore:()=>{I||!R||(async()=>{d({type:`queryStart`});try{let e=await q({...de,offset:F.length});d({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){d({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{d({type:`queryStart`});try{let e=await q({...de,offset:0}),[t,n]=await Promise.all([X(),J()]);d({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){d({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:se,handleLevelSegment:ce,filterByRequestId:(0,W.useCallback)(e=>{p(null),K(e)},[K]),filterBySessionId:(0,W.useCallback)(e=>{p(null),Q(e)},[Q]),filterByErrorSummary:(0,W.useCallback)(e=>{l({type:`setSearchInput`,value:e.errName}),l({type:`setDebouncedSearch`,value:e.errName}),e.module&&l({type:`setModule`,value:e.module}),l({type:`setLevels`,value:ye(`errors`)})},[]),openChatForSession:(0,W.useCallback)(e=>{let t=e.sessionKey?.trim();if(t){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:t}}));return}let n=e.sessionId?.trim();n&&B({sessionId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:e.sessionKey}}))}).catch(()=>{})},[]),errorSummary:S,errorSummaryLoading:w}}var $=r();function Le(e){let t=(0,G.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,W.useState)(!1);if(!i&&r.length===0)return null;let c;t[0]===r?c=t[1]:(c=r.reduce(ze,0),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(Re),t[2]=u):u=t[2];let d;t[3]===n.errorSummaryTitle?d=t[4]:(d=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=d);let f;t[5]===n.errorSummaryHint?f=t[6]:(f=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=f);let m;t[7]!==d||t[8]!==f?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=m):m=t[9];let h;t[10]!==r.length||t[11]!==i||t[12]!==l?(h=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(D,{className:`h-5 w-10 rounded-md`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:r.length}),(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-hover px-2 py-0.5 text-xs tabular-nums text-fg-muted`,children:[`×`,l]})]}),t[10]=r.length,t[11]=i,t[12]=l,t[13]=h):h=t[13];let g=o&&`rotate-180`,_;t[14]===g?_=t[15]:(_=p(`size-4 text-fg-muted transition-transform duration-150 ease-out motion-reduce:transition-none`,g),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,$.jsx)(ee,{className:_,strokeWidth:1.75,"aria-hidden":!0}),t[16]=_,t[17]=v);let y;t[18]!==h||t[19]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-0.5`,children:[h,v]}),t[18]=h,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`button`,{type:`button`,onClick:u,"aria-expanded":o,className:`flex w-full items-start justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,children:[m,y]}),t[21]=o,t[22]=y,t[23]=m,t[24]=b):b=t[24];let x;t[25]!==n.module||t[26]!==n.phase||t[27]!==n.time||t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==a?(x=o&&!i&&r.length>0?(0,$.jsx)(`ul`,{className:`divide-y divide-edge-subtle border-t border-edge-subtle dark:divide-edge dark:border-edge`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a?.(e),className:p(`flex w-full flex-col gap-1 px-4 py-2.5 text-left transition-colors hover:bg-surface-hover`,a&&`cursor-pointer`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.errName}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:[`×`,e.count]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[e.phase?(0,$.jsxs)(`span`,{children:[n.phase,`: `,e.phase]}):null,e.module?(0,$.jsxs)(`span`,{children:[n.module,`: `,e.module]}):null,(0,$.jsxs)(`span`,{children:[n.time,`: `,Ce(e.lastSeen)]})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.sampleMessage})]})},e.key))}):null,t[25]=n.module,t[26]=n.phase,t[27]=n.time,t[28]=o,t[29]=r,t[30]=i,t[31]=a,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-panel shadow-surface`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function Re(e){return!e}function ze(e,t){return e+t.count}function Be(e){let t=(0,G.c)(75),{log:n,labels:r,onFilterByRequestId:i,onFilterBySessionId:a,onOpenChat:o}=e,s=n.level??`info`,c=typeof n.requestId==`string`?n.requestId:``,l=typeof n.sessionKey==`string`?n.sessionKey:``,u=typeof n.sessionId==`string`?n.sessionId:``,d;t[0]===n?d=t[1]:(d=Oe(n),t[0]=n,t[1]=d);let f=d,m;t[2]===n?m=t[3]:(m=Ae(n),t[2]=n,t[3]=m);let h=m,g=s===`error`||s===`fatal`,_;t[4]===r.message?_=t[5]:(_=(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.message}),t[4]=r.message,t[5]=_);let v=g&&`border-red-500/40`,y;t[6]===v?y=t[7]:(y=p(`mt-2 whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,v),t[6]=v,t[7]=y);let b=n.message||`—`,x;t[8]!==y||t[9]!==b?(x=(0,$.jsx)(`pre`,{className:y,children:b}),t[8]=y,t[9]=b,t[10]=x):x=t[10];let S;t[11]!==_||t[12]!==x?(S=(0,$.jsxs)(`div`,{children:[_,x]}),t[11]=_,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==h||t[15]!==r.stackTrace?(C=h?.stack?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.stackTrace}),h.name?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:h.name}):null,(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-red-500/30 bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-red-500/30`,children:h.stack})]}):null,t[14]=h,t[15]=r.stackTrace,t[16]=C):C=t[16];let w;t[17]===r.time?w=t[18]:(w=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=w);let T;t[19]===n.timestamp?T=t[20]:(T=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:n.timestamp}),t[19]=n.timestamp,t[20]=T);let D;t[21]===r.level?D=t[22]:(D=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.level}),t[21]=r.level,t[22]=D);let O=g&&`font-medium text-red-600 dark:text-red-400`,k;t[23]===O?k=t[24]:(k=p(`text-fg`,O),t[23]=O,t[24]=k);let A;t[25]===s?A=t[26]:(A=De(s),t[25]=s,t[26]=A);let j;t[27]!==k||t[28]!==A?(j=(0,$.jsx)(`span`,{className:k,children:A}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;t[30]===r.module?M=t[31]:(M=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.module}),t[30]=r.module,t[31]=M);let N;t[32]===n?N=t[33]:(N=xe(n),t[32]=n,t[33]=N);let P;t[34]===N?P=t[35]:(P=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:N}),t[34]=N,t[35]=P);let F;t[36]!==r.phase||t[37]!==f?(F=f===`—`?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.phase}),(0,$.jsx)(`code`,{className:`break-all text-fg`,children:f})]}),t[36]=r.phase,t[37]=f,t[38]=F):F=t[38];let I;t[39]!==r.filterByRequestId||t[40]!==r.requestId||t[41]!==i||t[42]!==c?(I=c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.requestId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:c}),i?(0,$.jsx)(E,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>i(c),children:r.filterByRequestId}):null]})]}):null,t[39]=r.filterByRequestId,t[40]=r.requestId,t[41]=i,t[42]=c,t[43]=I):I=t[43];let L;t[44]!==r.openChat||t[45]!==r.sessionKey||t[46]!==o||t[47]!==l?(L=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.sessionKey}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:l}),o?(0,$.jsx)(E,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({sessionKey:l}),children:r.openChat}):null]})]}):null,t[44]=r.openChat,t[45]=r.sessionKey,t[46]=o,t[47]=l,t[48]=L):L=t[48];let R;t[49]!==r.filterBySessionId||t[50]!==r.openChat||t[51]!==r.sessionId||t[52]!==a||t[53]!==o||t[54]!==u?(R=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.sessionId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:u}),a?(0,$.jsx)(E,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(u),children:r.filterBySessionId}):null,o?(0,$.jsx)(E,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({sessionId:u}),children:r.openChat}):null]})]}):null,t[49]=r.filterBySessionId,t[50]=r.openChat,t[51]=r.sessionId,t[52]=a,t[53]=o,t[54]=u,t[55]=R):R=t[55];let z;t[56]!==w||t[57]!==T||t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==P||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==R?(z=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-2 text-xs`,children:[w,T,D,j,M,P,F,I,L,R]}),t[56]=w,t[57]=T,t[58]=D,t[59]=j,t[60]=M,t[61]=P,t[62]=F,t[63]=I,t[64]=L,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==r.metadata||t[68]!==n.meta?(B=n.meta&&Object.keys(n.meta).length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.metadata}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,children:JSON.stringify(n.meta,null,2)})]}):null,t[67]=r.metadata,t[68]=n.meta,t[69]=B):B=t[69];let ee;return t[70]!==z||t[71]!==B||t[72]!==S||t[73]!==C?(ee=(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[S,C,z,B]}),t[70]=z,t[71]=B,t[72]=S,t[73]=C,t[74]=ee):ee=t[74],ee}function Ve(e){let t=(0,G.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:o,onCopiedJson:s,onFilterByRequestId:c,onFilterBySessionId:l,onOpenChat:u}=e,d=r!==null,m;t[0]===i?m=t[1]:(m=e=>!e&&i(),t[0]=i,t[1]=m);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(y,{className:p(`xopc-dialog-overlay fixed inset-0 bg-scrim`,k)}),t[2]=h):h=t[2];let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=p(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-panel shadow-popover outline-none`,O,`dark:border-edge`),t[3]=g):g=t[3];let _;t[4]===n.details?_=t[5]:(_=(0,$.jsx)(C,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=_);let v;t[6]!==n.copied||t[7]!==n.copyJson||t[8]!==n.copyMessage||t[9]!==a||t[10]!==r||t[11]!==s||t[12]!==o?(v=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(E,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{T(typeof r.message==`string`?r.message:``).then(e=>{e&&o()})},children:[(0,$.jsx)(H,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`message`?n.copied:n.copyMessage})]}),(0,$.jsxs)(E,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{T(JSON.stringify(r,null,2)).then(e=>{e&&s()})},children:[(0,$.jsx)(H,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`json`?n.copied:n.copyJson})]})]}):null,t[6]=n.copied,t[7]=n.copyJson,t[8]=n.copyMessage,t[9]=a,t[10]=r,t[11]=s,t[12]=o,t[13]=v):v=t[13];let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(f,{className:`size-5`,strokeWidth:1.75}),t[14]=D):D=t[14];let A;t[15]===n.close?A=t[16]:(A=(0,$.jsx)(b,{asChild:!0,children:(0,$.jsx)(E,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:D})}),t[15]=n.close,t[16]=A);let j;t[17]!==v||t[18]!==A?(j=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[v,A]}),t[17]=v,t[18]=A,t[19]=j):j=t[19];let M;t[20]!==_||t[21]!==j?(M=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[_,j]}),t[20]=_,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==n.filterByRequestId||t[24]!==n.filterBySessionId||t[25]!==n.level||t[26]!==n.message||t[27]!==n.metadata||t[28]!==n.module||t[29]!==n.openChat||t[30]!==n.phase||t[31]!==n.requestId||t[32]!==n.sessionId||t[33]!==n.sessionKey||t[34]!==n.stackTrace||t[35]!==n.time||t[36]!==r||t[37]!==c||t[38]!==l||t[39]!==u?(N=r?(0,$.jsx)(Be,{log:r,labels:{time:n.time,level:n.level,module:n.module,message:n.message,metadata:n.metadata,requestId:n.requestId,sessionKey:n.sessionKey,sessionId:n.sessionId,phase:n.phase,stackTrace:n.stackTrace,filterByRequestId:n.filterByRequestId,filterBySessionId:n.filterBySessionId,openChat:n.openChat},onFilterByRequestId:c,onFilterBySessionId:l,onOpenChat:u}):null,t[23]=n.filterByRequestId,t[24]=n.filterBySessionId,t[25]=n.level,t[26]=n.message,t[27]=n.metadata,t[28]=n.module,t[29]=n.openChat,t[30]=n.phase,t[31]=n.requestId,t[32]=n.sessionId,t[33]=n.sessionKey,t[34]=n.stackTrace,t[35]=n.time,t[36]=r,t[37]=c,t[38]=l,t[39]=u,t[40]=N):N=t[40];let P;t[41]===N?P=t[42]:(P=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:N}),t[41]=N,t[42]=P);let F;t[43]!==M||t[44]!==P?(F=(0,$.jsxs)(x,{children:[h,(0,$.jsxs)(S,{className:g,"aria-describedby":void 0,children:[M,P]})]}),t[43]=M,t[44]=P,t[45]=F):F=t[45];let I;return t[46]!==d||t[47]!==F||t[48]!==m?(I=(0,$.jsx)(w,{open:d,onOpenChange:m,children:F}),t[46]=d,t[47]=F,t[48]=m,t[49]=I):I=t[49],I}function He(e){let t=(0,G.c)(25),{L:n,open:r,onOpenChange:i,files:a,logDir:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(y,{className:p(`xopc-dialog-overlay fixed inset-0 bg-scrim`,k)}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,85vh)] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-panel shadow-popover outline-none`,O,`dark:border-edge`),t[1]=c):c=t[1];let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(N,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=l):l=t[2];let u;t[3]===n.logFiles?u=t[4]:(u=(0,$.jsxs)(C,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[l,n.logFiles]}),t[3]=n.logFiles,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(f,{className:`size-5`,strokeWidth:1.75}),t[5]=d):d=t[5];let m;t[6]===n.close?m=t[7]:(m=(0,$.jsx)(b,{asChild:!0,children:(0,$.jsx)(E,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:d})}),t[6]=n.close,t[7]=m);let h;t[8]!==u||t[9]!==m?(h=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[u,m]}),t[8]=u,t[9]=m,t[10]=h):h=t[10];let g;t[11]!==n.filesEmpty||t[12]!==a?(g=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:a.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.filesEmpty}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.map(Ue)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=g):g=t[13];let _;t[14]!==n.logDir||t[15]!==o?(_=o?(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-2 text-xs text-fg-subtle dark:border-edge`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[n.logDir,`: `]}),(0,$.jsx)(`code`,{className:`break-all text-fg-subtle`,children:o})]}):null,t[14]=n.logDir,t[15]=o,t[16]=_):_=t[16];let v;t[17]!==h||t[18]!==g||t[19]!==_?(v=(0,$.jsxs)(x,{children:[s,(0,$.jsxs)(S,{className:c,children:[h,g,_]})]}),t[17]=h,t[18]=g,t[19]=_,t[20]=v):v=t[20];let T;return t[21]!==i||t[22]!==r||t[23]!==v?(T=(0,$.jsx)(w,{open:r,onOpenChange:i,children:v}),t[21]=i,t[22]=r,t[23]=v,t[24]=T):T=t[24],T}function Ue(e){return(0,$.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg`,children:e.name}),(0,$.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Te(e.size)}),(0,$.jsx)(`span`,{children:we(e.modified)})]})]},e.name)}function We(e){let t=(0,G.c)(68),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:o,dateTo:s,onDateToChange:c,selectedLevels:l,onToggleLevel:u}=e,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(y,{className:p(`xopc-dialog-overlay fixed inset-0 bg-scrim`,k)}),t[0]=d):d=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=p(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,90vh)] w-[min(100%-2rem,22rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-panel shadow-popover outline-none`,O,`dark:border-edge`),t[1]=m):m=t[1];let h;t[2]===n.filtersDialogTitle?h=t[3]:(h=(0,$.jsx)(C,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(f,{className:`size-5`,strokeWidth:1.75}),t[4]=g):g=t[4];let _;t[5]===n.close?_=t[6]:(_=(0,$.jsx)(b,{asChild:!0,children:(0,$.jsx)(E,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:g})}),t[5]=n.close,t[6]=_);let v;t[7]!==h||t[8]!==_?(v=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[h,_]}),t[7]=h,t[8]=_,t[9]=v):v=t[9];let T;t[10]===n.filtersDialogDesc?T=t[11]:(T=(0,$.jsx)(`div`,{id:`log-filters-desc`,className:`sr-only`,children:n.filtersDialogDesc}),t[10]=n.filtersDialogDesc,t[11]=T);let D;t[12]===n.timeRange?D=t[13]:(D=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.timeRange}),t[12]=n.timeRange,t[13]=D);let A;t[14]===n.from?A=t[15]:(A=(0,$.jsx)(`label`,{htmlFor:`log-from-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.from}),t[14]=n.from,t[15]=A);let j;t[16]===o?j=t[17]:(j=e=>o(e.target.value),t[16]=o,t[17]=j);let M;t[18]!==a||t[19]!==j?(M=(0,$.jsx)(`input`,{id:`log-from-d`,type:`datetime-local`,value:a,onChange:j,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[18]=a,t[19]=j,t[20]=M):M=t[20];let N;t[21]!==M||t[22]!==A?(N=(0,$.jsxs)(`div`,{children:[A,M]}),t[21]=M,t[22]=A,t[23]=N):N=t[23];let P;t[24]===n.to?P=t[25]:(P=(0,$.jsx)(`label`,{htmlFor:`log-to-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.to}),t[24]=n.to,t[25]=P);let F;t[26]===c?F=t[27]:(F=e=>c(e.target.value),t[26]=c,t[27]=F);let I;t[28]!==s||t[29]!==F?(I=(0,$.jsx)(`input`,{id:`log-to-d`,type:`datetime-local`,value:s,onChange:F,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[28]=s,t[29]=F,t[30]=I):I=t[30];let L;t[31]!==P||t[32]!==I?(L=(0,$.jsxs)(`div`,{children:[P,I]}),t[31]=P,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==N||t[35]!==L?(R=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[N,L]}),t[34]=N,t[35]=L,t[36]=R):R=t[36];let z;t[37]===n.levelCustom?z=t[38]:(z=(0,$.jsx)(`p`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:n.levelCustom}),t[37]=n.levelCustom,t[38]=z);let B;t[39]===n.levelCustomHint?B=t[40]:(B=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:n.levelCustomHint}),t[39]=n.levelCustomHint,t[40]=B);let ee=n.level,V;t[41]!==n.levelNames||t[42]!==u||t[43]!==l?(V=se.map(e=>(0,$.jsx)(`button`,{type:`button`,className:p(`rounded-full border px-3 py-1.5 text-xs font-medium capitalize transition-[color,background-color,border-color] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,l.has(e)?`border-edge bg-surface-active text-fg dark:border-edge`:`border-edge-subtle bg-surface-base text-fg-muted hover:bg-surface-hover dark:border-edge`),onClick:()=>u(e),children:n.levelNames[e]},e)),t[41]=n.levelNames,t[42]=u,t[43]=l,t[44]=V):V=t[44];let te;t[45]!==n.level||t[46]!==V?(te=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":ee,children:V}),t[45]=n.level,t[46]=V,t[47]=te):te=t[47];let H;t[48]!==R||t[49]!==z||t[50]!==B||t[51]!==te||t[52]!==D?(H=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[D,R,z,B,te]}),t[48]=R,t[49]=z,t[50]=B,t[51]=te,t[52]=D,t[53]=H):H=t[53];let U;t[54]===i?U=t[55]:(U=()=>i(!1),t[54]=i,t[55]=U);let W;t[56]!==n.filtersDone||t[57]!==U?(W=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(E,{type:`button`,className:`w-full rounded-xl`,onClick:U,children:n.filtersDone})}),t[56]=n.filtersDone,t[57]=U,t[58]=W):W=t[58];let K;t[59]!==H||t[60]!==W||t[61]!==v||t[62]!==T?(K=(0,$.jsxs)(x,{children:[d,(0,$.jsxs)(S,{className:m,"aria-describedby":`log-filters-desc`,children:[v,T,H,W]})]}),t[59]=H,t[60]=W,t[61]=v,t[62]=T,t[63]=K):K=t[63];let q;return t[64]!==i||t[65]!==r||t[66]!==K?(q=(0,$.jsx)(w,{open:r,onOpenChange:i,children:K}),t[64]=i,t[65]=r,t[66]=K,t[67]=q):q=t[67],q}var Ge=1;function Ke(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===t?{x:n,y:r}:null}var qe=`pointer-events-none absolute left-0 top-0 z-[1] rounded-pill bg-surface-panel shadow-sm will-change-transform [backface-visibility:hidden] dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,Je=`relative z-[2] box-border flex h-6 min-h-0 min-w-0 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function Ye({value:e,onChange:t,options:n,"aria-label":r,className:i,buttonClassName:a}){let o=(0,W.useRef)(null),s=(0,W.useRef)([]),[c,l]=(0,W.useState)({x:0,y:0,w:0,h:0}),[u,d]=(0,W.useState)(!1),[f,m]=(0,W.useState)(!1),h=(0,W.useCallback)(()=>{let t=o.current;if(!t)return;let r=n.findIndex(t=>t.value===e);if(r<0)return;let i=s.current[r];if(!i)return;let a=Ge,c=t.getBoundingClientRect(),u=i.getBoundingClientRect(),f=Ke(i,t),p,m;if(f)p=f.x,m=f.y;else{let e=getComputedStyle(t),n=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderTopWidth)||0;p=u.left-c.left-n,m=u.top-c.top-r}l({x:p+a,y:m+a,w:Math.max(0,u.width-a*2),h:Math.max(0,u.height-a*2)}),d(!0)},[n,e]),g=(0,W.useRef)(h);return g.current=h,(0,W.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>h());return()=>cancelAnimationFrame(e)},[h]),(0,W.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>m(!0))});return()=>cancelAnimationFrame(e)},[]),(0,W.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{requestAnimationFrame(()=>g.current())},n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{n.disconnect(),window.removeEventListener(`resize`,t)}},[]),(0,$.jsxs)(`div`,{ref:o,className:p(U,`relative isolate flex w-full max-w-full flex-row items-center`,i),role:`group`,"aria-label":r,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:p(qe,`motion-reduce:!transition-none motion-reduce:!duration-0`,f&&`transition-[transform,width,height] duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]`),style:{width:c.w,height:c.h,transform:`translate3d(${c.x}px, ${c.y}px, 0)`,opacity:u&&c.w>0?1:0}}),n.map((n,r)=>{let i=n.icon,o=e===n.value;return(0,$.jsxs)(`button`,{ref:e=>{s.current[r]=e},type:`button`,"aria-pressed":o,title:n.title??n.label,onClick:()=>t(n.value),className:p(Je,o?`text-fg`:`text-fg-subtle`,a),children:[i?(0,$.jsx)(i,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,$.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:n.label})]},n.value)})]})}function Xe(e){let t=(0,G.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:a,onSearchInputChange:o,moduleFilter:c,onModuleFilterChange:u,modules:d,onOpenFilters:m,activeFilterCount:h,hasActiveFilters:g,onClearFilters:_,autoRefresh:v}=e,y=n.filters,b;t[0]===n.presetAll?b=t[1]:(b={value:`all`,label:n.presetAll},t[0]=n.presetAll,t[1]=b);let x;t[2]===n.presetErrors?x=t[3]:(x={value:`errors`,label:n.presetErrors},t[2]=n.presetErrors,t[3]=x);let S;t[4]===n.presetWarnPlus?S=t[5]:(S={value:`warnPlus`,label:n.presetWarnPlus},t[4]=n.presetWarnPlus,t[5]=S);let C;t[6]===n.presetInfoPlus?C=t[7]:(C={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=C);let w;t[8]===n.presetVerbose?w=t[9]:(w={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=w);let T;t[10]===n.presetOther?T=t[11]:(T={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=T);let D;t[12]!==b||t[13]!==x||t[14]!==S||t[15]!==C||t[16]!==w||t[17]!==T?(D=[b,x,S,C,w,T],t[12]=b,t[13]=x,t[14]=S,t[15]=C,t[16]=w,t[17]=T,t[18]=D):D=t[18];let O;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==D?(O=(0,$.jsx)(`div`,{className:`overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,$.jsx)(`div`,{className:`min-w-[min(100%,36rem)]`,children:(0,$.jsx)(Ye,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:D,buttonClassName:`h-8 px-1.5 text-[11px] sm:px-2 sm:text-xs`})})}),t[19]=n.levelPresetAria,t[20]=r,t[21]=i,t[22]=D,t[23]=O):O=t[23];let k;t[24]===n.searchPlaceholder?k=t[25]:(k=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=k);let A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(F,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[26]=A):A=t[26];let j;t[27]===o?j=t[28]:(j=e=>o(e.target.value),t[27]=o,t[28]=j);let M=n.searchPlaceholder,N;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(N=p(`h-10 w-full rounded-md border border-edge bg-surface-panel py-0 pl-10 pr-3 text-sm leading-5 text-fg placeholder:text-fg-subtle dark:border-edge`,I),t[29]=N):N=t[29];let L;t[30]!==n.searchPlaceholder||t[31]!==a||t[32]!==j?(L=(0,$.jsx)(`input`,{type:`search`,value:a,onChange:j,placeholder:M,autoComplete:`off`,spellCheck:!1,className:N}),t[30]=n.searchPlaceholder,t[31]=a,t[32]=j,t[33]=L):L=t[33];let R;t[34]!==k||t[35]!==L?(R=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[k,A,L]}),t[34]=k,t[35]=L,t[36]=R):R=t[36];let z;t[37]===u?z=t[38]:(z=e=>u(e.target.value),t[37]=u,t[38]=z);let B=n.module,ee=n.module,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=p(P,`h-10 w-full min-w-0 rounded-md py-0 sm:w-[min(100%,14rem)] sm:shrink-0`),t[39]=V):V=t[39];let H;t[40]===n.allModules?H=t[41]:(H=(0,$.jsx)(l,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=H);let U;t[42]===d?U=t[43]:(U=d.map(Ze),t[42]=d,t[43]=U);let W;t[44]!==n.module||t[45]!==c||t[46]!==z||t[47]!==H||t[48]!==U?(W=(0,$.jsxs)(s,{id:`log-module`,value:c,onChange:z,"aria-label":B,title:ee,className:V,children:[H,U]}),t[44]=n.module,t[45]=c,t[46]=z,t[47]=H,t[48]=U,t[49]=W):W=t[49];let K;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(te,{className:`size-4`,strokeWidth:1.75}),t[50]=K):K=t[50];let q;t[51]===h?q=t[52]:(q=h>0?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 text-xs tabular-nums text-fg-muted`,children:h}):null,t[51]=h,t[52]=q);let J;t[53]!==n.filtersMore||t[54]!==m||t[55]!==q?(J=(0,$.jsxs)(E,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:m,children:[K,n.filtersMore,q]}),t[53]=n.filtersMore,t[54]=m,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==n.clear||t[58]!==g||t[59]!==_?(Y=g?(0,$.jsxs)(E,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:_,children:[(0,$.jsx)(f,{className:`size-4`,strokeWidth:1.75}),n.clear]}):null,t[57]=n.clear,t[58]=g,t[59]=_,t[60]=Y):Y=t[60];let X;t[61]!==J||t[62]!==Y?(X=(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center gap-2`,children:[J,Y]}),t[61]=J,t[62]=Y,t[63]=X):X=t[63];let Z;t[64]!==R||t[65]!==W||t[66]!==X?(Z=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center`,children:[R,W,X]}),t[64]=R,t[65]=W,t[66]=X,t[67]=Z):Z=t[67];let Q;t[68]!==n.liveHint||t[69]!==v?(Q=v?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.liveHint}):null,t[68]=n.liveHint,t[69]=v,t[70]=Q):Q=t[70];let ne;return t[71]!==n.filters||t[72]!==Z||t[73]!==Q||t[74]!==O?(ne=(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,"aria-label":y,children:[O,Z,Q]}),t[71]=n.filters,t[72]=Z,t[73]=Q,t[74]=O,t[75]=ne):ne=t[75],ne}function Ze(e){return(0,$.jsx)(l,{value:e,children:e},e)}function Qe(e){let t=(0,G.c)(20),{L:n,logs:r,loading:i,hasMore:a,onSelectLog:o,onLoadMore:s,onRefreshAll:c,onFilterByRequestId:l}=e,u;t[0]!==i||t[1]!==r.length?(u=i&&r.length===0?(0,$.jsx)(`div`,{className:`overflow-hidden rounded-xl bg-surface-panel shadow-surface`,"aria-busy":`true`,children:Array.from({length:8}).map($e)}):null,t[0]=i,t[1]=r.length,t[2]=u):u=t[2];let d;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==c?(d=!i&&r.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl bg-surface-base py-16 text-center`,children:[(0,$.jsx)(L,{className:`size-12 text-fg-subtle`,strokeWidth:1.5,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.noLogs}),(0,$.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-fg-muted`,children:n.noLogsDescription}),(0,$.jsxs)(E,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:c,children:[(0,$.jsx)(j,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=c,t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==l||t[13]!==s||t[14]!==o?(f=r.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:[be(n.showingCount,{count:String(r.length)}),a?(0,$.jsxs)(`span`,{className:`text-fg-subtle`,children:[` · `,n.moreAvailable]}):null]}),(0,$.jsx)(`ul`,{className:`overflow-hidden rounded-xl bg-surface-panel font-mono text-sm leading-6 shadow-surface`,children:r.map(e=>{let t=e.level??`info`,r=typeof e.requestId==`string`?e.requestId.trim():``,i=Oe(e),a=t===`error`||t===`fatal`;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:p(`flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,a&&`border-l-2 border-l-red-500/70`),children:[(0,$.jsx)(`span`,{className:`w-[5.25rem] shrink-0 tabular-nums text-fg-subtle`,children:Ce(e.timestamp)}),(0,$.jsx)(`span`,{className:p(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:De(t)}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0 truncate sm:w-[5.25rem]`,children:r?l?(0,$.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer text-accent hover:underline`,title:`${n.requestId}: ${r}`,onClick:e=>{e.stopPropagation(),l(r)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),l(r))},children:Ee(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:Ee(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 truncate text-fg-subtle xl:inline`,title:i===`—`?void 0:i,children:i===`—`?`—`:i}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 truncate text-fg-muted lg:inline`,title:xe(e),children:xe(e)}),(0,$.jsx)(`span`,{className:p(`min-w-0 flex-1 truncate`,`text-fg`),children:Se(e)})]})},ke(e))})}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(E,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(j,{className:`size-4 animate-spin motion-reduce:animate-none`,strokeWidth:1.75}):(0,$.jsx)(ee,{className:`size-4`,strokeWidth:1.75}),n.loadMore]})}):null]}):null,t[8]=n,t[9]=a,t[10]=i,t[11]=r,t[12]=l,t[13]=s,t[14]=o,t[15]=f):f=t[15];let m;return t[16]!==u||t[17]!==d||t[18]!==f?(m=(0,$.jsxs)($.Fragment,{children:[u,d,f]}),t[16]=u,t[17]=d,t[18]=f,t[19]=m):m=t[19],m}function $e(e,t){return(0,$.jsxs)(`div`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`h-4 w-16 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-12 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-20 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 min-w-0 flex-1 bg-surface-hover motion-reduce:animate-none animate-pulse`})]},t)}function et(e){let t=(0,G.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(V,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=r):r=t[0];let i;t[1]===n.title?i=t[2]:(i=(0,$.jsx)(`h1`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.title}),t[1]=n.title,t[2]=i);let a;t[3]===n.needToken?a=t[4]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.needToken}),t[3]=n.needToken,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsx)(`div`,{className:`flex w-full flex-col gap-3 px-3 py-10 sm:px-5 xl:px-6`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[r,(0,$.jsxs)(`div`,{children:[i,a]})]})}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function tt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function nt(e){let t=[`timestamp`,`level`,`module`,`phase`,`requestId`,`sessionId`,`message`],n=e.map(e=>{let t=String(e.module||``),n=String(e.phase??e.meta?.phase??``);return[e.timestamp,e.level,t,n,e.requestId??``,e.sessionId??``,e.message??``].map(e=>tt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
|
|
2
|
+
`)}function rt(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}function it(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){rt(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}rt(nt(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function at(e){let t=(0,G.c)(32),{L:n,logs:r,disabled:i}=e,s=i||r.length===0,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(d,{className:`size-4`,strokeWidth:1.75}),t[0]=l):l=t[0];let f;t[1]===n.exportLogs?f=t[2]:(f=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=f);let m;t[3]!==n.exportLogs||t[4]!==s||t[5]!==f?(m=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsxs)(E,{type:`button`,variant:`secondary`,className:`h-9 gap-2 px-3 text-xs`,disabled:s,title:n.exportLogs,children:[l,f]})}),t[3]=n.exportLogs,t[4]=s,t[5]=f,t[6]=m):m=t[6];let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=p(`w-52 rounded-xl border border-edge bg-surface-panel p-2 shadow-popover outline-none`,A,`dark:border-edge`),t[7]=h):h=t[7];let g;t[8]===n.exportLogs?g=t[9]:(g=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=g);let _;t[10]===n.exportHint?_=t[11]:(_=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=_);let v;t[12]===r?v=t[13]:(v=()=>it(r,`json`),t[12]=r,t[13]=v);let y;t[14]!==n.exportJson||t[15]!==v?(y=(0,$.jsx)(E,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:v,children:n.exportJson}),t[14]=n.exportJson,t[15]=v,t[16]=y):y=t[16];let b;t[17]===r?b=t[18]:(b=()=>it(r,`csv`),t[17]=r,t[18]=b);let x;t[19]!==n.exportCsv||t[20]!==b?(x=(0,$.jsx)(E,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:b,children:n.exportCsv}),t[19]=n.exportCsv,t[20]=b,t[21]=x):x=t[21];let S;t[22]!==x||t[23]!==y?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[y,x]}),t[22]=x,t[23]=y,t[24]=S):S=t[24];let C;t[25]!==S||t[26]!==g||t[27]!==_?(C=(0,$.jsx)(a,{children:(0,$.jsxs)(u,{side:`bottom`,align:`end`,sideOffset:6,className:h,children:[g,_,S]})}),t[25]=S,t[26]=g,t[27]=_,t[28]=C):C=t[28];let w;return t[29]!==C||t[30]!==m?(w=(0,$.jsxs)(o,{children:[m,C]}),t[29]=C,t[30]=m,t[31]=w):w=t[31],w}function ot(e){let t=(0,G.c)(38),{L:n}=e,[r,i]=(0,W.useState)(!1),[s,l]=(0,W.useState)(`info`),[d,f]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),g,_;t[0]!==n.logLevelLoadError||t[1]!==r?(g=()=>{if(!r)return;let e=!1;return Q().then(t=>{e||l(t)}).catch(t=>{e||h(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},_=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,W.useEffect)(g,_);let v;t[4]===n.logLevelSaveError?v=t[5]:(v=e=>{f(!0),h(null),ne(e).then(e=>{l(e.current),i(!1)}).catch(e=>{h(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>f(!1))},t[4]=n.logLevelSaveError,t[5]=v);let y=v,b;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(M,{className:`size-4`,strokeWidth:1.75}),t[6]=b):b=t[6];let x;t[7]===n.logLevelTitle?x=t[8]:(x=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=x);let S;t[9]===s?S=t[10]:(S=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:s}),t[9]=s,t[10]=S);let C;t[11]!==n.logLevelTitle||t[12]!==x||t[13]!==S?(C=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsxs)(E,{type:`button`,variant:`secondary`,className:`h-9 gap-2 px-3 text-xs`,title:n.logLevelTitle,children:[b,x,S]})}),t[11]=n.logLevelTitle,t[12]=x,t[13]=S,t[14]=C):C=t[14];let w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=p(`w-56 rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,A,`dark:border-edge`),t[15]=w):w=t[15];let T;t[16]===n.logLevelTitle?T=t[17]:(T=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=T);let D;t[18]===n.logLevelHint?D=t[19]:(D=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=D);let O;t[20]!==n.levelNames||t[21]!==y||t[22]!==s||t[23]!==d?(O=se.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>y(e),className:p(`flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs transition-colors`,s===e?`bg-accent/10 font-medium text-accent`:`text-fg hover:bg-surface-hover`),children:[(0,$.jsx)(`span`,{children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`font-mono text-[10px] uppercase text-fg-subtle`,children:e})]})},e)),t[20]=n.levelNames,t[21]=y,t[22]=s,t[23]=d,t[24]=O):O=t[24];let k;t[25]===O?k=t[26]:(k=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:O}),t[25]=O,t[26]=k);let j;t[27]===m?j=t[28]:(j=m?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:m}):null,t[27]=m,t[28]=j);let N;t[29]!==D||t[30]!==k||t[31]!==j||t[32]!==T?(N=(0,$.jsx)(a,{children:(0,$.jsxs)(u,{side:`bottom`,align:`end`,sideOffset:6,className:w,children:[T,D,k,j]})}),t[29]=D,t[30]=k,t[31]=j,t[32]=T,t[33]=N):N=t[33];let P;return t[34]!==r||t[35]!==N||t[36]!==C?(P=(0,$.jsxs)(o,{open:r,onOpenChange:i,children:[C,N]}),t[34]=r,t[35]=N,t[36]=C,t[37]=P):P=t[37],P}function st(e){let t=(0,G.c)(49),{L:n,autoRefresh:r,onAutoRefreshChange:i,fileCount:a,onOpenFiles:o,loading:s,onRefreshAll:c,logs:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,$.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:n.title}),t[0]=n.title,t[1]=u);let d;t[2]===n.subtitle?d=t[3]:(d=(0,$.jsx)(`p`,{className:`mt-0.5 text-sm leading-relaxed text-fg-muted`,children:n.subtitle}),t[2]=n.subtitle,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=r?`live`:`paused`,m;t[7]===i?m=t[8]:(m=e=>i(e===`live`),t[7]=i,t[8]=m);let h;t[9]===n.refreshManual?h=t[10]:(h={value:`paused`,label:n.refreshManual},t[9]=n.refreshManual,t[10]=h);let g;t[11]===n.refreshLive?g=t[12]:(g={value:`live`,label:n.refreshLive},t[11]=n.refreshLive,t[12]=g);let _;t[13]!==h||t[14]!==g?(_=[h,g],t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==n.refreshModeAria||t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,$.jsx)(`div`,{className:`w-full sm:w-48`,children:(0,$.jsx)(Ye,{"aria-label":n.refreshModeAria,value:p,onChange:m,options:_,buttonClassName:`h-8`})}),t[16]=n.refreshModeAria,t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]===n?y=t[22]:(y=(0,$.jsx)(ot,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(at,{L:n,logs:l,disabled:s}),t[23]=n,t[24]=s,t[25]=l,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(N,{className:`size-4`,strokeWidth:1.75}),t[27]=x):x=t[27];let S;t[28]===a?S=t[29]:(S=a>0?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-1.5 text-xs text-fg-muted`,children:a}):null,t[28]=a,t[29]=S);let C;t[30]!==n.logFiles||t[31]!==o||t[32]!==S?(C=(0,$.jsxs)(E,{type:`button`,variant:`ghost`,className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,title:n.logFiles,"aria-label":n.logFiles,onClick:o,children:[x,S]}),t[30]=n.logFiles,t[31]=o,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(w=(0,$.jsx)(z,{className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,loading:s,label:n.refresh,onClick:c}),t[34]=n.refresh,t[35]=s,t[36]=c,t[37]=w):w=t[37];let T;t[38]!==y||t[39]!==b||t[40]!==C||t[41]!==w?(T=(0,$.jsxs)(`div`,{className:`flex items-center gap-1 self-end sm:self-center`,children:[y,b,C,w]}),t[38]=y,t[39]=b,t[40]=C,t[41]=w,t[42]=T):T=t[42];let D;t[43]!==T||t[44]!==v?(D=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 flex-col gap-2 sm:w-auto sm:max-w-md sm:flex-row sm:items-center sm:justify-end`,children:[v,T]}),t[43]=T,t[44]=v,t[45]=D):D=t[45];let O;return t[46]!==D||t[47]!==f?(O=(0,$.jsxs)(`header`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[f,D]}),t[46]=D,t[47]=f,t[48]=O):O=t[48],O}function ct(e){let t=(0,G.c)(33),{L:n,stats:r}=e,i;t[0]===r.byLevel?i=t[1]:(i=r.byLevel??{},t[0]=r.byLevel,t[1]=i);let s;t[2]!==n.levelNames||t[3]!==i?(s=Me(i,n.levelNames),t[2]=n.levelNames,t[3]=i,t[4]=s):s=t[4];let l=s,d=r.runtime?.errorsLast24h;if(!l&&d==null)return null;let f;t[5]===n.statsRegion?f=t[6]:(f=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.statsRegion}),t[5]=n.statsRegion,t[6]=f);let m;t[7]===l?m=t[8]:(m=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsx)(`span`,{className:`tabular-nums`,children:l})]}):null,t[7]=l,t[8]=m);let h;t[9]!==n.runtimeErrors||t[10]!==d?(h=d!=null&&d>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsxs)(`span`,{className:`tabular-nums text-red-600 dark:text-red-400`,children:[n.runtimeErrors,` `,d]})]}):null,t[9]=n.runtimeErrors,t[10]=d,t[11]=h):h=t[11];let g;t[12]!==f||t[13]!==m||t[14]!==h?(g=(0,$.jsx)(c,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`max-w-full truncate rounded-lg border border-transparent px-1 py-0.5 text-left text-xs leading-5 text-fg-subtle transition-colors duration-150 ease-out hover:border-edge-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:hover:border-edge`,children:[f,m,h]})}),t[12]=f,t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=p(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-panel p-3 shadow-popover outline-none`,A,`dark:border-edge`),t[16]=_):_=t[16];let v;t[17]===n.statsDetailTitle?v=t[18]:(v=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.statsDetailTitle}),t[17]=n.statsDetailTitle,t[18]=v);let y;t[19]===n.statsHint?y=t[20]:(y=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.statsHint}),t[19]=n.statsHint,t[20]=y);let b;t[21]!==n.levelNames||t[22]!==r.byLevel?(b=se.map(e=>{let t=r.byLevel?.[e]??0;return t===0?null:(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`font-medium capitalize text-fg`,children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:t})]},e)}),t[21]=n.levelNames,t[22]=r.byLevel,t[23]=b):b=t[23];let x;t[24]===b?x=t[25]:(x=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1.5`,children:b}),t[24]=b,t[25]=x);let S;t[26]!==x||t[27]!==v||t[28]!==y?(S=(0,$.jsx)(a,{children:(0,$.jsxs)(u,{side:`bottom`,align:`start`,sideOffset:6,className:_,children:[v,y,x]})}),t[26]=x,t[27]=v,t[28]=y,t[29]=S):S=t[29];let C;return t[30]!==S||t[31]!==g?(C=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(o,{children:[g,S]})}),t[30]=S,t[31]=g,t[32]=C):C=t[32],C}function lt(){let e=(0,G.c)(89),{L:t,hasToken:n,logs:r,loading:i,error:a,hasMore:o,searchInput:s,setSearchInput:c,selectedLevels:l,moduleFilter:u,setModuleFilter:d,dateFrom:f,setDateFrom:p,dateTo:m,setDateTo:h,modules:_,files:v,stats:y,selectedLog:b,setSelectedLog:x,filesOpen:S,setFilesOpen:C,filtersOpen:w,setFiltersOpen:T,logDir:E,autoRefresh:D,setAutoRefresh:O,copiedDetail:k,setCopiedDetail:A,hasActiveFilters:j,activeFilterCount:M,clearFilters:N,toggleDialogLevel:P,handleLoadMore:F,refreshAll:I,levelSegment:L,handleLevelSegment:R,filterByRequestId:z,filterBySessionId:B,filterByErrorSummary:ee,openChatForSession:V,errorSummary:te,errorSummaryLoading:H}=Ie(g(ut));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(et,{L:t}),e[0]=t,e[1]=n),n}let U;e[2]===C?U=e[3]:(U=()=>C(!0),e[2]=C,e[3]=U);let W;e[4]!==t||e[5]!==D||e[6]!==v.length||e[7]!==i||e[8]!==r||e[9]!==I||e[10]!==O||e[11]!==U?(W=(0,$.jsx)(st,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:U,loading:i,onRefreshAll:I,logs:r}),e[4]=t,e[5]=D,e[6]=v.length,e[7]=i,e[8]=r,e[9]=I,e[10]=O,e[11]=U,e[12]=W):W=e[12];let K;e[13]===a?K=e[14]:(K=a?(0,$.jsx)(`div`,{className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg dark:border-edge`,role:`alert`,children:a}):null,e[13]=a,e[14]=K);let q;e[15]!==t||e[16]!==y?(q=y?(0,$.jsx)(ct,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=q):q=e[17];let J;e[18]!==t||e[19]!==te||e[20]!==H||e[21]!==ee?(J=(0,$.jsx)(Le,{L:t,items:te,loading:H,onSelectItem:ee}),e[18]=t,e[19]=te,e[20]=H,e[21]=ee,e[22]=J):J=e[22];let Y;e[23]===T?Y=e[24]:(Y=()=>T(!0),e[23]=T,e[24]=Y);let X;e[25]!==t||e[26]!==M||e[27]!==D||e[28]!==N||e[29]!==R||e[30]!==j||e[31]!==L||e[32]!==u||e[33]!==_||e[34]!==s||e[35]!==d||e[36]!==c||e[37]!==Y?(X=(0,$.jsx)(Xe,{L:t,levelSegment:L,onLevelSegment:R,searchInput:s,onSearchInputChange:c,moduleFilter:u,onModuleFilterChange:d,modules:_,onOpenFilters:Y,activeFilterCount:M,hasActiveFilters:j,onClearFilters:N,autoRefresh:D}),e[25]=t,e[26]=M,e[27]=D,e[28]=N,e[29]=R,e[30]=j,e[31]=L,e[32]=u,e[33]=_,e[34]=s,e[35]=d,e[36]=c,e[37]=Y,e[38]=X):X=e[38];let Z;e[39]!==t||e[40]!==z||e[41]!==F||e[42]!==o||e[43]!==i||e[44]!==r||e[45]!==I||e[46]!==x?(Z=(0,$.jsx)(Qe,{L:t,logs:r,loading:i,hasMore:o,onSelectLog:x,onLoadMore:F,onRefreshAll:I,onFilterByRequestId:z}),e[39]=t,e[40]=z,e[41]=F,e[42]=o,e[43]=i,e[44]=r,e[45]=I,e[46]=x,e[47]=Z):Z=e[47];let Q;e[48]!==t||e[49]!==f||e[50]!==m||e[51]!==w||e[52]!==l||e[53]!==p||e[54]!==h||e[55]!==T||e[56]!==P?(Q=(0,$.jsx)(We,{L:t,open:w,onOpenChange:T,dateFrom:f,onDateFromChange:p,dateTo:m,onDateToChange:h,selectedLevels:l,onToggleLevel:P}),e[48]=t,e[49]=f,e[50]=m,e[51]=w,e[52]=l,e[53]=p,e[54]=h,e[55]=T,e[56]=P,e[57]=Q):Q=e[57];let ne;e[58]===x?ne=e[59]:(ne=()=>x(null),e[58]=x,e[59]=ne);let re,ie;e[60]===A?(re=e[61],ie=e[62]):(re=()=>A(`message`),ie=()=>A(`json`),e[60]=A,e[61]=re,e[62]=ie);let ae;e[63]!==t||e[64]!==k||e[65]!==z||e[66]!==B||e[67]!==V||e[68]!==b||e[69]!==re||e[70]!==ie||e[71]!==ne?(ae=(0,$.jsx)(Ve,{L:t,log:b,onClose:ne,copiedDetail:k,onCopiedMessage:re,onCopiedJson:ie,onFilterByRequestId:z,onFilterBySessionId:B,onOpenChat:V}),e[63]=t,e[64]=k,e[65]=z,e[66]=B,e[67]=V,e[68]=b,e[69]=re,e[70]=ie,e[71]=ne,e[72]=ae):ae=e[72];let oe;e[73]!==t||e[74]!==v||e[75]!==S||e[76]!==E||e[77]!==C?(oe=(0,$.jsx)(He,{L:t,open:S,onOpenChange:C,files:v,logDir:E}),e[73]=t,e[74]=v,e[75]=S,e[76]=E,e[77]=C,e[78]=oe):oe=e[78];let se;return e[79]!==W||e[80]!==ae||e[81]!==oe||e[82]!==K||e[83]!==q||e[84]!==J||e[85]!==X||e[86]!==Z||e[87]!==Q?(se=(0,$.jsxs)(`div`,{className:`flex w-full flex-col gap-6 px-3 py-6 sm:px-5 xl:px-6`,children:[W,K,q,J,X,Z,Q,ae,oe]}),e[79]=W,e[80]=ae,e[81]=oe,e[82]=K,e[83]=q,e[84]=J,e[85]=X,e[86]=Z,e[87]=Q,e[88]=se):se=e[88],se}function ut(e){return e.language}export{lt as LogsPage};
|
|
@@ -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{d as i,h as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as o}from"./cn-JdwAhgNB.js";import{i as s,n as c,r as l}from"./locale-store-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,h as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as o}from"./cn-JdwAhgNB.js";import{i as s,n as c,r as l}from"./locale-store-DlOv7896.js";import{t as u}from"./messages-Ls1Aaiqd.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{t as f}from"./button-BA45yciM.js";import{t as p}from"./skeleton-BwbyijEw.js";import{Dc as m,Uc as h,Xi as g,fc as _,hc as v,yl as y}from"./index-ChIrvv3t.js";import{n as b,r as x}from"./settings-page-layout-DYelDcMV.js";import{h as S,v as C}from"./tunnel-api-Boajol0M.js";import{t as w}from"./device-pairing-wizard-BPMGvAKE.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,m]=(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),m(!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`),m(!0)},children:[(0,P.jsx)(_,{className:`size-4`}),o.addMobile]}),(0,P.jsxs)(f,{variant:`primary`,onClick:()=>e(`/settings/agent-browser?driver=extension`),children:[(0,P.jsx)(y,{className:`size-4`}),o.addLocalBrowser]}),(0,P.jsxs)(f,{variant:`secondary`,onClick:()=>{x(`browser`),m(!0)},children:[(0,P.jsx)(h,{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-subtle text-fg-muted`,children:e.platform===`chrome`?(0,P.jsx)(h,{className:`size-4`}):(0,P.jsx)(_,{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)(v,{className:`size-4`}),o.revoke]})]},e.id))}),(0,P.jsx)(w,{open:l,onOpenChange:m,onPaired:M,targetKind:b}),(0,P.jsx)(g,{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),h=(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 _=n.data??[],y=r.data??[],S=_.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)(m,{className:`size-4`,"aria-hidden":!0}),t.refresh]})}),n.error||r.error?(0,P.jsx)(`div`,{className:`rounded-xl border border-danger/30 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,_.length],[t.online,S],[t.recentCalls,y.length]].map(([e,t])=>(0,P.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-base 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-2xl border border-edge bg-surface-base 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:[_.length===0?(0,P.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):null,_.map(e=>{let n=e.revokedAt?`revoked`:e.endpoints.length>0?`online`:`offline`;return(0,P.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel 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?h.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)(v,{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 border border-edge-subtle bg-surface-panel 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-2xl border border-edge bg-surface-base 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:[y.length===0?(0,P.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noCalls}):null,y.map(e=>(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border border-edge-subtle bg-surface-panel 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:[h.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)(g,{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-CKInRsDh.js → markdown-view-6oYdBahT.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{d as o,u as s}from"./chunk-KS7C4IRE-Cq1tE_3b.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-
|
|
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{d as o,u as s}from"./chunk-KS7C4IRE-Cq1tE_3b.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-DlOv7896.js";import{t as m}from"./messages-Ls1Aaiqd.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-BiBXVEvp.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),lt=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},oee=function(){return typeof window>`u`?null:window},see=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}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ft(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oee(),t=e=>ft(e);if(t.version=`3.4.7`,t.removed=[],!e||!e.document||e.document.nodeType!==ut.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=dt();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=lt,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,pt=!0,mt=!1,ht=!0,gt=!1,_t=!1,vt=!1,yt=!1,bt=!1,xt=!1,St=!0,Ct=!1,wt=`user-content-`,Tt=!0,Et=!1,Dt={},Ot=null,kt=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`]),At=null,jt=Ue({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Mt=null,Nt=Ue({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Pt=`http://www.w3.org/1998/Math/MathML`,Ft=`http://www.w3.org/2000/svg`,It=`http://www.w3.org/1999/xhtml`,Lt=It,Rt=!1,zt=null,Bt=Ue({},[Pt,Ft,It],Oe),Vt=Ue({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ht=Ue({},[`annotation-xml`]),Ut=Ue({},[`title`,`style`,`font`,`a`,`script`]),Wt=null,Gt=[`application/xhtml+xml`,`text/html`],Kt=null,qt=null,Jt=n.createElement(`form`),Yt=function(e){return e instanceof RegExp||e instanceof Function},Xt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qt&&qt===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ge(e),Wt=Gt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Kt=Wt===`application/xhtml+xml`?Oe:De,ve=Le(e,`ALLOWED_TAGS`)&&Ee(e.ALLOWED_TAGS)?Ue({},e.ALLOWED_TAGS,Kt):ye,be=Le(e,`ALLOWED_ATTR`)&&Ee(e.ALLOWED_ATTR)?Ue({},e.ALLOWED_ATTR,Kt):Ne,zt=Le(e,`ALLOWED_NAMESPACES`)&&Ee(e.ALLOWED_NAMESPACES)?Ue({},e.ALLOWED_NAMESPACES,Oe):Bt,Mt=Le(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)?Ue(Ge(Nt),e.ADD_URI_SAFE_ATTR,Kt):Nt,At=Le(e,`ADD_DATA_URI_TAGS`)&&Ee(e.ADD_DATA_URI_TAGS)?Ue(Ge(jt),e.ADD_DATA_URI_TAGS,Kt):jt,Ot=Le(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)?Ue({},e.FORBID_CONTENTS,Kt):kt,Fe=Le(e,`FORBID_TAGS`)&&Ee(e.FORBID_TAGS)?Ue({},e.FORBID_TAGS,Kt):Ge({}),Ie=Le(e,`FORBID_ATTR`)&&Ee(e.FORBID_ATTR)?Ue({},e.FORBID_ATTR,Kt):Ge({}),Dt=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,pt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,mt=e.SAFE_FOR_TEMPLATES||!1,ht=e.SAFE_FOR_XML!==!1,gt=e.WHOLE_DOCUMENT||!1,yt=e.RETURN_DOM||!1,bt=e.RETURN_DOM_FRAGMENT||!1,xt=e.RETURN_TRUSTED_TYPE||!1,vt=e.FORCE_BODY||!1,St=e.SANITIZE_DOM!==!1,Ct=e.SANITIZE_NAMED_PROPS||!1,Tt=e.KEEP_CONTENT!==!1,Et=e.IN_PLACE||!1,ge=Je(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:st,Lt=typeof e.NAMESPACE==`string`?e.NAMESPACE:It,Vt=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`]),Ht=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`)&&Yt(t.tagNameCheck)&&(Pe.tagNameCheck=t.tagNameCheck),Le(t,`attributeNameCheck`)&&Yt(t.attributeNameCheck)&&(Pe.attributeNameCheck=t.attributeNameCheck),Le(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),mt&&(He=!1),bt&&(yt=!0),Dt&&(ve=Ue({},$e),be=_e(null),Dt.html===!0&&(Ue(ve,Ye),Ue(be,et)),Dt.svg===!0&&(Ue(ve,Xe),Ue(be,tt),Ue(be,rt)),Dt.svgFilters===!0&&(Ue(ve,Ze),Ue(be,tt),Ue(be,rt)),Dt.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,Kt))),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,Kt))),Le(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)&&Ue(Mt,e.ADD_URI_SAFE_ATTR,Kt),Le(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)&&(Ot===kt&&(Ot=Ge(Ot)),Ue(Ot,e.FORBID_CONTENTS,Kt)),Le(e,`ADD_FORBID_CONTENTS`)&&Ee(e.ADD_FORBID_CONTENTS)&&(Ot===kt&&(Ot=Ge(Ot)),Ue(Ot,e.ADD_FORBID_CONTENTS,Kt)),Tt&&(ve[`#text`]=!0),gt&&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=see(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),qt=e},Zt=Ue({},[...Xe,...Ze,...eee]),Qt=Ue({},[...Qe,...tee]),$t=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Lt,tagName:`template`});let n=De(e.tagName),r=De(t.tagName);return zt[e.namespaceURI]?e.namespaceURI===Ft?t.namespaceURI===It?n===`svg`:t.namespaceURI===Pt?n===`svg`&&(r===`annotation-xml`||Vt[r]):!!Zt[n]:e.namespaceURI===Pt?t.namespaceURI===It?n===`math`:t.namespaceURI===Ft?n===`math`&&Ht[r]:!!Qt[n]:e.namespaceURI===It?t.namespaceURI===Ft&&!Ht[r]||t.namespaceURI===Pt&&!Vt[r]?!1:!Qt[n]&&(Ut[n]||!Zt[n]):!!(Wt===`application/xhtml+xml`&&zt[e.namespaceURI]):!1},en=function(e){we(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},tn=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(yt||bt)try{en(n)}catch{}else try{n.setAttribute(e,``)}catch{}},nn=function(e){let t=null,r=null;if(vt)e=`<remove></remove>`+e;else{let t=ke(e,/^[\r\n\t ]+/);r=t&&t[0]}Wt===`application/xhtml+xml`&&Lt===It&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?x.createHTML(e):e;if(Lt===It)try{t=new l().parseFromString(i,Wt)}catch{}if(!t||!t.documentElement){t=te.createDocument(Lt,`template`,null);try{t.documentElement.innerHTML=Rt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Lt===It?re.call(t,gt?`html`:`body`)[0]:gt?t.documentElement:a},rn=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)},an=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()}},on=function(e){let t=b?b(e):null;return typeof t!=`string`||Kt(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)},sn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===ut.documentFragment}catch{return!1}},cn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function ln(e,n,r){xe(e,e=>{e.call(t,n,r,qt)})}let un=function(e){let n=null;if(ln(ae.beforeSanitizeElements,e,null),on(e))return en(e),!0;let r=Kt(e.nodeName);if(ln(ae.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),ht&&e.hasChildNodes()&&!cn(e.firstElementChild)&&ze(/<[/\w!]/g,e.innerHTML)&&ze(/<[/\w!]/g,e.textContent)||ht&&e.namespaceURI===It&&r===`style`&&cn(e.firstElementChild)||e.nodeType===ut.progressingInstruction||ht&&e.nodeType===ut.comment&&ze(/<[/\w]/g,e.data))return en(e),!0;if(Fe[r]||!(Re.tagCheck instanceof Function&&Re.tagCheck(r))&&!ve[r]){if(!Fe[r]&&pn(r)&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,r)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r)))return!1;if(Tt&&!Ot[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 en(e),!0}return(y?y(e):e.nodeType)===ut.element&&!$t(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ze(/<\/no(script|embed|frames)/i,e.innerHTML)?(en(e),!0):(mt&&e.nodeType===ut.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)),ln(ae.afterSanitizeElements,e,null),!1)},dn=function(e,t,r){if(Ie[t]||St&&(t===`id`||t===`name`)&&(r in n||r in Jt))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(!(pn(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(!Mt[t]&&!ze(ge,Ae(r,pe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&je(r,`data:`)===0&&At[e])&&!(We&&!ze(fe,Ae(r,pe,``)))&&r)return!1}return!0},fn=Ue({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),pn=function(e){return!fn[De(e)]&&ze(me,e)},mn=function(e){ln(ae.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||on(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=Kt(o),d=c,f=o===`value`?d:Me(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,ln(ae.uponSanitizeAttribute,e,r),f=r.attrValue,Ct&&(l===`id`||l===`name`)&&je(f,wt)!==0&&(tn(o,e),f=wt+f),ht&&ze(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){tn(o,e);continue}if(l===`attributename`&&ke(f,`href`)){tn(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){tn(o,e);continue}if(!pt&&ze(/\/>/i,f)){tn(o,e);continue}mt&&xe([oe,se,ce],e=>{f=Ae(f,e,` `)});let p=Kt(e.nodeName);if(!dn(p,l,f)){tn(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),on(e)?en(e):Ce(t.removed)}catch{tn(o,e)}}ln(ae.afterSanitizeAttributes,e,null)},hn=function(e){let t=null,n=rn(e);for(ln(ae.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(ln(ae.uponSanitizeShadowNode,t,null),un(t),mn(t),sn(t.content)&&hn(t.content),(y?y(t):t.nodeType)===ut.element){let e=_?_(t):t.shadowRoot;sn(e)&&(gn(e),hn(e))}ln(ae.afterSanitizeShadowDOM,e,null)},gn=function(e){let t=y?y(e):e.nodeType;if(t===ut.element){let t=_?_(e):e.shadowRoot;sn(t)&&(gn(t),hn(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];xe(n,e=>{we(r,e)});for(let e of r)gn(e);if(t===ut.element){let t=b?b(e):null;if(typeof t==`string`&&Kt(t)===`template`){let t=e.content;sn(t)&&gn(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(Rt=!e,Rt&&(e=`<!-->`),typeof e!=`string`&&!cn(e)&&(e=Ke(e),typeof e!=`string`))throw Be(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(_t||Xt(n),t.removed=[],typeof e==`string`&&(Et=!1),Et){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=Kt(t);if(!ve[e]||Fe[e])throw Be(`root node is forbidden and cannot be sanitized in-place`)}if(on(e))throw Be(`root node is clobbered and cannot be sanitized in-place`);gn(e)}else if(cn(e))i=nn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===ut.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),gn(a);else{if(!yt&&!mt&&!gt&&e.indexOf(`<`)===-1)return x&&xt?x.createHTML(e):e;if(i=nn(e),!i)return yt?null:xt?S:``}i&&vt&&en(i.firstChild);let c=rn(Et?e:i);for(;o=c.nextNode();)un(o),mn(o),sn(o.content)&&hn(o.content);if(Et)return mt&&an(e),e;if(yt){if(mt&&an(i),bt)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=gt?i.outerHTML:i.innerHTML;return gt&&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),mt&&xe([oe,se,ce],e=>{l=Ae(l,e,` `)}),x&&xt?x.createHTML(l):l},t.setConfig=function(){Xt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),_t=!0},t.clearConfig=function(){qt=null,_t=!1},t.isValidAttribute=function(e,t,n){return qt||Xt({}),dn(Kt(e),Kt(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=dt()},t}var pt=ft(),mt=e(r(),1),ht=i();function gt(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 _t(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 vt=[`/notes/`,`/tasks/`,`/projects/`];function yt(e,t){let n=e.split(/[?#]/,1)[0]??``;if(!vt.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:_t(e,t)}function bt(){let e=(0,ht.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(yt(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 xt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var St=xt();function Ct(e){St=e}var wt={exec:()=>null};function Tt(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 Et(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(Ot.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Dt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Ot={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:Tt(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Tt(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Tt(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Tt(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Tt(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Tt(e=>RegExp(`^ {0,${e}}>`))},kt=/^(?:[ \t]*(?:\n|$))+/,At=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ft=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,It=Et(Ft).replace(/bull/g,Pt).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(),Lt=Et(Ft).replace(/bull/g,Pt).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(),Rt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zt=/^[^\n]+/,Bt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Vt=Et(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Bt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ht=Et(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pt).getRegex(),Ut=`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`,Wt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gt=Et(`^ {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`,Wt).replace(`tag`,Ut).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kt=Et(Rt).replace(`hr`,Mt).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`,Ut).getRegex(),qt={blockquote:Et(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Kt).getRegex(),code:At,def:Vt,fences:jt,heading:Nt,hr:Mt,html:Gt,lheading:It,list:Ht,newline:kt,paragraph:Kt,table:wt,text:zt},Jt=Et(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Mt).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`,Ut).getRegex(),Yt={...qt,lheading:Lt,table:Jt,paragraph:Et(Rt).replace(`hr`,Mt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Jt).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`,Ut).getRegex()},Xt={...qt,html:Et(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Wt).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:wt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Et(Rt).replace(`hr`,Mt).replace(`heading`,` *#{1,6} *[^
|
|
4
4
|
]`).replace(`lheading`,It).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Zt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Qt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$t=/^( {2,}|\\)\n(?!\s*$)/,en=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tn=/[\p{P}\p{S}]/u,nn=/[\s\p{P}\p{S}]/u,rn=/[^\s\p{P}\p{S}]/u,an=Et(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,nn).getRegex(),on=/(?!~)[\p{P}\p{S}]/u,sn=/(?!~)[\s\p{P}\p{S}]/u,cn=/(?:[^\s\p{P}\p{S}]|~)/u,ln=Et(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Dt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),un=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dn=Et(un,`u`).replace(/punct/g,tn).getRegex(),fn=Et(un,`u`).replace(/punct/g,on).getRegex(),pn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,mn=Et(pn,`gu`).replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,tn).getRegex(),hn=Et(pn,`gu`).replace(/notPunctSpace/g,cn).replace(/punctSpace/g,sn).replace(/punct/g,on).getRegex(),gn=Et(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,tn).getRegex(),cee=Et(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,tn).getRegex(),lee=Et(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,tn).getRegex(),_n=Et(/\\(punct)/,`gu`).replace(/punct/g,tn).getRegex(),vn=Et(/^<(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(),yn=Et(Wt).replace(`(?:-->|$)`,`-->`).getRegex(),bn=Et(`^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`,yn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Sn=Et(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,xn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Cn=Et(/^!?\[(label)\]\[(ref)\]/).replace(`label`,xn).replace(`ref`,Bt).getRegex(),wn=Et(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Bt).getRegex(),uee=Et(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Cn).replace(`nolink`,wn).getRegex(),Tn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,En={_backpedal:wt,anyPunctuation:_n,autolink:vn,blockSkip:ln,br:$t,code:Qt,del:wt,delLDelim:wt,delRDelim:wt,emStrongLDelim:dn,emStrongRDelimAst:mn,emStrongRDelimUnd:gn,escape:Zt,link:Sn,nolink:wn,punctuation:an,reflink:Cn,reflinkSearch:uee,tag:bn,text:en,url:wt},Dn={...En,link:Et(/^!?\[(label)\]\((.*?)\)/).replace(`label`,xn).getRegex(),reflink:Et(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,xn).getRegex()},On={...En,emStrongRDelimAst:hn,emStrongLDelim:fn,delLDelim:cee,delRDelim:lee,url:Et(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Tn).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:Et(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Tn).getRegex()},kn={...On,br:Et($t).replace(`{2,}`,`*`).getRegex(),text:Et(On.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},An={normal:qt,gfm:Yt,pedantic:Xt},jn={normal:En,gfm:On,breaks:kn,pedantic:Dn},Mn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Nn=e=>Mn[e];function Pn(e,t){if(t){if(Ot.escapeTest.test(e))return e.replace(Ot.escapeReplace,Nn)}else if(Ot.escapeTestNoEncode.test(e))return e.replace(Ot.escapeReplaceNoEncode,Nn);return e}function Fn(e){try{e=encodeURI(e).replace(Ot.percentDecode,`%`)}catch{return null}return e}function In(e,t){let n=e.replace(Ot.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Ot.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(Ot.slashPipe,`|`);return n}function Ln(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 Rn(e){let t=e.split(`
|
package/dist/gateway/static/root/assets/{media-plugins-BaPkSvW7.js → media-plugins-CxthbBvk.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-
|
|
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-Ls1Aaiqd.js";import{ia as i}from"./index-ChIrvv3t.js";import{t as a}from"./preview-open-alternatives-Bevpbq9f.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};
|