@xopcai/xopc 0.0.179 → 0.0.180
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-A5FUMjeV.js → activity-store-DFKtQDgE.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-NghNiDWx.js → agent-avatar-dicebear-CcTvB_4W.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Baq8Shzy.js → agents-DgGj9bu6.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Bmzslx0Z.js → api-CUClAvuL.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DDWS_BBJ.js → app-management-settings-panel-Ib-cWKHM.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C6znvVtX.js → appearance-settings-CRSN8WuA.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-d-Y0Jbe1.js → apps-page-B5xahuT-.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-fvTZhPUr.js → archive-plugin-BBF9zspN.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BFEgvg-Q.js → attachment-load-D3QQfA7w.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BUYrvMmD.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CuI2bOc7.js → binary-plugins-D78XOjJ3.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Z_k8W0al.js → block-editor-D_VVXlYX.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CGApoYPr.js → browser-settings-page-Cjw07q9h.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-gs6b5e9-.js → browser-workflow-inputs-_gu08MA4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Cq5qXStp.js → browser-workflows-page-58DBMXgG.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BC-8n4Hl.js → capabilities-settings-panel-D_dfVxHY.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-BTKhPoDC.js → capability-presets-api-DhCn9rPv.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-D7WQ0oBN.js → capability-presets-settings-panel-LWWIYUT7.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-TwMak0SE.js → channel-recipient-api-DYtoNV5A.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-DysELlO_.js → channels-settings-Cyj5OunL.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-TEFnV0IG.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-DBKotvNr.js → connector-logo-CxIXnifA.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-QH-0WnOo.js → connectors-page-0TobCpBB.js} +2 -2
- package/dist/gateway/static/root/assets/{desktop-pet-Dwml8znf.js → desktop-pet-CwVSLL6N.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CyIg2jJp.js → desktop-pet-settings-BOIp4q0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B6fc_7SL.js → directory-picker-path-field-C8_lsW6S.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CUQxGnDf.js → dreaming-settings-Da9FeWQl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-AbRNi2ON.js → extension-debug-page-CMNnSJP6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-ClYfiLXC.js → extension-page-t0pJqLvM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BGVP2hw1.js → extension-settings-page-aiR-tKnW.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-B7GqtklK.js → gateway-config-api-CkyQBD6r.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BMeK8igT.js → gateway-settings-BIZfAgfB.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CKKL96r_.js → gateway-startup-retry-CSU7UvzG.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-Dj0ao2qA.js → goals-settings-Dx9uTyWF.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CTI2nPKa.js → heartbeat-settings-Cnr5ORXL.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BY3VQ5Mv.js → image-generation-api-BR6Kb77X.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BDzspHrg.js → index-BA56bQ68.js} +8 -8
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CELtDFz3.js → keyboard-shortcuts-settings-D76uYKeQ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-m8CTSGix.js → local-app-workbench-page-DSUNtLHg.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CF5uUd1n.js → local-apps-page-BsLnojTh.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DIVc0AQs.js → locale-store-BNC8HUCI.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DmH7Tk4k.js → logs-page-yI8kpQtO.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CN85EdB8.js → markdown-split-D6smTQWD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CxYEc-b8.js → media-plugins-D1TmMF0A.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DYqBwJAK.js → messages-H_iJjnEM.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-Goab4781.js → notes-page-Vt-diFf0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-C4jDBVBN.js → notes-workbench-BD297EZt.js} +2 -2
- package/dist/gateway/static/root/assets/{outcome-detail-page-DNRfeLZp.js → outcome-detail-page-C5i_ZR9a.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-tQNQcAts.js → page-tabs-BnSzIjH0.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BSTlgsDB.js → preview-open-alternatives-CF12Eqi4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-iQ5gTCip.js → product-open-page-Du0TE_CU.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-D7anK-eu.js → project-detail-page-D1HGz7Dy.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BePESKWy.js → projects-page-CqP2TnW-.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CHrzBKIs.js → remote-access-hub-BXdVJLS3.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-BsPf5Gkk.js → save-bar-controls-B53UNtDM.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-kAytH7mq.js → schedule-field-C3dIMN5q.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-Bbw8l2ri.js → schema-form-BKvpxqof.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-He5YAczL.js → sessions-page-CPAwDdl5.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C-jGsoft.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BqbibcnJ.js → settings-form-section-kt6GIS32.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DNLNCEGT.js → settings-loading-skeleton-85eUPcKz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BR6Ss0bK.js → settings-page-Di5x6Xrc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-Cdb1e2Cz.js → settings-page-layout-CkkCee_x.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-moT-D-ia.js → setup-status-panel-uxEE6gAB.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CkrASny2.js → share-preview-page-BtLEstaI.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-X49zY21H.js → shares-settings-2mcsMWgn.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-ocDwsrEt.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-9_jfsFU5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BG5dGkyA.js → skills-page.utils-C2SHvq8V.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-XdY8eyYf.js → system-settings-panel-CIJ66cUy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DtwI_VLT.js → theme-store-ClDa_Bci.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-UghsQu_I.js → time-picker-D0zAsHOo.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DOnpwsrE.js → typed-models-lib-GsmwmB40.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-BWDtfNvQ.js → use-channel-catalog-BQz3K7xj.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-BtNBEtKj.js → user-context-page-Bn4BLg4W.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DP80jW-W.js → voice-api-key-field-Blaxsbb3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-copy-hQmivDgT.js → work-copy-Cwyan9Sn.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CkDOVZBr.js → work-discovery-page-iJ9RBSpu.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-CqvkcFcR.js → work-item-detail-page-CqTH7PQX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-page-BL8TZW4Z.js → work-page-H3m99ccS.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BLlVqKdA.js → workflow-run-setup-panel-CTG4RpRE.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BgsdRu3_.js → workflows-page-BxZSKMfv.js} +1 -1
- package/dist/gateway/static/root/index.html +6 -6
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +4 -1
- package/dist/src/agent/agent-manager.js +21 -7
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
- package/dist/src/agent/embedded/run-for-session.js +3 -1
- package/dist/src/agent/goals/post-turn.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +6 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +5 -2
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +2 -0
- package/dist/src/agent/lifecycle/timeout-wrapper.js +39 -9
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +6 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +2 -0
- package/dist/src/agent/mcp/mcp-transport-config.js +10 -3
- package/dist/src/agent/mcp/mcp-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-transport.js +5 -2
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +6 -2
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -0
- package/dist/src/agent/service/process-direct-one-shot.js +4 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +6 -0
- package/dist/src/agent/skills/filesystem-watcher.d.ts +4 -0
- package/dist/src/agent/skills/filesystem-watcher.js +16 -7
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.d.ts +10 -7
- package/dist/src/agent/skills/index.js +56 -47
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.d.ts +5 -2
- package/dist/src/agent/skills/skill-manager.js +10 -5
- package/dist/src/agent/skills/skill-sources.d.ts +18 -0
- package/dist/src/agent/skills/skill-sources.js +143 -0
- package/dist/src/agent/skills/types.d.ts +25 -2
- package/dist/src/agent/tools/delegate-tool.js +2 -1
- package/dist/src/agent/tools/executor.d.ts +2 -0
- package/dist/src/agent/tools/executor.js +18 -11
- package/dist/src/agent/tools/factory.js +2 -0
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/managed-job-tool.d.ts +2 -0
- package/dist/src/agent/tools/managed-job-tool.js +160 -0
- package/dist/src/agent/workspace-runtime/registry.d.ts +3 -0
- package/dist/src/agent/workspace-runtime/registry.js +3 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/auth/credentials.d.ts +9 -1
- package/dist/src/auth/credentials.js +112 -56
- package/dist/src/auth/model-credential-store.js +7 -22
- package/dist/src/auth/oauth-provider-lock.d.ts +5 -0
- package/dist/src/auth/oauth-provider-lock.js +91 -0
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/defaults.d.ts +8 -1
- package/dist/src/automations/domain/defaults.js +9 -2
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +33 -7
- package/dist/src/automations/domain/validation.d.ts +8 -0
- package/dist/src/automations/domain/validation.js +2 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +144 -34
- package/dist/src/automations/service/automation-service.d.ts +4 -0
- package/dist/src/automations/service/automation-service.js +197 -18
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +37 -7
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/utils/oauth-login.js +1 -7
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +3 -0
- package/dist/src/config/schema.js +2 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/oauth-async.js +1 -7
- package/dist/src/gateway/hono/oauth.js +1 -7
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/you.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +3 -3
- package/dist/src/goals/goal-workflow-judge.js +1 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/projects/project-loop.js +3 -3
- package/dist/src/providers/auth-runtime/oauth.js +12 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/storage/sqlite/migrations/088_automation_execution_deadlines.sql +5 -0
- package/dist/src/storage/sqlite/migrations/089_automation_run_leases.sql +8 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +2 -0
- package/dist/src/tui/backends/embedded-backend.js +11 -7
- package/dist/src/tui/tui-backend.d.ts +2 -0
- package/dist/src/tui/tui-oauth-login.js +1 -7
- package/dist/src/tui/tui-picker-overlay.js +1 -0
- package/dist/src/tui/tui-picker-services.d.ts +1 -0
- package/dist/src/tui/tui-skills-autocomplete.d.ts +6 -2
- package/dist/src/tui/tui-skills-autocomplete.js +10 -6
- package/dist/src/tui/tui-startup-resources.d.ts +3 -1
- package/dist/src/tui/tui-startup-resources.js +4 -3
- package/dist/src/tui/tui.js +4 -1
- package/dist/src/work/home-query-service.d.ts +31 -2
- package/dist/src/work/home-query-service.js +4 -4
- package/dist/src/work/index.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +3 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/automations-page-CFYOCBlQ.js +0 -6
- package/dist/gateway/static/root/assets/channels-status-swr-BAC-R8IK.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-2eAC9GCP.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CjpnFfOH.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DEwfSOUE.js +0 -2
|
@@ -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,l as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{t as c}from"./messages-DYqBwJAK.js";import{n as l}from"./locale-store-DIVc0AQs.js";import{i as u}from"./vendor-swr-BIWyz7Rc.js";import{$n as d,$t as f,Bt as p,Cu as m,Do as h,El as g,Go as _,Gt as v,Ho as y,Ht as b,Js as x,Jt as S,Ko as C,Kt as w,Lc as T,Ou as E,Ps as D,Qt as O,Ts as k,Uo as A,Us as j,Ut as M,Vo as N,Vt as P,Wo as F,Ws as I,Wt as L,Xl as R,Xt as z,Yl as B,Yo as V,Yt as H,Zt as U,_u as W,an as G,as as K,cc as ee,cn as te,dl as ne,ds as re,du as ie,en as ae,eo as q,fc as oe,fn as J,gu as Y,ht as X,in as se,is as ce,iu as le,jc as ue,js as Z,lu as de,mc as fe,mu as pe,nn as me,on as he,pn as ge,qo as _e,qt as ve,rn as ye,sn as be,tn as xe,un as Se,us as Ce,wc as we,wl as Te,zc as Ee,zs as De,zt as Oe}from"./index-BDzspHrg.js";import{t as ke}from"./page-tabs-tQNQcAts.js";import{t as Ae}from"./time-picker-UghsQu_I.js";import{D as je,O as Me,t as Ne}from"./connector-logo-DBKotvNr.js";var Pe=n(),Q=e(t(),1),$=r();function Fe(e){let t=(0,Pe.c)(104),{value:n,onChange:r,labels:i,language:a,inputClassName:o}=e,c;t[0]===n.timezone?c=t[1]:(c=()=>J.some(e=>e.value===n.timezone)?``:n.timezone,t[0]=n.timezone,t[1]=c);let[l,u]=(0,Q.useState)(c),d;t[2]===n.timezone?d=t[3]:(d=()=>!!n.timezone&&!J.some(e=>e.value===n.timezone),t[2]=n.timezone,t[3]=d);let[f,p]=(0,Q.useState)(d),m;t[4]===n.pronouns?m=t[5]:(m=()=>!!n.pronouns&&!Se.some(e=>e.value===n.pronouns),t[4]=n.pronouns,t[5]=m);let[h,g]=(0,Q.useState)(m),_;bb0:{if(f){_=`__custom__`;break bb0}_=J.some(e=>e.value===n.timezone)?n.timezone:`__custom__`}let v=_,y;t[6]!==r||t[7]!==n?(y=e=>r({...n,...e}),t[6]=r,t[7]=n,t[8]=y):y=t[8];let b=y,x;t[9]===a?x=t[10]:(x=(e,t)=>a===`zh`?t:e,t[9]=a,t[10]=x);let S=x,C;t[11]===i.callName?C=t[12]:(C=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.callName}),t[11]=i.callName,t[12]=C);let w;t[13]===b?w=t[14]:(w=e=>b({callName:e.target.value}),t[13]=b,t[14]=w);let T;t[15]!==o||t[16]!==i.callNamePlaceholder||t[17]!==w||t[18]!==n.callName?(T=(0,$.jsx)(`input`,{className:o,value:n.callName,onChange:w,placeholder:i.callNamePlaceholder,autoComplete:`off`}),t[15]=o,t[16]=i.callNamePlaceholder,t[17]=w,t[18]=n.callName,t[19]=T):T=t[19];let E;t[20]!==C||t[21]!==T?(E=(0,$.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[C,T]}),t[20]=C,t[21]=T,t[22]=E):E=t[22];let D;t[23]===i.pronouns?D=t[24]:(D=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.pronouns}),t[23]=i.pronouns,t[24]=D);let O=h?`__custom__`:n.pronouns,A;t[25]!==b||t[26]!==n.pronouns?(A=e=>{if(e.target.value===`__custom__`){g(!0),Se.some(e=>e.value===n.pronouns)&&b({pronouns:``});return}g(!1),b({pronouns:e.target.value})},t[25]=b,t[26]=n.pronouns,t[27]=A):A=t[27];let j;t[28]===i.pronounsPlaceholder?j=t[29]:(j=(0,$.jsx)(K,{value:``,children:i.pronounsPlaceholder}),t[28]=i.pronounsPlaceholder,t[29]=j);let M;t[30]===S?M=t[31]:(M=Se.map(e=>(0,$.jsx)(K,{value:e.value,children:S(e.labelEn,e.labelZh)},e.value)),t[30]=S,t[31]=M);let N;t[32]===i.custom?N=t[33]:(N=(0,$.jsx)(K,{value:`__custom__`,children:i.custom}),t[32]=i.custom,t[33]=N);let P;t[34]!==o||t[35]!==O||t[36]!==A||t[37]!==j||t[38]!==M||t[39]!==N?(P=(0,$.jsxs)(ce,{className:o,value:O,onChange:A,children:[j,M,N]}),t[34]=o,t[35]=O,t[36]=A,t[37]=j,t[38]=M,t[39]=N,t[40]=P):P=t[40];let F;t[41]!==o||t[42]!==i.pronounsPlaceholder||t[43]!==h||t[44]!==b||t[45]!==n.pronouns?(F=h?(0,$.jsx)(`input`,{className:s(o,`mt-1 text-xs`),value:n.pronouns,onChange:e=>b({pronouns:e.target.value}),placeholder:i.pronounsPlaceholder,autoComplete:`off`}):null,t[41]=o,t[42]=i.pronounsPlaceholder,t[43]=h,t[44]=b,t[45]=n.pronouns,t[46]=F):F=t[46];let I;t[47]!==D||t[48]!==P||t[49]!==F?(I=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[D,P,F]}),t[47]=D,t[48]=P,t[49]=F,t[50]=I):I=t[50];let L;t[51]===i.timezone?L=t[52]:(L=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[51]=i.timezone,t[52]=L);let R;t[53]===o?R=t[54]:(R=s(o,`min-w-0 flex-1`),t[53]=o,t[54]=R);let z;t[55]===b?z=t[56]:(z=e=>{if(e.target.value===`__custom__`){p(!0);return}p(!1),u(``),b({timezone:e.target.value})},t[55]=b,t[56]=z);let B;t[57]===S?B=t[58]:(B=J.map(e=>(0,$.jsx)(K,{value:e.value,children:S(e.labelEn,e.labelZh)},e.value)),t[57]=S,t[58]=B);let V;t[59]===i.timezoneCustom?V=t[60]:(V=(0,$.jsx)(K,{value:`__custom__`,children:i.timezoneCustom}),t[59]=i.timezoneCustom,t[60]=V);let H;t[61]!==R||t[62]!==z||t[63]!==B||t[64]!==V||t[65]!==v?(H=(0,$.jsxs)(ce,{className:R,value:v,onChange:z,children:[B,V]}),t[61]=R,t[62]=z,t[63]=B,t[64]=V,t[65]=v,t[66]=H):H=t[66];let U;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(U=s(`shrink-0 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,k.press),t[67]=U):U=t[67];let W;t[68]===b?W=t[69]:(W=()=>{let e=ge();if(!e)return;let t=J.some(t=>t.value===e);p(!t),u(t?``:e),b({timezone:e})},t[68]=b,t[69]=W);let G;t[70]!==i.timezoneDetect||t[71]!==W?(G=(0,$.jsx)(`button`,{type:`button`,className:U,onClick:W,children:i.timezoneDetect}),t[70]=i.timezoneDetect,t[71]=W,t[72]=G):G=t[72];let ee;t[73]!==H||t[74]!==G?(ee=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:[H,G]}),t[73]=H,t[74]=G,t[75]=ee):ee=t[75];let te;t[76]!==l||t[77]!==o||t[78]!==f||t[79]!==b?(te=f?(0,$.jsx)(`input`,{className:s(o,`mt-1 font-mono text-xs`),value:l,onChange:e=>{u(e.target.value),b({timezone:e.target.value})},placeholder:`e.g. Asia/Shanghai`,autoComplete:`off`}):null,t[76]=l,t[77]=o,t[78]=f,t[79]=b,t[80]=te):te=t[80];let ne;t[81]!==L||t[82]!==ee||t[83]!==te?(ne=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[L,ee,te]}),t[81]=L,t[82]=ee,t[83]=te,t[84]=ne):ne=t[84];let re;t[85]===i.notes?re=t[86]:(re=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.notes}),t[85]=i.notes,t[86]=re);let ie;t[87]===o?ie=t[88]:(ie=s(o,`min-h-28 resize-y text-sm leading-relaxed`),t[87]=o,t[88]=ie);let ae;t[89]===b?ae=t[90]:(ae=e=>b({notes:e.target.value}),t[89]=b,t[90]=ae);let q;t[91]!==i.notesPlaceholder||t[92]!==ie||t[93]!==ae||t[94]!==n.notes?(q=(0,$.jsx)(`textarea`,{className:ie,value:n.notes,onChange:ae,placeholder:i.notesPlaceholder,rows:5,spellCheck:!0}),t[91]=i.notesPlaceholder,t[92]=ie,t[93]=ae,t[94]=n.notes,t[95]=q):q=t[95];let oe;t[96]!==re||t[97]!==q?(oe=(0,$.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[re,q]}),t[96]=re,t[97]=q,t[98]=oe):oe=t[98];let Y;return t[99]!==E||t[100]!==I||t[101]!==ne||t[102]!==oe?(Y=(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[E,I,ne,oe]}),t[99]=E,t[100]=I,t[101]=ne,t[102]=oe,t[103]=Y):Y=t[103],Y}function Ie(e){let t=(0,Pe.c)(57),{open:n,t:r,onOpenChange:i,onNavigate:a}=e,o;t[0]!==r.helpLearningBody||t[1]!==r.helpLearningTitle?(o={icon:m,title:r.helpLearningTitle,body:r.helpLearningBody},t[0]=r.helpLearningBody,t[1]=r.helpLearningTitle,t[2]=o):o=t[2];let c;t[3]!==r.helpSharingBody||t[4]!==r.helpSharingTitle?(c={icon:De,title:r.helpSharingTitle,body:r.helpSharingBody},t[3]=r.helpSharingBody,t[4]=r.helpSharingTitle,t[5]=c):c=t[5];let l;t[6]!==r.helpSourcesBody||t[7]!==r.helpSourcesTitle?(l={icon:R,title:r.helpSourcesTitle,body:r.helpSourcesBody},t[6]=r.helpSourcesBody,t[7]=r.helpSourcesTitle,t[8]=l):l=t[8];let u;t[9]!==r.helpControlBody||t[10]!==r.helpControlTitle?(u={icon:oe,title:r.helpControlTitle,body:r.helpControlBody},t[9]=r.helpControlBody,t[10]=r.helpControlTitle,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==c||t[14]!==l||t[15]!==u?(d=[o,c,l,u],t[12]=o,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16];let f=d,p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(_,{className:s(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,re)}),t[17]=p):p=t[17];let h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=s(`fixed right-3 top-1/2 flex h-[min(44rem,calc(100dvh-1.5rem))] w-[min(30rem,calc(100vw-1.5rem))] -translate-y-1/2 flex-col overflow-hidden`,Ce,`rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`),t[18]=h):h=t[18];let g;t[19]===r.helpTitle?g=t[20]:(g=(0,$.jsx)(_e,{className:`text-base font-semibold text-fg`,children:r.helpTitle}),t[19]=r.helpTitle,t[20]=g);let v;t[21]===r.helpSubtitle?v=t[22]:(v=(0,$.jsx)(F,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r.helpSubtitle}),t[21]=r.helpSubtitle,t[22]=v);let b;t[23]!==g||t[24]!==v?(b=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[g,v]}),t[23]=g,t[24]=v,t[25]=b):b=t[25];let x;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[26]=x):x=t[26];let S;t[27]===r.close?S=t[28]:(S=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":r.close,children:x})}),t[27]=r.close,t[28]=S);let w;t[29]!==b||t[30]!==S?(w=(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[b,S]}),t[29]=b,t[30]=S,t[31]=w):w=t[31];let T;t[32]===f?T=t[33]:(T=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-2`,children:f.map(Le)}),t[32]=f,t[33]=T);let E;t[34]!==a||t[35]!==i?(E=()=>{i(!1),a(`sources`)},t[34]=a,t[35]=i,t[36]=E):E=t[36];let O;t[37]!==r.tabs.sources||t[38]!==E?(O=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,onClick:E,children:r.tabs.sources}),t[37]=r.tabs.sources,t[38]=E,t[39]=O):O=t[39];let k;t[40]!==a||t[41]!==i?(k=()=>{i(!1),a(`privacy`)},t[40]=a,t[41]=i,t[42]=k):k=t[42];let j;t[43]!==r.openPrivacyControls||t[44]!==k?(j=(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:k,children:r.openPrivacyControls}),t[43]=r.openPrivacyControls,t[44]=k,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==j?(M=(0,$.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[O,j]}),t[46]=O,t[47]=j,t[48]=M):M=t[48];let P;t[49]!==w||t[50]!==T||t[51]!==M?(P=(0,$.jsxs)(C,{children:[p,(0,$.jsxs)(A,{className:h,children:[w,T,M]})]}),t[49]=w,t[50]=T,t[51]=M,t[52]=P):P=t[52];let I;return t[53]!==i||t[54]!==n||t[55]!==P?(I=(0,$.jsx)(N,{open:n,onOpenChange:i,children:P}),t[53]=i,t[54]=n,t[55]=P,t[56]=I):I=t[56],I}function Le(e){let{icon:t,title:n,body:r}=e;return(0,$.jsxs)(`section`,{className:`flex gap-3 border-b border-edge-subtle py-4 last:border-b-0`,children:[(0,$.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface-muted text-fg-muted`,children:(0,$.jsx)(t,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r})]})]},n)}function Re(e){let t=(0,Pe.c)(33),{source:n,language:r,busy:i,onOpenChange:a,onConfirm:o}=e,l=c(r).you,[u,d]=(0,Q.useState)(!1),f=n?.accountLabel??(n?.accountCount&&n.accountCount>1&&n.accountOrdinal?l.sourceAccountFallback.replace(`{{index}}`,String(n.accountOrdinal)).replace(`{{count}}`,String(n.accountCount)):void 0),p,m;t[0]===n?(p=t[1],m=t[2]):(p=()=>{n&&d(!1)},m=[n],t[0]=n,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h;t[3]!==i||t[4]!==a?(h=e=>!i&&a(e),t[3]=i,t[4]=a,t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[6]=g):g=t[6];let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[7]=v):v=t[7];let b;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>d(!1),t[8]=b):b=t[8];let S=u?`border-edge-subtle hover:bg-surface-hover`:`border-accent/40 bg-accent-soft/35`,w;t[9]===S?w=t[10]:(w=s(`flex w-full items-start gap-3 rounded-xl border p-4 text-left`,S),t[9]=S,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(R,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>d(!0),t[12]=E):E=t[12];let O=u?`border-danger/40 bg-danger-soft`:`border-edge-subtle hover:bg-surface-hover`,k;t[13]===O?k=t[14]:(k=s(`flex w-full items-start gap-3 rounded-xl border p-4 text-left disabled:cursor-not-allowed disabled:opacity-55`,O),t[13]=O,t[14]=k);let j;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-danger`,"aria-hidden":!0}),t[15]=j):j=t[15];let M=l.disconnectDeleteBody.replace(`{{count}}`,String(n?.derivedUnderstandingCount??0)),P;t[16]===M?P=t[17]:(P=(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:M}),t[16]=M,t[17]=P);let L;t[18]!==i||t[19]!==l.cancel?(L=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`ghost`,disabled:i,children:l.cancel})}),t[18]=i,t[19]=l.cancel,t[20]=L):L=t[20];let z=u?`border-danger/35 text-danger hover:bg-danger-soft`:void 0,B;t[21]!==u||t[22]!==o?(B=()=>o(u),t[21]=u,t[22]=o,t[23]=B):B=t[23];let V;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0}),t[24]=V):V=t[24];let H=i?l.disconnecting:l.disconnectAction,U;t[25]!==i||t[26]!==z||t[27]!==B||t[28]!==H?(U=(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:z,disabled:i,onClick:B,children:[V,H]}),t[25]=i,t[26]=z,t[27]=B,t[28]=H,t[29]=U):U=t[29];let W;return t[30]!==L||t[31]!==U?(W=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:[L,U]}),t[30]=L,t[31]=U,t[32]=W):W=t[32],(0,$.jsx)(N,{open:n!==null,onOpenChange:h,children:(0,$.jsxs)(C,{children:[g,(0,$.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[131] flex h-[min(31rem,calc(100dvh-2rem))] w-[min(32rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-elevated`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(_e,{className:`text-base font-semibold text-fg`,children:l.disconnectTitle}),(0,$.jsx)(F,{className:`mt-1 text-sm text-fg-muted`,children:l.disconnectBody.replace(`{{source}}`,n?.displayName??``)})]}),(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":l.cancel,disabled:i,children:v})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-muted px-4 py-3 text-xs leading-5 text-fg-muted`,children:[f?(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:l.disconnectAccount.replace(`{{account}}`,f)}):null,(0,$.jsx)(`p`,{children:l.disconnectImpact.replace(`{{items}}`,String(n?.knowledgeItemCount??0)).replace(`{{understandings}}`,String(n?.derivedUnderstandingCount??0))})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":!u,onClick:b,className:w,children:[T,(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:l.disconnectKeepTitle}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:l.disconnectKeepBody})]})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":u,onClick:E,disabled:!n?.derivedUnderstandingCount,className:k,children:[j,(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:l.disconnectDeleteTitle}),P]})]})]}),W]})]})})}var ze={"composio-gmail":`gmail`,"composio-googledrive":`google-drive`,"composio-notion":`notion`,"composio-slack":`slack`,memory:`memory`};function Be(e){if(e.branding?.logoUrl)return e.branding;let t=ze[e.id];return t?{...e.branding,logoUrl:`/connector-icons/${t}.svg`}:e.branding}function Ve(e,t){return Object.entries(t).reduce((e,[t,n])=>e.replace(`{{${t}}}`,String(n)),e)}function He(e){return e.status===`active`||e.status===`connected`}function Ue(e,t){return!He(e)||e.learning?.status===`failed`||e.lastSyncStatus===`failed`?{summary:t.sourceNeedsAttention,tone:`attention`,badge:t.attentionTitle}:e.learning?.status===`paused`?{summary:t.sourcePausedSummary,tone:`paused`,badge:t.paused}:e.learning?.status===`queued`||e.learning?.status===`running`?{summary:t.sourceReading,tone:`learning`}:e.learningFunnel.provisionalClaims>0?{summary:Ve(t.sourcePendingReview,{count:e.learningFunnel.provisionalClaims}),tone:`review`}:e.learningFunnel.activeClaims>0?{summary:Ve(t.sourceReliable,{count:e.learningFunnel.activeClaims}),tone:`useful`}:e.learningFunnel.attributedItems>0?{summary:Ve(t.sourceStillLearning,{count:e.learningFunnel.attributedItems}),tone:`learning`}:e.learningFunnel.indexedItems>0?{summary:Ve(t.sourceNoPersonalSignal,{count:e.learningFunnel.indexedItems}),tone:`neutral`}:e.learning?.status===`completed`?{summary:t.sourceNoRecentSignal,tone:`neutral`}:{summary:t.sourcePreparing,tone:`learning`}}function We(e,t){let n=e.id.toLocaleLowerCase();return/(github|gitlab|linear|jira)/.test(n)?t.sourcePurposeWork:/(gmail|outlook|slack|teams)/.test(n)?t.sourcePurposeCommunication:/calendar/.test(n)?t.sourcePurposeSchedule:/(docs|drive|notion|sheets|excel|onedrive|one-drive|local-files)/.test(n)?t.sourcePurposeDocuments:t.sourcePurposeDefault}function Ge(e,t){return e.accountLabel?e.accountLabel:e.accountCount&&e.accountCount>1&&e.accountOrdinal?Ve(t.sourceAccountFallback,{index:e.accountOrdinal,count:e.accountCount}):t.sourceUnknownAccount}function Ke(e){return e.lastSyncAt??e.learning?.updatedAt??e.lastActivityAt??e.lastConnectedAt}function qe(e,t){let n=Date.parse(e);return Number.isFinite(n)?X(n,t):e}function Je(e,t){return{attention:0,learning:1,review:2,useful:3,paused:4,neutral:5}[Ue(e,t).tone]}function Ye(e){let t=(0,Pe.c)(173),{source:n,language:r,t:i,busy:a,onOpenChange:o,onLearn:c,onPause:l,onConfigure:u,onDisconnect:d,onViewUnderstanding:f}=e;if(!n)return null;let p;t[0]!==n||t[1]!==i?(p=Ue(n,i),t[0]=n,t[1]=i,t[2]=p):p=t[2];let h=p,g,v,b,x,S,w,T,E,O,k,j,M,P,L,R,z;if(t[3]!==r||t[4]!==o||t[5]!==f||t[6]!==h.summary||t[7]!==h.tone||t[8]!==n||t[9]!==i){let e=Ke(n);x=n.learning?.status===`paused`,S=h.tone===`attention`,b=N,T=!0,E=o,v=C,t[26]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[26]=w):w=t[26],g=A,R=`fixed inset-y-0 right-0 z-[131] flex h-dvh w-[min(34rem,100vw)] flex-col overflow-hidden border-l border-edge bg-surface-panel shadow-elevated`;let a=n.displayName,c;t[27]===n?c=t[28]:(c=Be(n),t[27]=n,t[28]=c);let l;t[29]!==n.displayName||t[30]!==c?(l=(0,$.jsx)(Ne,{connector:{displayName:a,branding:c},size:`sm`}),t[29]=n.displayName,t[30]=c,t[31]=l):l=t[31];let u;t[32]===n.displayName?u=t[33]:(u=(0,$.jsx)(_e,{className:`truncate text-base font-semibold text-fg`,children:n.displayName}),t[32]=n.displayName,t[33]=u);let d;t[34]!==n||t[35]!==i?(d=Ge(n,i),t[34]=n,t[35]=i,t[36]=d):d=t[36];let p;t[37]===d?p=t[38]:(p=(0,$.jsx)(F,{className:`mt-0.5 truncate text-sm text-fg-muted`,children:d}),t[37]=d,t[38]=p);let I;t[39]!==u||t[40]!==p?(I=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,p]}),t[39]=u,t[40]=p,t[41]=I):I=t[41];let B;t[42]!==l||t[43]!==I?(B=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[l,I]}),t[42]=l,t[43]=I,t[44]=B):B=t[44];let V;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[45]=V):V=t[45];let H;t[46]===i.close?H=t[47]:(H=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":i.close,children:V})}),t[46]=i.close,t[47]=H),t[48]!==B||t[49]!==H?(z=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[B,H]}),t[48]=B,t[49]=H,t[50]=z):z=t[50],P=`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`;let U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(m,{className:`size-4 text-accent`,"aria-hidden":!0}),t[51]=U):U=t[51];let G;t[52]===i.sourceOutcomeTitle?G=t[53]:(G=(0,$.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[U,i.sourceOutcomeTitle]}),t[52]=i.sourceOutcomeTitle,t[53]=G);let K=h.tone===`attention`?`border-warning/30 bg-warning-soft text-fg`:`border-edge-subtle bg-surface-muted text-fg`,ee;t[54]===K?ee=t[55]:(ee=s(`mt-3 rounded-xl border px-4 py-3 text-sm leading-6`,K),t[54]=K,t[55]=ee);let te;t[56]!==h.summary||t[57]!==ee?(te=(0,$.jsx)(`p`,{className:ee,children:h.summary}),t[56]=h.summary,t[57]=ee,t[58]=te):te=t[58];let ne;t[59]===n.learningFunnel.activeClaims?ne=t[60]:(ne=(0,$.jsx)(`strong`,{className:`text-xl font-semibold text-fg`,children:n.learningFunnel.activeClaims}),t[59]=n.learningFunnel.activeClaims,t[60]=ne);let re;t[61]===i.sourceReliableMetric?re=t[62]:(re=(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:i.sourceReliableMetric}),t[61]=i.sourceReliableMetric,t[62]=re);let ie;t[63]!==ne||t[64]!==re?(ie=(0,$.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-base px-4 py-3`,children:[ne,re]}),t[63]=ne,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]===n.learningFunnel.provisionalClaims?ae=t[67]:(ae=(0,$.jsx)(`strong`,{className:`text-xl font-semibold text-fg`,children:n.learningFunnel.provisionalClaims}),t[66]=n.learningFunnel.provisionalClaims,t[67]=ae);let q;t[68]===i.sourcePendingMetric?q=t[69]:(q=(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:i.sourcePendingMetric}),t[68]=i.sourcePendingMetric,t[69]=q);let oe;t[70]!==ae||t[71]!==q?(oe=(0,$.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-base px-4 py-3`,children:[ae,q]}),t[70]=ae,t[71]=q,t[72]=oe):oe=t[72];let J;t[73]!==ie||t[74]!==oe?(J=(0,$.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3`,children:[ie,oe]}),t[73]=ie,t[74]=oe,t[75]=J):J=t[75];let Y;t[76]!==f||t[77]!==n.learningFunnel.activeClaims||t[78]!==n.learningFunnel.provisionalClaims||t[79]!==i.sourceViewUnderstanding?(Y=n.learningFunnel.activeClaims>0||n.learningFunnel.provisionalClaims>0?(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`mt-2 px-2`,onClick:f,children:[i.sourceViewUnderstanding,(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]}):null,t[76]=f,t[77]=n.learningFunnel.activeClaims,t[78]=n.learningFunnel.provisionalClaims,t[79]=i.sourceViewUnderstanding,t[80]=Y):Y=t[80],t[81]!==G||t[82]!==te||t[83]!==J||t[84]!==Y?(L=(0,$.jsxs)(`section`,{children:[G,te,J,Y]}),t[81]=G,t[82]=te,t[83]=J,t[84]=Y,t[85]=L):L=t[85],O=`border-t border-edge-subtle pt-5`;let X;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(le,{className:`size-4 text-accent`,"aria-hidden":!0}),t[86]=X):X=t[86],t[87]===i.sourceRecentRunTitle?k=t[88]:(k=(0,$.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[X,i.sourceRecentRunTitle]}),t[87]=i.sourceRecentRunTitle,t[88]=k);let se;t[89]!==n.learningFunnel.activeClaims||t[90]!==n.learningFunnel.attributedItems||t[91]!==n.learningFunnel.indexedItems||t[92]!==i.sourceRecentRunSummary?(se=Ve(i.sourceRecentRunSummary,{indexed:n.learningFunnel.indexedItems,attributed:n.learningFunnel.attributedItems,claims:n.learningFunnel.activeClaims}),t[89]=n.learningFunnel.activeClaims,t[90]=n.learningFunnel.attributedItems,t[91]=n.learningFunnel.indexedItems,t[92]=i.sourceRecentRunSummary,t[93]=se):se=t[93],t[94]===se?j=t[95]:(j=(0,$.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-fg-muted`,children:se}),t[94]=se,t[95]=j),M=e?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:Ve(i.sourceUpdatedAt,{time:qe(e,r)})}):null,t[3]=r,t[4]=o,t[5]=f,t[6]=h.summary,t[7]=h.tone,t[8]=n,t[9]=i,t[10]=g,t[11]=v,t[12]=b,t[13]=x,t[14]=S,t[15]=w,t[16]=T,t[17]=E,t[18]=O,t[19]=k,t[20]=j,t[21]=M,t[22]=P,t[23]=L,t[24]=R,t[25]=z}else g=t[10],v=t[11],b=t[12],x=t[13],S=t[14],w=t[15],T=t[16],E=t[17],O=t[18],k=t[19],j=t[20],M=t[21],P=t[22],L=t[23],R=t[24],z=t[25];let B;t[96]!==O||t[97]!==k||t[98]!==j||t[99]!==M?(B=(0,$.jsxs)(`section`,{className:O,children:[k,j,M]}),t[96]=O,t[97]=k,t[98]=j,t[99]=M,t[100]=B):B=t[100];let V;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(oe,{className:`size-4 text-accent`,"aria-hidden":!0}),t[101]=V):V=t[101];let H;t[102]===i.sourceAccessTitle?H=t[103]:(H=(0,$.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[V,i.sourceAccessTitle]}),t[102]=i.sourceAccessTitle,t[103]=H);let U;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(pe,{className:`mt-1 size-4 shrink-0 text-success`,"aria-hidden":!0}),t[104]=U):U=t[104];let G;t[105]===i.sourceReadAccess?G=t[106]:(G=(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[U,(0,$.jsx)(`span`,{children:i.sourceReadAccess})]}),t[105]=i.sourceReadAccess,t[106]=G);let K;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(pe,{className:`mt-1 size-4 shrink-0 text-success`,"aria-hidden":!0}),t[107]=K):K=t[107];let te;t[108]===i.sourceMemoryAccess?te=t[109]:(te=(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[K,(0,$.jsx)(`span`,{children:i.sourceMemoryAccess})]}),t[108]=i.sourceMemoryAccess,t[109]=te);let ne;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(oe,{className:`mt-1 size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[110]=ne):ne=t[110];let re=n.access.write?i.sourceWriteAccess:i.sourceNoWriteAccess,ie;t[111]===re?ie=t[112]:(ie=(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[ne,(0,$.jsx)(`span`,{children:re})]}),t[111]=re,t[112]=ie);let ae;t[113]!==G||t[114]!==te||t[115]!==ie?(ae=(0,$.jsxs)(`ul`,{className:`mt-3 space-y-2 text-sm leading-6 text-fg-muted`,children:[G,te,ie]}),t[113]=G,t[114]=te,t[115]=ie,t[116]=ae):ae=t[116];let q;t[117]!==H||t[118]!==ae?(q=(0,$.jsxs)(`section`,{className:`border-t border-edge-subtle pt-5`,children:[H,ae]}),t[117]=H,t[118]=ae,t[119]=q):q=t[119];let J;t[120]!==B||t[121]!==q||t[122]!==P||t[123]!==L?(J=(0,$.jsxs)(`div`,{className:P,children:[L,B,q]}),t[120]=B,t[121]=q,t[122]=P,t[123]=L,t[124]=J):J=t[124];let Y;t[125]===i.sourceManagementTitle?Y=t[126]:(Y=(0,$.jsx)(`p`,{className:`mb-2 px-1 text-xs font-medium text-fg-subtle`,children:i.sourceManagementTitle}),t[125]=i.sourceManagementTitle,t[126]=Y);let X;t[127]!==a||t[128]!==x||t[129]!==S||t[130]!==c||t[131]!==l||t[132]!==n||t[133]!==i.sourcePauseLearning||t[134]!==i.sourceResumeLearning||t[135]!==i.sourceRetryLearning?(X=He(n)?x||S?(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:a,onClick:()=>c(n),children:[a?(0,$.jsx)(we,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),S?i.sourceRetryLearning:i.sourceResumeLearning]}):(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:a,onClick:()=>l(n),children:[(0,$.jsx)(Ee,{className:`size-4`,"aria-hidden":!0}),i.sourcePauseLearning]}):null,t[127]=a,t[128]=x,t[129]=S,t[130]=c,t[131]=l,t[132]=n,t[133]=i.sourcePauseLearning,t[134]=i.sourceResumeLearning,t[135]=i.sourceRetryLearning,t[136]=X):X=t[136];let se;t[137]!==u||t[138]!==n?(se=()=>u(n),t[137]=u,t[138]=n,t[139]=se):se=t[139];let ce;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),t[140]=ce):ce=t[140];let ue;t[141]!==i.sourceConnectionSettings||t[142]!==se?(ue=(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:se,children:[ce,i.sourceConnectionSettings]}),t[141]=i.sourceConnectionSettings,t[142]=se,t[143]=ue):ue=t[143];let de;t[144]!==d||t[145]!==n?(de=()=>d(n),t[144]=d,t[145]=n,t[146]=de):de=t[146];let me;t[147]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0}),t[147]=me):me=t[147];let he;t[148]!==i.disconnect||t[149]!==de?(he=(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`ml-auto text-danger hover:bg-danger-soft hover:text-danger`,onClick:de,children:[me,i.disconnect]}),t[148]=i.disconnect,t[149]=de,t[150]=he):he=t[150];let ge;t[151]!==X||t[152]!==ue||t[153]!==he?(ge=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[X,ue,he]}),t[151]=X,t[152]=ue,t[153]=he,t[154]=ge):ge=t[154];let ve;t[155]!==Y||t[156]!==ge?(ve=(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle p-4`,children:[Y,ge]}),t[155]=Y,t[156]=ge,t[157]=ve):ve=t[157];let ye;t[158]!==g||t[159]!==J||t[160]!==ve||t[161]!==R||t[162]!==z?(ye=(0,$.jsxs)(g,{className:R,children:[z,J,ve]}),t[158]=g,t[159]=J,t[160]=ve,t[161]=R,t[162]=z,t[163]=ye):ye=t[163];let be;t[164]!==v||t[165]!==w||t[166]!==ye?(be=(0,$.jsxs)(v,{children:[w,ye]}),t[164]=v,t[165]=w,t[166]=ye,t[167]=be):be=t[167];let xe;return t[168]!==b||t[169]!==T||t[170]!==E||t[171]!==be?(xe=(0,$.jsx)(b,{open:T,onOpenChange:E,children:be}),t[168]=b,t[169]=T,t[170]=E,t[171]=be,t[172]=xe):xe=t[172],xe}function Xe(e){let t=(0,Pe.c)(69),{sources:n,language:r,t:i,busyId:a,onAddSource:o,onLearn:c,onPause:l,onConfigure:u,onDisconnect:d,onViewUnderstanding:f}=e,[p,m]=(0,Q.useState)(null),h;if(t[0]!==n||t[1]!==i){let e=n.filter(Qe),r=new Map;for(let t of e){let e=r.get(t.id)??[];e.push(t),r.set(t.id,e)}let a;t[3]===i?a=t[4]:(a=(e,t)=>Math.min(...e.accounts.map(e=>Je(e,i)))-Math.min(...t.accounts.map(e=>Je(e,i)))||e.source.displayName.localeCompare(t.source.displayName),t[3]=i,t[4]=a),h=[...r.values()].map(e=>({source:e[0],accounts:e.sort((e,t)=>Je(e,i)-Je(t,i)||Ge(e,i).localeCompare(Ge(t,i)))})).sort(a),t[0]=n,t[1]=i,t[2]=h}else h=t[2];let g=h,_,v,y,b,x,S,C,w,T;if(t[5]!==g||t[6]!==p||t[7]!==n||t[8]!==i.sourceConnectedSummary||t[9]!==i.sourcesSubtitle||t[10]!==i.sourcesTitle){let e=g.reduce(Ze,0),r;t[20]!==p||t[21]!==n?(r=p?n.find(e=>e.instanceId===p)??null:null,t[20]=p,t[21]=n,t[22]=r):r=t[22],_=r,S=`you-panel-sources`,C=`tabpanel`,w=`you-tab-sources`,T=`space-y-5`,x=`flex flex-wrap items-start justify-between gap-3`,t[23]===i.sourcesTitle?v=t[24]:(v=(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:i.sourcesTitle}),t[23]=i.sourcesTitle,t[24]=v),t[25]===i.sourcesSubtitle?y=t[26]:(y=(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:i.sourcesSubtitle}),t[25]=i.sourcesSubtitle,t[26]=y),b=g.length>0?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:Ve(i.sourceConnectedSummary,{accounts:e,sources:g.length})}):null,t[5]=g,t[6]=p,t[7]=n,t[8]=i.sourceConnectedSummary,t[9]=i.sourcesSubtitle,t[10]=i.sourcesTitle,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=S,t[17]=C,t[18]=w,t[19]=T}else _=t[11],v=t[12],y=t[13],b=t[14],x=t[15],S=t[16],C=t[17],w=t[18],T=t[19];let E;t[27]!==v||t[28]!==y||t[29]!==b?(E=(0,$.jsxs)(`div`,{children:[v,y,b]}),t[27]=v,t[28]=y,t[29]=b,t[30]=E):E=t[30];let D;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(ue,{className:`size-4`,"aria-hidden":!0}),t[31]=D):D=t[31];let O;t[32]!==o||t[33]!==i.addSource?(O=(0,$.jsxs)(Z,{type:`button`,variant:`primary`,onClick:o,children:[D,i.addSource]}),t[32]=o,t[33]=i.addSource,t[34]=O):O=t[34];let k;t[35]!==E||t[36]!==O||t[37]!==x?(k=(0,$.jsxs)(`div`,{className:x,children:[E,O]}),t[35]=E,t[36]=O,t[37]=x,t[38]=k):k=t[38];let A;t[39]!==g||t[40]!==r||t[41]!==o||t[42]!==i?(A=g.length>0?(0,$.jsx)(`div`,{className:`space-y-3`,children:g.map(e=>{let{source:t,accounts:n}=e;return(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-edge-subtle px-4 py-3.5 sm:px-5`,children:[(0,$.jsx)(Ne,{connector:{displayName:t.displayName,branding:Be(t)},size:`sm`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.displayName}),n.length>1?(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:Ve(i.sourceAccountCount,{count:n.length})}):null]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:We(t,i)})]})]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>{let t=Ue(e,i),n=Ke(e);return(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/40 sm:px-5`,onClick:()=>m(e.instanceId??null),children:[(0,$.jsx)(`span`,{className:s(`size-2 shrink-0 rounded-full`,t.tone===`attention`?`bg-warning`:t.tone===`useful`?`bg-success`:t.tone===`learning`?`bg-accent`:`bg-fg-subtle/50`),"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:Ge(e,i)}),t.badge?(0,$.jsx)(`span`,{className:s(`rounded-full px-2 py-0.5 text-[11px] font-medium`,t.tone===`attention`?`bg-warning-soft text-fg`:`bg-surface-muted text-fg-muted`),children:t.badge}):null]}),(0,$.jsx)(`span`,{className:s(`mt-1 block text-xs leading-5`,t.tone===`attention`?`text-fg`:`text-fg-muted`),children:t.summary})]}),n?(0,$.jsx)(`span`,{className:`hidden shrink-0 text-xs text-fg-subtle sm:block`,children:Ve(i.sourceUpdatedAt,{time:qe(n,r)})}):null,(0,$.jsx)(W,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]},e.instanceId)})})]},t.id)})}):(0,$.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-edge p-10 text-center`,children:[(0,$.jsx)(Y,{className:`mx-auto size-5 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:i.noSources}),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:`mt-4`,onClick:o,children:[(0,$.jsx)(ue,{className:`size-4`,"aria-hidden":!0}),i.addSource]})]}),t[39]=g,t[40]=r,t[41]=o,t[42]=i,t[43]=A):A=t[43];let j=_?a===`source-learning:${_.instanceId}`:!1,M;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e||m(null)},t[44]=M):M=t[44];let N;t[45]===u?N=t[46]:(N=e=>{m(null),u(e)},t[45]=u,t[46]=N);let P;t[47]===d?P=t[48]:(P=e=>{m(null),d(e)},t[47]=d,t[48]=P);let F;t[49]===f?F=t[50]:(F=()=>{m(null),f()},t[49]=f,t[50]=F);let I;t[51]!==r||t[52]!==c||t[53]!==l||t[54]!==_||t[55]!==i||t[56]!==j||t[57]!==N||t[58]!==P||t[59]!==F?(I=(0,$.jsx)(Ye,{source:_,language:r,t:i,busy:j,onOpenChange:M,onLearn:c,onPause:l,onConfigure:N,onDisconnect:P,onViewUnderstanding:F}),t[51]=r,t[52]=c,t[53]=l,t[54]=_,t[55]=i,t[56]=j,t[57]=N,t[58]=P,t[59]=F,t[60]=I):I=t[60];let L;return t[61]!==k||t[62]!==A||t[63]!==I||t[64]!==S||t[65]!==C||t[66]!==w||t[67]!==T?(L=(0,$.jsxs)(`div`,{id:S,role:C,"aria-labelledby":w,className:T,children:[k,A,I]}),t[61]=k,t[62]=A,t[63]=I,t[64]=S,t[65]=C,t[66]=w,t[67]=T,t[68]=L):L=t[68],L}function Ze(e,t){return e+t.accounts.length}function Qe(e){return e.installed}var $e=new Set([`overview`,`memory`,`collaboration`,`sources`,`privacy`]);function et(e){return e&&$e.has(e)?e:`overview`}var tt=[`collaboration`,`priorities`,`boundaries`,`people`,`current`,`basics`],nt=[`relationship`,`routine`,`long_term_goal`],rt=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/50 focus:ring-2 focus:ring-accent/20`;function it(e,t){return e.replace(`{{count}}`,String(t))}function at(e){let t=(0,Pe.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`inline-flex rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function ot(e,t){let n=Date.parse(e);return Number.isFinite(n)?X(n,t):e}function st(){let e=(0,Pe.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(q,{className:`h-24 rounded-2xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[t,(0,$.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,$.jsx)(q,{className:`h-64 rounded-2xl`}),(0,$.jsx)(q,{className:`h-64 rounded-2xl`})]})]}),e[1]=n):n=e[1],n}function ct(e,t){return e.origin===`connected_source`?t.origins.connected_source.replace(`{{source}}`,e.sourceName):t.origins[e.origin]}function lt(e){let t=(0,Pe.c)(19),{item:n,language:r,t:i,busy:a,onConfirm:c,onReject:l,onUpdate:u,onForget:d}=e,[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(n.statement),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(!1),b=n.status!==`active`,S=b?`border-warning/35 bg-warning-soft/35`:`border-edge-subtle bg-surface-panel`,C;t[0]===S?C=t[1]:(C=s(`rounded-xl border p-3.5`,S),t[0]=S,t[1]=C);let E;t[2]!==a||t[3]!==m||t[4]!==f||t[5]!==g||t[6]!==v||t[7]!==n||t[8]!==r||t[9]!==b||t[10]!==c||t[11]!==d||t[12]!==l||t[13]!==u||t[14]!==i?(E=f?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`textarea`,{className:s(rt,`min-h-20 resize-y`),value:m,onChange:e=>h(e.target.value),placeholder:i.updatePlaceholder}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>{h(n.statement),p(!1)},children:i.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:a||!m.trim(),onClick:()=>{u(m.trim()),p(!1)},children:i.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:n.statement}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,$.jsx)(ee,{className:`size-3 text-accent`,"aria-hidden":!0}),ct(n,i)]}),(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5`,children:i.stability[n.stability]}),n.evidenceCount>0?(0,$.jsx)(`span`,{children:it(i.evidenceCount,n.evidenceCount)}):null,n.latestEvidenceAt?(0,$.jsx)(`span`,{children:i.observedAt.replace(`{{time}}`,ot(n.latestEvidenceAt,r))}):null]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:c,children:[(0,$.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),i.confirm]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:l,children:[(0,$.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),i.notTrue]})]}):null,(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:()=>p(!0),children:[(0,$.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),i.change]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:v,onClick:()=>{if(g){_(null);return}y(!0),w(n.id).then(e=>_(e.history)).finally(()=>y(!1))},children:[(0,$.jsx)(Te,{className:`size-3.5`,"aria-hidden":!0}),i.history]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:d,children:[(0,$.jsx)(x,{className:`size-3.5`,"aria-hidden":!0}),i.forget]})]})]}),(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-muted/70 px-3 py-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer font-medium text-fg-muted`,children:i.viewEvidence}),(0,$.jsxs)(`dl`,{className:`mt-2 grid gap-1.5 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceSource}),(0,$.jsx)(`dd`,{className:`mt-0.5 break-all text-fg-muted`,children:n.sourceName})]}),n.sourcePath?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidencePath}),(0,$.jsx)(`dd`,{className:`mt-0.5 break-all text-fg-muted`,children:n.sourcePath})]}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceUpdated}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:ot(n.updatedAt,r)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceSupport}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:it(i.evidenceCount,n.evidenceCount)})]}),n.evidenceBasis?(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceRule}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:i.evidenceRuleValue.replace(`{{events}}`,String(n.evidenceBasis.eventCount)).replace(`{{days}}`,String(n.evidenceBasis.activeDays)).replace(`{{window}}`,String(n.evidenceBasis.windowDays))})]}):null,n.confidence===void 0?null:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceConfidence}),(0,$.jsxs)(`dd`,{className:`mt-0.5 text-fg-muted`,children:[Math.round(n.confidence*100),`%`]})]}),n.validTo?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceValidUntil}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:ot(n.validTo,r)})]}):null,n.expiresAt?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceExpires}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:ot(n.expiresAt,r)})]}):null]})]}),g?(0,$.jsxs)(`div`,{className:`mt-2 space-y-2 border-t border-edge pt-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.historyTitle}),g.map(e=>(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3 text-xs`,children:[(0,$.jsx)(`p`,{className:`min-w-0 text-fg-muted`,children:e.statement}),(0,$.jsx)(`span`,{className:`shrink-0 text-fg-subtle`,children:ot(e.updatedAt,r)})]},e.id))]}):null]}),t[2]=a,t[3]=m,t[4]=f,t[5]=g,t[6]=v,t[7]=n,t[8]=r,t[9]=b,t[10]=c,t[11]=d,t[12]=l,t[13]=u,t[14]=i,t[15]=E):E=t[15];let O;return t[16]!==C||t[17]!==E?(O=(0,$.jsx)(`article`,{className:C,children:E}),t[16]=C,t[17]=E,t[18]=O):O=t[18],O}function ut(e){let t=(0,Pe.c)(86),{claim:n,language:r,t:i,busy:a,onDecision:c}=e,l=typeof n.value.label==`string`?n.value.label:``,u;if(t[0]!==n.class||t[1]!==n.value.hour||t[2]!==n.value.weekday||t[3]!==l||t[4]!==r||t[5]!==i.claimProject||t[6]!==i.claimRelationship||t[7]!==i.claimRoutine){let e=r===`zh`?[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`]:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];u=n.class===`relationship`?i.claimRelationship.replace(`{{label}}`,l):n.class===`project`?i.claimProject.replace(`{{label}}`,l):i.claimRoutine.replace(`{{weekday}}`,e[Number(n.value.weekday)]??``).replace(`{{hour}}`,String(n.value.hour).padStart(2,`0`)),t[0]=n.class,t[1]=n.value.hour,t[2]=n.value.weekday,t[3]=l,t[4]=r,t[5]=i.claimProject,t[6]=i.claimRelationship,t[7]=i.claimRoutine,t[8]=u}else u=t[8];let d=u,f;t[9]===n.evidence?f=t[10]:(f=new Set(n.evidence.map(dt)),t[9]=n.evidence,t[10]=f);let p;t[11]===f?p=t[12]:(p=[...f],t[11]=f,t[12]=p);let m=p,h=n.state===`provisional`||n.state===`stale`,g=h?`border-warning/35 bg-warning-soft/35`:`border-edge-subtle bg-surface-panel`,_;t[13]===g?_=t[14]:(_=s(`rounded-xl border p-3.5`,g),t[13]=g,t[14]=_);let v=i.claimClasses[n.class],y;t[15]===v?y=t[16]:(y=(0,$.jsx)(`span`,{className:`text-[11px] font-medium text-fg-subtle`,children:v}),t[15]=v,t[16]=y);let b;t[17]===d?b=t[18]:(b=(0,$.jsx)(`p`,{className:`mt-1 text-sm font-medium leading-6 text-fg`,children:d}),t[17]=d,t[18]=b);let x;t[19]!==y||t[20]!==b?(x=(0,$.jsxs)(`div`,{children:[y,b]}),t[19]=y,t[20]=b,t[21]=x):x=t[21];let S=i.claimStates[n.state],C;t[22]===S?C=t[23]:(C=(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:S}),t[22]=S,t[23]=C);let w;t[24]!==C||t[25]!==x?(w=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[x,C]}),t[24]=C,t[25]=x,t[26]=w):w=t[26];let T;t[27]!==n.activeDayCount||t[28]!==n.independentEvidenceCount||t[29]!==i.claimEvidence?(T=i.claimEvidence.replace(`{{events}}`,String(n.independentEvidenceCount)).replace(`{{days}}`,String(n.activeDayCount)),t[27]=n.activeDayCount,t[28]=n.independentEvidenceCount,t[29]=i.claimEvidence,t[30]=T):T=t[30];let E;t[31]===T?E=t[32]:(E=(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:T}),t[31]=T,t[32]=E);let O;t[33]!==n.lastReinforcedAt||t[34]!==r||t[35]!==i.observedAt?(O=i.observedAt.replace(`{{time}}`,ot(n.lastReinforcedAt,r)),t[33]=n.lastReinforcedAt,t[34]=r,t[35]=i.observedAt,t[36]=O):O=t[36];let k;t[37]===O?k=t[38]:(k=(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:O}),t[37]=O,t[38]=k);let A;t[39]!==a||t[40]!==h||t[41]!==c||t[42]!==i.confirm||t[43]!==i.notTrue?(A=h?(0,$.jsxs)(`div`,{className:`flex gap-1`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:()=>c(`confirm`),children:[(0,$.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),i.confirm]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:()=>c(`reject`),children:[(0,$.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),i.notTrue]})]}):null,t[39]=a,t[40]=h,t[41]=c,t[42]=i.confirm,t[43]=i.notTrue,t[44]=A):A=t[44];let j;t[45]!==k||t[46]!==A?(j=(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[k,A]}),t[45]=k,t[46]=A,t[47]=j):j=t[47];let M;t[48]===i.viewEvidence?M=t[49]:(M=(0,$.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:i.viewEvidence}),t[48]=i.viewEvidence,t[49]=M);let N;t[50]===i.evidenceSource?N=t[51]:(N=(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceSource}),t[50]=i.evidenceSource,t[51]=N);let P=m.join(`, `),F;t[52]===P?F=t[53]:(F=(0,$.jsx)(`dd`,{className:`mt-0.5 break-all`,children:P}),t[52]=P,t[53]=F);let I;t[54]!==N||t[55]!==F?(I=(0,$.jsxs)(`div`,{children:[N,F]}),t[54]=N,t[55]=F,t[56]=I):I=t[56];let L;t[57]===i.evidenceConfidence?L=t[58]:(L=(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceConfidence}),t[57]=i.evidenceConfidence,t[58]=L);let R;t[59]===n.confidence?R=t[60]:(R=Math.round(n.confidence*100),t[59]=n.confidence,t[60]=R);let z;t[61]===R?z=t[62]:(z=(0,$.jsxs)(`dd`,{className:`mt-0.5`,children:[R,`%`]}),t[61]=R,t[62]=z);let B;t[63]!==L||t[64]!==z?(B=(0,$.jsxs)(`div`,{children:[L,z]}),t[63]=L,t[64]=z,t[65]=B):B=t[65];let V;t[66]===i.evidenceRule?V=t[67]:(V=(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceRule}),t[66]=i.evidenceRule,t[67]=V);let H;t[68]===i.claimRule?H=t[69]:(H=(0,$.jsx)(`dd`,{className:`mt-0.5`,children:i.claimRule}),t[68]=i.claimRule,t[69]=H);let U;t[70]!==V||t[71]!==H?(U=(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[V,H]}),t[70]=V,t[71]=H,t[72]=U):U=t[72];let W;t[73]!==I||t[74]!==B||t[75]!==U?(W=(0,$.jsxs)(`dl`,{className:`mt-2 grid gap-1.5 sm:grid-cols-2`,children:[I,B,U]}),t[73]=I,t[74]=B,t[75]=U,t[76]=W):W=t[76];let G;t[77]!==M||t[78]!==W?(G=(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-muted/70 px-3 py-2 text-xs text-fg-muted`,children:[M,W]}),t[77]=M,t[78]=W,t[79]=G):G=t[79];let K;return t[80]!==w||t[81]!==E||t[82]!==j||t[83]!==G||t[84]!==_?(K=(0,$.jsxs)(`article`,{className:_,children:[w,E,j,G]}),t[80]=w,t[81]=E,t[82]=j,t[83]=G,t[84]=_,t[85]=K):K=t[85],K}function dt(e){return e.sourceInstanceId}function ft(e){let t=(0,Pe.c)(70),{playbook:n,busy:r,t:i,onToggleGroup:a,onCreate:o,onUpdate:c,onDelete:l,onRollback:u}=e,[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(``),_=n.enabled?`border-edge-subtle bg-surface-panel`:`border-edge-subtle bg-surface-muted`,v;t[0]===_?v=t[1]:(v=s(`rounded-xl border p-4`,_),t[0]=_,t[1]=v);let y=i.playbookNames[n.id],b;t[2]===y?b=t[3]:(b=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:y}),t[2]=y,t[3]=b);let S;t[4]!==n.rules||t[5]!==i.playbookRuleCount?(S=it(i.playbookRuleCount,n.rules.filter(ht).length),t[4]=n.rules,t[5]=i.playbookRuleCount,t[6]=S):S=t[6];let C;t[7]===S?C=t[8]:(C=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:S}),t[7]=S,t[8]=C);let w;t[9]!==b||t[10]!==C?(w=(0,$.jsxs)(`div`,{children:[b,C]}),t[9]=b,t[10]=C,t[11]=w):w=t[11];let E=n.enabled?i.pausePlaybook:i.resumePlaybook,D;t[12]!==r||t[13]!==a||t[14]!==E?(D=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:r,onClick:a,children:E}),t[12]=r,t[13]=a,t[14]=E,t[15]=D):D=t[15];let O;t[16]!==w||t[17]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[w,D]}),t[16]=w,t[17]=D,t[18]=O):O=t[18];let k;t[19]!==r||t[20]!==p||t[21]!==h||t[22]!==l||t[23]!==u||t[24]!==c||t[25]!==n.rules||t[26]!==i.cancel||t[27]!==i.deleteRule||t[28]!==i.disableRule||t[29]!==i.edit||t[30]!==i.enableRule||t[31]!==i.moveDown||t[32]!==i.moveUp||t[33]!==i.rollbackRule||t[34]!==i.ruleChannelContext||t[35]!==i.ruleContextAny||t[36]!==i.ruleHistory||t[37]!==i.ruleSupportContext||t[38]!==i.ruleSupportNeeds||t[39]!==i.save?(k=n.rules.map((e,t)=>(0,$.jsx)(`li`,{className:s(`rounded-lg border border-edge-subtle p-2.5`,!e.enabled&&`opacity-60`),children:p===e.id?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`textarea`,{className:s(rt,`min-h-16 resize-y`),value:h,onChange:e=>g(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,onClick:()=>m(null),children:i.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-7 px-2`,disabled:!h.trim(),onClick:()=>{c(e.id,{statement:h.trim()}),m(null)},children:i.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:e.statement}),(0,$.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-1`,children:[(0,$.jsxs)(`label`,{className:`grid gap-1 text-[10px] text-fg-subtle`,children:[i.ruleSupportContext,(0,$.jsxs)(ce,{value:e.context.supportNeed??``,disabled:r,onChange:t=>c(e.id,{context:{supportNeed:t.target.value||null}}),children:[(0,$.jsx)(K,{value:``,children:i.ruleContextAny}),[`listen`,`clarify`,`advise`,`act`,`unknown`].map(e=>(0,$.jsx)(K,{value:e,children:i.ruleSupportNeeds[e]},e))]})]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-[10px] text-fg-subtle`,children:[i.ruleChannelContext,(0,$.jsxs)(ce,{value:e.context.channel??``,disabled:r,onChange:t=>c(e.id,{context:{channel:t.target.value||null}}),children:[(0,$.jsx)(K,{value:``,children:i.ruleContextAny}),[`webchat`,`telegram`,`weixin`,`feishu`,`cli`].map(mt)]})]})]}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r||t===0,onClick:()=>c(e.id,{order:n.rules[t-1].order-1}),children:i.moveUp}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r||t===n.rules.length-1,onClick:()=>c(e.id,{order:n.rules[t+1].order+1}),children:i.moveDown}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r,onClick:()=>c(e.id,{enabled:!e.enabled}),children:e.enabled?i.disableRule:i.enableRule}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r,onClick:()=>{m(e.id),g(e.statement)},children:[(0,$.jsx)(T,{className:`size-3`,"aria-hidden":!0}),i.edit]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2 text-danger`,disabled:r,onClick:()=>l(e.id),children:[(0,$.jsx)(x,{className:`size-3`,"aria-hidden":!0}),i.deleteRule]})]}),e.versions.length>1?(0,$.jsxs)(`details`,{className:`mt-2 border-t border-edge-subtle pt-2`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-fg-subtle`,children:i.ruleHistory}),(0,$.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.versions.filter(pt).map(t=>(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 text-[11px]`,children:[(0,$.jsx)(`p`,{className:`line-clamp-2 text-fg-muted`,children:t.statement}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 shrink-0 px-2`,disabled:r,onClick:()=>u(e.id,t.id),children:i.rollbackRule})]},t.id))})]}):null]})},e.id)),t[19]=r,t[20]=p,t[21]=h,t[22]=l,t[23]=u,t[24]=c,t[25]=n.rules,t[26]=i.cancel,t[27]=i.deleteRule,t[28]=i.disableRule,t[29]=i.edit,t[30]=i.enableRule,t[31]=i.moveDown,t[32]=i.moveUp,t[33]=i.rollbackRule,t[34]=i.ruleChannelContext,t[35]=i.ruleContextAny,t[36]=i.ruleHistory,t[37]=i.ruleSupportContext,t[38]=i.ruleSupportNeeds,t[39]=i.save,t[40]=k):k=t[40];let A;t[41]===k?A=t[42]:(A=(0,$.jsx)(`ul`,{className:`mt-3 space-y-2`,children:k}),t[41]=k,t[42]=A);let j;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>f(e.target.value),t[43]=j):j=t[43];let M;t[44]!==d||t[45]!==i.newRulePlaceholder?(M=(0,$.jsx)(`input`,{className:rt,value:d,onChange:j,placeholder:i.newRulePlaceholder}),t[44]=d,t[45]=i.newRulePlaceholder,t[46]=M):M=t[46];let N;t[47]!==r||t[48]!==d?(N=r||!d.trim(),t[47]=r,t[48]=d,t[49]=N):N=t[49];let P;t[50]!==d||t[51]!==o?(P=()=>{o(d.trim()),f(``)},t[50]=d,t[51]=o,t[52]=P):P=t[52];let F;t[53]!==i.addRule||t[54]!==N||t[55]!==P?(F=(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N,onClick:P,children:i.addRule}),t[53]=i.addRule,t[54]=N,t[55]=P,t[56]=F):F=t[56];let I;t[57]!==M||t[58]!==F?(I=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[M,F]}),t[57]=M,t[58]=F,t[59]=I):I=t[59];let L=i.playbookRuleExamples[n.id],R;t[60]===L?R=t[61]:(R=(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-5 text-fg-subtle`,children:L}),t[60]=L,t[61]=R);let z;t[62]!==I||t[63]!==R?(z=(0,$.jsxs)(`div`,{className:`mt-3`,children:[I,R]}),t[62]=I,t[63]=R,t[64]=z):z=t[64];let B;return t[65]!==O||t[66]!==A||t[67]!==v||t[68]!==z?(B=(0,$.jsxs)(`article`,{className:v,children:[O,A,z]}),t[65]=O,t[66]=A,t[67]=v,t[68]=z,t[69]=B):B=t[69],B}function pt(e){return!e.current}function mt(e){return(0,$.jsx)(K,{value:e,children:e},e)}function ht(e){return e.enabled}function gt(e){let t=(0,Pe.c)(46),{suggestion:n,draft:r,busy:i,onDraftChange:a,onSave:o,onLater:c,t:l}=e,u;t[0]!==n||t[1]!==l.meetSuggestedTitle||t[2]!==l.meetTitle?(u=n?l.meetSuggestedTitle.replace(`{{name}}`,n.value):l.meetTitle,t[0]=n,t[1]=l.meetSuggestedTitle,t[2]=l.meetTitle,t[3]=u):u=t[3];let d;t[4]===u?d=t[5]:(d=(0,$.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight text-fg`,children:u}),t[4]=u,t[5]=d);let f=n?l.meetSuggestedBody:l.meetBody,p;t[6]===f?p=t[7]:(p=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:f}),t[6]=f,t[7]=p);let m;t[8]===l.callName?m=t[9]:(m=(0,$.jsx)(`label`,{className:`sr-only`,htmlFor:`you-call-name`,children:l.callName}),t[8]=l.callName,t[9]=m);let h;t[10]===a?h=t[11]:(h=e=>a(e.target.value),t[10]=a,t[11]=h);let g;t[12]!==i||t[13]!==r||t[14]!==o?(g=e=>{e.key===`Enter`&&r.trim()&&!i&&o()},t[12]=i,t[13]=r,t[14]=o,t[15]=g):g=t[15];let _=l.meetPlaceholder,v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=s(rt,`h-10 flex-1 bg-surface-base/90`),t[16]=v):v=t[16];let y;t[17]!==r||t[18]!==l.meetPlaceholder||t[19]!==h||t[20]!==g?(y=(0,$.jsx)(`input`,{id:`you-call-name`,value:r,maxLength:80,onChange:h,onKeyDown:g,placeholder:_,className:v}),t[17]=r,t[18]=l.meetPlaceholder,t[19]=h,t[20]=g,t[21]=y):y=t[21];let b;t[22]!==i||t[23]!==r?(b=i||!r.trim(),t[22]=i,t[23]=r,t[24]=b):b=t[24];let x=i?l.meetSaving:l.meetSave,S;t[25]!==o||t[26]!==b||t[27]!==x?(S=(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-10 shrink-0`,disabled:b,onClick:o,children:x}),t[25]=o,t[26]=b,t[27]=x,t[28]=S):S=t[28];let C;t[29]!==y||t[30]!==S||t[31]!==m?(C=(0,$.jsxs)(`div`,{className:`mt-5 flex max-w-xl flex-col gap-2 sm:flex-row`,children:[m,y,S]}),t[29]=y,t[30]=S,t[31]=m,t[32]=C):C=t[32];let w;t[33]!==n||t[34]!==l.meetSource?(w=n?(0,$.jsxs)(`p`,{className:`mt-3 flex items-start gap-1.5 text-xs leading-5 text-fg-subtle`,children:[(0,$.jsx)(oe,{className:`mt-0.5 size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:l.meetSource})]}):null,t[33]=n,t[34]=l.meetSource,t[35]=w):w=t[35];let T;t[36]!==i||t[37]!==c||t[38]!==l.meetLater?(T=(0,$.jsx)(`button`,{type:`button`,disabled:i,className:`mt-3 text-xs font-medium text-fg-muted hover:text-fg hover:underline disabled:opacity-60`,onClick:c,children:l.meetLater}),t[36]=i,t[37]=c,t[38]=l.meetLater,t[39]=T):T=t[39];let E;return t[40]!==C||t[41]!==w||t[42]!==T||t[43]!==d||t[44]!==p?(E=(0,$.jsx)(`section`,{className:`relative overflow-hidden rounded-2xl border border-accent/25 bg-gradient-to-br from-accent-soft/80 via-surface-panel to-surface-panel p-5 sm:p-6`,children:(0,$.jsxs)(`div`,{className:`relative max-w-2xl`,children:[d,p,C,w,T]})}),t[40]=C,t[41]=w,t[42]=T,t[43]=d,t[44]=p,t[45]=E):E=t[45],E}function _t(){let e=l(e=>e.language),t=c(e).you,n=a(),[r,_]=i(),y=et(r.get(`tab`)),x=h(e=>e.setPageHeader),C=h(e=>e.clearPageHeader),{data:w,error:D,isLoading:k,mutate:A}=u(`/api/you`,ve),[N,F]=(0,Q.useState)(null),[I,ee]=(0,Q.useState)(!1),[re,q]=(0,Q.useState)(``),[J,Y]=(0,Q.useState)(`preference`),[X,le]=(0,Q.useState)(!1),[ue,fe]=(0,Q.useState)(null),[pe,_e]=(0,Q.useState)(!1),[Se,Ce]=(0,Q.useState)(null),[we,Te]=(0,Q.useState)(!1),[Ee,De]=(0,Q.useState)(``),[Ne,Pe]=(0,Q.useState)(!1),[Le,ze]=(0,Q.useState)(null),[Be,Ve]=(0,Q.useState)(!1),[He,Ue]=(0,Q.useState)(!1),[We,Ge]=(0,Q.useState)(!1),[Ke,qe]=(0,Q.useState)(null),[Je,Ye]=(0,Q.useState)(!1),[Ze,Qe]=(0,Q.useState)(null),[$e,dt]=(0,Q.useState)(null),[pt,mt]=(0,Q.useState)(!1),[ht,_t]=(0,Q.useState)(null),[vt,yt]=(0,Q.useState)(null),bt=(0,Q.useRef)(null),xt=(0,Q.useRef)(null),St=(0,Q.useRef)(null),Ct=w?.profile??{callName:``,pronouns:``,timezone:``,notes:``},wt=(0,Q.useMemo)(()=>w?.understanding.filter(e=>e.status===`active`)??[],[w]),Tt=(0,Q.useMemo)(()=>w?.understanding.filter(e=>e.status!==`active`)??[],[w]),Et=(0,Q.useMemo)(()=>w?.connectedClaims.filter(e=>e.state!==`rejected`)??[],[w]),Dt=(0,Q.useMemo)(()=>Et.filter(e=>e.state!==`active`),[Et]),Ot=(0,Q.useMemo)(()=>new Map(tt.map(e=>[e,wt.filter(t=>t.facet===e)])),[wt]),kt=Le??w?.controls??null,At=w?.sources.filter(e=>e.installed&&e.enabled)??[],jt=At.filter(e=>[`failed`,`unauthorized`,`degraded`,`not_configured`].includes(e.status));(0,Q.useEffect)(()=>{let e=()=>{A()};return window.addEventListener(`connector-learning-updated`,e),()=>window.removeEventListener(`connector-learning-updated`,e)},[A]),(0,Q.useEffect)(()=>{if(y!==`memory`||!vt)return;let e=requestAnimationFrame(()=>{(vt===`profile`?bt:xt).current?.scrollIntoView({behavior:`smooth`,block:`start`}),yt(null)});return()=>cancelAnimationFrame(e)},[vt,y]);async function Mt(e){if(!(!w||We)){Ge(!0);try{let n=await ye(e);await A({...w,relationship:n.relationship},{revalidate:!1}),V({type:`success`,title:t.collaborationTitle,message:t.saved})}catch{V({type:`error`,title:t.supportModeTitle,message:t.saveError})}finally{Ge(!1)}}}async function Nt(e,n){F(`claim:${e.id}`);try{let t=await ae(e.id,n);await A(e=>e&&{...e,connectedClaims:e.connectedClaims.map(e=>e.id===t.id?t:e)},{revalidate:!1})}catch{V({type:`error`,title:t.connectedClaimsTitle,message:t.saveError})}finally{F(null)}}let Pt=e=>{let t=new URLSearchParams;e!==`overview`&&t.set(`tab`,e),_(t,{replace:!0})},Ft=e=>{yt(e),Pt(`memory`)},It=e=>{let t=new URLSearchParams({connector:e.id});e.instanceId&&t.set(`instance`,e.instanceId),n(`/connectors?${t.toString()}`)},Lt=async e=>{if(e.instanceId){F(`source-learning:${e.instanceId}`);try{e.learning?.status===`paused`?await je(e.instanceId,!1):await Me(e.instanceId),await A(),V({type:`success`,title:e.displayName,message:t.sourceLearningStarted})}catch(n){V({type:`error`,title:e.displayName,message:n instanceof Error?n.message:t.sourceLearningStartFailed})}finally{F(null)}}},Rt=async e=>{if(e.instanceId){F(`source-learning:${e.instanceId}`);try{await je(e.instanceId,!0),await A()}catch(n){V({type:`error`,title:e.displayName,message:n instanceof Error?n.message:t.sourceLearningStartFailed})}finally{F(null)}}};(0,Q.useLayoutEffect)(()=>(x({startExtra:null,main:(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:t.subtitle})]}),end:(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 gap-1.5 px-2.5 text-xs`,onClick:()=>Ye(!0),children:[(0,$.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0}),t.howItWorks]})}),()=>C()),[C,x,t.howItWorks,t.subtitle,t.title]),(0,Q.useEffect)(()=>{!w||w.profile.callName||De(w.profileSetup.callNameSuggestion?.value??``)},[w,w?.profile.callName,w?.profileSetup.callNameSuggestion?.id]);async function zt(e,n,r){F(e.id);try{let t=await se(e.id,{action:n,content:r});await A(r=>r&&{...r,understanding:n===`reject`?r.understanding.filter(t=>t.id!==e.id):r.understanding.map(n=>n.id===e.id?t:n)},{revalidate:!1}),A()}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{F(null)}}async function Bt(e,n){F(`consent:${e}`);try{await b(e,n),await A(),V({type:`success`,title:t.title,message:t.saved})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{F(null)}}async function Vt(){let e=re.trim();if(e){F(`understanding:new`);try{await P({content:e,kind:J}),q(``),ee(!1),le(!1),await A(),V({type:`success`,title:t.understandingTitle,message:t.saved})}catch{V({type:`error`,title:t.understandingTitle,message:t.saveError})}finally{F(null)}}}async function Ht(){if(Tt.length){F(`understanding:batch`);try{await Oe(Tt.map(e=>e.id),`confirm`),await A()}catch{V({type:`error`,title:t.reviewTitle,message:t.saveError})}finally{F(null)}}}async function Ut(e,n){F(`conflict:${e}`);try{await z(e,n),await A()}catch{V({type:`error`,title:t.conflictsTitle,message:t.saveError})}finally{F(null)}}async function Wt(e){F(`grant:${e}`);try{await U(e),await A()}catch{V({type:`error`,title:t.grantsTitle,message:t.saveError})}finally{F(null)}}async function Gt(r,i){F(`insight:${r.id}`);try{let t=await xe(r.id,{action:i,uiLocale:e});await A(),i===`apply`&&t.href&&n(t.href)}catch{V({type:`error`,title:t.insightsTitle,message:t.saveError})}finally{F(null)}}async function Kt(e){F(`playbook:${e.id}`);try{await f(e.id,!e.enabled),await A()}catch{V({type:`error`,title:t.playbooksTitle,message:t.saveError})}finally{F(null)}}async function qt(e,n){F(`playbook:${e}`);try{await n(),await A()}catch{V({type:`error`,title:t.playbooksTitle,message:t.saveError})}finally{F(null)}}async function Jt(){if(ue){F(ue.id);try{await S(ue.id);let e=ue.id;fe(null),await A(t=>t&&{...t,understanding:t.understanding.filter(t=>t.id!==e)},{revalidate:!1}),A()}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{F(null)}}}async function Yt(){if(Se){Te(!0);try{let e=await he(Se);_e(!1),Ce(null),await A(t=>t&&{...t,...e},{revalidate:!1})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{Te(!1)}}}async function Xt(){let e=Ee.trim();if(!(!e||Ne)){Pe(!0);try{let t=await he({callName:e,timezone:Ct.timezone||ge()});await A(e=>e&&{...e,...t},{revalidate:!1})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{Pe(!1)}}}async function Zt(){if(!Ne){Pe(!0);try{let e=await be(`snooze`);await A(t=>t&&{...t,profileSetup:e.profileSetup},{revalidate:!1})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{Pe(!1)}}}function Qt(){Ce(Ct),_e(!0),Ft(`profile`)}function $t(e,t=!1){Y(e),le(t),ee(!0),Pt(`memory`)}function en(){ee(!1),le(!1),q(``)}async function tn(e){if(!Be){ze(e),Ve(!0);try{ze(await G(e)),await A(),V({type:`success`,title:t.privacyTitle,message:t.saved})}catch{ze(null),V({type:`error`,title:t.privacyTitle,message:t.saveError})}finally{Ve(!1)}}}async function nn(e){if(!(He||e===w?.trust.defaultActionLevel)){Ue(!0);try{let n=await te(e);await A(e=>e&&{...e,trust:n},{revalidate:!1}),V({type:`success`,title:t.trustTitle,message:t.saved})}catch{V({type:`error`,title:t.trustTitle,message:t.saveError})}finally{Ue(!1),qe(null)}}}async function rn(e){if(!(!$e?.instanceId||pt)){mt(!0);try{let n=await L($e.instanceId,e);dt(null),await A(),V({type:`success`,title:t.sourcesTitle,message:e?t.disconnectDeleted.replace(`{{count}}`,String(n.deletedUnderstandingCount)):t.disconnectSuccess})}catch{V({type:`error`,title:t.sourcesTitle,message:t.saveError})}finally{mt(!1)}}}async function an(){if(!ht){_t(`export`);try{let e=await v(),t=URL.createObjectURL(new Blob([JSON.stringify(e,null,2)],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`xopc-about-you-${e.exportedAt.slice(0,10)}.json`,n.click(),URL.revokeObjectURL(t)}catch{V({type:`error`,title:t.transferTitle,message:t.saveError})}finally{_t(null)}}}async function on(e){if(!(!e||ht)){_t(`import`);try{if(e.size>2*1024*1024)throw Error(`file too large`);let n=await H(JSON.parse(await e.text()));await A(),Ft(`review`),V({type:`success`,title:t.transferTitle,message:t.importSuccess.replace(`{{count}}`,String(n.importedCount)).replace(`{{skipped}}`,String(n.skippedCount))})}catch{V({type:`error`,title:t.transferTitle,message:t.importError})}finally{St.current&&(St.current.value=``),Qe(null),_t(null)}}}function sn(){Qe(null),St.current&&(St.current.value=``)}return(0,$.jsxs)(`main`,{className:`flex w-full flex-1 flex-col gap-5 px-3 py-6 sm:px-5 xl:px-6`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ke,{items:[{id:`overview`,label:t.tabs.overview,icon:g},{id:`memory`,label:t.tabs.memory,icon:m,count:Tt.length+Dt.length||void 0},{id:`collaboration`,label:t.tabs.collaboration,icon:E},{id:`sources`,label:t.tabs.sources,icon:R},{id:`privacy`,label:t.tabs.privacy,icon:oe}],activeTab:y,onChange:Pt,ariaLabel:t.title,tabIdPrefix:`you-tab`,panelIdPrefix:`you-panel`,className:`pr-8 sm:pr-1`,buttonClassName:`px-2.5 sm:px-3`}),(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-y-1 right-0 w-8 bg-gradient-to-l from-surface-panel to-transparent sm:hidden`,"aria-hidden":!0})]}),k?(0,$.jsx)(st,{}):D||!w?(0,$.jsx)(`div`,{className:`rounded-2xl border border-danger/25 bg-danger-soft p-5 text-sm text-danger`,children:t.loadError}):null,w&&y===`overview`?(0,$.jsxs)(`div`,{id:`you-panel-overview`,role:`tabpanel`,"aria-labelledby":`you-tab-overview`,className:`space-y-4`,children:[!Ct.callName&&w.profileSetup.shouldPrompt?(0,$.jsx)(gt,{suggestion:w.profileSetup.callNameSuggestion,draft:Ee,busy:Ne,onDraftChange:De,onSave:()=>void Xt(),onLater:()=>void Zt(),t}):null,Tt.length>0||Dt.length>0||jt.length>0||!Ct.callName?(0,$.jsxs)(`section`,{className:`rounded-2xl border border-warning/25 bg-warning-soft/35 p-5`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.attentionTitle}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[Tt.length+Dt.length>0?(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:()=>Ft(`review`),children:[it(t.reviewCount,Tt.length+Dt.length),(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]}):null,jt.length>0?(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:()=>Pt(`sources`),children:[it(t.sourceIssues,jt.length),(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]}):null,Ct.callName?null:(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:Qt,children:[t.completeProfile,(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]})]})]}):null,(0,$.jsx)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-4`,children:(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>Pt(`memory`),children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold text-fg`,children:wt.length}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:t.knownSummary})]}),(0,$.jsxs)(`button`,{type:`button`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>Pt(`sources`),children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold text-fg`,children:At.length}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:t.connectedSources})]}),(0,$.jsxs)(`button`,{type:`button`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>Ft(`review`),children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold text-fg`,children:Tt.length+Dt.length}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:t.waitingReview})]})]})}),w.insights.length>0?(0,$.jsxs)(`section`,{className:`rounded-2xl border border-accent/15 bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(ne,{className:`size-4 text-accent`,"aria-hidden":!0}),t.insightsTitle]}),(0,$.jsx)(at,{children:t.confirmedContextBadge})]}),(0,$.jsx)(`div`,{className:`mt-4 grid gap-3 lg:grid-cols-2`,children:w.insights.map(e=>(0,$.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.insight}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:e.evidenceCount>1?it(t.insightEvidence,e.evidenceCount):t.insightReason}),(0,$.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:N===`insight:${e.id}`,onClick:()=>void Gt(e,`dismiss`),children:t.notNow}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:N===`insight:${e.id}`,onClick:()=>void Gt(e,`apply`),children:t.insightActions[e.action]})]})]},e.id))})]}):null,(0,$.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),t.profileTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.profileHint})]}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>Ft(`profile`),children:(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsxs)(`dl`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.callName}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.callName||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.timezone}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.timezone||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.pronouns}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.pronouns||`—`})]}),Ct.notes?(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.notes}),(0,$.jsx)(`dd`,{className:`mt-1 line-clamp-2 text-sm leading-6 text-fg`,children:Ct.notes})]}):null]})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(m,{className:`size-4 text-accent`,"aria-hidden":!0}),t.understandingTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.understandingHint})]}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>Pt(`memory`),children:(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[wt.slice(0,4).map(e=>(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2.5 text-sm leading-5 text-fg`,children:e.statement},e.id)),wt.length===0?(0,$.jsx)(`p`,{className:`py-5 text-center text-sm text-fg-muted`,children:t.emptyUnderstanding}):null]})]})]})]}):null,w&&y===`memory`?(0,$.jsxs)(`div`,{id:`you-panel-memory`,role:`tabpanel`,"aria-labelledby":`you-tab-memory`,className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.memoryTitle}),(0,$.jsx)(at,{children:t.sharedAgentsBadge})]}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.memoryHint})]}),(0,$.jsxs)(`section`,{ref:bt,id:`you-profile-card`,className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,$.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),t.profileTitle]}),(0,$.jsx)(at,{children:t.onlyYouEditBadge})]}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:t.profileHint})]}),pe?null:(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:Qt,children:[(0,$.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),t.edit]})]}),pe&&Se?(0,$.jsxs)(`div`,{className:`mt-5`,children:[(0,$.jsx)(Fe,{value:Se,onChange:Ce,language:e,inputClassName:rt,labels:{callName:t.callName,callNamePlaceholder:t.meetPlaceholder,pronouns:t.pronouns,pronounsPlaceholder:t.pronounsPlaceholder,timezone:t.timezone,timezoneCustom:t.timezoneCustom,timezoneDetect:t.timezoneDetect,custom:t.custom,notes:t.notes,notesPlaceholder:t.notesPlaceholder}}),(0,$.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>{_e(!1),Ce(null)},children:t.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:we,onClick:()=>void Yt(),children:we?t.saving:t.save})]})]}):(0,$.jsxs)(`dl`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.callName}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.callName||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.timezone}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.timezone||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.pronouns}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.pronouns||`—`})]}),(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.notes}),(0,$.jsx)(`dd`,{className:`mt-1 whitespace-pre-wrap text-sm leading-6 text-fg`,children:Ct.notes||`—`})]})]})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.structuredContextTitle}),(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&!X&&J===`preference`,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&!X&&J===`preference`?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`preference`),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addPreference}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addPreferenceHint})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&!X&&J===`boundary`,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&!X&&J===`boundary`?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`boundary`),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addBoundary}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addBoundaryHint})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&!X&&J===`current_state`,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&!X&&J===`current_state`?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`current_state`),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addCurrentFocus}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addCurrentFocusHint})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&X,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&X?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`relationship`,!0),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addOther}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addOtherHint})]})]}),I?(0,$.jsxs)(`div`,{className:`mt-4 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:X?t.addOther:J===`preference`?t.addPreference:J===`boundary`?t.addBoundary:t.addCurrentFocus}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:X?t.addOtherHint:J===`preference`?t.addPreferenceHint:J===`boundary`?t.addBoundaryHint:t.addCurrentFocusHint})]}),X?null:(0,$.jsx)(at,{children:t.understandingKinds[J]})]}),(0,$.jsx)(`textarea`,{className:s(rt,`mt-3 min-h-24 resize-y`),value:re,onChange:e=>q(e.target.value),placeholder:t.understandingPlaceholders[J],autoFocus:!0}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end justify-between gap-3`,children:[X?(0,$.jsxs)(`label`,{className:`grid min-w-48 gap-1 text-xs font-medium text-fg-muted`,children:[t.understandingKind,(0,$.jsx)(ce,{value:J,onChange:e=>Y(e.target.value),children:nt.map(e=>(0,$.jsx)(K,{value:e,children:t.understandingKinds[e]},e))})]}):(0,$.jsx)(`span`,{}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,onClick:en,children:t.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:!re.trim()||N===`understanding:new`,onClick:()=>void Vt(),children:t.add})]})]})]}):null]}),w.conflictGroups.some(e=>e.unresolved)?(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.conflictsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.conflictsHint}),(0,$.jsx)(`div`,{className:`mt-3 space-y-3`,children:w.conflictGroups.filter(e=>e.unresolved).map(n=>(0,$.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-xl border border-warning/35 bg-warning-soft/25`,children:n.records.filter(e=>e.storedStatus!==`archived`&&e.storedStatus!==`rejected`).map(r=>(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:r.statement}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[ct(r,t),` · `,ot(r.updatedAt,e)]})]}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-2.5`,disabled:N===`conflict:${n.id}`,onClick:()=>void Ut(n.id,r.id),children:t.useThis})]},r.id))},n.id))})]}):null,w.consentRequests.length>0?(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.consentTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.consentHint})]}),w.consentRequests.map(e=>(0,$.jsxs)(`article`,{className:`rounded-2xl border border-accent/25 bg-accent-soft/20 p-4`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.statement}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.consentPurpose.replace(`{{purpose}}`,e.purpose)}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`deny`),children:t.consentDeny}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`once`),children:t.consentOnce}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`session`),children:t.consentSession}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`always`),children:t.consentAlways})]})]},e.id))]}):null,(0,$.jsxs)(`div`,{ref:xt,className:`space-y-6 scroll-mt-6`,children:[Et.length>0?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.connectedClaimsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.connectedClaimsHint})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:Et.map(n=>(0,$.jsx)(ut,{claim:n,language:e,t,busy:N===`claim:${n.id}`,onDecision:e=>void Nt(n,e)},n.id))})]}):null,Tt.length>0?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.reviewTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.reviewHint})]}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N===`understanding:batch`,onClick:()=>void Ht(),children:t.reviewAll})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:Tt.map(n=>(0,$.jsx)(lt,{item:n,language:e,t,busy:N===n.id,onConfirm:()=>void zt(n,`confirm`),onReject:()=>void zt(n,`reject`),onUpdate:e=>void zt(n,`update`,e),onForget:()=>fe(n)},n.id))})]}):wt.length>0||Et.some(e=>e.state===`active`)?(0,$.jsxs)(`div`,{className:`rounded-2xl border border-success/20 bg-success-soft p-6 text-center`,children:[(0,$.jsx)(o,{className:`mx-auto size-5 text-success`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-2 text-sm font-semibold text-fg`,children:t.nothingToReview}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.nothingToReviewHint})]}):null]}),tt.map(n=>{let r=Ot.get(n)??[];return r.length===0?null:(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.facets[n]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:r.map(n=>(0,$.jsx)(lt,{item:n,language:e,t,busy:N===n.id,onConfirm:()=>void zt(n,`confirm`),onReject:()=>void zt(n,`reject`),onUpdate:e=>void zt(n,`update`,e),onForget:()=>fe(n)},n.id))})]},n)}),w.understanding.length===0&&Et.length===0?(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge p-10 text-center text-sm text-fg-muted`,children:t.emptyUnderstanding}):null]}):null,w&&y===`collaboration`?(0,$.jsxs)(`div`,{id:`you-panel-collaboration`,role:`tabpanel`,"aria-labelledby":`you-tab-collaboration`,className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.collaborationTitle}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.collaborationHint})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(g,{className:`size-4 text-accent`,"aria-hidden":!0}),t.supportModeTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.supportModeHint})]}),(0,$.jsxs)(`label`,{className:`grid min-w-48 gap-1 text-xs font-medium text-fg-muted`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:t.supportModeTitle}),(0,$.jsx)(ce,{value:w.relationship.supportMode,disabled:We,onChange:e=>void Mt({supportMode:e.target.value}),children:Object.entries(t.supportModes).map(([e,t])=>(0,$.jsx)(K,{value:e,children:t},e))})]})]}),(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 border-t border-edge-subtle pt-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:w.relationship.proactiveEnabled,disabled:We,onChange:e=>void Mt({proactiveEnabled:e.target.checked})}),t.proactiveEnabled]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-xs text-fg-muted`,children:[t.quietStart,(0,$.jsx)(Ae,{value:w.relationship.quietStart??``,disabled:We,allowEmpty:!0,clearLabel:t.clearTime,ariaLabel:t.quietStart,onChange:e=>void Mt({quietStart:e||null})})]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-xs text-fg-muted`,children:[t.quietEnd,(0,$.jsx)(Ae,{value:w.relationship.quietEnd??``,disabled:We,allowEmpty:!0,clearLabel:t.clearTime,ariaLabel:t.quietEnd,onChange:e=>void Mt({quietEnd:e||null})})]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-xs text-fg-muted`,children:[t.blockedTopics,(0,$.jsx)(`input`,{className:rt,defaultValue:w.relationship.blockedTopics.join(`, `),disabled:We,onBlur:e=>void Mt({blockedTopics:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})]})]}),(0,$.jsx)(`p`,{className:`mt-3 text-right text-xs text-fg-subtle`,children:We?t.saving:t.autoSaveHint})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,$.jsx)(E,{className:`size-4 text-accent`,"aria-hidden":!0}),t.playbooksTitle]}),(0,$.jsx)(at,{children:t.affectsAgentsBadge})]}),w.playbooks.length>0?(0,$.jsx)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-3`,children:w.playbooks.map(e=>(0,$.jsx)(ft,{playbook:e,busy:N===`playbook:${e.id}`,t,onToggleGroup:()=>void Kt(e),onCreate:t=>void qt(e.id,()=>p(e.id,t,(e.rules.at(-1)?.order??0)+10)),onUpdate:(t,n)=>void qt(e.id,()=>me(e.id,t,n)),onDelete:t=>void qt(e.id,()=>M(e.id,t)),onRollback:(t,n)=>void qt(e.id,()=>O(e.id,t,n))},e.id))}):(0,$.jsx)(`p`,{className:`mt-4 rounded-xl bg-surface-muted px-4 py-3 text-sm text-fg-muted`,children:t.emptyPlaybooks})]})]}):null,w&&y===`sources`?(0,$.jsx)(Xe,{sources:w.sources,language:e,t,busyId:N,onAddSource:()=>n(`/connectors?personalContext=1`),onLearn:e=>void Lt(e),onPause:e=>void Rt(e),onConfigure:It,onDisconnect:dt,onViewUnderstanding:()=>Pt(`memory`)}):null,w&&y===`privacy`&&kt?(0,$.jsxs)(`div`,{id:`you-panel-privacy`,role:`tabpanel`,"aria-labelledby":`you-tab-privacy`,className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.privacyTitle}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.privacyHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-2`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.controlTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.controlHint}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-3 rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.learningMode,(0,$.jsx)(ce,{value:kt.mode,disabled:Be,onChange:e=>void tn({...kt,mode:e.target.value}),children:Object.entries(t.learningModes).map(([e,t])=>(0,$.jsx)(K,{value:e,children:t},e))})]}),(0,$.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.sensitive,(0,$.jsx)(ce,{value:kt.sensitiveWritePolicy,disabled:Be,onChange:e=>void tn({...kt,sensitiveWritePolicy:e.target.value}),children:Object.entries(t.sensitiveOptions).map(([e,t])=>(0,$.jsx)(K,{value:e,children:t},e))}),(0,$.jsx)(`span`,{className:`font-normal leading-5 text-fg-subtle`,children:t.sensitiveOptionHints[kt.sensitiveWritePolicy]})]}),(0,$.jsx)(`p`,{className:`text-right text-xs text-fg-subtle`,children:Be?t.saving:t.autoSaveHint})]})]}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.trustTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.trustHint}),(0,$.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:w.trust.levels.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":e===w.trust.defaultActionLevel,disabled:He,onClick:()=>{e!==w.trust.defaultActionLevel&&(e===`auto`?qe(e):nn(e))},className:s(`rounded-xl border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 disabled:opacity-70`,e===w.trust.defaultActionLevel?`border-accent/35 bg-accent-soft/35`:`border-edge-subtle bg-surface-panel hover:border-accent/25 hover:bg-surface-hover`),children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-fg`,children:t.trustLevels[e]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.trustLevelHints[e]}),e===w.trust.defaultActionLevel?(0,$.jsx)(`span`,{className:`mt-2 inline-block rounded-full bg-accent-soft px-2 py-0.5 text-[11px] text-accent-fg`,children:t.defaultTrust}):null]},e))})]})]}),(0,$.jsx)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(oe,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.sharingTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:t.sharingHint})]})]})}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.grantsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.grantsHint}),w.referenceGrants.length>0?(0,$.jsx)(`div`,{className:`mt-3 divide-y divide-edge overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:w.referenceGrants.map(n=>(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm text-fg`,children:n.statement}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[n.grantScope?t.grantScopes[n.grantScope]:``,n.expiresAt?` · ${ot(n.expiresAt,e)}`:``]})]}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2.5`,disabled:N===`grant:${n.id}`,onClick:()=>void Wt(n.id),children:t.revoke})]},n.id))}):(0,$.jsx)(`p`,{className:`mt-3 rounded-xl bg-surface-muted px-4 py-3 text-sm text-fg-muted`,children:t.noGrants})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.transferTitle}),(0,$.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:ht!==null,onClick:()=>void an(),children:[(0,$.jsx)(B,{className:`size-4`,"aria-hidden":!0}),ht===`export`?t.exporting:t.exportAction]}),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:ht!==null,onClick:()=>St.current?.click(),children:[(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0}),ht===`import`?t.importing:t.importAction]}),(0,$.jsx)(`input`,{ref:St,type:`file`,accept:`application/json,.json`,className:`sr-only`,onChange:e=>Qe(e.target.files?.[0]??null)})]})]})]}):null,(0,$.jsx)(d,{open:ue!==null,title:t.forgetTitle,description:t.forgetBody,confirmLabel:t.forget,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void Jt(),onCancel:()=>fe(null)}),(0,$.jsx)(d,{open:Ke===`auto`,title:t.autoConfirmTitle,description:t.autoConfirmBody,confirmLabel:t.autoConfirmAction,cancelLabel:t.cancel,onConfirm:()=>void nn(`auto`),onCancel:()=>qe(null)}),(0,$.jsx)(d,{open:Ze!==null,title:t.importConfirmTitle,description:t.importConfirmBody.replace(`{{name}}`,Ze?.name??``),confirmLabel:t.importConfirmAction,cancelLabel:t.cancel,onConfirm:()=>{let e=Ze;Qe(null),on(e)},onCancel:sn}),(0,$.jsx)(Re,{source:$e,language:e,busy:pt,onOpenChange:e=>{e||dt(null)},onConfirm:e=>void rn(e)}),(0,$.jsx)(Ie,{open:Je,t,onOpenChange:Ye,onNavigate:Pt})]})}export{_t 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,l as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{t as c}from"./messages-H_iJjnEM.js";import{n as l}from"./locale-store-BNC8HUCI.js";import{i as u}from"./vendor-swr-BIWyz7Rc.js";import{$n as d,$t as f,Bt as p,Cu as m,Do as h,El as g,Go as _,Gt as v,Ho as y,Ht as b,Js as x,Jt as S,Ko as C,Kt as w,Lc as T,Ou as E,Ps as D,Qt as O,Ts as k,Uo as A,Us as j,Ut as M,Vo as N,Vt as P,Wo as F,Ws as I,Wt as L,Xl as R,Xt as z,Yl as B,Yo as V,Yt as H,Zt as U,_u as W,an as G,as as K,cc as ee,cn as te,dl as ne,ds as re,du as ie,en as ae,eo as q,fc as oe,fn as J,gu as Y,ht as X,in as se,is as ce,iu as le,jc as ue,js as Z,lu as de,mc as fe,mu as pe,nn as me,on as he,pn as ge,qo as _e,qt as ve,rn as ye,sn as be,tn as xe,un as Se,us as Ce,wc as we,wl as Te,zc as Ee,zs as De,zt as Oe}from"./index-BA56bQ68.js";import{t as ke}from"./page-tabs-BnSzIjH0.js";import{t as Ae}from"./time-picker-D0zAsHOo.js";import{D as je,O as Me,t as Ne}from"./connector-logo-CxIXnifA.js";var Pe=n(),Q=e(t(),1),$=r();function Fe(e){let t=(0,Pe.c)(104),{value:n,onChange:r,labels:i,language:a,inputClassName:o}=e,c;t[0]===n.timezone?c=t[1]:(c=()=>J.some(e=>e.value===n.timezone)?``:n.timezone,t[0]=n.timezone,t[1]=c);let[l,u]=(0,Q.useState)(c),d;t[2]===n.timezone?d=t[3]:(d=()=>!!n.timezone&&!J.some(e=>e.value===n.timezone),t[2]=n.timezone,t[3]=d);let[f,p]=(0,Q.useState)(d),m;t[4]===n.pronouns?m=t[5]:(m=()=>!!n.pronouns&&!Se.some(e=>e.value===n.pronouns),t[4]=n.pronouns,t[5]=m);let[h,g]=(0,Q.useState)(m),_;bb0:{if(f){_=`__custom__`;break bb0}_=J.some(e=>e.value===n.timezone)?n.timezone:`__custom__`}let v=_,y;t[6]!==r||t[7]!==n?(y=e=>r({...n,...e}),t[6]=r,t[7]=n,t[8]=y):y=t[8];let b=y,x;t[9]===a?x=t[10]:(x=(e,t)=>a===`zh`?t:e,t[9]=a,t[10]=x);let S=x,C;t[11]===i.callName?C=t[12]:(C=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.callName}),t[11]=i.callName,t[12]=C);let w;t[13]===b?w=t[14]:(w=e=>b({callName:e.target.value}),t[13]=b,t[14]=w);let T;t[15]!==o||t[16]!==i.callNamePlaceholder||t[17]!==w||t[18]!==n.callName?(T=(0,$.jsx)(`input`,{className:o,value:n.callName,onChange:w,placeholder:i.callNamePlaceholder,autoComplete:`off`}),t[15]=o,t[16]=i.callNamePlaceholder,t[17]=w,t[18]=n.callName,t[19]=T):T=t[19];let E;t[20]!==C||t[21]!==T?(E=(0,$.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[C,T]}),t[20]=C,t[21]=T,t[22]=E):E=t[22];let D;t[23]===i.pronouns?D=t[24]:(D=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.pronouns}),t[23]=i.pronouns,t[24]=D);let O=h?`__custom__`:n.pronouns,A;t[25]!==b||t[26]!==n.pronouns?(A=e=>{if(e.target.value===`__custom__`){g(!0),Se.some(e=>e.value===n.pronouns)&&b({pronouns:``});return}g(!1),b({pronouns:e.target.value})},t[25]=b,t[26]=n.pronouns,t[27]=A):A=t[27];let j;t[28]===i.pronounsPlaceholder?j=t[29]:(j=(0,$.jsx)(K,{value:``,children:i.pronounsPlaceholder}),t[28]=i.pronounsPlaceholder,t[29]=j);let M;t[30]===S?M=t[31]:(M=Se.map(e=>(0,$.jsx)(K,{value:e.value,children:S(e.labelEn,e.labelZh)},e.value)),t[30]=S,t[31]=M);let N;t[32]===i.custom?N=t[33]:(N=(0,$.jsx)(K,{value:`__custom__`,children:i.custom}),t[32]=i.custom,t[33]=N);let P;t[34]!==o||t[35]!==O||t[36]!==A||t[37]!==j||t[38]!==M||t[39]!==N?(P=(0,$.jsxs)(ce,{className:o,value:O,onChange:A,children:[j,M,N]}),t[34]=o,t[35]=O,t[36]=A,t[37]=j,t[38]=M,t[39]=N,t[40]=P):P=t[40];let F;t[41]!==o||t[42]!==i.pronounsPlaceholder||t[43]!==h||t[44]!==b||t[45]!==n.pronouns?(F=h?(0,$.jsx)(`input`,{className:s(o,`mt-1 text-xs`),value:n.pronouns,onChange:e=>b({pronouns:e.target.value}),placeholder:i.pronounsPlaceholder,autoComplete:`off`}):null,t[41]=o,t[42]=i.pronounsPlaceholder,t[43]=h,t[44]=b,t[45]=n.pronouns,t[46]=F):F=t[46];let I;t[47]!==D||t[48]!==P||t[49]!==F?(I=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[D,P,F]}),t[47]=D,t[48]=P,t[49]=F,t[50]=I):I=t[50];let L;t[51]===i.timezone?L=t[52]:(L=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[51]=i.timezone,t[52]=L);let R;t[53]===o?R=t[54]:(R=s(o,`min-w-0 flex-1`),t[53]=o,t[54]=R);let z;t[55]===b?z=t[56]:(z=e=>{if(e.target.value===`__custom__`){p(!0);return}p(!1),u(``),b({timezone:e.target.value})},t[55]=b,t[56]=z);let B;t[57]===S?B=t[58]:(B=J.map(e=>(0,$.jsx)(K,{value:e.value,children:S(e.labelEn,e.labelZh)},e.value)),t[57]=S,t[58]=B);let V;t[59]===i.timezoneCustom?V=t[60]:(V=(0,$.jsx)(K,{value:`__custom__`,children:i.timezoneCustom}),t[59]=i.timezoneCustom,t[60]=V);let H;t[61]!==R||t[62]!==z||t[63]!==B||t[64]!==V||t[65]!==v?(H=(0,$.jsxs)(ce,{className:R,value:v,onChange:z,children:[B,V]}),t[61]=R,t[62]=z,t[63]=B,t[64]=V,t[65]=v,t[66]=H):H=t[66];let U;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(U=s(`shrink-0 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,k.press),t[67]=U):U=t[67];let W;t[68]===b?W=t[69]:(W=()=>{let e=ge();if(!e)return;let t=J.some(t=>t.value===e);p(!t),u(t?``:e),b({timezone:e})},t[68]=b,t[69]=W);let G;t[70]!==i.timezoneDetect||t[71]!==W?(G=(0,$.jsx)(`button`,{type:`button`,className:U,onClick:W,children:i.timezoneDetect}),t[70]=i.timezoneDetect,t[71]=W,t[72]=G):G=t[72];let ee;t[73]!==H||t[74]!==G?(ee=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:[H,G]}),t[73]=H,t[74]=G,t[75]=ee):ee=t[75];let te;t[76]!==l||t[77]!==o||t[78]!==f||t[79]!==b?(te=f?(0,$.jsx)(`input`,{className:s(o,`mt-1 font-mono text-xs`),value:l,onChange:e=>{u(e.target.value),b({timezone:e.target.value})},placeholder:`e.g. Asia/Shanghai`,autoComplete:`off`}):null,t[76]=l,t[77]=o,t[78]=f,t[79]=b,t[80]=te):te=t[80];let ne;t[81]!==L||t[82]!==ee||t[83]!==te?(ne=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[L,ee,te]}),t[81]=L,t[82]=ee,t[83]=te,t[84]=ne):ne=t[84];let re;t[85]===i.notes?re=t[86]:(re=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.notes}),t[85]=i.notes,t[86]=re);let ie;t[87]===o?ie=t[88]:(ie=s(o,`min-h-28 resize-y text-sm leading-relaxed`),t[87]=o,t[88]=ie);let ae;t[89]===b?ae=t[90]:(ae=e=>b({notes:e.target.value}),t[89]=b,t[90]=ae);let q;t[91]!==i.notesPlaceholder||t[92]!==ie||t[93]!==ae||t[94]!==n.notes?(q=(0,$.jsx)(`textarea`,{className:ie,value:n.notes,onChange:ae,placeholder:i.notesPlaceholder,rows:5,spellCheck:!0}),t[91]=i.notesPlaceholder,t[92]=ie,t[93]=ae,t[94]=n.notes,t[95]=q):q=t[95];let oe;t[96]!==re||t[97]!==q?(oe=(0,$.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[re,q]}),t[96]=re,t[97]=q,t[98]=oe):oe=t[98];let Y;return t[99]!==E||t[100]!==I||t[101]!==ne||t[102]!==oe?(Y=(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[E,I,ne,oe]}),t[99]=E,t[100]=I,t[101]=ne,t[102]=oe,t[103]=Y):Y=t[103],Y}function Ie(e){let t=(0,Pe.c)(57),{open:n,t:r,onOpenChange:i,onNavigate:a}=e,o;t[0]!==r.helpLearningBody||t[1]!==r.helpLearningTitle?(o={icon:m,title:r.helpLearningTitle,body:r.helpLearningBody},t[0]=r.helpLearningBody,t[1]=r.helpLearningTitle,t[2]=o):o=t[2];let c;t[3]!==r.helpSharingBody||t[4]!==r.helpSharingTitle?(c={icon:De,title:r.helpSharingTitle,body:r.helpSharingBody},t[3]=r.helpSharingBody,t[4]=r.helpSharingTitle,t[5]=c):c=t[5];let l;t[6]!==r.helpSourcesBody||t[7]!==r.helpSourcesTitle?(l={icon:R,title:r.helpSourcesTitle,body:r.helpSourcesBody},t[6]=r.helpSourcesBody,t[7]=r.helpSourcesTitle,t[8]=l):l=t[8];let u;t[9]!==r.helpControlBody||t[10]!==r.helpControlTitle?(u={icon:oe,title:r.helpControlTitle,body:r.helpControlBody},t[9]=r.helpControlBody,t[10]=r.helpControlTitle,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==c||t[14]!==l||t[15]!==u?(d=[o,c,l,u],t[12]=o,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16];let f=d,p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(_,{className:s(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,re)}),t[17]=p):p=t[17];let h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=s(`fixed right-3 top-1/2 flex h-[min(44rem,calc(100dvh-1.5rem))] w-[min(30rem,calc(100vw-1.5rem))] -translate-y-1/2 flex-col overflow-hidden`,Ce,`rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`),t[18]=h):h=t[18];let g;t[19]===r.helpTitle?g=t[20]:(g=(0,$.jsx)(_e,{className:`text-base font-semibold text-fg`,children:r.helpTitle}),t[19]=r.helpTitle,t[20]=g);let v;t[21]===r.helpSubtitle?v=t[22]:(v=(0,$.jsx)(F,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r.helpSubtitle}),t[21]=r.helpSubtitle,t[22]=v);let b;t[23]!==g||t[24]!==v?(b=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[g,v]}),t[23]=g,t[24]=v,t[25]=b):b=t[25];let x;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[26]=x):x=t[26];let S;t[27]===r.close?S=t[28]:(S=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":r.close,children:x})}),t[27]=r.close,t[28]=S);let w;t[29]!==b||t[30]!==S?(w=(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[b,S]}),t[29]=b,t[30]=S,t[31]=w):w=t[31];let T;t[32]===f?T=t[33]:(T=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-2`,children:f.map(Le)}),t[32]=f,t[33]=T);let E;t[34]!==a||t[35]!==i?(E=()=>{i(!1),a(`sources`)},t[34]=a,t[35]=i,t[36]=E):E=t[36];let O;t[37]!==r.tabs.sources||t[38]!==E?(O=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,onClick:E,children:r.tabs.sources}),t[37]=r.tabs.sources,t[38]=E,t[39]=O):O=t[39];let k;t[40]!==a||t[41]!==i?(k=()=>{i(!1),a(`privacy`)},t[40]=a,t[41]=i,t[42]=k):k=t[42];let j;t[43]!==r.openPrivacyControls||t[44]!==k?(j=(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:k,children:r.openPrivacyControls}),t[43]=r.openPrivacyControls,t[44]=k,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==j?(M=(0,$.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[O,j]}),t[46]=O,t[47]=j,t[48]=M):M=t[48];let P;t[49]!==w||t[50]!==T||t[51]!==M?(P=(0,$.jsxs)(C,{children:[p,(0,$.jsxs)(A,{className:h,children:[w,T,M]})]}),t[49]=w,t[50]=T,t[51]=M,t[52]=P):P=t[52];let I;return t[53]!==i||t[54]!==n||t[55]!==P?(I=(0,$.jsx)(N,{open:n,onOpenChange:i,children:P}),t[53]=i,t[54]=n,t[55]=P,t[56]=I):I=t[56],I}function Le(e){let{icon:t,title:n,body:r}=e;return(0,$.jsxs)(`section`,{className:`flex gap-3 border-b border-edge-subtle py-4 last:border-b-0`,children:[(0,$.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface-muted text-fg-muted`,children:(0,$.jsx)(t,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r})]})]},n)}function Re(e){let t=(0,Pe.c)(33),{source:n,language:r,busy:i,onOpenChange:a,onConfirm:o}=e,l=c(r).you,[u,d]=(0,Q.useState)(!1),f=n?.accountLabel??(n?.accountCount&&n.accountCount>1&&n.accountOrdinal?l.sourceAccountFallback.replace(`{{index}}`,String(n.accountOrdinal)).replace(`{{count}}`,String(n.accountCount)):void 0),p,m;t[0]===n?(p=t[1],m=t[2]):(p=()=>{n&&d(!1)},m=[n],t[0]=n,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h;t[3]!==i||t[4]!==a?(h=e=>!i&&a(e),t[3]=i,t[4]=a,t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[6]=g):g=t[6];let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[7]=v):v=t[7];let b;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>d(!1),t[8]=b):b=t[8];let S=u?`border-edge-subtle hover:bg-surface-hover`:`border-accent/40 bg-accent-soft/35`,w;t[9]===S?w=t[10]:(w=s(`flex w-full items-start gap-3 rounded-xl border p-4 text-left`,S),t[9]=S,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(R,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>d(!0),t[12]=E):E=t[12];let O=u?`border-danger/40 bg-danger-soft`:`border-edge-subtle hover:bg-surface-hover`,k;t[13]===O?k=t[14]:(k=s(`flex w-full items-start gap-3 rounded-xl border p-4 text-left disabled:cursor-not-allowed disabled:opacity-55`,O),t[13]=O,t[14]=k);let j;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-danger`,"aria-hidden":!0}),t[15]=j):j=t[15];let M=l.disconnectDeleteBody.replace(`{{count}}`,String(n?.derivedUnderstandingCount??0)),P;t[16]===M?P=t[17]:(P=(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:M}),t[16]=M,t[17]=P);let L;t[18]!==i||t[19]!==l.cancel?(L=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`ghost`,disabled:i,children:l.cancel})}),t[18]=i,t[19]=l.cancel,t[20]=L):L=t[20];let z=u?`border-danger/35 text-danger hover:bg-danger-soft`:void 0,B;t[21]!==u||t[22]!==o?(B=()=>o(u),t[21]=u,t[22]=o,t[23]=B):B=t[23];let V;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0}),t[24]=V):V=t[24];let H=i?l.disconnecting:l.disconnectAction,U;t[25]!==i||t[26]!==z||t[27]!==B||t[28]!==H?(U=(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:z,disabled:i,onClick:B,children:[V,H]}),t[25]=i,t[26]=z,t[27]=B,t[28]=H,t[29]=U):U=t[29];let W;return t[30]!==L||t[31]!==U?(W=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:[L,U]}),t[30]=L,t[31]=U,t[32]=W):W=t[32],(0,$.jsx)(N,{open:n!==null,onOpenChange:h,children:(0,$.jsxs)(C,{children:[g,(0,$.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[131] flex h-[min(31rem,calc(100dvh-2rem))] w-[min(32rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-elevated`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(_e,{className:`text-base font-semibold text-fg`,children:l.disconnectTitle}),(0,$.jsx)(F,{className:`mt-1 text-sm text-fg-muted`,children:l.disconnectBody.replace(`{{source}}`,n?.displayName??``)})]}),(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":l.cancel,disabled:i,children:v})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-muted px-4 py-3 text-xs leading-5 text-fg-muted`,children:[f?(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:l.disconnectAccount.replace(`{{account}}`,f)}):null,(0,$.jsx)(`p`,{children:l.disconnectImpact.replace(`{{items}}`,String(n?.knowledgeItemCount??0)).replace(`{{understandings}}`,String(n?.derivedUnderstandingCount??0))})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":!u,onClick:b,className:w,children:[T,(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:l.disconnectKeepTitle}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:l.disconnectKeepBody})]})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":u,onClick:E,disabled:!n?.derivedUnderstandingCount,className:k,children:[j,(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:l.disconnectDeleteTitle}),P]})]})]}),W]})]})})}var ze={"composio-gmail":`gmail`,"composio-googledrive":`google-drive`,"composio-notion":`notion`,"composio-slack":`slack`,memory:`memory`};function Be(e){if(e.branding?.logoUrl)return e.branding;let t=ze[e.id];return t?{...e.branding,logoUrl:`/connector-icons/${t}.svg`}:e.branding}function Ve(e,t){return Object.entries(t).reduce((e,[t,n])=>e.replace(`{{${t}}}`,String(n)),e)}function He(e){return e.status===`active`||e.status===`connected`}function Ue(e,t){return!He(e)||e.learning?.status===`failed`||e.lastSyncStatus===`failed`?{summary:t.sourceNeedsAttention,tone:`attention`,badge:t.attentionTitle}:e.learning?.status===`paused`?{summary:t.sourcePausedSummary,tone:`paused`,badge:t.paused}:e.learning?.status===`queued`||e.learning?.status===`running`?{summary:t.sourceReading,tone:`learning`}:e.learningFunnel.provisionalClaims>0?{summary:Ve(t.sourcePendingReview,{count:e.learningFunnel.provisionalClaims}),tone:`review`}:e.learningFunnel.activeClaims>0?{summary:Ve(t.sourceReliable,{count:e.learningFunnel.activeClaims}),tone:`useful`}:e.learningFunnel.attributedItems>0?{summary:Ve(t.sourceStillLearning,{count:e.learningFunnel.attributedItems}),tone:`learning`}:e.learningFunnel.indexedItems>0?{summary:Ve(t.sourceNoPersonalSignal,{count:e.learningFunnel.indexedItems}),tone:`neutral`}:e.learning?.status===`completed`?{summary:t.sourceNoRecentSignal,tone:`neutral`}:{summary:t.sourcePreparing,tone:`learning`}}function We(e,t){let n=e.id.toLocaleLowerCase();return/(github|gitlab|linear|jira)/.test(n)?t.sourcePurposeWork:/(gmail|outlook|slack|teams)/.test(n)?t.sourcePurposeCommunication:/calendar/.test(n)?t.sourcePurposeSchedule:/(docs|drive|notion|sheets|excel|onedrive|one-drive|local-files)/.test(n)?t.sourcePurposeDocuments:t.sourcePurposeDefault}function Ge(e,t){return e.accountLabel?e.accountLabel:e.accountCount&&e.accountCount>1&&e.accountOrdinal?Ve(t.sourceAccountFallback,{index:e.accountOrdinal,count:e.accountCount}):t.sourceUnknownAccount}function Ke(e){return e.lastSyncAt??e.learning?.updatedAt??e.lastActivityAt??e.lastConnectedAt}function qe(e,t){let n=Date.parse(e);return Number.isFinite(n)?X(n,t):e}function Je(e,t){return{attention:0,learning:1,review:2,useful:3,paused:4,neutral:5}[Ue(e,t).tone]}function Ye(e){let t=(0,Pe.c)(173),{source:n,language:r,t:i,busy:a,onOpenChange:o,onLearn:c,onPause:l,onConfigure:u,onDisconnect:d,onViewUnderstanding:f}=e;if(!n)return null;let p;t[0]!==n||t[1]!==i?(p=Ue(n,i),t[0]=n,t[1]=i,t[2]=p):p=t[2];let h=p,g,v,b,x,S,w,T,E,O,k,j,M,P,L,R,z;if(t[3]!==r||t[4]!==o||t[5]!==f||t[6]!==h.summary||t[7]!==h.tone||t[8]!==n||t[9]!==i){let e=Ke(n);x=n.learning?.status===`paused`,S=h.tone===`attention`,b=N,T=!0,E=o,v=C,t[26]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[26]=w):w=t[26],g=A,R=`fixed inset-y-0 right-0 z-[131] flex h-dvh w-[min(34rem,100vw)] flex-col overflow-hidden border-l border-edge bg-surface-panel shadow-elevated`;let a=n.displayName,c;t[27]===n?c=t[28]:(c=Be(n),t[27]=n,t[28]=c);let l;t[29]!==n.displayName||t[30]!==c?(l=(0,$.jsx)(Ne,{connector:{displayName:a,branding:c},size:`sm`}),t[29]=n.displayName,t[30]=c,t[31]=l):l=t[31];let u;t[32]===n.displayName?u=t[33]:(u=(0,$.jsx)(_e,{className:`truncate text-base font-semibold text-fg`,children:n.displayName}),t[32]=n.displayName,t[33]=u);let d;t[34]!==n||t[35]!==i?(d=Ge(n,i),t[34]=n,t[35]=i,t[36]=d):d=t[36];let p;t[37]===d?p=t[38]:(p=(0,$.jsx)(F,{className:`mt-0.5 truncate text-sm text-fg-muted`,children:d}),t[37]=d,t[38]=p);let I;t[39]!==u||t[40]!==p?(I=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,p]}),t[39]=u,t[40]=p,t[41]=I):I=t[41];let B;t[42]!==l||t[43]!==I?(B=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[l,I]}),t[42]=l,t[43]=I,t[44]=B):B=t[44];let V;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[45]=V):V=t[45];let H;t[46]===i.close?H=t[47]:(H=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":i.close,children:V})}),t[46]=i.close,t[47]=H),t[48]!==B||t[49]!==H?(z=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-4`,children:[B,H]}),t[48]=B,t[49]=H,t[50]=z):z=t[50],P=`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`;let U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(m,{className:`size-4 text-accent`,"aria-hidden":!0}),t[51]=U):U=t[51];let G;t[52]===i.sourceOutcomeTitle?G=t[53]:(G=(0,$.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[U,i.sourceOutcomeTitle]}),t[52]=i.sourceOutcomeTitle,t[53]=G);let K=h.tone===`attention`?`border-warning/30 bg-warning-soft text-fg`:`border-edge-subtle bg-surface-muted text-fg`,ee;t[54]===K?ee=t[55]:(ee=s(`mt-3 rounded-xl border px-4 py-3 text-sm leading-6`,K),t[54]=K,t[55]=ee);let te;t[56]!==h.summary||t[57]!==ee?(te=(0,$.jsx)(`p`,{className:ee,children:h.summary}),t[56]=h.summary,t[57]=ee,t[58]=te):te=t[58];let ne;t[59]===n.learningFunnel.activeClaims?ne=t[60]:(ne=(0,$.jsx)(`strong`,{className:`text-xl font-semibold text-fg`,children:n.learningFunnel.activeClaims}),t[59]=n.learningFunnel.activeClaims,t[60]=ne);let re;t[61]===i.sourceReliableMetric?re=t[62]:(re=(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:i.sourceReliableMetric}),t[61]=i.sourceReliableMetric,t[62]=re);let ie;t[63]!==ne||t[64]!==re?(ie=(0,$.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-base px-4 py-3`,children:[ne,re]}),t[63]=ne,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]===n.learningFunnel.provisionalClaims?ae=t[67]:(ae=(0,$.jsx)(`strong`,{className:`text-xl font-semibold text-fg`,children:n.learningFunnel.provisionalClaims}),t[66]=n.learningFunnel.provisionalClaims,t[67]=ae);let q;t[68]===i.sourcePendingMetric?q=t[69]:(q=(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:i.sourcePendingMetric}),t[68]=i.sourcePendingMetric,t[69]=q);let oe;t[70]!==ae||t[71]!==q?(oe=(0,$.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-base px-4 py-3`,children:[ae,q]}),t[70]=ae,t[71]=q,t[72]=oe):oe=t[72];let J;t[73]!==ie||t[74]!==oe?(J=(0,$.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3`,children:[ie,oe]}),t[73]=ie,t[74]=oe,t[75]=J):J=t[75];let Y;t[76]!==f||t[77]!==n.learningFunnel.activeClaims||t[78]!==n.learningFunnel.provisionalClaims||t[79]!==i.sourceViewUnderstanding?(Y=n.learningFunnel.activeClaims>0||n.learningFunnel.provisionalClaims>0?(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`mt-2 px-2`,onClick:f,children:[i.sourceViewUnderstanding,(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]}):null,t[76]=f,t[77]=n.learningFunnel.activeClaims,t[78]=n.learningFunnel.provisionalClaims,t[79]=i.sourceViewUnderstanding,t[80]=Y):Y=t[80],t[81]!==G||t[82]!==te||t[83]!==J||t[84]!==Y?(L=(0,$.jsxs)(`section`,{children:[G,te,J,Y]}),t[81]=G,t[82]=te,t[83]=J,t[84]=Y,t[85]=L):L=t[85],O=`border-t border-edge-subtle pt-5`;let X;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(le,{className:`size-4 text-accent`,"aria-hidden":!0}),t[86]=X):X=t[86],t[87]===i.sourceRecentRunTitle?k=t[88]:(k=(0,$.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[X,i.sourceRecentRunTitle]}),t[87]=i.sourceRecentRunTitle,t[88]=k);let se;t[89]!==n.learningFunnel.activeClaims||t[90]!==n.learningFunnel.attributedItems||t[91]!==n.learningFunnel.indexedItems||t[92]!==i.sourceRecentRunSummary?(se=Ve(i.sourceRecentRunSummary,{indexed:n.learningFunnel.indexedItems,attributed:n.learningFunnel.attributedItems,claims:n.learningFunnel.activeClaims}),t[89]=n.learningFunnel.activeClaims,t[90]=n.learningFunnel.attributedItems,t[91]=n.learningFunnel.indexedItems,t[92]=i.sourceRecentRunSummary,t[93]=se):se=t[93],t[94]===se?j=t[95]:(j=(0,$.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-fg-muted`,children:se}),t[94]=se,t[95]=j),M=e?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:Ve(i.sourceUpdatedAt,{time:qe(e,r)})}):null,t[3]=r,t[4]=o,t[5]=f,t[6]=h.summary,t[7]=h.tone,t[8]=n,t[9]=i,t[10]=g,t[11]=v,t[12]=b,t[13]=x,t[14]=S,t[15]=w,t[16]=T,t[17]=E,t[18]=O,t[19]=k,t[20]=j,t[21]=M,t[22]=P,t[23]=L,t[24]=R,t[25]=z}else g=t[10],v=t[11],b=t[12],x=t[13],S=t[14],w=t[15],T=t[16],E=t[17],O=t[18],k=t[19],j=t[20],M=t[21],P=t[22],L=t[23],R=t[24],z=t[25];let B;t[96]!==O||t[97]!==k||t[98]!==j||t[99]!==M?(B=(0,$.jsxs)(`section`,{className:O,children:[k,j,M]}),t[96]=O,t[97]=k,t[98]=j,t[99]=M,t[100]=B):B=t[100];let V;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(oe,{className:`size-4 text-accent`,"aria-hidden":!0}),t[101]=V):V=t[101];let H;t[102]===i.sourceAccessTitle?H=t[103]:(H=(0,$.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[V,i.sourceAccessTitle]}),t[102]=i.sourceAccessTitle,t[103]=H);let U;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(pe,{className:`mt-1 size-4 shrink-0 text-success`,"aria-hidden":!0}),t[104]=U):U=t[104];let G;t[105]===i.sourceReadAccess?G=t[106]:(G=(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[U,(0,$.jsx)(`span`,{children:i.sourceReadAccess})]}),t[105]=i.sourceReadAccess,t[106]=G);let K;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(pe,{className:`mt-1 size-4 shrink-0 text-success`,"aria-hidden":!0}),t[107]=K):K=t[107];let te;t[108]===i.sourceMemoryAccess?te=t[109]:(te=(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[K,(0,$.jsx)(`span`,{children:i.sourceMemoryAccess})]}),t[108]=i.sourceMemoryAccess,t[109]=te);let ne;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(oe,{className:`mt-1 size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[110]=ne):ne=t[110];let re=n.access.write?i.sourceWriteAccess:i.sourceNoWriteAccess,ie;t[111]===re?ie=t[112]:(ie=(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[ne,(0,$.jsx)(`span`,{children:re})]}),t[111]=re,t[112]=ie);let ae;t[113]!==G||t[114]!==te||t[115]!==ie?(ae=(0,$.jsxs)(`ul`,{className:`mt-3 space-y-2 text-sm leading-6 text-fg-muted`,children:[G,te,ie]}),t[113]=G,t[114]=te,t[115]=ie,t[116]=ae):ae=t[116];let q;t[117]!==H||t[118]!==ae?(q=(0,$.jsxs)(`section`,{className:`border-t border-edge-subtle pt-5`,children:[H,ae]}),t[117]=H,t[118]=ae,t[119]=q):q=t[119];let J;t[120]!==B||t[121]!==q||t[122]!==P||t[123]!==L?(J=(0,$.jsxs)(`div`,{className:P,children:[L,B,q]}),t[120]=B,t[121]=q,t[122]=P,t[123]=L,t[124]=J):J=t[124];let Y;t[125]===i.sourceManagementTitle?Y=t[126]:(Y=(0,$.jsx)(`p`,{className:`mb-2 px-1 text-xs font-medium text-fg-subtle`,children:i.sourceManagementTitle}),t[125]=i.sourceManagementTitle,t[126]=Y);let X;t[127]!==a||t[128]!==x||t[129]!==S||t[130]!==c||t[131]!==l||t[132]!==n||t[133]!==i.sourcePauseLearning||t[134]!==i.sourceResumeLearning||t[135]!==i.sourceRetryLearning?(X=He(n)?x||S?(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:a,onClick:()=>c(n),children:[a?(0,$.jsx)(we,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),S?i.sourceRetryLearning:i.sourceResumeLearning]}):(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:a,onClick:()=>l(n),children:[(0,$.jsx)(Ee,{className:`size-4`,"aria-hidden":!0}),i.sourcePauseLearning]}):null,t[127]=a,t[128]=x,t[129]=S,t[130]=c,t[131]=l,t[132]=n,t[133]=i.sourcePauseLearning,t[134]=i.sourceResumeLearning,t[135]=i.sourceRetryLearning,t[136]=X):X=t[136];let se;t[137]!==u||t[138]!==n?(se=()=>u(n),t[137]=u,t[138]=n,t[139]=se):se=t[139];let ce;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),t[140]=ce):ce=t[140];let ue;t[141]!==i.sourceConnectionSettings||t[142]!==se?(ue=(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:se,children:[ce,i.sourceConnectionSettings]}),t[141]=i.sourceConnectionSettings,t[142]=se,t[143]=ue):ue=t[143];let de;t[144]!==d||t[145]!==n?(de=()=>d(n),t[144]=d,t[145]=n,t[146]=de):de=t[146];let me;t[147]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0}),t[147]=me):me=t[147];let he;t[148]!==i.disconnect||t[149]!==de?(he=(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`ml-auto text-danger hover:bg-danger-soft hover:text-danger`,onClick:de,children:[me,i.disconnect]}),t[148]=i.disconnect,t[149]=de,t[150]=he):he=t[150];let ge;t[151]!==X||t[152]!==ue||t[153]!==he?(ge=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[X,ue,he]}),t[151]=X,t[152]=ue,t[153]=he,t[154]=ge):ge=t[154];let ve;t[155]!==Y||t[156]!==ge?(ve=(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle p-4`,children:[Y,ge]}),t[155]=Y,t[156]=ge,t[157]=ve):ve=t[157];let ye;t[158]!==g||t[159]!==J||t[160]!==ve||t[161]!==R||t[162]!==z?(ye=(0,$.jsxs)(g,{className:R,children:[z,J,ve]}),t[158]=g,t[159]=J,t[160]=ve,t[161]=R,t[162]=z,t[163]=ye):ye=t[163];let be;t[164]!==v||t[165]!==w||t[166]!==ye?(be=(0,$.jsxs)(v,{children:[w,ye]}),t[164]=v,t[165]=w,t[166]=ye,t[167]=be):be=t[167];let xe;return t[168]!==b||t[169]!==T||t[170]!==E||t[171]!==be?(xe=(0,$.jsx)(b,{open:T,onOpenChange:E,children:be}),t[168]=b,t[169]=T,t[170]=E,t[171]=be,t[172]=xe):xe=t[172],xe}function Xe(e){let t=(0,Pe.c)(69),{sources:n,language:r,t:i,busyId:a,onAddSource:o,onLearn:c,onPause:l,onConfigure:u,onDisconnect:d,onViewUnderstanding:f}=e,[p,m]=(0,Q.useState)(null),h;if(t[0]!==n||t[1]!==i){let e=n.filter(Qe),r=new Map;for(let t of e){let e=r.get(t.id)??[];e.push(t),r.set(t.id,e)}let a;t[3]===i?a=t[4]:(a=(e,t)=>Math.min(...e.accounts.map(e=>Je(e,i)))-Math.min(...t.accounts.map(e=>Je(e,i)))||e.source.displayName.localeCompare(t.source.displayName),t[3]=i,t[4]=a),h=[...r.values()].map(e=>({source:e[0],accounts:e.sort((e,t)=>Je(e,i)-Je(t,i)||Ge(e,i).localeCompare(Ge(t,i)))})).sort(a),t[0]=n,t[1]=i,t[2]=h}else h=t[2];let g=h,_,v,y,b,x,S,C,w,T;if(t[5]!==g||t[6]!==p||t[7]!==n||t[8]!==i.sourceConnectedSummary||t[9]!==i.sourcesSubtitle||t[10]!==i.sourcesTitle){let e=g.reduce(Ze,0),r;t[20]!==p||t[21]!==n?(r=p?n.find(e=>e.instanceId===p)??null:null,t[20]=p,t[21]=n,t[22]=r):r=t[22],_=r,S=`you-panel-sources`,C=`tabpanel`,w=`you-tab-sources`,T=`space-y-5`,x=`flex flex-wrap items-start justify-between gap-3`,t[23]===i.sourcesTitle?v=t[24]:(v=(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:i.sourcesTitle}),t[23]=i.sourcesTitle,t[24]=v),t[25]===i.sourcesSubtitle?y=t[26]:(y=(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:i.sourcesSubtitle}),t[25]=i.sourcesSubtitle,t[26]=y),b=g.length>0?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:Ve(i.sourceConnectedSummary,{accounts:e,sources:g.length})}):null,t[5]=g,t[6]=p,t[7]=n,t[8]=i.sourceConnectedSummary,t[9]=i.sourcesSubtitle,t[10]=i.sourcesTitle,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=S,t[17]=C,t[18]=w,t[19]=T}else _=t[11],v=t[12],y=t[13],b=t[14],x=t[15],S=t[16],C=t[17],w=t[18],T=t[19];let E;t[27]!==v||t[28]!==y||t[29]!==b?(E=(0,$.jsxs)(`div`,{children:[v,y,b]}),t[27]=v,t[28]=y,t[29]=b,t[30]=E):E=t[30];let D;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(ue,{className:`size-4`,"aria-hidden":!0}),t[31]=D):D=t[31];let O;t[32]!==o||t[33]!==i.addSource?(O=(0,$.jsxs)(Z,{type:`button`,variant:`primary`,onClick:o,children:[D,i.addSource]}),t[32]=o,t[33]=i.addSource,t[34]=O):O=t[34];let k;t[35]!==E||t[36]!==O||t[37]!==x?(k=(0,$.jsxs)(`div`,{className:x,children:[E,O]}),t[35]=E,t[36]=O,t[37]=x,t[38]=k):k=t[38];let A;t[39]!==g||t[40]!==r||t[41]!==o||t[42]!==i?(A=g.length>0?(0,$.jsx)(`div`,{className:`space-y-3`,children:g.map(e=>{let{source:t,accounts:n}=e;return(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-edge-subtle px-4 py-3.5 sm:px-5`,children:[(0,$.jsx)(Ne,{connector:{displayName:t.displayName,branding:Be(t)},size:`sm`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.displayName}),n.length>1?(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:Ve(i.sourceAccountCount,{count:n.length})}):null]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:We(t,i)})]})]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>{let t=Ue(e,i),n=Ke(e);return(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/40 sm:px-5`,onClick:()=>m(e.instanceId??null),children:[(0,$.jsx)(`span`,{className:s(`size-2 shrink-0 rounded-full`,t.tone===`attention`?`bg-warning`:t.tone===`useful`?`bg-success`:t.tone===`learning`?`bg-accent`:`bg-fg-subtle/50`),"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:Ge(e,i)}),t.badge?(0,$.jsx)(`span`,{className:s(`rounded-full px-2 py-0.5 text-[11px] font-medium`,t.tone===`attention`?`bg-warning-soft text-fg`:`bg-surface-muted text-fg-muted`),children:t.badge}):null]}),(0,$.jsx)(`span`,{className:s(`mt-1 block text-xs leading-5`,t.tone===`attention`?`text-fg`:`text-fg-muted`),children:t.summary})]}),n?(0,$.jsx)(`span`,{className:`hidden shrink-0 text-xs text-fg-subtle sm:block`,children:Ve(i.sourceUpdatedAt,{time:qe(n,r)})}):null,(0,$.jsx)(W,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]},e.instanceId)})})]},t.id)})}):(0,$.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-edge p-10 text-center`,children:[(0,$.jsx)(Y,{className:`mx-auto size-5 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:i.noSources}),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:`mt-4`,onClick:o,children:[(0,$.jsx)(ue,{className:`size-4`,"aria-hidden":!0}),i.addSource]})]}),t[39]=g,t[40]=r,t[41]=o,t[42]=i,t[43]=A):A=t[43];let j=_?a===`source-learning:${_.instanceId}`:!1,M;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e||m(null)},t[44]=M):M=t[44];let N;t[45]===u?N=t[46]:(N=e=>{m(null),u(e)},t[45]=u,t[46]=N);let P;t[47]===d?P=t[48]:(P=e=>{m(null),d(e)},t[47]=d,t[48]=P);let F;t[49]===f?F=t[50]:(F=()=>{m(null),f()},t[49]=f,t[50]=F);let I;t[51]!==r||t[52]!==c||t[53]!==l||t[54]!==_||t[55]!==i||t[56]!==j||t[57]!==N||t[58]!==P||t[59]!==F?(I=(0,$.jsx)(Ye,{source:_,language:r,t:i,busy:j,onOpenChange:M,onLearn:c,onPause:l,onConfigure:N,onDisconnect:P,onViewUnderstanding:F}),t[51]=r,t[52]=c,t[53]=l,t[54]=_,t[55]=i,t[56]=j,t[57]=N,t[58]=P,t[59]=F,t[60]=I):I=t[60];let L;return t[61]!==k||t[62]!==A||t[63]!==I||t[64]!==S||t[65]!==C||t[66]!==w||t[67]!==T?(L=(0,$.jsxs)(`div`,{id:S,role:C,"aria-labelledby":w,className:T,children:[k,A,I]}),t[61]=k,t[62]=A,t[63]=I,t[64]=S,t[65]=C,t[66]=w,t[67]=T,t[68]=L):L=t[68],L}function Ze(e,t){return e+t.accounts.length}function Qe(e){return e.installed}var $e=new Set([`overview`,`memory`,`collaboration`,`sources`,`privacy`]);function et(e){return e&&$e.has(e)?e:`overview`}var tt=[`collaboration`,`priorities`,`boundaries`,`people`,`current`,`basics`],nt=[`relationship`,`routine`,`long_term_goal`],rt=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/50 focus:ring-2 focus:ring-accent/20`;function it(e,t){return e.replace(`{{count}}`,String(t))}function at(e){let t=(0,Pe.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`inline-flex rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function ot(e,t){let n=Date.parse(e);return Number.isFinite(n)?X(n,t):e}function st(){let e=(0,Pe.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(q,{className:`h-24 rounded-2xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[t,(0,$.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,$.jsx)(q,{className:`h-64 rounded-2xl`}),(0,$.jsx)(q,{className:`h-64 rounded-2xl`})]})]}),e[1]=n):n=e[1],n}function ct(e,t){return e.origin===`connected_source`?t.origins.connected_source.replace(`{{source}}`,e.sourceName):t.origins[e.origin]}function lt(e){let t=(0,Pe.c)(19),{item:n,language:r,t:i,busy:a,onConfirm:c,onReject:l,onUpdate:u,onForget:d}=e,[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(n.statement),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(!1),b=n.status!==`active`,S=b?`border-warning/35 bg-warning-soft/35`:`border-edge-subtle bg-surface-panel`,C;t[0]===S?C=t[1]:(C=s(`rounded-xl border p-3.5`,S),t[0]=S,t[1]=C);let E;t[2]!==a||t[3]!==m||t[4]!==f||t[5]!==g||t[6]!==v||t[7]!==n||t[8]!==r||t[9]!==b||t[10]!==c||t[11]!==d||t[12]!==l||t[13]!==u||t[14]!==i?(E=f?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`textarea`,{className:s(rt,`min-h-20 resize-y`),value:m,onChange:e=>h(e.target.value),placeholder:i.updatePlaceholder}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>{h(n.statement),p(!1)},children:i.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:a||!m.trim(),onClick:()=>{u(m.trim()),p(!1)},children:i.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:n.statement}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,$.jsx)(ee,{className:`size-3 text-accent`,"aria-hidden":!0}),ct(n,i)]}),(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5`,children:i.stability[n.stability]}),n.evidenceCount>0?(0,$.jsx)(`span`,{children:it(i.evidenceCount,n.evidenceCount)}):null,n.latestEvidenceAt?(0,$.jsx)(`span`,{children:i.observedAt.replace(`{{time}}`,ot(n.latestEvidenceAt,r))}):null]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:c,children:[(0,$.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),i.confirm]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:l,children:[(0,$.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),i.notTrue]})]}):null,(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:()=>p(!0),children:[(0,$.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),i.change]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:v,onClick:()=>{if(g){_(null);return}y(!0),w(n.id).then(e=>_(e.history)).finally(()=>y(!1))},children:[(0,$.jsx)(Te,{className:`size-3.5`,"aria-hidden":!0}),i.history]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:d,children:[(0,$.jsx)(x,{className:`size-3.5`,"aria-hidden":!0}),i.forget]})]})]}),(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-muted/70 px-3 py-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer font-medium text-fg-muted`,children:i.viewEvidence}),(0,$.jsxs)(`dl`,{className:`mt-2 grid gap-1.5 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceSource}),(0,$.jsx)(`dd`,{className:`mt-0.5 break-all text-fg-muted`,children:n.sourceName})]}),n.sourcePath?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidencePath}),(0,$.jsx)(`dd`,{className:`mt-0.5 break-all text-fg-muted`,children:n.sourcePath})]}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceUpdated}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:ot(n.updatedAt,r)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceSupport}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:it(i.evidenceCount,n.evidenceCount)})]}),n.evidenceBasis?(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceRule}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:i.evidenceRuleValue.replace(`{{events}}`,String(n.evidenceBasis.eventCount)).replace(`{{days}}`,String(n.evidenceBasis.activeDays)).replace(`{{window}}`,String(n.evidenceBasis.windowDays))})]}):null,n.confidence===void 0?null:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceConfidence}),(0,$.jsxs)(`dd`,{className:`mt-0.5 text-fg-muted`,children:[Math.round(n.confidence*100),`%`]})]}),n.validTo?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceValidUntil}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:ot(n.validTo,r)})]}):null,n.expiresAt?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceExpires}),(0,$.jsx)(`dd`,{className:`mt-0.5 text-fg-muted`,children:ot(n.expiresAt,r)})]}):null]})]}),g?(0,$.jsxs)(`div`,{className:`mt-2 space-y-2 border-t border-edge pt-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.historyTitle}),g.map(e=>(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3 text-xs`,children:[(0,$.jsx)(`p`,{className:`min-w-0 text-fg-muted`,children:e.statement}),(0,$.jsx)(`span`,{className:`shrink-0 text-fg-subtle`,children:ot(e.updatedAt,r)})]},e.id))]}):null]}),t[2]=a,t[3]=m,t[4]=f,t[5]=g,t[6]=v,t[7]=n,t[8]=r,t[9]=b,t[10]=c,t[11]=d,t[12]=l,t[13]=u,t[14]=i,t[15]=E):E=t[15];let O;return t[16]!==C||t[17]!==E?(O=(0,$.jsx)(`article`,{className:C,children:E}),t[16]=C,t[17]=E,t[18]=O):O=t[18],O}function ut(e){let t=(0,Pe.c)(86),{claim:n,language:r,t:i,busy:a,onDecision:c}=e,l=typeof n.value.label==`string`?n.value.label:``,u;if(t[0]!==n.class||t[1]!==n.value.hour||t[2]!==n.value.weekday||t[3]!==l||t[4]!==r||t[5]!==i.claimProject||t[6]!==i.claimRelationship||t[7]!==i.claimRoutine){let e=r===`zh`?[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`]:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];u=n.class===`relationship`?i.claimRelationship.replace(`{{label}}`,l):n.class===`project`?i.claimProject.replace(`{{label}}`,l):i.claimRoutine.replace(`{{weekday}}`,e[Number(n.value.weekday)]??``).replace(`{{hour}}`,String(n.value.hour).padStart(2,`0`)),t[0]=n.class,t[1]=n.value.hour,t[2]=n.value.weekday,t[3]=l,t[4]=r,t[5]=i.claimProject,t[6]=i.claimRelationship,t[7]=i.claimRoutine,t[8]=u}else u=t[8];let d=u,f;t[9]===n.evidence?f=t[10]:(f=new Set(n.evidence.map(dt)),t[9]=n.evidence,t[10]=f);let p;t[11]===f?p=t[12]:(p=[...f],t[11]=f,t[12]=p);let m=p,h=n.state===`provisional`||n.state===`stale`,g=h?`border-warning/35 bg-warning-soft/35`:`border-edge-subtle bg-surface-panel`,_;t[13]===g?_=t[14]:(_=s(`rounded-xl border p-3.5`,g),t[13]=g,t[14]=_);let v=i.claimClasses[n.class],y;t[15]===v?y=t[16]:(y=(0,$.jsx)(`span`,{className:`text-[11px] font-medium text-fg-subtle`,children:v}),t[15]=v,t[16]=y);let b;t[17]===d?b=t[18]:(b=(0,$.jsx)(`p`,{className:`mt-1 text-sm font-medium leading-6 text-fg`,children:d}),t[17]=d,t[18]=b);let x;t[19]!==y||t[20]!==b?(x=(0,$.jsxs)(`div`,{children:[y,b]}),t[19]=y,t[20]=b,t[21]=x):x=t[21];let S=i.claimStates[n.state],C;t[22]===S?C=t[23]:(C=(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:S}),t[22]=S,t[23]=C);let w;t[24]!==C||t[25]!==x?(w=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[x,C]}),t[24]=C,t[25]=x,t[26]=w):w=t[26];let T;t[27]!==n.activeDayCount||t[28]!==n.independentEvidenceCount||t[29]!==i.claimEvidence?(T=i.claimEvidence.replace(`{{events}}`,String(n.independentEvidenceCount)).replace(`{{days}}`,String(n.activeDayCount)),t[27]=n.activeDayCount,t[28]=n.independentEvidenceCount,t[29]=i.claimEvidence,t[30]=T):T=t[30];let E;t[31]===T?E=t[32]:(E=(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:T}),t[31]=T,t[32]=E);let O;t[33]!==n.lastReinforcedAt||t[34]!==r||t[35]!==i.observedAt?(O=i.observedAt.replace(`{{time}}`,ot(n.lastReinforcedAt,r)),t[33]=n.lastReinforcedAt,t[34]=r,t[35]=i.observedAt,t[36]=O):O=t[36];let k;t[37]===O?k=t[38]:(k=(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:O}),t[37]=O,t[38]=k);let A;t[39]!==a||t[40]!==h||t[41]!==c||t[42]!==i.confirm||t[43]!==i.notTrue?(A=h?(0,$.jsxs)(`div`,{className:`flex gap-1`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:()=>c(`confirm`),children:[(0,$.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),i.confirm]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:a,onClick:()=>c(`reject`),children:[(0,$.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),i.notTrue]})]}):null,t[39]=a,t[40]=h,t[41]=c,t[42]=i.confirm,t[43]=i.notTrue,t[44]=A):A=t[44];let j;t[45]!==k||t[46]!==A?(j=(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[k,A]}),t[45]=k,t[46]=A,t[47]=j):j=t[47];let M;t[48]===i.viewEvidence?M=t[49]:(M=(0,$.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:i.viewEvidence}),t[48]=i.viewEvidence,t[49]=M);let N;t[50]===i.evidenceSource?N=t[51]:(N=(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceSource}),t[50]=i.evidenceSource,t[51]=N);let P=m.join(`, `),F;t[52]===P?F=t[53]:(F=(0,$.jsx)(`dd`,{className:`mt-0.5 break-all`,children:P}),t[52]=P,t[53]=F);let I;t[54]!==N||t[55]!==F?(I=(0,$.jsxs)(`div`,{children:[N,F]}),t[54]=N,t[55]=F,t[56]=I):I=t[56];let L;t[57]===i.evidenceConfidence?L=t[58]:(L=(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceConfidence}),t[57]=i.evidenceConfidence,t[58]=L);let R;t[59]===n.confidence?R=t[60]:(R=Math.round(n.confidence*100),t[59]=n.confidence,t[60]=R);let z;t[61]===R?z=t[62]:(z=(0,$.jsxs)(`dd`,{className:`mt-0.5`,children:[R,`%`]}),t[61]=R,t[62]=z);let B;t[63]!==L||t[64]!==z?(B=(0,$.jsxs)(`div`,{children:[L,z]}),t[63]=L,t[64]=z,t[65]=B):B=t[65];let V;t[66]===i.evidenceRule?V=t[67]:(V=(0,$.jsx)(`dt`,{className:`text-fg-subtle`,children:i.evidenceRule}),t[66]=i.evidenceRule,t[67]=V);let H;t[68]===i.claimRule?H=t[69]:(H=(0,$.jsx)(`dd`,{className:`mt-0.5`,children:i.claimRule}),t[68]=i.claimRule,t[69]=H);let U;t[70]!==V||t[71]!==H?(U=(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[V,H]}),t[70]=V,t[71]=H,t[72]=U):U=t[72];let W;t[73]!==I||t[74]!==B||t[75]!==U?(W=(0,$.jsxs)(`dl`,{className:`mt-2 grid gap-1.5 sm:grid-cols-2`,children:[I,B,U]}),t[73]=I,t[74]=B,t[75]=U,t[76]=W):W=t[76];let G;t[77]!==M||t[78]!==W?(G=(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-muted/70 px-3 py-2 text-xs text-fg-muted`,children:[M,W]}),t[77]=M,t[78]=W,t[79]=G):G=t[79];let K;return t[80]!==w||t[81]!==E||t[82]!==j||t[83]!==G||t[84]!==_?(K=(0,$.jsxs)(`article`,{className:_,children:[w,E,j,G]}),t[80]=w,t[81]=E,t[82]=j,t[83]=G,t[84]=_,t[85]=K):K=t[85],K}function dt(e){return e.sourceInstanceId}function ft(e){let t=(0,Pe.c)(70),{playbook:n,busy:r,t:i,onToggleGroup:a,onCreate:o,onUpdate:c,onDelete:l,onRollback:u}=e,[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(``),_=n.enabled?`border-edge-subtle bg-surface-panel`:`border-edge-subtle bg-surface-muted`,v;t[0]===_?v=t[1]:(v=s(`rounded-xl border p-4`,_),t[0]=_,t[1]=v);let y=i.playbookNames[n.id],b;t[2]===y?b=t[3]:(b=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:y}),t[2]=y,t[3]=b);let S;t[4]!==n.rules||t[5]!==i.playbookRuleCount?(S=it(i.playbookRuleCount,n.rules.filter(ht).length),t[4]=n.rules,t[5]=i.playbookRuleCount,t[6]=S):S=t[6];let C;t[7]===S?C=t[8]:(C=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:S}),t[7]=S,t[8]=C);let w;t[9]!==b||t[10]!==C?(w=(0,$.jsxs)(`div`,{children:[b,C]}),t[9]=b,t[10]=C,t[11]=w):w=t[11];let E=n.enabled?i.pausePlaybook:i.resumePlaybook,D;t[12]!==r||t[13]!==a||t[14]!==E?(D=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:r,onClick:a,children:E}),t[12]=r,t[13]=a,t[14]=E,t[15]=D):D=t[15];let O;t[16]!==w||t[17]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[w,D]}),t[16]=w,t[17]=D,t[18]=O):O=t[18];let k;t[19]!==r||t[20]!==p||t[21]!==h||t[22]!==l||t[23]!==u||t[24]!==c||t[25]!==n.rules||t[26]!==i.cancel||t[27]!==i.deleteRule||t[28]!==i.disableRule||t[29]!==i.edit||t[30]!==i.enableRule||t[31]!==i.moveDown||t[32]!==i.moveUp||t[33]!==i.rollbackRule||t[34]!==i.ruleChannelContext||t[35]!==i.ruleContextAny||t[36]!==i.ruleHistory||t[37]!==i.ruleSupportContext||t[38]!==i.ruleSupportNeeds||t[39]!==i.save?(k=n.rules.map((e,t)=>(0,$.jsx)(`li`,{className:s(`rounded-lg border border-edge-subtle p-2.5`,!e.enabled&&`opacity-60`),children:p===e.id?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`textarea`,{className:s(rt,`min-h-16 resize-y`),value:h,onChange:e=>g(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,onClick:()=>m(null),children:i.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-7 px-2`,disabled:!h.trim(),onClick:()=>{c(e.id,{statement:h.trim()}),m(null)},children:i.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:e.statement}),(0,$.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-1`,children:[(0,$.jsxs)(`label`,{className:`grid gap-1 text-[10px] text-fg-subtle`,children:[i.ruleSupportContext,(0,$.jsxs)(ce,{value:e.context.supportNeed??``,disabled:r,onChange:t=>c(e.id,{context:{supportNeed:t.target.value||null}}),children:[(0,$.jsx)(K,{value:``,children:i.ruleContextAny}),[`listen`,`clarify`,`advise`,`act`,`unknown`].map(e=>(0,$.jsx)(K,{value:e,children:i.ruleSupportNeeds[e]},e))]})]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-[10px] text-fg-subtle`,children:[i.ruleChannelContext,(0,$.jsxs)(ce,{value:e.context.channel??``,disabled:r,onChange:t=>c(e.id,{context:{channel:t.target.value||null}}),children:[(0,$.jsx)(K,{value:``,children:i.ruleContextAny}),[`webchat`,`telegram`,`weixin`,`feishu`,`cli`].map(mt)]})]})]}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r||t===0,onClick:()=>c(e.id,{order:n.rules[t-1].order-1}),children:i.moveUp}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r||t===n.rules.length-1,onClick:()=>c(e.id,{order:n.rules[t+1].order+1}),children:i.moveDown}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r,onClick:()=>c(e.id,{enabled:!e.enabled}),children:e.enabled?i.disableRule:i.enableRule}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2`,disabled:r,onClick:()=>{m(e.id),g(e.statement)},children:[(0,$.jsx)(T,{className:`size-3`,"aria-hidden":!0}),i.edit]}),(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-7 px-2 text-danger`,disabled:r,onClick:()=>l(e.id),children:[(0,$.jsx)(x,{className:`size-3`,"aria-hidden":!0}),i.deleteRule]})]}),e.versions.length>1?(0,$.jsxs)(`details`,{className:`mt-2 border-t border-edge-subtle pt-2`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-fg-subtle`,children:i.ruleHistory}),(0,$.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.versions.filter(pt).map(t=>(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 text-[11px]`,children:[(0,$.jsx)(`p`,{className:`line-clamp-2 text-fg-muted`,children:t.statement}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-7 shrink-0 px-2`,disabled:r,onClick:()=>u(e.id,t.id),children:i.rollbackRule})]},t.id))})]}):null]})},e.id)),t[19]=r,t[20]=p,t[21]=h,t[22]=l,t[23]=u,t[24]=c,t[25]=n.rules,t[26]=i.cancel,t[27]=i.deleteRule,t[28]=i.disableRule,t[29]=i.edit,t[30]=i.enableRule,t[31]=i.moveDown,t[32]=i.moveUp,t[33]=i.rollbackRule,t[34]=i.ruleChannelContext,t[35]=i.ruleContextAny,t[36]=i.ruleHistory,t[37]=i.ruleSupportContext,t[38]=i.ruleSupportNeeds,t[39]=i.save,t[40]=k):k=t[40];let A;t[41]===k?A=t[42]:(A=(0,$.jsx)(`ul`,{className:`mt-3 space-y-2`,children:k}),t[41]=k,t[42]=A);let j;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>f(e.target.value),t[43]=j):j=t[43];let M;t[44]!==d||t[45]!==i.newRulePlaceholder?(M=(0,$.jsx)(`input`,{className:rt,value:d,onChange:j,placeholder:i.newRulePlaceholder}),t[44]=d,t[45]=i.newRulePlaceholder,t[46]=M):M=t[46];let N;t[47]!==r||t[48]!==d?(N=r||!d.trim(),t[47]=r,t[48]=d,t[49]=N):N=t[49];let P;t[50]!==d||t[51]!==o?(P=()=>{o(d.trim()),f(``)},t[50]=d,t[51]=o,t[52]=P):P=t[52];let F;t[53]!==i.addRule||t[54]!==N||t[55]!==P?(F=(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N,onClick:P,children:i.addRule}),t[53]=i.addRule,t[54]=N,t[55]=P,t[56]=F):F=t[56];let I;t[57]!==M||t[58]!==F?(I=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[M,F]}),t[57]=M,t[58]=F,t[59]=I):I=t[59];let L=i.playbookRuleExamples[n.id],R;t[60]===L?R=t[61]:(R=(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-5 text-fg-subtle`,children:L}),t[60]=L,t[61]=R);let z;t[62]!==I||t[63]!==R?(z=(0,$.jsxs)(`div`,{className:`mt-3`,children:[I,R]}),t[62]=I,t[63]=R,t[64]=z):z=t[64];let B;return t[65]!==O||t[66]!==A||t[67]!==v||t[68]!==z?(B=(0,$.jsxs)(`article`,{className:v,children:[O,A,z]}),t[65]=O,t[66]=A,t[67]=v,t[68]=z,t[69]=B):B=t[69],B}function pt(e){return!e.current}function mt(e){return(0,$.jsx)(K,{value:e,children:e},e)}function ht(e){return e.enabled}function gt(e){let t=(0,Pe.c)(46),{suggestion:n,draft:r,busy:i,onDraftChange:a,onSave:o,onLater:c,t:l}=e,u;t[0]!==n||t[1]!==l.meetSuggestedTitle||t[2]!==l.meetTitle?(u=n?l.meetSuggestedTitle.replace(`{{name}}`,n.value):l.meetTitle,t[0]=n,t[1]=l.meetSuggestedTitle,t[2]=l.meetTitle,t[3]=u):u=t[3];let d;t[4]===u?d=t[5]:(d=(0,$.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight text-fg`,children:u}),t[4]=u,t[5]=d);let f=n?l.meetSuggestedBody:l.meetBody,p;t[6]===f?p=t[7]:(p=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:f}),t[6]=f,t[7]=p);let m;t[8]===l.callName?m=t[9]:(m=(0,$.jsx)(`label`,{className:`sr-only`,htmlFor:`you-call-name`,children:l.callName}),t[8]=l.callName,t[9]=m);let h;t[10]===a?h=t[11]:(h=e=>a(e.target.value),t[10]=a,t[11]=h);let g;t[12]!==i||t[13]!==r||t[14]!==o?(g=e=>{e.key===`Enter`&&r.trim()&&!i&&o()},t[12]=i,t[13]=r,t[14]=o,t[15]=g):g=t[15];let _=l.meetPlaceholder,v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=s(rt,`h-10 flex-1 bg-surface-base/90`),t[16]=v):v=t[16];let y;t[17]!==r||t[18]!==l.meetPlaceholder||t[19]!==h||t[20]!==g?(y=(0,$.jsx)(`input`,{id:`you-call-name`,value:r,maxLength:80,onChange:h,onKeyDown:g,placeholder:_,className:v}),t[17]=r,t[18]=l.meetPlaceholder,t[19]=h,t[20]=g,t[21]=y):y=t[21];let b;t[22]!==i||t[23]!==r?(b=i||!r.trim(),t[22]=i,t[23]=r,t[24]=b):b=t[24];let x=i?l.meetSaving:l.meetSave,S;t[25]!==o||t[26]!==b||t[27]!==x?(S=(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-10 shrink-0`,disabled:b,onClick:o,children:x}),t[25]=o,t[26]=b,t[27]=x,t[28]=S):S=t[28];let C;t[29]!==y||t[30]!==S||t[31]!==m?(C=(0,$.jsxs)(`div`,{className:`mt-5 flex max-w-xl flex-col gap-2 sm:flex-row`,children:[m,y,S]}),t[29]=y,t[30]=S,t[31]=m,t[32]=C):C=t[32];let w;t[33]!==n||t[34]!==l.meetSource?(w=n?(0,$.jsxs)(`p`,{className:`mt-3 flex items-start gap-1.5 text-xs leading-5 text-fg-subtle`,children:[(0,$.jsx)(oe,{className:`mt-0.5 size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:l.meetSource})]}):null,t[33]=n,t[34]=l.meetSource,t[35]=w):w=t[35];let T;t[36]!==i||t[37]!==c||t[38]!==l.meetLater?(T=(0,$.jsx)(`button`,{type:`button`,disabled:i,className:`mt-3 text-xs font-medium text-fg-muted hover:text-fg hover:underline disabled:opacity-60`,onClick:c,children:l.meetLater}),t[36]=i,t[37]=c,t[38]=l.meetLater,t[39]=T):T=t[39];let E;return t[40]!==C||t[41]!==w||t[42]!==T||t[43]!==d||t[44]!==p?(E=(0,$.jsx)(`section`,{className:`relative overflow-hidden rounded-2xl border border-accent/25 bg-gradient-to-br from-accent-soft/80 via-surface-panel to-surface-panel p-5 sm:p-6`,children:(0,$.jsxs)(`div`,{className:`relative max-w-2xl`,children:[d,p,C,w,T]})}),t[40]=C,t[41]=w,t[42]=T,t[43]=d,t[44]=p,t[45]=E):E=t[45],E}function _t(){let e=l(e=>e.language),t=c(e).you,n=a(),[r,_]=i(),y=et(r.get(`tab`)),x=h(e=>e.setPageHeader),C=h(e=>e.clearPageHeader),{data:w,error:D,isLoading:k,mutate:A}=u(`/api/you`,ve),[N,F]=(0,Q.useState)(null),[I,ee]=(0,Q.useState)(!1),[re,q]=(0,Q.useState)(``),[J,Y]=(0,Q.useState)(`preference`),[X,le]=(0,Q.useState)(!1),[ue,fe]=(0,Q.useState)(null),[pe,_e]=(0,Q.useState)(!1),[Se,Ce]=(0,Q.useState)(null),[we,Te]=(0,Q.useState)(!1),[Ee,De]=(0,Q.useState)(``),[Ne,Pe]=(0,Q.useState)(!1),[Le,ze]=(0,Q.useState)(null),[Be,Ve]=(0,Q.useState)(!1),[He,Ue]=(0,Q.useState)(!1),[We,Ge]=(0,Q.useState)(!1),[Ke,qe]=(0,Q.useState)(null),[Je,Ye]=(0,Q.useState)(!1),[Ze,Qe]=(0,Q.useState)(null),[$e,dt]=(0,Q.useState)(null),[pt,mt]=(0,Q.useState)(!1),[ht,_t]=(0,Q.useState)(null),[vt,yt]=(0,Q.useState)(null),bt=(0,Q.useRef)(null),xt=(0,Q.useRef)(null),St=(0,Q.useRef)(null),Ct=w?.profile??{callName:``,pronouns:``,timezone:``,notes:``},wt=(0,Q.useMemo)(()=>w?.understanding.filter(e=>e.status===`active`)??[],[w]),Tt=(0,Q.useMemo)(()=>w?.understanding.filter(e=>e.status!==`active`)??[],[w]),Et=(0,Q.useMemo)(()=>w?.connectedClaims.filter(e=>e.state!==`rejected`)??[],[w]),Dt=(0,Q.useMemo)(()=>Et.filter(e=>e.state!==`active`),[Et]),Ot=(0,Q.useMemo)(()=>new Map(tt.map(e=>[e,wt.filter(t=>t.facet===e)])),[wt]),kt=Le??w?.controls??null,At=w?.sources.filter(e=>e.installed&&e.enabled)??[],jt=At.filter(e=>[`failed`,`unauthorized`,`degraded`,`not_configured`].includes(e.status));(0,Q.useEffect)(()=>{let e=()=>{A()};return window.addEventListener(`connector-learning-updated`,e),()=>window.removeEventListener(`connector-learning-updated`,e)},[A]),(0,Q.useEffect)(()=>{if(y!==`memory`||!vt)return;let e=requestAnimationFrame(()=>{(vt===`profile`?bt:xt).current?.scrollIntoView({behavior:`smooth`,block:`start`}),yt(null)});return()=>cancelAnimationFrame(e)},[vt,y]);async function Mt(e){if(!(!w||We)){Ge(!0);try{let n=await ye(e);await A({...w,relationship:n.relationship},{revalidate:!1}),V({type:`success`,title:t.collaborationTitle,message:t.saved})}catch{V({type:`error`,title:t.supportModeTitle,message:t.saveError})}finally{Ge(!1)}}}async function Nt(e,n){F(`claim:${e.id}`);try{let t=await ae(e.id,n);await A(e=>e&&{...e,connectedClaims:e.connectedClaims.map(e=>e.id===t.id?t:e)},{revalidate:!1})}catch{V({type:`error`,title:t.connectedClaimsTitle,message:t.saveError})}finally{F(null)}}let Pt=e=>{let t=new URLSearchParams;e!==`overview`&&t.set(`tab`,e),_(t,{replace:!0})},Ft=e=>{yt(e),Pt(`memory`)},It=e=>{let t=new URLSearchParams({connector:e.id});e.instanceId&&t.set(`instance`,e.instanceId),n(`/connectors?${t.toString()}`)},Lt=async e=>{if(e.instanceId){F(`source-learning:${e.instanceId}`);try{e.learning?.status===`paused`?await je(e.instanceId,!1):await Me(e.instanceId),await A(),V({type:`success`,title:e.displayName,message:t.sourceLearningStarted})}catch(n){V({type:`error`,title:e.displayName,message:n instanceof Error?n.message:t.sourceLearningStartFailed})}finally{F(null)}}},Rt=async e=>{if(e.instanceId){F(`source-learning:${e.instanceId}`);try{await je(e.instanceId,!0),await A()}catch(n){V({type:`error`,title:e.displayName,message:n instanceof Error?n.message:t.sourceLearningStartFailed})}finally{F(null)}}};(0,Q.useLayoutEffect)(()=>(x({startExtra:null,main:(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:t.subtitle})]}),end:(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`h-8 gap-1.5 px-2.5 text-xs`,onClick:()=>Ye(!0),children:[(0,$.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0}),t.howItWorks]})}),()=>C()),[C,x,t.howItWorks,t.subtitle,t.title]),(0,Q.useEffect)(()=>{!w||w.profile.callName||De(w.profileSetup.callNameSuggestion?.value??``)},[w,w?.profile.callName,w?.profileSetup.callNameSuggestion?.id]);async function zt(e,n,r){F(e.id);try{let t=await se(e.id,{action:n,content:r});await A(r=>r&&{...r,understanding:n===`reject`?r.understanding.filter(t=>t.id!==e.id):r.understanding.map(n=>n.id===e.id?t:n)},{revalidate:!1}),A()}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{F(null)}}async function Bt(e,n){F(`consent:${e}`);try{await b(e,n),await A(),V({type:`success`,title:t.title,message:t.saved})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{F(null)}}async function Vt(){let e=re.trim();if(e){F(`understanding:new`);try{await P({content:e,kind:J}),q(``),ee(!1),le(!1),await A(),V({type:`success`,title:t.understandingTitle,message:t.saved})}catch{V({type:`error`,title:t.understandingTitle,message:t.saveError})}finally{F(null)}}}async function Ht(){if(Tt.length){F(`understanding:batch`);try{await Oe(Tt.map(e=>e.id),`confirm`),await A()}catch{V({type:`error`,title:t.reviewTitle,message:t.saveError})}finally{F(null)}}}async function Ut(e,n){F(`conflict:${e}`);try{await z(e,n),await A()}catch{V({type:`error`,title:t.conflictsTitle,message:t.saveError})}finally{F(null)}}async function Wt(e){F(`grant:${e}`);try{await U(e),await A()}catch{V({type:`error`,title:t.grantsTitle,message:t.saveError})}finally{F(null)}}async function Gt(r,i){F(`insight:${r.id}`);try{let t=await xe(r.id,{action:i,uiLocale:e});await A(),i===`apply`&&t.href&&n(t.href)}catch{V({type:`error`,title:t.insightsTitle,message:t.saveError})}finally{F(null)}}async function Kt(e){F(`playbook:${e.id}`);try{await f(e.id,!e.enabled),await A()}catch{V({type:`error`,title:t.playbooksTitle,message:t.saveError})}finally{F(null)}}async function qt(e,n){F(`playbook:${e}`);try{await n(),await A()}catch{V({type:`error`,title:t.playbooksTitle,message:t.saveError})}finally{F(null)}}async function Jt(){if(ue){F(ue.id);try{await S(ue.id);let e=ue.id;fe(null),await A(t=>t&&{...t,understanding:t.understanding.filter(t=>t.id!==e)},{revalidate:!1}),A()}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{F(null)}}}async function Yt(){if(Se){Te(!0);try{let e=await he(Se);_e(!1),Ce(null),await A(t=>t&&{...t,...e},{revalidate:!1})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{Te(!1)}}}async function Xt(){let e=Ee.trim();if(!(!e||Ne)){Pe(!0);try{let t=await he({callName:e,timezone:Ct.timezone||ge()});await A(e=>e&&{...e,...t},{revalidate:!1})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{Pe(!1)}}}async function Zt(){if(!Ne){Pe(!0);try{let e=await be(`snooze`);await A(t=>t&&{...t,profileSetup:e.profileSetup},{revalidate:!1})}catch{V({type:`error`,title:t.title,message:t.saveError})}finally{Pe(!1)}}}function Qt(){Ce(Ct),_e(!0),Ft(`profile`)}function $t(e,t=!1){Y(e),le(t),ee(!0),Pt(`memory`)}function en(){ee(!1),le(!1),q(``)}async function tn(e){if(!Be){ze(e),Ve(!0);try{ze(await G(e)),await A(),V({type:`success`,title:t.privacyTitle,message:t.saved})}catch{ze(null),V({type:`error`,title:t.privacyTitle,message:t.saveError})}finally{Ve(!1)}}}async function nn(e){if(!(He||e===w?.trust.defaultActionLevel)){Ue(!0);try{let n=await te(e);await A(e=>e&&{...e,trust:n},{revalidate:!1}),V({type:`success`,title:t.trustTitle,message:t.saved})}catch{V({type:`error`,title:t.trustTitle,message:t.saveError})}finally{Ue(!1),qe(null)}}}async function rn(e){if(!(!$e?.instanceId||pt)){mt(!0);try{let n=await L($e.instanceId,e);dt(null),await A(),V({type:`success`,title:t.sourcesTitle,message:e?t.disconnectDeleted.replace(`{{count}}`,String(n.deletedUnderstandingCount)):t.disconnectSuccess})}catch{V({type:`error`,title:t.sourcesTitle,message:t.saveError})}finally{mt(!1)}}}async function an(){if(!ht){_t(`export`);try{let e=await v(),t=URL.createObjectURL(new Blob([JSON.stringify(e,null,2)],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`xopc-about-you-${e.exportedAt.slice(0,10)}.json`,n.click(),URL.revokeObjectURL(t)}catch{V({type:`error`,title:t.transferTitle,message:t.saveError})}finally{_t(null)}}}async function on(e){if(!(!e||ht)){_t(`import`);try{if(e.size>2*1024*1024)throw Error(`file too large`);let n=await H(JSON.parse(await e.text()));await A(),Ft(`review`),V({type:`success`,title:t.transferTitle,message:t.importSuccess.replace(`{{count}}`,String(n.importedCount)).replace(`{{skipped}}`,String(n.skippedCount))})}catch{V({type:`error`,title:t.transferTitle,message:t.importError})}finally{St.current&&(St.current.value=``),Qe(null),_t(null)}}}function sn(){Qe(null),St.current&&(St.current.value=``)}return(0,$.jsxs)(`main`,{className:`flex w-full flex-1 flex-col gap-5 px-3 py-6 sm:px-5 xl:px-6`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ke,{items:[{id:`overview`,label:t.tabs.overview,icon:g},{id:`memory`,label:t.tabs.memory,icon:m,count:Tt.length+Dt.length||void 0},{id:`collaboration`,label:t.tabs.collaboration,icon:E},{id:`sources`,label:t.tabs.sources,icon:R},{id:`privacy`,label:t.tabs.privacy,icon:oe}],activeTab:y,onChange:Pt,ariaLabel:t.title,tabIdPrefix:`you-tab`,panelIdPrefix:`you-panel`,className:`pr-8 sm:pr-1`,buttonClassName:`px-2.5 sm:px-3`}),(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-y-1 right-0 w-8 bg-gradient-to-l from-surface-panel to-transparent sm:hidden`,"aria-hidden":!0})]}),k?(0,$.jsx)(st,{}):D||!w?(0,$.jsx)(`div`,{className:`rounded-2xl border border-danger/25 bg-danger-soft p-5 text-sm text-danger`,children:t.loadError}):null,w&&y===`overview`?(0,$.jsxs)(`div`,{id:`you-panel-overview`,role:`tabpanel`,"aria-labelledby":`you-tab-overview`,className:`space-y-4`,children:[!Ct.callName&&w.profileSetup.shouldPrompt?(0,$.jsx)(gt,{suggestion:w.profileSetup.callNameSuggestion,draft:Ee,busy:Ne,onDraftChange:De,onSave:()=>void Xt(),onLater:()=>void Zt(),t}):null,Tt.length>0||Dt.length>0||jt.length>0||!Ct.callName?(0,$.jsxs)(`section`,{className:`rounded-2xl border border-warning/25 bg-warning-soft/35 p-5`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.attentionTitle}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[Tt.length+Dt.length>0?(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:()=>Ft(`review`),children:[it(t.reviewCount,Tt.length+Dt.length),(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]}):null,jt.length>0?(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:()=>Pt(`sources`),children:[it(t.sourceIssues,jt.length),(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]}):null,Ct.callName?null:(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:Qt,children:[t.completeProfile,(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})]})]})]}):null,(0,$.jsx)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-4`,children:(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>Pt(`memory`),children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold text-fg`,children:wt.length}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:t.knownSummary})]}),(0,$.jsxs)(`button`,{type:`button`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>Pt(`sources`),children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold text-fg`,children:At.length}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:t.connectedSources})]}),(0,$.jsxs)(`button`,{type:`button`,className:`rounded-xl border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>Ft(`review`),children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold text-fg`,children:Tt.length+Dt.length}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:t.waitingReview})]})]})}),w.insights.length>0?(0,$.jsxs)(`section`,{className:`rounded-2xl border border-accent/15 bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(ne,{className:`size-4 text-accent`,"aria-hidden":!0}),t.insightsTitle]}),(0,$.jsx)(at,{children:t.confirmedContextBadge})]}),(0,$.jsx)(`div`,{className:`mt-4 grid gap-3 lg:grid-cols-2`,children:w.insights.map(e=>(0,$.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.insight}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:e.evidenceCount>1?it(t.insightEvidence,e.evidenceCount):t.insightReason}),(0,$.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:N===`insight:${e.id}`,onClick:()=>void Gt(e,`dismiss`),children:t.notNow}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:N===`insight:${e.id}`,onClick:()=>void Gt(e,`apply`),children:t.insightActions[e.action]})]})]},e.id))})]}):null,(0,$.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),t.profileTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.profileHint})]}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>Ft(`profile`),children:(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsxs)(`dl`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.callName}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.callName||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.timezone}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.timezone||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.pronouns}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.pronouns||`—`})]}),Ct.notes?(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.notes}),(0,$.jsx)(`dd`,{className:`mt-1 line-clamp-2 text-sm leading-6 text-fg`,children:Ct.notes})]}):null]})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(m,{className:`size-4 text-accent`,"aria-hidden":!0}),t.understandingTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.understandingHint})]}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>Pt(`memory`),children:(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[wt.slice(0,4).map(e=>(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2.5 text-sm leading-5 text-fg`,children:e.statement},e.id)),wt.length===0?(0,$.jsx)(`p`,{className:`py-5 text-center text-sm text-fg-muted`,children:t.emptyUnderstanding}):null]})]})]})]}):null,w&&y===`memory`?(0,$.jsxs)(`div`,{id:`you-panel-memory`,role:`tabpanel`,"aria-labelledby":`you-tab-memory`,className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.memoryTitle}),(0,$.jsx)(at,{children:t.sharedAgentsBadge})]}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.memoryHint})]}),(0,$.jsxs)(`section`,{ref:bt,id:`you-profile-card`,className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,$.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),t.profileTitle]}),(0,$.jsx)(at,{children:t.onlyYouEditBadge})]}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:t.profileHint})]}),pe?null:(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,onClick:Qt,children:[(0,$.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),t.edit]})]}),pe&&Se?(0,$.jsxs)(`div`,{className:`mt-5`,children:[(0,$.jsx)(Fe,{value:Se,onChange:Ce,language:e,inputClassName:rt,labels:{callName:t.callName,callNamePlaceholder:t.meetPlaceholder,pronouns:t.pronouns,pronounsPlaceholder:t.pronounsPlaceholder,timezone:t.timezone,timezoneCustom:t.timezoneCustom,timezoneDetect:t.timezoneDetect,custom:t.custom,notes:t.notes,notesPlaceholder:t.notesPlaceholder}}),(0,$.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>{_e(!1),Ce(null)},children:t.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:we,onClick:()=>void Yt(),children:we?t.saving:t.save})]})]}):(0,$.jsxs)(`dl`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.callName}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.callName||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.timezone}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.timezone||`—`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.pronouns}),(0,$.jsx)(`dd`,{className:`mt-1 text-sm text-fg`,children:Ct.pronouns||`—`})]}),(0,$.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,$.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t.notes}),(0,$.jsx)(`dd`,{className:`mt-1 whitespace-pre-wrap text-sm leading-6 text-fg`,children:Ct.notes||`—`})]})]})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.structuredContextTitle}),(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&!X&&J===`preference`,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&!X&&J===`preference`?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`preference`),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addPreference}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addPreferenceHint})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&!X&&J===`boundary`,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&!X&&J===`boundary`?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`boundary`),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addBoundary}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addBoundaryHint})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&!X&&J===`current_state`,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&!X&&J===`current_state`?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`current_state`),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addCurrentFocus}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addCurrentFocusHint})]}),(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":I&&X,className:s(`rounded-xl border bg-surface-panel p-4 text-left transition-colors hover:border-accent/30 hover:bg-surface-hover`,I&&X?`border-accent/40 bg-accent-soft/20`:`border-edge-subtle`),onClick:()=>$t(`relationship`,!0),children:[(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:t.addOther}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:t.addOtherHint})]})]}),I?(0,$.jsxs)(`div`,{className:`mt-4 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:X?t.addOther:J===`preference`?t.addPreference:J===`boundary`?t.addBoundary:t.addCurrentFocus}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:X?t.addOtherHint:J===`preference`?t.addPreferenceHint:J===`boundary`?t.addBoundaryHint:t.addCurrentFocusHint})]}),X?null:(0,$.jsx)(at,{children:t.understandingKinds[J]})]}),(0,$.jsx)(`textarea`,{className:s(rt,`mt-3 min-h-24 resize-y`),value:re,onChange:e=>q(e.target.value),placeholder:t.understandingPlaceholders[J],autoFocus:!0}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end justify-between gap-3`,children:[X?(0,$.jsxs)(`label`,{className:`grid min-w-48 gap-1 text-xs font-medium text-fg-muted`,children:[t.understandingKind,(0,$.jsx)(ce,{value:J,onChange:e=>Y(e.target.value),children:nt.map(e=>(0,$.jsx)(K,{value:e,children:t.understandingKinds[e]},e))})]}):(0,$.jsx)(`span`,{}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,onClick:en,children:t.cancel}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:!re.trim()||N===`understanding:new`,onClick:()=>void Vt(),children:t.add})]})]})]}):null]}),w.conflictGroups.some(e=>e.unresolved)?(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.conflictsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.conflictsHint}),(0,$.jsx)(`div`,{className:`mt-3 space-y-3`,children:w.conflictGroups.filter(e=>e.unresolved).map(n=>(0,$.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-xl border border-warning/35 bg-warning-soft/25`,children:n.records.filter(e=>e.storedStatus!==`archived`&&e.storedStatus!==`rejected`).map(r=>(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:r.statement}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[ct(r,t),` · `,ot(r.updatedAt,e)]})]}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-2.5`,disabled:N===`conflict:${n.id}`,onClick:()=>void Ut(n.id,r.id),children:t.useThis})]},r.id))},n.id))})]}):null,w.consentRequests.length>0?(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.consentTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.consentHint})]}),w.consentRequests.map(e=>(0,$.jsxs)(`article`,{className:`rounded-2xl border border-accent/25 bg-accent-soft/20 p-4`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.statement}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.consentPurpose.replace(`{{purpose}}`,e.purpose)}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-2`,children:[(0,$.jsx)(Z,{type:`button`,variant:`ghost`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`deny`),children:t.consentDeny}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`once`),children:t.consentOnce}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`session`),children:t.consentSession}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:N===`consent:${e.id}`,onClick:()=>void Bt(e.id,`always`),children:t.consentAlways})]})]},e.id))]}):null,(0,$.jsxs)(`div`,{ref:xt,className:`space-y-6 scroll-mt-6`,children:[Et.length>0?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.connectedClaimsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.connectedClaimsHint})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:Et.map(n=>(0,$.jsx)(ut,{claim:n,language:e,t,busy:N===`claim:${n.id}`,onDecision:e=>void Nt(n,e)},n.id))})]}):null,Tt.length>0?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.reviewTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.reviewHint})]}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,disabled:N===`understanding:batch`,onClick:()=>void Ht(),children:t.reviewAll})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:Tt.map(n=>(0,$.jsx)(lt,{item:n,language:e,t,busy:N===n.id,onConfirm:()=>void zt(n,`confirm`),onReject:()=>void zt(n,`reject`),onUpdate:e=>void zt(n,`update`,e),onForget:()=>fe(n)},n.id))})]}):wt.length>0||Et.some(e=>e.state===`active`)?(0,$.jsxs)(`div`,{className:`rounded-2xl border border-success/20 bg-success-soft p-6 text-center`,children:[(0,$.jsx)(o,{className:`mx-auto size-5 text-success`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-2 text-sm font-semibold text-fg`,children:t.nothingToReview}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.nothingToReviewHint})]}):null]}),tt.map(n=>{let r=Ot.get(n)??[];return r.length===0?null:(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.facets[n]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:r.map(n=>(0,$.jsx)(lt,{item:n,language:e,t,busy:N===n.id,onConfirm:()=>void zt(n,`confirm`),onReject:()=>void zt(n,`reject`),onUpdate:e=>void zt(n,`update`,e),onForget:()=>fe(n)},n.id))})]},n)}),w.understanding.length===0&&Et.length===0?(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge p-10 text-center text-sm text-fg-muted`,children:t.emptyUnderstanding}):null]}):null,w&&y===`collaboration`?(0,$.jsxs)(`div`,{id:`you-panel-collaboration`,role:`tabpanel`,"aria-labelledby":`you-tab-collaboration`,className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.collaborationTitle}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.collaborationHint})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,$.jsx)(g,{className:`size-4 text-accent`,"aria-hidden":!0}),t.supportModeTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.supportModeHint})]}),(0,$.jsxs)(`label`,{className:`grid min-w-48 gap-1 text-xs font-medium text-fg-muted`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:t.supportModeTitle}),(0,$.jsx)(ce,{value:w.relationship.supportMode,disabled:We,onChange:e=>void Mt({supportMode:e.target.value}),children:Object.entries(t.supportModes).map(([e,t])=>(0,$.jsx)(K,{value:e,children:t},e))})]})]}),(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 border-t border-edge-subtle pt-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:w.relationship.proactiveEnabled,disabled:We,onChange:e=>void Mt({proactiveEnabled:e.target.checked})}),t.proactiveEnabled]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-xs text-fg-muted`,children:[t.quietStart,(0,$.jsx)(Ae,{value:w.relationship.quietStart??``,disabled:We,allowEmpty:!0,clearLabel:t.clearTime,ariaLabel:t.quietStart,onChange:e=>void Mt({quietStart:e||null})})]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-xs text-fg-muted`,children:[t.quietEnd,(0,$.jsx)(Ae,{value:w.relationship.quietEnd??``,disabled:We,allowEmpty:!0,clearLabel:t.clearTime,ariaLabel:t.quietEnd,onChange:e=>void Mt({quietEnd:e||null})})]}),(0,$.jsxs)(`label`,{className:`grid gap-1 text-xs text-fg-muted`,children:[t.blockedTopics,(0,$.jsx)(`input`,{className:rt,defaultValue:w.relationship.blockedTopics.join(`, `),disabled:We,onBlur:e=>void Mt({blockedTopics:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})]})]}),(0,$.jsx)(`p`,{className:`mt-3 text-right text-xs text-fg-subtle`,children:We?t.saving:t.autoSaveHint})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,$.jsx)(E,{className:`size-4 text-accent`,"aria-hidden":!0}),t.playbooksTitle]}),(0,$.jsx)(at,{children:t.affectsAgentsBadge})]}),w.playbooks.length>0?(0,$.jsx)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-3`,children:w.playbooks.map(e=>(0,$.jsx)(ft,{playbook:e,busy:N===`playbook:${e.id}`,t,onToggleGroup:()=>void Kt(e),onCreate:t=>void qt(e.id,()=>p(e.id,t,(e.rules.at(-1)?.order??0)+10)),onUpdate:(t,n)=>void qt(e.id,()=>me(e.id,t,n)),onDelete:t=>void qt(e.id,()=>M(e.id,t)),onRollback:(t,n)=>void qt(e.id,()=>O(e.id,t,n))},e.id))}):(0,$.jsx)(`p`,{className:`mt-4 rounded-xl bg-surface-muted px-4 py-3 text-sm text-fg-muted`,children:t.emptyPlaybooks})]})]}):null,w&&y===`sources`?(0,$.jsx)(Xe,{sources:w.sources,language:e,t,busyId:N,onAddSource:()=>n(`/connectors?personalContext=1`),onLearn:e=>void Lt(e),onPause:e=>void Rt(e),onConfigure:It,onDisconnect:dt,onViewUnderstanding:()=>Pt(`memory`)}):null,w&&y===`privacy`&&kt?(0,$.jsxs)(`div`,{id:`you-panel-privacy`,role:`tabpanel`,"aria-labelledby":`you-tab-privacy`,className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.privacyTitle}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.privacyHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-2`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.controlTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.controlHint}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-3 rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.learningMode,(0,$.jsx)(ce,{value:kt.mode,disabled:Be,onChange:e=>void tn({...kt,mode:e.target.value}),children:Object.entries(t.learningModes).map(([e,t])=>(0,$.jsx)(K,{value:e,children:t},e))})]}),(0,$.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.sensitive,(0,$.jsx)(ce,{value:kt.sensitiveWritePolicy,disabled:Be,onChange:e=>void tn({...kt,sensitiveWritePolicy:e.target.value}),children:Object.entries(t.sensitiveOptions).map(([e,t])=>(0,$.jsx)(K,{value:e,children:t},e))}),(0,$.jsx)(`span`,{className:`font-normal leading-5 text-fg-subtle`,children:t.sensitiveOptionHints[kt.sensitiveWritePolicy]})]}),(0,$.jsx)(`p`,{className:`text-right text-xs text-fg-subtle`,children:Be?t.saving:t.autoSaveHint})]})]}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.trustTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.trustHint}),(0,$.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:w.trust.levels.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":e===w.trust.defaultActionLevel,disabled:He,onClick:()=>{e!==w.trust.defaultActionLevel&&(e===`auto`?qe(e):nn(e))},className:s(`rounded-xl border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 disabled:opacity-70`,e===w.trust.defaultActionLevel?`border-accent/35 bg-accent-soft/35`:`border-edge-subtle bg-surface-panel hover:border-accent/25 hover:bg-surface-hover`),children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-fg`,children:t.trustLevels[e]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.trustLevelHints[e]}),e===w.trust.defaultActionLevel?(0,$.jsx)(`span`,{className:`mt-2 inline-block rounded-full bg-accent-soft px-2 py-0.5 text-[11px] text-accent-fg`,children:t.defaultTrust}):null]},e))})]})]}),(0,$.jsx)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(oe,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.sharingTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:t.sharingHint})]})]})}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.grantsTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.grantsHint}),w.referenceGrants.length>0?(0,$.jsx)(`div`,{className:`mt-3 divide-y divide-edge overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:w.referenceGrants.map(n=>(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm text-fg`,children:n.statement}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[n.grantScope?t.grantScopes[n.grantScope]:``,n.expiresAt?` · ${ot(n.expiresAt,e)}`:``]})]}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2.5`,disabled:N===`grant:${n.id}`,onClick:()=>void Wt(n.id),children:t.revoke})]},n.id))}):(0,$.jsx)(`p`,{className:`mt-3 rounded-xl bg-surface-muted px-4 py-3 text-sm text-fg-muted`,children:t.noGrants})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-base p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.transferTitle}),(0,$.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:ht!==null,onClick:()=>void an(),children:[(0,$.jsx)(B,{className:`size-4`,"aria-hidden":!0}),ht===`export`?t.exporting:t.exportAction]}),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,disabled:ht!==null,onClick:()=>St.current?.click(),children:[(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0}),ht===`import`?t.importing:t.importAction]}),(0,$.jsx)(`input`,{ref:St,type:`file`,accept:`application/json,.json`,className:`sr-only`,onChange:e=>Qe(e.target.files?.[0]??null)})]})]})]}):null,(0,$.jsx)(d,{open:ue!==null,title:t.forgetTitle,description:t.forgetBody,confirmLabel:t.forget,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void Jt(),onCancel:()=>fe(null)}),(0,$.jsx)(d,{open:Ke===`auto`,title:t.autoConfirmTitle,description:t.autoConfirmBody,confirmLabel:t.autoConfirmAction,cancelLabel:t.cancel,onConfirm:()=>void nn(`auto`),onCancel:()=>qe(null)}),(0,$.jsx)(d,{open:Ze!==null,title:t.importConfirmTitle,description:t.importConfirmBody.replace(`{{name}}`,Ze?.name??``),confirmLabel:t.importConfirmAction,cancelLabel:t.cancel,onConfirm:()=>{let e=Ze;Qe(null),on(e)},onCancel:sn}),(0,$.jsx)(Re,{source:$e,language:e,busy:pt,onOpenChange:e=>{e||dt(null)},onConfirm:e=>void rn(e)}),(0,$.jsx)(Ie,{open:Je,t,onOpenChange:Ye,onNavigate:Pt})]})}export{_t 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-BNC8HUCI.js";import{Qa as o,Ss as s}from"./index-BA56bQ68.js";e();var c=t();function l(){return{enabled:!0,provider:`xopc-local`,alibaba:{model:`paraformer-v2`},openai:{model:`whisper-1`},providers:{"xopc-local":{model:`sensevoice-small`}},fallback:{enabled:!1,order:[`xopc-local`]}}}function u(){return{enabled:!0,provider:`edge`,trigger:`inbound`,maxTextLength:512,timeoutMs:6e4,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 d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e){return typeof e==`string`&&e.trim().length>0?e.trim():`xopc-local`}function p(e,t,n){let r=d(e.providers)?e.providers:void 0,i=r&&d(r[t])?r[t]:void 0;return{...n,...i??{}}}function m(e){let t=l();if(!d(e))return t;let n=f(e.provider),r=p(e,`alibaba`,t.alibaba??{}),i=p(e,`openai`,t.openai??{}),a=t.fallback??{enabled:!1,order:[`xopc-local`]};if(d(e.fallback)){let t=Array.isArray(e.fallback.order)?e.fallback.order.filter(e=>typeof e==`string`&&e.trim().length>0):a.order;a={enabled:typeof e.fallback.enabled==`boolean`?e.fallback.enabled:a.enabled,order:t.length?t:a.order}}let o=d(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,d(t)?{...t}:{}])):void 0;return{enabled:!!e.enabled,provider:n,alibaba:r,openai:i,...o?{providers:o}:{},fallback:a}}function h(e){return typeof e==`string`&&e.trim().length>0?e.trim():`edge`}function g(e){let t=u();if(!d(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[`tts-local-cli`]??{},a=d(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,d(t)?{...t}:{}])):void 0;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,...a?{providers:a}:{},alibaba:p(e,`alibaba`,t.alibaba??{}),openai:p(e,`openai`,t.openai??{}),edge:p(e,`edge`,t.edge??{}),minimax:p(e,`minimax`,t.minimax??{}),"tts-local-cli":p(e,`tts-local-cli`,i)}}function _(e){let{alibaba:t,openai:n,providers:r,...i}=e,a={...r??{}};return t&&(a.alibaba={...a.alibaba??{},...t}),n&&(a.openai={...a.openai??{},...n}),{...i,...Object.keys(a).length>0?{providers:a}:{}}}function v(e){let{alibaba:t,openai:n,edge:r,minimax:i,"tts-local-cli":a,providers:o,...s}=e,c={...o??{}};return t&&(c.alibaba={...c.alibaba??{},...t}),n&&(c.openai={...c.openai??{},...n}),r&&(c.edge={...c.edge??{},...r}),i&&(c.minimax={...c.minimax??{},...i}),a&&(c[`tts-local-cli`]={...c[`tts-local-cli`]??{},...a}),{...s,...Object.keys(c).length>0?{providers:c}:{}}}function y(e){let t=d(e)?e:{},n=d(t.voice)?t.voice:{},r=d(n.input)?n.input:{},i=d(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{b as a,y as c,O as d,C as i,x as l,T as n,w as o,S as r,E as s,j as t,D as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,s as t}from"./locale-store-
|
|
1
|
+
import{r as e,s as t}from"./locale-store-BNC8HUCI.js";import{a as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./schemas-C6onAggk.js";import{co as u,do as d,lo as f,uo as p}from"./index-BA56bQ68.js";var m=l([`backlog`,`todo`,`in_progress`,`blocked`,`needs_input`,`in_review`,`done`,`cancelled`]),h=l([`urgent`,`high`,`normal`,`low`]),g=c({id:i(),projectId:i(),projectName:i(),title:i(),status:m,priority:h,nextAction:i().optional(),blockedReason:i().optional(),dueAt:o().optional(),completedAt:o().optional(),updatedAt:o()}),_=c({id:i(),kind:l([`agent_judgment`,`work_item`,`goal`,`connector_approval`,`goal_evidence`]),title:i(),detail:i().optional(),reason:l([`needs_input`,`in_review`,`blocked`,`overdue`,`due_soon`,`decision_needed`,`approval_required`]),urgency:l([`now`,`soon`]),href:i(),projectId:i().optional(),projectName:i().optional(),updatedAt:o(),judgment:c({inboxItemId:i(),whyNow:i(),impact:i(),workDone:i(),recommendation:i(),confidence:o(),valueScore:o().min(0).max(1).optional(),decision:c({question:i(),options:a(c({id:i(),label:i(),consequence:i()}))}).optional()}).optional(),response:r(`kind`,[c({kind:n(`connector_approval`),approvalId:i()}),c({kind:n(`goal_evidence`),goalId:i(),requirementId:i()})]).optional()}),v=c({id:i(),kind:l([`automation_run`,`workflow_run`]),runId:i(),title:i(),detail:i(),reason:l([`run_failed`,`run_timeout`]),href:i(),updatedAt:o(),sessionKey:i().optional()}),y=c({id:i(),name:i().optional(),trigger:i(),action:i(),nextRunAt:i()}),b=c({id:i(),definitionId:i(),title:i(),status:i(),sessionKey:i().optional(),createdAtMs:o(),startedAtMs:o().optional(),completedAtMs:o().optional()}),x=c({key:i(),name:i(),updatedAt:i().optional(),active:s()}),S=c({id:i(),kind:l([`work_item`,`workflow_run`,`automation_run`]),title:i(),href:i(),completedAt:o()}),C=c({briefing:c({generatedAt:o(),summary:i(),focus:a(_),progress:c({activeWorkCount:o(),activeWorkflowCount:o(),activeGoalCount:o(),movingCount:o()}),wins:a(S),nextScheduled:y.optional()}),decisions:a(_),attention:a(v),attentionPolicy:c({visibleDecisionCount:o().int().nonnegative(),suppressedDecisionCount:o().int().nonnegative(),visibleAttentionCount:o().int().nonnegative(),suppressedAttentionCount:o().int().nonnegative()}).default({visibleDecisionCount:0,suppressedDecisionCount:0,visibleAttentionCount:0,suppressedAttentionCount:0}),chats:c({running:a(x),recent:a(x)}),work:c({attentionCount:o(),overdueCount:o(),todayCount:o(),items:a(g),current:a(g),recentlyCompleted:a(g)}),workflowRuns:c({active:a(b),recent:a(b)}),upcomingAutomations:a(y),outcomes:c({running:a(d),needsUser:a(d),recentlyCompleted:a(d)}).default({running:[],needsUser:[],recentlyCompleted:[]}),recentOutcomes:a(p).default([])}).passthrough();c({northStar:c({weeklyTrustedProgress:o(),weeklyActiveUsers:o(),trustedProgressPerWeeklyActiveUser:o()}),intake:c({total:o(),proposed:o(),confirmed:o(),expired:o(),runNow:o(),createOnly:o(),queued:o(),pendingQueueRecovery:o(),confirmationRate:o(),queueRate:o()}),outcomes:c({total:o(),achieved:o(),partial:o(),notAchieved:o(),userCorrected:o(),achievementRate:o(),correctionRate:o(),trusted:o(),trustedRate:o()})});function w(e){return C.parse(e)}async function T(n){let r=await t(e(`/api/outcomes/${encodeURIComponent(n)}`));return{outcome:d.parse(r.outcome),receipts:p.array().parse(r.receipts)}}async function E(n,r){let i=await t(e(`/api/outcomes/${encodeURIComponent(n)}/actions`),{method:`POST`,body:JSON.stringify({action:r})});return d.parse(i.outcome)}async function D(n){let r=await t(e(`/api/work/intakes`),{method:`POST`,body:JSON.stringify({idempotencyKey:crypto.randomUUID(),objective:n})});return f.parse(r.proposal)}async function O(n){let r=await t(e(`/api/work/intakes/${encodeURIComponent(n)}/confirm`),{method:`POST`,body:JSON.stringify({executionMode:`run_now`})});return u.parse(r.work)}function k(n){return t(e(`/api/home${n?`?locale=${encodeURIComponent(n)}`:``}`)).then(w)}function A(n,r){return t(e(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...n,decision:r})})}function j(n){return t(e(`/api/home/attention/acknowledge`),{method:`POST`,body:JSON.stringify(n)})}function M(n,r){return t(e(`/api/inbox/judgments/${encodeURIComponent(n)}/decisions`),{method:`POST`,body:JSON.stringify({choice:r})})}function N(n,r){return t(e(`/api/inbox/judgments/${encodeURIComponent(n)}/transition`),{method:`POST`,body:JSON.stringify(r===`snoozed`?{status:r,snoozedUntil:new Date(Date.now()+1440*60*1e3).toISOString()}:r===`resolved`?{status:r,resolution:`dismissed`}:{status:r})})}function P(n,r){return t(e(`/api/inbox/judgments/${encodeURIComponent(n)}/instructions`),{method:`POST`,body:JSON.stringify({instruction:r})})}function F(n){return t(e(`/api/home/attention/retry`),{method:`POST`,body:JSON.stringify(n)})}function I(e){return e===`zh`?{newWork:`交给 xopc`,dialogTitle:`现在想完成什么?`,dialogDescription:`xopc 会先理解目标、归属项目和下一步,由你确认后再建立工作。`,intentLabel:`告诉 xopc 你要做什么`,intentPlaceholder:`例如:整理这周的会议记录,提炼待办并给出下周优先级`,submit:`生成工作方案`,proposalTitle:`确认工作方案`,projectLabel:`归属项目`,outcomeLabel:`期望结果`,nextActionLabel:`第一步`,monitoringLabel:`主动跟进`,monitoringModes:{observe:`仅观察`,ask_before_action:`行动前询问`,auto_low_risk:`自动执行低风险操作`},existingProject:`已有项目`,newProject:`新项目`,editIntent:`返回修改`,confirmWork:`确认并建立工作`,needsAttention:`需要你处理`,runAttention:`运行异常`,running:`xopc 正在处理`,continue:`继续推进`,recent:`最近对话`,recentOutcomes:`最近完成`,evidenceCount:`项证据`,remainingCount:`项待继续`,projects:`长期项目`,emptyRunning:`当前没有正在处理的对话`,emptyContinue:`还没有需要继续推进的事项`,openChat:`打开对话`,whyNow:`为什么现在`,impact:`影响`,workDone:`AI 已完成`,recommendation:`建议`,snooze:`明天再看`,dismiss:`忽略`,feedbackPlaceholder:`告诉 AI:以后遇到这类情况应该怎样判断…`,applyFeedback:`调整后续判断`,outcomeStatuses:{running:`正在推进`,needs_user:`需要你`,completed:`已完成`},successDefinition:`怎样才算完成`,deliverables:`交付物`,constraints:`约束与边界`,approvalRequired:`需要你批准`,executionReceipts:`执行回执`,noDefinition:`系统正在进一步明确完成标准。未明确前不会把事情误判为已完成。`,noReceipts:`还没有执行回执。`,backToWork:`返回首页`,outcomeNotFound:`没有找到这个结果`,runOutcome:`开始推进`,pauseOutcome:`暂时暂停`,resumeOutcome:`继续推进`,cancelOutcome:`结束事项`,actionFailed:`操作失败,请重试。`,verificationStatuses:{passed:`已验证`,failed:`验证未通过`,unverified:`待验证`}}:{newWork:`Ask xopc`,dialogTitle:`What do you want to get done?`,dialogDescription:`xopc will clarify the outcome, project, and first action before creating the work.`,intentLabel:`Tell xopc what you need`,intentPlaceholder:`For example: summarize this week’s meeting notes and suggest next week’s priorities`,submit:`Prepare work plan`,proposalTitle:`Confirm work plan`,projectLabel:`Project`,outcomeLabel:`Desired outcome`,nextActionLabel:`First action`,monitoringLabel:`Proactive follow-up`,monitoringModes:{observe:`Observe only`,ask_before_action:`Ask before acting`,auto_low_risk:`Auto-run low-risk actions`},existingProject:`Existing project`,newProject:`New project`,editIntent:`Edit intent`,confirmWork:`Confirm and create`,needsAttention:`Needs your attention`,runAttention:`Run issues`,running:`xopc is working`,continue:`Continue`,recent:`Recent conversations`,recentOutcomes:`Recent outcomes`,evidenceCount:`evidence items`,remainingCount:`remaining`,projects:`Long-term projects`,emptyRunning:`No conversations are running`,emptyContinue:`No ongoing items yet`,openChat:`Open conversation`,whyNow:`Why now`,impact:`Impact`,workDone:`AI checked`,recommendation:`Recommendation`,snooze:`Tomorrow`,dismiss:`Dismiss`,feedbackPlaceholder:`Tell AI how to judge this kind of event next time…`,applyFeedback:`Update future judgments`,outcomeStatuses:{running:`In progress`,needs_user:`Needs you`,completed:`Completed`},successDefinition:`Definition of done`,deliverables:`Deliverables`,constraints:`Constraints and boundaries`,approvalRequired:`Your approval is required`,executionReceipts:`Execution receipts`,noDefinition:`xopc is still clarifying the completion criteria. It will not mark this done before they are explicit.`,noReceipts:`No execution receipts yet.`,backToWork:`Back to home`,outcomeNotFound:`This outcome was not found`,runOutcome:`Start working`,pauseOutcome:`Pause`,resumeOutcome:`Continue`,cancelOutcome:`End outcome`,actionFailed:`The action failed. Please try again.`,verificationStatuses:{passed:`Verified`,failed:`Verification failed`,unverified:`Not verified`}}}export{M as a,P as c,F as d,N as f,O as i,D as l,j as n,T as o,E as r,k as s,I as t,A as u};
|