@xopcai/xopc 0.0.208 → 0.0.210
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-D0mYZqhc.js → activity-store-JLmEb1p0.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-MWLQWL_i.js → agent-avatar-dicebear-CI1zQfzY.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DqGMj3QJ.js +68 -0
- package/dist/gateway/static/root/assets/{api-DZA1yVzM.js → api-C6MmWfcb.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B2X6quAF.js → app-management-settings-panel-Cd02GGpV.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BZW-c38q.js → appearance-settings-Db-h2I3G.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BT7F4WBI.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CK-gsjsJ.js → archive-plugin-CMHzJT2a.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-EJGP4rCw.js → attachment-load-BzhI2LoH.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-CwOXGV9z.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Tbss_4P-.js → binary-plugins-DsUeHvZO.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C-dOWigw.js → block-editor-CFfsIeZ4.js} +47 -47
- package/dist/gateway/static/root/assets/{browser-settings-page-NlvDyMwD.js → browser-settings-page-CyRLhCod.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-DW06Zo1N.js → browser-workflow-inputs-BiWghvJ0.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B6RnRGwm.js → browser-workflows-page-DPLdT6Zn.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-jRKcS7lZ.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-Cc3BtQar.js → capability-presets-api-CTxGFvsS.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-D0loEbzq.js → capability-presets-settings-panel-B3bKdtwU.js} +2 -2
- package/dist/gateway/static/root/assets/{channel-recipient-api-BvZO5FaO.js → channel-recipient-api-BklVUOxC.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-yZBWH02s.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-C3zlimZd.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-0F4Jmma2.js +36 -0
- package/dist/gateway/static/root/assets/{connectors-api-CUl6_EQJ.js → connectors-api-BvIZ51ty.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-OX4KvUkA.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BD9MgoE_.js → cron-expression-BHmwaMbO.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-ChqNmoxw.js → date-picker-fj_pPCv5.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CDUmFs6H.js → dependency-picker-DsWvwOv-.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D61gqxaD.js → desktop-pet-mjkF0Xxh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-QvuJvIX_.js → desktop-pet-settings-ClwUpRYu.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DvXMvDNY.js → directory-picker-path-field-OkqRFyRL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DMdVTAQ3.js → extension-debug-page-DC69wplH.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BNzxZtaK.js → extension-page-DCtk6zdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DoEfyizU.js → extension-settings-page-Bkm4zzv-.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-o7AKvthC.js → gateway-config-api-Dr_NQt7v.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BQbkUP5X.js → gateway-config-swr-CEfv8N1J.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-V1XVxjHa.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DIgdpHgk.js → gateway-startup-retry-B8hebJ7s.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-UZAn1aAQ.js → heartbeat-settings-CWUBAQrE.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-D57cYRd3.js +1 -0
- package/dist/gateway/static/root/assets/index-DJ7HSgKs.js +85 -0
- package/dist/gateway/static/root/assets/index-PNBFdxHb.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-4xaM3jjU.js → keyboard-shortcuts-settings-DCQvf05d.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D9bguWRo.js → local-app-workbench-page-BbAiMZE1.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-C1xDicdr.js → local-apps-page-B3Ugd0my.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-pByvK12G.js → locale-store-hDBVeG3G.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Gr-nE4nW.js → logs-page-nXdF3wOT.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-D1XdHm7v.js → management-settings-C-S5Llq3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-B_Ijq1Fr.js → markdown-split-DuVq37Uh.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CyJlGUxB.js → markdown-view-D8eO_6h3.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CXXNRROJ.js → media-plugins-C1V6pkX3.js} +1 -1
- package/dist/gateway/static/root/assets/messages-1qg_hOOd.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-rkePB4CB.js → notes-page-Dn71ZV8c.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BYPoZeRw.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-gw-RMQCV.js → page-tabs-B5a5aSoS.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-B8aMScJ2.js → preview-open-alternatives-5041AIBX.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CjcpkWAz.js → product-open-page-7UkouFQU.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-D27nOKbo.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-DPRxKGbs.js → projects-page-CdB5cJJ-.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DFoZ3UNS.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Ch5qq86o.js → runtime-tools-settings-panel-DvaXzHYS.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DHYWYUFt.js → schema-form-Dlxl_5X0.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C1cbIcJ7.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DnXRlQXS.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DlzZx0-i.js → settings-form-section-CSaiuuer.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BVLhreQi.js → settings-loading-skeleton-H3mJwt3r.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BJU-kUnN.js → settings-page-Cs7zA4BS.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CwgMODfJ.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-hvIuZXMe.js → share-preview-page-Bdpw5m7M.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-hlUgIkrp.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DR31B_Gz.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-Dlvuh7D-.js → skills-page-Bup3Lg1Z.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-B6ddOpnf.js → skills-page.utils-D22ORR21.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BdbCAyoA.js → system-settings-panel-GmtWsfjB.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CTKDpxhf.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BtdGacMI.js → theme-store-CtY8RwMX.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-CL6qHYJA.js → typed-models-lib-C2aOdlEA.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DysNnqCS.js → use-autosave-DOj5i8d_.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-Bwg4KV8B.js → user-context-page-keJJYpix.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-UEsO9Jr-.js → voice-api-key-field-5WfurWYa.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B9disASf.js → work-discovery-overlay-D5_MH3n3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CmPfOfHl.js → work-discovery-page-BcvBiebt.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-A0zTQHFQ.js → workflow-run-setup-panel-bBA8LinI.js} +1 -1
- package/dist/gateway/static/root/assets/workflows-page-Cz2VpWdj.js +5 -0
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +2 -2
- package/dist/src/agent/background-review/coordinator.d.ts +1 -1
- package/dist/src/agent/background-review/coordinator.js +4 -5
- package/dist/src/agent/background-review/run-background-review.js +0 -1
- package/dist/src/agent/background-review/settings.d.ts +1 -2
- package/dist/src/agent/background-review/settings.js +3 -4
- package/dist/src/agent/external-tools/composio-provider.js +8 -4
- package/dist/src/agent/memory/builtin-provider.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent/memory/manager.js +2 -0
- package/dist/src/agent/memory/sensitivity.js +1 -1
- package/dist/src/agent/memory/understanding/service.js +43 -19
- package/dist/src/agent/memory/user-context-coordinator.js +1 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/automations/domain/validation.d.ts +7 -7
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/connectors/auth-provider-registry.d.ts +2 -1
- package/dist/src/connectors/auth-provider-registry.js +5 -2
- package/dist/src/connectors/composio-sessions.d.ts +38 -0
- package/dist/src/connectors/composio-sessions.js +64 -6
- package/dist/src/connectors/composio.d.ts +4 -1
- package/dist/src/connectors/composio.js +26 -4
- package/dist/src/connectors/runtime-adapter-registry.js +14 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +4 -1
- package/dist/src/gateway/hono/routes/connectors.js +15 -2
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +75 -1
- package/dist/src/gateway/service/agent-runner.d.ts +9 -1
- package/dist/src/gateway/service/agent-runner.js +9 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
- package/dist/src/gateway/service/session-input-coordinator.js +64 -6
- package/dist/src/gateway/service.d.ts +8 -0
- package/dist/src/gateway/service.js +8 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/retrieval/audit.d.ts +1 -0
- package/dist/src/retrieval/audit.js +8 -0
- package/dist/src/retrieval/candidateFusion.d.ts +5 -0
- package/dist/src/retrieval/candidateFusion.js +20 -0
- package/dist/src/retrieval/queryProfile.d.ts +16 -0
- package/dist/src/retrieval/queryProfile.js +66 -0
- package/dist/src/retrieval/textFeatures.d.ts +5 -0
- package/dist/src/retrieval/textFeatures.js +71 -0
- package/dist/src/session/client-history.d.ts +1 -0
- package/dist/src/session/client-history.js +4 -0
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/fts.d.ts +0 -4
- package/dist/src/storage/sqlite/fts.js +2 -49
- package/dist/src/storage/sqlite/index.d.ts +3 -2
- package/dist/src/storage/sqlite/index.js +6 -5
- package/dist/src/storage/sqlite/memory-records-repository.js +60 -38
- package/dist/src/storage/sqlite/row-mappers.js +2 -2
- package/dist/src/storage/sqlite/session-repository.js +2 -2
- package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +34 -0
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +110 -0
- package/dist/src/storage/sqlite/transcript-repository.js +1 -1
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +7 -0
- package/dist/src/storage/sqlite/user-context-quality-repository.js +25 -1
- package/dist/src/storage/sqlite/user-context-repository.d.ts +4 -0
- package/dist/src/storage/sqlite/user-context-repository.js +29 -3
- package/dist/src/tasks/home-query-service.d.ts +3 -1
- package/dist/src/tasks/home-query-service.js +73 -70
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/user-context/planner.d.ts +1 -0
- package/dist/src/user-context/planner.js +16 -29
- package/dist/src/user-context/retriever.d.ts +15 -0
- package/dist/src/user-context/retriever.js +65 -0
- package/dist/src/user-context/scope.d.ts +7 -0
- package/dist/src/user-context/scope.js +9 -0
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-Bl8FQZxW.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-CRUgTO10.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-DrSwolhG.js +0 -6
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BWXUznw5.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CcivCw8U.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DkHAD2Zn.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-DVedGAeX.js +0 -36
- package/dist/gateway/static/root/assets/connectors-page-DlBSlfkv.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-TO5YYZ9a.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CRJDpy5E.js +0 -3
- package/dist/gateway/static/root/assets/index-BSjP0Wsx.css +0 -2
- package/dist/gateway/static/root/assets/index-C2ZYFBGL.js +0 -85
- package/dist/gateway/static/root/assets/messages-yG5P43Q9.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-CpbD4XG2.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-GvSYDbjR.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-WIzeu-gB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-2XEJM0YE.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-g1GThZ0O.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C6qj2L-q.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BBpE1bep.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DXORBJNk.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DC0hc8hp.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DhQNh7W6.js +0 -5
|
@@ -0,0 +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,f as a,t as o}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as s,r as c}from"./popover-select-BzdnTy3h.js";import{t as l}from"./external-link-DjqjBmc3.js";import{f as u,u as d}from"./markdown-view-D8eO_6h3.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./cn-JdwAhgNB.js";import{t as m}from"./button-CSEbl4zT.js";import{l as h,n as g}from"./locale-store-hDBVeG3G.js";import{i as _,n as v,o as ee,r as te,s as ne,t as y}from"./dist-BPoKqzeH.js";import{A as re,Ci as ie,El as b,H as ae,K as x,M as oe,Ma as S,Na as C,Nl as w,R as T,Tl as se,W as ce,_c as le,an as ue,ar as de,dl as fe,el as pe,et as me,in as E,ir as he,kr as ge,li as D,n as O,nr as _e,q as ve,qa as k,rn as ye,rr as A,sc as j,sr as M,tc as N,tl as P,tu as F,va as be,wi as I}from"./index-DJ7HSgKs.js";import{t as xe}from"./date-picker-fj_pPCv5.js";import{t as L}from"./dependency-picker-DsWvwOv-.js";var R=e(t(),1),z=n();function Se(e,t,n,r){return!!(e&&t!==e.version&&n!==e.value&&r!==n)}function Ce(e,t){let n={...e.task};t.title!==void 0&&(n.title=t.title),t.priority!==void 0&&(n.priority=t.priority);for(let e of[`body`,`projectId`,`milestoneId`,`parentTaskId`,`dueAt`,`ownerId`]){let r=t[e];r!==void 0&&(r===null?delete n[e]:Object.assign(n,{[e]:r}))}return n.version+=1,n.updatedAt=Date.now(),{...e,task:n}}var B=r();function we(e,t){return(t===`zh`?{backlog:`待规划`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已完成`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Completed`})[e]}function Te(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,B.jsx)(C,{className:`h-32 rounded-2xl`}),(0,B.jsx)(C,{className:`h-52 rounded-2xl`}),(0,B.jsx)(C,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function Ee(e){if(e===void 0)return``;let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function De(e){return e?new Date(`${e}T23:59:59.999`).getTime():null}var Oe=[`backlog`,`ready`,`active`,`review`,`closed`],ke=[`low`,`normal`,`high`,`critical`],Ae=(0,R.memo)(function(e){let t=(0,z.c)(20),{value:n,disabled:r,canMove:i,canApprove:a,canReopen:o,language:l,label:u,onChange:d}=e,f;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==n?(f=e=>e!==n&&(e===`closed`?!a:n===`closed`?!o:!i),t[0]=a,t[1]=i,t[2]=o,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]===u?m=t[6]:(m=(0,B.jsx)(`span`,{children:u}),t[5]=u,t[6]=m);let h;t[7]===d?h=t[8]:(h=e=>d(e.target.value),t[7]=d,t[8]=h);let g;t[9]!==l||t[10]!==p?(g=Oe.map(e=>(0,B.jsx)(c,{value:e,disabled:p(e),children:we(e,l)},e)),t[9]=l,t[10]=p,t[11]=g):g=t[11];let _;t[12]!==r||t[13]!==h||t[14]!==g||t[15]!==n?(_=(0,B.jsx)(s,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:h,children:g}),t[12]=r,t[13]=h,t[14]=g,t[15]=n,t[16]=_):_=t[16];let v;return t[17]!==m||t[18]!==_?(v=(0,B.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[m,_]}),t[17]=m,t[18]=_,t[19]=v):v=t[19],v}),je=(0,R.memo)(function(e){let t=(0,z.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,l;t[0]===i?l=t[1]:(l=(0,B.jsx)(`span`,{children:i}),t[0]=i,t[1]=l);let u;t[2]===o?u=t[3]:(u=e=>o(e.target.value),t[2]=o,t[3]=u);let d;t[4]===a?d=t[5]:(d=ke.map(e=>(0,B.jsx)(c,{value:e,children:a[e]},e)),t[4]=a,t[5]=d);let f;t[6]!==r||t[7]!==u||t[8]!==d||t[9]!==n?(f=(0,B.jsx)(s,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:u,children:d}),t[6]=r,t[7]=u,t[8]=d,t[9]=n,t[10]=f):f=t[10];let p;return t[11]!==l||t[12]!==f?(p=(0,B.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[l,f]}),t[11]=l,t[12]=f,t[13]=p):p=t[13],p}),Me=(0,R.memo)(function(e){let t=(0,z.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,B.jsx)(`span`,{children:i}),t[0]=i,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==a||t[5]!==n?(s=(0,B.jsx)(xe,{disabled:r,value:n,onChange:a,ariaLabel:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==s?(c=(0,B.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}),Ne=(0,R.memo)(function(e){let t=(0,z.c)(17),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,onChange:l}=e,u;t[0]===i?u=t[1]:(u=(0,B.jsx)(`span`,{children:i}),t[0]=i,t[1]=u);let d;t[2]===l?d=t[3]:(d=e=>l(e.target.value),t[2]=l,t[3]=d);let f;t[4]===a?f=t[5]:(f=(0,B.jsx)(c,{value:``,disabled:!0,children:a}),t[4]=a,t[5]=f);let p;t[6]===o?p=t[7]:(p=o.map(Ye),t[6]=o,t[7]=p);let m;t[8]!==r||t[9]!==d||t[10]!==f||t[11]!==p||t[12]!==n?(m=(0,B.jsxs)(s,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:d,children:[f,p]}),t[8]=r,t[9]=d,t[10]=f,t[11]=p,t[12]=n,t[13]=m):m=t[13];let h;return t[14]!==u||t[15]!==m?(h=(0,B.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[u,m]}),t[14]=u,t[15]=m,t[16]=h):h=t[16],h}),Pe=(0,R.memo)(function(e){let t=(0,z.c)(8),{candidates:n,selected:r,disabled:i,labels:a,onChange:o}=e,s;t[0]===r?s=t[1]:(s=r.map(Xe),t[0]=r,t[1]=s);let c;return t[2]!==n||t[3]!==i||t[4]!==a||t[5]!==o||t[6]!==s?(c=(0,B.jsx)(L,{borderless:!0,candidates:n,selectedIds:s,disabled:i,onChange:o,labels:a}),t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c},(e,t)=>e.disabled===t.disabled&&e.labels===t.labels&&e.onChange===t.onChange&&e.candidates.length===t.candidates.length&&e.candidates.every((e,n)=>e.id===t.candidates[n]?.id&&e.title===t.candidates[n]?.title)&&e.selected.length===t.selected.length&&e.selected.every((e,n)=>e.id===t.selected[n]?.id&&e.title===t.selected[n]?.title)),Fe=`xopc.taskDetail.chatPanelPercent`,Ie=42;function Le(e,t){let n=Math.max(30,352/Math.max(t,1)*100),r=Math.min(60,(t-480)/Math.max(t,1)*100);return r<n?Ie:Math.min(r,Math.max(n,e))}function Re(){try{let e=Number(window.localStorage.getItem(Fe));return Number.isFinite(e)&&e>=30&&e<=60?e:Ie}catch{return Ie}}function ze(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`paused`:e.operationalState}function V(e){let t=(0,z.c)(9),{items:n,empty:r,verificationByCriterion:i}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,B.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=i?.get(e)??`unverified`;return(0,B.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,B.jsx)(t===`passed`?w:t===`failed`?b:se,{className:t===`passed`?`mt-1 size-4 shrink-0 text-success`:t===`failed`?`mt-1 size-4 shrink-0 text-danger`:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,B.jsx)(`span`,{children:e})]},e)},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,B.jsx)(`ul`,{className:`space-y-2`,children:a}),t[7]=a,t[8]=o),o}function H({taskId:e,presentation:t,backgroundPath:n}){let[r]=a(),i=g(e=>e.language),s=h(e=>e.token),c=(0,R.useMemo)(()=>ve(i),[i]),f=k(e=>e.setPageHeader),_=k(e=>e.clearPageHeader),v=I(e=>e.open),ee=I(e=>e.sessionKeyOverride),te=I(e=>e.openForSession),ne=ge(e=>e.setOpen),{data:y,error:ie,mutate:b,lastChange:C,conversationLoading:se,conversationError:ue}=re(e),[xe,L]=(0,R.useState)(null),[z,we]=(0,R.useState)(()=>new Set),[Oe,ke]=(0,R.useState)([]),[H,Be]=(0,R.useState)(null),[Ve,He]=(0,R.useState)([]),[Ue,U]=(0,R.useState)(!1),[We,Ge]=(0,R.useState)(``),[Ke,W]=(0,R.useState)(!1),[qe,Je]=(0,R.useState)(``),[G,Ye]=(0,R.useState)(Re),[Xe,Ze]=(0,R.useState)(!1),Qe=(0,R.useRef)(null),$e=(0,R.useRef)(!1),et=(0,R.useRef)(!1),tt=(0,R.useRef)(``),nt=(0,R.useRef)(null),rt=(0,R.useRef)(null),it=(0,R.useRef)(null),at=(0,R.useRef)(y),[ot,K]=(0,R.useState)(null),[st,ct]=(0,R.useState)(null),lt=(0,R.useMemo)(()=>({link:c.linkDependencies,linked:c.linkedDependencies,searchPlaceholder:c.dependencySearchPlaceholder,noMatches:c.noDependencyMatches,noCandidates:c.noDependencyCandidates,remove:c.removeDependency}),[c.dependencySearchPlaceholder,c.linkDependencies,c.linkedDependencies,c.noDependencyCandidates,c.noDependencyMatches,c.removeDependency]),ut=y?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,dt=(0,R.useMemo)(()=>d(r.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[r]);at.current=y;let q=(0,R.useCallback)((e,t)=>{we(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,R.useEffect)(()=>{L(null),K(null),U(!1),W(!1),ct(null)},[e]),(0,R.useEffect)(()=>{let e=!0;return S().then(t=>{e&&He(t.items)}).catch(()=>void 0),()=>{e=!1}},[s]),(0,R.useEffect)(()=>{if(!C||C.source===`user`)return;ct(C);let e=window.setTimeout(()=>ct(null),3500);return()=>window.clearTimeout(e)},[C]),(0,R.useEffect)(()=>{let t=y?.task.projectId,n=y?.dependencies??[];if(!t){it.current=null,Be(null),ke(n);return}it.current!==t&&(it.current=t,Be(null));let r=!0;return be(t).then(t=>{if(!r)return;Be(t.project.name);let i=new Map;for(let r of[...t.tasks,...n])r.id!==e&&i.set(r.id,{id:r.id,title:r.title});ke([...i.values()])}).catch(()=>{r&&ke(n)}),()=>{r=!1}},[ut,y?.task.projectId,e]);let J=(0,R.useCallback)(async(t,n=`command`)=>{let r=at.current;if(r){q(n,!0),L(null);try{await b(await oe(e,t,r.task.version),{revalidate:!1})}catch{L(c.actionFailed)}finally{q(n,!1)}}},[c.actionFailed,b,q,e]),Y=(0,R.useCallback)(async(t,n)=>{let r=at.current;if(!r)return!1;n&&q(n,!0),L(null);try{return await b(ce(e,t,r.task.version),{optimisticData:Ce(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return L(c.actionFailed),!1}finally{n&&q(n,!1)}},[c.actionFailed,b,q,e]),ft=async()=>{if(!y)return;if($e.current){$e.current=!1;return}let e=We.trim(),t=nt.current;if(Se(t,y.task.version,y.task.title,e)){K(`title`);return}if(!e||e===y.task.title){Ge(y.task.title),U(!1);return}await Y({title:e})&&(K(null),U(!1))},pt=async()=>{if(!y)return;if(et.current){et.current=!1;return}let e=qe.trim(),t=rt.current;if(Se(t,y.task.version,y.task.body??``,e)){K(`description`);return}if(qe===tt.current||e===(y.task.body??``).trim()){W(!1);return}await Y({body:e||null})&&(K(null),W(!1))},mt=(0,R.useCallback)(async e=>{let t=at.current;if(!(!t||e===t.task.phase)){if(t.task.phase===`closed`){await J({type:`reopen`,phase:e===`closed`?`ready`:e},`phase`);return}if(e===`closed`){await J({type:`close`,resolution:`done`},`phase`);return}await J({type:`move`,phase:e},`phase`)}},[J]),ht=(0,R.useCallback)(e=>{Y({priority:e},`priority`)},[Y]),gt=(0,R.useCallback)(e=>{Y({dueAt:De(e)},`dueAt`)},[Y]),_t=(0,R.useCallback)(e=>{Ye(e);try{window.localStorage.setItem(Fe,String(e))}catch{}},[]),vt=(0,R.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=Qe.current?.clientWidth??0;_t(Le(e.key===`Home`?Ie:G+(e.key===`ArrowLeft`?2:-2),t))},[G,_t]),yt=(0,R.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=Qe.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),Ze(!0);let i=G,a=0,o=()=>{a=0,t.style.setProperty(`--task-chat-panel-width`,`${i}%`)},s=e=>{let n=t.getBoundingClientRect();i=Le((n.right-e.clientX)/n.width*100,n.width),a===0&&(a=window.requestAnimationFrame(o))},c=()=>{a!==0&&(window.cancelAnimationFrame(a),o());try{n.releasePointerCapture(r)}catch{}Ze(!1),_t(i),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[G,_t]),bt=(0,R.useCallback)(async t=>{let n=at.current;if(n){q(`dependencies`,!0),L(null);try{await b(await x(e,t,n.task.version),{revalidate:!1})}catch{L(c.dependencyUpdateFailed)}finally{q(`dependencies`,!1)}}},[c.dependencyUpdateFailed,b,q,e]),xt=(0,R.useCallback)(async t=>{let n=at.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){q(`delegateAgentId`,!0),L(null);try{await b(await T(e,t,n.task.version),{revalidate:!1})}catch{L(c.actionFailed)}finally{q(`delegateAgentId`,!1)}}},[c.actionFailed,b,q,e]);if((0,R.useLayoutEffect)(()=>{if(t!==`modal`)return f({startExtra:(0,B.jsx)(o,{to:dt,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":c.backToWork,children:(0,B.jsx)(F,{className:`size-4`})}),main:y?(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:H?`${H} / ${c.taskLabel}`:c.taskLabel}),(0,B.jsx)(`p`,{className:`text-xs text-fg-muted`,children:c.detailStatuses[ze(y)]})]}):null,end:null}),_},[_,c.backToWork,c.detailStatuses,c.taskLabel,y,t,H,dt,f]),ie&&!y)return(0,B.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:c.taskNotFound});if(!y)return(0,B.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,B.jsx)(Te,{})});let St=y.waits[0],Ct=St?.kind===`paused`?St:void 0,X=y.receipts[0],wt=c.detailStatuses[ze(y)],Tt=c.detailStatusDescriptions[ze(y)],Et=y.task.body?.trim()||y.task.contract?.objective.trim(),Dt=new Map(X?.verification.checks.map(e=>[e.criterion,e.status])),Ot=y.allowedCommands.includes(`mark_ready`),kt=y.allowedCommands.includes(`start`),At=y.allowedCommands.includes(`add_wait`),jt=y.task.phase===`review`&&y.allowedCommands.includes(`close`),Mt=y.allowedCommands.includes(`reopen`),Z=y.conversation.activeSessionKey,Nt=y.conversation.currentExecutorAgentId??y.task.delegateAgentId??y.task.ownerId,Pt=Ve.find(e=>e.id===Nt),Ft=!!(Z&&v&&ee===Z),It=y.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`),Lt=y.task.contract?.acceptanceCriteria??[],Rt=Lt.filter(e=>Dt.get(e)===`passed`).length,zt=y.task.contract?.expectedOutputs??[],Bt=y.task.contract?.constraints??[],Vt=y.task.contract?.approvalRequired??[],Ht=y.task.contract?.assumptions??[],Ut=y.task.contract?.risks??[],Q=(...e)=>!!st?.changedFields.some(t=>e.includes(t)),Wt=e=>t===`modal`&&n?E(n,e):u(`/tasks/${e}`,dt),Gt=y.allowedCommands.includes(`move`),$=z.has(`command`),Kt=(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[Ot?(0,B.jsxs)(m,{variant:`primary`,disabled:$,onClick:()=>void J({type:`mark_ready`}),children:[(0,B.jsx)(N,{className:`size-4`}),c.scheduleTask]}):null,Ct?(0,B.jsxs)(m,{variant:`primary`,disabled:$,onClick:()=>void J({type:`resolve_wait`,waitId:Ct.id}),children:[(0,B.jsx)(N,{className:`size-4`}),c.resumeTask]}):null,!St&&kt&&Nt?(0,B.jsxs)(m,{variant:`primary`,disabled:$,onClick:()=>void J({type:`start`,executor:{kind:`agent`,agentId:Nt}}),children:[(0,B.jsx)(N,{className:`size-4`}),c.runTask]}):null,jt?(0,B.jsxs)(m,{variant:`primary`,disabled:$,onClick:()=>void J({type:`close`,resolution:`done`}),children:[(0,B.jsx)(w,{className:`size-4`}),c.approveTask]}):null,Mt?(0,B.jsxs)(m,{variant:`primary`,disabled:$,onClick:()=>void J({type:`reopen`,phase:`ready`}),children:[(0,B.jsx)(N,{className:`size-4`}),c.reopenTask]}):null,!St&&At?(0,B.jsxs)(m,{variant:`secondary`,className:`border-0 bg-surface-hover shadow-none`,disabled:$,onClick:()=>void J({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,B.jsx)(j,{className:`size-4`}),c.pauseTask]}):null,y.task.phase===`closed`?null:(0,B.jsxs)(de,{children:[(0,B.jsx)(M,{asChild:!0,children:(0,B.jsx)(m,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:$,"aria-label":c.moreActions,children:(0,B.jsx)(fe,{className:`size-4`,"aria-hidden":!0})})}),(0,B.jsx)(he,{children:(0,B.jsx)(_e,{align:`end`,sideOffset:6,className:`z-[100] min-w-40 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,B.jsx)(A,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void J({type:`close`,resolution:`cancelled`}),children:c.cancelTask})})})]})]});return(0,B.jsxs)(`div`,{ref:Qe,className:`${t===`modal`?`flex h-full min-h-0 flex-col lg:flex-row`:`flex min-h-[calc(100dvh-8rem)] flex-col overflow-hidden lg:flex-row`} ${Xe?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${G}%`},children:[(0,B.jsxs)(`section`,{className:`task-detail-scroll min-w-0 flex-1 overflow-y-auto overscroll-contain p-5 sm:p-6`,children:[(0,B.jsxs)(`header`,{className:p(`px-4 pb-5`,Q(`title`)&&`task-detail-live-update`),children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[H?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(P,{className:`size-3.5`,"aria-hidden":!0}),H]}):null,(0,B.jsx)(`span`,{children:`/`}),(0,B.jsx)(`span`,{children:c.taskLabel}),st?(0,B.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:st.source===`agent`?i===`zh`?`Agent 刚刚更新`:`Updated by Agent`:i===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),Ue?(0,B.jsx)(`input`,{autoFocus:!0,"data-task-inline-editor":!0,value:We,onChange:e=>Ge(e.target.value),onBlur:()=>void ft(),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),$e.current=!0,Ge(y.task.title),U(!1),queueMicrotask(()=>{$e.current=!1}))},className:`mt-3 w-full max-w-3xl rounded-lg bg-surface-hover px-3 py-2 text-2xl font-semibold leading-8 text-fg outline-none ring-2 ring-accent/30 focus:ring-accent/60`}):(0,B.jsx)(`button`,{type:`button`,className:`mt-3 block max-w-3xl rounded-lg text-left outline-none hover:bg-surface-hover focus-visible:bg-surface-hover`,onClick:()=>{nt.current={value:y.task.title,version:y.task.version},K(null),Ge(y.task.title),U(!0)},children:(0,B.jsx)(`h1`,{className:`text-2xl font-semibold leading-8 text-fg`,children:y.task.title})}),ot===`title`?(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,B.jsx)(`span`,{children:i===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{Ge(y.task.title),K(null),U(!1)},children:i===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void Y({title:We.trim()}).then(e=>{e&&(K(null),U(!1))}),children:i===`zh`?`保留我的修改`:`Keep my changes`})]}):null]})}),xe?(0,B.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:xe}):null]}),(0,B.jsxs)(`div`,{className:`mt-5 flex flex-col gap-5`,children:[(0,B.jsxs)(`main`,{className:`order-2 min-w-0 space-y-5`,children:[(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-surface-panel p-4`,Q(`body`)&&`task-detail-live-update`),children:[(0,B.jsx)(`h2`,{className:`font-medium text-fg`,children:c.taskDescription}),Ke?(0,B.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:qe,onChange:e=>Je(e.target.value),onBlur:()=>void pt(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),et.current=!0,Je(y.task.body??y.task.contract?.objective??``),W(!1),queueMicrotask(()=>{et.current=!1}))},className:`mt-3 w-full resize-y rounded-lg bg-surface-hover px-3 py-2 text-sm leading-6 text-fg outline-none ring-2 ring-accent/20 focus:ring-accent/50`}):(0,B.jsx)(`button`,{type:`button`,className:`-mx-1 mt-2 block w-[calc(100%+0.5rem)] rounded-lg px-1 py-1 text-left outline-none hover:bg-surface-hover focus-visible:bg-surface-hover`,onClick:()=>{let e=y.task.body??y.task.contract?.objective??``;tt.current=e,rt.current={value:y.task.body??``,version:y.task.version},K(null),Je(e),W(!0)},children:(0,B.jsx)(`span`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg-muted`,children:Et&&Et!==y.task.title?Et:c.noTaskDescription})}),ot===`description`?(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,B.jsx)(`span`,{children:i===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{Je(y.task.body??``),K(null),W(!1)},children:i===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void Y({body:qe.trim()||null}).then(e=>{e&&(K(null),W(!1))}),children:i===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),y.attention.length>0?(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-warning/10 p-4`,Q(`attention`)&&`task-detail-live-update`),children:[(0,B.jsx)(`h3`,{className:`font-medium text-fg`,children:It?c.needsAttention:c.waitingStatus}),(0,B.jsx)(`ul`,{className:`mt-3 space-y-2 text-sm text-fg-muted`,children:y.attention.map((e,t)=>(0,B.jsx)(`li`,{children:e.summary},`${e.kind}-${t}`))})]}):null,(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-surface-panel p-4`,Q(`contract`)&&`task-detail-live-update`),children:[(0,B.jsx)(`h2`,{className:`font-medium text-fg`,children:c.taskDefinition}),(0,B.jsxs)(`div`,{className:`mt-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:c.successDefinition}),Lt.length>0?(0,B.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:c.criteriaProgress.replace(`{{verified}}`,String(Rt)).replace(`{{total}}`,String(Lt.length))}):null]}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(V,{items:Lt,empty:c.noDefinition,verificationByCriterion:Dt})})]}),zt.length>0?(0,B.jsxs)(`div`,{className:`mt-5 rounded-lg bg-surface-hover p-4`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:c.expectedOutputs}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(V,{items:zt,empty:c.noDefinition})})]}):null,Bt.length>0?(0,B.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-hover p-4`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:c.constraints}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(V,{items:Bt,empty:c.noDefinition})})]}):null,Vt.length>0?(0,B.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-hover p-4`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:c.approvalRequired}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(V,{items:Vt,empty:c.noDefinition})})]}):null,Ht.length>0?(0,B.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-hover p-4`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:c.contextAssumptions}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(V,{items:Ht,empty:c.noDefinition})})]}):null,Ut.length>0?(0,B.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-hover p-4`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:c.contextRisks}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(V,{items:Ut,empty:c.noDefinition})})]}):null]}),X?(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-surface-panel p-4`,Q(`runs`,`receipts`)&&`task-detail-live-update`),children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`font-medium text-fg`,children:c.latestResult}),(0,B.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg`,children:X.summary})]}),(0,B.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:[c.receiptStatuses[X.status],` · `,c.verificationStatuses[X.verification.status]]})]}),X.remainingWork.length>0?(0,B.jsxs)(`div`,{className:`mt-4`,children:[(0,B.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:c.remainingWork}),(0,B.jsx)(`div`,{className:`mt-2`,children:(0,B.jsx)(V,{items:X.remainingWork,empty:c.noRemainingWork})})]}):null,X.nextAction?(0,B.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:c.nextAction}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:X.nextAction})]}):null,(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(m,{className:`border-0 bg-surface-hover px-2 py-1 text-xs shadow-none`,variant:`secondary`,onClick:()=>void ae(X.runId,`helpful`),children:c.doneWell}),(0,B.jsx)(m,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void ae(X.runId,`not_helpful`),children:c.needsFix}),X.evidence.filter(e=>e.uri).map(e=>(0,B.jsxs)(`a`,{className:`ml-auto inline-flex items-center gap-1 text-xs text-accent hover:underline`,href:e.uri,children:[(0,B.jsx)(l,{className:`size-3`}),e.title]},`${e.title}-${e.uri}`))]}),y.receipts.length>1?(0,B.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-hover p-4`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:c.executionHistory.replace(`{{count}}`,String(y.receipts.length-1))}),(0,B.jsx)(`div`,{className:`mt-3 space-y-3`,children:y.receipts.slice(1).map(e=>(0,B.jsx)(`article`,{className:`rounded-lg bg-surface-active p-3`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsx)(`p`,{className:`text-sm text-fg`,children:e.summary}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:c.receiptStatuses[e.status]})]})},e.runId))})]}):null]}):null,y.context.length>0?(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-surface-panel p-4`,Q(`context`)&&`task-detail-live-update`),children:[(0,B.jsx)(`h2`,{className:`font-medium text-fg`,children:c.contextUsed}),(0,B.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:y.context.map(e=>(0,B.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,B.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[c.contextRoleLabels[e.role],` · `,c.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,B.jsx)(`a`,{className:`mt-1 block break-all text-sm text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,B.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,B.jsxs)(`aside`,{className:`order-1 min-w-0 space-y-4`,children:[(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-surface-subtle p-4`,Q(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,B.jsx)(`h2`,{className:`font-medium text-fg`,children:c.taskProperties}),(0,B.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2`,children:[(0,B.jsx)(Ae,{value:y.task.phase,disabled:z.has(`phase`),canMove:Gt,canApprove:jt,canReopen:Mt,language:i,label:c.taskPhase,onChange:mt}),(0,B.jsx)(je,{value:y.task.priority,disabled:z.has(`priority`),label:c.priority,labels:c.priorityLabels,onChange:ht}),(0,B.jsx)(Me,{value:Ee(y.task.dueAt),disabled:z.has(`dueAt`),label:c.dueDate,onChange:gt}),(0,B.jsx)(Ne,{value:y.conversation.currentExecutorAgentId??``,disabled:z.has(`delegateAgentId`),label:c.executorLabel,unassignedLabel:c.unassigned,agents:Ve,onChange:xt}),H?(0,B.jsxs)(`div`,{className:`grid gap-1 text-xs text-fg-muted`,children:[(0,B.jsx)(`span`,{children:c.projectLabel}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-lg bg-surface-hover px-3 py-2 text-sm text-fg`,children:[(0,B.jsx)(P,{className:`size-3.5`}),H]})]}):null]}),(0,B.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3 text-xs leading-5 text-fg-subtle`,children:[(0,B.jsx)(`p`,{children:wt}),(0,B.jsx)(`p`,{children:Tt}),(0,B.jsx)(`p`,{className:`mt-2`,children:c.updatedAt.replace(`{{date}}`,D(y.task.updatedAt,i))})]})]}),(0,B.jsxs)(`section`,{className:p(`rounded-xl bg-surface-panel p-4`,Q(`dependencies`)&&`task-detail-live-update`),children:[(0,B.jsx)(`h2`,{className:`font-medium text-fg`,children:c.taskRelations}),(0,B.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:c.dependencies}),(0,B.jsx)(Pe,{candidates:Oe,selected:y.dependencies,disabled:z.has(`dependencies`),labels:lt,onChange:bt})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:c.dependents}),y.dependents.length>0?(0,B.jsx)(`div`,{className:`space-y-1.5`,children:y.dependents.map(e=>(0,B.jsx)(o,{to:Wt(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-accent hover:underline`,children:e.title},e.id))}):(0,B.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:c.noDependents})]})]})]})]})]})]}),(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":i===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(G),tabIndex:0,onPointerDown:yt,onKeyDown:vt,onDoubleClick:()=>_t(Ie),className:`group hidden w-2 shrink-0 cursor-col-resize touch-none items-stretch justify-center bg-surface-panel outline-none transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover lg:flex ${Xe?`bg-surface-hover`:``}`,children:(0,B.jsx)(`div`,{className:`my-3 w-px rounded-full bg-edge-strong/70 transition-colors group-hover:bg-accent group-focus-visible:bg-accent`})}),(0,B.jsxs)(`aside`,{className:`flex min-h-[34rem] min-w-0 flex-col bg-surface-panel lg:min-h-0 lg:w-[var(--task-chat-panel-width)] lg:shrink-0`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3 bg-surface-subtle px-4 py-3.5`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[Nt?(0,B.jsx)(me,{agentId:Nt,avatar:Pt?.avatar,size:28,className:`shrink-0`}):null,(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:i===`zh`?`Agent 执行与对话`:`Agent execution and chat`}),(0,B.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:[Pt?.name??Nt??c.unassigned,` · `,wt]})]})]})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Kt,Z&&t!==`modal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(m,{type:`button`,variant:`ghost`,className:p(`h-8 shrink-0 px-2 text-xs`,Ft&&`bg-surface-hover text-fg`),"aria-label":i===`zh`?`项目文件`:`Project files`,"aria-pressed":Ft,onClick:()=>{ne(Z,!1),te(Z)},children:[(0,B.jsx)(pe,{className:`size-3.5`,"aria-hidden":!0}),i===`zh`?`文件`:`Files`]}),(0,B.jsx)(m,{asChild:!0,variant:`ghost`,className:`h-8 shrink-0 px-2 text-xs`,children:(0,B.jsxs)(o,{to:ye(e),children:[(0,B.jsx)(l,{className:`size-3.5`}),i===`zh`?`全屏`:`Full screen`]})})]}):null]})]}),Z?(0,B.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,B.jsx)(O,{embedded:!0,sessionKey:Z,taskId:e})}):se?(0,B.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,B.jsxs)(`div`,{className:`max-w-xs`,children:[(0,B.jsx)(le,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,B.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:i===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):ue?(0,B.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,B.jsxs)(`div`,{className:`max-w-xs`,children:[(0,B.jsx)(le,{className:`mx-auto size-8 text-danger`}),(0,B.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:i===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,B.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:ue instanceof Error?ue.message:String(ue)})]})}):(0,B.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,B.jsxs)(`div`,{className:`max-w-xs`,children:[(0,B.jsx)(le,{className:`mx-auto size-8 text-fg-subtle`}),(0,B.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:i===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,B.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:i===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]})}function Be(){let e=(0,z.c)(2),{taskId:t}=i(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,B.jsx)(H,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function Ve(e){let t=(0,z.c)(54),{taskId:n,backgroundPath:r,onClose:i}=e,a=g(G),{data:s}=re(n),c=s?.conversation.activeSessionKey??null,u=I(Je),d=I(qe),m=I(W),h=I(Ke),b=ge(Ge),ae=ie(We),x=ie(U),oe=u?d:0,S;t[0]!==i||t[1]!==x?(S=e=>{e||(x(null),i())},t[0]=i,t[1]=x,t[2]=S):S=t[2];let C=a===`zh`?`关闭任务详情`:`Close task details`,w;t[3]!==i||t[4]!==x?(w=()=>{x(null),i()},t[3]=i,t[4]=x,t[5]=w):w=t[5];let T;t[6]!==C||t[7]!==w?(T=(0,B.jsx)(`button`,{type:`button`,tabIndex:-1,"data-task-modal-backdrop":!0,className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`,"aria-label":C,onClick:w}),t[6]=C,t[7]=w,t[8]=T):T=t[8];let se=u?`true`:`false`,ce=`${oe/2}px`,le=`${oe}px`,de;t[9]!==ce||t[10]!==le?(de={"--task-detail-workspace-offset":ce,"--task-detail-workspace-width":le},t[9]=ce,t[10]=le,t[11]=de):de=t[11];let fe=de,me=a===`zh`?`任务详情`:`Task details`,E;t[12]===me?E=t[13]:(E=(0,B.jsx)(ne,{className:`font-medium text-fg`,children:me}),t[12]=me,t[13]=E);let he=a===`zh`?`查看并操作任务详情`:`View and manage task details`,D;t[14]===he?D=t[15]:(D=(0,B.jsx)(_,{className:`sr-only`,children:he}),t[14]=he,t[15]=D);let O;t[16]!==c||t[17]!==a||t[18]!==h||t[19]!==b||t[20]!==n||t[21]!==u||t[22]!==m?(O=c?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,className:p(`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,u&&m===c&&`bg-surface-hover text-fg`),"aria-label":a===`zh`?`项目文件`:`Project files`,title:a===`zh`?`项目文件`:`Project files`,"aria-pressed":u&&m===c,onClick:()=>{b(c,!1),h(c)},children:(0,B.jsx)(pe,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsx)(o,{to:ye(n),className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":a===`zh`?`全屏打开对话`:`Open chat full screen`,title:a===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,B.jsx)(l,{className:`size-4`,"aria-hidden":!0})})]}):null,t[16]=c,t[17]=a,t[18]=h,t[19]=b,t[20]=n,t[21]=u,t[22]=m,t[23]=O):O=t[23];let _e=a===`zh`?`关闭任务详情`:`Close task details`,ve;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,B.jsx)(f,{className:`size-4`,"aria-hidden":!0}),t[24]=ve):ve=t[24];let k;t[25]===_e?k=t[26]:(k=(0,B.jsx)(v,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":_e,children:ve}),t[25]=_e,t[26]=k);let A;t[27]!==O||t[28]!==k?(A=(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[O,k]}),t[27]=O,t[28]=k,t[29]=A):A=t[29];let j;t[30]!==E||t[31]!==D||t[32]!==A?(j=(0,B.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 bg-surface-panel px-5 py-3.5`,children:[E,D,A]}),t[30]=E,t[31]=D,t[32]=A,t[33]=j):j=t[33];let M;t[34]!==r||t[35]!==n?(M=(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,B.jsx)(H,{taskId:n,presentation:`modal`,backgroundPath:r})}),t[34]=r,t[35]=n,t[36]=M):M=t[36];let N;t[37]!==j||t[38]!==M||t[39]!==se||t[40]!==fe?(N=(0,B.jsxs)(te,{className:`task-detail-modal-content fixed top-1/2 z-[90] flex h-[min(54rem,calc(100dvh-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl bg-surface-base shadow-float focus:outline-none`,"data-workspace-panel-open":se,style:fe,onEscapeKeyDown:Ue,onInteractOutside:He,children:[j,M]}),t[37]=j,t[38]=M,t[39]=se,t[40]=fe,t[41]=N):N=t[41];let P;t[42]!==ae||t[43]!==u||t[44]!==d||t[45]!==m?(P=ae?(0,B.jsx)(`div`,{className:`fixed inset-y-0 left-0 z-[100] flex min-h-0 min-w-0 overflow-hidden bg-surface-panel transition-[right] duration-200 ease-out motion-reduce:transition-none`,style:{right:u?d:0},children:(0,B.jsx)(ue,{allowOutsideChat:!0,sessionKey:m??void 0})}):null,t[42]=ae,t[43]=u,t[44]=d,t[45]=m,t[46]=P):P=t[46];let F;t[47]!==N||t[48]!==P||t[49]!==T?(F=(0,B.jsxs)(ee,{children:[T,N,P]}),t[47]=N,t[48]=P,t[49]=T,t[50]=F):F=t[50];let be;return t[51]!==S||t[52]!==F?(be=(0,B.jsx)(y,{modal:!1,open:!0,onOpenChange:S,children:F}),t[51]=S,t[52]=F,t[53]=be):be=t[53],be}function He(e){let t=e.detail.originalEvent.target;t instanceof Element&&t.closest(`#app-workspace-panel, [data-task-modal-backdrop]`)&&e.preventDefault()}function Ue(e){let t=e.target;t instanceof HTMLElement&&t.closest(`[data-task-inline-editor]`)&&e.preventDefault()}function U(e){return e.setPath}function We(e){return e.path}function Ge(e){return e.setOpen}function Ke(e){return e.openForSession}function W(e){return e.sessionKeyOverride}function qe(e){return e.widthPx}function Je(e){return e.open}function G(e){return e.language}function Ye(e){return(0,B.jsx)(c,{value:e.id,children:e.name||e.id},e.id)}function Xe(e){return e.id}export{Ve as TaskDetailModal,Be as TaskDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-
|
|
1
|
+
import{p as e}from"./locale-store-hDBVeG3G.js";import{t}from"./middleware-Pd0e8Igk.js";var n=`default`,r={light:{default:`#ffffff`,emerald:`#f0fdf4`,mono:`#ffffff`,clay:`#fffaf0`},dark:{default:`#0a0a0a`,emerald:`#000000`,mono:`#101010`,clay:`#0a1a1a`}};function i(e,t){let n=document.head;if(!n)return;let i=n.querySelector(`meta[name="theme-color"][data-xopc-theme-color="true"]`);i||(i=document.createElement(`meta`),i.setAttribute(`name`,`theme-color`),i.setAttribute(`data-xopc-theme-color`,`true`),n.appendChild(i)),i.setAttribute(`content`,r[e][t])}function a(){return globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}function o(e){return e===`system`?a()?`dark`:`light`:e}function s(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}function c(e){return e===`cal`?`mono`:e==="default"||e===`emerald`||e===`mono`||e===`clay`?e:n}function l(e,t,n){let r=document.documentElement,a=()=>{r.classList.toggle(`dark`,e===`dark`),r.dataset.theme=e,r.dataset.colorScheme=t,i(e,t)},o=document;n&&!s()&&typeof o.startViewTransition==`function`?o.startViewTransition(a):a()}function u(){try{let e=localStorage.getItem(`xopc-web-theme`),t=`system`,r=n;if(e){let n=JSON.parse(e);n.state?.preference&&(t=n.state.preference),n.state&&`colorScheme`in n.state&&(r=c(n.state.colorScheme))}l(o(t),r,!1)}catch{l(o(`system`),`default`,!1)}}var d=e(t((e,t)=>({preference:`system`,colorScheme:n,resolved:o(`system`),setPreference:n=>{let r=o(n),{resolved:i,colorScheme:a}=t();l(r,a,r!==i),e({preference:n,resolved:r})},setColorScheme:n=>{let{resolved:r}=t();l(r,n,!0),e({colorScheme:n})}}),{name:`xopc-web-theme`,merge:(e,t)=>{let n=e??{};return{...t,...n,colorScheme:c(n.colorScheme)}}}));function f(){let{preference:e,colorScheme:t}=d.getState(),n=o(e);l(n,t,!1),d.setState({resolved:n})}function p(){let e=globalThis.matchMedia?.(`(prefers-color-scheme: dark)`);if(!e)return()=>{};let t=()=>{let{preference:e,colorScheme:t}=d.getState();if(e!==`system`)return;let n=o(`system`),r=d.getState().resolved;l(n,t,n!==r),d.setState({resolved:n})};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}export{d as i,p as n,f as r,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cn-JdwAhgNB.js";import{es as t,ns as n,ts as r}from"./index-
|
|
1
|
+
import{t as e}from"./cn-JdwAhgNB.js";import{es as t,ns as n,ts as r}from"./index-DJ7HSgKs.js";function i(){return e(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,n,`dark:border-edge`)}function a(){return e(r,t)}var o=`h-auto shrink-0 px-2.5 py-1.5 text-xs font-medium`,s=/^[a-z][a-z0-9_-]{0,63}$/;function c(e){let t=e.trim(),n=t.indexOf(`/`);return n>0&&n<t.length-1}function l(e){let t=e&&typeof e==`object`&&!Array.isArray(e)&&`roles`in e?Object.entries(e.roles??{}).map(([e,t])=>({id:e,...t&&typeof t==`object`&&!Array.isArray(t)?t:{}})):e;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!e||typeof e!=`object`||Array.isArray(e))continue;let t=e,r=typeof t.id==`string`?t.id.trim():``,i=typeof t.model==`string`?t.model.trim():``;if(!r||!i)continue;let a=typeof t.description==`string`?t.description.trim():``,o=Array.isArray(t.fallbacks)?t.fallbacks.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean):[];n.push({id:r,model:i,fallbacks:o,description:a})}return n}function u(e,t){let n=new Set([t.toLowerCase()]),r=[];for(let t of e){let e=t.trim(),i=e.toLowerCase();!e||!c(e)||n.has(i)||(n.add(i),r.push(e))}return r}function d(e){let t=new Map;for(let n of e){let e=n.id.trim(),r=n.model.trim();if(!e||!s.test(e)||!r||!c(r))continue;let i=n.description.trim(),a=u(n.fallbacks??[],r);t.set(e,{model:r,...a.length>0?{fallbacks:a}:{},...i?{description:i}:{}})}return t.size===0?null:{roles:Object.fromEntries(t.entries())}}function f(e,t){let n=new Set;for(let r of e){let e=r.id.trim(),i=r.model.trim(),a=r.fallbacks??[];if(!(!e&&!i&&!r.description.trim()&&a.every(e=>!e.trim()))){if(!e||!s.test(e))return t.invalidId;if(n.has(e))return t.duplicateId;if(n.add(e),!i||!c(i)||a.some(e=>e.trim()&&!c(e)))return t.invalidModel}}return null}function p(e){return e.length===0?`—`:e.map(e=>`${e.id} -> ${e.model}${e.fallbacks?.length?` (+${e.fallbacks.length})`:``}`).join(`, `)}function m(e){return(e??[]).map(e=>({id:e.id,model:e.model,fallbacks:e.fallbacks??[],description:e.description?.trim()??``}))}export{f as a,a as c,m as i,p as n,o,l as r,i as s,d as t};
|
package/dist/gateway/static/root/assets/{use-autosave-DysNnqCS.js → use-autosave-DOj5i8d_.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"./check-DUBLcKHA.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}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"./check-DUBLcKHA.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}from"./locale-store-hDBVeG3G.js";import{Fl as c}from"./index-DJ7HSgKs.js";var l=n(),u=r();function d(e){let t=(0,l.c)(21),{status:n,error:r,className:d}=e,p=s(f)===`zh`,m=n===`saving`?p?`正在保存…`:`Saving…`:n===`saved`?p?`已自动保存`:`Saved automatically`:n===`error`?r||(p?`自动保存失败`:`Autosave failed`):n===`dirty`?p?`编辑中,将自动保存`:`Editing — autosave pending`:p?`自动保存`:`Autosave`,h=n===`error`?`text-danger`:n===`saved`?`text-success`:`text-fg-subtle`,g;t[0]!==d||t[1]!==h?(g=o(`inline-flex min-w-0 items-center gap-1.5 text-xs`,h,d),t[0]=d,t[1]=h,t[2]=g):g=t[2];let _;t[3]===n?_=t[4]:(_=n===`saving`?(0,u.jsx)(a,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}):null,t[3]=n,t[4]=_);let v;t[5]===n?v=t[6]:(v=n===`saved`?(0,u.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,t[5]=n,t[6]=v);let y;t[7]===n?y=t[8]:(y=n===`error`?(0,u.jsx)(c,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,t[7]=n,t[8]=y);let b;t[9]===n?b=t[10]:(b=n===`dirty`?(0,u.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-current`,"aria-hidden":!0}):null,t[9]=n,t[10]=b);let x;t[11]===m?x=t[12]:(x=(0,u.jsx)(`span`,{className:`truncate`,children:m}),t[11]=m,t[12]=x);let S;return t[13]!==m||t[14]!==g||t[15]!==_||t[16]!==v||t[17]!==y||t[18]!==b||t[19]!==x?(S=(0,u.jsxs)(`span`,{className:g,role:`status`,"aria-live":`polite`,title:m,children:[_,v,y,b,x]}),t[13]=m,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S):S=t[20],S}function f(e){return e.language}var p=e(t(),1);function m({value:e,dirty:t,onSave:n,enabled:r=!0,delayMs:i=700,validate:a,serialize:o=JSON.stringify}){let[s,c]=(0,p.useState)(`idle`),[l,u]=(0,p.useState)(null),d=(0,p.useRef)(e),f=(0,p.useRef)(n),m=(0,p.useRef)(a),h=(0,p.useRef)(o),g=(0,p.useRef)(null),_=(0,p.useRef)(!1),v=(0,p.useRef)(null),y=(0,p.useRef)(null),b=(0,p.useRef)(null),x=(0,p.useRef)(!0);d.current=e,f.current=n,m.current=a,h.current=o;let S=(0,p.useCallback)(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),C=(0,p.useCallback)(async e=>{S();let t=h.current(e);b.current=t;let n=m.current?.(e)??null;if(n){u(n),c(`error`);return}if(_.current){v.current=e;return}_.current=!0,u(null),c(`saving`);try{await f.current(e),y.current=t,x.current&&c(`saved`)}catch(e){x.current&&(u(e instanceof Error?e.message:String(e)),c(`error`))}finally{_.current=!1;let e=v.current;v.current=null,e&&h.current(e)!==y.current&&C(e)}},[S]),w=(0,p.useCallback)(()=>{let e=d.current;!r||!t||e===null||C(e)},[t,r,C]),T=(0,p.useCallback)(e=>{let t=e??d.current;!r||t===null||C(t)},[r,C]);return(0,p.useEffect)(()=>{if(!r||!t||e===null){S(),!t&&s===`dirty`&&c(`idle`);return}let n=o(e);if(n!==y.current&&!(s===`error`&&n===b.current))return c(e=>e===`saving`?e:`dirty`),S(),g.current=window.setTimeout(()=>void C(e),i),S},[S,i,t,r,C,o,s,e]),(0,p.useEffect)(()=>(x.current=!0,()=>{x.current=!1,S()}),[S]),{status:s,error:l,flush:w,saveNow:T,retry:w,onBlurCapture:w}}export{d as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o,r as s}from"./popover-select-BzdnTy3h.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./loader-circle-CifKLtgG.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./button-CSEbl4zT.js";import{n as p}from"./locale-store-pByvK12G.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./dist-BPoKqzeH.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{Co as S,Dl as C,Hl as w,Ia as T,Il as E,Ls as D,So as O,Vl as k,Yc as A,_o as j,ac as M,bo as N,co as P,do as F,fo as I,go as L,ho as R,lo as z,ml as B,mo as V,pc as H,po as U,qa as W,so as G,uo as K,vo as q,vs as J,xo as ee,yo as Y}from"./index-C2ZYFBGL.js";import{n as te,t as ne}from"./use-autosave-DysNnqCS.js";import{t as re}from"./page-tabs-gw-RMQCV.js";import{F as ie,a as ae,i as oe}from"./connectors-api-CUl6_EQJ.js";var X=n(),Z=e(t(),1),Q=r(),se=new Set([`profile`,`understanding`,`collaboration`,`sources`,`dreaming`,`privacy`]),$=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,ce={en:{title:`About You`,subtitle:`What xopc knows, why it knows it, and how it should work with you.`,profile:`Profile`,understanding:`Understanding`,collaboration:`Working agreement`,sources:`Sources`,dreaming:`Background review`,privacy:`Privacy`,profileHint:`Facts you provide directly. These are available across conversations.`,done:`Done`,required:`This field cannot be empty.`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: product designer, founder, or engineer`,primaryGoal:`What are you mainly trying to achieve?`,primaryGoalPlaceholder:`The outcome you want xopc to optimize for`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,locale:`Language / locale`,detect:`Use this device`,understoodHint:`Reviewable beliefs learned from your conversations and work. Inferences stay pending until confirmed.`,addUnderstanding:`Add understanding`,statement:`What should xopc understand?`,kind:`Type`,add:`Add`,cancel:`Cancel`,active:`Active`,review:`Needs review`,confirm:`Confirm`,reject:`Wrong`,edit:`Edit`,delete:`Delete`,confirmDelete:`Delete now`,rulesHint:`Explicit instructions for how xopc should collaborate with you. Rules outrank inferred understanding.`,addRule:`Add rule`,ruleStatement:`How should xopc work with you?`,category:`Category`,disable:`Disable`,enable:`Enable`,emptyUnderstanding:`Nothing here yet. Tell xopc something explicitly, or confirm a suggestion after it learns one.`,qualityTitle:`Learning quality`,qualityActive:`Confirmed`,qualityPending:`Pending review`,qualityAcceptance:`30-day acceptance`,qualityRecall:`Helpful recall`,qualityNoData:`Not enough feedback yet`,emptyRules:`No working agreements yet.`,sourceExplicit:`You said this directly`,sourceInferred:`Inferred — may be wrong`,sourceObserved:`Observed across prior work`,sourcesHint:`Review every granted source, its access mode, retention, and last collection. Revoking stops future learning.`,manageSources:`Connect another source`,authorizedSources:`Authorized sources`,connectorsTitle:`Connectors`,openConnector:`Open connector`,noSources:`No sources are authorized.`,noConnectors:`No connectors are installed.`,connected:`Connected`,unavailable:`Needs attention`,revoke:`Revoke source`,revokeHint:`Revoke this source and remove its derived understanding`,confirmRevoke:`Confirm revoke`,revoking:`Revoking…`,revokeDone:`Source revoked and derived understanding removed.`,refresh:`Update`,refreshing:`Updating…`,refreshStarted:`Update started.`,actionFailed:`Action failed`,once:`One-time`,continuous:`Continuous`,localOnly:`Local only`,derivedOnly:`Derived understanding only`,focuses:`Current focuses`,focusHint:`Candidate focuses never activate until you confirm them.`,activate:`Activate`,pause:`Pause`,complete:`Complete`,noFocuses:`No focus candidates yet.`,focusCandidate:`Suggested`,focusActive:`Active`,focusPaused:`Paused`,focusCompleted:`Completed`,confidence:`Confidence`,confidenceHigh:`High`,confidenceMedium:`Medium`,confidenceLow:`Low`,dreamingHint:`A deterministic daily review checks expiry, contradictory evidence, and corroborated candidates. It never auto-activates an inference.`,mode:`Background review`,on:`On — propose for review`,off:`Off`,reviewTime:`Daily review time`,evidenceThreshold:`Supporting evidence required`,scanLimit:`Maximum items per run`,lastRun:`Last review`,neverRun:`Not run yet`,runCompleted:`Completed`,runFailed:`Failed`,runRunning:`Running`,runItems:`items`,privacyHint:`Choose how generic memory providers handle sensitive content. Structured user understanding applies stricter rules of its own.`,sensitivePolicy:`Sensitive memory writes`,policyDeny:`Do not store`,policyConfirm:`Ask before storing`,policyAllow:`Store when relevant`,privacyWarning:`Secret and regulated content is never stored as structured user understanding, regardless of this setting.`,error:`Could not load your context.`,retry:`Try again`},zh:{title:`关于你`,subtitle:`清楚查看 xopc 知道什么、为什么知道,以及应该如何与你协作。`,profile:`个人资料`,understanding:`对你的理解`,collaboration:`协作约定`,sources:`数据来源`,dreaming:`后台复核`,privacy:`隐私`,profileHint:`由你直接提供的事实,会在不同对话中使用。`,done:`完成`,required:`此项不能为空。`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:产品设计师、创业者、工程师`,primaryGoal:`你目前最想达成什么?`,primaryGoalPlaceholder:`希望 xopc 优先帮助你实现的结果`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,locale:`语言 / 地区`,detect:`使用本机时区`,understoodHint:`从对话和工作中形成、可复核的理解。推断内容在你确认前保持待审核。`,addUnderstanding:`添加理解`,statement:`希望 xopc 了解什么?`,kind:`类型`,add:`添加`,cancel:`取消`,active:`使用中`,review:`待审核`,confirm:`确认`,reject:`不正确`,edit:`编辑`,delete:`删除`,confirmDelete:`确认删除`,rulesHint:`你明确设定的协作方式。协作约定的优先级高于推断出的理解。`,addRule:`添加约定`,ruleStatement:`希望 xopc 如何与你协作?`,category:`类别`,disable:`停用`,enable:`启用`,emptyUnderstanding:`还没有内容。你可以直接告诉 xopc,或在它学到建议后进行确认。`,emptyRules:`还没有协作约定。`,qualityTitle:`学习质量`,qualityActive:`已确认`,qualityPending:`待审核`,qualityAcceptance:`30 天采纳率`,qualityRecall:`有效召回`,qualityNoData:`反馈数据还不足`,sourceExplicit:`由你直接告知`,sourceInferred:`推断内容,可能有误`,sourceObserved:`从过往工作中观察到`,sourcesHint:`查看每项授权的访问方式、保留策略和最近采集时间;撤销后将停止后续学习。`,manageSources:`连接其他来源`,authorizedSources:`已授权数据来源`,connectorsTitle:`连接器`,openConnector:`打开连接器`,noSources:`尚未授权任何来源。`,noConnectors:`尚未安装连接器。`,connected:`已连接`,unavailable:`需要处理`,revoke:`撤销来源`,revokeHint:`撤销此来源并删除由它产生的理解`,confirmRevoke:`确认撤销`,revoking:`正在撤销…`,revokeDone:`已撤销来源并删除派生理解。`,refresh:`更新`,refreshing:`正在更新…`,refreshStarted:`更新任务已开始。`,actionFailed:`操作失败`,once:`仅一次`,continuous:`持续更新`,localOnly:`仅本地处理`,derivedOnly:`仅保留派生理解`,focuses:`当前关注`,focusHint:`候选关注不会自动生效,只有你确认后才会启用。`,activate:`启用`,pause:`暂停`,complete:`完成`,noFocuses:`还没有候选关注。`,focusCandidate:`待确认`,focusActive:`进行中`,focusPaused:`已暂停`,focusCompleted:`已完成`,confidence:`置信度`,confidenceHigh:`高`,confidenceMedium:`中`,confidenceLow:`低`,dreamingHint:`每天进行一次确定性复核,检查过期、矛盾证据和得到佐证的候选理解;推断内容不会自动生效。`,mode:`后台复核`,on:`开启并生成待审核项`,off:`关闭`,reviewTime:`每日复核时间`,evidenceThreshold:`所需支持证据数`,scanLimit:`每次最多检查`,lastRun:`最近一次复核`,neverRun:`尚未运行`,runCompleted:`已完成`,runFailed:`失败`,runRunning:`运行中`,runItems:`项`,privacyHint:`选择通用记忆服务如何处理敏感内容;结构化用户理解有独立且更严格的规则。`,sensitivePolicy:`敏感记忆写入`,policyDeny:`不保存`,policyConfirm:`保存前询问`,policyAllow:`相关时允许保存`,privacyWarning:`无论这里如何设置,秘密和受监管内容都不会保存为结构化用户理解。`,error:`无法加载用户上下文。`,retry:`重试`}},le={preference:{en:`Preference`,zh:`偏好`},boundary:{en:`Boundary`,zh:`边界`},relationship:{en:`Relationship`,zh:`关系`},routine:{en:`Routine`,zh:`习惯`},current_state:{en:`Current state`,zh:`当前状态`},long_term_goal:{en:`Long-term goal`,zh:`长期目标`},project_context:{en:`Project context`,zh:`项目背景`},task_lesson:{en:`Task lesson`,zh:`任务经验`},derived_insight:{en:`Insight`,zh:`洞察`}},ue={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function de(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:n}),t[0]=n,t[1]=r),r}function fe(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function pe(e){let t=(0,X.c)(33),{open:n,onOpenChange:r,title:i,description:a,submitLabel:o,cancelLabel:s,submitDisabled:c,onSubmit:l,children:u}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(m,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=p):p=t[0];let x;t[1]===i?x=t[2]:(x=(0,Q.jsx)(y,{className:`text-base font-semibold text-fg`,children:i}),t[1]=i,t[2]=x);let S;t[3]===a?S=t[4]:(S=(0,Q.jsx)(h,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a}),t[3]=a,t[4]=S);let C;t[5]!==x||t[6]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[5]=x,t[6]=S,t[7]=C):C=t[7];let w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(d,{className:`size-4`}),t[8]=w):w=t[8];let T;t[9]===s?T=t[10]:(T=(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsx)(f,{type:`button`,variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":s,children:w})}),t[9]=s,t[10]=T);let E;t[11]!==C||t[12]!==T?(E=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[C,T]}),t[11]=C,t[12]=T,t[13]=E):E=t[13];let D;t[14]===u?D=t[15]:(D=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:u}),t[14]=u,t[15]=D);let O;t[16]===s?O=t[17]:(O=(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsx)(f,{type:`button`,children:s})}),t[16]=s,t[17]=O);let k;t[18]!==c||t[19]!==o?(k=(0,Q.jsx)(f,{type:`submit`,variant:`primary`,disabled:c,children:o}),t[18]=c,t[19]=o,t[20]=k):k=t[20];let A;t[21]!==k||t[22]!==O?(A=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[O,k]}),t[21]=k,t[22]=O,t[23]=A):A=t[23];let j;t[24]!==l||t[25]!==A||t[26]!==E||t[27]!==D?(j=(0,Q.jsxs)(_,{children:[p,(0,Q.jsx)(v,{className:`fixed left-1/2 top-1/2 z-[90] h-[min(30rem,calc(100vh-2rem))] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col`,onSubmit:l,children:[E,D,A]})})]}),t[24]=l,t[25]=A,t[26]=E,t[27]=D,t[28]=j):j=t[28];let M;return t[29]!==r||t[30]!==n||t[31]!==j?(M=(0,Q.jsx)(b,{open:n,onOpenChange:r,children:j}),t[29]=r,t[30]=n,t[31]=j,t[32]=M):M=t[32],M}function me(e){return JSON.stringify(e)}function he(e){let t=(0,X.c)(10),[n,r]=(0,Z.useState)(e),i;t[0]===e?i=t[1]:(i=me(e),t[0]=e,t[1]=i);let a=(0,Z.useRef)(i),o;t[2]===e?o=t[3]:(o=me(e),t[2]=e,t[3]=o);let s=o,c,l;t[4]!==e||t[5]!==s?(c=()=>{if(s===a.current)return;let t=a.current;a.current=s,r(n=>me(n)===t?e:n)},l=[e,s],t[4]=e,t[5]=s,t[6]=c,t[7]=l):(c=t[6],l=t[7]),(0,Z.useEffect)(c,l);let u;return t[8]===n?u=t[9]:(u=[n,r],t[8]=n,t[9]=u),u}function ge(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function _e(){let e=(0,X.c)(87),t=p(xe),n=ce[t],[r,a]=i(),o;if(e[0]!==r){let t=r.get(`tab`);o=t&&se.has(t)?t:`profile`,e[0]=r,e[1]=o}else o=e[1];let s=o,c=W(be),l=W(ye),{data:u,error:d,isLoading:f,mutate:m}=x(`/api/you`,V),h;e[2]!==l||e[3]!==c||e[4]!==n.subtitle||e[5]!==n.title?(h=()=>(c({startExtra:null,main:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:n.title}),(0,Q.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:n.subtitle})]}),end:null}),l),e[2]=l,e[3]=c,e[4]=n.subtitle,e[5]=n.title,e[6]=h):h=e[6];let g;if(e[7]!==l||e[8]!==c||e[9]!==n?(g=[l,c,n],e[7]=l,e[8]=c,e[9]=n,e[10]=g):g=e[10],(0,Z.useEffect)(h,g),f){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-4 p-4 sm:p-6`,children:[(0,Q.jsx)(T,{className:`h-10 w-96 max-w-full`}),(0,Q.jsx)(T,{className:`h-72 rounded-2xl`})]}),e[11]=t):t=e[11],t}if(d||!u){let t;e[12]===m?t=e[13]:(t=()=>void m(),e[12]=m,e[13]=t);let r;e[14]!==n.retry||e[15]!==t?(r=(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:t,children:n.retry}),e[14]=n.retry,e[15]=t,e[16]=r):r=e[16];let i;return e[17]!==n.error||e[18]!==r?(i=(0,Q.jsx)(`div`,{className:`p-6`,children:(0,Q.jsxs)(fe,{children:[n.error,` `,r]})}),e[17]=n.error,e[18]=r,e[19]=i):i=e[19],i}let _=n.title,v;e[20]===a?v=e[21]:(v=e=>a({tab:e}),e[20]=a,e[21]=v);let y;e[22]===n.profile?y=e[23]:(y={id:`profile`,label:n.profile,icon:C},e[22]=n.profile,e[23]=y);let b;e[24]!==u.understandings.length||e[25]!==n.understanding?(b={id:`understanding`,label:n.understanding,icon:w,count:u.understandings.length},e[24]=u.understandings.length,e[25]=n.understanding,e[26]=b):b=e[26];let S=n.collaboration,E;e[27]===u.rules?E=e[28]:(E=u.rules.filter(ve),e[27]=u.rules,e[28]=E);let O;e[29]!==n.collaboration||e[30]!==E.length?(O={id:`collaboration`,label:S,icon:A,count:E.length},e[29]=n.collaboration,e[30]=E.length,e[31]=O):O=e[31];let j;e[32]===n.sources?j=e[33]:(j={id:`sources`,label:n.sources,icon:k},e[32]=n.sources,e[33]=j);let M;e[34]===n.dreaming?M=e[35]:(M={id:`dreaming`,label:n.dreaming,icon:H},e[34]=n.dreaming,e[35]=M);let N;e[36]===n.privacy?N=e[37]:(N={id:`privacy`,label:n.privacy,icon:D},e[36]=n.privacy,e[37]=N);let P;e[38]!==j||e[39]!==M||e[40]!==N||e[41]!==y||e[42]!==b||e[43]!==O?(P=[y,b,O,j,M,N],e[38]=j,e[39]=M,e[40]=N,e[41]=y,e[42]=b,e[43]=O,e[44]=P):P=e[44];let F;e[45]!==n.title||e[46]!==P||e[47]!==v||e[48]!==s?(F=(0,Q.jsx)(re,{ariaLabel:_,activeTab:s,onChange:v,items:P}),e[45]=n.title,e[46]=P,e[47]=v,e[48]=s,e[49]=F):F=e[49];let I;e[50]!==u.profile||e[51]!==t||e[52]!==m||e[53]!==n||e[54]!==s?(I=s===`profile`?(0,Q.jsx)(Se,{profile:u.profile,language:t,t:n,onChanged:e=>m(t=>t&&{...t,profile:e},{revalidate:!1})}):null,e[50]=u.profile,e[51]=t,e[52]=m,e[53]=n,e[54]=s,e[55]=I):I=e[55];let L;e[56]!==u.quality||e[57]!==u.understandings||e[58]!==t||e[59]!==m||e[60]!==n||e[61]!==s?(L=s===`understanding`?(0,Q.jsx)(we,{items:u.understandings,quality:u.quality,language:t,t:n,onChanged:e=>e?m(t=>t&&{...t,understandings:t.understandings.map(t=>t.id===e.id?e:t)},{revalidate:!0}):m()}):null,e[56]=u.quality,e[57]=u.understandings,e[58]=t,e[59]=m,e[60]=n,e[61]=s,e[62]=L):L=e[62];let R;e[63]!==u.rules||e[64]!==t||e[65]!==m||e[66]!==n||e[67]!==s?(R=s===`collaboration`?(0,Q.jsx)(Me,{rules:u.rules,language:t,t:n,onChanged:()=>m()}):null,e[63]=u.rules,e[64]=t,e[65]=m,e[66]=n,e[67]=s,e[68]=R):R=e[68];let z;e[69]!==n||e[70]!==s?(z=s===`sources`?(0,Q.jsx)(Fe,{t:n}):null,e[69]=n,e[70]=s,e[71]=z):z=e[71];let B;e[72]!==u.consolidation?.lastRun||e[73]!==n||e[74]!==s?(B=s===`dreaming`?(0,Q.jsx)(Ie,{lastRun:u.consolidation?.lastRun??null,t:n}):null,e[72]=u.consolidation?.lastRun,e[73]=n,e[74]=s,e[75]=B):B=e[75];let U;e[76]!==n||e[77]!==s?(U=s===`privacy`?(0,Q.jsx)(Re,{t:n}):null,e[76]=n,e[77]=s,e[78]=U):U=e[78];let G;return e[79]!==F||e[80]!==I||e[81]!==L||e[82]!==R||e[83]!==z||e[84]!==B||e[85]!==U?(G=(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl space-y-5 p-4 sm:p-6`,children:[F,I,L,R,z,B,U]}),e[79]=F,e[80]=I,e[81]=L,e[82]=R,e[83]=z,e[84]=B,e[85]=U,e[86]=G):G=e[86],G}function ve(e){return e.status===`active`}function ye(e){return e.clearPageHeader}function be(e){return e.setPageHeader}function xe(e){return e.language}function Se(e){let t=(0,X.c)(78),{profile:n,language:r,t:i,onChanged:a}=e,o;t[0]===n?o=t[1]:(o=ge(n),t[0]=n,t[1]=o);let s=o,[c,l]=he(s),u;t[2]===c?u=t[3]:(u=me(c),t[2]=c,t[3]=u);let d;t[4]===s?d=t[5]:(d=me(s),t[4]=s,t[5]=d);let p=u!==d,m;t[6]!==a||t[7]!==n?(m=async e=>{await a((await S({...e,accessibility:n.accessibility})).profile)},t[6]=a,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==c||t[10]!==p||t[11]!==m?(h={value:c,dirty:p,delayMs:500,onSave:m},t[9]=c,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=ne(h),_;t[13]!==c||t[14]!==l?(_=(e,t,n)=>(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Q.jsx)(`input`,{className:$,placeholder:n,value:c[e],onChange:t=>l(n=>({...n,[e]:t.target.value}))})]}),t[13]=c,t[14]=l,t[15]=_):_=t[15];let v=_,y=g.onBlurCapture,b;t[16]===i.profileHint?b=t[17]:(b=(0,Q.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-fg-muted`,children:i.profileHint}),t[16]=i.profileHint,t[17]=b);let x;t[18]!==v||t[19]!==i.callName||t[20]!==i.callNamePlaceholder?(x=v(`callName`,i.callName,i.callNamePlaceholder),t[18]=v,t[19]=i.callName,t[20]=i.callNamePlaceholder,t[21]=x):x=t[21];let C;t[22]!==v||t[23]!==i.role||t[24]!==i.rolePlaceholder?(C=v(`role`,i.role,i.rolePlaceholder),t[22]=v,t[23]=i.role,t[24]=i.rolePlaceholder,t[25]=C):C=t[25];let w;t[26]===i.primaryGoal?w=t[27]:(w=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.primaryGoal}),t[26]=i.primaryGoal,t[27]=w);let T;t[28]===l?T=t[29]:(T=e=>l(t=>({...t,primaryGoal:e.target.value})),t[28]=l,t[29]=T);let E;t[30]!==c.primaryGoal||t[31]!==i.primaryGoalPlaceholder||t[32]!==T?(E=(0,Q.jsx)(`textarea`,{className:$,rows:3,placeholder:i.primaryGoalPlaceholder,value:c.primaryGoal,onChange:T}),t[30]=c.primaryGoal,t[31]=i.primaryGoalPlaceholder,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==w||t[35]!==E?(D=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[w,E]}),t[34]=w,t[35]=E,t[36]=D):D=t[36];let O;t[37]!==v||t[38]!==r||t[39]!==i.pronouns||t[40]!==i.pronounsPlaceholder?(O=r===`en`?v(`pronouns`,i.pronouns,i.pronounsPlaceholder):null,t[37]=v,t[38]=r,t[39]=i.pronouns,t[40]=i.pronounsPlaceholder,t[41]=O):O=t[41];let k;t[42]===i.timezone?k=t[43]:(k=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[42]=i.timezone,t[43]=k);let A;t[44]===l?A=t[45]:(A=e=>l(t=>({...t,timezone:e.target.value})),t[44]=l,t[45]=A);let j;t[46]!==c.timezone||t[47]!==A?(j=(0,Q.jsx)(`input`,{className:`${$} min-w-0 flex-1`,value:c.timezone,onChange:A}),t[46]=c.timezone,t[47]=A,t[48]=j):j=t[48];let M;t[49]===l?M=t[50]:(M=()=>l(Ce),t[49]=l,t[50]=M);let N;t[51]!==i.detect||t[52]!==M?(N=(0,Q.jsx)(f,{className:`shrink-0 whitespace-nowrap`,onClick:M,children:i.detect}),t[51]=i.detect,t[52]=M,t[53]=N):N=t[53];let P;t[54]!==j||t[55]!==N?(P=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[j,N]}),t[54]=j,t[55]=N,t[56]=P):P=t[56];let F;t[57]!==k||t[58]!==P?(F=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[k,P]}),t[57]=k,t[58]=P,t[59]=F):F=t[59];let I;t[60]!==v||t[61]!==i.locale?(I=v(`locale`,i.locale),t[60]=v,t[61]=i.locale,t[62]=I):I=t[62];let L;t[63]!==x||t[64]!==C||t[65]!==D||t[66]!==O||t[67]!==F||t[68]!==I?(L=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[x,C,D,O,F,I]}),t[63]=x,t[64]=C,t[65]=D,t[66]=O,t[67]=F,t[68]=I,t[69]=L):L=t[69];let R;t[70]!==g.error||t[71]!==g.status?(R=(0,Q.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Q.jsx)(te,{status:g.status,error:g.error})}),t[70]=g.error,t[71]=g.status,t[72]=R):R=t[72];let z;return t[73]!==g.onBlurCapture||t[74]!==L||t[75]!==R||t[76]!==b?(z=(0,Q.jsx)(de,{children:(0,Q.jsxs)(`div`,{onBlurCapture:y,children:[b,L,R]})}),t[73]=g.onBlurCapture,t[74]=L,t[75]=R,t[76]=b,t[77]=z):z=t[77],z}function Ce(e){return{...e,timezone:I()}}function we(e){let t=(0,X.c)(78),{items:n,quality:r,language:i,t:a,onChanged:c}=e,[l,d]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(`preference`),_;t[0]===n?_=t[1]:(_=n.filter(Ee),t[0]=n,t[1]=_);let v=_,y;t[2]===n?y=t[3]:(y=n.filter(Te),t[2]=n,t[3]=y);let b=y,x;t[4]!==h||t[5]!==c||t[6]!==p?(x=async e=>{e.preventDefault(),p.trim()&&(await P({statement:p,kind:h}),m(``),d(!1),await c())},t[4]=h,t[5]=c,t[6]=p,t[7]=x):x=t[7];let S=x,C;t[8]===a.understoodHint?C=t[9]:(C=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:a.understoodHint}),t[8]=a.understoodHint,t[9]=C);let w,T;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>d(!0),T=(0,Q.jsx)(u,{className:`size-4`}),t[10]=w,t[11]=T):(w=t[10],T=t[11]);let E;t[12]===a.addUnderstanding?E=t[13]:(E=(0,Q.jsxs)(f,{variant:`primary`,onClick:w,children:[T,a.addUnderstanding]}),t[12]=a.addUnderstanding,t[13]=E);let D;t[14]!==C||t[15]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[C,E]}),t[14]=C,t[15]=E,t[16]=D):D=t[16];let O=a.addUnderstanding,k=a.understoodHint,A=a.add,j=a.cancel,M;t[17]===p?M=t[18]:(M=p.trim(),t[17]=p,t[18]=M);let N=!M,F;t[19]===a.statement?F=t[20]:(F=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:a.statement}),t[19]=a.statement,t[20]=F);let I;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>m(e.target.value),t[21]=I):I=t[21];let L;t[22]!==p||t[23]!==a.statement?(L=(0,Q.jsx)(`textarea`,{autoFocus:!0,className:$,rows:4,placeholder:a.statement,value:p,onChange:I}),t[22]=p,t[23]=a.statement,t[24]=L):L=t[24];let R;t[25]!==F||t[26]!==L?(R=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[F,L]}),t[25]=F,t[26]=L,t[27]=R):R=t[27];let z;t[28]===a.kind?z=t[29]:(z=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:a.kind}),t[28]=a.kind,t[29]=z);let B,V;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>g(e.target.value),V=Object.entries(le),t[30]=B,t[31]=V):(B=t[30],V=t[31]);let H;t[32]===i?H=t[33]:(H=V.map(e=>{let[t,n]=e;return(0,Q.jsx)(s,{value:t,children:n[i]},t)}),t[32]=i,t[33]=H);let U;t[34]!==h||t[35]!==H?(U=(0,Q.jsx)(o,{value:h,onChange:B,children:H}),t[34]=h,t[35]=H,t[36]=U):U=t[36];let W;t[37]!==z||t[38]!==U?(W=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[z,U]}),t[37]=z,t[38]=U,t[39]=W):W=t[39];let G;t[40]!==l||t[41]!==S||t[42]!==a.add||t[43]!==a.addUnderstanding||t[44]!==a.cancel||t[45]!==a.understoodHint||t[46]!==N||t[47]!==R||t[48]!==W?(G=(0,Q.jsxs)(pe,{open:l,onOpenChange:d,title:O,description:k,submitLabel:A,cancelLabel:j,submitDisabled:N,onSubmit:S,children:[R,W]}),t[40]=l,t[41]=S,t[42]=a.add,t[43]=a.addUnderstanding,t[44]=a.cancel,t[45]=a.understoodHint,t[46]=N,t[47]=R,t[48]=W,t[49]=G):G=t[49];let K;t[50]!==r||t[51]!==a?(K=(0,Q.jsx)(De,{quality:r,t:a}),t[50]=r,t[51]=a,t[52]=K):K=t[52];let q;t[53]===a?q=t[54]:(q=(0,Q.jsx)(Ae,{t:a}),t[53]=a,t[54]=q);let J;t[55]!==i||t[56]!==c||t[57]!==b||t[58]!==a?(J=b.length?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.review,` · `,b.length]}),(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:b.map(e=>(0,Q.jsx)(ke,{item:e,language:i,t:a,onChanged:c},e.id))})]}):null,t[55]=i,t[56]=c,t[57]=b,t[58]=a,t[59]=J):J=t[59];let ee;t[60]!==v.length||t[61]!==a.active?(ee=(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.active,` · `,v.length]}),t[60]=v.length,t[61]=a.active,t[62]=ee):ee=t[62];let Y;t[63]!==v||t[64]!==i||t[65]!==c||t[66]!==a?(Y=v.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:v.map(e=>(0,Q.jsx)(ke,{item:e,language:i,t:a,onChanged:c},e.id))}):(0,Q.jsx)(fe,{children:a.emptyUnderstanding}),t[63]=v,t[64]=i,t[65]=c,t[66]=a,t[67]=Y):Y=t[67];let te;t[68]!==ee||t[69]!==Y?(te=(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[ee,Y]}),t[68]=ee,t[69]=Y,t[70]=te):te=t[70];let ne;return t[71]!==G||t[72]!==K||t[73]!==q||t[74]!==J||t[75]!==te||t[76]!==D?(ne=(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[D,G,K,q,J,te]}),t[71]=G,t[72]=K,t[73]=q,t[74]=J,t[75]=te,t[76]=D,t[77]=ne):ne=t[77],ne}function Te(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function Ee(e){return e.status===`active`}function De(e){let t=(0,X.c)(32),{quality:n,t:r}=e,i;t[0]===r.qualityNoData?i=t[1]:(i=e=>e==null?r.qualityNoData:`${Math.round(e*100)}%`,t[0]=r.qualityNoData,t[1]=i);let a=i,o=r.qualityActive,s=String(n.records.active),c;t[2]!==r.qualityActive||t[3]!==s?(c=[o,s],t[2]=r.qualityActive,t[3]=s,t[4]=c):c=t[4];let l=r.qualityPending,u=String(n.records.candidate+n.records.needsReview),d;t[5]!==r.qualityPending||t[6]!==u?(d=[l,u],t[5]=r.qualityPending,t[6]=u,t[7]=d):d=t[7];let f=r.qualityAcceptance,p;t[8]!==n.decisions.acceptanceRate||t[9]!==a?(p=a(n.decisions.acceptanceRate),t[8]=n.decisions.acceptanceRate,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==r.qualityAcceptance||t[12]!==p?(m=[f,p],t[11]=r.qualityAcceptance,t[12]=p,t[13]=m):m=t[13];let h=r.qualityRecall,g;t[14]!==n.recall.helpfulRate||t[15]!==a?(g=a(n.recall.helpfulRate),t[14]=n.recall.helpfulRate,t[15]=a,t[16]=g):g=t[16];let _;t[17]!==r.qualityRecall||t[18]!==g?(_=[h,g],t[17]=r.qualityRecall,t[18]=g,t[19]=_):_=t[19];let v;t[20]!==m||t[21]!==_||t[22]!==c||t[23]!==d?(v=[c,d,m,_],t[20]=m,t[21]=_,t[22]=c,t[23]=d,t[24]=v):v=t[24];let y=v,b;t[25]===r.qualityTitle?b=t[26]:(b=(0,Q.jsx)(`h2`,{className:`text-xs font-medium text-fg-muted`,children:r.qualityTitle}),t[25]=r.qualityTitle,t[26]=b);let x;t[27]===y?x=t[28]:(x=y.map(Oe),t[27]=y,t[28]=x);let S;return t[29]!==b||t[30]!==x?(S=(0,Q.jsxs)(`section`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 rounded-xl bg-surface-muted px-3 py-2.5`,children:[b,x]}),t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function Oe(e){let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:t}),(0,Q.jsx)(`span`,{className:`font-semibold text-fg`,children:n})]},t)}function ke(e){let t=(0,X.c)(60),{item:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,d]=he(n.statement),p=u!==n.statement,m;t[0]===i.required?m=t[1]:(m=e=>e.trim()?null:i.required,t[0]=i.required,t[1]=m);let h;t[2]!==n.id||t[3]!==a?(h=async e=>{await a((await N(n.id,{statement:e})).understanding)},t[2]=n.id,t[3]=a,t[4]=h):h=t[4];let g;t[5]!==u||t[6]!==o||t[7]!==p||t[8]!==m||t[9]!==h?(g={value:u,dirty:p,enabled:o,delayMs:500,validate:m,onSave:h},t[5]=u,t[6]=o,t[7]=p,t[8]=m,t[9]=h,t[10]=g):g=t[10];let _=ne(g),v;t[11]!==u||t[12]!==o||t[13]!==d?(v=o?(0,Q.jsx)(`textarea`,{autoFocus:!0,className:$,value:u,onChange:e=>d(e.target.value),rows:3}):(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:u}),t[11]=u,t[12]=o,t[13]=d,t[14]=v):v=t[14];let y=le[n.kind][r],b;t[15]===y?b=t[16]:(b=(0,Q.jsx)(`span`,{children:y}),t[15]=y,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(`span`,{children:`·`}),t[17]=x):x=t[17];let S=n.explicitness===`explicit`?i.sourceExplicit:n.explicitness===`observed`?i.sourceObserved:i.sourceInferred,C;t[18]===S?C=t[19]:(C=(0,Q.jsx)(`span`,{children:S}),t[18]=S,t[19]=C);let w;t[20]!==C||t[21]!==b?(w=(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[b,x,C]}),t[20]=C,t[21]=b,t[22]=w):w=t[22];let T;t[23]!==w||t[24]!==v?(T=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[v,w]}),t[23]=w,t[24]=v,t[25]=T):T=t[25];let E;t[26]!==_||t[27]!==o||t[28]!==i.done||t[29]!==i.edit?(E=o?(0,Q.jsx)(f,{variant:`ghost`,onClick:()=>{_.flush(),s(!1)},children:i.done}):(0,Q.jsxs)(f,{variant:`ghost`,onClick:()=>s(!0),children:[(0,Q.jsx)(M,{className:`size-3.5`}),i.edit]}),t[26]=_,t[27]=o,t[28]=i.done,t[29]=i.edit,t[30]=E):E=t[30];let D;t[31]!==n.id||t[32]!==n.status||t[33]!==a||t[34]!==i.confirm||t[35]!==i.reject?(D=n.status===`active`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{variant:`primary`,onClick:async()=>{await a((await N(n.id,{status:`active`})).understanding)},children:i.confirm}),(0,Q.jsx)(f,{onClick:async()=>{await a((await N(n.id,{status:`rejected`})).understanding)},children:i.reject})]}),t[31]=n.id,t[32]=n.status,t[33]=a,t[34]=i.confirm,t[35]=i.reject,t[36]=D):D=t[36];let O;t[37]!==c||t[38]!==n.id||t[39]!==a?(O=async()=>{if(!c){l(!0);return}await K(n.id),l(!1),await a()},t[37]=c,t[38]=n.id,t[39]=a,t[40]=O):O=t[40];let k;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(J,{className:`size-3.5`}),t[41]=k):k=t[41];let A=c?i.confirmDelete:i.delete,j;t[42]!==O||t[43]!==A?(j=(0,Q.jsxs)(f,{variant:`ghost`,className:`text-danger`,onClick:O,children:[k,A]}),t[42]=O,t[43]=A,t[44]=j):j=t[44];let P;t[45]!==E||t[46]!==D||t[47]!==j?(P=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 sm:justify-end`,children:[E,D,j]}),t[45]=E,t[46]=D,t[47]=j,t[48]=P):P=t[48];let F;t[49]!==T||t[50]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:gap-4`,children:[T,P]}),t[49]=T,t[50]=P,t[51]=F):F=t[51];let I;t[52]!==_.error||t[53]!==_.status||t[54]!==o?(I=o||_.status!==`idle`?(0,Q.jsx)(te,{className:`mt-2`,status:_.status,error:_.error}):null,t[52]=_.error,t[53]=_.status,t[54]=o,t[55]=I):I=t[55];let L;return t[56]!==_.onBlurCapture||t[57]!==F||t[58]!==I?(L=(0,Q.jsx)(`article`,{className:`px-4 py-3 sm:px-5`,children:(0,Q.jsxs)(`div`,{onBlurCapture:_.onBlurCapture,children:[F,I]})}),t[56]=_.onBlurCapture,t[57]=F,t[58]=I,t[59]=L):L=t[59],L}function Ae(e){let t=(0,X.c)(35),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=x(`you-focuses`,L),[s,c]=(0,Z.useState)(null);if(a){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(T,{className:`h-40 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;return t[1]===n.error?e=t[2]:(e=(0,Q.jsx)(fe,{children:n.error}),t[1]=n.error,t[2]=e),e}let l;if(t[3]!==r||t[4]!==s||t[5]!==o||t[6]!==n.activate||t[7]!==n.complete||t[8]!==n.confidence||t[9]!==n.confidenceHigh||t[10]!==n.confidenceLow||t[11]!==n.confidenceMedium||t[12]!==n.confirmDelete||t[13]!==n.delete||t[14]!==n.focusActive||t[15]!==n.focusCandidate||t[16]!==n.focusCompleted||t[17]!==n.focusHint||t[18]!==n.focusPaused||t[19]!==n.focuses||t[20]!==n.noFocuses||t[21]!==n.pause||t[22]!==n.reject){let e=(r??[]).filter(je),i;t[24]!==n.focusActive||t[25]!==n.focusCandidate||t[26]!==n.focusCompleted||t[27]!==n.focusPaused?(i=e=>e===`candidate`?n.focusCandidate:e===`active`?n.focusActive:e===`paused`?n.focusPaused:n.focusCompleted,t[24]=n.focusActive,t[25]=n.focusCandidate,t[26]=n.focusCompleted,t[27]=n.focusPaused,t[28]=i):i=t[28];let a=i,u;t[29]!==n.confidenceHigh||t[30]!==n.confidenceLow||t[31]!==n.confidenceMedium?(u=e=>e>=.85?n.confidenceHigh:e>=.65?n.confidenceMedium:n.confidenceLow,t[29]=n.confidenceHigh,t[30]=n.confidenceLow,t[31]=n.confidenceMedium,t[32]=u):u=t[32];let d=u,p;t[33]===n.focusHint?p=t[34]:(p=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.focusHint}),t[33]=n.focusHint,t[34]=p),l=(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[n.focuses,` · `,e.length]}),p]}),e.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:e.map(e=>(0,Q.jsxs)(`article`,{className:`flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] text-fg-muted`,children:a(e.status)}),(0,Q.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[n.confidence,` · `,d(e.confidence)]})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:e.summary})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-1 sm:justify-end`,children:[e.status===`active`?(0,Q.jsx)(f,{onClick:async()=>{await O(e.id,`paused`),await o()},children:n.pause}):(0,Q.jsx)(f,{variant:`primary`,onClick:async()=>{await O(e.id,`active`),await o()},children:n.activate}),(0,Q.jsx)(f,{variant:`ghost`,onClick:async()=>{await O(e.id,`completed`),await o()},children:n.complete}),e.status===`candidate`?(0,Q.jsx)(f,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await O(e.id,`rejected`),await o()},children:n.reject}):null,(0,Q.jsxs)(f,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(s!==e.id){c(e.id);return}await F(e.id),c(null),await o()},children:[(0,Q.jsx)(J,{className:`size-3.5`}),s===e.id?n.confirmDelete:n.delete]})]})]},e.id))}):(0,Q.jsx)(fe,{children:n.noFocuses})]}),t[3]=r,t[4]=s,t[5]=o,t[6]=n.activate,t[7]=n.complete,t[8]=n.confidence,t[9]=n.confidenceHigh,t[10]=n.confidenceLow,t[11]=n.confidenceMedium,t[12]=n.confirmDelete,t[13]=n.delete,t[14]=n.focusActive,t[15]=n.focusCandidate,t[16]=n.focusCompleted,t[17]=n.focusHint,t[18]=n.focusPaused,t[19]=n.focuses,t[20]=n.noFocuses,t[21]=n.pause,t[22]=n.reject,t[23]=l}else l=t[23];return l}function je(e){return e.status!==`rejected`}function Me(e){let t=(0,X.c)(80),{rules:n,language:r,t:i,onChanged:a}=e,[c,l]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(`communication`),[g,_]=(0,Z.useState)(null),v,y,b,x,S,C;if(t[0]!==c||t[1]!==m||t[2]!==g||t[3]!==r||t[4]!==a||t[5]!==n||t[6]!==d||t[7]!==i.add||t[8]!==i.addRule||t[9]!==i.cancel||t[10]!==i.category||t[11]!==i.collaboration||t[12]!==i.confirmDelete||t[13]!==i.delete||t[14]!==i.disable||t[15]!==i.emptyRules||t[16]!==i.enable||t[17]!==i.ruleStatement||t[18]!==i.rulesHint){let e=n.filter(Ne),w;t[25]!==m||t[26]!==a||t[27]!==d?(w=async e=>{e.preventDefault(),d.trim()&&(await G({statement:d,category:m}),p(``),l(!1),await a())},t[25]=m,t[26]=a,t[27]=d,t[28]=w):w=t[28];let T=w;x=`space-y-5`;let E;t[29]===i.rulesHint?E=t[30]:(E=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.rulesHint}),t[29]=i.rulesHint,t[30]=E);let D,O;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>l(!0),D=(0,Q.jsx)(u,{className:`size-4`}),t[31]=D,t[32]=O):(D=t[31],O=t[32]);let k;t[33]===i.addRule?k=t[34]:(k=(0,Q.jsxs)(f,{variant:`primary`,onClick:O,children:[D,i.addRule]}),t[33]=i.addRule,t[34]=k),t[35]!==k||t[36]!==E?(S=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[E,k]}),t[35]=k,t[36]=E,t[37]=S):S=t[37];let A=i.addRule,j=i.rulesHint,M=i.add,N=i.cancel,P;t[38]===d?P=t[39]:(P=d.trim(),t[38]=d,t[39]=P);let F=!P,I;t[40]===i.ruleStatement?I=t[41]:(I=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.ruleStatement}),t[40]=i.ruleStatement,t[41]=I);let L;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>p(e.target.value),t[42]=L):L=t[42];let R;t[43]!==d||t[44]!==i.ruleStatement?(R=(0,Q.jsx)(`textarea`,{autoFocus:!0,className:$,rows:4,placeholder:i.ruleStatement,value:d,onChange:L}),t[43]=d,t[44]=i.ruleStatement,t[45]=R):R=t[45];let B;t[46]!==I||t[47]!==R?(B=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[I,R]}),t[46]=I,t[47]=R,t[48]=B):B=t[48];let V;t[49]===i.category?V=t[50]:(V=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.category}),t[49]=i.category,t[50]=V);let H,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>h(e.target.value),U=Object.entries(ue),t[51]=H,t[52]=U):(H=t[51],U=t[52]);let W;t[53]===r?W=t[54]:(W=U.map(e=>{let[t,n]=e;return(0,Q.jsx)(s,{value:t,children:n[r]},t)}),t[53]=r,t[54]=W);let K;t[55]!==m||t[56]!==W?(K=(0,Q.jsx)(o,{value:m,onChange:H,children:W}),t[55]=m,t[56]=W,t[57]=K):K=t[57];let q;t[58]!==V||t[59]!==K?(q=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[V,K]}),t[58]=V,t[59]=K,t[60]=q):q=t[60],t[61]!==c||t[62]!==T||t[63]!==i.add||t[64]!==i.addRule||t[65]!==i.cancel||t[66]!==i.rulesHint||t[67]!==F||t[68]!==B||t[69]!==q?(C=(0,Q.jsxs)(pe,{open:c,onOpenChange:l,title:A,description:j,submitLabel:M,cancelLabel:N,submitDisabled:F,onSubmit:T,children:[B,q]}),t[61]=c,t[62]=T,t[63]=i.add,t[64]=i.addRule,t[65]=i.cancel,t[66]=i.rulesHint,t[67]=F,t[68]=B,t[69]=q,t[70]=C):C=t[70],v=`space-y-2`,y=(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[i.collaboration,` · `,e.length]}),b=e.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:e.map(e=>(0,Q.jsxs)(`article`,{className:`flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-start sm:gap-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm leading-6 ${e.status===`disabled`?`text-fg-subtle line-through`:`text-fg`}`,children:e.statement}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:ue[e.category][r]}),(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsxs)(`span`,{children:[`P`,e.priority]}),e.status===`disabled`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsx)(`span`,{children:i.disable})]}):null]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 sm:justify-end`,children:[(0,Q.jsx)(f,{variant:`ghost`,onClick:async()=>{await Y(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,Q.jsxs)(f,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(g!==e.id){_(e.id);return}await z(e.id),_(null),await a()},children:[(0,Q.jsx)(J,{className:`size-3.5`}),g===e.id?i.confirmDelete:i.delete]})]})]},e.id))}):(0,Q.jsx)(fe,{children:i.emptyRules}),t[0]=c,t[1]=m,t[2]=g,t[3]=r,t[4]=a,t[5]=n,t[6]=d,t[7]=i.add,t[8]=i.addRule,t[9]=i.cancel,t[10]=i.category,t[11]=i.collaboration,t[12]=i.confirmDelete,t[13]=i.delete,t[14]=i.disable,t[15]=i.emptyRules,t[16]=i.enable,t[17]=i.ruleStatement,t[18]=i.rulesHint,t[19]=v,t[20]=y,t[21]=b,t[22]=x,t[23]=S,t[24]=C}else v=t[19],y=t[20],b=t[21],x=t[22],S=t[23],C=t[24];let w;t[71]!==v||t[72]!==y||t[73]!==b?(w=(0,Q.jsxs)(`section`,{className:v,children:[y,b]}),t[71]=v,t[72]=y,t[73]=b,t[74]=w):w=t[74];let T;return t[75]!==x||t[76]!==S||t[77]!==C||t[78]!==w?(T=(0,Q.jsxs)(`div`,{className:x,children:[S,C,w]}),t[75]=x,t[76]=S,t[77]=C,t[78]=w,t[79]=T):T=t[79],T}function Ne(e){return e.status!==`archived`}async function Pe(){let[e,t,n]=await Promise.all([U(),ae(),oe()]);return{grants:e,connectors:t,catalog:n}}function Fe({t:e}){let{data:t,error:n,isLoading:r,mutate:i}=x(`you-understanding-sources`,Pe),[o,s]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null);if(r)return(0,Q.jsx)(T,{className:`h-64 rounded-2xl`});if(n)return(0,Q.jsxs)(fe,{children:[e.error,` `,(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:()=>void i(),children:e.retry})]});let h=t?.grants??[],g=t?.connectors??[],_=new Map((t?.catalog??[]).map(e=>[e.id,e])),v=e=>{let t=e.displayName.trim().toLocaleLowerCase(),n=g.find(e=>e.displayName.trim().toLocaleLowerCase()===t);return n?_.get(n.connectorId):[..._.values()].find(n=>n.displayName.trim().toLocaleLowerCase()===t||e.sourceKey.toLocaleLowerCase().includes(n.id.toLocaleLowerCase()))},y=t=>`${e.actionFailed}: ${t instanceof Error?t.message:String(t)}`,b=async t=>{m(null),d(null),s({grantId:t.id,kind:`refresh`});try{await j(t.id),await i().catch(()=>void 0),m({tone:`success`,message:`${t.displayName}: ${e.refreshStarted}`})}catch(e){m({tone:`error`,message:y(e)})}finally{s(null)}},S=async t=>{if(u!==t.id){d(t.id),m(null);return}s({grantId:t.id,kind:`revoke`});try{await q(t.id),await i().catch(()=>void 0),d(null),m({tone:`success`,message:`${t.displayName}: ${e.revokeDone}`})}catch(e){m({tone:`error`,message:y(e)})}finally{s(null)}};return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:e.sourcesHint}),(0,Q.jsx)(f,{asChild:!0,variant:`primary`,children:(0,Q.jsxs)(a,{to:`/connectors?understanding=1&returnTo=%2Fyou%3Ftab%3Dsources`,children:[e.manageSources,(0,Q.jsx)(c,{className:`size-4`})]})})]}),p?(0,Q.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`rounded-xl px-3 py-2 text-sm ${p.tone===`success`?`bg-success-soft text-success`:`bg-danger/10 text-danger`}`,children:p.message}):null,(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[e.authorizedSources,` · `,h.length]}),h.length?(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:h.map(t=>{let n=v(t);return(0,Q.jsxs)(`article`,{className:`flex min-h-28 items-start gap-3 rounded-2xl border border-edge bg-surface-panel p-4`,children:[n?(0,Q.jsx)(ie,{connector:n,size:`sm`}):(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base`,children:(0,Q.jsx)(B,{className:`size-4 text-fg-muted`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:t.displayName}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:[t.accessMode===`continuous`?e.continuous:e.once,` · `,t.processingPolicy===`local_only`?e.localOnly:t.retentionPolicy===`derived_only`?e.derivedOnly:t.retentionPolicy]}),t.lastCollectedAt?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:new Date(t.lastCollectedAt).toLocaleString()}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:[t.accessMode===`continuous`?(0,Q.jsx)(f,{variant:`ghost`,disabled:o!==null,"aria-busy":o?.grantId===t.id&&o.kind===`refresh`,onClick:()=>void b(t),children:o?.grantId===t.id&&o.kind===`refresh`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`size-4 animate-spin`}),e.refreshing]}):e.refresh}):null,(0,Q.jsx)(f,{variant:`ghost`,className:`text-danger`,title:e.revokeHint,"aria-label":`${e.revoke}: ${t.displayName}`,disabled:o!==null,"aria-busy":o?.grantId===t.id&&o.kind===`revoke`,onClick:()=>void S(t),children:o?.grantId===t.id&&o.kind===`revoke`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`size-4 animate-spin`}),e.revoking]}):u===t.id?e.confirmRevoke:e.revoke})]})]},t.id)})}):(0,Q.jsx)(fe,{children:e.noSources})]}),(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[e.connectorsTitle,` · `,g.length]}),g.length?(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:g.map(t=>{let n=t.enabled&&(t.status===`connected`||t.connectionStatus===`connected`||t.authStatus===`connected`),r=_.get(t.connectorId);return(0,Q.jsxs)(a,{to:`/connectors?tab=connected&instance=${encodeURIComponent(t.instanceId)}`,"aria-label":`${e.openConnector}: ${t.displayName}`,className:`group flex min-h-24 items-center gap-3 rounded-2xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,children:[(0,Q.jsx)(ie,{connector:r??{displayName:t.displayName}}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:t.displayName}),(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:t.connectorId})]}),(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs ${n?`bg-success-soft text-success`:`bg-warning-soft text-warning`}`,children:n?e.connected:e.unavailable}),(0,Q.jsx)(E,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`})]},t.instanceId)})}):(0,Q.jsx)(fe,{children:e.noConnectors})]})]})}function Ie(e){let t=(0,X.c)(112),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:c,mutate:l}=x(`you-context-settings`,R),u=i?.dreaming??null,[d,p]=he(u),m;t[0]!==d||t[1]!==u?(m=d&&u&&me(d)!==me(u),t[0]=d,t[1]=u,t[2]=m):m=t[2];let h=!!m,g;t[3]===l?g=t[4]:(g=async e=>{await ee({dreaming:e}),await l()},t[3]=l,t[4]=g);let _;t[5]!==d||t[6]!==h||t[7]!==g?(_={value:d,dirty:h,delayMs:500,onSave:g},t[5]=d,t[6]=h,t[7]=g,t[8]=_):_=t[8];let v=ne(_);if(a){let e;t[9]===l?e=t[10]:(e=()=>void l(),t[9]=l,t[10]=e);let n;t[11]!==r.retry||t[12]!==e?(n=(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:r.retry}),t[11]=r.retry,t[12]=e,t[13]=n):n=t[13];let i;return t[14]!==r.error||t[15]!==n?(i=(0,Q.jsxs)(fe,{children:[r.error,` `,n]}),t[14]=r.error,t[15]=n,t[16]=i):i=t[16],i}if(c||!d){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(T,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let y=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,b;t[18]===r.dreamingHint?b=t[19]:(b=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=b);let S=v.onBlurCapture,C;t[20]===r.mode?C=t[21]:(C=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.mode}),t[20]=r.mode,t[21]=C);let w;t[22]===p?w=t[23]:(w=e=>p(t=>t&&{...t,mode:e.target.value}),t[22]=p,t[23]=w);let E;t[24]===r.on?E=t[25]:(E=(0,Q.jsx)(s,{value:`review`,children:r.on}),t[24]=r.on,t[25]=E);let D;t[26]===r.off?D=t[27]:(D=(0,Q.jsx)(s,{value:`off`,children:r.off}),t[26]=r.off,t[27]=D);let O;t[28]!==d.mode||t[29]!==D||t[30]!==w||t[31]!==E?(O=(0,Q.jsxs)(o,{value:d.mode,onChange:w,children:[E,D]}),t[28]=d.mode,t[29]=D,t[30]=w,t[31]=E,t[32]=O):O=t[32];let k;t[33]!==O||t[34]!==C?(k=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[C,O]}),t[33]=O,t[34]=C,t[35]=k):k=t[35];let A;t[36]===r.reviewTime?A=t[37]:(A=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.reviewTime}),t[36]=r.reviewTime,t[37]=A);let j;t[38]===p?j=t[39]:(j=e=>p(t=>t&&{...t,schedule:{time:e.target.value}}),t[38]=p,t[39]=j);let M;t[40]!==d.schedule.time||t[41]!==j?(M=(0,Q.jsx)(`input`,{type:`time`,className:$,value:d.schedule.time,onChange:j}),t[40]=d.schedule.time,t[41]=j,t[42]=M):M=t[42];let N;t[43]!==A||t[44]!==M?(N=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[A,M]}),t[43]=A,t[44]=M,t[45]=N):N=t[45];let P;t[46]===r.timezone?P=t[47]:(P=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.timezone}),t[46]=r.timezone,t[47]=P);let F=d.timezone??``,L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=I(),t[48]=L):L=t[48];let z;t[49]===p?z=t[50]:(z=e=>p(t=>t&&{...t,timezone:e.target.value||void 0}),t[49]=p,t[50]=z);let B;t[51]!==F||t[52]!==z?(B=(0,Q.jsx)(`input`,{className:`${$} min-w-0 flex-1`,value:F,placeholder:L,onChange:z}),t[51]=F,t[52]=z,t[53]=B):B=t[53];let V;t[54]===p?V=t[55]:(V=()=>p(Le),t[54]=p,t[55]=V);let H;t[56]!==r.detect||t[57]!==V?(H=(0,Q.jsx)(f,{className:`shrink-0 whitespace-nowrap`,onClick:V,children:r.detect}),t[56]=r.detect,t[57]=V,t[58]=H):H=t[58];let U;t[59]!==B||t[60]!==H?(U=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[B,H]}),t[59]=B,t[60]=H,t[61]=U):U=t[61];let W;t[62]!==P||t[63]!==U?(W=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[P,U]}),t[62]=P,t[63]=U,t[64]=W):W=t[64];let G;t[65]===r.evidenceThreshold?G=t[66]:(G=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[65]=r.evidenceThreshold,t[66]=G);let K;t[67]===p?K=t[68]:(K=e=>p(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[67]=p,t[68]=K);let q;t[69]!==d.minEvidenceSources||t[70]!==K?(q=(0,Q.jsx)(`input`,{type:`number`,min:2,max:10,className:$,value:d.minEvidenceSources,onChange:K}),t[69]=d.minEvidenceSources,t[70]=K,t[71]=q):q=t[71];let J;t[72]!==G||t[73]!==q?(J=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[G,q]}),t[72]=G,t[73]=q,t[74]=J):J=t[74];let Y;t[75]===r.scanLimit?Y=t[76]:(Y=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[75]=r.scanLimit,t[76]=Y);let re;t[77]===p?re=t[78]:(re=e=>p(t=>t&&{...t,limit:Number(e.target.value)}),t[77]=p,t[78]=re);let ie;t[79]!==d.limit||t[80]!==re?(ie=(0,Q.jsx)(`input`,{type:`number`,min:1,max:2e3,className:$,value:d.limit,onChange:re}),t[79]=d.limit,t[80]=re,t[81]=ie):ie=t[81];let ae;t[82]!==Y||t[83]!==ie?(ae=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[Y,ie]}),t[82]=Y,t[83]=ie,t[84]=ae):ae=t[84];let oe;t[85]!==k||t[86]!==N||t[87]!==W||t[88]!==J||t[89]!==ae?(oe=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[k,N,W,J,ae]}),t[85]=k,t[86]=N,t[87]=W,t[88]=J,t[89]=ae,t[90]=oe):oe=t[90];let Z;t[91]!==v.error||t[92]!==v.status?(Z=(0,Q.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Q.jsx)(te,{status:v.status,error:v.error})}),t[91]=v.error,t[92]=v.status,t[93]=Z):Z=t[93];let se;t[94]!==v.onBlurCapture||t[95]!==oe||t[96]!==Z?(se=(0,Q.jsx)(de,{children:(0,Q.jsxs)(`div`,{onBlurCapture:S,children:[oe,Z]})}),t[94]=v.onBlurCapture,t[95]=oe,t[96]=Z,t[97]=se):se=t[97];let ce;t[98]===r.lastRun?ce=t[99]:(ce=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[98]=r.lastRun,t[99]=ce);let le;t[100]!==n||t[101]!==y||t[102]!==r.neverRun||t[103]!==r.runItems?(le=n?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:y}),(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsx)(`time`,{children:new Date(n.startedAt).toLocaleString()}),typeof n.metrics.scanned==`number`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsxs)(`span`,{children:[String(n.metrics.scanned),` `,r.runItems]})]}):null]}):(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:r.neverRun}),t[100]=n,t[101]=y,t[102]=r.neverRun,t[103]=r.runItems,t[104]=le):le=t[104];let ue;t[105]!==ce||t[106]!==le?(ue=(0,Q.jsxs)(de,{children:[ce,le]}),t[105]=ce,t[106]=le,t[107]=ue):ue=t[107];let pe;return t[108]!==se||t[109]!==ue||t[110]!==b?(pe=(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[b,se,ue]}),t[108]=se,t[109]=ue,t[110]=b,t[111]=pe):pe=t[111],pe}function Le(e){return e&&{...e,timezone:I()}}function Re(e){let t=(0,X.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:c}=x(`you-context-settings`,R),l=r?.privacy.sensitiveWritePolicy??null,[u,d]=he(l),f=!!(u&&l&&u!==l),p;t[0]===c?p=t[1]:(p=async e=>{await ee({privacy:{sensitiveWritePolicy:e}}),await c()},t[0]=c,t[1]=p);let m;t[2]!==u||t[3]!==f||t[4]!==p?(m={value:u,dirty:f,delayMs:350,onSave:p},t[2]=u,t[3]=f,t[4]=p,t[5]=m):m=t[5];let h=ne(m);if(i){let e;t[6]===c?e=t[7]:(e=()=>void c(),t[6]=c,t[7]=e);let r;t[8]!==n.retry||t[9]!==e?(r=(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[8]=n.retry,t[9]=e,t[10]=r):r=t[10];let i;return t[11]!==n.error||t[12]!==r?(i=(0,Q.jsxs)(fe,{children:[n.error,` `,r]}),t[11]=n.error,t[12]=r,t[13]=i):i=t[13],i}if(a||!u){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(T,{className:`h-56 rounded-2xl`}),t[14]=e):e=t[14],e}let g;t[15]===n.privacyHint?g=t[16]:(g=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.privacyHint}),t[15]=n.privacyHint,t[16]=g);let _;t[17]===n.sensitivePolicy?_=t[18]:(_=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.sensitivePolicy}),t[17]=n.sensitivePolicy,t[18]=_);let v;t[19]===d?v=t[20]:(v=e=>d(e.target.value),t[19]=d,t[20]=v);let y;t[21]===n.policyDeny?y=t[22]:(y=(0,Q.jsx)(s,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=y);let b;t[23]===n.policyConfirm?b=t[24]:(b=(0,Q.jsx)(s,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=b);let S;t[25]===n.policyAllow?S=t[26]:(S=(0,Q.jsx)(s,{value:`allow`,children:n.policyAllow}),t[25]=n.policyAllow,t[26]=S);let C;t[27]!==u||t[28]!==v||t[29]!==y||t[30]!==b||t[31]!==S?(C=(0,Q.jsxs)(o,{value:u,onChange:v,children:[y,b,S]}),t[27]=u,t[28]=v,t[29]=y,t[30]=b,t[31]=S,t[32]=C):C=t[32];let w;t[33]!==C||t[34]!==_?(w=(0,Q.jsxs)(`label`,{className:`block max-w-xl space-y-1.5 text-sm`,children:[_,C]}),t[33]=C,t[34]=_,t[35]=w):w=t[35];let E;t[36]===n.privacyWarning?E=t[37]:(E=(0,Q.jsx)(`p`,{className:`mt-3 max-w-2xl text-xs leading-5 text-fg-subtle`,children:n.privacyWarning}),t[36]=n.privacyWarning,t[37]=E);let D;t[38]!==h.error||t[39]!==h.status?(D=(0,Q.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Q.jsx)(te,{status:h.status,error:h.error})}),t[38]=h.error,t[39]=h.status,t[40]=D):D=t[40];let O;t[41]!==h.onBlurCapture||t[42]!==w||t[43]!==E||t[44]!==D?(O=(0,Q.jsx)(de,{children:(0,Q.jsxs)(`div`,{onBlurCapture:h.onBlurCapture,children:[w,E,D]})}),t[41]=h.onBlurCapture,t[42]=w,t[43]=E,t[44]=D,t[45]=O):O=t[45];let k;return t[46]!==O||t[47]!==g?(k=(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[g,O]}),t[46]=O,t[47]=g,t[48]=k):k=t[48],k}export{_e as UserContextPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o,r as s}from"./popover-select-BzdnTy3h.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./loader-circle-CifKLtgG.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./button-CSEbl4zT.js";import{n as p}from"./locale-store-hDBVeG3G.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./dist-BPoKqzeH.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{Co as S,Dl as C,Hl as w,Il as T,Ls as E,Na as D,So as O,Vl as k,Yc as A,_o as j,ac as M,bo as N,co as P,do as F,fo as I,go as L,ho as R,lo as z,ml as B,mo as V,pc as H,po as U,qa as W,so as G,uo as K,vo as q,vs as J,xo as ee,yo as Y}from"./index-DJ7HSgKs.js";import{n as te,t as ne}from"./use-autosave-DOj5i8d_.js";import{t as re}from"./page-tabs-B5a5aSoS.js";import{I as ie,a as ae,i as oe}from"./connectors-api-BvIZ51ty.js";var X=n(),Z=e(t(),1),Q=r(),se=new Set([`profile`,`understanding`,`collaboration`,`sources`,`dreaming`,`privacy`]),$=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,ce={en:{title:`About You`,subtitle:`What xopc knows, why it knows it, and how it should work with you.`,profile:`Profile`,understanding:`Understanding`,collaboration:`Working agreement`,sources:`Sources`,dreaming:`Background review`,privacy:`Privacy`,profileHint:`Facts you provide directly. These are available across conversations.`,done:`Done`,required:`This field cannot be empty.`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: product designer, founder, or engineer`,primaryGoal:`What are you mainly trying to achieve?`,primaryGoalPlaceholder:`The outcome you want xopc to optimize for`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,locale:`Language / locale`,detect:`Use this device`,understoodHint:`Reviewable beliefs learned from your conversations and work. Inferences stay pending until confirmed.`,addUnderstanding:`Add understanding`,statement:`What should xopc understand?`,kind:`Type`,add:`Add`,cancel:`Cancel`,active:`Active`,review:`Needs review`,confirm:`Confirm`,reject:`Wrong`,edit:`Edit`,delete:`Delete`,confirmDelete:`Delete now`,rulesHint:`Explicit instructions for how xopc should collaborate with you. Rules outrank inferred understanding.`,addRule:`Add rule`,ruleStatement:`How should xopc work with you?`,category:`Category`,disable:`Disable`,enable:`Enable`,emptyUnderstanding:`Nothing here yet. Tell xopc something explicitly, or confirm a suggestion after it learns one.`,qualityTitle:`Learning quality`,qualityActive:`Confirmed`,qualityPending:`Pending review`,qualityAcceptance:`30-day acceptance`,qualityRecall:`Helpful recall`,qualityNoData:`Not enough feedback yet`,emptyRules:`No working agreements yet.`,sourceExplicit:`You said this directly`,sourceInferred:`Inferred — may be wrong`,sourceObserved:`Observed across prior work`,sourcesHint:`Review every granted source, its access mode, retention, and last collection. Revoking stops future learning.`,manageSources:`Connect another source`,authorizedSources:`Authorized sources`,connectorsTitle:`Connectors`,openConnector:`Open connector`,noSources:`No sources are authorized.`,noConnectors:`No connectors are installed.`,connected:`Connected`,unavailable:`Needs attention`,revoke:`Revoke source`,revokeHint:`Revoke this source and remove its derived understanding`,confirmRevoke:`Confirm revoke`,revoking:`Revoking…`,revokeDone:`Source revoked and derived understanding removed.`,refresh:`Update`,refreshing:`Updating…`,refreshStarted:`Update started.`,actionFailed:`Action failed`,once:`One-time`,continuous:`Continuous`,localOnly:`Local only`,derivedOnly:`Derived understanding only`,focuses:`Current focuses`,focusHint:`Candidate focuses never activate until you confirm them.`,activate:`Activate`,pause:`Pause`,complete:`Complete`,noFocuses:`No focus candidates yet.`,focusCandidate:`Suggested`,focusActive:`Active`,focusPaused:`Paused`,focusCompleted:`Completed`,confidence:`Confidence`,confidenceHigh:`High`,confidenceMedium:`Medium`,confidenceLow:`Low`,dreamingHint:`A deterministic daily review checks expiry, contradictory evidence, and corroborated candidates. It never auto-activates an inference.`,mode:`Background review`,on:`On — propose for review`,off:`Off`,reviewTime:`Daily review time`,evidenceThreshold:`Supporting evidence required`,scanLimit:`Maximum items per run`,lastRun:`Last review`,neverRun:`Not run yet`,runCompleted:`Completed`,runFailed:`Failed`,runRunning:`Running`,runItems:`items`,privacyHint:`Choose how generic memory providers handle sensitive content. Structured user understanding applies stricter rules of its own.`,sensitivePolicy:`Sensitive memory writes`,policyDeny:`Do not store`,policyConfirm:`Ask before storing`,policyAllow:`Store when relevant`,privacyWarning:`Secret and regulated content is never stored as structured user understanding, regardless of this setting.`,error:`Could not load your context.`,retry:`Try again`},zh:{title:`关于你`,subtitle:`清楚查看 xopc 知道什么、为什么知道,以及应该如何与你协作。`,profile:`个人资料`,understanding:`对你的理解`,collaboration:`协作约定`,sources:`数据来源`,dreaming:`后台复核`,privacy:`隐私`,profileHint:`由你直接提供的事实,会在不同对话中使用。`,done:`完成`,required:`此项不能为空。`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:产品设计师、创业者、工程师`,primaryGoal:`你目前最想达成什么?`,primaryGoalPlaceholder:`希望 xopc 优先帮助你实现的结果`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,locale:`语言 / 地区`,detect:`使用本机时区`,understoodHint:`从对话和工作中形成、可复核的理解。推断内容在你确认前保持待审核。`,addUnderstanding:`添加理解`,statement:`希望 xopc 了解什么?`,kind:`类型`,add:`添加`,cancel:`取消`,active:`使用中`,review:`待审核`,confirm:`确认`,reject:`不正确`,edit:`编辑`,delete:`删除`,confirmDelete:`确认删除`,rulesHint:`你明确设定的协作方式。协作约定的优先级高于推断出的理解。`,addRule:`添加约定`,ruleStatement:`希望 xopc 如何与你协作?`,category:`类别`,disable:`停用`,enable:`启用`,emptyUnderstanding:`还没有内容。你可以直接告诉 xopc,或在它学到建议后进行确认。`,emptyRules:`还没有协作约定。`,qualityTitle:`学习质量`,qualityActive:`已确认`,qualityPending:`待审核`,qualityAcceptance:`30 天采纳率`,qualityRecall:`有效召回`,qualityNoData:`反馈数据还不足`,sourceExplicit:`由你直接告知`,sourceInferred:`推断内容,可能有误`,sourceObserved:`从过往工作中观察到`,sourcesHint:`查看每项授权的访问方式、保留策略和最近采集时间;撤销后将停止后续学习。`,manageSources:`连接其他来源`,authorizedSources:`已授权数据来源`,connectorsTitle:`连接器`,openConnector:`打开连接器`,noSources:`尚未授权任何来源。`,noConnectors:`尚未安装连接器。`,connected:`已连接`,unavailable:`需要处理`,revoke:`撤销来源`,revokeHint:`撤销此来源并删除由它产生的理解`,confirmRevoke:`确认撤销`,revoking:`正在撤销…`,revokeDone:`已撤销来源并删除派生理解。`,refresh:`更新`,refreshing:`正在更新…`,refreshStarted:`更新任务已开始。`,actionFailed:`操作失败`,once:`仅一次`,continuous:`持续更新`,localOnly:`仅本地处理`,derivedOnly:`仅保留派生理解`,focuses:`当前关注`,focusHint:`候选关注不会自动生效,只有你确认后才会启用。`,activate:`启用`,pause:`暂停`,complete:`完成`,noFocuses:`还没有候选关注。`,focusCandidate:`待确认`,focusActive:`进行中`,focusPaused:`已暂停`,focusCompleted:`已完成`,confidence:`置信度`,confidenceHigh:`高`,confidenceMedium:`中`,confidenceLow:`低`,dreamingHint:`每天进行一次确定性复核,检查过期、矛盾证据和得到佐证的候选理解;推断内容不会自动生效。`,mode:`后台复核`,on:`开启并生成待审核项`,off:`关闭`,reviewTime:`每日复核时间`,evidenceThreshold:`所需支持证据数`,scanLimit:`每次最多检查`,lastRun:`最近一次复核`,neverRun:`尚未运行`,runCompleted:`已完成`,runFailed:`失败`,runRunning:`运行中`,runItems:`项`,privacyHint:`选择通用记忆服务如何处理敏感内容;结构化用户理解有独立且更严格的规则。`,sensitivePolicy:`敏感记忆写入`,policyDeny:`不保存`,policyConfirm:`保存前询问`,policyAllow:`相关时允许保存`,privacyWarning:`无论这里如何设置,秘密和受监管内容都不会保存为结构化用户理解。`,error:`无法加载用户上下文。`,retry:`重试`}},le={preference:{en:`Preference`,zh:`偏好`},boundary:{en:`Boundary`,zh:`边界`},relationship:{en:`Relationship`,zh:`关系`},routine:{en:`Routine`,zh:`习惯`},current_state:{en:`Current state`,zh:`当前状态`},long_term_goal:{en:`Long-term goal`,zh:`长期目标`},project_context:{en:`Project context`,zh:`项目背景`},task_lesson:{en:`Task lesson`,zh:`任务经验`},derived_insight:{en:`Insight`,zh:`洞察`}},ue={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function de(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:n}),t[0]=n,t[1]=r),r}function fe(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function pe(e){let t=(0,X.c)(33),{open:n,onOpenChange:r,title:i,description:a,submitLabel:o,cancelLabel:s,submitDisabled:c,onSubmit:l,children:u}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(m,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=p):p=t[0];let x;t[1]===i?x=t[2]:(x=(0,Q.jsx)(y,{className:`text-base font-semibold text-fg`,children:i}),t[1]=i,t[2]=x);let S;t[3]===a?S=t[4]:(S=(0,Q.jsx)(h,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a}),t[3]=a,t[4]=S);let C;t[5]!==x||t[6]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[5]=x,t[6]=S,t[7]=C):C=t[7];let w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(d,{className:`size-4`}),t[8]=w):w=t[8];let T;t[9]===s?T=t[10]:(T=(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsx)(f,{type:`button`,variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":s,children:w})}),t[9]=s,t[10]=T);let E;t[11]!==C||t[12]!==T?(E=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[C,T]}),t[11]=C,t[12]=T,t[13]=E):E=t[13];let D;t[14]===u?D=t[15]:(D=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:u}),t[14]=u,t[15]=D);let O;t[16]===s?O=t[17]:(O=(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsx)(f,{type:`button`,children:s})}),t[16]=s,t[17]=O);let k;t[18]!==c||t[19]!==o?(k=(0,Q.jsx)(f,{type:`submit`,variant:`primary`,disabled:c,children:o}),t[18]=c,t[19]=o,t[20]=k):k=t[20];let A;t[21]!==k||t[22]!==O?(A=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[O,k]}),t[21]=k,t[22]=O,t[23]=A):A=t[23];let j;t[24]!==l||t[25]!==A||t[26]!==E||t[27]!==D?(j=(0,Q.jsxs)(_,{children:[p,(0,Q.jsx)(v,{className:`fixed left-1/2 top-1/2 z-[90] h-[min(30rem,calc(100vh-2rem))] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col`,onSubmit:l,children:[E,D,A]})})]}),t[24]=l,t[25]=A,t[26]=E,t[27]=D,t[28]=j):j=t[28];let M;return t[29]!==r||t[30]!==n||t[31]!==j?(M=(0,Q.jsx)(b,{open:n,onOpenChange:r,children:j}),t[29]=r,t[30]=n,t[31]=j,t[32]=M):M=t[32],M}function me(e){return JSON.stringify(e)}function he(e){let t=(0,X.c)(10),[n,r]=(0,Z.useState)(e),i;t[0]===e?i=t[1]:(i=me(e),t[0]=e,t[1]=i);let a=(0,Z.useRef)(i),o;t[2]===e?o=t[3]:(o=me(e),t[2]=e,t[3]=o);let s=o,c,l;t[4]!==e||t[5]!==s?(c=()=>{if(s===a.current)return;let t=a.current;a.current=s,r(n=>me(n)===t?e:n)},l=[e,s],t[4]=e,t[5]=s,t[6]=c,t[7]=l):(c=t[6],l=t[7]),(0,Z.useEffect)(c,l);let u;return t[8]===n?u=t[9]:(u=[n,r],t[8]=n,t[9]=u),u}function ge(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function _e(){let e=(0,X.c)(87),t=p(xe),n=ce[t],[r,a]=i(),o;if(e[0]!==r){let t=r.get(`tab`);o=t&&se.has(t)?t:`profile`,e[0]=r,e[1]=o}else o=e[1];let s=o,c=W(be),l=W(ye),{data:u,error:d,isLoading:f,mutate:m}=x(`/api/you`,V),h;e[2]!==l||e[3]!==c||e[4]!==n.subtitle||e[5]!==n.title?(h=()=>(c({startExtra:null,main:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:n.title}),(0,Q.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:n.subtitle})]}),end:null}),l),e[2]=l,e[3]=c,e[4]=n.subtitle,e[5]=n.title,e[6]=h):h=e[6];let g;if(e[7]!==l||e[8]!==c||e[9]!==n?(g=[l,c,n],e[7]=l,e[8]=c,e[9]=n,e[10]=g):g=e[10],(0,Z.useEffect)(h,g),f){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-4 p-4 sm:p-6`,children:[(0,Q.jsx)(D,{className:`h-10 w-96 max-w-full`}),(0,Q.jsx)(D,{className:`h-72 rounded-2xl`})]}),e[11]=t):t=e[11],t}if(d||!u){let t;e[12]===m?t=e[13]:(t=()=>void m(),e[12]=m,e[13]=t);let r;e[14]!==n.retry||e[15]!==t?(r=(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:t,children:n.retry}),e[14]=n.retry,e[15]=t,e[16]=r):r=e[16];let i;return e[17]!==n.error||e[18]!==r?(i=(0,Q.jsx)(`div`,{className:`p-6`,children:(0,Q.jsxs)(fe,{children:[n.error,` `,r]})}),e[17]=n.error,e[18]=r,e[19]=i):i=e[19],i}let _=n.title,v;e[20]===a?v=e[21]:(v=e=>a({tab:e}),e[20]=a,e[21]=v);let y;e[22]===n.profile?y=e[23]:(y={id:`profile`,label:n.profile,icon:C},e[22]=n.profile,e[23]=y);let b;e[24]!==u.understandings.length||e[25]!==n.understanding?(b={id:`understanding`,label:n.understanding,icon:w,count:u.understandings.length},e[24]=u.understandings.length,e[25]=n.understanding,e[26]=b):b=e[26];let S=n.collaboration,T;e[27]===u.rules?T=e[28]:(T=u.rules.filter(ve),e[27]=u.rules,e[28]=T);let O;e[29]!==n.collaboration||e[30]!==T.length?(O={id:`collaboration`,label:S,icon:A,count:T.length},e[29]=n.collaboration,e[30]=T.length,e[31]=O):O=e[31];let j;e[32]===n.sources?j=e[33]:(j={id:`sources`,label:n.sources,icon:k},e[32]=n.sources,e[33]=j);let M;e[34]===n.dreaming?M=e[35]:(M={id:`dreaming`,label:n.dreaming,icon:H},e[34]=n.dreaming,e[35]=M);let N;e[36]===n.privacy?N=e[37]:(N={id:`privacy`,label:n.privacy,icon:E},e[36]=n.privacy,e[37]=N);let P;e[38]!==j||e[39]!==M||e[40]!==N||e[41]!==y||e[42]!==b||e[43]!==O?(P=[y,b,O,j,M,N],e[38]=j,e[39]=M,e[40]=N,e[41]=y,e[42]=b,e[43]=O,e[44]=P):P=e[44];let F;e[45]!==n.title||e[46]!==P||e[47]!==v||e[48]!==s?(F=(0,Q.jsx)(re,{ariaLabel:_,activeTab:s,onChange:v,items:P}),e[45]=n.title,e[46]=P,e[47]=v,e[48]=s,e[49]=F):F=e[49];let I;e[50]!==u.profile||e[51]!==t||e[52]!==m||e[53]!==n||e[54]!==s?(I=s===`profile`?(0,Q.jsx)(Se,{profile:u.profile,language:t,t:n,onChanged:e=>m(t=>t&&{...t,profile:e},{revalidate:!1})}):null,e[50]=u.profile,e[51]=t,e[52]=m,e[53]=n,e[54]=s,e[55]=I):I=e[55];let L;e[56]!==u.quality||e[57]!==u.understandings||e[58]!==t||e[59]!==m||e[60]!==n||e[61]!==s?(L=s===`understanding`?(0,Q.jsx)(we,{items:u.understandings,quality:u.quality,language:t,t:n,onChanged:e=>e?m(t=>t&&{...t,understandings:t.understandings.map(t=>t.id===e.id?e:t)},{revalidate:!0}):m()}):null,e[56]=u.quality,e[57]=u.understandings,e[58]=t,e[59]=m,e[60]=n,e[61]=s,e[62]=L):L=e[62];let R;e[63]!==u.rules||e[64]!==t||e[65]!==m||e[66]!==n||e[67]!==s?(R=s===`collaboration`?(0,Q.jsx)(Me,{rules:u.rules,language:t,t:n,onChanged:()=>m()}):null,e[63]=u.rules,e[64]=t,e[65]=m,e[66]=n,e[67]=s,e[68]=R):R=e[68];let z;e[69]!==n||e[70]!==s?(z=s===`sources`?(0,Q.jsx)(Fe,{t:n}):null,e[69]=n,e[70]=s,e[71]=z):z=e[71];let B;e[72]!==u.consolidation?.lastRun||e[73]!==n||e[74]!==s?(B=s===`dreaming`?(0,Q.jsx)(Ie,{lastRun:u.consolidation?.lastRun??null,t:n}):null,e[72]=u.consolidation?.lastRun,e[73]=n,e[74]=s,e[75]=B):B=e[75];let U;e[76]!==n||e[77]!==s?(U=s===`privacy`?(0,Q.jsx)(Re,{t:n}):null,e[76]=n,e[77]=s,e[78]=U):U=e[78];let G;return e[79]!==F||e[80]!==I||e[81]!==L||e[82]!==R||e[83]!==z||e[84]!==B||e[85]!==U?(G=(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl space-y-5 p-4 sm:p-6`,children:[F,I,L,R,z,B,U]}),e[79]=F,e[80]=I,e[81]=L,e[82]=R,e[83]=z,e[84]=B,e[85]=U,e[86]=G):G=e[86],G}function ve(e){return e.status===`active`}function ye(e){return e.clearPageHeader}function be(e){return e.setPageHeader}function xe(e){return e.language}function Se(e){let t=(0,X.c)(78),{profile:n,language:r,t:i,onChanged:a}=e,o;t[0]===n?o=t[1]:(o=ge(n),t[0]=n,t[1]=o);let s=o,[c,l]=he(s),u;t[2]===c?u=t[3]:(u=me(c),t[2]=c,t[3]=u);let d;t[4]===s?d=t[5]:(d=me(s),t[4]=s,t[5]=d);let p=u!==d,m;t[6]!==a||t[7]!==n?(m=async e=>{await a((await S({...e,accessibility:n.accessibility})).profile)},t[6]=a,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==c||t[10]!==p||t[11]!==m?(h={value:c,dirty:p,delayMs:500,onSave:m},t[9]=c,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=ne(h),_;t[13]!==c||t[14]!==l?(_=(e,t,n)=>(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Q.jsx)(`input`,{className:$,placeholder:n,value:c[e],onChange:t=>l(n=>({...n,[e]:t.target.value}))})]}),t[13]=c,t[14]=l,t[15]=_):_=t[15];let v=_,y=g.onBlurCapture,b;t[16]===i.profileHint?b=t[17]:(b=(0,Q.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-fg-muted`,children:i.profileHint}),t[16]=i.profileHint,t[17]=b);let x;t[18]!==v||t[19]!==i.callName||t[20]!==i.callNamePlaceholder?(x=v(`callName`,i.callName,i.callNamePlaceholder),t[18]=v,t[19]=i.callName,t[20]=i.callNamePlaceholder,t[21]=x):x=t[21];let C;t[22]!==v||t[23]!==i.role||t[24]!==i.rolePlaceholder?(C=v(`role`,i.role,i.rolePlaceholder),t[22]=v,t[23]=i.role,t[24]=i.rolePlaceholder,t[25]=C):C=t[25];let w;t[26]===i.primaryGoal?w=t[27]:(w=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.primaryGoal}),t[26]=i.primaryGoal,t[27]=w);let T;t[28]===l?T=t[29]:(T=e=>l(t=>({...t,primaryGoal:e.target.value})),t[28]=l,t[29]=T);let E;t[30]!==c.primaryGoal||t[31]!==i.primaryGoalPlaceholder||t[32]!==T?(E=(0,Q.jsx)(`textarea`,{className:$,rows:3,placeholder:i.primaryGoalPlaceholder,value:c.primaryGoal,onChange:T}),t[30]=c.primaryGoal,t[31]=i.primaryGoalPlaceholder,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==w||t[35]!==E?(D=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[w,E]}),t[34]=w,t[35]=E,t[36]=D):D=t[36];let O;t[37]!==v||t[38]!==r||t[39]!==i.pronouns||t[40]!==i.pronounsPlaceholder?(O=r===`en`?v(`pronouns`,i.pronouns,i.pronounsPlaceholder):null,t[37]=v,t[38]=r,t[39]=i.pronouns,t[40]=i.pronounsPlaceholder,t[41]=O):O=t[41];let k;t[42]===i.timezone?k=t[43]:(k=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[42]=i.timezone,t[43]=k);let A;t[44]===l?A=t[45]:(A=e=>l(t=>({...t,timezone:e.target.value})),t[44]=l,t[45]=A);let j;t[46]!==c.timezone||t[47]!==A?(j=(0,Q.jsx)(`input`,{className:`${$} min-w-0 flex-1`,value:c.timezone,onChange:A}),t[46]=c.timezone,t[47]=A,t[48]=j):j=t[48];let M;t[49]===l?M=t[50]:(M=()=>l(Ce),t[49]=l,t[50]=M);let N;t[51]!==i.detect||t[52]!==M?(N=(0,Q.jsx)(f,{className:`shrink-0 whitespace-nowrap`,onClick:M,children:i.detect}),t[51]=i.detect,t[52]=M,t[53]=N):N=t[53];let P;t[54]!==j||t[55]!==N?(P=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[j,N]}),t[54]=j,t[55]=N,t[56]=P):P=t[56];let F;t[57]!==k||t[58]!==P?(F=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[k,P]}),t[57]=k,t[58]=P,t[59]=F):F=t[59];let I;t[60]!==v||t[61]!==i.locale?(I=v(`locale`,i.locale),t[60]=v,t[61]=i.locale,t[62]=I):I=t[62];let L;t[63]!==x||t[64]!==C||t[65]!==D||t[66]!==O||t[67]!==F||t[68]!==I?(L=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[x,C,D,O,F,I]}),t[63]=x,t[64]=C,t[65]=D,t[66]=O,t[67]=F,t[68]=I,t[69]=L):L=t[69];let R;t[70]!==g.error||t[71]!==g.status?(R=(0,Q.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Q.jsx)(te,{status:g.status,error:g.error})}),t[70]=g.error,t[71]=g.status,t[72]=R):R=t[72];let z;return t[73]!==g.onBlurCapture||t[74]!==L||t[75]!==R||t[76]!==b?(z=(0,Q.jsx)(de,{children:(0,Q.jsxs)(`div`,{onBlurCapture:y,children:[b,L,R]})}),t[73]=g.onBlurCapture,t[74]=L,t[75]=R,t[76]=b,t[77]=z):z=t[77],z}function Ce(e){return{...e,timezone:I()}}function we(e){let t=(0,X.c)(78),{items:n,quality:r,language:i,t:a,onChanged:c}=e,[l,d]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(`preference`),_;t[0]===n?_=t[1]:(_=n.filter(Ee),t[0]=n,t[1]=_);let v=_,y;t[2]===n?y=t[3]:(y=n.filter(Te),t[2]=n,t[3]=y);let b=y,x;t[4]!==h||t[5]!==c||t[6]!==p?(x=async e=>{e.preventDefault(),p.trim()&&(await P({statement:p,kind:h}),m(``),d(!1),await c())},t[4]=h,t[5]=c,t[6]=p,t[7]=x):x=t[7];let S=x,C;t[8]===a.understoodHint?C=t[9]:(C=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:a.understoodHint}),t[8]=a.understoodHint,t[9]=C);let w,T;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>d(!0),T=(0,Q.jsx)(u,{className:`size-4`}),t[10]=w,t[11]=T):(w=t[10],T=t[11]);let E;t[12]===a.addUnderstanding?E=t[13]:(E=(0,Q.jsxs)(f,{variant:`primary`,onClick:w,children:[T,a.addUnderstanding]}),t[12]=a.addUnderstanding,t[13]=E);let D;t[14]!==C||t[15]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[C,E]}),t[14]=C,t[15]=E,t[16]=D):D=t[16];let O=a.addUnderstanding,k=a.understoodHint,A=a.add,j=a.cancel,M;t[17]===p?M=t[18]:(M=p.trim(),t[17]=p,t[18]=M);let N=!M,F;t[19]===a.statement?F=t[20]:(F=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:a.statement}),t[19]=a.statement,t[20]=F);let I;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>m(e.target.value),t[21]=I):I=t[21];let L;t[22]!==p||t[23]!==a.statement?(L=(0,Q.jsx)(`textarea`,{autoFocus:!0,className:$,rows:4,placeholder:a.statement,value:p,onChange:I}),t[22]=p,t[23]=a.statement,t[24]=L):L=t[24];let R;t[25]!==F||t[26]!==L?(R=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[F,L]}),t[25]=F,t[26]=L,t[27]=R):R=t[27];let z;t[28]===a.kind?z=t[29]:(z=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:a.kind}),t[28]=a.kind,t[29]=z);let B,V;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>g(e.target.value),V=Object.entries(le),t[30]=B,t[31]=V):(B=t[30],V=t[31]);let H;t[32]===i?H=t[33]:(H=V.map(e=>{let[t,n]=e;return(0,Q.jsx)(s,{value:t,children:n[i]},t)}),t[32]=i,t[33]=H);let U;t[34]!==h||t[35]!==H?(U=(0,Q.jsx)(o,{value:h,onChange:B,children:H}),t[34]=h,t[35]=H,t[36]=U):U=t[36];let W;t[37]!==z||t[38]!==U?(W=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[z,U]}),t[37]=z,t[38]=U,t[39]=W):W=t[39];let G;t[40]!==l||t[41]!==S||t[42]!==a.add||t[43]!==a.addUnderstanding||t[44]!==a.cancel||t[45]!==a.understoodHint||t[46]!==N||t[47]!==R||t[48]!==W?(G=(0,Q.jsxs)(pe,{open:l,onOpenChange:d,title:O,description:k,submitLabel:A,cancelLabel:j,submitDisabled:N,onSubmit:S,children:[R,W]}),t[40]=l,t[41]=S,t[42]=a.add,t[43]=a.addUnderstanding,t[44]=a.cancel,t[45]=a.understoodHint,t[46]=N,t[47]=R,t[48]=W,t[49]=G):G=t[49];let K;t[50]!==r||t[51]!==a?(K=(0,Q.jsx)(De,{quality:r,t:a}),t[50]=r,t[51]=a,t[52]=K):K=t[52];let q;t[53]===a?q=t[54]:(q=(0,Q.jsx)(Ae,{t:a}),t[53]=a,t[54]=q);let J;t[55]!==i||t[56]!==c||t[57]!==b||t[58]!==a?(J=b.length?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.review,` · `,b.length]}),(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:b.map(e=>(0,Q.jsx)(ke,{item:e,language:i,t:a,onChanged:c},e.id))})]}):null,t[55]=i,t[56]=c,t[57]=b,t[58]=a,t[59]=J):J=t[59];let ee;t[60]!==v.length||t[61]!==a.active?(ee=(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.active,` · `,v.length]}),t[60]=v.length,t[61]=a.active,t[62]=ee):ee=t[62];let Y;t[63]!==v||t[64]!==i||t[65]!==c||t[66]!==a?(Y=v.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:v.map(e=>(0,Q.jsx)(ke,{item:e,language:i,t:a,onChanged:c},e.id))}):(0,Q.jsx)(fe,{children:a.emptyUnderstanding}),t[63]=v,t[64]=i,t[65]=c,t[66]=a,t[67]=Y):Y=t[67];let te;t[68]!==ee||t[69]!==Y?(te=(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[ee,Y]}),t[68]=ee,t[69]=Y,t[70]=te):te=t[70];let ne;return t[71]!==G||t[72]!==K||t[73]!==q||t[74]!==J||t[75]!==te||t[76]!==D?(ne=(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[D,G,K,q,J,te]}),t[71]=G,t[72]=K,t[73]=q,t[74]=J,t[75]=te,t[76]=D,t[77]=ne):ne=t[77],ne}function Te(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function Ee(e){return e.status===`active`}function De(e){let t=(0,X.c)(32),{quality:n,t:r}=e,i;t[0]===r.qualityNoData?i=t[1]:(i=e=>e==null?r.qualityNoData:`${Math.round(e*100)}%`,t[0]=r.qualityNoData,t[1]=i);let a=i,o=r.qualityActive,s=String(n.records.active),c;t[2]!==r.qualityActive||t[3]!==s?(c=[o,s],t[2]=r.qualityActive,t[3]=s,t[4]=c):c=t[4];let l=r.qualityPending,u=String(n.records.candidate+n.records.needsReview),d;t[5]!==r.qualityPending||t[6]!==u?(d=[l,u],t[5]=r.qualityPending,t[6]=u,t[7]=d):d=t[7];let f=r.qualityAcceptance,p;t[8]!==n.decisions.acceptanceRate||t[9]!==a?(p=a(n.decisions.acceptanceRate),t[8]=n.decisions.acceptanceRate,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==r.qualityAcceptance||t[12]!==p?(m=[f,p],t[11]=r.qualityAcceptance,t[12]=p,t[13]=m):m=t[13];let h=r.qualityRecall,g;t[14]!==n.recall.helpfulRate||t[15]!==a?(g=a(n.recall.helpfulRate),t[14]=n.recall.helpfulRate,t[15]=a,t[16]=g):g=t[16];let _;t[17]!==r.qualityRecall||t[18]!==g?(_=[h,g],t[17]=r.qualityRecall,t[18]=g,t[19]=_):_=t[19];let v;t[20]!==m||t[21]!==_||t[22]!==c||t[23]!==d?(v=[c,d,m,_],t[20]=m,t[21]=_,t[22]=c,t[23]=d,t[24]=v):v=t[24];let y=v,b;t[25]===r.qualityTitle?b=t[26]:(b=(0,Q.jsx)(`h2`,{className:`text-xs font-medium text-fg-muted`,children:r.qualityTitle}),t[25]=r.qualityTitle,t[26]=b);let x;t[27]===y?x=t[28]:(x=y.map(Oe),t[27]=y,t[28]=x);let S;return t[29]!==b||t[30]!==x?(S=(0,Q.jsxs)(`section`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 rounded-xl bg-surface-muted px-3 py-2.5`,children:[b,x]}),t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function Oe(e){let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:t}),(0,Q.jsx)(`span`,{className:`font-semibold text-fg`,children:n})]},t)}function ke(e){let t=(0,X.c)(60),{item:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,d]=he(n.statement),p=u!==n.statement,m;t[0]===i.required?m=t[1]:(m=e=>e.trim()?null:i.required,t[0]=i.required,t[1]=m);let h;t[2]!==n.id||t[3]!==a?(h=async e=>{await a((await N(n.id,{statement:e})).understanding)},t[2]=n.id,t[3]=a,t[4]=h):h=t[4];let g;t[5]!==u||t[6]!==o||t[7]!==p||t[8]!==m||t[9]!==h?(g={value:u,dirty:p,enabled:o,delayMs:500,validate:m,onSave:h},t[5]=u,t[6]=o,t[7]=p,t[8]=m,t[9]=h,t[10]=g):g=t[10];let _=ne(g),v;t[11]!==u||t[12]!==o||t[13]!==d?(v=o?(0,Q.jsx)(`textarea`,{autoFocus:!0,className:$,value:u,onChange:e=>d(e.target.value),rows:3}):(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:u}),t[11]=u,t[12]=o,t[13]=d,t[14]=v):v=t[14];let y=le[n.kind][r],b;t[15]===y?b=t[16]:(b=(0,Q.jsx)(`span`,{children:y}),t[15]=y,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(`span`,{children:`·`}),t[17]=x):x=t[17];let S=n.explicitness===`explicit`?i.sourceExplicit:n.explicitness===`observed`?i.sourceObserved:i.sourceInferred,C;t[18]===S?C=t[19]:(C=(0,Q.jsx)(`span`,{children:S}),t[18]=S,t[19]=C);let w;t[20]!==C||t[21]!==b?(w=(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[b,x,C]}),t[20]=C,t[21]=b,t[22]=w):w=t[22];let T;t[23]!==w||t[24]!==v?(T=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[v,w]}),t[23]=w,t[24]=v,t[25]=T):T=t[25];let E;t[26]!==_||t[27]!==o||t[28]!==i.done||t[29]!==i.edit?(E=o?(0,Q.jsx)(f,{variant:`ghost`,onClick:()=>{_.flush(),s(!1)},children:i.done}):(0,Q.jsxs)(f,{variant:`ghost`,onClick:()=>s(!0),children:[(0,Q.jsx)(M,{className:`size-3.5`}),i.edit]}),t[26]=_,t[27]=o,t[28]=i.done,t[29]=i.edit,t[30]=E):E=t[30];let D;t[31]!==n.id||t[32]!==n.status||t[33]!==a||t[34]!==i.confirm||t[35]!==i.reject?(D=n.status===`active`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{variant:`primary`,onClick:async()=>{await a((await N(n.id,{status:`active`})).understanding)},children:i.confirm}),(0,Q.jsx)(f,{onClick:async()=>{await a((await N(n.id,{status:`rejected`})).understanding)},children:i.reject})]}),t[31]=n.id,t[32]=n.status,t[33]=a,t[34]=i.confirm,t[35]=i.reject,t[36]=D):D=t[36];let O;t[37]!==c||t[38]!==n.id||t[39]!==a?(O=async()=>{if(!c){l(!0);return}await K(n.id),l(!1),await a()},t[37]=c,t[38]=n.id,t[39]=a,t[40]=O):O=t[40];let k;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(J,{className:`size-3.5`}),t[41]=k):k=t[41];let A=c?i.confirmDelete:i.delete,j;t[42]!==O||t[43]!==A?(j=(0,Q.jsxs)(f,{variant:`ghost`,className:`text-danger`,onClick:O,children:[k,A]}),t[42]=O,t[43]=A,t[44]=j):j=t[44];let P;t[45]!==E||t[46]!==D||t[47]!==j?(P=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 sm:justify-end`,children:[E,D,j]}),t[45]=E,t[46]=D,t[47]=j,t[48]=P):P=t[48];let F;t[49]!==T||t[50]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:gap-4`,children:[T,P]}),t[49]=T,t[50]=P,t[51]=F):F=t[51];let I;t[52]!==_.error||t[53]!==_.status||t[54]!==o?(I=o||_.status!==`idle`?(0,Q.jsx)(te,{className:`mt-2`,status:_.status,error:_.error}):null,t[52]=_.error,t[53]=_.status,t[54]=o,t[55]=I):I=t[55];let L;return t[56]!==_.onBlurCapture||t[57]!==F||t[58]!==I?(L=(0,Q.jsx)(`article`,{className:`px-4 py-3 sm:px-5`,children:(0,Q.jsxs)(`div`,{onBlurCapture:_.onBlurCapture,children:[F,I]})}),t[56]=_.onBlurCapture,t[57]=F,t[58]=I,t[59]=L):L=t[59],L}function Ae(e){let t=(0,X.c)(35),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=x(`you-focuses`,L),[s,c]=(0,Z.useState)(null);if(a){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(D,{className:`h-40 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;return t[1]===n.error?e=t[2]:(e=(0,Q.jsx)(fe,{children:n.error}),t[1]=n.error,t[2]=e),e}let l;if(t[3]!==r||t[4]!==s||t[5]!==o||t[6]!==n.activate||t[7]!==n.complete||t[8]!==n.confidence||t[9]!==n.confidenceHigh||t[10]!==n.confidenceLow||t[11]!==n.confidenceMedium||t[12]!==n.confirmDelete||t[13]!==n.delete||t[14]!==n.focusActive||t[15]!==n.focusCandidate||t[16]!==n.focusCompleted||t[17]!==n.focusHint||t[18]!==n.focusPaused||t[19]!==n.focuses||t[20]!==n.noFocuses||t[21]!==n.pause||t[22]!==n.reject){let e=(r??[]).filter(je),i;t[24]!==n.focusActive||t[25]!==n.focusCandidate||t[26]!==n.focusCompleted||t[27]!==n.focusPaused?(i=e=>e===`candidate`?n.focusCandidate:e===`active`?n.focusActive:e===`paused`?n.focusPaused:n.focusCompleted,t[24]=n.focusActive,t[25]=n.focusCandidate,t[26]=n.focusCompleted,t[27]=n.focusPaused,t[28]=i):i=t[28];let a=i,u;t[29]!==n.confidenceHigh||t[30]!==n.confidenceLow||t[31]!==n.confidenceMedium?(u=e=>e>=.85?n.confidenceHigh:e>=.65?n.confidenceMedium:n.confidenceLow,t[29]=n.confidenceHigh,t[30]=n.confidenceLow,t[31]=n.confidenceMedium,t[32]=u):u=t[32];let d=u,p;t[33]===n.focusHint?p=t[34]:(p=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.focusHint}),t[33]=n.focusHint,t[34]=p),l=(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[n.focuses,` · `,e.length]}),p]}),e.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:e.map(e=>(0,Q.jsxs)(`article`,{className:`flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] text-fg-muted`,children:a(e.status)}),(0,Q.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[n.confidence,` · `,d(e.confidence)]})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:e.summary})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-1 sm:justify-end`,children:[e.status===`active`?(0,Q.jsx)(f,{onClick:async()=>{await O(e.id,`paused`),await o()},children:n.pause}):(0,Q.jsx)(f,{variant:`primary`,onClick:async()=>{await O(e.id,`active`),await o()},children:n.activate}),(0,Q.jsx)(f,{variant:`ghost`,onClick:async()=>{await O(e.id,`completed`),await o()},children:n.complete}),e.status===`candidate`?(0,Q.jsx)(f,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await O(e.id,`rejected`),await o()},children:n.reject}):null,(0,Q.jsxs)(f,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(s!==e.id){c(e.id);return}await F(e.id),c(null),await o()},children:[(0,Q.jsx)(J,{className:`size-3.5`}),s===e.id?n.confirmDelete:n.delete]})]})]},e.id))}):(0,Q.jsx)(fe,{children:n.noFocuses})]}),t[3]=r,t[4]=s,t[5]=o,t[6]=n.activate,t[7]=n.complete,t[8]=n.confidence,t[9]=n.confidenceHigh,t[10]=n.confidenceLow,t[11]=n.confidenceMedium,t[12]=n.confirmDelete,t[13]=n.delete,t[14]=n.focusActive,t[15]=n.focusCandidate,t[16]=n.focusCompleted,t[17]=n.focusHint,t[18]=n.focusPaused,t[19]=n.focuses,t[20]=n.noFocuses,t[21]=n.pause,t[22]=n.reject,t[23]=l}else l=t[23];return l}function je(e){return e.status!==`rejected`}function Me(e){let t=(0,X.c)(80),{rules:n,language:r,t:i,onChanged:a}=e,[c,l]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(`communication`),[g,_]=(0,Z.useState)(null),v,y,b,x,S,C;if(t[0]!==c||t[1]!==m||t[2]!==g||t[3]!==r||t[4]!==a||t[5]!==n||t[6]!==d||t[7]!==i.add||t[8]!==i.addRule||t[9]!==i.cancel||t[10]!==i.category||t[11]!==i.collaboration||t[12]!==i.confirmDelete||t[13]!==i.delete||t[14]!==i.disable||t[15]!==i.emptyRules||t[16]!==i.enable||t[17]!==i.ruleStatement||t[18]!==i.rulesHint){let e=n.filter(Ne),w;t[25]!==m||t[26]!==a||t[27]!==d?(w=async e=>{e.preventDefault(),d.trim()&&(await G({statement:d,category:m}),p(``),l(!1),await a())},t[25]=m,t[26]=a,t[27]=d,t[28]=w):w=t[28];let T=w;x=`space-y-5`;let E;t[29]===i.rulesHint?E=t[30]:(E=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.rulesHint}),t[29]=i.rulesHint,t[30]=E);let D,O;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>l(!0),D=(0,Q.jsx)(u,{className:`size-4`}),t[31]=D,t[32]=O):(D=t[31],O=t[32]);let k;t[33]===i.addRule?k=t[34]:(k=(0,Q.jsxs)(f,{variant:`primary`,onClick:O,children:[D,i.addRule]}),t[33]=i.addRule,t[34]=k),t[35]!==k||t[36]!==E?(S=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[E,k]}),t[35]=k,t[36]=E,t[37]=S):S=t[37];let A=i.addRule,j=i.rulesHint,M=i.add,N=i.cancel,P;t[38]===d?P=t[39]:(P=d.trim(),t[38]=d,t[39]=P);let F=!P,I;t[40]===i.ruleStatement?I=t[41]:(I=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.ruleStatement}),t[40]=i.ruleStatement,t[41]=I);let L;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>p(e.target.value),t[42]=L):L=t[42];let R;t[43]!==d||t[44]!==i.ruleStatement?(R=(0,Q.jsx)(`textarea`,{autoFocus:!0,className:$,rows:4,placeholder:i.ruleStatement,value:d,onChange:L}),t[43]=d,t[44]=i.ruleStatement,t[45]=R):R=t[45];let B;t[46]!==I||t[47]!==R?(B=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[I,R]}),t[46]=I,t[47]=R,t[48]=B):B=t[48];let V;t[49]===i.category?V=t[50]:(V=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:i.category}),t[49]=i.category,t[50]=V);let H,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>h(e.target.value),U=Object.entries(ue),t[51]=H,t[52]=U):(H=t[51],U=t[52]);let W;t[53]===r?W=t[54]:(W=U.map(e=>{let[t,n]=e;return(0,Q.jsx)(s,{value:t,children:n[r]},t)}),t[53]=r,t[54]=W);let K;t[55]!==m||t[56]!==W?(K=(0,Q.jsx)(o,{value:m,onChange:H,children:W}),t[55]=m,t[56]=W,t[57]=K):K=t[57];let q;t[58]!==V||t[59]!==K?(q=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[V,K]}),t[58]=V,t[59]=K,t[60]=q):q=t[60],t[61]!==c||t[62]!==T||t[63]!==i.add||t[64]!==i.addRule||t[65]!==i.cancel||t[66]!==i.rulesHint||t[67]!==F||t[68]!==B||t[69]!==q?(C=(0,Q.jsxs)(pe,{open:c,onOpenChange:l,title:A,description:j,submitLabel:M,cancelLabel:N,submitDisabled:F,onSubmit:T,children:[B,q]}),t[61]=c,t[62]=T,t[63]=i.add,t[64]=i.addRule,t[65]=i.cancel,t[66]=i.rulesHint,t[67]=F,t[68]=B,t[69]=q,t[70]=C):C=t[70],v=`space-y-2`,y=(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[i.collaboration,` · `,e.length]}),b=e.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:e.map(e=>(0,Q.jsxs)(`article`,{className:`flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-start sm:gap-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm leading-6 ${e.status===`disabled`?`text-fg-subtle line-through`:`text-fg`}`,children:e.statement}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:ue[e.category][r]}),(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsxs)(`span`,{children:[`P`,e.priority]}),e.status===`disabled`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsx)(`span`,{children:i.disable})]}):null]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 sm:justify-end`,children:[(0,Q.jsx)(f,{variant:`ghost`,onClick:async()=>{await Y(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,Q.jsxs)(f,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(g!==e.id){_(e.id);return}await z(e.id),_(null),await a()},children:[(0,Q.jsx)(J,{className:`size-3.5`}),g===e.id?i.confirmDelete:i.delete]})]})]},e.id))}):(0,Q.jsx)(fe,{children:i.emptyRules}),t[0]=c,t[1]=m,t[2]=g,t[3]=r,t[4]=a,t[5]=n,t[6]=d,t[7]=i.add,t[8]=i.addRule,t[9]=i.cancel,t[10]=i.category,t[11]=i.collaboration,t[12]=i.confirmDelete,t[13]=i.delete,t[14]=i.disable,t[15]=i.emptyRules,t[16]=i.enable,t[17]=i.ruleStatement,t[18]=i.rulesHint,t[19]=v,t[20]=y,t[21]=b,t[22]=x,t[23]=S,t[24]=C}else v=t[19],y=t[20],b=t[21],x=t[22],S=t[23],C=t[24];let w;t[71]!==v||t[72]!==y||t[73]!==b?(w=(0,Q.jsxs)(`section`,{className:v,children:[y,b]}),t[71]=v,t[72]=y,t[73]=b,t[74]=w):w=t[74];let T;return t[75]!==x||t[76]!==S||t[77]!==C||t[78]!==w?(T=(0,Q.jsxs)(`div`,{className:x,children:[S,C,w]}),t[75]=x,t[76]=S,t[77]=C,t[78]=w,t[79]=T):T=t[79],T}function Ne(e){return e.status!==`archived`}async function Pe(){let[e,t,n]=await Promise.all([U(),ae(),oe()]);return{grants:e,connectors:t,catalog:n}}function Fe({t:e}){let{data:t,error:n,isLoading:r,mutate:i}=x(`you-understanding-sources`,Pe),[o,s]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null);if(r)return(0,Q.jsx)(D,{className:`h-64 rounded-2xl`});if(n)return(0,Q.jsxs)(fe,{children:[e.error,` `,(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:()=>void i(),children:e.retry})]});let h=t?.grants??[],g=t?.connectors??[],_=new Map((t?.catalog??[]).map(e=>[e.id,e])),v=e=>{let t=e.displayName.trim().toLocaleLowerCase(),n=g.find(e=>e.displayName.trim().toLocaleLowerCase()===t);return n?_.get(n.connectorId):[..._.values()].find(n=>n.displayName.trim().toLocaleLowerCase()===t||e.sourceKey.toLocaleLowerCase().includes(n.id.toLocaleLowerCase()))},y=t=>`${e.actionFailed}: ${t instanceof Error?t.message:String(t)}`,b=async t=>{m(null),d(null),s({grantId:t.id,kind:`refresh`});try{await j(t.id),await i().catch(()=>void 0),m({tone:`success`,message:`${t.displayName}: ${e.refreshStarted}`})}catch(e){m({tone:`error`,message:y(e)})}finally{s(null)}},S=async t=>{if(u!==t.id){d(t.id),m(null);return}s({grantId:t.id,kind:`revoke`});try{await q(t.id),await i().catch(()=>void 0),d(null),m({tone:`success`,message:`${t.displayName}: ${e.revokeDone}`})}catch(e){m({tone:`error`,message:y(e)})}finally{s(null)}};return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:e.sourcesHint}),(0,Q.jsx)(f,{asChild:!0,variant:`primary`,children:(0,Q.jsxs)(a,{to:`/connectors?understanding=1&returnTo=%2Fyou%3Ftab%3Dsources`,children:[e.manageSources,(0,Q.jsx)(c,{className:`size-4`})]})})]}),p?(0,Q.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`rounded-xl px-3 py-2 text-sm ${p.tone===`success`?`bg-success-soft text-success`:`bg-danger/10 text-danger`}`,children:p.message}):null,(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[e.authorizedSources,` · `,h.length]}),h.length?(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:h.map(t=>{let n=v(t);return(0,Q.jsxs)(`article`,{className:`flex min-h-28 items-start gap-3 rounded-2xl border border-edge bg-surface-panel p-4`,children:[n?(0,Q.jsx)(ie,{connector:n,size:`sm`}):(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base`,children:(0,Q.jsx)(B,{className:`size-4 text-fg-muted`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:t.displayName}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:[t.accessMode===`continuous`?e.continuous:e.once,` · `,t.processingPolicy===`local_only`?e.localOnly:t.retentionPolicy===`derived_only`?e.derivedOnly:t.retentionPolicy]}),t.lastCollectedAt?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:new Date(t.lastCollectedAt).toLocaleString()}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:[t.accessMode===`continuous`?(0,Q.jsx)(f,{variant:`ghost`,disabled:o!==null,"aria-busy":o?.grantId===t.id&&o.kind===`refresh`,onClick:()=>void b(t),children:o?.grantId===t.id&&o.kind===`refresh`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`size-4 animate-spin`}),e.refreshing]}):e.refresh}):null,(0,Q.jsx)(f,{variant:`ghost`,className:`text-danger`,title:e.revokeHint,"aria-label":`${e.revoke}: ${t.displayName}`,disabled:o!==null,"aria-busy":o?.grantId===t.id&&o.kind===`revoke`,onClick:()=>void S(t),children:o?.grantId===t.id&&o.kind===`revoke`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`size-4 animate-spin`}),e.revoking]}):u===t.id?e.confirmRevoke:e.revoke})]})]},t.id)})}):(0,Q.jsx)(fe,{children:e.noSources})]}),(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[e.connectorsTitle,` · `,g.length]}),g.length?(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:g.map(t=>{let n=t.enabled&&(t.status===`connected`||t.connectionStatus===`connected`||t.authStatus===`connected`),r=_.get(t.connectorId);return(0,Q.jsxs)(a,{to:`/connectors?tab=connected&instance=${encodeURIComponent(t.instanceId)}`,"aria-label":`${e.openConnector}: ${t.displayName}`,className:`group flex min-h-24 items-center gap-3 rounded-2xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,children:[(0,Q.jsx)(ie,{connector:r??{displayName:t.displayName}}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:t.displayName}),(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:t.connectorId})]}),(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs ${n?`bg-success-soft text-success`:`bg-warning-soft text-warning`}`,children:n?e.connected:e.unavailable}),(0,Q.jsx)(T,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`})]},t.instanceId)})}):(0,Q.jsx)(fe,{children:e.noConnectors})]})]})}function Ie(e){let t=(0,X.c)(112),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:c,mutate:l}=x(`you-context-settings`,R),u=i?.dreaming??null,[d,p]=he(u),m;t[0]!==d||t[1]!==u?(m=d&&u&&me(d)!==me(u),t[0]=d,t[1]=u,t[2]=m):m=t[2];let h=!!m,g;t[3]===l?g=t[4]:(g=async e=>{await ee({dreaming:e}),await l()},t[3]=l,t[4]=g);let _;t[5]!==d||t[6]!==h||t[7]!==g?(_={value:d,dirty:h,delayMs:500,onSave:g},t[5]=d,t[6]=h,t[7]=g,t[8]=_):_=t[8];let v=ne(_);if(a){let e;t[9]===l?e=t[10]:(e=()=>void l(),t[9]=l,t[10]=e);let n;t[11]!==r.retry||t[12]!==e?(n=(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:r.retry}),t[11]=r.retry,t[12]=e,t[13]=n):n=t[13];let i;return t[14]!==r.error||t[15]!==n?(i=(0,Q.jsxs)(fe,{children:[r.error,` `,n]}),t[14]=r.error,t[15]=n,t[16]=i):i=t[16],i}if(c||!d){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(D,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let y=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,b;t[18]===r.dreamingHint?b=t[19]:(b=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=b);let S=v.onBlurCapture,C;t[20]===r.mode?C=t[21]:(C=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.mode}),t[20]=r.mode,t[21]=C);let w;t[22]===p?w=t[23]:(w=e=>p(t=>t&&{...t,mode:e.target.value}),t[22]=p,t[23]=w);let T;t[24]===r.on?T=t[25]:(T=(0,Q.jsx)(s,{value:`review`,children:r.on}),t[24]=r.on,t[25]=T);let E;t[26]===r.off?E=t[27]:(E=(0,Q.jsx)(s,{value:`off`,children:r.off}),t[26]=r.off,t[27]=E);let O;t[28]!==d.mode||t[29]!==E||t[30]!==w||t[31]!==T?(O=(0,Q.jsxs)(o,{value:d.mode,onChange:w,children:[T,E]}),t[28]=d.mode,t[29]=E,t[30]=w,t[31]=T,t[32]=O):O=t[32];let k;t[33]!==O||t[34]!==C?(k=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[C,O]}),t[33]=O,t[34]=C,t[35]=k):k=t[35];let A;t[36]===r.reviewTime?A=t[37]:(A=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.reviewTime}),t[36]=r.reviewTime,t[37]=A);let j;t[38]===p?j=t[39]:(j=e=>p(t=>t&&{...t,schedule:{time:e.target.value}}),t[38]=p,t[39]=j);let M;t[40]!==d.schedule.time||t[41]!==j?(M=(0,Q.jsx)(`input`,{type:`time`,className:$,value:d.schedule.time,onChange:j}),t[40]=d.schedule.time,t[41]=j,t[42]=M):M=t[42];let N;t[43]!==A||t[44]!==M?(N=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[A,M]}),t[43]=A,t[44]=M,t[45]=N):N=t[45];let P;t[46]===r.timezone?P=t[47]:(P=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.timezone}),t[46]=r.timezone,t[47]=P);let F=d.timezone??``,L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=I(),t[48]=L):L=t[48];let z;t[49]===p?z=t[50]:(z=e=>p(t=>t&&{...t,timezone:e.target.value||void 0}),t[49]=p,t[50]=z);let B;t[51]!==F||t[52]!==z?(B=(0,Q.jsx)(`input`,{className:`${$} min-w-0 flex-1`,value:F,placeholder:L,onChange:z}),t[51]=F,t[52]=z,t[53]=B):B=t[53];let V;t[54]===p?V=t[55]:(V=()=>p(Le),t[54]=p,t[55]=V);let H;t[56]!==r.detect||t[57]!==V?(H=(0,Q.jsx)(f,{className:`shrink-0 whitespace-nowrap`,onClick:V,children:r.detect}),t[56]=r.detect,t[57]=V,t[58]=H):H=t[58];let U;t[59]!==B||t[60]!==H?(U=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[B,H]}),t[59]=B,t[60]=H,t[61]=U):U=t[61];let W;t[62]!==P||t[63]!==U?(W=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[P,U]}),t[62]=P,t[63]=U,t[64]=W):W=t[64];let G;t[65]===r.evidenceThreshold?G=t[66]:(G=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[65]=r.evidenceThreshold,t[66]=G);let K;t[67]===p?K=t[68]:(K=e=>p(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[67]=p,t[68]=K);let q;t[69]!==d.minEvidenceSources||t[70]!==K?(q=(0,Q.jsx)(`input`,{type:`number`,min:2,max:10,className:$,value:d.minEvidenceSources,onChange:K}),t[69]=d.minEvidenceSources,t[70]=K,t[71]=q):q=t[71];let J;t[72]!==G||t[73]!==q?(J=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[G,q]}),t[72]=G,t[73]=q,t[74]=J):J=t[74];let Y;t[75]===r.scanLimit?Y=t[76]:(Y=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[75]=r.scanLimit,t[76]=Y);let re;t[77]===p?re=t[78]:(re=e=>p(t=>t&&{...t,limit:Number(e.target.value)}),t[77]=p,t[78]=re);let ie;t[79]!==d.limit||t[80]!==re?(ie=(0,Q.jsx)(`input`,{type:`number`,min:1,max:2e3,className:$,value:d.limit,onChange:re}),t[79]=d.limit,t[80]=re,t[81]=ie):ie=t[81];let ae;t[82]!==Y||t[83]!==ie?(ae=(0,Q.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[Y,ie]}),t[82]=Y,t[83]=ie,t[84]=ae):ae=t[84];let oe;t[85]!==k||t[86]!==N||t[87]!==W||t[88]!==J||t[89]!==ae?(oe=(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[k,N,W,J,ae]}),t[85]=k,t[86]=N,t[87]=W,t[88]=J,t[89]=ae,t[90]=oe):oe=t[90];let Z;t[91]!==v.error||t[92]!==v.status?(Z=(0,Q.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Q.jsx)(te,{status:v.status,error:v.error})}),t[91]=v.error,t[92]=v.status,t[93]=Z):Z=t[93];let se;t[94]!==v.onBlurCapture||t[95]!==oe||t[96]!==Z?(se=(0,Q.jsx)(de,{children:(0,Q.jsxs)(`div`,{onBlurCapture:S,children:[oe,Z]})}),t[94]=v.onBlurCapture,t[95]=oe,t[96]=Z,t[97]=se):se=t[97];let ce;t[98]===r.lastRun?ce=t[99]:(ce=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[98]=r.lastRun,t[99]=ce);let le;t[100]!==n||t[101]!==y||t[102]!==r.neverRun||t[103]!==r.runItems?(le=n?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:y}),(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsx)(`time`,{children:new Date(n.startedAt).toLocaleString()}),typeof n.metrics.scanned==`number`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`·`}),(0,Q.jsxs)(`span`,{children:[String(n.metrics.scanned),` `,r.runItems]})]}):null]}):(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:r.neverRun}),t[100]=n,t[101]=y,t[102]=r.neverRun,t[103]=r.runItems,t[104]=le):le=t[104];let ue;t[105]!==ce||t[106]!==le?(ue=(0,Q.jsxs)(de,{children:[ce,le]}),t[105]=ce,t[106]=le,t[107]=ue):ue=t[107];let pe;return t[108]!==se||t[109]!==ue||t[110]!==b?(pe=(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[b,se,ue]}),t[108]=se,t[109]=ue,t[110]=b,t[111]=pe):pe=t[111],pe}function Le(e){return e&&{...e,timezone:I()}}function Re(e){let t=(0,X.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:c}=x(`you-context-settings`,R),l=r?.privacy.sensitiveWritePolicy??null,[u,d]=he(l),f=!!(u&&l&&u!==l),p;t[0]===c?p=t[1]:(p=async e=>{await ee({privacy:{sensitiveWritePolicy:e}}),await c()},t[0]=c,t[1]=p);let m;t[2]!==u||t[3]!==f||t[4]!==p?(m={value:u,dirty:f,delayMs:350,onSave:p},t[2]=u,t[3]=f,t[4]=p,t[5]=m):m=t[5];let h=ne(m);if(i){let e;t[6]===c?e=t[7]:(e=()=>void c(),t[6]=c,t[7]=e);let r;t[8]!==n.retry||t[9]!==e?(r=(0,Q.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[8]=n.retry,t[9]=e,t[10]=r):r=t[10];let i;return t[11]!==n.error||t[12]!==r?(i=(0,Q.jsxs)(fe,{children:[n.error,` `,r]}),t[11]=n.error,t[12]=r,t[13]=i):i=t[13],i}if(a||!u){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(D,{className:`h-56 rounded-2xl`}),t[14]=e):e=t[14],e}let g;t[15]===n.privacyHint?g=t[16]:(g=(0,Q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.privacyHint}),t[15]=n.privacyHint,t[16]=g);let _;t[17]===n.sensitivePolicy?_=t[18]:(_=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n.sensitivePolicy}),t[17]=n.sensitivePolicy,t[18]=_);let v;t[19]===d?v=t[20]:(v=e=>d(e.target.value),t[19]=d,t[20]=v);let y;t[21]===n.policyDeny?y=t[22]:(y=(0,Q.jsx)(s,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=y);let b;t[23]===n.policyConfirm?b=t[24]:(b=(0,Q.jsx)(s,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=b);let S;t[25]===n.policyAllow?S=t[26]:(S=(0,Q.jsx)(s,{value:`allow`,children:n.policyAllow}),t[25]=n.policyAllow,t[26]=S);let C;t[27]!==u||t[28]!==v||t[29]!==y||t[30]!==b||t[31]!==S?(C=(0,Q.jsxs)(o,{value:u,onChange:v,children:[y,b,S]}),t[27]=u,t[28]=v,t[29]=y,t[30]=b,t[31]=S,t[32]=C):C=t[32];let w;t[33]!==C||t[34]!==_?(w=(0,Q.jsxs)(`label`,{className:`block max-w-xl space-y-1.5 text-sm`,children:[_,C]}),t[33]=C,t[34]=_,t[35]=w):w=t[35];let T;t[36]===n.privacyWarning?T=t[37]:(T=(0,Q.jsx)(`p`,{className:`mt-3 max-w-2xl text-xs leading-5 text-fg-subtle`,children:n.privacyWarning}),t[36]=n.privacyWarning,t[37]=T);let E;t[38]!==h.error||t[39]!==h.status?(E=(0,Q.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Q.jsx)(te,{status:h.status,error:h.error})}),t[38]=h.error,t[39]=h.status,t[40]=E):E=t[40];let O;t[41]!==h.onBlurCapture||t[42]!==w||t[43]!==T||t[44]!==E?(O=(0,Q.jsx)(de,{children:(0,Q.jsxs)(`div`,{onBlurCapture:h.onBlurCapture,children:[w,T,E]})}),t[41]=h.onBlurCapture,t[42]=w,t[43]=T,t[44]=E,t[45]=O):O=t[45];let k;return t[46]!==O||t[47]!==g?(k=(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[g,O]}),t[46]=O,t[47]=g,t[48]=k):k=t[48],k}export{_e as UserContextPage};
|
|
@@ -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"./cn-JdwAhgNB.js";import{r as i,s as a}from"./locale-store-
|
|
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"./cn-JdwAhgNB.js";import{r as i,s as a}from"./locale-store-hDBVeG3G.js";import{n as o}from"./gateway-config-swr-CEfv8N1J.js";import{Jo as s}from"./index-DJ7HSgKs.js";e();var c=t();async function l(e,t){return(await a(i(`/api/voice/tts-voices?${new URLSearchParams({provider:e,model:t}).toString()}`))).payload?.voices??[]}function u(){return{enabled:!0,provider:`xopc-local`,providers:{"xopc-local":{model:`sensevoice-small`},alibaba:{model:`qwen-audio-3.0-asr-flash`},openai:{model:`gpt-4o-mini-transcribe`},groq:{model:`whisper-large-v3-turbo`}},fallback:{enabled:!1,order:[`xopc-local`]}}}function d(){return{enabled:!0,provider:`edge`,trigger:`inbound`,maxTextLength:512,timeoutMs:6e4,providers:{alibaba:{model:`qwen-tts`,voice:`Cherry`},openai:{model:`tts-1`,voice:`alloy`},edge:{voice:`zh-CN-XiaoxiaoNeural`,lang:`zh-CN`},minimax:{model:`speech-2.8-hd`,voice:`male-qn-qingse`},"tts-local-cli":{command:``,outputFormat:`wav`}}}}function f(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function p(e){return typeof e==`string`&&e.trim().length>0?e.trim():`xopc-local`}function m(e){let t=u();if(!f(e))return t;let n=p(e.provider),r=t.fallback??{enabled:!1,order:[`xopc-local`]};if(f(e.fallback)){let t=Array.isArray(e.fallback.order)?e.fallback.order.filter(e=>typeof e==`string`&&e.trim().length>0):r.order;r={enabled:typeof e.fallback.enabled==`boolean`?e.fallback.enabled:r.enabled,order:t.length?t:r.order}}let i={...t.providers??{},...f(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,f(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,providers:i,fallback:r}}function h(e){return typeof e==`string`&&e.trim().length>0?e.trim():`edge`}function g(e){let t=d();if(!f(e))return t;let n=h(e.provider),r=e.trigger===`off`||e.trigger===`always`||e.trigger===`inbound`||e.trigger===`tagged`?e.trigger:`inbound`,i={...t.providers??{},...f(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,f(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,trigger:r,maxTextLength:typeof e.maxTextLength==`number`&&Number.isFinite(e.maxTextLength)?e.maxTextLength:t.maxTextLength,timeoutMs:typeof e.timeoutMs==`number`&&Number.isFinite(e.timeoutMs)?e.timeoutMs:t.timeoutMs,providers:i}}function _(e){return{...e}}function v(e){return{...e}}function y(e){let t=f(e)?e:{},n=f(t.voice)?t.voice:{},r=f(n.input)?n.input:{},i=f(r.refinement)?r.refinement:{},a=i.mode===`punctuation`||i.mode===`light`||i.mode===`custom`?i.mode:`off`;return{stt:m(t.stt),tts:g(t.tts),voice:{languageMode:n.languageMode===`manual`?`manual`:`auto`,language:n.language===`zh`?`zh`:`en`,input:{refinement:{mode:a,...typeof i.model==`string`&&i.model.trim()?{model:i.model.trim()}:{},...typeof i.customInstruction==`string`?{customInstruction:i.customInstruction}:{}}}}}}async function b(){return y((await a(i(`/api/config`))).payload?.config??{})}async function x(e){await a(i(`/api/config`),{method:`PATCH`,body:JSON.stringify({stt:_(e.stt),tts:v(e.tts),voice:e.voice})}),e.voice.languageMode===`auto`&&await a(i(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:e.voice.language})}),typeof window<`u`&&window.dispatchEvent(new Event(`voice-config-changed`)),o()}async function S(){let e=await a(i(`/api/voice/models`));if(!e.payload?.models)throw Error(`Missing voice models payload`);return e.payload.models}async function C(){let e=await a(i(`/api/voice/providers`));if(!e.payload?.providers)throw Error(`Missing voice providers payload`);return e.payload}async function w(){let e=await a(i(`/api/voice/stt-providers`));if(!e.payload?.providers)throw Error(`Missing STT providers payload`);return e.payload}async function T(){let e=await a(i(`/api/voice/local/status`));if(!e.payload)throw Error(`Missing local voice status payload`);return e.payload}async function E(e){await a(i(`/api/voice/local/models/${encodeURIComponent(e)}/install`),{method:`POST`,body:`{}`})}async function D(e){await a(i(`/api/voice/local/models/${encodeURIComponent(e)}`),{method:`DELETE`})}async function O(e){let t=await a(i(`/api/voice/tts-test`),{method:`POST`,body:JSON.stringify(e)});if(t.ok===!1){let e=typeof t.error==`string`?t.error:t.error?.message;throw Error(e||`TTS test failed`)}if(!t.payload||typeof t.payload.audio!=`string`||!t.payload.audio.trim())throw Error(`TTS test returned no audio. Check the selected voice engine and try again.`);return t.payload}async function k(e){let t=await a(i(`/api/voice/reveal-api-key`),{method:`POST`,body:JSON.stringify(e)});if(!t.payload)throw Error(`Missing reveal payload`);return t.payload}var A=n();function j(e){let t=(0,c.c)(15),{kind:n,providerId:i,fieldId:a,value:o,onChange:l,labels:u,placeholder:d,className:f}=e,p=d===void 0?`sk-...`:d,m;t[0]!==n||t[1]!==i?(m=()=>k({kind:n,provider:i}).then(M),t[0]=n,t[1]=i,t[2]=m):m=t[2];let h=m,g;t[3]===f?g=t[4]:(g=r(`flex min-w-0 flex-col gap-1.5`,f),t[3]=f,t[4]=g);let _;t[5]!==a||t[6]!==u||t[7]!==l||t[8]!==p||t[9]!==h||t[10]!==o?(_=(0,A.jsx)(s,{id:a,value:o,onChange:l,placeholder:p,labels:u,reveal:h,loadFailedLabel:u.loadFailed,maskedHelp:u.maskedHelp,notInConfigFile:u.notInConfigFile,inputClassName:`text-xs`}),t[5]=a,t[6]=u,t[7]=l,t[8]=p,t[9]=h,t[10]=o,t[11]=_):_=t[11];let v;return t[12]!==g||t[13]!==_?(v=(0,A.jsx)(`div`,{className:g,children:_}),t[12]=g,t[13]=_,t[14]=v):v=t[14],v}function M(e){return e.apiKey??null}export{C as a,E as c,D as d,O as f,S as i,y as l,T as n,b as o,l as r,w as s,j as t,x as u};
|
|
@@ -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"./x-B_N4OPjy.js";import{t as a}from"./button-CSEbl4zT.js";import{t as o}from"./messages-
|
|
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"./x-B_N4OPjy.js";import{t as a}from"./button-CSEbl4zT.js";import{t as o}from"./messages-1qg_hOOd.js";import{n as s}from"./locale-store-hDBVeG3G.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-BPoKqzeH.js";import{Ja as m,rs as h}from"./index-DJ7HSgKs.js";import{WorkDiscoveryPage as g}from"./work-discovery-page-BcvBiebt.js";var _=n(),v=e(t(),1),y=r(),b=180;function x(e){let t=(0,_.c)(40),{requestedOpen:n,onExited:r}=e,x=s(C),w=m(S),[T,E]=(0,v.useState)(!0),D=(0,v.useRef)(!1),O=(0,v.useRef)(null),k;t[0]===x?k=t[1]:(k=o(x),t[0]=x,t[1]=k);let A=k.onboarding.workDiscovery,j=w?x===`zh`?`在后台继续`:`Continue in background`:x===`zh`?`稍后再说`:`Maybe later`,M;t[2]===r?M=t[3]:(M=()=>{if(D.current)return;D.current=!0,E(!1);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:b;O.current=window.setTimeout(r,e)},t[2]=r,t[3]=M);let N=M,P,F;t[4]!==N||t[5]!==n?(P=()=>{n||N()},F=[N,n],t[4]=N,t[5]=n,t[6]=P,t[7]=F):(P=t[6],F=t[7]),(0,v.useEffect)(P,F);let I,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{O.current!==null&&window.clearTimeout(O.current)},L=[],t[8]=I,t[9]=L):(I=t[8],L=t[9]),(0,v.useEffect)(I,L);let R;t[10]===N?R=t[11]:(R=e=>{e||N()},t[10]=N,t[11]=R);let z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,y.jsx)(c,{className:`xopc-dialog-overlay fixed inset-0 z-[75] bg-scrim backdrop-blur-[1px]`}),t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,y.jsx)(h,{className:`size-7 shrink-0`,"aria-hidden":!0}),t[13]=B):B=t[13];let V;t[14]===A.title?V=t[15]:(V=(0,y.jsx)(f,{className:`truncate text-sm font-semibold text-fg`,children:A.title}),t[14]=A.title,t[15]=V);let H;t[16]===A.subtitle?H=t[17]:(H=(0,y.jsx)(l,{className:`sr-only`,children:A.subtitle}),t[16]=A.subtitle,t[17]=H);let U;t[18]!==V||t[19]!==H?(U=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[B,V,H]}),t[18]=V,t[19]=H,t[20]=U):U=t[20];let W;t[21]===j?W=t[22]:(W=(0,y.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:j}),t[21]=j,t[22]=W);let G;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,y.jsx)(i,{className:`size-4`,"aria-hidden":!0}),t[23]=G):G=t[23];let K;t[24]!==j||t[25]!==N||t[26]!==W?(K=(0,y.jsxs)(a,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1.5 px-2.5 text-fg-muted`,title:j,"aria-label":j,onClick:N,children:[W,G]}),t[24]=j,t[25]=N,t[26]=W,t[27]=K):K=t[27];let q;t[28]!==U||t[29]!==K?(q=(0,y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-4 border-b border-edge bg-surface-panel px-4 sm:px-5`,children:[U,K]}),t[28]=U,t[29]=K,t[30]=q):q=t[30];let J;t[31]===N?J=t[32]:(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,y.jsx)(g,{embedded:!0,onRequestClose:N})}),t[31]=N,t[32]=J);let Y;t[33]!==q||t[34]!==J?(Y=(0,y.jsxs)(u,{children:[z,(0,y.jsx)(d,{className:`xopc-work-discovery-dialog pointer-events-none fixed inset-0 z-[76] flex items-center justify-center p-3 outline-none sm:p-6`,children:(0,y.jsxs)(`section`,{className:`xopc-work-discovery-panel pointer-events-auto flex h-[min(47.5rem,calc(100dvh-1.5rem))] w-[min(45rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-float sm:h-[min(47.5rem,calc(100dvh-3rem))] sm:w-[min(45rem,calc(100vw-3rem))]`,children:[q,J]})})]}),t[33]=q,t[34]=J,t[35]=Y):Y=t[35];let X;return t[36]!==T||t[37]!==Y||t[38]!==R?(X=(0,y.jsx)(p,{open:T,onOpenChange:R,children:Y}),t[36]=T,t[37]=Y,t[38]=R,t[39]=X):X=t[39],X}function S(e){return e.status===`running`}function C(e){return e.language}export{x as WorkDiscoveryOverlay};
|