@xopcai/xopc 0.0.194 → 0.0.196
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/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-4ln7j-oZ.js → agent-avatar-dicebear-B1oxPli_.js} +1 -1
- package/dist/gateway/static/root/assets/agents-VoFNMGL3.js +68 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B0IMpHk8.js → app-management-settings-panel-vmuJ_Z6i.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BG6ZGIUf.js → appearance-settings-BMlEoe-G.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CsNB6mv_.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BNpjG4FR.js → archive-plugin-BdE4Mati.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BK25C_hA.js → attachment-load-CTzaQcLV.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-CW1YWgiX.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-fbFe6Jqc.js → binary-plugins-B25zTNxl.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-SQHwWg1e.js → block-editor-Cdrf2awF.js} +6 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BMTmGMM6.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-DuUQ_Ycz.js → browser-workflow-inputs-BsmHy0ks.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B8I2FmrM.js → browser-workflows-page-Wx9FrbK-.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C5l85__e.js +7 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-9T2KXAs1.js +3 -0
- package/dist/gateway/static/root/assets/channels-settings-DquD4BPQ.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-BC-4ftOM.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-7zUxVHQg.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-DtWb3YAh.js → cron-expression-BycQlU8Q.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-3vjdusik.js → dependency-picker-BvYqHRz0.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-NmW7VWdO.js → desktop-pet-BOb8sEhN.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DrdSI9lX.js → desktop-pet-settings-DStgPb82.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CG5XR1UD.js → directory-picker-path-field-DUUr9sq0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-RjIezQyy.js → extension-debug-page-p83TmZFd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D9Elz9mr.js → extension-page-DMQ3ovxA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BvVjqFvm.js → extension-settings-page-BcSKEU8s.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C-rYVz-n.js → gateway-config-api-C-MmtCc7.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CLS25-gm.js → gateway-settings-CuaRDWbg.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DSgDxtwJ.js → heartbeat-settings-Dm8TrfGa.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BYhDbUvI.js +3 -0
- package/dist/gateway/static/root/assets/{index-Cb9y6tVR.js → index-BzPwnXho.js} +62 -62
- package/dist/gateway/static/root/assets/index-CFFYvilx.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-RcHmSHYI.js → keyboard-shortcuts-settings-BQb06_jl.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CHk4x0kR.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-s7PKLTvO.js → local-apps-page-DQtsxjGs.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CDqIY72S.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-CWUHBXje.js → management-settings-D7itDEHl.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-B-IuPr4L.js → markdown-split-Db-KrpOQ.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CiejHVt4.js → media-plugins-CHN66qs0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BSJAwHqy.js → notes-page-CJtKZM0P.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-epHGeKd5.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-D6YJ6_l_.js → page-tabs-HXweXqYE.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Tw_G-6jb.js → preview-open-alternatives-Dob6Oe2l.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BlB3QjTV.js → product-open-page--RnCc9bb.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BxOD5-zj.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D-9AhrH5.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CSUNXLKM.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D59bftC7.js → runtime-tools-settings-panel-Bg1W2__k.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DyXqGA71.js → schema-form-BI4rVt3u.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BxOUBMca.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DAvTIbgw.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DZUGXwFO.js → settings-form-section-C7rzhi7x.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Lz1ec5lN.js → settings-loading-skeleton-BS36Mjzz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DLofKC7q.js → settings-page-BDSd7F9Y.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BdkN2U81.js → settings-page-layout-CTMmZcwj.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D1v-2Ci-.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DrZVv8tB.js → share-preview-page-BeCxg6eb.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CXL1EldF.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BxwkKgVw.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-zOD__-H5.js → skills-page-CyfjEM4D.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-ZDcx95iD.js → skills-page.utils-CnbJncdL.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BJhat70L.js → system-settings-panel-CAv0Yk0Y.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DGTVJs_N.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-B1p3wMFK.js → typed-models-lib-DomX3Szl.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Frcfbncl.js → use-autosave-BLc4gfG0.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-C2kQENTK.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CSNOUNF4.js → voice-api-key-field-BijmpPjb.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DTJGssPz.js → work-discovery-overlay-D7w2JFFq.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-Bt2-fzHu.js → work-discovery-page-XtoPgPUS.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D3uCmyag.js → workflow-run-setup-panel-BEmugHfL.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-D_K2xOWq.js +5 -0
- package/dist/gateway/static/root/index.html +2 -2
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.d.ts +2 -1
- package/dist/src/cli/commands/onboard/model.js +10 -3
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/understanding-sources.js +5 -1
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service.js +6 -6
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/user-context/sources/activity-clustering.js +1 -1
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/repository.d.ts +1 -0
- package/dist/src/user-context/sources/repository.js +4 -1
- package/dist/src/work-discovery/analyzer.js +8 -8
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-C1Z-rurI.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-CwsZENTk.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-BedezAfO.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CC0_TfTy.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-ditT6VRs.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-bNVds1ta.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-DhsWSbJ2.js +0 -1
- package/dist/gateway/static/root/assets/connectors-api-Ne8mQrYN.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-hZA9M1z_.js +0 -2
- package/dist/gateway/static/root/assets/home-page-CDpUUelT.js +0 -3
- package/dist/gateway/static/root/assets/image-generation-api-Cki7jfEV.js +0 -1
- package/dist/gateway/static/root/assets/index-DtEVsSU1.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DvzXo7dx.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CNm5fu3L.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-DTWRQ_EU.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-DT7aWLWT.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B-i3U2fU.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-v-kXavTc.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-tEfg1Pru.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-tbguNxVJ.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DQgoV7gj.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-I2bBkyDb.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-gFdcImEc.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DoyREaFj.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-DniWcH92.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Ba5fVQWY.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as a}from"./cn-JdwAhgNB.js";import{t as o}from"./messages-DQ5X6cXp.js";import{l as s,n as c,r as l,s as u}from"./locale-store-Bjvw7jtg.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{Du as f,Er as p,Hs as m,Jl as h,Ns as g,bn as _,cc as v,ds as y,iu as b,ls as x,mo as S,nl as C,ql as w,sn as T,tu as E,xa as D,yn as O,zc as ee}from"./index-Cb9y6tVR.js";import{n as k,r as A}from"./settings-page-layout-BdkN2U81.js";import{n as j}from"./settings-loading-skeleton-Lz1ec5lN.js";import{n as M,t as N}from"./settings-form-section-DZUGXwFO.js";var P=e(t(),1),F=n();function I(e){if(!e||typeof e!=`object`)return 0;let t=e.providers;return!t||typeof t!=`object`||Array.isArray(t)?0:Object.values(t).filter(e=>typeof e==`string`&&x(e)).length}function L(e){if(!e||typeof e!=`object`)return``;let t=e.agents;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t,r=typeof n.defaultPreset==`string`&&n.defaultPreset.trim()?n.defaultPreset.trim():`default`,i=n.capabilityPresets,a=i&&typeof i==`object`&&!Array.isArray(i)?i[r]:void 0,o=a&&typeof a==`object`&&!Array.isArray(a)?a.models:void 0;if(!o||typeof o!=`object`||Array.isArray(o))return``;let s=o,c=s.roles;if(!c||typeof c!=`object`||Array.isArray(c))return``;let l=c,u=typeof s.defaultRole==`string`&&s.defaultRole.trim()?s.defaultRole.trim():Object.keys(l)[0],d=u?l[u]:void 0;if(!d||typeof d!=`object`||Array.isArray(d))return``;let f=d.model;return typeof f==`string`?f.trim():``}function R(e){if(!e||typeof e!=`object`)return!1;let t=e.channels;return!t||typeof t!=`object`||Array.isArray(t)?!1:Object.values(t).some(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(`configured`in t||`config`in t||`schema`in t||`uiHints`in t){if(t.configured===!0)return!0;let e=t.config;if(!e||typeof e!=`object`||Array.isArray(e))return!1;let n=e;return n.enabled===!0||Object.keys(n).length>0}return t.enabled===!0||Object.keys(t).length>0})}function z(e){if(!e||typeof e!=`object`)return{enabled:!1,backend:`extension`};let t=e.browser;if(!t||typeof t!=`object`||Array.isArray(t))return{enabled:!1,backend:`extension`};let n=t;return{enabled:n.enabled===!0,backend:typeof n.backend==`string`&&n.backend.trim()?n.backend.trim():`extension`}}function B(e){return e?`pass`:`fail`}function V(e){if(e===`provider-auth`)return`/settings/capabilities/models`;if(e===`config-health`)return`/settings/gateway`;if(e===`state-integrity`||e===`workspace-status`)return`/agents`;if(e===`database-schema`||e===`session-integrity`)return`/settings/sessions`;if(e===`channel-config`||e===`channel-pairing-pending`||e.startsWith(`channel:`))return`/channels`;if(e===`security-audit`||e===`gateway-service`||e===`gateway-health`)return`/settings/gateway`;if(e===`version-check`)return`/settings/desktop-app`}function H(e){return{fail:4,warn:3,skip:2,pass:1}[e]}function te(e){return e.filter(e=>e.status===`fail`||e.status===`warn`).map(e=>({id:e.id,label:e.label,status:e.status,message:e.message,hints:e.hints,path:V(e.id),source:`doctor`})).toSorted((e,t)=>H(t.status)-H(e.status)||e.label.localeCompare(t.label))}function U(e){let t=new Map(e.doctorChecks.map(e=>[e.id,e])),n=[];for(let e of[`security-audit`,`channel-config`,`channel-pairing-pending`,`gateway-health`]){let r=t.get(e);r&&n.push({id:r.id,label:r.label,status:r.status,message:r.message,path:V(r.id)})}if(e.logsHealth){let t=e.logsHealth.stats?.errorsLast24h??0;n.push({id:`logs-health`,label:`Logs`,status:e.logsHealth.shuttingDown||t>0?`warn`:`pass`,message:e.logsHealth.shuttingDown?`Logger is shutting down.`:t>0?`${t} error(s) in the last 24 hours.`:`Log system is healthy.`,path:`/settings/logs`})}for(let t of e.browserDiagnostics??[])n.push(t);return n}function ne(e){let t=I(e.config),n=e.providerMeta?.configured??t,r=e.providerMeta?.total??0,i=n>0||t>0,a=L(e.config),o=a.length>0,s=e.hasToken&&e.realtimeConnected,c=R(e.config),l=e.skillCount>0,u=e.doctorChecks??[],d=te(u),f=[{id:`gateway`,done:s,detail:s?e.labels.gatewayOnline:e.labels.gatewayOffline},{id:`provider`,done:i,detail:i?e.providerMeta&&e.providerMeta.total>0?e.labels.providersMetaReady(n,r):e.labels.providersConfigured(t):e.labels.providersMissing},{id:`defaultModel`,done:o,detail:o?e.labels.modelConfigured(a):e.labels.modelMissing},{id:`channel`,done:c,optional:!0,detail:c?e.labels.channelConfigured:e.labels.channelMissing},{id:`skill`,done:l,optional:!0,detail:l?e.labels.skillsConfigured(e.skillCount):e.labels.skillsMissing}],p=f.filter(e=>!e.optional).every(e=>e.done),m=f.every(e=>e.done),h=[{id:`gateway`,status:B(s),title:`Gateway`,detail:s?e.labels.gatewayOnline:e.labels.gatewayOffline,path:`/settings/gateway`},{id:`provider`,status:B(i),title:`Model provider`,detail:i?e.providerMeta&&e.providerMeta.total>0?e.labels.providersMetaReady(n,r):e.labels.providersConfigured(t):e.labels.providersMissing,path:`/settings/capabilities/models`},{id:`defaultModel`,status:B(o),title:`Default model`,detail:o?e.labels.modelConfigured(a):e.labels.modelMissing,path:`/settings/capabilities/models`},{id:`ready`,status:p?`pass`:`fail`,title:`Chat readiness`,detail:p?e.labels.readyToChat:e.labels.modelMissing,path:`/chat`}],g=d.some(e=>e.status===`fail`),_=d.some(e=>e.status===`warn`),v=g?`blocked`:_?`attention`:p?`ready`:`setup`,y=U({doctorChecks:u,logsHealth:e.logsHealth,browserDiagnostics:e.browserDiagnostics});return{gatewayConnected:s,providerConfigured:i,providerCount:t,providerMetaConfigured:n,providerMetaTotal:r,defaultModel:a,defaultModelConfigured:o,channelConfigured:c,skillInstalled:l,skillCount:e.skillCount,checklist:f,readiness:h,issues:d,healthTier:v,diagnosticSignals:y,requiredComplete:p,allComplete:m}}function re(e){return z(e)}function W(e){return!e.id||!e.label||!e.status||!e.message||![`pass`,`warn`,`fail`,`skip`].includes(e.status)?null:{id:e.id,label:e.label,status:e.status,message:e.message,hints:Array.isArray(e.hints)?e.hints.filter(e=>typeof e==`string`):[],fixed:e.fixed===!0,findings:Array.isArray(e.findings)?e.findings:void 0}}function ie(){return l(`/api/doctor`)}async function ae(){return((await u(ie())).checks??[]).map(W).filter(e=>e!==null)}function oe(){return l(`/api/logs/health`)}async function se(){return u(oe())}function G(e){return e?`pass`:`warn`}function K(e){return`/settings/agent-browser?tab=${encodeURIComponent(e)}`}function ce(e){return e?.enabled?[`setup-browser-diagnostics`,e]:null}async function le(e){if(!e.enabled)return[];if(e.backend===`local`){let e=await u(l(`/api/browser/playwright/doctor`)),t=e.payload?.installed===!0;return[{id:`browser-playwright`,label:`Browser: Playwright`,status:G(t),message:t?`Local Chromium is installed.`:e.payload?.reason??`Local Chromium is not installed.`,path:K(`local`)}]}if(e.backend===`cloakbrowser`){let e=await u(l(`/api/browser/cloakbrowser/doctor`)),t=e.payload?.installed===!0;return[{id:`browser-cloakbrowser`,label:`Browser: CloakBrowser`,status:G(t),message:t?`CloakBrowser ${e.payload?.version??``}`.trim():`CloakBrowser is not installed.`,path:K(`cloakbrowser`)}]}if(e.backend===`extension`){let e=await u(l(`/api/browser/extension-status?probe=true`)),t=e.artifacts?.installed===!0,n=e.connected===!0,r=e.artifacts?.needsRefresh===!0||e.artifacts?.needsChromeReload===!0;return[{id:`browser-extension`,label:`Browser: Chrome extension`,status:n?`pass`:`warn`,message:n?`Chrome extension bridge is connected.`:t?r?`Chrome extension needs refresh.`:`Chrome extension is installed but not connected.`:`Chrome extension is not installed.`,path:K(`extension`)}]}return[{id:`browser-playwright`,label:`Browser`,status:`skip`,message:`Browser backend "${e.backend}" is not checked on this overview.`,path:K(e.backend||`overview`)}]}function q(){let e=(0,F.c)(57),t=s(he),n=c(me),r;e[0]===n?r=e[1]:(r=o(n),e[0]=n,e[1]=r);let i=r,a=i.setupStatus.labels,l=D(pe),{data:u,error:f,isLoading:p,mutate:m}=S(!!t),h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1},e[2]=h):h=e[2];let{data:g,error:v,isLoading:y,mutate:b}=d(t?`setup-checklist-skills`:null,fe,h),x;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(x={revalidateOnFocus:!1},e[3]=x):x=e[3];let{data:C,error:w,isLoading:E,mutate:ee}=d(t?`setup-checklist-provider-meta`:null,T,x),k;e[4]===t?k=e[5]:(k=t?ie():null,e[4]=t,e[5]=k);let A;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(A={revalidateOnFocus:!1},e[6]=A):A=e[6];let{data:j,error:M,isLoading:N,mutate:P}=d(k,ae,A),I;e[7]===t?I=e[8]:(I=t?oe():null,e[7]=t,e[8]=I);let L;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(L={revalidateOnFocus:!1},e[9]=L):L=e[9];let{data:R,isLoading:z,mutate:B}=d(I,se,L);u?.payload?.config;let V=u?.payload?.config,H;e[10]===V?H=e[11]:(H=re(V),e[10]=V,e[11]=H);let te=t?H:null,U;e[12]===te?U=e[13]:(U=ce(te),e[12]=te,e[13]=U);let W;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(W={revalidateOnFocus:!1},e[14]=W):W=e[14];let{data:G,isLoading:K,mutate:le}=d(U,de,W),q;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(q={revalidateOnFocus:!1},e[15]=q):q=e[15],d(t?O:null,_,q);let J=!t||!p&&!y&&!E&&!N&&!z&&!K,Y=!!(f||v||w||M),X;bb0:{if(!t||!J){X=null;break bb0}let n=g?.catalog?.length??0,r;if(e[16]!==G||e[17]!==u?.payload?.config||e[18]!==j||e[19]!==a.channelConfigured||e[20]!==a.channelMissing||e[21]!==a.gatewayOffline||e[22]!==a.gatewayOnline||e[23]!==a.modelConfigured||e[24]!==a.modelMissing||e[25]!==a.providersConfigured||e[26]!==a.providersMetaReady||e[27]!==a.providersMissing||e[28]!==a.skillsConfigured||e[29]!==a.skillsMissing||e[30]!==R||e[31]!==i.setupStatus.requiredCompleteMessage||e[32]!==C||e[33]!==l||e[34]!==n||e[35]!==t){let o=C?.filter(ue).length??0,s=C?.length??0,c;e[37]===a.providersConfigured?c=e[38]:(c=e=>a.providersConfigured.replace(`{{count}}`,String(e)),e[37]=a.providersConfigured,e[38]=c);let d;e[39]===a.providersMetaReady?d=e[40]:(d=(e,t)=>a.providersMetaReady.replace(`{{configured}}`,String(e)).replace(`{{total}}`,String(t)),e[39]=a.providersMetaReady,e[40]=d);let f;e[41]===a.modelConfigured?f=e[42]:(f=e=>a.modelConfigured.replace(`{{model}}`,e),e[41]=a.modelConfigured,e[42]=f);let p;e[43]===a.skillsConfigured?p=e[44]:(p=e=>a.skillsConfigured.replace(`{{count}}`,String(e)),e[43]=a.skillsConfigured,e[44]=p),r=ne({hasToken:!!t,realtimeConnected:l,config:u?.payload?.config,skillCount:n,providerMeta:s>0?{configured:o,total:s}:null,doctorChecks:j,logsHealth:R,browserDiagnostics:G,labels:{gatewayOnline:a.gatewayOnline,gatewayOffline:a.gatewayOffline,providersConfigured:c,providersMetaReady:d,providersMissing:a.providersMissing,modelConfigured:f,modelMissing:a.modelMissing,channelConfigured:a.channelConfigured,channelMissing:a.channelMissing,skillsConfigured:p,skillsMissing:a.skillsMissing,readyToChat:i.setupStatus.requiredCompleteMessage}}),e[16]=G,e[17]=u?.payload?.config,e[18]=j,e[19]=a.channelConfigured,e[20]=a.channelMissing,e[21]=a.gatewayOffline,e[22]=a.gatewayOnline,e[23]=a.modelConfigured,e[24]=a.modelMissing,e[25]=a.providersConfigured,e[26]=a.providersMetaReady,e[27]=a.providersMissing,e[28]=a.skillsConfigured,e[29]=a.skillsMissing,e[30]=R,e[31]=i.setupStatus.requiredCompleteMessage,e[32]=C,e[33]=l,e[34]=n,e[35]=t,e[36]=r}else r=e[36];X=r}let ge=X,Z;e[45]!==le||e[46]!==m||e[47]!==P||e[48]!==B||e[49]!==ee||e[50]!==b?(Z=async()=>{await Promise.all([m(),b(),ee(),P(),B(),le()])},e[45]=le,e[46]=m,e[47]=P,e[48]=B,e[49]=ee,e[50]=b,e[51]=Z):Z=e[51];let Q=Z,$;return e[52]!==Y||e[53]!==J||e[54]!==Q||e[55]!==ge?($={ready:J,error:Y,snapshot:ge,refresh:Q},e[52]=Y,e[53]=J,e[54]=Q,e[55]=ge,e[56]=$):$=e[56],$}function ue(e){return e.configured}function de(e){let[,t]=e;return le(t)}function fe(){return p()}function pe(e){return e.connectionState===`connected`}function me(e){return e.language}function he(e){return e.token}var J=r();function Y(e){return e===`pass`?`border-success/30 bg-success-soft text-success`:e===`warn`?`border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300`:e===`fail`?`border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300`:`border-edge bg-surface-hover text-fg-muted`}function X(e){return e===`pass`?E:e===`warn`?g:e===`fail`?h:C}function ge(e,t){return e===`blocked`?{icon:h,className:`bg-red-500/10 text-red-950 dark:text-red-100`,title:t.health.blockedTitle,body:t.health.blockedBody,action:t.health.viewIssues,targetId:`next-steps`}:e===`attention`?{icon:g,className:`bg-amber-500/10 text-amber-950 dark:text-amber-100`,title:t.health.attentionTitle,body:t.health.attentionBody,action:t.health.viewIssues,targetId:`next-steps`}:e===`setup`?{icon:w,className:`bg-surface-base text-fg shadow-surface`,title:t.health.setupTitle,body:t.health.setupBody,action:t.health.continueSetup,targetId:`next-steps`}:{icon:E,className:`bg-success-soft text-success`,title:t.health.readyTitle,body:t.health.readyBody,action:t.health.startChat,actionPath:`/chat`}}function Z(e){let t=(0,F.c)(48),{tier:n,issueCount:r,onRunDoctor:s,ready:l,doctorRunning:u,doctorRunState:d}=e,f=c(Q),p,m,h,g,_,x,S,C,w,T,E;if(t[0]!==r||t[1]!==f||t[2]!==n){m=o(f).setupStatus;let e=ge(n,m),s=e.icon,c=`targetId`in e&&typeof e.targetId==`string`?e.targetId:null,l=`actionPath`in e&&typeof e.actionPath==`string`?e.actionPath:`/chat`;p=c?(0,J.jsxs)(`button`,{type:`button`,onClick:()=>document.getElementById(c)?.scrollIntoView({block:`start`,behavior:`smooth`}),className:`inline-flex items-center gap-1 rounded-lg bg-surface-base px-3 py-2 text-sm font-medium text-fg shadow-sm hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.action,(0,J.jsx)(b,{className:`size-4`,"aria-hidden":!0})]}):(0,J.jsxs)(i,{to:l,className:`inline-flex items-center gap-1 rounded-lg bg-surface-base px-3 py-2 text-sm font-medium text-fg shadow-sm hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.action,(0,J.jsx)(b,{className:`size-4`,"aria-hidden":!0})]}),E=a(`rounded-xl p-4`,e.className),T=`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,C=`flex min-w-0 gap-3`,w=(0,J.jsx)(s,{className:`mt-0.5 size-5 shrink-0`,"aria-hidden":!0}),_=`min-w-0`,x=(0,J.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),S=(0,J.jsx)(`p`,{className:`mt-1 text-sm opacity-85`,children:e.body}),h=`mt-2 text-xs opacity-75`,g=m.health.issueCount.replace(`{{count}}`,String(r)),t[0]=r,t[1]=f,t[2]=n,t[3]=p,t[4]=m,t[5]=h,t[6]=g,t[7]=_,t[8]=x,t[9]=S,t[10]=C,t[11]=w,t[12]=T,t[13]=E}else p=t[3],m=t[4],h=t[5],g=t[6],_=t[7],x=t[8],S=t[9],C=t[10],w=t[11],T=t[12],E=t[13];let D;t[14]!==h||t[15]!==g?(D=(0,J.jsx)(`p`,{className:h,children:g}),t[14]=h,t[15]=g,t[16]=D):D=t[16];let O;t[17]!==D||t[18]!==_||t[19]!==x||t[20]!==S?(O=(0,J.jsxs)(`div`,{className:_,children:[x,S,D]}),t[17]=D,t[18]=_,t[19]=x,t[20]=S,t[21]=O):O=t[21];let k;t[22]!==O||t[23]!==C||t[24]!==w?(k=(0,J.jsxs)(`div`,{className:C,children:[w,O]}),t[22]=O,t[23]=C,t[24]=w,t[25]=k):k=t[25];let A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=a(`inline-flex items-center gap-2 rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,y.press),t[26]=A):A=t[26];let j=!l||u,M;t[27]===u?M=t[28]:(M=u?(0,J.jsx)(ee,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,J.jsx)(v,{className:`size-4`,"aria-hidden":!0}),t[27]=u,t[28]=M);let N=u?m.health.runDoctorRunning:m.health.runDoctor,P;t[29]!==u||t[30]!==s||t[31]!==j||t[32]!==M||t[33]!==N?(P=(0,J.jsxs)(`button`,{type:`button`,className:A,onClick:s,disabled:j,"aria-busy":u,children:[M,N]}),t[29]=u,t[30]=s,t[31]=j,t[32]=M,t[33]=N,t[34]=P):P=t[34];let I;t[35]!==p||t[36]!==P?(I=(0,J.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[p,P]}),t[35]=p,t[36]=P,t[37]=I):I=t[37];let L;t[38]!==k||t[39]!==I||t[40]!==T?(L=(0,J.jsxs)(`div`,{className:T,children:[k,I]}),t[38]=k,t[39]=I,t[40]=T,t[41]=L):L=t[41];let R=u?m.health.doctorRunningMessage:d===`success`?m.health.doctorCompleteMessage:d===`error`?m.health.doctorFailedMessage:m.health.doctorIdleMessage,z;t[42]===R?z=t[43]:(z=(0,J.jsx)(`p`,{className:`mt-3 text-xs opacity-75`,role:`status`,"aria-live":`polite`,children:R}),t[42]=R,t[43]=z);let B;return t[44]!==L||t[45]!==z||t[46]!==E?(B=(0,J.jsxs)(`section`,{className:E,children:[L,z]}),t[44]=L,t[45]=z,t[46]=E,t[47]=B):B=t[47],B}function Q(e){return e.language}function $(e){let t=(0,F.c)(34),{issue:n,fixLabel:r}=e,o;t[0]===n.status?o=t[1]:(o=X(n.status),t[0]=n.status,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c=(0,J.jsx)(s,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":!0}),t[2]=s,t[3]=c);let l;t[4]===n.label?l=t[5]:(l=(0,J.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:n.label}),t[4]=n.label,t[5]=l);let u;t[6]===n.status?u=t[7]:(u=a(`rounded-full border px-2 py-0.5 text-[11px] font-medium uppercase`,Y(n.status)),t[6]=n.status,t[7]=u);let d;t[8]!==n.status||t[9]!==u?(d=(0,J.jsx)(`span`,{className:u,children:n.status}),t[8]=n.status,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===n.message?p=t[15]:(p=(0,J.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:n.message}),t[14]=n.message,t[15]=p);let m;t[16]===n.hints[0]?m=t[17]:(m=n.hints[0]?(0,J.jsx)(`span`,{className:`mt-1 block truncate text-xs text-fg-subtle`,children:n.hints[0]}):null,t[16]=n.hints[0],t[17]=m);let h;t[18]!==f||t[19]!==p||t[20]!==m?(h=(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,p,m]}),t[18]=f,t[19]=p,t[20]=m,t[21]=h):h=t[21];let g;t[22]!==r||t[23]!==n.path?(g=n.path?(0,J.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs font-medium text-accent-fg`,children:[r,(0,J.jsx)(b,{className:`size-4`,"aria-hidden":!0})]}):null,t[22]=r,t[23]=n.path,t[24]=g):g=t[24];let _;t[25]!==g||t[26]!==c||t[27]!==h?(_=(0,J.jsxs)(J.Fragment,{children:[c,h,g]}),t[25]=g,t[26]=c,t[27]=h,t[28]=_):_=t[28];let v=_;if(n.path){let e;return t[29]!==v||t[30]!==n.path?(e=(0,J.jsx)(i,{to:n.path,className:`flex items-start gap-3 rounded-lg bg-surface-panel/80 p-3 shadow-surface hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:v}),t[29]=v,t[30]=n.path,t[31]=e):e=t[31],e}let y;return t[32]===v?y=t[33]:(y=(0,J.jsx)(`div`,{className:`flex items-start gap-3 rounded-lg bg-surface-panel/80 p-3 shadow-surface`,children:v}),t[32]=v,t[33]=y),y}function _e(e){let t=(0,F.c)(27),{item:n,labels:r}=e,o;t[0]===n.status?o=t[1]:(o=X(n.status),t[0]=n.status,t[1]=o);let s=o,c=r[n.id]??n.title,l;t[2]===n.status?l=t[3]:(l=a(`flex size-7 shrink-0 items-center justify-center rounded-full border`,Y(n.status)),t[2]=n.status,t[3]=l);let u;t[4]===s?u=t[5]:(u=(0,J.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[4]=s,t[5]=u);let d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(`span`,{className:l,children:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]===c?f=t[10]:(f=(0,J.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:c}),t[9]=c,t[10]=f);let p;t[11]===n.detail?p=t[12]:(p=(0,J.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:n.detail}),t[11]=n.detail,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===n.path?h=t[17]:(h=n.path?(0,J.jsx)(b,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}):null,t[16]=n.path,t[17]=h);let g;t[18]!==d||t[19]!==m||t[20]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[d,m,h]}),t[18]=d,t[19]=m,t[20]=h,t[21]=g):g=t[21];let _=g;if(n.path){let e;return t[22]!==_||t[23]!==n.path?(e=(0,J.jsx)(i,{to:n.path,className:`flex items-center gap-3 rounded-lg p-3 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:_}),t[22]=_,t[23]=n.path,t[24]=e):e=t[24],e}let v;return t[25]===_?v=t[26]:(v=(0,J.jsx)(`div`,{className:`flex items-center gap-3 rounded-lg p-3`,children:_}),t[25]=_,t[26]=v),v}function ve(e){let t=(0,F.c)(29),{signal:n,fixLabel:r}=e,o;t[0]===n.status?o=t[1]:(o=X(n.status),t[0]=n.status,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c=(0,J.jsx)(s,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":!0}),t[2]=s,t[3]=c);let l;t[4]===n.label?l=t[5]:(l=(0,J.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:n.label}),t[4]=n.label,t[5]=l);let u;t[6]===n.message?u=t[7]:(u=(0,J.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:n.message}),t[6]=n.message,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===n.status?f=t[12]:(f=a(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium uppercase`,Y(n.status)),t[11]=n.status,t[12]=f);let p;t[13]!==n.status||t[14]!==f?(p=(0,J.jsx)(`span`,{className:f,children:n.status}),t[13]=n.status,t[14]=f,t[15]=p):p=t[15];let m;t[16]!==r||t[17]!==n.path?(m=n.path?(0,J.jsx)(`span`,{className:`sr-only`,children:r}):null,t[16]=r,t[17]=n.path,t[18]=m):m=t[18];let h;t[19]!==c||t[20]!==d||t[21]!==p||t[22]!==m?(h=(0,J.jsxs)(J.Fragment,{children:[c,d,p,m]}),t[19]=c,t[20]=d,t[21]=p,t[22]=m,t[23]=h):h=t[23];let g=h;if(n.path){let e;return t[24]!==g||t[25]!==n.path?(e=(0,J.jsx)(i,{to:n.path,className:`flex min-w-0 items-start gap-2 rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:g}),t[24]=g,t[25]=n.path,t[26]=e):e=t[26],e}let _;return t[27]===g?_=t[28]:(_=(0,J.jsx)(`div`,{className:`flex min-w-0 items-start gap-2 rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface`,children:g}),t[27]=g,t[28]=_),_}function ye(){let e=o(c(e=>e.language)).setupStatus,{ready:t,error:n,snapshot:r,refresh:i}=q(),[s,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(`idle`),p=r?.diagnosticSignals.filter(e=>e.status===`fail`||e.status===`warn`)??[],h=async()=>{if(!(s||!t)){l(!0),d(`idle`);try{await i(),d(`success`)}catch{d(`error`)}finally{l(!1)}}};return(0,J.jsxs)(A,{gap:`gap-6`,children:[(0,J.jsx)(k,{title:e.title,subtitle:e.subtitle,actions:(0,J.jsxs)(`button`,{type:`button`,className:a(`inline-flex shrink-0 items-center gap-2 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,y.press),onClick:()=>void h(),disabled:!t||s,"aria-busy":s,children:[(0,J.jsx)(v,{className:a(`size-4`,(!t||s)&&`animate-spin`),"aria-hidden":!0}),s?e.health.runDoctorRunning:e.refresh]})}),n?(0,J.jsx)(`p`,{className:`rounded-xl border border-red-300/40 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/40 dark:bg-red-950/30 dark:text-red-300`,children:e.loadError}):null,!t||!r?(0,J.jsx)(j,{sections:2}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{tier:r.healthTier,issueCount:r.issues.length,ready:t,onRunDoctor:()=>void h(),doctorRunning:s,doctorRunState:u}),(0,J.jsxs)(N,{id:`next-steps`,children:[(0,J.jsx)(M,{icon:r.issues.length?g:f,title:e.nextStepsTitle,subtitle:r.issues.length?e.nextStepsIssuesSubtitle:e.nextStepsReadySubtitle}),r.issues.length?(0,J.jsx)(`div`,{className:`mt-4 flex flex-col gap-2`,children:r.issues.slice(0,8).map(t=>(0,J.jsx)($,{issue:t,fixLabel:e.fixIssue},`${t.source}:${t.id}`))}):(0,J.jsx)(`div`,{className:`mt-4 rounded-lg bg-surface-panel/80 shadow-surface`,children:r.readiness.map(t=>(0,J.jsx)(_e,{item:t,labels:e.readinessLabels},t.id))})]}),(0,J.jsxs)(N,{children:[(0,J.jsx)(M,{icon:m,title:e.diagnosticsTitle,subtitle:e.diagnosticsSubtitle}),p.length?(0,J.jsx)(`div`,{className:`mt-4 grid gap-2 md:grid-cols-2`,children:p.map(t=>(0,J.jsx)(ve,{signal:t,fixLabel:e.fixIssue},t.id))}):(0,J.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-panel/80 p-3 text-sm text-fg-muted shadow-surface`,children:r.diagnosticSignals.length?e.diagnosticsAllClear:e.diagnosticsEmpty})]})]})]})}export{ye as SetupStatusPanel};
|
|
@@ -1 +0,0 @@
|
|
|
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}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-JdwAhgNB.js";import{t as s}from"./copy-to-clipboard-HOJ79TWv.js";import{t as c}from"./messages-DQ5X6cXp.js";import{l,n as u,r as d,s as f}from"./locale-store-Bjvw7jtg.js";import{i as p}from"./vendor-swr-BIWyz7Rc.js";import{Ao as m,At as h,Da as g,En as _,Go as v,Ll as y,Mi as b,Mo as x,No as S,Oo as ee,Po as C,Ps as w,Qr as T,Tl as E,Ul as D,Wo as O,_s as k,ai as A,bs as j,cc as te,ci as M,dr as N,ei as P,gs as F,hc as I,ii as L,ko as ne,mo as re,ni as R,oi as ie,ou as z,po as ae,ri as oe,si as B,ti as V,vr as se,yl as ce,zc as H}from"./index-Cb9y6tVR.js";import{n as U,r as W,t as G}from"./settings-page-layout-BdkN2U81.js";import{t as K}from"./settings-loading-skeleton-Lz1ec5lN.js";import{t as q}from"./settings-form-section-DZUGXwFO.js";import{t as le}from"./page-tabs-D6YJ6_l_.js";var J=e(t(),1),ue=n(),Y={enabled:!0,defaultTtlHours:24,maxTtlDays:30,maxActiveShares:500,maxFileSizeMb:500,directoryMaxFolderSizeMb:2048,directoryMaxFileCount:1e4,inlinePreviewMimes:[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`,`application/pdf`,`text/html`,`text/markdown`,`text/plain`,`application/json`],siteEnabled:!0,siteDefaultTtlHours:24,siteMaxTtlDays:30,maxActiveSites:50,siteMaxRootDirSizeMb:1024,siteMaxFileCount:2e4};function de(){return structuredClone(Y)}var fe=36e5,X=864e5,Z=1048576;function pe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function me(e,t=32){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim()).slice(0,t):[]}function he(e){let t=pe(e)?e:{},n=pe(t.gateway)?t.gateway:{},r=pe(n.share)?n.share:{},i=pe(r.directory)?r.directory:{},a=pe(n.siteShare)?n.siteShare:{},o=pe(a.static)?a.static:{},s=typeof r.defaultTtlMs==`number`&&Number.isFinite(r.defaultTtlMs)?Math.floor(r.defaultTtlMs):Y.defaultTtlHours*fe,c=typeof r.maxTtlMs==`number`&&Number.isFinite(r.maxTtlMs)?Math.floor(r.maxTtlMs):Y.maxTtlDays*X,l=typeof r.maxFileSize==`number`&&Number.isFinite(r.maxFileSize)?Math.floor(r.maxFileSize):Y.maxFileSizeMb*Z,u=typeof i.maxFolderSize==`number`&&Number.isFinite(i.maxFolderSize)?Math.floor(i.maxFolderSize):Y.directoryMaxFolderSizeMb*Z,d=typeof a.defaultTtlMs==`number`&&Number.isFinite(a.defaultTtlMs)?Math.floor(a.defaultTtlMs):Y.siteDefaultTtlHours*fe,f=typeof a.maxTtlMs==`number`&&Number.isFinite(a.maxTtlMs)?Math.floor(a.maxTtlMs):Y.siteMaxTtlDays*X,p=typeof o.maxRootDirSize==`number`&&Number.isFinite(o.maxRootDirSize)?Math.floor(o.maxRootDirSize):Y.siteMaxRootDirSizeMb*Z;return{enabled:r.enabled!==!1,defaultTtlHours:Math.max(1,Math.round(s/fe)),maxTtlDays:Math.max(1,Math.round(c/X)),maxActiveShares:typeof r.maxActiveShares==`number`&&Number.isFinite(r.maxActiveShares)?Math.max(1,Math.min(1e4,Math.floor(r.maxActiveShares))):Y.maxActiveShares,maxFileSizeMb:Math.max(1,Math.round(l/Z)),directoryMaxFolderSizeMb:Math.max(1,Math.round(u/Z)),directoryMaxFileCount:typeof i.maxFileCount==`number`&&Number.isFinite(i.maxFileCount)?Math.max(1,Math.min(1e5,Math.floor(i.maxFileCount))):Y.directoryMaxFileCount,inlinePreviewMimes:me(r.inlinePreviewMimes,32).length?me(r.inlinePreviewMimes,32):[...Y.inlinePreviewMimes],siteEnabled:a.enabled!==!1,siteDefaultTtlHours:Math.max(1,Math.round(d/fe)),siteMaxTtlDays:Math.max(1,Math.round(f/X)),maxActiveSites:typeof a.maxActiveSites==`number`&&Number.isFinite(a.maxActiveSites)?Math.max(1,Math.min(1e3,Math.floor(a.maxActiveSites))):Y.maxActiveSites,siteMaxRootDirSizeMb:Math.max(1,Math.round(p/Z)),siteMaxFileCount:typeof o.maxFileCount==`number`&&Number.isFinite(o.maxFileCount)?Math.max(1,Math.min(1e5,Math.floor(o.maxFileCount))):Y.siteMaxFileCount}}function ge(e){let t=e.defaultTtlHours*fe,n=e.maxTtlDays*X,r=e.siteDefaultTtlHours*fe,i=e.siteMaxTtlDays*X;return t<6e4||t>6048e5?`Default share TTL must be between 1 minute and 7 days.`:n<6e4||n>2592e6?`Maximum share TTL must be between 1 minute and 30 days.`:t>n?`Default TTL cannot exceed maximum TTL.`:e.maxActiveShares<1||e.maxActiveShares>1e4?`Maximum active shares must be between 1 and 10,000.`:e.maxActiveSites<1||e.maxActiveSites>1e3?`Maximum active site shares must be between 1 and 1,000.`:e.maxFileSizeMb<1||e.maxFileSizeMb>10240?`Maximum file size must be between 1 MB and 10 GB.`:e.directoryMaxFolderSizeMb<1||e.directoryMaxFolderSizeMb>10240?`Maximum folder size must be between 1 MB and 10 GB.`:e.directoryMaxFileCount<1||e.directoryMaxFileCount>1e5?`Maximum directory file count must be between 1 and 100,000.`:r<6e4||r>6048e5?`Default site share TTL must be between 1 minute and 7 days.`:i<6e4||i>2592e6?`Maximum site share TTL must be between 1 minute and 30 days.`:r>i?`Default site TTL cannot exceed maximum site TTL.`:e.siteMaxRootDirSizeMb<1||e.siteMaxRootDirSizeMb>10240?`Maximum static site size must be between 1 MB and 10 GB.`:e.siteMaxFileCount<1||e.siteMaxFileCount>1e5?`Maximum static site file count must be between 1 and 100,000.`:null}async function _e(e){let t=ge(e);if(t)throw Error(t);await f(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{share:{enabled:e.enabled,defaultTtlMs:e.defaultTtlHours*fe,maxTtlMs:e.maxTtlDays*X,maxActiveShares:e.maxActiveShares,maxFileSize:e.maxFileSizeMb*Z,inlinePreviewMimes:e.inlinePreviewMimes,directory:{maxFolderSize:e.directoryMaxFolderSizeMb*Z,maxFileCount:e.directoryMaxFileCount}},siteShare:{enabled:e.siteEnabled,defaultTtlMs:e.siteDefaultTtlHours*fe,maxTtlMs:e.siteMaxTtlDays*X,maxActiveSites:e.maxActiveSites,static:{maxRootDirSize:e.siteMaxRootDirSizeMb*Z,maxFileCount:e.siteMaxFileCount}}}})}),ae()}var Q=r();function ve(){return o(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,F,`dark:border-edge`)}function ye({hasToken:e}){let t=c(u(e=>e.language)).sharesSettings,{data:n,isLoading:r}=re(e),i=(0,J.useMemo)(()=>n?.payload?.config===void 0?null:structuredClone(he(n.payload.config)),[n]),a=(0,J.useRef)(!1),[o,s]=(0,J.useState)(null),[l,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1),g=o??i,_=i,v=(0,J.useMemo)(()=>!g||!_?!1:JSON.stringify(g)!==JSON.stringify(_),[g,_]),y=(0,J.useCallback)(e=>{a.current=!0,s(t=>{let n=t??_;return n?{...n,...e}:null})},[_]),b=(0,J.useCallback)(async()=>{if(!(!g||l)){d(!0),p(null),h(!1);try{await _e(g),a.current=!1,s(null),h(!0),window.setTimeout(()=>h(!1),2500)}catch(e){p(e instanceof Error?e.message:t.policySaveError)}finally{d(!1)}}},[g,l,t.policySaveError]),x=(0,J.useCallback)(()=>{a.current=!1,s(null),p(null),h(!1)},[]);return!e||!g?r?(0,Q.jsx)(q,{children:(0,Q.jsx)(K,{rows:2})}):null:(0,Q.jsxs)(q,{children:[(0,Q.jsxs)(`div`,{className:`mb-4 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.policyTitle}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.policyHint})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[m?(0,Q.jsx)(`span`,{className:`text-sm text-fg-muted`,children:t.policySaved}):null,(0,Q.jsx)(k,{type:`button`,variant:`secondary`,disabled:l,onClick:()=>y(de()),children:t.policyUseRecommended}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,disabled:!v||l,onClick:x,children:t.policyDiscard}),(0,Q.jsx)(k,{type:`button`,variant:`primary`,disabled:!v||l,onClick:()=>void b(),children:l?t.policySaving:t.policySave})]})]}),v?(0,Q.jsx)(`p`,{className:`mb-3 text-xs text-amber-800 dark:text-amber-200`,children:t.policyUnsaved}):null,f?(0,Q.jsx)(`p`,{className:`mb-3 text-sm text-red-600 dark:text-red-400`,children:f}):null,(0,Q.jsx)(`p`,{className:`mb-4 text-xs text-fg-subtle`,children:t.policyRestartHint}),(0,Q.jsx)(be,{t,form:g,onChange:y})]})}function be(e){let t=(0,ue.c)(150),{t:n,form:r,onChange:i}=e,a;t[0]===n.policyFileSection?a=t[1]:(a=(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policyFileSection}),t[0]=n.policyFileSection,t[1]=a);let o;t[2]===n.policyFileSectionHint?o=t[3]:(o=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policyFileSectionHint}),t[2]=n.policyFileSectionHint,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Q.jsxs)(`div`,{className:`mb-4`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=e=>i({enabled:e.target.checked}),t[7]=i,t[8]=c);let l;t[9]!==r.enabled||t[10]!==c?(l=(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.enabled,onChange:c}),t[9]=r.enabled,t[10]=c,t[11]=l):l=t[11];let u;t[12]!==n.policyEnabled||t[13]!==l?(u=(0,Q.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[l,n.policyEnabled]}),t[12]=n.policyEnabled,t[13]=l,t[14]=u):u=t[14];let d=!r.enabled,f;t[15]===i?f=t[16]:(f=e=>i({defaultTtlHours:e}),t[15]=i,t[16]=f);let p;t[17]!==r.defaultTtlHours||t[18]!==n.policyDefaultTtlHint||t[19]!==n.policyDefaultTtlHours||t[20]!==d||t[21]!==f?(p=(0,Q.jsx)($,{id:`share-default-ttl-hours`,label:n.policyDefaultTtlHours,hint:n.policyDefaultTtlHint,value:r.defaultTtlHours,min:1,max:168,disabled:d,onChange:f}),t[17]=r.defaultTtlHours,t[18]=n.policyDefaultTtlHint,t[19]=n.policyDefaultTtlHours,t[20]=d,t[21]=f,t[22]=p):p=t[22];let m=!r.enabled,h;t[23]===i?h=t[24]:(h=e=>i({maxTtlDays:e}),t[23]=i,t[24]=h);let g;t[25]!==r.maxTtlDays||t[26]!==n.policyMaxTtlDays||t[27]!==n.policyMaxTtlHint||t[28]!==m||t[29]!==h?(g=(0,Q.jsx)($,{id:`share-max-ttl-days`,label:n.policyMaxTtlDays,hint:n.policyMaxTtlHint,value:r.maxTtlDays,min:1,max:30,disabled:m,onChange:h}),t[25]=r.maxTtlDays,t[26]=n.policyMaxTtlDays,t[27]=n.policyMaxTtlHint,t[28]=m,t[29]=h,t[30]=g):g=t[30];let _=!r.enabled,v;t[31]===i?v=t[32]:(v=e=>i({maxActiveShares:e}),t[31]=i,t[32]=v);let y;t[33]!==r.maxActiveShares||t[34]!==n.policyMaxActiveShares||t[35]!==n.policyMaxActiveSharesHint||t[36]!==_||t[37]!==v?(y=(0,Q.jsx)($,{id:`share-max-active`,label:n.policyMaxActiveShares,hint:n.policyMaxActiveSharesHint,value:r.maxActiveShares,min:1,max:1e4,disabled:_,onChange:v}),t[33]=r.maxActiveShares,t[34]=n.policyMaxActiveShares,t[35]=n.policyMaxActiveSharesHint,t[36]=_,t[37]=v,t[38]=y):y=t[38];let b=!r.enabled,x;t[39]===i?x=t[40]:(x=e=>i({maxFileSizeMb:e}),t[39]=i,t[40]=x);let S;t[41]!==r.maxFileSizeMb||t[42]!==n.policyMaxFileSizeHint||t[43]!==n.policyMaxFileSizeMb||t[44]!==b||t[45]!==x?(S=(0,Q.jsx)($,{id:`share-max-file-mb`,label:n.policyMaxFileSizeMb,hint:n.policyMaxFileSizeHint,value:r.maxFileSizeMb,min:1,max:10240,disabled:b,onChange:x}),t[41]=r.maxFileSizeMb,t[42]=n.policyMaxFileSizeHint,t[43]=n.policyMaxFileSizeMb,t[44]=b,t[45]=x,t[46]=S):S=t[46];let ee=!r.enabled,C;t[47]===i?C=t[48]:(C=e=>i({directoryMaxFolderSizeMb:e}),t[47]=i,t[48]=C);let w;t[49]!==r.directoryMaxFolderSizeMb||t[50]!==n.policyDirectoryMaxFolderSizeHint||t[51]!==n.policyDirectoryMaxFolderSizeMb||t[52]!==ee||t[53]!==C?(w=(0,Q.jsx)($,{id:`share-directory-max-size-mb`,label:n.policyDirectoryMaxFolderSizeMb,hint:n.policyDirectoryMaxFolderSizeHint,value:r.directoryMaxFolderSizeMb,min:1,max:10240,disabled:ee,onChange:C}),t[49]=r.directoryMaxFolderSizeMb,t[50]=n.policyDirectoryMaxFolderSizeHint,t[51]=n.policyDirectoryMaxFolderSizeMb,t[52]=ee,t[53]=C,t[54]=w):w=t[54];let T=!r.enabled,E;t[55]===i?E=t[56]:(E=e=>i({directoryMaxFileCount:e}),t[55]=i,t[56]=E);let D;t[57]!==r.directoryMaxFileCount||t[58]!==n.policyDirectoryMaxFileCount||t[59]!==n.policyDirectoryMaxFileCountHint||t[60]!==T||t[61]!==E?(D=(0,Q.jsx)($,{id:`share-directory-max-files`,label:n.policyDirectoryMaxFileCount,hint:n.policyDirectoryMaxFileCountHint,value:r.directoryMaxFileCount,min:1,max:1e5,disabled:T,onChange:E}),t[57]=r.directoryMaxFileCount,t[58]=n.policyDirectoryMaxFileCount,t[59]=n.policyDirectoryMaxFileCountHint,t[60]=T,t[61]=E,t[62]=D):D=t[62];let O;t[63]!==g||t[64]!==y||t[65]!==S||t[66]!==w||t[67]!==D||t[68]!==p?(O=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[p,g,y,S,w,D]}),t[63]=g,t[64]=y,t[65]=S,t[66]=w,t[67]=D,t[68]=p,t[69]=O):O=t[69];let k=!r.enabled,A;t[70]===i?A=t[71]:(A=e=>i({inlinePreviewMimes:e}),t[70]=i,t[71]=A);let j;t[72]!==r.inlinePreviewMimes||t[73]!==n||t[74]!==k||t[75]!==A?(j=(0,Q.jsx)(xe,{t:n,values:r.inlinePreviewMimes,disabled:k,onChange:A}),t[72]=r.inlinePreviewMimes,t[73]=n,t[74]=k,t[75]=A,t[76]=j):j=t[76];let te;t[77]!==O||t[78]!==j||t[79]!==s||t[80]!==u?(te=(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-muted/25 p-4`,children:[s,u,O,j]}),t[77]=O,t[78]=j,t[79]=s,t[80]=u,t[81]=te):te=t[81];let M;t[82]===n.policySiteSection?M=t[83]:(M=(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.policySiteSection}),t[82]=n.policySiteSection,t[83]=M);let N;t[84]===n.policySiteSectionHint?N=t[85]:(N=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n.policySiteSectionHint}),t[84]=n.policySiteSectionHint,t[85]=N);let P;t[86]!==M||t[87]!==N?(P=(0,Q.jsxs)(`div`,{className:`mb-4`,children:[M,N]}),t[86]=M,t[87]=N,t[88]=P):P=t[88];let F;t[89]===i?F=t[90]:(F=e=>i({siteEnabled:e.target.checked}),t[89]=i,t[90]=F);let I;t[91]!==r.siteEnabled||t[92]!==F?(I=(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:r.siteEnabled,onChange:F}),t[91]=r.siteEnabled,t[92]=F,t[93]=I):I=t[93];let L;t[94]!==n.policySiteEnabled||t[95]!==I?(L=(0,Q.jsxs)(`label`,{className:`mb-4 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[I,n.policySiteEnabled]}),t[94]=n.policySiteEnabled,t[95]=I,t[96]=L):L=t[96];let ne=!r.siteEnabled,re;t[97]===i?re=t[98]:(re=e=>i({siteDefaultTtlHours:e}),t[97]=i,t[98]=re);let R;t[99]!==r.siteDefaultTtlHours||t[100]!==n.policySiteDefaultTtlHint||t[101]!==n.policySiteDefaultTtlHours||t[102]!==ne||t[103]!==re?(R=(0,Q.jsx)($,{id:`site-share-default-ttl-hours`,label:n.policySiteDefaultTtlHours,hint:n.policySiteDefaultTtlHint,value:r.siteDefaultTtlHours,min:1,max:168,disabled:ne,onChange:re}),t[99]=r.siteDefaultTtlHours,t[100]=n.policySiteDefaultTtlHint,t[101]=n.policySiteDefaultTtlHours,t[102]=ne,t[103]=re,t[104]=R):R=t[104];let ie=!r.siteEnabled,z;t[105]===i?z=t[106]:(z=e=>i({siteMaxTtlDays:e}),t[105]=i,t[106]=z);let ae;t[107]!==r.siteMaxTtlDays||t[108]!==n.policySiteMaxTtlDays||t[109]!==n.policySiteMaxTtlHint||t[110]!==ie||t[111]!==z?(ae=(0,Q.jsx)($,{id:`site-share-max-ttl-days`,label:n.policySiteMaxTtlDays,hint:n.policySiteMaxTtlHint,value:r.siteMaxTtlDays,min:1,max:30,disabled:ie,onChange:z}),t[107]=r.siteMaxTtlDays,t[108]=n.policySiteMaxTtlDays,t[109]=n.policySiteMaxTtlHint,t[110]=ie,t[111]=z,t[112]=ae):ae=t[112];let oe=!r.siteEnabled,B;t[113]===i?B=t[114]:(B=e=>i({maxActiveSites:e}),t[113]=i,t[114]=B);let V;t[115]!==r.maxActiveSites||t[116]!==n.policyMaxActiveSites||t[117]!==n.policyMaxActiveSitesHint||t[118]!==oe||t[119]!==B?(V=(0,Q.jsx)($,{id:`site-share-max-active`,label:n.policyMaxActiveSites,hint:n.policyMaxActiveSitesHint,value:r.maxActiveSites,min:1,max:1e3,disabled:oe,onChange:B}),t[115]=r.maxActiveSites,t[116]=n.policyMaxActiveSites,t[117]=n.policyMaxActiveSitesHint,t[118]=oe,t[119]=B,t[120]=V):V=t[120];let se=!r.siteEnabled,ce;t[121]===i?ce=t[122]:(ce=e=>i({siteMaxRootDirSizeMb:e}),t[121]=i,t[122]=ce);let H;t[123]!==r.siteMaxRootDirSizeMb||t[124]!==n.policySiteMaxRootDirSizeHint||t[125]!==n.policySiteMaxRootDirSizeMb||t[126]!==se||t[127]!==ce?(H=(0,Q.jsx)($,{id:`site-share-max-root-size-mb`,label:n.policySiteMaxRootDirSizeMb,hint:n.policySiteMaxRootDirSizeHint,value:r.siteMaxRootDirSizeMb,min:1,max:10240,disabled:se,onChange:ce}),t[123]=r.siteMaxRootDirSizeMb,t[124]=n.policySiteMaxRootDirSizeHint,t[125]=n.policySiteMaxRootDirSizeMb,t[126]=se,t[127]=ce,t[128]=H):H=t[128];let U=!r.siteEnabled,W;t[129]===i?W=t[130]:(W=e=>i({siteMaxFileCount:e}),t[129]=i,t[130]=W);let G;t[131]!==r.siteMaxFileCount||t[132]!==n.policySiteMaxFileCount||t[133]!==n.policySiteMaxFileCountHint||t[134]!==U||t[135]!==W?(G=(0,Q.jsx)($,{id:`site-share-max-files`,label:n.policySiteMaxFileCount,hint:n.policySiteMaxFileCountHint,value:r.siteMaxFileCount,min:1,max:1e5,disabled:U,onChange:W}),t[131]=r.siteMaxFileCount,t[132]=n.policySiteMaxFileCount,t[133]=n.policySiteMaxFileCountHint,t[134]=U,t[135]=W,t[136]=G):G=t[136];let K;t[137]!==R||t[138]!==ae||t[139]!==V||t[140]!==H||t[141]!==G?(K=(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[R,ae,V,H,G]}),t[137]=R,t[138]=ae,t[139]=V,t[140]=H,t[141]=G,t[142]=K):K=t[142];let q;t[143]!==P||t[144]!==L||t[145]!==K?(q=(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-muted/25 p-4`,children:[P,L,K]}),t[143]=P,t[144]=L,t[145]=K,t[146]=q):q=t[146];let le;return t[147]!==te||t[148]!==q?(le=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[te,q]}),t[147]=te,t[148]=q,t[149]=le):le=t[149],le}function $(e){let t=(0,ue.c)(21),{id:n,label:r,hint:i,value:a,min:s,max:c,disabled:l,onChange:u}=e,d;t[0]!==n||t[1]!==r?(d=(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=d):d=t[2];let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=o(ve(),`max-w-xs font-mono text-xs`),t[3]=f):f=t[3];let p;t[4]!==c||t[5]!==s||t[6]!==u?(p=e=>{let t=Number(e.target.value);Number.isFinite(t)&&u(Math.max(s,Math.min(c,Math.floor(t))))},t[4]=c,t[5]=s,t[6]=u,t[7]=p):p=t[7];let m;t[8]!==l||t[9]!==n||t[10]!==c||t[11]!==s||t[12]!==p||t[13]!==a?(m=(0,Q.jsx)(`input`,{id:n,type:`number`,min:s,max:c,disabled:l,className:f,value:a,onChange:p}),t[8]=l,t[9]=n,t[10]=c,t[11]=s,t[12]=p,t[13]=a,t[14]=m):m=t[14];let h;t[15]===i?h=t[16]:(h=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}),t[15]=i,t[16]=h);let g;return t[17]!==d||t[18]!==m||t[19]!==h?(g=(0,Q.jsxs)(`div`,{children:[d,m,h]}),t[17]=d,t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function xe(e){let t=(0,ue.c)(25),{t:n,values:r,disabled:i,onChange:a}=e,s;t[0]!==a||t[1]!==r?(s=e=>{let t=e.trim();!t||r.includes(t)||r.length>=32||a([...r,t])},t[0]=a,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]===n.policyInlinePreviewMimes?l=t[4]:(l=(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n.policyInlinePreviewMimes}),t[3]=n.policyInlinePreviewMimes,t[4]=l);let u;t[5]===n.policyInlinePreviewMimesHint?u=t[6]:(u=(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.policyInlinePreviewMimesHint}),t[5]=n.policyInlinePreviewMimesHint,t[6]=u);let d;t[7]!==i||t[8]!==a||t[9]!==r?(d=r.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge bg-surface-panel px-2 py-0.5 font-mono text-xs text-fg`,children:[e,i?null:(0,Q.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,"aria-label":`Remove ${e}`,onClick:()=>a(r.filter(t=>t!==e)),children:`×`})]},e)),t[7]=i,t[8]=a,t[9]=r,t[10]=d):d=t[10];let f;t[11]===d?f=t[12]:(f=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d}),t[11]=d,t[12]=f);let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=o(ve(),`font-mono text-xs`),t[13]=p):p=t[13];let m=i||r.length>=32,h;t[14]===c?h=t[15]:(h=e=>{e.key===`Enter`&&(e.preventDefault(),c(e.target.value),e.target.value=``)},t[14]=c,t[15]=h);let g;t[16]!==n.policyMimePlaceholder||t[17]!==m||t[18]!==h?(g=(0,Q.jsx)(`input`,{className:p,placeholder:n.policyMimePlaceholder,disabled:m,onKeyDown:h}),t[16]=n.policyMimePlaceholder,t[17]=m,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==l||t[21]!==u||t[22]!==f||t[23]!==g?(_=(0,Q.jsxs)(`div`,{className:`space-y-2 border-t border-edge pt-4`,children:[l,u,f,g]}),t[20]=l,t[21]=u,t[22]=f,t[23]=g,t[24]=_):_=t[24],_}function Se(e){let t=(0,ue.c)(70),{open:n,onOpenChange:r,onConfirm:i,initialPath:a,selectKind:s,sessionKey:d,agentId:f}=e,h=s===void 0?`any`:s,g=c(u(Te)),_=g.workspace,y=g.sharesSettings,w=T(we),{data:E}=p(l(Ce)?`picker-agents-list`:null,se),D;bb0:{let e;t[0]===f?e=t[1]:(e=f?.trim(),t[0]=f,t[1]=e);let n=e;if(n){D=n;break bb0}let r;t[2]===w?r=t[3]:(r=w.trim(),t[2]=w,t[3]=r);let i=r;if(i){D=i;break bb0}if(E?.defaultId){D=E.defaultId;break bb0}if(E?.agents?.[0]?.id){D=E.agents[0].id;break bb0}D=``}let A=D,[M,F]=(0,J.useState)(A),I,L;t[4]===A?(I=t[5],L=t[6]):(I=()=>{F(A)},L=[A],t[4]=A,t[5]=I,t[6]=L),(0,J.useEffect)(I,L);let{tree:re,loading:R,error:ie,loadRoot:z,loadChildren:ae,reset:oe}=P(M,d??null),B;t[7]===a?B=t[8]:(B=a?{path:a,isDirectory:!1}:null,t[7]=a,t[8]=B);let[V,U]=(0,J.useState)(B),W;t[9]!==a||t[10]!==z||t[11]!==n||t[12]!==oe||t[13]!==U?(W=()=>{if(!n){oe(),U(a?{path:a,isDirectory:!1}:null);return}z()},t[9]=a,t[10]=z,t[11]=n,t[12]=oe,t[13]=U,t[14]=W):W=t[14];let G;t[15]!==a||t[16]!==z||t[17]!==n||t[18]!==M||t[19]!==oe||t[20]!==d?(G=[n,M,d,z,oe,a],t[15]=a,t[16]=z,t[17]=n,t[18]=M,t[19]=oe,t[20]=d,t[21]=G):G=t[21],(0,J.useEffect)(W,G);let K;t[22]===ae?K=t[23]:(K=e=>{ae(e)},t[22]=ae,t[23]=K);let q=K,le=V!==null&&(h===`any`||h===`file`&&!V.isDirectory||h===`directory`&&V.isDirectory),Y;bb1:{if(!V){Y=y.pickerHintNone;break bb1}if(h===`file`&&V.isDirectory){Y=y.pickerHintNeedsFile;break bb1}if(h===`directory`&&!V.isDirectory){Y=y.pickerHintNeedsDirectory;break bb1}Y=`${V.isDirectory?`📁`:`📄`} ${V.path}`}let de=Y,fe=E?.agents??[],X;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(x,{className:`fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[24]=X):X=t[24];let Z;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Z=o(`fixed left-1/2 top-1/2 z-[71] w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2`,`flex h-[min(28rem,calc(100vh-3rem))] flex-col overflow-hidden rounded-lg border border-edge bg-surface-panel shadow-popover outline-none`),t[25]=Z):Z=t[25];let pe;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(ce,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),t[26]=pe):pe=t[26];let me=g.cron.refresh,he=g.cron.refresh,ge;t[27]===z?ge=t[28]:(ge=()=>void z(),t[27]=z,t[28]=ge);let _e=R&&`animate-spin`,ve;t[29]===_e?ve=t[30]:(ve=o(`size-4`,_e),t[29]=_e,t[30]=ve);let ye;t[31]===ve?ye=t[32]:(ye=(0,Q.jsx)(te,{className:ve,"aria-hidden":!0}),t[31]=ve,t[32]=ye);let be;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Q.jsx)(j,{className:`size-4`}),t[33]=be):be=t[33];let $;t[34]!==ie||t[35]!==_.loadError?($=ie?(0,Q.jsxs)(`p`,{className:`shrink-0 px-4 py-2 text-xs text-red-600 dark:text-red-400`,children:[_.loadError,`: `,ie]}):null,t[34]=ie,t[35]=_.loadError,t[36]=$):$=t[36];let xe;t[37]!==q||t[38]!==R||t[39]!==V?.path||t[40]!==U||t[41]!==_.emptyDir||t[42]!==_.title||t[43]!==re?(xe=R&&re.length===0?(0,Q.jsxs)(`p`,{className:`flex shrink-0 items-center gap-2 px-4 py-3 text-sm text-fg-muted`,children:[(0,Q.jsx)(H,{className:`size-4 animate-spin`}),_.title,`…`]}):(0,Q.jsx)(b,{tree:re,selectedPath:V?.path??null,onSelectFile:e=>U({path:e,isDirectory:!1}),onSelectEntry:(e,t)=>U({path:e,isDirectory:t}),onExpandDir:q,onAction:void 0,emptyHint:_.emptyDir}),t[37]=q,t[38]=R,t[39]=V?.path,t[40]=U,t[41]=_.emptyDir,t[42]=_.title,t[43]=re,t[44]=xe):xe=t[44];let Se;t[45]!==$||t[46]!==xe?(Se=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[$,xe]}),t[45]=$,t[46]=xe,t[47]=Se):Se=t[47];let Ee;t[48]===de?Ee=t[49]:(Ee=(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:de}),t[48]=de,t[49]=Ee);let De;t[50]===r?De=t[51]:(De=()=>r(!1),t[50]=r,t[51]=De);let Oe;t[52]!==y.cancel||t[53]!==De?(Oe=(0,Q.jsx)(k,{type:`button`,variant:`ghost`,onClick:De,children:y.cancel}),t[52]=y.cancel,t[53]=De,t[54]=Oe):Oe=t[54];let ke=!le,Ae;t[55]!==i||t[56]!==r||t[57]!==M||t[58]!==V?(Ae=()=>{V&&(i({...V,agentId:M}),r(!1))},t[55]=i,t[56]=r,t[57]=M,t[58]=V,t[59]=Ae):Ae=t[59];let je;t[60]!==y.pickerConfirm||t[61]!==ke||t[62]!==Ae?(je=(0,Q.jsx)(k,{type:`button`,disabled:ke,onClick:Ae,children:y.pickerConfirm}),t[60]=y.pickerConfirm,t[61]=ke,t[62]=Ae,t[63]=je):je=t[63];let Me;t[64]!==Oe||t[65]!==je?(Me=(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[Oe,je]}),t[64]=Oe,t[65]=je,t[66]=Me):Me=t[66];let Ne;return t[67]!==Ee||t[68]!==Me?(Ne=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-4 py-3`,children:[Ee,Me]}),t[67]=Ee,t[68]=Me,t[69]=Ne):Ne=t[69],(0,Q.jsx)(ee,{open:n,onOpenChange:r,children:(0,Q.jsxs)(S,{children:[X,(0,Q.jsxs)(m,{className:Z,children:[(0,Q.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-edge px-4`,children:[pe,(0,Q.jsx)(C,{className:`min-w-0 flex-1 truncate text-base font-semibold text-fg`,children:y.pickerTitle}),(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50`,title:me,"aria-label":he,disabled:R,onClick:ge,children:ye}),(0,Q.jsx)(ne,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":_.close,children:be})})]}),fe.length>0?(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-edge px-4 py-2`,children:[(0,Q.jsx)(`label`,{className:`text-xs text-fg-muted`,htmlFor:`picker-agent-select`,children:y.pickerAgentLabel}),(0,Q.jsx)(O,{id:`picker-agent-select`,className:`min-w-0 flex-1 rounded-md border border-edge bg-surface-panel px-2 py-1 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:M,onChange:e=>{F(e.target.value),U(null)},children:fe.map(e=>(0,Q.jsxs)(v,{value:e.id,children:[N(e,g.agentsSettings),e.id===E?.defaultId?` ★`:``]},e.id))})]}):null,Se,Ne]})]})})}function Ce(e){return e.token}function we(e){return e.agentId}function Te(e){return e.language}var Ee=[`shares`,`policy`];function De(e){let t=(e??``).trim();return Ee.includes(t)?t:`shares`}function Oe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function ke(e,t){let n=new Date(e).getTime()-Date.now(),r=Math.abs(n),i=n<0;if(r<6e4)return t===`zh`?`刚刚`:`just now`;let a=Math.floor(r/6e4);if(a<60){let e=t===`zh`?`${a} 分钟`:`${a}m`;return i?t===`zh`?`${e}前`:`${e} ago`:e}let o=Math.floor(a/60);if(o<24){let e=t===`zh`?`${o} 小时`:`${o}h`;return i?t===`zh`?`${e}前`:`${e} ago`:e}let s=Math.floor(o/24),c=t===`zh`?`${s} 天`:`${s}d`;return i?t===`zh`?`${c}前`:`${c} ago`:c}var Ae=[{value:36e5,key:`1h`},{value:216e5,key:`6h`},{value:864e5,key:`24h`},{value:2592e5,key:`3d`},{value:6048e5,key:`7d`},{value:2592e6,key:`30d`}];function je(){let e=(0,ue.c)(24),t=u(Ne),n=c(t).sharesSettings,r=!!l(Me),[a,o]=i(),s;e[0]===a?s=e[1]:(s=De(a.get(`tab`)),e[0]=a,e[1]=s);let d=s,f;e[2]===o?f=e[3]:(f=e=>{o(t=>{let n=new URLSearchParams(t);return e===`shares`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},e[2]=o,e[3]=f);let p=f;if(!r)return(0,Q.jsx)(W,{gap:`gap-3`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.needToken})});let m={shares:n.tabShares,policy:n.tabPolicy},h=Ee.map(e=>({id:e,label:m[e]})),g;e[4]!==n.subtitle||e[5]!==n.title?(g=(0,Q.jsx)(U,{title:n.title,subtitle:n.subtitle}),e[4]=n.subtitle,e[5]=n.title,e[6]=g):g=e[6];let _;e[7]!==d||e[8]!==p||e[9]!==n.tabsAria||e[10]!==h?(_=(0,Q.jsx)(le,{items:h,activeTab:d,onChange:p,ariaLabel:n.tabsAria,tabIdPrefix:`shares-tab`,panelIdPrefix:`shares-panel`}),e[7]=d,e[8]=p,e[9]=n.tabsAria,e[10]=h,e[11]=_):_=e[11];let v;e[12]!==d||e[13]!==r||e[14]!==t||e[15]!==n?(v=d===`shares`?(0,Q.jsx)(Pe,{t:n,language:t}):(0,Q.jsx)(ye,{hasToken:r}),e[12]=d,e[13]=r,e[14]=t,e[15]=n,e[16]=v):v=e[16];let y;e[17]!==d||e[18]!==v?(y=(0,Q.jsx)(G,{id:d,activeTab:d,tabIdPrefix:`shares-tab`,panelIdPrefix:`shares-panel`,showHeading:!1,children:v}),e[17]=d,e[18]=v,e[19]=y):y=e[19];let b;return e[20]!==g||e[21]!==_||e[22]!==y?(b=(0,Q.jsxs)(W,{children:[g,_,y]}),e[20]=g,e[21]=_,e[22]=y,e[23]=b):b=e[23],b}function Me(e){return e.token}function Ne(e){return e.language}function Pe(e){let t=(0,ue.c)(60),{t:n,language:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={refreshInterval:3e4},t[0]=i):i=t[0];let{data:a,error:s,isLoading:c,mutate:l}=p(`shares-list`,L,i),u;t[1]===a?.payload?.shares?u=t[2]:(u=a?.payload?.shares??[],t[1]=a?.payload?.shares,t[2]=u);let d=u,[f,m]=(0,J.useState)(!1),h;bb0:{if(f){h=d;break bb0}let e;t[3]===d?e=t[4]:(e=d.filter(ze),t[3]=d,t[4]=e),h=e}let g=h,_;t[5]===d?_=t[6]:(_=d.filter(Re),t[5]=d,t[6]=_);let v=_.length,y;t[7]===d?y=t[8]:(y=d.filter(Le),t[7]=d,t[8]=y);let b=y.length,x;t[9]===l?x=t[10]:(x=()=>void l(),t[9]=l,t[10]=x);let S;t[11]!==n||t[12]!==x?(S=(0,Q.jsx)(Ve,{t:n,onCreated:x}),t[11]=n,t[12]=x,t[13]=S):S=t[13];let ee=f?n.allSharesTitle:n.listTitle,C;t[14]===v?C=t[15]:(C=v>0&&(0,Q.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:[`(`,v,`)`]}),t[14]=v,t[15]=C);let w;t[16]!==ee||t[17]!==C?(w=(0,Q.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[ee,C]}),t[16]=ee,t[17]=C,t[18]=w):w=t[18];let T;t[19]===l?T=t[20]:(T=()=>void l(),t[19]=l,t[20]=T);let E=c&&`animate-spin`,D;t[21]===E?D=t[22]:(D=o(`size-3.5`,E),t[21]=E,t[22]=D);let O;t[23]===D?O=t[24]:(O=(0,Q.jsx)(te,{className:D}),t[23]=D,t[24]=O);let A;t[25]!==c||t[26]!==T||t[27]!==O?(A=(0,Q.jsx)(k,{type:`button`,variant:`ghost`,className:`px-2 py-1`,onClick:T,disabled:c,children:O}),t[25]=c,t[26]=T,t[27]=O,t[28]=A):A=t[28];let j;t[29]!==b||t[30]!==f||t[31]!==n.hideExpired||t[32]!==n.showExpired?(j=b>0&&(0,Q.jsx)(`button`,{type:`button`,className:`text-xs text-accent hover:underline`,onClick:()=>m(Ie),children:f?n.hideExpired:n.showExpired}),t[29]=b,t[30]=f,t[31]=n.hideExpired,t[32]=n.showExpired,t[33]=j):j=t[33];let M;t[34]!==A||t[35]!==j?(M=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,j]}),t[34]=A,t[35]=j,t[36]=M):M=t[36];let N;t[37]!==w||t[38]!==M?(N=(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[w,M]}),t[37]=w,t[38]=M,t[39]=N):N=t[39];let P;t[40]!==a||t[41]!==s||t[42]!==g||t[43]!==c||t[44]!==r||t[45]!==l||t[46]!==n?(P=c&&!a?(0,Q.jsx)(`div`,{className:`grid gap-2`,"aria-busy":`true`,children:Array.from({length:4}).map(Fe)}):s?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-red-600 dark:text-red-400`,children:[(0,Q.jsx)(`span`,{children:n.error}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>void l(),children:n.retry})]}):g.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.emptyState}):(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:g.map(e=>(0,Q.jsx)(Ue,{share:e,t:n,language:r,onRevoked:()=>void l(),onExtended:()=>void l()},e.id))}),t[40]=a,t[41]=s,t[42]=g,t[43]=c,t[44]=r,t[45]=l,t[46]=n,t[47]=P):P=t[47];let F;t[48]!==b||t[49]!==l||t[50]!==f||t[51]!==n?(F=b>0&&f&&(0,Q.jsx)(We,{t:n,onCleaned:()=>void l()}),t[48]=b,t[49]=l,t[50]=f,t[51]=n,t[52]=F):F=t[52];let I;t[53]!==N||t[54]!==P||t[55]!==F?(I=(0,Q.jsxs)(q,{children:[N,P,F]}),t[53]=N,t[54]=P,t[55]=F,t[56]=I):I=t[56];let ne;return t[57]!==I||t[58]!==S?(ne=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[S,I]}),t[57]=I,t[58]=S,t[59]=ne):ne=t[59],ne}function Fe(e,t){return(0,Q.jsx)(`div`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(g,{className:`h-4 w-2/3`}),(0,Q.jsx)(g,{className:`mt-2 h-3 w-1/2`})]}),(0,Q.jsx)(g,{className:`h-7 w-20 rounded-md`})]})},t)}function Ie(e){return!e}function Le(e){return e.expired||e.revoked}function Re(e){return!e.expired&&!e.revoked}function ze(e){return!e.expired&&!e.revoked}var Be={expanded:!0,path:``,isDirectory:!1,agentId:``,ttlMs:864e5,maxViews:null,description:``,directoryMode:`browse`,creating:!1,result:null,errorMsg:null,resultDialogOpen:!1,pickerOpen:!1};function Ve({t:e,onCreated:t}){let[n,r]=(0,J.useReducer)(h,Be),{expanded:i,path:a,isDirectory:s,agentId:c,ttlMs:l,maxViews:u,description:d,directoryMode:f,creating:p,result:m,errorMsg:g,resultDialogOpen:_,pickerOpen:y}=n,b=(0,J.useCallback)(async()=>{if(a.trim()){r({type:`patch`,patch:{creating:!0,errorMsg:null,result:null}});try{r({type:`patch`,patch:{result:(await R({path:a.trim(),ttlMs:l,maxViews:u,description:d.trim()||void 0,...c?{agentId:c}:{},...s?{kind:`directory`,directoryMode:f}:{}})).payload,resultDialogOpen:!0}}),t()}catch(e){r({type:`patch`,patch:{errorMsg:e instanceof Error?e.message:String(e)}})}finally{r({type:`patch`,patch:{creating:!1}})}}},[a,s,c,l,u,d,f,t]),x=(0,J.useCallback)(()=>{r({type:`patch`,patch:{path:``,isDirectory:!1,agentId:``,description:``,maxViews:null,ttlMs:864e5,directoryMode:`browse`,result:null,errorMsg:null}})},[]);return i?(0,Q.jsxs)(q,{children:[(0,Q.jsx)(`h2`,{className:`mb-1 text-sm font-semibold text-fg`,children:e.createTitle}),(0,Q.jsx)(`p`,{className:`mb-4 text-xs text-fg-muted`,children:e.createHint}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.pathLabel}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:o(`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm`,a?`text-fg`:`text-fg-subtle`),children:a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,children:s?`📁`:`📄`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:a,children:a})]}):(0,Q.jsx)(`span`,{className:`truncate`,children:e.pathPlaceholder})}),(0,Q.jsxs)(k,{type:`button`,variant:`ghost`,onClick:()=>r({type:`patch`,patch:{pickerOpen:!0}}),children:[(0,Q.jsx)(E,{className:`size-4`}),a?e.pathBrowseChange:e.pathBrowse]})]})]}),s?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.directoryModeLabel}),(0,Q.jsxs)(O,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:f,onChange:e=>r({type:`patch`,patch:{directoryMode:e.target.value===`zip-only`?`zip-only`:`browse`}}),children:[(0,Q.jsx)(v,{value:`browse`,children:e.directoryModeBrowse}),(0,Q.jsx)(v,{value:`zip-only`,children:e.directoryModeZipOnly})]})]}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.ttlLabel}),(0,Q.jsx)(O,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:l,onChange:e=>r({type:`patch`,patch:{ttlMs:Number(e.target.value)}}),children:Ae.map(t=>(0,Q.jsx)(v,{value:t.value,children:e.ttlOptions[t.key]},t.key))})]}),(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.maxViewsLabel}),(0,Q.jsxs)(O,{className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:outline-none focus:ring-2 focus:ring-accent`,value:u??`unlimited`,onChange:e=>r({type:`patch`,patch:{maxViews:e.target.value===`unlimited`?null:Number(e.target.value)}}),children:[(0,Q.jsx)(v,{value:`unlimited`,children:e.maxViewsUnlimited}),(0,Q.jsx)(v,{value:`1`,children:`1`}),(0,Q.jsx)(v,{value:`5`,children:`5`}),(0,Q.jsx)(v,{value:`10`,children:`10`}),(0,Q.jsx)(v,{value:`50`,children:`50`}),(0,Q.jsx)(v,{value:`100`,children:`100`})]})]})]}),(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:e.descriptionLabel}),(0,Q.jsx)(`input`,{type:`text`,className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:ring-2 focus:ring-accent`,placeholder:e.descriptionPlaceholder,value:d,onChange:e=>r({type:`patch`,patch:{description:e.target.value}})})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,Q.jsxs)(k,{type:`button`,disabled:p||!a.trim(),onClick:()=>void b(),children:[p?(0,Q.jsx)(H,{className:`size-4 animate-spin`}):(0,Q.jsx)(I,{className:`size-4`}),p?e.creating:e.createButton]}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,onClick:()=>{x(),r({type:`patch`,patch:{expanded:!1}})},children:e.cancel})]}),g&&(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:g})]}),(0,Q.jsx)(B,{open:_,onOpenChange:e=>{r({type:`patch`,patch:{resultDialogOpen:e,...e?{}:{result:null}}})},result:m}),(0,Q.jsx)(Se,{open:y,onOpenChange:e=>r({type:`patch`,patch:{pickerOpen:e}}),initialPath:a||void 0,selectKind:`any`,onConfirm:e=>r({type:`patch`,patch:{path:e.path,isDirectory:e.isDirectory,agentId:e.agentId,directoryMode:`browse`}})})]}):(0,Q.jsxs)(k,{type:`button`,onClick:()=>r({type:`patch`,patch:{expanded:!0}}),className:`self-start`,children:[(0,Q.jsx)(I,{className:`size-4`}),e.createTitle]})}var He={revokeOpen:!1,revoking:!1,linksOpen:!1,urlCopied:!1,copyFailed:!1,extending:!1};function Ue({share:e,t,language:n,onRevoked:r,onExtended:i}){let[c,l]=(0,J.useReducer)(h,He),{revokeOpen:u,revoking:d,linksOpen:f,urlCopied:p,copyFailed:m,extending:g}=c,v=!e.expired&&!e.revoked,b=e.revoked?t.statusRevoked:e.expired?t.statusExpired:t.statusActive,x=e.revoked?`text-red-600 dark:text-red-400`:e.expired?`text-fg-subtle`:`text-emerald-600 dark:text-emerald-400`,S=(0,J.useCallback)(async()=>{l({type:`patch`,patch:{revokeOpen:!1,revoking:!0}});try{await A(e.id),r()}catch{}finally{l({type:`patch`,patch:{revoking:!1}})}},[e.id,r]),ee=(0,J.useCallback)(async()=>{if(l({type:`patch`,patch:{linksOpen:!0,copyFailed:!1}}),!await s(e.shareUrl)){l({type:`patch`,patch:{copyFailed:!0}}),window.setTimeout(()=>l({type:`patch`,patch:{copyFailed:!1}}),2500);return}l({type:`patch`,patch:{urlCopied:!0}}),window.setTimeout(()=>l({type:`patch`,patch:{urlCopied:!1}}),2e3)},[e.shareUrl]),C=(0,J.useCallback)(async()=>{l({type:`patch`,patch:{extending:!0}});try{await oe(e.id,864e5),i()}catch{}finally{l({type:`patch`,patch:{extending:!1}})}},[e.id,i]),T=`share-links-${e.id}`;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2.5 shadow-surface`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:o(`flex min-w-0 flex-1 items-start gap-3 rounded-md text-left`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),"aria-expanded":f,"aria-controls":T,onClick:()=>l({type:`patch`,patch:{linksOpen:!f}}),children:[(0,Q.jsx)(z,{className:o(`mt-0.5 size-4 shrink-0 text-fg-muted transition-transform`,f?`rotate-0`:`-rotate-90`),"aria-hidden":!0}),(0,Q.jsx)(E,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:o(`text-xs font-medium`,x),children:b})]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.workspaceRelativePath}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:Oe(e.fileSize)}),(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(D,{className:`size-3`}),e.expired?n===`zh`?`已过期`:`expired`:ke(e.expiresAt,n)]}),(0,Q.jsxs)(`span`,{children:[t.views,`: `,e.downloadCount,e.maxViews!==null&&` ${t.viewsOf} ${e.maxViews}`]}),e.description&&(0,Q.jsx)(`span`,{className:`italic text-fg-subtle`,children:e.description})]})]})]}),(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(k,{type:`button`,variant:`ghost`,className:`px-2 py-1`,title:t.copyUrl,onClick:()=>void ee(),children:p?(0,Q.jsx)(a,{className:`size-3.5 text-emerald-500`}):(0,Q.jsx)(y,{className:`size-3.5`})}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,className:`px-2 py-1`,onClick:()=>void C(),disabled:g,title:t.extend,children:g?(0,Q.jsx)(H,{className:`size-3.5 animate-spin`}):(0,Q.jsx)(D,{className:`size-3.5`})}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,className:`px-2 py-1 text-red-600 hover:text-red-700 dark:text-red-400`,onClick:()=>l({type:`patch`,patch:{revokeOpen:!0}}),disabled:d,children:d?(0,Q.jsx)(H,{className:`size-3.5 animate-spin`}):(0,Q.jsx)(w,{className:`size-3.5`})})]})})]}),v&&f?(0,Q.jsxs)(`div`,{id:T,className:`mt-3 bg-surface-base/45 py-3 pl-7 pr-3`,children:[(0,Q.jsx)(M,{shareUrl:e.shareUrl,lanUrl:e.lanUrl,reachability:e.reachability,compact:!0}),m?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:t.copyFailed}):null,(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ie,{reachability:e.reachability})})]}):null]}),(0,Q.jsx)(_,{open:u,title:t.revokeConfirmTitle,description:t.revokeConfirmBody,confirmLabel:t.revokeConfirmLabel,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void S(),onCancel:()=>l({type:`patch`,patch:{revokeOpen:!1}})})]})}function We({t:e,onCleaned:t}){let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1),o=(0,J.useCallback)(async()=>{r(!1),a(!0);try{await V(),t()}catch{}finally{a(!1)}},[t]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(k,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>r(!0),className:`border-danger/40 px-2 py-1 text-xs text-danger hover:bg-danger/10`,children:[i?(0,Q.jsx)(H,{className:`size-3.5 animate-spin`}):(0,Q.jsx)(w,{className:`size-3.5`}),e.cleanExpired]})}),(0,Q.jsx)(_,{open:n,title:e.cleanExpiredConfirmTitle,description:e.cleanExpiredConfirmBody,confirmLabel:e.cleanExpiredConfirmLabel,cancelLabel:e.cancel,destructive:!0,onConfirm:()=>void o(),onCancel:()=>r(!1)})]})}export{je as SharesSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,r as n}from"./locale-store-Bjvw7jtg.js";import{Dr as r}from"./index-Cb9y6tVR.js";var i=e({reloadSkills:()=>a});async function a(){let e=await t(n(`/api/skills/reload`),{method:`POST`});if(!e.ok)throw Error(await r(e))}export{i as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,t as o}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{l as s,n as c}from"./locale-store-Bjvw7jtg.js";import{Al as l,Ao as u,Cc as d,Cl as f,Ct as p,Da as m,Jl as h,Jr as g,Kr as _,La as v,Mo as y,No as b,Oo as x,Po as S,Sn as C,Su as w,Tt as ee,Yr as te,Zr as ne,_c as T,_s as E,bi as re,bl as ie,bs as D,fu as ae,ht as oe,jl as se,jo as O,ko as k,pt as ce,ql as A,qr as le,rt as j,su as ue,tu as M,ua as de,xc as fe,xi as pe,yt as me}from"./index-Cb9y6tVR.js";import{t as he}from"./dependency-picker-3vjdusik.js";var N=n(),P=e(t(),1),F=r();function I(e,t){return(t===`zh`?{backlog:`收集箱`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`})[e]}function ge(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,F.jsx)(m,{className:`h-32 rounded-2xl`}),(0,F.jsx)(m,{className:`h-52 rounded-2xl`}),(0,F.jsx)(m,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function L(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`paused`:e.operationalState}function R(e){let t=(0,N.c)(9),{items:n,empty:r,verificationByCriterion:i}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,F.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=i?.get(e)??`unverified`;return(0,F.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,F.jsx)(t===`passed`?M:t===`failed`?h:A,{className:t===`passed`?`mt-1 size-4 shrink-0 text-success`:t===`failed`?`mt-1 size-4 shrink-0 text-danger`:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,F.jsx)(`span`,{children:e})]},e)},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,F.jsx)(`ul`,{className:`space-y-2`,children:a}),t[7]=a,t[8]=o),o}function z({taskId:e,presentation:t,backgroundPath:n}){let[r]=a(),i=c(e=>e.language),u=s(e=>e.token),m=(0,P.useMemo)(()=>ce(i),[i]),h=v(e=>e.setPageHeader),y=v(e=>e.clearPageHeader),[b,x]=(0,P.useState)(null),[S,D]=(0,P.useState)(null),[O,k]=(0,P.useState)(!1),[A,N]=(0,P.useState)([]),[z,B]=(0,P.useState)(null),[V,H]=(0,P.useState)(!1),[U,W]=(0,P.useState)([]),G=(0,P.useMemo)(()=>re(r.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[r]);(0,P.useEffect)(()=>{let t=!0;return x(null),D(null),me(e).then(e=>{t&&x(e)}).catch(()=>{t&&D(m.taskNotFound)}),()=>{t=!1}},[m.taskNotFound,e,u]),(0,P.useEffect)(()=>{let t=b?.task.projectId,n=b?.dependencies??[];if(!t){B(null),N(n);return}B(null);let r=!0;return de(t).then(t=>{if(!r)return;B(t.project.name);let i=new Map;for(let r of[...t.tasks,...n])r.id!==e&&i.set(r.id,{id:r.id,title:r.title});N([...i.values()])}).catch(()=>{r&&(B(null),N(n))}),()=>{r=!1}},[b?.dependencies,b?.task.projectId,e]);let K=async t=>{if(b){k(!0),D(null);try{x(await oe(e,t,b.task.version))}catch{D(m.actionFailed)}finally{k(!1)}}},_e=async()=>{if(b){k(!0),D(null);try{x(await ee(e,U,b.task.version)),H(!1)}catch{D(m.dependencyUpdateFailed)}finally{k(!1)}}};if((0,P.useLayoutEffect)(()=>{if(t!==`modal`)return h({startExtra:(0,F.jsx)(o,{to:G,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":m.backToWork,children:(0,F.jsx)(w,{className:`size-4`})}),main:b?(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:z?`${z} / ${m.taskLabel}`:m.taskLabel}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:m.detailStatuses[L(b)]})]}):null,end:null}),y},[y,m.backToWork,m.detailStatuses,m.taskLabel,b,t,z,G,h]),S&&!b)return(0,F.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:S});if(!b)return(0,F.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,F.jsx)(ge,{})});let q=b.waits[0],J=q?.kind===`paused`?q:void 0,Y=b.receipts[0],ve=m.detailStatuses[L(b)],ye=m.detailStatusDescriptions[L(b)],X=b.task.body?.trim()||b.task.contract?.objective.trim(),be=b.task.delegateAgentId??b.task.ownerId,Z=new Map(Y?.verification.checks.map(e=>[e.criterion,e.status])),xe=b.allowedCommands.includes(`mark_ready`),Se=b.allowedCommands.includes(`start`),Ce=b.allowedCommands.includes(`add_wait`),we=b.task.phase===`review`&&b.allowedCommands.includes(`close`),Te=b.allowedCommands.includes(`reopen`),Ee=b.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`),Q=b.task.contract?.acceptanceCriteria??[],De=Q.filter(e=>Z.get(e)===`passed`).length,$=b.task.contract?.expectedOutputs??[],Oe=b.task.contract?.constraints??[],ke=b.task.contract?.approvalRequired??[],Ae=b.task.contract?.assumptions??[],je=b.task.contract?.risks??[],Me=e=>t===`modal`&&n?C(n,e):pe(`/tasks/${e}`,G);return(0,F.jsxs)(`div`,{className:t===`modal`?`space-y-4 p-5`:`mx-auto max-w-4xl space-y-4 p-4 pb-16 sm:p-6`,children:[(0,F.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`inline-flex rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:ve}),(0,F.jsx)(`h1`,{className:`mt-3 text-xl font-semibold leading-7 text-fg`,children:b.task.title}),X&&X!==b.task.title?(0,F.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm leading-6 text-fg-muted`,children:X}):null,(0,F.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[z?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0}),z]}):null,(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),m.priorityLabels[b.task.priority]]}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),be??m.unassigned]}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(ue,{className:`size-3.5`,"aria-hidden":!0}),b.task.dueAt?j(b.task.dueAt,i):m.noDueDate]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[xe?(0,F.jsxs)(E,{disabled:O,onClick:()=>void K({type:`mark_ready`}),children:[(0,F.jsx)(T,{className:`size-4`}),m.scheduleTask]}):null,J?(0,F.jsxs)(E,{disabled:O,onClick:()=>void K({type:`resolve_wait`,waitId:J.id}),children:[(0,F.jsx)(T,{className:`size-4`}),m.resumeTask]}):null,!q&&Se?(0,F.jsxs)(E,{disabled:O,onClick:()=>void K({type:`start`,executor:{kind:`agent`,agentId:b.task.delegateAgentId??`main`}}),children:[(0,F.jsx)(T,{className:`size-4`}),m.runTask]}):null,we?(0,F.jsxs)(E,{disabled:O,onClick:()=>void K({type:`close`,resolution:`done`}),children:[(0,F.jsx)(M,{className:`size-4`}),m.approveTask]}):null,Te?(0,F.jsxs)(E,{disabled:O,onClick:()=>void K({type:`reopen`,phase:`ready`}),children:[(0,F.jsx)(T,{className:`size-4`}),m.reopenTask]}):null,!q&&Ce?(0,F.jsxs)(E,{variant:`secondary`,disabled:O,onClick:()=>void K({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,F.jsx)(d,{className:`size-4`}),m.pauseTask]}):null,b.task.phase===`closed`?null:(0,F.jsxs)(te,{children:[(0,F.jsx)(ne,{asChild:!0,children:(0,F.jsx)(E,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:O,"aria-label":m.moreActions,children:(0,F.jsx)(se,{className:`size-4`,"aria-hidden":!0})})}),(0,F.jsx)(g,{children:(0,F.jsx)(_,{align:`end`,sideOffset:6,className:`z-[100] min-w-40 rounded-lg border border-edge bg-surface-panel p-1 shadow-lg`,children:(0,F.jsx)(le,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void K({type:`close`,resolution:`cancelled`}),children:m.cancelTask})})})]})]})]}),S?(0,F.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:S}):null]}),(0,F.jsxs)(`section`,{className:`rounded-2xl border border-accent/20 bg-accent-soft/40 p-5`,children:[(0,F.jsx)(`h2`,{className:`font-medium text-fg`,children:m.statusSummary}),(0,F.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:ye}),(0,F.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:m.updatedAt.replace(`{{date}}`,j(b.task.updatedAt,i))})]}),b.attention.length>0?(0,F.jsxs)(`section`,{className:`rounded-2xl border border-warning/40 bg-warning/5 p-5`,children:[(0,F.jsx)(`h3`,{className:`font-medium text-fg`,children:Ee?m.needsAttention:m.waitingStatus}),(0,F.jsx)(`ul`,{className:`mt-3 space-y-2 text-sm text-fg-muted`,children:b.attention.map((e,t)=>(0,F.jsx)(`li`,{children:e.summary},`${e.kind}-${t}`))})]}):null,Y?(0,F.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`font-medium text-fg`,children:m.latestResult}),(0,F.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg`,children:Y.summary})]}),(0,F.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:[m.receiptStatuses[Y.status],` · `,m.verificationStatuses[Y.verification.status]]})]}),Y.remainingWork.length>0?(0,F.jsxs)(`div`,{className:`mt-4`,children:[(0,F.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:m.remainingWork}),(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(R,{items:Y.remainingWork,empty:m.noRemainingWork})})]}):null,Y.nextAction?(0,F.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3`,children:[(0,F.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:m.nextAction}),(0,F.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:Y.nextAction})]}):null,(0,F.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(E,{className:`px-2 py-1 text-xs`,variant:`secondary`,onClick:()=>void p(Y.runId,`helpful`),children:m.doneWell}),(0,F.jsx)(E,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void p(Y.runId,`not_helpful`),children:m.needsFix}),Y.evidence.filter(e=>e.uri).map(e=>(0,F.jsxs)(`a`,{className:`ml-auto inline-flex items-center gap-1 text-xs text-accent hover:underline`,href:e.uri,children:[(0,F.jsx)(l,{className:`size-3`}),e.title]},`${e.title}-${e.uri}`))]}),b.receipts.length>1?(0,F.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:m.executionHistory.replace(`{{count}}`,String(b.receipts.length-1))}),(0,F.jsx)(`div`,{className:`mt-3 space-y-3`,children:b.receipts.slice(1).map(e=>(0,F.jsx)(`article`,{className:`rounded-lg bg-surface-hover p-3`,children:(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsx)(`p`,{className:`text-sm text-fg`,children:e.summary}),(0,F.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:m.receiptStatuses[e.status]})]})},e.runId))})]}):null]}):null,(0,F.jsxs)(`div`,{className:`grid items-start gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(16rem,1fr)]`,children:[(0,F.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,F.jsx)(`h2`,{className:`font-medium text-fg`,children:m.taskDefinition}),(0,F.jsxs)(`div`,{className:`mt-5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:m.successDefinition}),Q.length>0?(0,F.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:m.criteriaProgress.replace(`{{verified}}`,String(De)).replace(`{{total}}`,String(Q.length))}):null]}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(R,{items:Q,empty:m.noDefinition,verificationByCriterion:Z})})]}),$.length>0?(0,F.jsxs)(`div`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:m.expectedOutputs}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(R,{items:$,empty:m.noDefinition})})]}):null,Oe.length>0?(0,F.jsxs)(`details`,{className:`mt-5 border-t border-edge pt-4`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:m.constraints}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(R,{items:Oe,empty:m.noDefinition})})]}):null,ke.length>0?(0,F.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:m.approvalRequired}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(R,{items:ke,empty:m.noDefinition})})]}):null,Ae.length>0?(0,F.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:m.contextAssumptions}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(R,{items:Ae,empty:m.noDefinition})})]}):null,je.length>0?(0,F.jsxs)(`details`,{className:`mt-4 border-t border-edge pt-4`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:m.contextRisks}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(R,{items:je,empty:m.noDefinition})})]}):null]}),(0,F.jsxs)(`div`,{className:`grid min-w-0 gap-4`,children:[(0,F.jsxs)(`section`,{className:`min-w-0 rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`h2`,{className:`font-medium text-fg`,children:m.taskRelations}),V?null:(0,F.jsxs)(E,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs`,onClick:()=>{W(b.dependencies.map(e=>e.id)),H(!0)},children:[(0,F.jsx)(fe,{className:`size-3.5`,"aria-hidden":!0}),m.editDependencies]})]}),V?(0,F.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,F.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:m.dependenciesDescription}),(0,F.jsx)(he,{candidates:A,selectedIds:U,disabled:O,onChange:W,labels:{link:m.linkDependencies,linked:m.linkedDependencies,searchPlaceholder:m.dependencySearchPlaceholder,noMatches:m.noDependencyMatches,noCandidates:m.noDependencyCandidates,remove:m.removeDependency}}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(E,{type:`button`,variant:`ghost`,disabled:O,onClick:()=>H(!1),children:m.cancelDependencyEdit}),(0,F.jsx)(E,{type:`button`,variant:`primary`,disabled:O,onClick:()=>void _e(),children:m.saveDependencies})]})]}):(0,F.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:m.dependencies}),b.dependencies.length>0?(0,F.jsx)(`div`,{className:`space-y-2`,children:b.dependencies.map(e=>(0,F.jsxs)(o,{to:Me(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-accent hover:underline`,children:[(0,F.jsx)(`span`,{className:`break-words`,children:e.title}),(0,F.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:I(e.phase,i)})]},e.id))}):(0,F.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:m.noDependencies})]}),(0,F.jsxs)(`div`,{className:`rounded-lg border border-accent/25 bg-accent-soft/40 p-3`,children:[(0,F.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:m.currentTask}),(0,F.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:b.task.title})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:m.dependents}),b.dependents.length>0?(0,F.jsx)(`div`,{className:`space-y-2`,children:b.dependents.map(e=>(0,F.jsxs)(o,{to:Me(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-accent hover:underline`,children:[(0,F.jsx)(`span`,{className:`break-words`,children:e.title}),(0,F.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:I(e.phase,i)})]},e.id))}):(0,F.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:m.noDependents})]})]})]}),b.context.length>0?(0,F.jsxs)(`section`,{className:`min-w-0 rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,F.jsx)(`h2`,{className:`font-medium text-fg`,children:m.contextUsed}),(0,F.jsx)(`ul`,{className:`mt-4 space-y-2`,children:b.context.map(e=>(0,F.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,F.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[m.contextRoleLabels[e.role],` · `,m.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,F.jsx)(`a`,{className:`mt-1 block break-all text-sm text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,F.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]})]})]})}function B(){let e=(0,N.c)(2),{taskId:t}=i(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,F.jsx)(z,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function V(e){let t=(0,N.c)(23),{taskId:n,backgroundPath:r,onClose:i}=e,a=c(H),o;t[0]===i?o=t[1]:(o=e=>{e||i()},t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(y,{className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`}),t[2]=s):s=t[2];let l=a===`zh`?`任务详情`:`Task details`,d;t[3]===l?d=t[4]:(d=(0,F.jsx)(S,{className:`font-medium text-fg`,children:l}),t[3]=l,t[4]=d);let f=a===`zh`?`查看并操作任务详情`:`View and manage task details`,p;t[5]===f?p=t[6]:(p=(0,F.jsx)(O,{className:`sr-only`,children:f}),t[5]=f,t[6]=p);let m=a===`zh`?`关闭任务详情`:`Close task details`,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,F.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[7]=h):h=t[7];let g;t[8]===m?g=t[9]:(g=(0,F.jsx)(k,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":m,children:h}),t[8]=m,t[9]=g);let _;t[10]!==d||t[11]!==p||t[12]!==g?(_=(0,F.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-5 py-3.5`,children:[d,p,g]}),t[10]=d,t[11]=p,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==r||t[15]!==n?(v=(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,F.jsx)(z,{taskId:n,presentation:`modal`,backgroundPath:r})}),t[14]=r,t[15]=n,t[16]=v):v=t[16];let C;t[17]!==_||t[18]!==v?(C=(0,F.jsxs)(b,{children:[s,(0,F.jsxs)(u,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(52rem,calc(100dvh-2rem))] w-[min(64rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-float focus:outline-none`,children:[_,v]})]}),t[17]=_,t[18]=v,t[19]=C):C=t[19];let w;return t[20]!==o||t[21]!==C?(w=(0,F.jsx)(x,{open:!0,onOpenChange:o,children:C}),t[20]=o,t[21]=C,t[22]=w):w=t[22],w}function H(e){return e.language}export{V as TaskDetailModal,B as TaskDetailPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o}from"./locale-store-Bjvw7jtg.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{$a as c,Al as l,Da as u,Go as d,La as f,Ps as p,Qa as m,Qs as h,Wo as g,Yl as _,Za as v,_s as y,ao as b,co as x,cu as S,do as C,eo as w,fo as T,hc as E,io as D,kc as O,lo as k,lu as A,no as j,oo as M,pl as N,ro as P,so as F,to as I,uo as L,xc as R}from"./index-Cb9y6tVR.js";import{n as z,t as B}from"./use-autosave-Frcfbncl.js";import{t as V}from"./page-tabs-D6YJ6_l_.js";import{a as H}from"./connectors-api-Ne8mQrYN.js";var U=n(),W=e(t(),1),G=r(),K=new Set([`profile`,`understanding`,`collaboration`,`sources`,`dreaming`,`privacy`]),q=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,J={en:{title:`About You`,subtitle:`What xopc knows, why it knows it, and how it should work with you.`,profile:`Profile`,understanding:`Understanding`,collaboration:`Working agreement`,sources:`Sources`,dreaming:`Background review`,privacy:`Privacy`,profileHint:`Facts you provide directly. These are available across conversations.`,done:`Done`,required:`This field cannot be empty.`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: product designer, founder, or engineer`,primaryGoal:`What are you mainly trying to achieve?`,primaryGoalPlaceholder:`The outcome you want xopc to optimize for`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,locale:`Language / locale`,detect:`Use this device`,understoodHint:`Reviewable beliefs learned from your conversations and work. Inferences stay pending until confirmed.`,addUnderstanding:`Add understanding`,statement:`What should xopc understand?`,kind:`Type`,add:`Add`,cancel:`Cancel`,active:`Active`,review:`Needs review`,confirm:`Confirm`,reject:`Wrong`,edit:`Edit`,delete:`Delete`,confirmDelete:`Delete now`,rulesHint:`Explicit instructions for how xopc should collaborate with you. Rules outrank inferred understanding.`,addRule:`Add rule`,ruleStatement:`How should xopc work with you?`,category:`Category`,disable:`Disable`,enable:`Enable`,emptyUnderstanding:`Nothing here yet. Tell xopc something explicitly, or confirm a suggestion after it learns one.`,qualityTitle:`Learning quality`,qualityActive:`Confirmed`,qualityPending:`Pending review`,qualityAcceptance:`30-day acceptance`,qualityRecall:`Helpful recall`,qualityNoData:`Not enough feedback yet`,emptyRules:`No working agreements yet.`,sourceExplicit:`You said this directly`,sourceInferred:`Inferred — may be wrong`,sourceObserved:`Observed across prior work`,sourcesHint:`Review every granted source, its access mode, retention, and last collection. Revoking stops future learning.`,manageSources:`Connect another source`,noSources:`No sources are authorized.`,connected:`Connected`,unavailable:`Needs attention`,revoke:`Revoke & remove derived`,refresh:`Refresh`,once:`One-time`,continuous:`Continuous`,localOnly:`Local only`,derivedOnly:`Derived understanding only`,focuses:`Current focuses`,focusHint:`Candidate focuses never activate until you confirm them.`,activate:`Activate`,pause:`Pause`,complete:`Complete`,noFocuses:`No focus candidates yet.`,dreamingHint:`A deterministic daily review checks expiry, contradictory evidence, and corroborated candidates. It never auto-activates an inference.`,mode:`Background review`,on:`On — propose for review`,off:`Off`,reviewTime:`Daily review time`,evidenceThreshold:`Supporting evidence required`,scanLimit:`Maximum items per run`,lastRun:`Last review`,neverRun:`Not run yet`,runCompleted:`Completed`,runFailed:`Failed`,runRunning:`Running`,runItems:`items`,privacyHint:`Choose how generic memory providers handle sensitive content. Structured user understanding applies stricter rules of its own.`,sensitivePolicy:`Sensitive memory writes`,policyDeny:`Do not store`,policyConfirm:`Ask before storing`,policyAllow:`Store when relevant`,privacyWarning:`Secret and regulated content is never stored as structured user understanding, regardless of this setting.`,error:`Could not load your context.`,retry:`Try again`},zh:{title:`关于你`,subtitle:`清楚查看 xopc 知道什么、为什么知道,以及应该如何与你协作。`,profile:`个人资料`,understanding:`对你的理解`,collaboration:`协作约定`,sources:`数据来源`,dreaming:`后台复核`,privacy:`隐私`,profileHint:`由你直接提供的事实,会在不同对话中使用。`,done:`完成`,required:`此项不能为空。`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:产品设计师、创业者、工程师`,primaryGoal:`你目前最想达成什么?`,primaryGoalPlaceholder:`希望 xopc 优先帮助你实现的结果`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,locale:`语言 / 地区`,detect:`使用本机时区`,understoodHint:`从对话和工作中形成、可复核的理解。推断内容在你确认前保持待审核。`,addUnderstanding:`添加理解`,statement:`希望 xopc 了解什么?`,kind:`类型`,add:`添加`,cancel:`取消`,active:`使用中`,review:`待审核`,confirm:`确认`,reject:`不正确`,edit:`编辑`,delete:`删除`,confirmDelete:`确认删除`,rulesHint:`你明确设定的协作方式。协作约定的优先级高于推断出的理解。`,addRule:`添加约定`,ruleStatement:`希望 xopc 如何与你协作?`,category:`类别`,disable:`停用`,enable:`启用`,emptyUnderstanding:`还没有内容。你可以直接告诉 xopc,或在它学到建议后进行确认。`,emptyRules:`还没有协作约定。`,qualityTitle:`学习质量`,qualityActive:`已确认`,qualityPending:`待审核`,qualityAcceptance:`30 天采纳率`,qualityRecall:`有效召回`,qualityNoData:`反馈数据还不足`,sourceExplicit:`由你直接告知`,sourceInferred:`推断内容,可能有误`,sourceObserved:`从过往工作中观察到`,sourcesHint:`查看每项授权的访问方式、保留策略和最近采集时间;撤销后将停止后续学习。`,manageSources:`连接其他来源`,noSources:`尚未授权任何来源。`,connected:`已连接`,unavailable:`需要处理`,revoke:`撤销并删除派生理解`,refresh:`立即更新`,once:`仅一次`,continuous:`持续更新`,localOnly:`仅本地处理`,derivedOnly:`仅保留派生理解`,focuses:`当前关注`,focusHint:`候选关注不会自动生效,只有你确认后才会启用。`,activate:`启用`,pause:`暂停`,complete:`完成`,noFocuses:`还没有候选关注。`,dreamingHint:`每天进行一次确定性复核,检查过期、矛盾证据和得到佐证的候选理解;推断内容不会自动生效。`,mode:`后台复核`,on:`开启并生成待审核项`,off:`关闭`,reviewTime:`每日复核时间`,evidenceThreshold:`所需支持证据数`,scanLimit:`每次最多检查`,lastRun:`最近一次复核`,neverRun:`尚未运行`,runCompleted:`已完成`,runFailed:`失败`,runRunning:`运行中`,runItems:`项`,privacyHint:`选择通用记忆服务如何处理敏感内容;结构化用户理解有独立且更严格的规则。`,sensitivePolicy:`敏感记忆写入`,policyDeny:`不保存`,policyConfirm:`保存前询问`,policyAllow:`相关时允许保存`,privacyWarning:`无论这里如何设置,秘密和受监管内容都不会保存为结构化用户理解。`,error:`无法加载用户上下文。`,retry:`重试`}},Y={preference:{en:`Preference`,zh:`偏好`},boundary:{en:`Boundary`,zh:`边界`},relationship:{en:`Relationship`,zh:`关系`},routine:{en:`Routine`,zh:`习惯`},current_state:{en:`Current state`,zh:`当前状态`},long_term_goal:{en:`Long-term goal`,zh:`长期目标`},project_context:{en:`Project context`,zh:`项目背景`},task_lesson:{en:`Task lesson`,zh:`任务经验`},derived_insight:{en:`Insight`,zh:`洞察`}},X={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function Z(e){let t=(0,U.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:n}),t[0]=n,t[1]=r),r}function Q(e){let t=(0,U.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function ee(e){return JSON.stringify(e)}function te(e){let t=(0,U.c)(10),[n,r]=(0,W.useState)(e),i;t[0]===e?i=t[1]:(i=ee(e),t[0]=e,t[1]=i);let a=(0,W.useRef)(i),o;t[2]===e?o=t[3]:(o=ee(e),t[2]=e,t[3]=o);let s=o,c,l;t[4]!==e||t[5]!==s?(c=()=>{if(s===a.current)return;let t=a.current;a.current=s,r(n=>ee(n)===t?e:n)},l=[e,s],t[4]=e,t[5]=s,t[6]=c,t[7]=l):(c=t[6],l=t[7]),(0,W.useEffect)(c,l);let u;return t[8]===n?u=t[9]:(u=[n,r],t[8]=n,t[9]=u),u}function ne(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function re(){let e=(0,U.c)(87),t=o(se),n=J[t],[r,a]=i(),c;if(e[0]!==r){let t=r.get(`tab`);c=t&&K.has(t)?t:`profile`,e[0]=r,e[1]=c}else c=e[1];let l=c,d=f(oe),p=f(ae),{data:m,error:g,isLoading:v,mutate:y}=s(`/api/you`,P),b;e[2]!==p||e[3]!==d||e[4]!==n.subtitle||e[5]!==n.title?(b=()=>(d({startExtra:null,main:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:n.title}),(0,G.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:n.subtitle})]}),end:null}),p),e[2]=p,e[3]=d,e[4]=n.subtitle,e[5]=n.title,e[6]=b):b=e[6];let x;if(e[7]!==p||e[8]!==d||e[9]!==n?(x=[p,d,n],e[7]=p,e[8]=d,e[9]=n,e[10]=x):x=e[10],(0,W.useEffect)(b,x),v){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsxs)(`div`,{className:`space-y-4 p-4 sm:p-6`,children:[(0,G.jsx)(u,{className:`h-10 w-96 max-w-full`}),(0,G.jsx)(u,{className:`h-72 rounded-2xl`})]}),e[11]=t):t=e[11],t}if(g||!m){let t;e[12]===y?t=e[13]:(t=()=>void y(),e[12]=y,e[13]=t);let r;e[14]!==n.retry||e[15]!==t?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:t,children:n.retry}),e[14]=n.retry,e[15]=t,e[16]=r):r=e[16];let i;return e[17]!==n.error||e[18]!==r?(i=(0,G.jsx)(`div`,{className:`p-6`,children:(0,G.jsxs)(Q,{children:[n.error,` `,r]})}),e[17]=n.error,e[18]=r,e[19]=i):i=e[19],i}let C=n.title,w;e[20]===a?w=e[21]:(w=e=>a({tab:e}),e[20]=a,e[21]=w);let T;e[22]===n.profile?T=e[23]:(T={id:`profile`,label:n.profile,icon:_},e[22]=n.profile,e[23]=T);let E;e[24]!==m.understandings.length||e[25]!==n.understanding?(E={id:`understanding`,label:n.understanding,icon:A,count:m.understandings.length},e[24]=m.understandings.length,e[25]=n.understanding,e[26]=E):E=e[26];let D=n.collaboration,k;e[27]===m.rules?k=e[28]:(k=m.rules.filter(ie),e[27]=m.rules,e[28]=k);let j;e[29]!==n.collaboration||e[30]!==k.length?(j={id:`collaboration`,label:D,icon:N,count:k.length},e[29]=n.collaboration,e[30]=k.length,e[31]=j):j=e[31];let M;e[32]===n.sources?M=e[33]:(M={id:`sources`,label:n.sources,icon:S},e[32]=n.sources,e[33]=M);let F;e[34]===n.dreaming?F=e[35]:(F={id:`dreaming`,label:n.dreaming,icon:O},e[34]=n.dreaming,e[35]=F);let I;e[36]===n.privacy?I=e[37]:(I={id:`privacy`,label:n.privacy,icon:h},e[36]=n.privacy,e[37]=I);let L;e[38]!==M||e[39]!==F||e[40]!==I||e[41]!==T||e[42]!==E||e[43]!==j?(L=[T,E,j,M,F,I],e[38]=M,e[39]=F,e[40]=I,e[41]=T,e[42]=E,e[43]=j,e[44]=L):L=e[44];let R;e[45]!==n.title||e[46]!==L||e[47]!==w||e[48]!==l?(R=(0,G.jsx)(V,{ariaLabel:C,activeTab:l,onChange:w,items:L}),e[45]=n.title,e[46]=L,e[47]=w,e[48]=l,e[49]=R):R=e[49];let z;e[50]!==m.profile||e[51]!==t||e[52]!==y||e[53]!==n||e[54]!==l?(z=l===`profile`?(0,G.jsx)(ce,{profile:m.profile,language:t,t:n,onChanged:e=>y(t=>t&&{...t,profile:e},{revalidate:!1})}):null,e[50]=m.profile,e[51]=t,e[52]=y,e[53]=n,e[54]=l,e[55]=z):z=e[55];let B;e[56]!==m.quality||e[57]!==m.understandings||e[58]!==t||e[59]!==y||e[60]!==n||e[61]!==l?(B=l===`understanding`?(0,G.jsx)(ue,{items:m.understandings,quality:m.quality,language:t,t:n,onChanged:e=>e?y(t=>t&&{...t,understandings:t.understandings.map(t=>t.id===e.id?e:t)},{revalidate:!0}):y()}):null,e[56]=m.quality,e[57]=m.understandings,e[58]=t,e[59]=y,e[60]=n,e[61]=l,e[62]=B):B=e[62];let H;e[63]!==m.rules||e[64]!==t||e[65]!==y||e[66]!==n||e[67]!==l?(H=l===`collaboration`?(0,G.jsx)(_e,{rules:m.rules,language:t,t:n,onChanged:()=>y()}):null,e[63]=m.rules,e[64]=t,e[65]=y,e[66]=n,e[67]=l,e[68]=H):H=e[68];let q;e[69]!==n||e[70]!==l?(q=l===`sources`?(0,G.jsx)(be,{t:n}):null,e[69]=n,e[70]=l,e[71]=q):q=e[71];let Y;e[72]!==m.consolidation?.lastRun||e[73]!==n||e[74]!==l?(Y=l===`dreaming`?(0,G.jsx)(xe,{lastRun:m.consolidation?.lastRun??null,t:n}):null,e[72]=m.consolidation?.lastRun,e[73]=n,e[74]=l,e[75]=Y):Y=e[75];let X;e[76]!==n||e[77]!==l?(X=l===`privacy`?(0,G.jsx)(Ce,{t:n}):null,e[76]=n,e[77]=l,e[78]=X):X=e[78];let Z;return e[79]!==R||e[80]!==z||e[81]!==B||e[82]!==H||e[83]!==q||e[84]!==Y||e[85]!==X?(Z=(0,G.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl space-y-5 p-4 sm:p-6`,children:[R,z,B,H,q,Y,X]}),e[79]=R,e[80]=z,e[81]=B,e[82]=H,e[83]=q,e[84]=Y,e[85]=X,e[86]=Z):Z=e[86],Z}function ie(e){return e.status===`active`}function ae(e){return e.clearPageHeader}function oe(e){return e.setPageHeader}function se(e){return e.language}function ce(e){let t=(0,U.c)(78),{profile:n,language:r,t:i,onChanged:a}=e,o;t[0]===n?o=t[1]:(o=ne(n),t[0]=n,t[1]=o);let s=o,[c,l]=te(s),u;t[2]===c?u=t[3]:(u=ee(c),t[2]=c,t[3]=u);let d;t[4]===s?d=t[5]:(d=ee(s),t[4]=s,t[5]=d);let f=u!==d,p;t[6]!==a||t[7]!==n?(p=async e=>{await a((await T({...e,accessibility:n.accessibility})).profile)},t[6]=a,t[7]=n,t[8]=p):p=t[8];let m;t[9]!==c||t[10]!==f||t[11]!==p?(m={value:c,dirty:f,delayMs:500,onSave:p},t[9]=c,t[10]=f,t[11]=p,t[12]=m):m=t[12];let h=B(m),g;t[13]!==c||t[14]!==l?(g=(e,t,n)=>(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,G.jsx)(`input`,{className:q,placeholder:n,value:c[e],onChange:t=>l(n=>({...n,[e]:t.target.value}))})]}),t[13]=c,t[14]=l,t[15]=g):g=t[15];let _=g,v=h.onBlurCapture,b;t[16]===i.profileHint?b=t[17]:(b=(0,G.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-fg-muted`,children:i.profileHint}),t[16]=i.profileHint,t[17]=b);let x;t[18]!==_||t[19]!==i.callName||t[20]!==i.callNamePlaceholder?(x=_(`callName`,i.callName,i.callNamePlaceholder),t[18]=_,t[19]=i.callName,t[20]=i.callNamePlaceholder,t[21]=x):x=t[21];let S;t[22]!==_||t[23]!==i.role||t[24]!==i.rolePlaceholder?(S=_(`role`,i.role,i.rolePlaceholder),t[22]=_,t[23]=i.role,t[24]=i.rolePlaceholder,t[25]=S):S=t[25];let C;t[26]===i.primaryGoal?C=t[27]:(C=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:i.primaryGoal}),t[26]=i.primaryGoal,t[27]=C);let w;t[28]===l?w=t[29]:(w=e=>l(t=>({...t,primaryGoal:e.target.value})),t[28]=l,t[29]=w);let E;t[30]!==c.primaryGoal||t[31]!==i.primaryGoalPlaceholder||t[32]!==w?(E=(0,G.jsx)(`textarea`,{className:q,rows:3,placeholder:i.primaryGoalPlaceholder,value:c.primaryGoal,onChange:w}),t[30]=c.primaryGoal,t[31]=i.primaryGoalPlaceholder,t[32]=w,t[33]=E):E=t[33];let D;t[34]!==C||t[35]!==E?(D=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[C,E]}),t[34]=C,t[35]=E,t[36]=D):D=t[36];let O;t[37]!==_||t[38]!==r||t[39]!==i.pronouns||t[40]!==i.pronounsPlaceholder?(O=r===`en`?_(`pronouns`,i.pronouns,i.pronounsPlaceholder):null,t[37]=_,t[38]=r,t[39]=i.pronouns,t[40]=i.pronounsPlaceholder,t[41]=O):O=t[41];let k;t[42]===i.timezone?k=t[43]:(k=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[42]=i.timezone,t[43]=k);let A;t[44]===l?A=t[45]:(A=e=>l(t=>({...t,timezone:e.target.value})),t[44]=l,t[45]=A);let j;t[46]!==c.timezone||t[47]!==A?(j=(0,G.jsx)(`input`,{className:`${q} min-w-0 flex-1`,value:c.timezone,onChange:A}),t[46]=c.timezone,t[47]=A,t[48]=j):j=t[48];let M;t[49]===l?M=t[50]:(M=()=>l(le),t[49]=l,t[50]=M);let N;t[51]!==i.detect||t[52]!==M?(N=(0,G.jsx)(y,{className:`shrink-0 whitespace-nowrap`,onClick:M,children:i.detect}),t[51]=i.detect,t[52]=M,t[53]=N):N=t[53];let P;t[54]!==j||t[55]!==N?(P=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[j,N]}),t[54]=j,t[55]=N,t[56]=P):P=t[56];let F;t[57]!==k||t[58]!==P?(F=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[k,P]}),t[57]=k,t[58]=P,t[59]=F):F=t[59];let I;t[60]!==_||t[61]!==i.locale?(I=_(`locale`,i.locale),t[60]=_,t[61]=i.locale,t[62]=I):I=t[62];let L;t[63]!==x||t[64]!==S||t[65]!==D||t[66]!==O||t[67]!==F||t[68]!==I?(L=(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[x,S,D,O,F,I]}),t[63]=x,t[64]=S,t[65]=D,t[66]=O,t[67]=F,t[68]=I,t[69]=L):L=t[69];let R;t[70]!==h.error||t[71]!==h.status?(R=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:h.status,error:h.error})}),t[70]=h.error,t[71]=h.status,t[72]=R):R=t[72];let V;return t[73]!==h.onBlurCapture||t[74]!==L||t[75]!==R||t[76]!==b?(V=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:v,children:[b,L,R]})}),t[73]=h.onBlurCapture,t[74]=L,t[75]=R,t[76]=b,t[77]=V):V=t[77],V}function le(e){return{...e,timezone:I()}}function ue(e){let t=(0,U.c)(54),{items:n,quality:r,language:i,t:a,onChanged:o}=e,[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),[f,p]=(0,W.useState)(`preference`),h;t[0]===n?h=t[1]:(h=n.filter(fe),t[0]=n,t[1]=h);let _=h,v;t[2]===n?v=t[3]:(v=n.filter(de),t[2]=n,t[3]=v);let b=v,x;t[4]!==f||t[5]!==o||t[6]!==l?(x=async e=>{e.preventDefault(),l.trim()&&(await m({statement:l,kind:f}),u(``),c(!1),await o())},t[4]=f,t[5]=o,t[6]=l,t[7]=x):x=t[7];let S=x,C;t[8]===a.understoodHint?C=t[9]:(C=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:a.understoodHint}),t[8]=a.understoodHint,t[9]=C);let w,T;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>c(!0),T=(0,G.jsx)(E,{className:`size-4`}),t[10]=w,t[11]=T):(w=t[10],T=t[11]);let D;t[12]===a.addUnderstanding?D=t[13]:(D=(0,G.jsxs)(y,{variant:`primary`,onClick:w,children:[T,a.addUnderstanding]}),t[12]=a.addUnderstanding,t[13]=D);let O;t[14]!==C||t[15]!==D?(O=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[C,D]}),t[14]=C,t[15]=D,t[16]=O):O=t[16];let k;t[17]!==r||t[18]!==a?(k=(0,G.jsx)(pe,{quality:r,t:a}),t[17]=r,t[18]=a,t[19]=k):k=t[19];let A;t[20]===a?A=t[21]:(A=(0,G.jsx)(he,{t:a}),t[20]=a,t[21]=A);let j;t[22]!==s||t[23]!==f||t[24]!==i||t[25]!==l||t[26]!==S||t[27]!==a.add||t[28]!==a.cancel||t[29]!==a.statement?(j=s?(0,G.jsx)(Z,{children:(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:S,children:[(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,rows:3,placeholder:a.statement,value:l,onChange:e=>u(e.target.value)}),(0,G.jsx)(g,{value:f,onChange:e=>p(e.target.value),children:Object.entries(Y).map(e=>{let[t,n]=e;return(0,G.jsx)(d,{value:t,children:n[i]},t)})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(y,{type:`submit`,variant:`primary`,children:a.add}),(0,G.jsx)(y,{onClick:()=>c(!1),children:a.cancel})]})]})}):null,t[22]=s,t[23]=f,t[24]=i,t[25]=l,t[26]=S,t[27]=a.add,t[28]=a.cancel,t[29]=a.statement,t[30]=j):j=t[30];let M;t[31]!==i||t[32]!==o||t[33]!==b||t[34]!==a?(M=b.length?(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.review,` · `,b.length]}),b.map(e=>(0,G.jsx)($,{item:e,language:i,t:a,onChanged:o},e.id))]}):null,t[31]=i,t[32]=o,t[33]=b,t[34]=a,t[35]=M):M=t[35];let N;t[36]!==_.length||t[37]!==a.active?(N=(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[a.active,` · `,_.length]}),t[36]=_.length,t[37]=a.active,t[38]=N):N=t[38];let P;t[39]!==_||t[40]!==i||t[41]!==o||t[42]!==a?(P=_.length?_.map(e=>(0,G.jsx)($,{item:e,language:i,t:a,onChanged:o},e.id)):(0,G.jsx)(Q,{children:a.emptyUnderstanding}),t[39]=_,t[40]=i,t[41]=o,t[42]=a,t[43]=P):P=t[43];let F;t[44]!==N||t[45]!==P?(F=(0,G.jsxs)(`section`,{className:`space-y-3`,children:[N,P]}),t[44]=N,t[45]=P,t[46]=F):F=t[46];let I;return t[47]!==A||t[48]!==j||t[49]!==M||t[50]!==F||t[51]!==O||t[52]!==k?(I=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[O,k,A,j,M,F]}),t[47]=A,t[48]=j,t[49]=M,t[50]=F,t[51]=O,t[52]=k,t[53]=I):I=t[53],I}function de(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function fe(e){return e.status===`active`}function pe(e){let t=(0,U.c)(32),{quality:n,t:r}=e,i;t[0]===r.qualityNoData?i=t[1]:(i=e=>e==null?r.qualityNoData:`${Math.round(e*100)}%`,t[0]=r.qualityNoData,t[1]=i);let a=i,o=r.qualityActive,s=String(n.records.active),c;t[2]!==r.qualityActive||t[3]!==s?(c=[o,s],t[2]=r.qualityActive,t[3]=s,t[4]=c):c=t[4];let l=r.qualityPending,u=String(n.records.candidate+n.records.needsReview),d;t[5]!==r.qualityPending||t[6]!==u?(d=[l,u],t[5]=r.qualityPending,t[6]=u,t[7]=d):d=t[7];let f=r.qualityAcceptance,p;t[8]!==n.decisions.acceptanceRate||t[9]!==a?(p=a(n.decisions.acceptanceRate),t[8]=n.decisions.acceptanceRate,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==r.qualityAcceptance||t[12]!==p?(m=[f,p],t[11]=r.qualityAcceptance,t[12]=p,t[13]=m):m=t[13];let h=r.qualityRecall,g;t[14]!==n.recall.helpfulRate||t[15]!==a?(g=a(n.recall.helpfulRate),t[14]=n.recall.helpfulRate,t[15]=a,t[16]=g):g=t[16];let _;t[17]!==r.qualityRecall||t[18]!==g?(_=[h,g],t[17]=r.qualityRecall,t[18]=g,t[19]=_):_=t[19];let v;t[20]!==m||t[21]!==_||t[22]!==c||t[23]!==d?(v=[c,d,m,_],t[20]=m,t[21]=_,t[22]=c,t[23]=d,t[24]=v):v=t[24];let y=v,b;t[25]===r.qualityTitle?b=t[26]:(b=(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r.qualityTitle}),t[25]=r.qualityTitle,t[26]=b);let x;t[27]===y?x=t[28]:(x=(0,G.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4`,children:y.map(me)}),t[27]=y,t[28]=x);let S;return t[29]!==b||t[30]!==x?(S=(0,G.jsxs)(Z,{children:[b,x]}),t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function me(e){let[t,n]=e;return(0,G.jsxs)(`div`,{className:`rounded-xl bg-surface-muted px-3 py-2.5`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-fg-subtle`,children:t}),(0,G.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-fg`,children:n})]},t)}function $(e){let t=(0,U.c)(57),{item:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(!1),[u,d]=te(n.statement),f=u!==n.statement,m;t[0]===i.required?m=t[1]:(m=e=>e.trim()?null:i.required,t[0]=i.required,t[1]=m);let h;t[2]!==n.id||t[3]!==a?(h=async e=>{await a((await k(n.id,{statement:e})).understanding)},t[2]=n.id,t[3]=a,t[4]=h):h=t[4];let g;t[5]!==u||t[6]!==o||t[7]!==f||t[8]!==m||t[9]!==h?(g={value:u,dirty:f,enabled:o,delayMs:500,validate:m,onSave:h},t[5]=u,t[6]=o,t[7]=f,t[8]=m,t[9]=h,t[10]=g):g=t[10];let _=B(g),v=Y[n.kind][r],b;t[11]===v?b=t[12]:(b=(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:v}),t[11]=v,t[12]=b);let x=n.explicitness===`explicit`?i.sourceExplicit:n.explicitness===`observed`?i.sourceObserved:i.sourceInferred,S;t[13]===x?S=t[14]:(S=(0,G.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:x}),t[13]=x,t[14]=S);let C;t[15]!==b||t[16]!==S?(C=(0,G.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[b,S]}),t[15]=b,t[16]=S,t[17]=C):C=t[17];let T;t[18]!==u||t[19]!==o||t[20]!==d?(T=o?(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,value:u,onChange:e=>d(e.target.value),rows:3}):(0,G.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:u}),t[18]=u,t[19]=o,t[20]=d,t[21]=T):T=t[21];let E;t[22]!==T||t[23]!==C?(E=(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[C,T]})}),t[22]=T,t[23]=C,t[24]=E):E=t[24];let D;t[25]!==_||t[26]!==o||t[27]!==i.done||t[28]!==i.edit?(D=o?(0,G.jsx)(y,{variant:`ghost`,onClick:()=>{_.flush(),s(!1)},children:i.done}):(0,G.jsxs)(y,{variant:`ghost`,onClick:()=>s(!0),children:[(0,G.jsx)(R,{className:`size-3.5`}),i.edit]}),t[25]=_,t[26]=o,t[27]=i.done,t[28]=i.edit,t[29]=D):D=t[29];let O;t[30]!==n.id||t[31]!==n.status||t[32]!==a||t[33]!==i.confirm||t[34]!==i.reject?(O=n.status===`active`?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(y,{variant:`primary`,onClick:async()=>{await a((await k(n.id,{status:`active`})).understanding)},children:i.confirm}),(0,G.jsx)(y,{onClick:async()=>{await a((await k(n.id,{status:`rejected`})).understanding)},children:i.reject})]}),t[30]=n.id,t[31]=n.status,t[32]=a,t[33]=i.confirm,t[34]=i.reject,t[35]=O):O=t[35];let A;t[36]!==c||t[37]!==n.id||t[38]!==a?(A=async()=>{if(!c){l(!0);return}await w(n.id),l(!1),await a()},t[36]=c,t[37]=n.id,t[38]=a,t[39]=A):A=t[39];let j;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,G.jsx)(p,{className:`size-3.5`}),t[40]=j):j=t[40];let M=c?i.confirmDelete:i.delete,N;t[41]!==A||t[42]!==M?(N=(0,G.jsxs)(y,{variant:`ghost`,className:`text-danger`,onClick:A,children:[j,M]}),t[41]=A,t[42]=M,t[43]=N):N=t[43];let P;t[44]!==_.error||t[45]!==_.status||t[46]!==o?(P=o||_.status!==`idle`?(0,G.jsx)(z,{className:`ml-auto`,status:_.status,error:_.error}):null,t[44]=_.error,t[45]=_.status,t[46]=o,t[47]=P):P=t[47];let F;t[48]!==D||t[49]!==O||t[50]!==N||t[51]!==P?(F=(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[D,O,N,P]}),t[48]=D,t[49]=O,t[50]=N,t[51]=P,t[52]=F):F=t[52];let I;return t[53]!==_.onBlurCapture||t[54]!==E||t[55]!==F?(I=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:_.onBlurCapture,children:[E,F]})}),t[53]=_.onBlurCapture,t[54]=E,t[55]=F,t[56]=I):I=t[56],I}function he(e){let t=(0,U.c)(20),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=s(`you-focuses`,b);if(a){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-40 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;return t[1]===n.error?e=t[2]:(e=(0,G.jsx)(Q,{children:n.error}),t[1]=n.error,t[2]=e),e}let c;if(t[3]!==r||t[4]!==o||t[5]!==n.activate||t[6]!==n.complete||t[7]!==n.focusHint||t[8]!==n.focuses||t[9]!==n.noFocuses||t[10]!==n.pause||t[11]!==n.reject){let e=(r??[]).filter(ge),i;t[13]===n.focuses?i=t[14]:(i=(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.focuses}),t[13]=n.focuses,t[14]=i);let a;t[15]===n.focusHint?a=t[16]:(a=(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.focusHint}),t[15]=n.focusHint,t[16]=a);let s;t[17]!==i||t[18]!==a?(s=(0,G.jsxs)(`div`,{children:[i,a]}),t[17]=i,t[18]=a,t[19]=s):s=t[19],c=(0,G.jsxs)(`section`,{className:`space-y-3`,children:[s,e.length?e.map(e=>(0,G.jsxs)(Z,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] text-fg-muted`,children:e.status})]}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary})]}),(0,G.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:[Math.round(e.confidence*100),`%`]})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[e.status===`active`?(0,G.jsx)(y,{onClick:async()=>{await C(e.id,`paused`),await o()},children:n.pause}):(0,G.jsx)(y,{variant:`primary`,onClick:async()=>{await C(e.id,`active`),await o()},children:n.activate}),(0,G.jsx)(y,{variant:`ghost`,onClick:async()=>{await C(e.id,`completed`),await o()},children:n.complete}),e.status===`candidate`?(0,G.jsx)(y,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await C(e.id,`rejected`),await o()},children:n.reject}):null]})]},e.id)):(0,G.jsx)(Q,{children:n.noFocuses})]}),t[3]=r,t[4]=o,t[5]=n.activate,t[6]=n.complete,t[7]=n.focusHint,t[8]=n.focuses,t[9]=n.noFocuses,t[10]=n.pause,t[11]=n.reject,t[12]=c}else c=t[12];return c}function ge(e){return e.status!==`rejected`}function _e(e){let t=(0,U.c)(36),{rules:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),[f,m]=(0,W.useState)(`communication`),[h,_]=(0,W.useState)(null),b;t[0]!==f||t[1]!==a||t[2]!==l?(b=async e=>{e.preventDefault(),l.trim()&&(await v({statement:l,category:f}),u(``),s(!1),await a())},t[0]=f,t[1]=a,t[2]=l,t[3]=b):b=t[3];let S=b,C;t[4]===i.rulesHint?C=t[5]:(C=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.rulesHint}),t[4]=i.rulesHint,t[5]=C);let w,T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>s(!0),T=(0,G.jsx)(E,{className:`size-4`}),t[6]=w,t[7]=T):(w=t[6],T=t[7]);let D;t[8]===i.addRule?D=t[9]:(D=(0,G.jsxs)(y,{variant:`primary`,onClick:w,children:[T,i.addRule]}),t[8]=i.addRule,t[9]=D);let O;t[10]!==C||t[11]!==D?(O=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[C,D]}),t[10]=C,t[11]=D,t[12]=O):O=t[12];let k;t[13]!==o||t[14]!==f||t[15]!==r||t[16]!==l||t[17]!==S||t[18]!==i.add||t[19]!==i.cancel||t[20]!==i.ruleStatement?(k=o?(0,G.jsx)(Z,{children:(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:S,children:[(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,rows:3,placeholder:i.ruleStatement,value:l,onChange:e=>u(e.target.value)}),(0,G.jsx)(g,{value:f,onChange:e=>m(e.target.value),children:Object.entries(X).map(e=>{let[t,n]=e;return(0,G.jsx)(d,{value:t,children:n[r]},t)})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(y,{type:`submit`,variant:`primary`,children:i.add}),(0,G.jsx)(y,{onClick:()=>s(!1),children:i.cancel})]})]})}):null,t[13]=o,t[14]=f,t[15]=r,t[16]=l,t[17]=S,t[18]=i.add,t[19]=i.cancel,t[20]=i.ruleStatement,t[21]=k):k=t[21];let A;t[22]!==h||t[23]!==r||t[24]!==a||t[25]!==n||t[26]!==i.confirmDelete||t[27]!==i.delete||t[28]!==i.disable||t[29]!==i.emptyRules||t[30]!==i.enable?(A=n.length?n.filter(ve).map(e=>(0,G.jsxs)(Z,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:X[e.category][r]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm leading-6 ${e.status===`disabled`?`text-fg-subtle line-through`:`text-fg`}`,children:e.statement})]}),(0,G.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:[`P`,e.priority]})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,G.jsx)(y,{variant:`ghost`,onClick:async()=>{await x(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,G.jsxs)(y,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(h!==e.id){_(e.id);return}await c(e.id),_(null),await a()},children:[(0,G.jsx)(p,{className:`size-3.5`}),h===e.id?i.confirmDelete:i.delete]})]})]},e.id)):(0,G.jsx)(Q,{children:i.emptyRules}),t[22]=h,t[23]=r,t[24]=a,t[25]=n,t[26]=i.confirmDelete,t[27]=i.delete,t[28]=i.disable,t[29]=i.emptyRules,t[30]=i.enable,t[31]=A):A=t[31];let j;return t[32]!==O||t[33]!==k||t[34]!==A?(j=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[O,k,A]}),t[32]=O,t[33]=k,t[34]=A,t[35]=j):j=t[35],j}function ve(e){return e.status!==`archived`}async function ye(){let[e,t]=await Promise.all([j(),H()]);return{grants:e,connectors:t}}function be(e){let t=(0,U.c)(39),{t:n}=e,{data:r,error:i,isLoading:o,mutate:c}=s(`you-understanding-sources`,ye);if(o){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-64 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;t[1]===c?e=t[2]:(e=()=>void c(),t[1]=c,t[2]=e);let r;t[3]!==n.retry||t[4]!==e?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[3]=n.retry,t[4]=e,t[5]=r):r=t[5];let i;return t[6]!==n.error||t[7]!==r?(i=(0,G.jsxs)(Q,{children:[n.error,` `,r]}),t[6]=n.error,t[7]=r,t[8]=i):i=t[8],i}let d;t[9]===r?.grants?d=t[10]:(d=r?.grants??[],t[9]=r?.grants,t[10]=d);let f=d,p;t[11]===r?.connectors?p=t[12]:(p=r?.connectors??[],t[11]=r?.connectors,t[12]=p);let m=p,h;t[13]===n.sourcesHint?h=t[14]:(h=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.sourcesHint}),t[13]=n.sourcesHint,t[14]=h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,G.jsx)(l,{className:`size-4`}),t[15]=g):g=t[15];let _;t[16]===n.manageSources?_=t[17]:(_=(0,G.jsx)(y,{asChild:!0,variant:`primary`,children:(0,G.jsxs)(a,{to:`/connectors?understanding=1&returnTo=%2Fyou%3Ftab%3Dsources`,children:[n.manageSources,g]})}),t[16]=n.manageSources,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let b;t[21]!==f||t[22]!==c||t[23]!==n.continuous||t[24]!==n.derivedOnly||t[25]!==n.localOnly||t[26]!==n.noSources||t[27]!==n.once||t[28]!==n.refresh||t[29]!==n.revoke?(b=f.length?(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:f.map(e=>(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,G.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[e.accessMode===`continuous`?n.continuous:n.once,` · `,e.processingPolicy===`local_only`?n.localOnly:e.retentionPolicy===`derived_only`?n.derivedOnly:e.retentionPolicy]}),e.lastCollectedAt?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:new Date(e.lastCollectedAt).toLocaleString()}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[e.accessMode===`continuous`?(0,G.jsx)(y,{variant:`ghost`,onClick:async()=>{await M(e.id),await c()},children:n.refresh}):null,(0,G.jsx)(y,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await F(e.id),await c()},children:n.revoke})]})]})},e.id))}):(0,G.jsx)(Q,{children:n.noSources}),t[21]=f,t[22]=c,t[23]=n.continuous,t[24]=n.derivedOnly,t[25]=n.localOnly,t[26]=n.noSources,t[27]=n.once,t[28]=n.refresh,t[29]=n.revoke,t[30]=b):b=t[30];let x;t[31]!==m||t[32]!==n.connected||t[33]!==n.unavailable?(x=m.length?(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:m.map(e=>{let t=e.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`);return(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,G.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:e.connectorId})]}),(0,G.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs ${t?`bg-success-soft text-success`:`bg-warning-soft text-warning`}`,children:t?n.connected:n.unavailable})]})},e.instanceId)})}):null,t[31]=m,t[32]=n.connected,t[33]=n.unavailable,t[34]=x):x=t[34];let S;return t[35]!==v||t[36]!==b||t[37]!==x?(S=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[v,b,x]}),t[35]=v,t[36]=b,t[37]=x,t[38]=S):S=t[38],S}function xe(e){let t=(0,U.c)(112),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:o,mutate:c}=s(`you-context-settings`,D),l=i?.dreaming??null,[f,p]=te(l),m;t[0]!==f||t[1]!==l?(m=f&&l&&ee(f)!==ee(l),t[0]=f,t[1]=l,t[2]=m):m=t[2];let h=!!m,_;t[3]===c?_=t[4]:(_=async e=>{await L({dreaming:e}),await c()},t[3]=c,t[4]=_);let v;t[5]!==f||t[6]!==h||t[7]!==_?(v={value:f,dirty:h,delayMs:500,onSave:_},t[5]=f,t[6]=h,t[7]=_,t[8]=v):v=t[8];let b=B(v);if(a){let e;t[9]===c?e=t[10]:(e=()=>void c(),t[9]=c,t[10]=e);let n;t[11]!==r.retry||t[12]!==e?(n=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:r.retry}),t[11]=r.retry,t[12]=e,t[13]=n):n=t[13];let i;return t[14]!==r.error||t[15]!==n?(i=(0,G.jsxs)(Q,{children:[r.error,` `,n]}),t[14]=r.error,t[15]=n,t[16]=i):i=t[16],i}if(o||!f){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let x=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,S;t[18]===r.dreamingHint?S=t[19]:(S=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=S);let C=b.onBlurCapture,w;t[20]===r.mode?w=t[21]:(w=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.mode}),t[20]=r.mode,t[21]=w);let T;t[22]===p?T=t[23]:(T=e=>p(t=>t&&{...t,mode:e.target.value}),t[22]=p,t[23]=T);let E;t[24]===r.on?E=t[25]:(E=(0,G.jsx)(d,{value:`review`,children:r.on}),t[24]=r.on,t[25]=E);let O;t[26]===r.off?O=t[27]:(O=(0,G.jsx)(d,{value:`off`,children:r.off}),t[26]=r.off,t[27]=O);let k;t[28]!==f.mode||t[29]!==O||t[30]!==T||t[31]!==E?(k=(0,G.jsxs)(g,{value:f.mode,onChange:T,children:[E,O]}),t[28]=f.mode,t[29]=O,t[30]=T,t[31]=E,t[32]=k):k=t[32];let A;t[33]!==k||t[34]!==w?(A=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[w,k]}),t[33]=k,t[34]=w,t[35]=A):A=t[35];let j;t[36]===r.reviewTime?j=t[37]:(j=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.reviewTime}),t[36]=r.reviewTime,t[37]=j);let M;t[38]===p?M=t[39]:(M=e=>p(t=>t&&{...t,schedule:{time:e.target.value}}),t[38]=p,t[39]=M);let N;t[40]!==f.schedule.time||t[41]!==M?(N=(0,G.jsx)(`input`,{type:`time`,className:q,value:f.schedule.time,onChange:M}),t[40]=f.schedule.time,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==j||t[44]!==N?(P=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[j,N]}),t[43]=j,t[44]=N,t[45]=P):P=t[45];let F;t[46]===r.timezone?F=t[47]:(F=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.timezone}),t[46]=r.timezone,t[47]=F);let R=f.timezone??``,V;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(V=I(),t[48]=V):V=t[48];let H;t[49]===p?H=t[50]:(H=e=>p(t=>t&&{...t,timezone:e.target.value||void 0}),t[49]=p,t[50]=H);let W;t[51]!==R||t[52]!==H?(W=(0,G.jsx)(`input`,{className:`${q} min-w-0 flex-1`,value:R,placeholder:V,onChange:H}),t[51]=R,t[52]=H,t[53]=W):W=t[53];let K;t[54]===p?K=t[55]:(K=()=>p(Se),t[54]=p,t[55]=K);let J;t[56]!==r.detect||t[57]!==K?(J=(0,G.jsx)(y,{className:`shrink-0 whitespace-nowrap`,onClick:K,children:r.detect}),t[56]=r.detect,t[57]=K,t[58]=J):J=t[58];let Y;t[59]!==W||t[60]!==J?(Y=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[W,J]}),t[59]=W,t[60]=J,t[61]=Y):Y=t[61];let X;t[62]!==F||t[63]!==Y?(X=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[F,Y]}),t[62]=F,t[63]=Y,t[64]=X):X=t[64];let ne;t[65]===r.evidenceThreshold?ne=t[66]:(ne=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[65]=r.evidenceThreshold,t[66]=ne);let re;t[67]===p?re=t[68]:(re=e=>p(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[67]=p,t[68]=re);let ie;t[69]!==f.minEvidenceSources||t[70]!==re?(ie=(0,G.jsx)(`input`,{type:`number`,min:2,max:10,className:q,value:f.minEvidenceSources,onChange:re}),t[69]=f.minEvidenceSources,t[70]=re,t[71]=ie):ie=t[71];let ae;t[72]!==ne||t[73]!==ie?(ae=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[ne,ie]}),t[72]=ne,t[73]=ie,t[74]=ae):ae=t[74];let oe;t[75]===r.scanLimit?oe=t[76]:(oe=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[75]=r.scanLimit,t[76]=oe);let se;t[77]===p?se=t[78]:(se=e=>p(t=>t&&{...t,limit:Number(e.target.value)}),t[77]=p,t[78]=se);let ce;t[79]!==f.limit||t[80]!==se?(ce=(0,G.jsx)(`input`,{type:`number`,min:1,max:2e3,className:q,value:f.limit,onChange:se}),t[79]=f.limit,t[80]=se,t[81]=ce):ce=t[81];let le;t[82]!==oe||t[83]!==ce?(le=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[oe,ce]}),t[82]=oe,t[83]=ce,t[84]=le):le=t[84];let ue;t[85]!==A||t[86]!==P||t[87]!==X||t[88]!==ae||t[89]!==le?(ue=(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[A,P,X,ae,le]}),t[85]=A,t[86]=P,t[87]=X,t[88]=ae,t[89]=le,t[90]=ue):ue=t[90];let de;t[91]!==b.error||t[92]!==b.status?(de=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:b.status,error:b.error})}),t[91]=b.error,t[92]=b.status,t[93]=de):de=t[93];let fe;t[94]!==b.onBlurCapture||t[95]!==ue||t[96]!==de?(fe=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:C,children:[ue,de]})}),t[94]=b.onBlurCapture,t[95]=ue,t[96]=de,t[97]=fe):fe=t[97];let pe;t[98]===r.lastRun?pe=t[99]:(pe=(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[98]=r.lastRun,t[99]=pe);let me;t[100]!==n||t[101]!==x||t[102]!==r.neverRun||t[103]!==r.runItems?(me=n?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,G.jsx)(`span`,{children:x}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`time`,{children:new Date(n.startedAt).toLocaleString()}),typeof n.metrics.scanned==`number`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`·`}),(0,G.jsxs)(`span`,{children:[String(n.metrics.scanned),` `,r.runItems]})]}):null]}):(0,G.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:r.neverRun}),t[100]=n,t[101]=x,t[102]=r.neverRun,t[103]=r.runItems,t[104]=me):me=t[104];let $;t[105]!==pe||t[106]!==me?($=(0,G.jsxs)(Z,{children:[pe,me]}),t[105]=pe,t[106]=me,t[107]=$):$=t[107];let he;return t[108]!==fe||t[109]!==$||t[110]!==S?(he=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[S,fe,$]}),t[108]=fe,t[109]=$,t[110]=S,t[111]=he):he=t[111],he}function Se(e){return e&&{...e,timezone:I()}}function Ce(e){let t=(0,U.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=s(`you-context-settings`,D),c=r?.privacy.sensitiveWritePolicy??null,[l,f]=te(c),p=!!(l&&c&&l!==c),m;t[0]===o?m=t[1]:(m=async e=>{await L({privacy:{sensitiveWritePolicy:e}}),await o()},t[0]=o,t[1]=m);let h;t[2]!==l||t[3]!==p||t[4]!==m?(h={value:l,dirty:p,delayMs:350,onSave:m},t[2]=l,t[3]=p,t[4]=m,t[5]=h):h=t[5];let _=B(h);if(i){let e;t[6]===o?e=t[7]:(e=()=>void o(),t[6]=o,t[7]=e);let r;t[8]!==n.retry||t[9]!==e?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[8]=n.retry,t[9]=e,t[10]=r):r=t[10];let i;return t[11]!==n.error||t[12]!==r?(i=(0,G.jsxs)(Q,{children:[n.error,` `,r]}),t[11]=n.error,t[12]=r,t[13]=i):i=t[13],i}if(a||!l){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-56 rounded-2xl`}),t[14]=e):e=t[14],e}let v;t[15]===n.privacyHint?v=t[16]:(v=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.privacyHint}),t[15]=n.privacyHint,t[16]=v);let y;t[17]===n.sensitivePolicy?y=t[18]:(y=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:n.sensitivePolicy}),t[17]=n.sensitivePolicy,t[18]=y);let b;t[19]===f?b=t[20]:(b=e=>f(e.target.value),t[19]=f,t[20]=b);let x;t[21]===n.policyDeny?x=t[22]:(x=(0,G.jsx)(d,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=x);let S;t[23]===n.policyConfirm?S=t[24]:(S=(0,G.jsx)(d,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=S);let C;t[25]===n.policyAllow?C=t[26]:(C=(0,G.jsx)(d,{value:`allow`,children:n.policyAllow}),t[25]=n.policyAllow,t[26]=C);let w;t[27]!==l||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==C?(w=(0,G.jsxs)(g,{value:l,onChange:b,children:[x,S,C]}),t[27]=l,t[28]=b,t[29]=x,t[30]=S,t[31]=C,t[32]=w):w=t[32];let T;t[33]!==w||t[34]!==y?(T=(0,G.jsxs)(`label`,{className:`block max-w-xl space-y-1.5 text-sm`,children:[y,w]}),t[33]=w,t[34]=y,t[35]=T):T=t[35];let E;t[36]===n.privacyWarning?E=t[37]:(E=(0,G.jsx)(`p`,{className:`mt-3 max-w-2xl text-xs leading-5 text-fg-subtle`,children:n.privacyWarning}),t[36]=n.privacyWarning,t[37]=E);let O;t[38]!==_.error||t[39]!==_.status?(O=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:_.status,error:_.error})}),t[38]=_.error,t[39]=_.status,t[40]=O):O=t[40];let k;t[41]!==_.onBlurCapture||t[42]!==T||t[43]!==E||t[44]!==O?(k=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:_.onBlurCapture,children:[T,E,O]})}),t[41]=_.onBlurCapture,t[42]=T,t[43]=E,t[44]=O,t[45]=k):k=t[45];let A;return t[46]!==k||t[47]!==v?(A=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[v,k]}),t[46]=k,t[47]=v,t[48]=A):A=t[48],A}export{re as UserContextPage};
|