@xopcai/xopc 0.0.393 → 0.0.395
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-1AF2KGju.js → agent-avatar-dicebear-BRtkz-ZU.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Dqg2NOn-.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-cjJXJj_3.js → agent-plugin-dialog-CKK95Jmr.js} +1 -1
- package/dist/gateway/static/root/assets/agents-0zgLsfVA.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-B5aykqg_.js → agents-admin-api-BjGOUrAf.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B_MFhXXU.js → app-management-settings-panel-BZS8FvoL.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-TYGidVnd.js → appearance-settings-RxXMAxiB.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-mGU9WLjP.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BrFfEp0u.js → archive-plugin-DEnHq3OR.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-B7OofUPF.js → automations-page-BwkugzB8.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-K8aDhoYt.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BfAWnYG8.js → binary-plugins-NWeXhh1k.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-_Y-QwZ-3.js → block-editor-D_bKN3BN.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DH9QHI9m.js → browser-automation-inputs-vtPkXfJ8.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-DBPbwOG8.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-VBZDYoXD.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-pt2M56-E.js → capabilities-CTfLd_UE.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-CQsGp9Sx.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C_OMsW_8.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-CFVx3iaZ.js → capability-header-actions-CMJXWq8a.js} +1 -1
- package/dist/gateway/static/root/assets/channels-C_TVCc1N.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D3GuiG3N.js → chat-terminal-dock-9YRAokOl.js} +16 -16
- package/dist/gateway/static/root/assets/computer-settings-page-BPYAZ4ks.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-CDyCHkpK.js → connector-service-page-B81cEAEX.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C0NvAP2V.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-BvKP4P3n.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BVJh9sYc.js → dependency-picker-TvrNaf8y.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Q52A8vjp.js → desktop-pet-De-_QNSD.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CZr1CXxu.js → desktop-pet-settings-CRSRTIwT.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-D_WWTsze.js → device-pairing-wizard-DnyJ8Bja.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C6cUgrvg.js → directory-picker-path-field-DOPXwYNR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DyyfC4gA.js → extension-debug-page-DzXvpUwj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Dho9o3ZZ.js → extension-page-C0S1zNeP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CdnIGyCH.js → extension-settings-page-C3Z7bFjy.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BEePO3Wl.js → gateway-config-swr-Di9g6pE8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-Dng_VOvI.js → gateway-realtime-2-o7qk92.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQ6-whg-.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-Btc2wTQe.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CDCiy7Cd.js → gateway-startup-retry-BCUswcVy.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BNpj_mIM.js → highlighted-body-KQOG7T2V-BFYBbh1P.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-C5sLR47Q.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DwkO2y46.js → image-generation-api-Vqcyqnzb.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BrYvomnU.js → imports-page-BJGHrzhX.js} +1 -1
- package/dist/gateway/static/root/assets/index-BNRLzxpH.js +260 -0
- package/dist/gateway/static/root/assets/index-zIgp-ZTu.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BveDYfYk.js → keyboard-shortcuts-settings-BQkQoPmm.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DbxLz9Ms.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B1a69mlV.js → local-apps-page-CaatwSrK.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CYEDUPH7.js → local-session-drafts-BjwlkAKA.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CE7L6MlS.js → locale-store-Djl2FW6_.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-3Wo4Lmts.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-BHlbM8IM.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-PrKvVpRh.js → markdown-view-DyO7Q0Ms.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CR1fp6IL.js → media-plugins-Cq1uLrd8.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-XhlIBp5t.js +1 -0
- package/dist/gateway/static/root/assets/{messages-CaeL_miw.js → messages-DPxcWxfD.js} +2 -2
- package/dist/gateway/static/root/assets/note-detail-panel-MjKND8HC.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-Cv040hVD.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-Cn_WK68Y.js → page-context-capture-button-Cp71nTq2.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CyEUWV2n.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-3NbiWGRG.js → preview-open-alternatives-gzCecXc4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-KKE5-V8k.js → product-open-page-CWFT7VuQ.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-content-Dh111Kca.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-CyhyZiTi.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-QUdyJino.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BO2Ck3aA.js → registry-api-BwR2CiR5.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cd8P0Dxs.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-B1sb8nlw.js → runtime-tools-api-C_VOMhLI.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-W0X_Fy7b.js → runtime-tools-settings-panel-bTjVfYm5.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DNM2Zdyr.js → schema-form-BGOzfVyj.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CaAUJvu1.js → session-api-DbNNQps9.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DoFTlgNz.js → session-manager-DfVviLTK.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BGMemJF6.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BiySFw1N.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DCSHPFAN.js → settings-form-section-Bqm1IKvR.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B18UbbaJ.js → settings-page-CniJVL-o.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-JPs4-QRw.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BLnS3hoH.js → share-preview-page-BnDGFgBR.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Cgp5BuLt.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CcYGkRPL.js → skill-api-CFdrz6tl.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Cy5jVfms.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-CxaA3P5E.js +2 -0
- package/dist/gateway/static/root/assets/sliding-indicator-hwz0sx3h.js +1 -0
- package/dist/gateway/static/root/assets/{style-BQqU-1pP.js → style-C_MAnir7.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C974myUM.js → system-settings-panel-BjnIlilP.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-Bg79rPnF.js +2 -0
- package/dist/gateway/static/root/assets/{task-expandable-content-DTEVoNrM.js → task-expandable-content-D3i_51Oc.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-BCI0tUbe.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DWyI3uA3.js → tunnel-api-0knnta9z.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-D5aT1eie.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CY0YuljR.js → use-autosave-Ds_mbAfe.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-D7L0-pDt.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BNG4ixJE.js → voice-api-key-field-CPoGdarN.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D0Wscn9W.js → voice-config-api-Ceo_hqZC.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CohIoAre.js → work-discovery-overlay-CWNguy2Z.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BcDMFfkT.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-BwZB-s4N.js +6 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-C_COnY_B.js → xopc-cloud-account-card-DlKr98VO.js} +1 -1
- package/dist/gateway/static/root/index.html +16 -15
- package/dist/package.js +1 -1
- package/dist/src/agent/coding/run-verification.js +4 -4
- package/dist/src/agent/embedded/agent-profile-context.js +10 -4
- package/dist/src/agent/tools/exec-command.d.ts +2 -0
- package/dist/src/agent/tools/exec-command.js +45 -1
- package/dist/src/config/models-json.d.ts +16 -16
- package/dist/src/providers/cloud-thinking.d.ts +3 -0
- package/dist/src/providers/cloud-thinking.js +13 -0
- package/dist/src/providers/model-registry.js +3 -0
- package/dist/src/providers/register-runtime-providers.js +3 -0
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CPJr7NRR.js +0 -1
- package/dist/gateway/static/root/assets/agents-DW3TlnIg.js +0 -77
- package/dist/gateway/static/root/assets/apps-page-DOkyvOF0.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DIod-bfm.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-B_SnD9B0.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-BPlqYpMM.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-BtzZvMIK.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-WzoG3oBb.js +0 -8
- package/dist/gateway/static/root/assets/channels-BXA55GY2.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-CIbHDlp8.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DA2b6cJu.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-C424c_g9.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DtlBf7oH.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-D0KSQRNZ.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CH_A0W29.js +0 -2
- package/dist/gateway/static/root/assets/index-CKdOZoVu.js +0 -260
- package/dist/gateway/static/root/assets/index-Rxjt-jc3.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CcIi1BhT.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-Us1jv3C4.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-C9RAM7-s.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DQdcaMiu.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-Q4yRx9iZ.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-C9qu16IN.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-DrP6hEcg.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-BM0oqNxi.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CPZrwf8n.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Besfx_07.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CTDghL5L.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Dxtablvd.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C7zklouD.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-JoSfluza.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DcIuPJK3.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-PnUZjoPK.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D3JAw62U.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-CiljFekC.js +0 -2
- package/dist/gateway/static/root/assets/tracing-settings-page-DEE75MUn.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-DJYvbxk7.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-eHZJD6Fw.js +0 -2
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BXI8eyYh.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-CVti0u-l.js +0 -6
|
@@ -1,6 +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,g as a,t as o}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as s}from"./check-DUBLcKHA.js";import{t as c}from"./circle-check-C23XjkUj.js";import{t as l}from"./ellipsis-0k4rZLoy.js";import{t as u}from"./markdown-view-PrKvVpRh.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-CaeL_miw.js";import{t as m}from"./cn-0WouolD0.js";import{n as h}from"./locale-store-CE7L6MlS.js";import{a as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{i as S}from"./vendor-swr-BIWyz7Rc.js";import{$n as C,Ai as w,Cs as T,Es as E,Gl as D,Hc as O,Ic as k,Jl as A,Kd as j,Lu as M,Of as ee,Ol as N,Qi as te,Rn as P,So as F,Ss as I,Ts as L,Ul as ne,Uo as re,Wu as ie,Ya as ae,af as R,au as oe,bd as se,bu as z,er as ce,eu as le,gl as B,hs as ue,if as de,ir as fe,l as V,lf as H,ls as U,ms as W,nr as pe,oo as me,ps as he,pu as G,sf as ge,tr as _e,us as K,v as ve,vu as ye,ws as be}from"./index-CKdOZoVu.js";import{a as xe,c as Se,i as Ce,l as we,n as Te,o as Ee,r as q,s as De,t as Oe}from"./automation-display-DCkjVzA0.js";import{i as ke,n as Ae,r as J,s as je,t as Me}from"./workflow-run-setup-panel-BXI8eyYh.js";import{i as Ne,n as Pe,r as Fe,t as Ie}from"./browser-automation-inputs-DH9QHI9m.js";var Le=n(),Y=e(t(),1),X=r(),Re=Array.from({length:24},(e,t)=>t);function ze(e){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hour:n,minute:r}}function Be(){let e=new Date;return{hour:e.getHours(),minute:e.getMinutes()}}function Ve(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function He(e){let t=(0,Le.c)(80),{value:n,onChange:r,disabled:i,allowEmpty:a,clearLabel:o,ariaLabel:c,ariaLabelledBy:l,className:u,triggerClassName:d,id:p,name:h,minuteStep:g}=e,_=a===void 0?!1:a,v=g===void 0?1:g,y=ze(n),b=y??Be(),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(null),[T,D]=(0,Y.useState)(b.hour),[O,k]=(0,Y.useState)(b.minute),A=(0,Y.useRef)([]),M=(0,Y.useRef)([]),ee=W(),N=he(C),te=ue(ee,N!==null),P=Math.max(1,Math.min(60,Math.round(v))),F=Array.from({length:Math.ceil(60/P)},(e,t)=>t*P).filter(We),I;t[0]===r?I=t[1]:(I=(e,t,n)=>{let i=n===void 0?!1:n;D(e),k(t),r(Ve(e,t)),i&&S(!1)},t[0]=r,t[1]=I);let ne=I,re=Ue,ie;t[2]===u?ie=t[3]:(ie=m(`relative min-w-0`,u),t[2]=u,t[3]=ie);let ae=E,R;t[4]===n?R=t[5]:(R=e=>{if(e){let e=ze(n)??Be();D(e.hour),k(e.minute)}S(e)},t[4]=n,t[5]=R);let oe=_&&n&&`pr-9`,se=i&&`cursor-not-allowed opacity-50 hover:border-edge`,z;t[6]!==oe||t[7]!==se||t[8]!==d?(z=m(`box-border flex h-10 w-full min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 text-left text-sm text-fg`,`transition-colors hover:border-edge-strong focus-visible:border-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/20`,oe,se,d),t[6]=oe,t[7]=se,t[8]=d,t[9]=z):z=t[9];let ce;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,X.jsx)(j,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`}),t[10]=ce):ce=t[10];let le=!y&&`text-fg-subtle`,B;t[11]===le?B=t[12]:(B=m(`tabular-nums`,le),t[11]=le,t[12]=B);let de=y?Ve(y.hour,y.minute):`--:--`,fe;t[13]!==B||t[14]!==de?(fe=(0,X.jsx)(`span`,{className:B,children:de}),t[13]=B,t[14]=de,t[15]=fe):fe=t[15];let V;t[16]!==c||t[17]!==l||t[18]!==i||t[19]!==p||t[20]!==fe||t[21]!==z?(V=(0,X.jsx)(L,{asChild:!0,children:(0,X.jsxs)(`button`,{ref:w,id:p,type:`button`,disabled:i,"aria-label":c,"aria-labelledby":l,"aria-haspopup":`listbox`,className:z,children:[ce,fe]})}),t[16]=c,t[17]=l,t[18]=i,t[19]=p,t[20]=fe,t[21]=z,t[22]=V):V=t[22];let H=E,U=N??void 0,pe=E,me=m(te,`w-[18rem] overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`),G=e=>{e.preventDefault(),requestAnimationFrame(()=>A.current[T]?.focus())},ge;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,X.jsx)(j,{className:`size-3.5`,"aria-hidden":`true`}),t[23]=ge):ge=t[23];let _e=c??`HH:mm`,K;t[24]===_e?K=t[25]:(K=(0,X.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[ge,_e]}),t[24]=_e,t[25]=K);let ve;t[26]!==T||t[27]!==O?(ve=Ve(T,O),t[26]=T,t[27]=O,t[28]=ve):ve=t[28];let ye;t[29]===ve?ye=t[30]:(ye=(0,X.jsx)(`span`,{className:`font-mono text-base font-semibold tabular-nums text-fg`,children:ve}),t[29]=ve,t[30]=ye);let be;t[31]!==K||t[32]!==ye?(be=(0,X.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle bg-surface-inset px-3 py-2.5`,children:[K,ye]}),t[31]=K,t[32]=ye,t[33]=be):be=t[33];let xe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,X.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`HH`}),t[34]=xe):xe=t[34];let Se=`${c??`HH:mm`} HH`,Ce=Re.map((e,t)=>(0,X.jsx)(`button`,{ref:e=>{A.current[t]=e},type:`button`,role:`option`,"aria-selected":T===e,tabIndex:T===e?0:-1,className:m(`relative flex h-8 items-center justify-center rounded-md text-xs tabular-nums text-fg-muted transition-colors`,`hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,T===e&&`bg-accent-soft font-semibold text-accent-fg`),onClick:()=>ne(e,O),onKeyDown:e=>re(e,Re,T,e=>ne(e,O),A),children:String(e).padStart(2,`0`)},e)),we;t[35]!==Se||t[36]!==Ce?(we=(0,X.jsxs)(`div`,{className:`pr-2`,children:[xe,(0,X.jsx)(`div`,{role:`listbox`,"aria-label":Se,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:Ce})]}),t[35]=Se,t[36]=Ce,t[37]=we):we=t[37];let Te;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,X.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`MM`}),t[38]=Te):Te=t[38];let Ee=`${c??`HH:mm`} MM`,q=F.map((e,t)=>(0,X.jsxs)(`button`,{ref:e=>{M.current[t]=e},type:`button`,role:`option`,"aria-selected":O===e,tabIndex:O===e?0:-1,className:m(`relative flex h-8 items-center justify-center rounded-md text-xs tabular-nums text-fg-muted transition-colors`,`hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,O===e&&`bg-accent-soft font-semibold text-accent-fg`),onClick:()=>ne(T,e,!0),onKeyDown:e=>re(e,F,O,e=>ne(T,e),M),children:[(0,X.jsx)(s,{className:m(`absolute left-0.5 size-3`,O!==e&&`invisible`),"aria-hidden":`true`}),String(e).padStart(2,`0`)]},e)),De;t[39]!==Ee||t[40]!==q?(De=(0,X.jsx)(`div`,{role:`listbox`,"aria-label":Ee,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:q}),t[39]=Ee,t[40]=q,t[41]=De):De=t[41];let Oe;t[42]!==Te||t[43]!==De?(Oe=(0,X.jsxs)(`div`,{className:`pl-2`,children:[Te,De]}),t[42]=Te,t[43]=De,t[44]=Oe):Oe=t[44];let ke;t[45]!==we||t[46]!==Oe?(ke=(0,X.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-edge-subtle p-2`,children:[we,Oe]}),t[45]=we,t[46]=Oe,t[47]=ke):ke=t[47];let Ae;t[48]!==pe.Content||t[49]!==me||t[50]!==G||t[51]!==be||t[52]!==ke?(Ae=(0,X.jsxs)(pe.Content,{side:`bottom`,align:`start`,sideOffset:6,collisionPadding:12,className:me,onOpenAutoFocus:G,children:[be,ke]}),t[48]=pe.Content,t[49]=me,t[50]=G,t[51]=be,t[52]=ke,t[53]=Ae):Ae=t[53];let J;t[54]!==H.Portal||t[55]!==U||t[56]!==Ae?(J=(0,X.jsx)(H.Portal,{container:U,children:Ae}),t[54]=H.Portal,t[55]=U,t[56]=Ae,t[57]=J):J=t[57];let je;t[58]!==x||t[59]!==V||t[60]!==J||t[61]!==ae.Root||t[62]!==R?(je=(0,X.jsxs)(ae.Root,{open:x,onOpenChange:R,children:[V,J]}),t[58]=x,t[59]=V,t[60]=J,t[61]=ae.Root,t[62]=R,t[63]=je):je=t[63];let Me;t[64]!==_||t[65]!==c||t[66]!==o||t[67]!==i||t[68]!==r||t[69]!==n?(Me=_&&n?(0,X.jsx)(`button`,{type:`button`,disabled:i,"aria-label":o??c,title:o,className:`absolute right-1.5 top-1/2 flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30 disabled:pointer-events-none`,onClick:()=>r(``),children:(0,X.jsx)(f,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[64]=_,t[65]=c,t[66]=o,t[67]=i,t[68]=r,t[69]=n,t[70]=Me):Me=t[70];let Ne;t[71]!==i||t[72]!==h||t[73]!==n?(Ne=h?(0,X.jsx)(`input`,{type:`hidden`,name:h,value:n,disabled:i}):null,t[71]=i,t[72]=h,t[73]=n,t[74]=Ne):Ne=t[74];let Pe;return t[75]!==ie||t[76]!==je||t[77]!==Me||t[78]!==Ne?(Pe=(0,X.jsxs)(`div`,{className:ie,children:[je,Me,Ne]}),t[75]=ie,t[76]=je,t[77]=Me,t[78]=Ne,t[79]=Pe):Pe=t[79],Pe}function Ue(e,t,n,r,i){let a=null,o=Math.max(0,t.indexOf(n));if((e.key===`ArrowDown`||e.key===`ArrowRight`)&&(a=(o+1)%t.length),(e.key===`ArrowUp`||e.key===`ArrowLeft`)&&(a=(o-1+t.length)%t.length),e.key===`Home`&&(a=0),e.key===`End`&&(a=t.length-1),a===null)return;e.preventDefault();let s=t[a];r(s),i.current?.[a]?.focus()}function We(e){return e<60}function Ge(e){return e.management!==void 0}var Ke={name:``,description:``,projectId:``,triggerMode:`daily`,time:`09:00`,weekday:`1`,intervalValue:`1`,intervalUnit:`hour`,cronExpr:`0 9 * * *`,webhookSecretId:``,onceAt:``,eventType:``,eventSource:``,eventPayloadMatch:``,actionMode:`agent`,agentId:``,model:``,instruction:``,taskId:``,workflowId:``,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0,browserAutomationId:``,browserAutomationInputs:{},safetyMode:`suggest_only`,timeoutSeconds:`1800`,conversationMode:`new_session`,notificationPolicy:`attention`,resultWebhookEndpoint:``,resultWebhookSecretId:``,disableAfterFailures:`3`},qe=[{value:`15`,unit:`minute`},{value:`30`,unit:`minute`},{value:`1`,unit:`hour`},{value:`6`,unit:`hour`},{value:`24`,unit:`hour`}];function Je(e,t){let[n,r]=e.time.split(`:`),i=Number.parseInt(n||`9`,10),a=Number.parseInt(r||`0`,10),o;if(e.triggerMode===`manual`)o={kind:`manual`};else if(e.triggerMode===`once`)o={kind:`schedule`,schedule:{kind:`once`,at:new Date(e.onceAt).toISOString()}};else if(e.triggerMode===`webhook`)o={kind:`webhook`,...e.webhookSecretId.trim()?{secretId:e.webhookSecretId.trim()}:{}};else if(e.triggerMode===`taskBlocked`)o={kind:`event`,eventType:`task.attention_required.v2`,source:`tasks`,payloadMatch:{reason:`blocked`}};else if(e.triggerMode===`noteCreated`)o={kind:`event`,eventType:`note.created`,source:`notes`};else if(e.triggerMode===`workflowFailed`)o={kind:`event`,eventType:`workflow.run.completed`,source:`workflows`,payloadMatch:{status:`failed`}};else if(e.triggerMode===`sessionUpdated`)o={kind:`event`,eventType:`session.transcript.updated`,source:`sessions`};else if(e.triggerMode===`event`){let t=e.eventPayloadMatch.trim()?JSON.parse(e.eventPayloadMatch):void 0;o={kind:`event`,eventType:e.eventType.trim(),...e.eventSource.trim()?{source:e.eventSource.trim()}:{},...t?{payloadMatch:t}:{}}}else o=e.triggerMode===`interval`?{kind:`schedule`,schedule:{kind:`interval`,everyMs:Oe(e.intervalValue,e.intervalUnit)}}:e.triggerMode===`weekly`?{kind:`schedule`,schedule:{kind:`cron`,expr:`${a} ${i} * * ${e.weekday}`}}:e.triggerMode===`cron`?{kind:`schedule`,schedule:{kind:`cron`,expr:e.cronExpr.trim()}}:{kind:`schedule`,schedule:{kind:`cron`,expr:`${a} ${i} * * *`}};let s=J(t,e.workflowInput),c=e.workflowInput.goal.trim()||e.workflowGoal.trim(),l=e.actionMode===`browser_automation`||e.actionMode===`task_command`?`auto_apply`:e.safetyMode,u;return u=e.actionMode===`workflow`?{kind:`workflow`,workflowId:e.workflowId.trim(),...e.agentId.trim()?{agentId:e.agentId.trim()}:{},...s===void 0?{}:{input:s},...c?{goal:c}:{},...e.workflowInput.concurrency.trim()?{concurrency:Math.max(1,Number.parseInt(e.workflowInput.concurrency,10)||1)}:{},...e.workflowInput.maxSubagents.trim()?{maxSubagents:Math.max(1,Number.parseInt(e.workflowInput.maxSubagents,10)||1)}:{}}:e.actionMode===`browser_automation`?{kind:`browser_automation`,automationId:e.browserAutomationId.trim(),inputs:e.browserAutomationInputs}:e.actionMode===`task_command`?{kind:`task_command`,taskId:e.taskId.trim(),command:{type:`start`,executor:{kind:`agent`,agentId:e.agentId.trim()}}}:{kind:`agent`,instruction:e.instruction.trim(),...e.agentId.trim()?{agentId:e.agentId.trim()}:{},...e.model.trim()?{model:e.model.trim()}:{}},{name:e.name.trim(),...e.description.trim()?{description:e.description.trim()}:{},...e.projectId.trim()?{projectId:e.projectId.trim()}:{},trigger:o,action:u,safety:{mode:l},conversationMode:e.conversationMode,delivery:{notificationPolicy:e.notificationPolicy,destinations:[{key:`gateway_event`,kind:`gateway_event`},...e.resultWebhookEndpoint.trim()&&e.resultWebhookSecretId.trim()?[{key:`result_webhook`,kind:`webhook`,endpoint:e.resultWebhookEndpoint.trim(),secretId:e.resultWebhookSecretId.trim()}]:[]]},reliability:{executionTimeoutSeconds:Math.max(1,Number.parseInt(e.timeoutSeconds,10)||1800),disableAfterConsecutiveFailures:Math.max(1,Number.parseInt(e.disableAfterFailures,10)||3)}}}function Ye(e){let t=e.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+\*$/);if(t)return{triggerMode:`daily`,time:`${t[2].padStart(2,`0`)}:${t[1].padStart(2,`0`)}`,weekday:`1`,cronExpr:e};let n=e.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+([0-6])$/);return n?{triggerMode:`weekly`,time:`${n[2].padStart(2,`0`)}:${n[1].padStart(2,`0`)}`,weekday:n[3],cronExpr:e}:{triggerMode:`cron`,time:Ke.time,weekday:Ke.weekday,cronExpr:e}}function Xe(e){let t=[[`week`,10080*6e4],[`day`,1440*6e4],[`hour`,60*6e4],[`minute`,6e4]],[n,r]=t.find(([,t])=>e>=t&&e%t===0)??t.at(-1);return{intervalValue:String(e/r),intervalUnit:n}}function Ze(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=t.getTimezoneOffset()*6e4;return new Date(t.getTime()-n).toISOString().slice(0,16)}function Z(e){let t=e.payloadMatch;return e.eventType===`task.attention_required.v2`&&e.source===`tasks`&&t?.reason===`blocked`?{triggerMode:`taskBlocked`}:e.eventType===`note.created`&&e.source===`notes`&&!t?{triggerMode:`noteCreated`}:e.eventType===`workflow.run.completed`&&e.source===`workflows`&&t?.status===`failed`?{triggerMode:`workflowFailed`}:e.eventType===`session.transcript.updated`&&e.source===`sessions`&&!t?{triggerMode:`sessionUpdated`}:{triggerMode:`event`,eventType:e.eventType,eventSource:e.source??``,eventPayloadMatch:t?JSON.stringify(t,null,2):``}}function Qe(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function $e(e){if(!e.trim())return!0;try{let t=JSON.parse(e);return!!t&&typeof t==`object`&&!Array.isArray(t)&&Object.values(t).every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))}catch{return!1}}function et(e,t=[]){let n={triggerMode:`manual`};if(e.trigger.kind===`webhook`)n={triggerMode:`webhook`,webhookSecretId:e.trigger.secretId??``};else if(e.trigger.kind===`event`)n=Z(e.trigger);else if(e.trigger.kind===`schedule`){let t=e.trigger.schedule;t.kind===`cron`&&(n=Ye(t.expr)),t.kind===`interval`&&(n={triggerMode:`interval`,...Xe(t.everyMs)}),t.kind===`once`&&(n={triggerMode:`once`,onceAt:Ze(t.at)})}let r=e.action,i=r.kind===`workflow`?t.find(e=>e.id===r.workflowId)??null:null,a=r.kind===`workflow`?Qe(r.input):{},o=e.reliability?.executionTimeoutSeconds??(`timeoutSeconds`in r?r.timeoutSeconds:void 0)??(r.kind===`browser_automation`?600:1800);return{...Ke,...n,name:e.name,description:e.description??``,projectId:e.projectId??``,actionMode:r.kind===`system`?`agent`:r.kind,agentId:r.kind===`agent`||r.kind===`workflow`?r.agentId??``:r.kind===`task_command`&&r.command.type===`start`&&r.command.executor.kind===`agent`?r.command.executor.agentId:``,model:r.kind===`agent`?r.model??``:``,instruction:r.kind===`agent`?r.instruction:``,taskId:r.kind===`task_command`?r.taskId:``,workflowId:r.kind===`workflow`?r.workflowId:``,workflowGoal:r.kind===`workflow`?r.goal??``:``,browserAutomationId:r.kind===`browser_automation`?r.automationId:``,browserAutomationInputs:r.kind===`browser_automation`?r.inputs??{}:{},workflowInput:{goal:r.kind===`workflow`?r.goal??``:``,argValues:i?Ae(i.name,a):{},schemaInput:a,concurrency:r.kind===`workflow`&&r.concurrency?String(r.concurrency):``,maxSubagents:r.kind===`workflow`&&r.maxSubagents?String(r.maxSubagents):``},workflowInputValid:!0,safetyMode:e.safety?.mode??`auto_apply`,timeoutSeconds:String(o),conversationMode:e.conversationMode??`new_session`,notificationPolicy:e.delivery.notificationPolicy,resultWebhookEndpoint:e.delivery.destinations.find(e=>e.kind===`webhook`)?.endpoint??``,resultWebhookSecretId:e.delivery.destinations.find(e=>e.kind===`webhook`)?.secretId??``,disableAfterFailures:String(e.reliability?.disableAfterConsecutiveFailures??3)}}function tt(e,t,n){let r=Je(t,n),i=e.trigger.kind===`schedule`&&r.trigger.kind===`schedule`&&e.trigger.schedule.kind===r.trigger.schedule.kind?{...r.trigger,schedule:{...e.trigger.schedule,...r.trigger.schedule}}:r.trigger,a=r.action;e.action.kind===`agent`&&r.action.kind===`agent`?a={...e.action,...r.action,agentId:r.action.agentId,model:r.action.model}:e.action.kind===`workflow`&&r.action.kind===`workflow`?a={...e.action,...r.action,agentId:r.action.agentId,input:r.action.input,goal:r.action.goal,concurrency:r.action.concurrency,maxSubagents:r.action.maxSubagents}:e.action.kind===`browser_automation`&&r.action.kind===`browser_automation`?a={...e.action,...r.action}:e.action.kind===`task_command`&&r.action.kind===`task_command`&&(a=r.action);let o=e.delivery.destinations.filter(e=>e.kind===`gateway_event`),s=e.delivery.destinations.filter(e=>e.kind===`webhook`);return{...r,description:t.description.trim(),projectId:t.projectId.trim(),delivery:{notificationPolicy:t.notificationPolicy,destinations:[...o.length>0?o:[{key:`gateway_event`,kind:`gateway_event`}],...e.delivery.destinations.filter(e=>e.kind===`file`||e.kind===`card`),...s.slice(1),...t.resultWebhookEndpoint.trim()&&t.resultWebhookSecretId.trim()?[{key:s[0]?.key??`result_webhook`,kind:`webhook`,endpoint:t.resultWebhookEndpoint.trim(),secretId:t.resultWebhookSecretId.trim()}]:[]]},trigger:i,action:a,reliability:{...e.reliability,...r.reliability}}}function nt(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...Ke,name:n.name,instruction:t===`reminder`?``:n.instruction,triggerMode:t===`reminder`?`once`:t===`review`?`weekly`:`daily`,time:t===`brief`?`08:30`:t===`review`?`17:00`:`09:00`,weekday:`5`,notificationPolicy:`all`}}})}var rt=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-2 focus-visible:outline-accent`;function it(e){let t=(0,Le.c)(99),{form:n,setForm:r,labels:i,projects:a,projectLocked:o,source:s,requiresProject:c}=e,l;t[0]===r?l=t[1]:(l=e=>r(t=>({...t,...e})),t[0]=r,t[1]=l);let u=l,d;t[2]!==i.experience.source||t[3]!==s?(d=(0,X.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i.experience.source,`: `,s]}),t[2]=i.experience.source,t[3]=s,t[4]=d):d=t[4];let f;t[5]===u?f=t[6]:(f=e=>u({name:e.target.value}),t[5]=u,t[6]=f);let p;t[7]!==n.name||t[8]!==f?(p=(0,X.jsx)(`input`,{className:rt,value:n.name,onChange:f}),t[7]=n.name,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==i.form.name||t[11]!==p?(m=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.name,p]}),t[10]=i.form.name,t[11]=p,t[12]=m):m=t[12];let h;t[13]===u?h=t[14]:(h=e=>u({instruction:e.target.value}),t[13]=u,t[14]=h);let g;t[15]!==n.instruction||t[16]!==h?(g=(0,X.jsx)(`textarea`,{className:rt,rows:5,value:n.instruction,onChange:h}),t[15]=n.instruction,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.info.task||t[19]!==g?(_=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.info.task,g]}),t[18]=i.info.task,t[19]=g,t[20]=_):_=t[20];let v;t[21]!==n.projectId||t[22]!==i.form.noProject||t[23]!==i.form.project||t[24]!==o||t[25]!==a||t[26]!==u?(v=!o&&(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,X.jsxs)(U,{className:rt,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,X.jsx)(K,{value:``,children:i.form.noProject}),a.map(at)]})]}),t[21]=n.projectId,t[22]=i.form.noProject,t[23]=i.form.project,t[24]=o,t[25]=a,t[26]=u,t[27]=v):v=t[27];let y;t[28]!==n.projectId||t[29]!==i.experience.projectRequired||t[30]!==c?(y=c&&!n.projectId?(0,X.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:i.experience.projectRequired}):null,t[28]=n.projectId,t[29]=i.experience.projectRequired,t[30]=c,t[31]=y):y=t[31];let b;t[32]===u?b=t[33]:(b=e=>u({triggerMode:e.target.value}),t[32]=u,t[33]=b);let x;t[34]===i.trigger.once?x=t[35]:(x=(0,X.jsx)(K,{value:`once`,children:i.trigger.once}),t[34]=i.trigger.once,t[35]=x);let S;t[36]===i.trigger.daily?S=t[37]:(S=(0,X.jsx)(K,{value:`daily`,children:i.trigger.daily}),t[36]=i.trigger.daily,t[37]=S);let C;t[38]===i.trigger.weekly?C=t[39]:(C=(0,X.jsx)(K,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=C);let w;t[40]!==n.triggerMode||t[41]!==b||t[42]!==x||t[43]!==S||t[44]!==C?(w=(0,X.jsxs)(U,{className:rt,value:n.triggerMode,onChange:b,children:[x,S,C]}),t[40]=n.triggerMode,t[41]=b,t[42]=x,t[43]=S,t[44]=C,t[45]=w):w=t[45];let T;t[46]!==i.form.trigger||t[47]!==w?(T=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,w]}),t[46]=i.form.trigger,t[47]=w,t[48]=T):T=t[48];let E;t[49]!==n.onceAt||t[50]!==n.time||t[51]!==n.triggerMode||t[52]!==i.form.onceAt||t[53]!==i.form.time||t[54]!==u?(E=n.triggerMode===`once`?(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.onceAt,(0,X.jsx)(`input`,{type:`datetime-local`,className:rt,value:n.onceAt,onChange:e=>u({onceAt:e.target.value})})]}):(0,X.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,X.jsx)(`span`,{children:i.form.time}),(0,X.jsx)(He,{value:n.time,onChange:e=>u({time:e}),ariaLabel:i.form.time})]}),t[49]=n.onceAt,t[50]=n.time,t[51]=n.triggerMode,t[52]=i.form.onceAt,t[53]=i.form.time,t[54]=u,t[55]=E):E=t[55];let D;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(D=n.triggerMode===`weekly`&&(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,X.jsx)(U,{className:rt,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,X.jsx)(K,{value:String(t),children:i.weekdays[e]},e))})]}),t[56]=n.triggerMode,t[57]=n.weekday,t[58]=i.form.day,t[59]=i.weekdays,t[60]=u,t[61]=D):D=t[61];let O;t[62]!==T||t[63]!==E||t[64]!==D?(O=(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[T,E,D]}),t[62]=T,t[63]=E,t[64]=D,t[65]=O):O=t[65];let k;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(k=n.triggerMode===`once`&&n.onceAt&&new Date(n.onceAt).getTime()<=Date.now()?(0,X.jsx)(`p`,{role:`status`,className:`text-sm text-red-700 dark:text-red-300`,children:i.experience.futureTime}):null,t[66]=n.onceAt,t[67]=n.triggerMode,t[68]=i.experience.futureTime,t[69]=k):k=t[69];let A;t[70]===i.experience.scheduleNote?A=t[71]:(A=(0,X.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=A);let j;t[72]===u?j=t[73]:(j=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=j);let M;t[74]===i.draft.notifyAll?M=t[75]:(M=(0,X.jsx)(K,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=M);let ee;t[76]===i.draft.notifyAttention?ee=t[77]:(ee=(0,X.jsx)(K,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=ee);let N;t[78]===i.draft.notifyNone?N=t[79]:(N=(0,X.jsx)(K,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=N);let te;t[80]!==n.notificationPolicy||t[81]!==j||t[82]!==M||t[83]!==ee||t[84]!==N?(te=(0,X.jsxs)(U,{className:rt,value:n.notificationPolicy,onChange:j,children:[M,ee,N]}),t[80]=n.notificationPolicy,t[81]=j,t[82]=M,t[83]=ee,t[84]=N,t[85]=te):te=t[85];let P;t[86]!==i.draft.notifications||t[87]!==te?(P=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,te]}),t[86]=i.draft.notifications,t[87]=te,t[88]=P):P=t[88];let F;return t[89]!==y||t[90]!==O||t[91]!==d||t[92]!==k||t[93]!==A||t[94]!==P||t[95]!==m||t[96]!==_||t[97]!==v?(F=(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[d,m,_,v,y,O,k,A,P]}),t[89]=y,t[90]=O,t[91]=d,t[92]=k,t[93]=A,t[94]=P,t[95]=m,t[96]=_,t[97]=v,t[98]=F):F=t[98],F}function at(e){return(0,X.jsx)(K,{value:e.id,children:e.name},e.id)}function ot(e,t){let n=new URLSearchParams({draft:e.trim()}),r=t?.trim();return r?n.set(`projectId`,r):n.set(`projectScope`,`none`),`/chat/new?${n.toString()}`}function st(e,t){return t.reduce((t,n)=>n.automationId===e&&(!t||n.createdAtMs>t.createdAtMs)?n:t,void 0)}function ct(e,t){let n=st(e.id,t),r=!!(e.state.lastRunAtMs&&(!n||e.state.lastRunAtMs>n.createdAtMs)),i=r?e.state.lastRunStatus:n?.status??e.state.lastRunStatus;return i!==`failed`&&i!==`timeout`?null:`${i}:${(r?e.state.lastRunAtMs:n?.createdAtMs??e.state.lastRunAtMs)??`unknown`}`}function lt(e,t){return ct(e,t)!==null}var ut=`xopc.automations.dismissedExecutionIssues`;function dt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(ut)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function ft(e,t,n){return e?Ee(e,n):t.never}function pt(e,t){return e.kind===`system`?e.capability===`home.advisor.refresh`?`Home AI suggestions refresh`:e.capability===`memory.temporal_sweep`?`Memory temporal sweep`:e.capability===`memory.daily_reconciliation`?`Memory daily reconciliation`:`Memory weekly knowledge maintenance`:e.kind===`workflow`?t.action.workflowWithId.replace(`{id}`,e.workflowId):e.kind===`browser_automation`?`Browser automation: ${e.automationId}`:e.kind===`task_command`?t.action.taskWithId.replace(`{id}`,e.taskId):e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function mt(e,t){return e.kind===`system`?`System`:e.kind===`workflow`?t.sources.workflow:e.kind===`browser_automation`?t.sources.browser:e.kind===`task_command`?t.sources.task:t.sources.agent}function ht(e,t){return e===`workflow`?t.action.runWorkflow:e===`browser_automation`?t.sources.browser:e===`task_command`?t.action.runTask:t.action.runAgent}function gt(e,t){return e===`cron`?t.trigger.customCron:e===`event`?t.trigger.customEvent:t.trigger[e]}function _t(e){let t=(0,Le.c)(10),{kind:n,className:r}=e;if(n===`system`){let e;return t[0]===r?e=t[1]:(e=(0,X.jsx)(B,{className:r,"aria-hidden":!0}),t[0]=r,t[1]=e),e}if(n===`workflow`){let e;return t[2]===r?e=t[3]:(e=(0,X.jsx)(se,{className:r,"aria-hidden":!0}),t[2]=r,t[3]=e),e}if(n===`browser_automation`){let e;return t[4]===r?e=t[5]:(e=(0,X.jsx)(ie,{className:r,"aria-hidden":!0}),t[4]=r,t[5]=e),e}if(n===`task_command`){let e;return t[6]===r?e=t[7]:(e=(0,X.jsx)(c,{className:r,"aria-hidden":!0}),t[6]=r,t[7]=e),e}let i;return t[8]===r?i=t[9]:(i=(0,X.jsx)(ne,{className:r,"aria-hidden":!0}),t[8]=r,t[9]=i),i}function vt(e){return e.safety?.mode??`auto_apply`}function yt(e){return e===`succeeded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`failed`||e===`timeout`?`bg-red-500/10 text-red-700 dark:text-red-300`:e===`running`||e===`queued`||e===`cancelling`?`bg-blue-500/10 text-blue-700 dark:text-blue-300`:`bg-surface-hover text-fg-muted`}function bt(e,t){if(e==null)return t.never;if(e<1e3)return`${e}ms`;let n=Math.round(e/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`}function xt(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function St(e){return e.status===`failed`||e.status===`timeout`}function Ct(e,t){return e.action.kind===`system`?pt(e.action,t):e.action.kind===`agent`?e.action.instruction:e.action.kind===`workflow`?e.action.goal?.trim()||pt(e.action,t):(e.action.kind,pt(e.action,t))}function wt(e){return e.description?.trim()??``}function Tt(e){return xt(e)?0:St(e)?1:e.status===`succeeded`?2:3}function Et(e){return[...e].sort((e,t)=>{let n=Tt(e)-Tt(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function Dt(){let e=(0,Le.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`section`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:Array.from({length:4}).map(kt)}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,X.jsx)(k,{className:`h-4 w-36`}),(0,X.jsx)(k,{className:`h-3 w-56 max-w-full`})]}),(0,X.jsx)(k,{className:`h-7 w-20 rounded-full`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:[n,(0,X.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(Ot)})]}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(k,{className:`h-4 w-32`}),a=(0,X.jsx)(k,{className:`mt-4 h-24 rounded-lg`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsxs)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:[t,(0,X.jsxs)(`div`,{className:`grid min-h-0 items-start gap-4 xl:grid-cols-[minmax(18rem,0.8fr)_minmax(0,1.5fr)]`,children:[r,(0,X.jsxs)(`section`,{className:`hidden rounded-xl bg-surface-panel p-4 shadow-surface xl:block`,children:[i,a,(0,X.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,X.jsx)(k,{className:`h-12 rounded-lg`}),(0,X.jsx)(k,{className:`h-12 rounded-lg`}),(0,X.jsx)(k,{className:`h-12 rounded-lg`})]})]})]})]}),e[5]=o):o=e[5],o}function Ot(e,t){return(0,X.jsx)(`div`,{className:`rounded-lg bg-surface-base p-3`,children:(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(k,{className:`size-4 rounded-full`}),(0,X.jsx)(k,{className:`h-4 w-32`}),(0,X.jsx)(k,{className:`h-5 w-20 rounded-full`})]}),(0,X.jsx)(k,{className:`mt-3 h-4 w-full`}),(0,X.jsx)(k,{className:`mt-2 h-4 w-3/5`})]}),(0,X.jsx)(k,{className:`h-8 w-24 rounded-md`})]})},t)}function kt(e,t){return(0,X.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2.5 bg-surface-base px-3 py-2.5`,children:[(0,X.jsx)(k,{className:`size-4 rounded-full`}),(0,X.jsx)(k,{className:`h-3 w-14`}),(0,X.jsx)(k,{className:`ml-auto h-4 w-10`})]},t)}function At({projectId:e,embedded:t=!1,title:n,subtitle:r}){let o=h(e=>e.language),s=p(o),l=s.automations,u=s.productNavigation.sections[`automation-triggers`],w=s.cron,E=re(e=>e.setPageHeader),k=re(e=>e.clearPageHeader),A=i(),[j,N]=a(),te=!t&&j.get(`view`)===`activity`,P=j.get(`run`)?.trim()??``,R=j.get(`automation`)?.trim()??``,z=j.get(`draft`)?.trim()??``,ue=j.get(`action`)?.trim()??``,W=j.get(`taskId`)?.trim()??``,he=j.get(`projectId`)?.trim()??``,G=e?.trim()||he,xe=!!e?.trim(),Se=j.get(`autogenerate`)===`1`,Te=(0,Y.useRef)(``),Ee=j.get(`status`),q=Ee===`active`||Ee===`paused`||Ee===`running`||Ee===`attention`?Ee:`all`,De=j.get(`ownership`)===`system`?`system`:`user`,Ae=j.get(`source`),J=Ae===`agent`||Ae===`workflow`||Ae===`task_command`||Ae===`browser_automation`?Ae:`all`,je=j.get(`q`)??``,Me=e=>N(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),Fe=e=>N(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),Ie=e=>N(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),Le=e=>N(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`source`):n.set(`source`,e),n.delete(`automation`),n}),Re=()=>N(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.delete(`automation`),t}),[ze,Be]=(0,Y.useState)(null),[Ve,He]=(0,Y.useState)(!1),[Ue,We]=(0,Y.useState)(`blank`),[qe,Ye]=(0,Y.useState)(null),[Xe,Ze]=(0,Y.useState)(!1),[Z,Qe]=(0,Y.useState)(Ke),[rt,at]=(0,Y.useState)(null),[ft,pt]=(0,Y.useState)(null),[mt,ht]=(0,Y.useState)(!1),[gt,_t]=(0,Y.useState)(null),[vt,yt]=(0,Y.useState)(``),[bt,St]=(0,Y.useState)(null),[Tt,Ot]=(0,Y.useState)(!1),[kt,At]=(0,Y.useState)(!1),[Pt,Ft]=(0,Y.useState)(G),[It,Bt]=(0,Y.useState)(`new_session`),[Vt,Ht]=(0,Y.useState)(`attention`),[Ut,Kt]=(0,Y.useState)(null),[qt,Jt]=(0,Y.useState)(!1),[Yt,Xt]=(0,Y.useState)(!1),[Zt,Qt]=(0,Y.useState)(!1),[tn,nn]=(0,Y.useState)(null),[$,rn]=(0,Y.useState)(dt),an=S([`automations`,G],()=>V.list(G?{projectId:G}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),on=S([`automation-runs`,G],()=>V.runs(50,void 0,G?{projectId:G}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),sn=S(G?`automations-global-system-source`:null,()=>V.list(),{keepPreviousData:!0,refreshInterval:15e3}),cn=S(G?`automation-runs-global-system-source`:null,()=>V.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),ln=S(gt?[`automation-history`,gt,G]:null,()=>V.runs(50,gt,G?{projectId:G}:void 0),{refreshInterval:1e4}),un=S(ft?`automation-run-events:${ft}`:null,()=>V.runEvents(ft),{refreshInterval:5e3}),dn=S(`automation-workflow-definitions`,ve),fn=S(`automation-browser-automations`,()=>Ne.list()),pn=S(`automation-chat-agents`,me),mn=S(`automation-tasks`,V.tasks),hn=S(`automation-projects`,()=>F({sortBy:`name`,sortOrder:`asc`,limit:200})),gn=an.isLoading&&!an.data||on.isLoading&&!on.data||!!G&&sn.isLoading&&!sn.data||!!G&&cn.isLoading&&!cn.data,_n=!gn&&(an.isLoading||on.isLoading||sn.isLoading||cn.isLoading),vn=an.data?.automations??[],yn=G?sn.data?.automations??[]:vn,bn=(0,Y.useMemo)(()=>Et(on.data?.runs??[]),[on.data?.runs]),xn=(0,Y.useMemo)(()=>G?Et(cn.data?.runs??[]):bn,[cn.data?.runs,G,bn]),Sn=(0,Y.useMemo)(()=>vn.filter(e=>!Ge(e)),[vn]),Cn=(0,Y.useMemo)(()=>yn.filter(Ge),[yn]),wn=(0,Y.useMemo)(()=>[...Sn,...Cn],[Cn,Sn]),Tn=(0,Y.useMemo)(()=>new Set(Cn.map(e=>e.id)),[Cn]),En=(0,Y.useMemo)(()=>bn.filter(e=>!Tn.has(e.automationId)),[bn,Tn]),Dn=(0,Y.useMemo)(()=>xn.filter(e=>Tn.has(e.automationId)),[xn,Tn]),On=(0,Y.useMemo)(()=>G?[...bn,...Dn]:bn,[G,bn,Dn]),kn=(0,Y.useMemo)(()=>On.find(e=>e.id===ft)??ln.data?.runs.find(e=>e.id===ft)??null,[On,ft,ln.data]),An=(0,Y.useMemo)(()=>wn.find(e=>e.id===gt)??null,[wn,gt]),jn=(0,Y.useMemo)(()=>wn.find(e=>e.id===qe)??null,[wn,qe]),Mn=(0,Y.useMemo)(()=>[...ln.data?.runs??On].filter(e=>e.automationId===gt).sort((e,t)=>t.createdAtMs-e.createdAtMs),[On,gt,ln.data]),Nn=un.data?.events??[],Pn=(0,Y.useMemo)(()=>En.filter(e=>!xt(e)&&e.readAtMs==null),[En]),Fn=je.trim().toLocaleLowerCase(),In=De===`system`?Cn:Sn,Ln=De===`system`?Dn:En,Rn=(0,Y.useMemo)(()=>new Set(Ln.filter(xt).map(e=>e.automationId)),[Ln]),zn=(0,Y.useMemo)(()=>In.filter(e=>q===`attention`&&!lt(e,Ln)||q===`running`&&!Rn.has(e.id)||q===`active`&&!e.enabled||q===`paused`&&e.enabled||J!==`all`&&e.action.kind!==J?!1:Fn?[e.name,wt(e),Ct(e,l),Ce(e.trigger,l,w,o)].some(e=>e.toLocaleLowerCase().includes(Fn)):!0),[w,q,l,o,Fn,In,Ln,Rn,J]),Bn=(0,Y.useMemo)(()=>dn.data??[],[dn.data]),Vn=(0,Y.useMemo)(()=>(fn.data?.automations??[]).filter(e=>e.enabled),[fn.data]),Hn=pn.data?.items??[],Un=(0,Y.useMemo)(()=>(mn.data?.items??[]).map(e=>e.task),[mn.data]),Wn=hn.data?.items??[],Gn=(0,Y.useMemo)(()=>Bn.find(e=>e.id===Z.workflowId.trim())??null,[Z.workflowId,Bn]),Kn=(0,Y.useMemo)(()=>Vn.find(e=>e.id===Z.browserAutomationId.trim())??null,[Vn,Z.browserAutomationId]),qn=Z.actionMode===`workflow`&&(!Z.workflowId.trim()||Bn.length>0&&!Bn.some(e=>e.id===Z.workflowId)),Jn=Z.actionMode===`workflow`&&Gn?!ke(Gn,Z.workflowInput,Z.workflowInputValid).valid:!1,Yn=!!jn?.management?.editable.includes(`trigger`),Xn=[`daily`,`weekly`,`interval`,`cron`].includes(Z.triggerMode)&&(![`daily`,`weekly`].includes(Z.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(Z.time))&&(Z.triggerMode!==`interval`||Oe(Z.intervalValue,Z.intervalUnit)>=6e4)&&(Z.triggerMode!==`cron`||!!Z.cronExpr.trim()),Zn=Yn?Xn:!!Z.name.trim()&&(Z.triggerMode!==`once`||Number.isFinite(new Date(Z.onceAt).getTime())&&(!!jn||new Date(Z.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(Z.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(Z.time))&&(Z.triggerMode!==`event`||!!Z.eventType.trim()&&$e(Z.eventPayloadMatch))&&(Z.actionMode===`workflow`?!qn&&!Jn:Z.actionMode===`browser_automation`?Kn!==null&&Pe(Kn,Z.browserAutomationInputs):Z.actionMode===`task_command`?!!(Z.taskId.trim()&&Z.agentId.trim()):!!Z.instruction.trim()),Qn=(0,Y.useMemo)(()=>nt(l),[l]),$n=(0,Y.useMemo)(()=>Sn.filter(e=>lt(e,En)),[Sn,En]),er=(0,Y.useMemo)(()=>In.filter(e=>lt(e,Ln)),[In,Ln]),tr=$n.some(e=>{let t=ct(e,En);return t!==null&&$[e.id]!==t}),nr=Ln.filter(xt).length,rr=In.filter(e=>e.enabled&&e.state.nextRunAtMs).sort((e,t)=>(e.state.nextRunAtMs??1/0)-(t.state.nextRunAtMs??1/0))[0],ir=(0,Y.useMemo)(()=>({all:In.length,agent:In.filter(e=>e.action.kind===`agent`).length,workflow:In.filter(e=>e.action.kind===`workflow`).length,task_command:In.filter(e=>e.action.kind===`task_command`).length,browser_automation:In.filter(e=>e.action.kind===`browser_automation`).length}),[In]),ar=Number(q!==`all`)+Number(J!==`all`),or=(0,Y.useCallback)(()=>{rn(e=>{let t={...e};for(let e of $n){let n=ct(e,En);n&&(t[e.id]=n)}try{window.localStorage.setItem(ut,JSON.stringify(t))}catch{}return t})},[$n,En]);(0,Y.useEffect)(()=>{if(!_n){if(zn.length===0){_t(null);return}if(R&&zn.some(e=>e.id===R)){_t(R);return}gt&&zn.some(e=>e.id===gt)||_t(zn[0].id)}},[R,zn,_n,gt]);let sr=(0,Y.useCallback)(async()=>{await Promise.all([an.mutate(),on.mutate(),sn.mutate(),cn.mutate(),ln.mutate(),un.mutate()])},[an.mutate,sn.mutate,cn.mutate,un.mutate,on.mutate,ln.mutate]),cr=(0,Y.useCallback)(e=>{if(xe){_t(null),pt(null);return}N(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),_t(null),pt(null)},[xe,N]);(0,Y.useEffect)(()=>{xe&&(Ft(G),Qe(e=>e.projectId===G?e:{...e,projectId:G}))},[G,xe]);let lr=(0,Y.useCallback)(e=>{if(Ye(null),Ze(!1),at(null),We(e),He(!0),e===`blank`){Qe({...Ke,projectId:G});return}yt(``),St(null),At(!1),Ft(G),Bt(`new_session`),Ht(`attention`)},[G]),ur=(0,Y.useCallback)(()=>{A(ot(l.createWithAssistantPrompt,G))},[l.createWithAssistantPrompt,A,G]),dr=e=>{Be(e),Qe({...e.form,projectId:G}),Ye(null),Ze(!1),at(null),We(`quick`),He(!0)},fr=(0,Y.useCallback)(e=>{Qe(et(e,Bn)),Ye(e.id),Ze(!1),_t(null),We(`blank`),He(!0)},[Bn]),pr=(0,Y.useCallback)(()=>{bt&&(Qe({...et(bt.automation,Bn),projectId:Pt,conversationMode:It,notificationPolicy:Vt}),Ye(null),Ze(!0),We(`blank`))},[bt,It,Vt,Pt,Bn]),mr=(0,Y.useCallback)(async()=>{Qt(!0),at(null);try{await sr()}catch(e){at(e instanceof Error?e.message:String(e))}finally{Qt(!1)}},[l.feedback.actionFailed,sr]);(0,Y.useEffect)(()=>{let e=wn.find(e=>e.id===R);!e||!Ge(e)||De===`system`||N(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[R,wn,De,N]),(0,Y.useEffect)(()=>{ue===`create`&&(lr(`blank`),W&&Qe(e=>({...e,actionMode:`task_command`,taskId:W,safetyMode:`auto_apply`})),N(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[ue,lr,N,W]),(0,Y.useEffect)(()=>{if(!z)return;let e=`${o}:${Se?`auto`:`seed`}:${z}`;Te.current!==e&&(Te.current=e,yt(z),St(null),At(!1),Ft(G),We(`draft`),He(!0),N(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),Se&&(at(null),Ot(!0),V.draft({prompt:z,language:o}).then(e=>{St(e.draft),At(!1)}).catch(e=>{at(e instanceof Error?e.message:String(e))}).finally(()=>{Ot(!1)})))},[Se,z,o,G,N]);let hr=(0,Y.useCallback)(e=>{let t=bn.find(t=>t.id===e)??ln.data?.runs.find(t=>t.id===e);if(!t||xt(t)||t.readAtMs!=null)return;let n=Date.now();on.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),ln.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),V.markRunRead(e).catch(e=>{at(e instanceof Error?e.message:String(e)),on.mutate(),ln.mutate()})},[bn,on.mutate,ln.data,ln.mutate]),gr=(0,Y.useCallback)(e=>{hr(e),pt(e),ht(!0),N(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[hr,N]),_r=(0,Y.useCallback)(e=>{_t(e);let t=st(e,On);N(t=>{let n=new URLSearchParams(t);return n.set(`automation`,e),n},{replace:!0}),t&&t.readAtMs==null&&!xt(t)&&hr(t.id)},[On,hr,N]),vr=(0,Y.useCallback)(()=>{if(!rr)return;_t(rr.id);let e=st(rr.id,On);N(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.set(`automation`,rr.id),t},{replace:!0}),e&&e.readAtMs==null&&!xt(e)&&hr(e.id)},[On,hr,rr,N]);(0,Y.useEffect)(()=>{P&&(hr(P),pt(P),ht(!0))},[hr,P]),(0,Y.useEffect)(()=>{Kt(null),Xt(!1)},[ft]);async function yr(){if(at(null),Z.triggerMode===`once`&&!jn&&new Date(Z.onceAt).getTime()<=Date.now()){at(l.experience.futureTime);return}if(!(!Zn||tn)&&!(Ue===`quick`&&ze?.requiresProject&&!Z.projectId)){if(Xe&&bt){nn(`draft:edit`);try{let e=Je(Z,Gn),{simulation:t}=await V.simulate(e);St({...bt,automation:e,simulation:t}),Ft(Z.projectId),Bt(Z.conversationMode),Ht(Z.notificationPolicy),At(!1),Ze(!1),We(`draft`)}catch(e){at(e instanceof Error?e.message:String(e))}finally{nn(null)}return}if(jn){let e=jn.id;await br(`automation:${e}:edit`,()=>V.update(e,Yn?{trigger:tt(jn,{...Z,instruction:`managed`},null).trigger}:tt(jn,Z,Gn)))&&(He(!1),Ye(null),_t(e));return}nn(`automation:create`);try{let e=Je(Z,Gn),{automation:t}=await V.create(e);Qe(Ke),He(!1),N(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.set(`automation`,t.id),xe||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await sr(),_t(t.id)}catch(e){at(e instanceof Error?e.message:String(e))}finally{nn(null)}}}async function br(e,t){at(null),nn(e);try{return await t(),await sr(),!0}catch(e){return at(e instanceof Error?e.message:String(e)),!1}finally{nn(null)}}async function xr(){await br(`runs:read-all`,()=>V.markAllRunsRead(G||void 0))}async function Sr(){let e=vt.trim();if(e){at(null),Ot(!0);try{St((await V.draft({prompt:e,language:o})).draft),At(!1)}catch(e){at(e instanceof Error?e.message:String(e))}finally{Ot(!1)}}}async function Cr(){if(!bt)return;let e=``,t=``;await br(`draft:publish`,async()=>{let{automation:n}=await V.create({...bt.automation,...Pt?{projectId:Pt}:{projectId:void 0},conversationMode:It,delivery:{...bt.automation.delivery,notificationPolicy:Vt}});St(null),yt(``),At(!1),He(!1),Me(`all`),Ie(``),e=n.id,t=n.projectId??``})&&e&&(cr(t),_t(e))}async function wr(){if(!bt)return;let e=``,t=``,n=``;await br(`draft:test`,async()=>{let{automation:r}=await V.create({...bt.automation,...Pt?{projectId:Pt}:{projectId:void 0},conversationMode:It,delivery:{...bt.automation.delivery,notificationPolicy:Vt},enabled:!1}),{run:i}=await V.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,St(null),yt(``),At(!1),He(!1),Me(`all`),Ie(``)})&&e&&n&&(cr(t),_t(e),gr(n))}async function Tr(e){at(null),Jt(!0),Kt(null),Xt(!1);try{Kt((await V.repairDraft(e.id,{language:o})).repair)}catch(e){at(e instanceof Error?e.message:String(e))}finally{Jt(!1)}}async function Er(e){Ut&&await br(`run:${e.id}:repair`,async()=>{await V.update(e.automationId,Ut.patch),Kt(null),Xt(!1)})}let Dr=(0,Y.useMemo)(()=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(ae,{className:`size-9 shrink-0 p-0`,loading:Zt,label:l.refresh,onClick:mr}),(0,X.jsxs)(`div`,{className:`inline-flex h-9 shrink-0`,role:`group`,"aria-label":l.createOptions,children:[(0,X.jsxs)(O,{variant:`primary`,className:`h-9 rounded-r-none pr-2.5`,onClick:ur,children:[(0,X.jsx)(d,{className:`size-4`,"aria-hidden":!0}),l.create]}),(0,X.jsxs)(pe,{children:[(0,X.jsx)(fe,{asChild:!0,children:(0,X.jsx)(O,{variant:`primary`,className:`h-9 w-9 rounded-l-none border-l border-white/20 px-0`,"aria-label":l.createOptions,title:l.createOptions,children:(0,X.jsx)(ge,{className:`size-4`,"aria-hidden":!0})})}),(0,X.jsx)(_e,{children:(0,X.jsxs)(C,{align:`end`,sideOffset:6,className:`z-70 min-w-52 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,X.jsxs)(ce,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,onSelect:ur,children:[(0,X.jsx)(M,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.createWithAssistant]}),(0,X.jsxs)(ce,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,onSelect:()=>lr(`blank`),children:[(0,X.jsx)(ye,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.setUpManually]})]})})]})]})]}),[l.create,l.createOptions,l.createWithAssistant,l.refresh,l.setUpManually,ur,lr,Zt,mr]);return(0,Y.useLayoutEffect)(()=>{if(!t)return E({startExtra:null,main:(0,X.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u}),end:Dr}),()=>k()},[k,t,Dr,u,E]),(0,X.jsxs)(`div`,{className:m(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,X.jsxs)(`div`,{className:m(`flex w-full flex-col gap-4`,t?`py-1`:`mx-auto max-w-[96rem] px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`),children:[t?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-xl border border-edge-subtle bg-surface-base px-4 py-3 shadow-surface`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(B,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n||l.title})]}),(0,X.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r||l.subtitle})]}),Dr]}):null,rt||an.error||on.error||sn.error||cn.error?(0,X.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:rt||l.feedback.actionFailed}):null,te?gn?(0,X.jsx)(Dt,{}):(0,X.jsx)(Rt,{runs:Ln,ownership:De,labels:l,language:o,unreadCount:De===`user`?Pn.length:0,loading:_n||Zt,onOwnershipChange:Fe,onRefresh:mr,onSelectRun:gr}):(0,X.jsxs)(X.Fragment,{children:[gn?null:(0,X.jsxs)(`section`,{"aria-labelledby":`automation-overview-title`,children:[(0,X.jsx)(`h2`,{id:`automation-overview-title`,className:`sr-only`,children:l.overview.title}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:[(0,X.jsx)(Lt,{icon:(0,X.jsx)(B,{className:`size-4`,"aria-hidden":!0}),label:l.metrics.enabled,value:String(In.filter(e=>e.enabled).length),active:q===`active`,onClick:()=>Me(`active`)}),(0,X.jsx)(Lt,{icon:(0,X.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),label:l.metrics.running,value:String(nr),active:q===`running`,onClick:()=>Me(`running`)}),(0,X.jsx)(Lt,{icon:(0,X.jsx)(de,{className:`size-4`,"aria-hidden":!0}),label:l.dashboard.needsAttention,value:String(er.length),tone:er.length>0?`danger`:`default`,active:q===`attention`,onClick:()=>Me(`attention`)}),(0,X.jsx)(Lt,{icon:(0,X.jsx)(H,{className:`size-4`,"aria-hidden":!0}),label:l.metrics.next,value:rr?we(rr.state.nextRunAtMs,o):`—`,onClick:rr?vr:void 0})]})]}),!gn&&tr&&De===`user`?(0,X.jsxs)(`div`,{className:`flex items-center rounded-lg border border-red-500/20 bg-red-500/5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>Me(`attention`),className:`flex min-w-0 flex-1 items-center gap-3 rounded-l-lg px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,X.jsx)(de,{className:`size-4 shrink-0 text-red-700 dark:text-red-300`,"aria-hidden":!0}),(0,X.jsxs)(`span`,{className:`min-w-0 text-sm text-fg`,children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[l.experience.executionIssues,` · `,$n.length]}),(0,X.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:l.experience.issuesDescription})]})]}),(0,X.jsx)(`button`,{type:`button`,onClick:or,className:`mr-2 rounded-md p-2 text-fg-muted hover:bg-red-500/10 hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":l.close,title:l.close,children:(0,X.jsx)(f,{className:`size-4`,"aria-hidden":!0})})]}):null,gn?(0,X.jsx)(Dt,{}):(0,X.jsxs)(`section`,{className:`grid min-h-0 items-start gap-4 xl:grid-cols-[minmax(18rem,0.8fr)_minmax(0,1.5fr)]`,"aria-busy":_n,children:[(0,X.jsxs)(`aside`,{className:`flex max-h-[42rem] flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface xl:sticky xl:top-20 xl:max-h-[calc(100vh-7rem)]`,children:[(0,X.jsxs)(`div`,{className:`shrink-0 border-b border-edge-subtle p-3`,children:[xe?null:(0,X.jsxs)(U,{"aria-label":l.filters.project,className:Q,value:G,onChange:e=>cr(e.target.value),children:[(0,X.jsx)(K,{value:``,children:l.filters.allProjects}),Wn.map(e=>(0,X.jsx)(K,{value:e.id,children:e.name},e.id))]}),(0,X.jsxs)(`div`,{className:m(`flex items-center gap-2`,!xe&&`mt-2`),children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg-muted focus-within:border-accent`,children:[(0,X.jsx)(le,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`input`,{className:`min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-subtle`,value:je,onChange:e=>Ie(e.target.value),placeholder:l.filters.search,"aria-label":l.filters.search})]}),(0,X.jsxs)(be,{children:[(0,X.jsx)(L,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:m(`inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,ar>0&&`border-accent/40 bg-accent/8 text-accent-fg`),"aria-label":l.filters.more,children:[(0,X.jsx)(D,{className:`size-4`,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:l.filters.more}),ar>0?(0,X.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full bg-accent px-1.5 text-[11px] leading-5 text-on-accent`,children:ar}):null]})}),(0,X.jsx)(T,{children:(0,X.jsxs)(I,{align:`end`,sideOffset:6,className:`z-[90] w-[min(22rem,calc(100vw-2rem))] rounded-xl border border-edge bg-surface-overlay p-3 shadow-popover outline-none`,children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:l.filters.status}),(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,role:`group`,"aria-label":l.filters.status,children:[{id:`all`,label:l.filters.all},{id:`active`,label:l.filters.active},{id:`running`,label:l.metrics.running},{id:`paused`,label:l.paused},{id:`attention`,label:l.experience.executionIssues}].map(e=>(0,X.jsx)(`button`,{type:`button`,className:m(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,q===e.id&&`bg-surface-active text-fg`),onClick:()=>Me(e.id),"aria-pressed":q===e.id,children:e.label},e.id))}),(0,X.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:l.filters.executor}),(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,role:`group`,"aria-label":l.filters.executor,children:[{id:`all`,label:l.filters.allSources,icon:B},{id:`agent`,label:l.sources.agent,icon:ne},{id:`workflow`,label:l.sources.workflow,icon:se},{id:`task_command`,label:l.sources.task,icon:c},{id:`browser_automation`,label:l.sources.browser,icon:ie}].map(e=>(0,X.jsxs)(`button`,{type:`button`,className:m(`flex min-h-8 items-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg`,J===e.id&&`border-edge bg-surface-active text-fg`),onClick:()=>Le(e.id),"aria-pressed":J===e.id,children:[(0,X.jsx)(e.icon,{className:`size-3.5`,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(`span`,{className:`text-fg-subtle`,children:ir[e.id]})]},e.id))})]}),ar>0?(0,X.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,X.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent-fg hover:underline`,onClick:Re,children:l.filters.clear})}):null]})})]})]}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:l.filters.ownership}),(0,X.jsxs)(`div`,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":l.filters.ownership,children:[(0,X.jsxs)(`button`,{type:`button`,className:m(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,De===`user`&&`bg-surface-base text-fg shadow-sm`),onClick:()=>Fe(`user`),"aria-pressed":De===`user`,children:[l.filters.userManaged,` · `,Sn.length]}),(0,X.jsxs)(`button`,{type:`button`,className:m(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,De===`system`&&`bg-surface-base text-fg shadow-sm`),onClick:()=>Fe(`system`),"aria-pressed":De===`system`,children:[l.system.title,` · `,Cn.length]})]})]}),Pn.length>0&&De===`user`?(0,X.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 rounded-md bg-accent/8 px-2.5 py-1.5 text-xs text-accent-fg`,children:[(0,X.jsxs)(`span`,{children:[l.filters.unread,` · `,Pn.length]}),(0,X.jsx)(`button`,{type:`button`,className:`font-medium hover:underline`,disabled:tn===`runs:read-all`,onClick:()=>void xr(),children:l.filters.markAllRead})]}):null,(0,X.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[_n?(0,X.jsx)(oe,{className:`size-3 animate-spin`,"aria-hidden":!0}):null,_n?l.loading:l.filters.results.replace(`{count}`,String(zn.length))]}),q!==`all`||J!==`all`||Fn?(0,X.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:Re,children:l.filters.clear}):null]})]}),(0,X.jsx)(zt,{automations:zn,runs:Ln,labels:l,cronLabels:w,language:o,selectedAutomationId:gt,onOpenDetails:_r})]}),An?(0,X.jsx)(Gt,{automation:An,runs:Mn,runsLoading:ln.isLoading,runsError:ln.error?l.feedback.actionFailed:void 0,labels:l,cronLabels:w,language:o,projects:Wn,busyAction:tn,onEdit:fr,onSelectRun:gr,onAction:br},An.id):(0,X.jsx)(`div`,{className:`min-h-[28rem] overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:De===`user`&&In.length===0?(0,X.jsxs)(`div`,{className:`p-5`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l.experience.starterTemplates}),(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:l.experience.starterTemplatesDescription}),(0,X.jsx)(jt,{templates:Qn,labels:l,onSelect:dr}),(0,X.jsx)(O,{className:`mt-4`,variant:`ghost`,onClick:()=>lr(`draft`),children:l.experience.custom})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($t,{className:`min-h-56 rounded-none border-0 shadow-none`,icon:(0,X.jsx)(B,{className:`size-5`}),title:In.length===0?l.empty.automations:l.empty.filtered}),In.length>0?(0,X.jsx)(`div`,{className:`flex justify-center border-t border-edge-subtle p-4`,children:(0,X.jsx)(O,{variant:`ghost`,onClick:Re,children:l.filters.clear})}):null]})})]}),!gn&&Sn.length>0?(0,X.jsx)(`div`,{children:(0,X.jsxs)(O,{variant:`ghost`,onClick:()=>lr(`draft`),children:[(0,X.jsx)(d,{className:`size-4`,"aria-hidden":!0}),l.experience.discover]})}):null]})]}),(0,X.jsx)(x,{open:Ve,onOpenChange:e=>{He(e),e||(Ye(null),Ze(!1))},children:(0,X.jsxs)(v,{children:[(0,X.jsx)(g,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,X.jsxs)(y,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(760px,calc(100vh-2rem))] w-[min(100%-2rem,48rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(b,{className:`text-base font-semibold text-fg`,children:Ue===`draft`?l.draft.title:jn?l.editTitle:Xe?l.draft.editTitle:l.createTitle}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:Ue===`draft`?l.draft.subtitle:l.form.createFlowHint})]}),(0,X.jsx)(_,{asChild:!0,children:(0,X.jsx)(O,{variant:`ghost`,"aria-label":l.close,children:(0,X.jsx)(f,{className:`size-4`})})})]}),rt?(0,X.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:rt}):null,Ue===`draft`?(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,X.jsx)(Nt,{labels:l,prompt:vt,draft:bt,loading:Tt,approved:kt,publishBusy:tn===`draft:publish`,testBusy:tn===`draft:test`,templates:Qn,projects:Wn,projectId:Pt,conversationMode:It,notificationPolicy:Vt,onPromptChange:yt,onGenerate:Sr,onEdit:pr,onPublish:Cr,onTest:wr,onProjectChange:Ft,onConversationModeChange:Bt,onNotificationPolicyChange:Ht,projectLocked:xe,onApprovedChange:At,onDiscard:()=>{St(null),At(!1)},onTemplateSelect:e=>{dr(e),Qe({...e.form,projectId:Pt})},onOpenAdvanced:()=>{Qe({...Ke,projectId:Pt,conversationMode:It,notificationPolicy:Vt}),We(`blank`)}})}):(0,X.jsxs)(X.Fragment,{children:[Yn?(0,X.jsx)(Mt,{form:Z,setForm:Qe,labels:l}):Ue===`quick`&&ze?(0,X.jsx)(it,{form:Z,setForm:Qe,labels:l,projects:Wn,projectLocked:xe,source:ze.source,requiresProject:ze.requiresProject}):(0,X.jsx)(en,{form:Z,labels:l,setForm:Qe,projects:Wn,workflowDefinitions:Bn,selectedWorkflow:Gn,workflowsLoading:dn.isLoading,browserAutomations:Vn,selectedBrowserAutomation:Kn,browserAutomationsLoading:fn.isLoading,agentOptions:Hn,agentsLoading:pn.isLoading,defaultAgentId:pn.data?.defaultId??``,taskOptions:Un,tasksLoading:mn.isLoading,language:o,projectLocked:xe}),(0,X.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[Ue===`quick`?(0,X.jsx)(O,{variant:`ghost`,onClick:()=>We(`blank`),children:l.draft.advancedCreate}):null,Xe?(0,X.jsx)(O,{variant:`ghost`,onClick:()=>{Ze(!1),We(`draft`)},children:l.cancel}):(0,X.jsx)(_,{asChild:!0,children:(0,X.jsx)(O,{variant:`ghost`,children:l.cancel})}),(0,X.jsx)(O,{variant:`primary`,onClick:yr,disabled:!Zn||!!tn||Ue===`quick`&&!!ze?.requiresProject&&!Z.projectId,children:tn===`automation:create`||tn===`draft:edit`||jn&&tn===`automation:${jn.id}:edit`?l.feedback.working:jn||Xe?l.save:l.experience.createEnabled})]})]})]})]})}),(0,X.jsx)(x,{open:mt&&!!kn,onOpenChange:e=>{ht(e),!e&&N(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,X.jsxs)(v,{children:[(0,X.jsx)(g,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,X.jsxs)(y,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(85vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,X.jsx)(b,{className:`truncate text-base font-semibold text-fg`,children:kn?.automationName??l.dashboard.result}),(0,X.jsx)(_,{asChild:!0,children:(0,X.jsx)(O,{variant:`ghost`,"aria-label":l.close,children:(0,X.jsx)(f,{className:`size-4`})})})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,X.jsx)(Wt,{className:`rounded-none border-0`,run:kn,events:Nn,labels:l,cronLabels:w,language:o,loading:un.isLoading,repairDraft:Ut,repairLoading:qt,repairApproved:Yt,busyAction:tn,onRepairApprovedChange:Xt,onSuggestRepair:Tr,onApplyRepair:Er})})]})]})})]})}function jt(e){let t=(0,Le.c)(9),{templates:n,labels:r,onSelect:i}=e,a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==r||t[5]!==i?(e=e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-lg border border-edge-subtle bg-surface-panel p-4 text-left hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,X.jsx)(H,{className:`mb-3 size-4 text-accent-fg`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.description}),(0,X.jsxs)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:[r.experience.source,`: `,e.source]})]},e.name),t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,X.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:a}),t[7]=a,t[8]=o),o}function Mt(e){let t=(0,Le.c)(48),{form:n,setForm:r,labels:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(t=>({...t,...e})),t[0]=r,t[1]=a);let o=a,s;t[2]!==i.form.trigger||t[3]!==i.form.triggerStepDescription?(s=(0,X.jsx)(rn,{step:`1`,title:i.form.trigger,description:i.form.triggerStepDescription}),t[2]=i.form.trigger,t[3]=i.form.triggerStepDescription,t[4]=s):s=t[4];let c;t[5]===o?c=t[6]:(c=e=>o({triggerMode:e.target.value}),t[5]=o,t[6]=c);let l;t[7]===i.trigger.daily?l=t[8]:(l=(0,X.jsx)(K,{value:`daily`,children:i.trigger.daily}),t[7]=i.trigger.daily,t[8]=l);let u;t[9]===i.trigger.weekly?u=t[10]:(u=(0,X.jsx)(K,{value:`weekly`,children:i.trigger.weekly}),t[9]=i.trigger.weekly,t[10]=u);let d;t[11]===i.trigger.interval?d=t[12]:(d=(0,X.jsx)(K,{value:`interval`,children:i.trigger.interval}),t[11]=i.trigger.interval,t[12]=d);let f;t[13]===i.trigger.customCron?f=t[14]:(f=(0,X.jsx)(K,{value:`cron`,children:i.trigger.customCron}),t[13]=i.trigger.customCron,t[14]=f);let p;t[15]!==n.triggerMode||t[16]!==c||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f?(p=(0,X.jsxs)(U,{className:Q,value:n.triggerMode,onChange:c,children:[l,u,d,f]}),t[15]=n.triggerMode,t[16]=c,t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=p):p=t[21];let m;t[22]!==n.time||t[23]!==n.triggerMode||t[24]!==n.weekday||t[25]!==i.form.day||t[26]!==i.form.time||t[27]!==i.weekdays||t[28]!==o?(m=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,X.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:i.form.time,children:(0,X.jsx)(He,{value:n.time,onChange:e=>o({time:e}),ariaLabel:i.form.time})}),n.triggerMode===`weekly`?(0,X.jsx)($,{label:i.form.day,children:(0,X.jsxs)(U,{className:Q,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,X.jsx)(K,{value:`1`,children:i.weekdays.monday}),(0,X.jsx)(K,{value:`2`,children:i.weekdays.tuesday}),(0,X.jsx)(K,{value:`3`,children:i.weekdays.wednesday}),(0,X.jsx)(K,{value:`4`,children:i.weekdays.thursday}),(0,X.jsx)(K,{value:`5`,children:i.weekdays.friday}),(0,X.jsx)(K,{value:`6`,children:i.weekdays.saturday}),(0,X.jsx)(K,{value:`0`,children:i.weekdays.sunday})]})}):null]}):null,t[22]=n.time,t[23]=n.triggerMode,t[24]=n.weekday,t[25]=i.form.day,t[26]=i.form.time,t[27]=i.weekdays,t[28]=o,t[29]=m):m=t[29];let h;t[30]!==n.intervalUnit||t[31]!==n.intervalValue||t[32]!==n.triggerMode||t[33]!==i.form.intervalEvery||t[34]!==i.form.intervalUnits||t[35]!==o?(h=n.triggerMode===`interval`?(0,X.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,X.jsx)($,{label:i.form.intervalEvery,children:(0,X.jsx)(`input`,{className:Q,type:`number`,min:`1`,value:n.intervalValue,onChange:e=>o({intervalValue:e.target.value})})}),(0,X.jsx)($,{label:i.form.intervalUnits.minute,children:(0,X.jsxs)(U,{className:Q,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,X.jsx)(K,{value:`minute`,children:i.form.intervalUnits.minute}),(0,X.jsx)(K,{value:`hour`,children:i.form.intervalUnits.hour}),(0,X.jsx)(K,{value:`day`,children:i.form.intervalUnits.day}),(0,X.jsx)(K,{value:`week`,children:i.form.intervalUnits.week})]})})]}):null,t[30]=n.intervalUnit,t[31]=n.intervalValue,t[32]=n.triggerMode,t[33]=i.form.intervalEvery,t[34]=i.form.intervalUnits,t[35]=o,t[36]=h):h=t[36];let g;t[37]!==n.cronExpr||t[38]!==n.triggerMode||t[39]!==i.form.expression||t[40]!==o?(g=n.triggerMode===`cron`?(0,X.jsx)(`div`,{className:`mt-4`,children:(0,X.jsx)($,{label:i.form.expression,children:(0,X.jsx)(`input`,{className:Q,value:n.cronExpr,onChange:e=>o({cronExpr:e.target.value})})})}):null,t[37]=n.cronExpr,t[38]=n.triggerMode,t[39]=i.form.expression,t[40]=o,t[41]=g):g=t[41];let _;return t[42]!==h||t[43]!==g||t[44]!==s||t[45]!==p||t[46]!==m?(_=(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[s,p,m,h,g]}),t[42]=h,t[43]=g,t[44]=s,t[45]=p,t[46]=m,t[47]=_):_=t[47],_}function Nt(e){let t=(0,Le.c)(110),{labels:n,prompt:r,draft:i,loading:a,approved:o,publishBusy:s,testBusy:c,templates:l,projects:u,projectId:d,conversationMode:f,notificationPolicy:p,onPromptChange:h,onGenerate:g,onEdit:_,onPublish:v,onTest:y,onProjectChange:b,onConversationModeChange:x,onNotificationPolicyChange:S,onApprovedChange:C,onDiscard:w,onTemplateSelect:T,onOpenAdvanced:E,projectLocked:D}=e,k=s===void 0?!1:s,A=c===void 0?!1:c,j=D===void 0?!1:D,M=!!(i&&i.simulation.requiredConfirmations.length>0),ee;t[0]!==i||t[1]!==n.draft.advancedCreate||t[2]!==n.draft.suggestions||t[3]!==n.draft.suggestionsDescription||t[4]!==n.experience||t[5]!==E||t[6]!==T||t[7]!==l?(ee=i?null:(0,X.jsxs)(`div`,{className:`mb-5 border-b border-edge-subtle pb-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.draft.suggestions}),(0,X.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n.draft.suggestionsDescription})]}),(0,X.jsx)(O,{variant:`ghost`,onClick:E,children:n.draft.advancedCreate})]}),(0,X.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:l.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-2 focus-visible:ring-accent rounded-lg border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>T(e),children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,X.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description}),(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.experience.source,`: `,e.source]})]},e.name))})]}),t[0]=i,t[1]=n.draft.advancedCreate,t[2]=n.draft.suggestions,t[3]=n.draft.suggestionsDescription,t[4]=n.experience,t[5]=E,t[6]=T,t[7]=l,t[8]=ee):ee=t[8];let N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,X.jsx)(ne,{className:`size-4 text-accent`}),t[9]=N):N=t[9];let te;t[10]===n.draft.title?te=t[11]:(te=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[N,n.draft.title]}),t[10]=n.draft.title,t[11]=te);let P;t[12]===n.draft.subtitle?P=t[13]:(P=(0,X.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=P);let F;t[14]!==te||t[15]!==P?(F=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[te,P]}),t[14]=te,t[15]=P,t[16]=F):F=t[16];let I;t[17]!==a||t[18]!==r?(I=a||!r.trim(),t[17]=a,t[18]=r,t[19]=I):I=t[19];let L;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,X.jsx)(ne,{className:`size-4`}),t[20]=L):L=t[20];let re=a?n.draft.generating:n.draft.generate,ie;t[21]!==g||t[22]!==re||t[23]!==I?(ie=(0,X.jsxs)(O,{variant:`primary`,onClick:g,disabled:I,children:[L,re]}),t[21]=g,t[22]=re,t[23]=I,t[24]=ie):ie=t[24];let ae;t[25]!==ie||t[26]!==F?(ae=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[F,ie]}),t[25]=ie,t[26]=F,t[27]=ae):ae=t[27];let R;t[28]===h?R=t[29]:(R=e=>h(e.target.value),t[28]=h,t[29]=R);let oe;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==R?(oe=(0,X.jsx)(`textarea`,{"aria-label":n.draft.title,className:`mt-4 min-h-20 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,value:r,onChange:R,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=R,t[34]=oe):oe=t[34];let se=j?`sm:grid-cols-2`:`sm:grid-cols-3`,z;t[35]===se?z=t[36]:(z=m(`mt-3 grid gap-3`,se),t[35]=se,t[36]=z);let ce;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==b||t[40]!==d||t[41]!==j||t[42]!==u?(ce=j?null:(0,X.jsx)($,{label:n.draft.project,children:(0,X.jsxs)(U,{className:Q,value:d,onChange:e=>b(e.target.value),children:[(0,X.jsx)(K,{value:``,children:n.draft.noProject}),u.map(Pt)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=b,t[40]=d,t[41]=j,t[42]=u,t[43]=ce):ce=t[43];let le;t[44]===x?le=t[45]:(le=e=>x(e.target.value),t[44]=x,t[45]=le);let B;t[46]===n.draft.newConversation?B=t[47]:(B=(0,X.jsx)(K,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=B);let ue;t[48]===n.draft.continuousConversation?ue=t[49]:(ue=(0,X.jsx)(K,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=ue);let de;t[50]!==f||t[51]!==le||t[52]!==B||t[53]!==ue?(de=(0,X.jsxs)(U,{className:Q,value:f,onChange:le,children:[B,ue]}),t[50]=f,t[51]=le,t[52]=B,t[53]=ue,t[54]=de):de=t[54];let fe;t[55]!==n.draft.conversation||t[56]!==de?(fe=(0,X.jsx)($,{label:n.draft.conversation,children:de}),t[55]=n.draft.conversation,t[56]=de,t[57]=fe):fe=t[57];let V;t[58]===S?V=t[59]:(V=e=>S(e.target.value),t[58]=S,t[59]=V);let H;t[60]===n.draft.notifyAttention?H=t[61]:(H=(0,X.jsx)(K,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=H);let W;t[62]===n.draft.notifyAll?W=t[63]:(W=(0,X.jsx)(K,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=W);let pe;t[64]===n.draft.notifyNone?pe=t[65]:(pe=(0,X.jsx)(K,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=pe);let me;t[66]!==p||t[67]!==V||t[68]!==H||t[69]!==W||t[70]!==pe?(me=(0,X.jsxs)(U,{className:Q,value:p,onChange:V,children:[H,W,pe]}),t[66]=p,t[67]=V,t[68]=H,t[69]=W,t[70]=pe,t[71]=me):me=t[71];let he;t[72]!==n.draft.notifications||t[73]!==me?(he=(0,X.jsx)($,{label:n.draft.notifications,children:me}),t[72]=n.draft.notifications,t[73]=me,t[74]=he):he=t[74];let ge;t[75]!==z||t[76]!==ce||t[77]!==fe||t[78]!==he?(ge=(0,X.jsxs)(`div`,{className:z,children:[ce,fe,he]}),t[75]=z,t[76]=ce,t[77]=fe,t[78]=he,t[79]=ge):ge=t[79];let _e;t[80]!==o||t[81]!==i||t[82]!==n.draft.approval||t[83]!==n.draft.assumptions||t[84]!==n.draft.discard||t[85]!==n.draft.edit||t[86]!==n.draft.publish||t[87]!==n.draft.review||t[88]!==n.draft.risks||t[89]!==n.draft.safety||t[90]!==n.draft.testOnce||t[91]!==n.draft.testing||t[92]!==n.feedback||t[93]!==n.info||t[94]!==n.none||t[95]!==C||t[96]!==w||t[97]!==_||t[98]!==v||t[99]!==y||t[100]!==k||t[101]!==M||t[102]!==A?(_e=i?(0,X.jsxs)(`div`,{className:`mt-4 grid gap-3 rounded-lg bg-surface-base p-4 lg:grid-cols-[1fr_1fr]`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:i.automation.name}),i.automation.description?(0,X.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:i.automation.description}):null,(0,X.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,X.jsx)(Qt,{label:n.info.when,value:i.simulation.triggerSummary}),(0,X.jsx)(Qt,{label:n.info.run,value:i.simulation.actionSummary})]})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:n.draft.review}),(0,X.jsx)(Ft,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,X.jsx)(Ft,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,X.jsx)(Ft,{title:n.draft.risks,items:i.risks,empty:n.none}),M?(0,X.jsxs)(`label`,{className:`mt-4 flex items-start gap-2 text-sm text-fg`,children:[(0,X.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:o,onChange:e=>C(e.target.checked)}),(0,X.jsx)(`span`,{children:n.draft.approval})]}):null,(0,X.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,X.jsx)(O,{variant:`ghost`,onClick:w,children:n.draft.discard}),(0,X.jsxs)(O,{variant:`secondary`,onClick:_,children:[(0,X.jsx)(ye,{className:`size-4`}),n.draft.edit]}),(0,X.jsxs)(O,{variant:`secondary`,onClick:y,disabled:A||k||M&&!o,children:[(0,X.jsx)(G,{className:`size-4`}),A?n.draft.testing:n.draft.testOnce]}),(0,X.jsx)(O,{variant:`primary`,onClick:v,disabled:k||M&&!o,children:k?n.feedback.working:n.draft.publish})]})]})]}):null,t[80]=o,t[81]=i,t[82]=n.draft.approval,t[83]=n.draft.assumptions,t[84]=n.draft.discard,t[85]=n.draft.edit,t[86]=n.draft.publish,t[87]=n.draft.review,t[88]=n.draft.risks,t[89]=n.draft.safety,t[90]=n.draft.testOnce,t[91]=n.draft.testing,t[92]=n.feedback,t[93]=n.info,t[94]=n.none,t[95]=C,t[96]=w,t[97]=_,t[98]=v,t[99]=y,t[100]=k,t[101]=M,t[102]=A,t[103]=_e):_e=t[103];let ve;return t[104]!==ae||t[105]!==oe||t[106]!==ge||t[107]!==_e||t[108]!==ee?(ve=(0,X.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[ee,ae,oe,ge,_e]}),t[104]=ae,t[105]=oe,t[106]=ge,t[107]=_e,t[108]=ee,t[109]=ve):ve=t[109],ve}function Pt(e){return(0,X.jsx)(K,{value:e.id,children:e.name},e.id)}function Ft(e){let t=(0,Le.c)(10),{title:n,items:r,empty:i}=e,a;t[0]===n?a=t[1]:(a=(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r?(o=r.length>0?r.map(It):(0,X.jsx)(`li`,{className:`text-fg-muted`,children:i}),t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===o?s=t[6]:(s=(0,X.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm text-fg`,children:o}),t[5]=o,t[6]=s);let c;return t[7]!==a||t[8]!==s?(c=(0,X.jsxs)(`div`,{className:`mt-3`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function It(e){return(0,X.jsxs)(`li`,{children:[`- `,e]},e)}function Lt(e){let t=(0,Le.c)(25),{icon:n,label:r,value:i,tone:a,active:o,onClick:s}=e,c=a===void 0?`default`:a,l=c===`danger`?`text-red-600 dark:text-red-300`:`text-fg-subtle`,u;t[0]===l?u=t[1]:(u=m(`shrink-0`,l),t[0]=l,t[1]=u);let d;t[2]!==n||t[3]!==u?(d=(0,X.jsx)(`span`,{className:u,children:n}),t[2]=n,t[3]=u,t[4]=d):d=t[4];let f;t[5]===r?f=t[6]:(f=(0,X.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:r}),t[5]=r,t[6]=f);let p=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,h;t[7]===p?h=t[8]:(h=m(`ml-auto truncate text-sm font-semibold tabular-nums`,p),t[7]=p,t[8]=h);let g;t[9]!==h||t[10]!==i?(g=(0,X.jsx)(`span`,{className:h,children:i}),t[9]=h,t[10]=i,t[11]=g):g=t[11];let _;t[12]!==d||t[13]!==f||t[14]!==g?(_=(0,X.jsxs)(X.Fragment,{children:[d,f,g]}),t[12]=d,t[13]=f,t[14]=g,t[15]=_):_=t[15];let v=_,y=o&&`bg-accent/8`,b=s&&`cursor-pointer hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,x;t[16]!==y||t[17]!==b?(x=m(`flex min-h-12 min-w-0 items-center gap-2.5 bg-surface-base px-3 py-2.5 text-left transition-colors`,y,b),t[16]=y,t[17]=b,t[18]=x):x=t[18];let S=x,C=`${r}: ${i}`,w;return t[19]!==C||t[20]!==o||t[21]!==S||t[22]!==v||t[23]!==s?(w=s?(0,X.jsx)(`button`,{type:`button`,className:S,onClick:s,"aria-label":C,"aria-pressed":o,children:v}):(0,X.jsx)(`div`,{className:S,"aria-label":C,children:v}),t[19]=C,t[20]=o,t[21]=S,t[22]=v,t[23]=s,t[24]=w):w=t[24],w}function Rt(e){let t=(0,Le.c)(74),{runs:n,ownership:r,labels:i,language:a,unreadCount:o,loading:s,onOwnershipChange:l,onRefresh:u,onSelectRun:d}=e,f;t[0]===n?f=t[1]:(f=n.filter(xt),t[0]=n,t[1]=f);let p=f.length,h;t[2]===n?h=t[3]:(h=n.filter(St),t[2]=n,t[3]=h);let g=h.length,_;t[4]===i.dashboard.activity?_=t[5]:(_=(0,X.jsx)(`h2`,{id:`automation-activity-title`,className:`text-sm font-semibold text-fg`,children:i.dashboard.activity}),t[4]=i.dashboard.activity,t[5]=_);let v;t[6]===i.dashboard.activityDescription?v=t[7]:(v=(0,X.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.dashboard.activityDescription}),t[6]=i.dashboard.activityDescription,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let b=i.filters.ownership,x=r===`user`&&`bg-surface-base text-fg shadow-sm`,S;t[11]===x?S=t[12]:(S=m(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,x),t[11]=x,t[12]=S);let C;t[13]===l?C=t[14]:(C=()=>l(`user`),t[13]=l,t[14]=C);let w=r===`user`,T;t[15]!==i.filters.userManaged||t[16]!==w||t[17]!==S||t[18]!==C?(T=(0,X.jsx)(`button`,{type:`button`,className:S,onClick:C,"aria-pressed":w,children:i.filters.userManaged}),t[15]=i.filters.userManaged,t[16]=w,t[17]=S,t[18]=C,t[19]=T):T=t[19];let E=r===`system`&&`bg-surface-base text-fg shadow-sm`,D;t[20]===E?D=t[21]:(D=m(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,E),t[20]=E,t[21]=D);let O;t[22]===l?O=t[23]:(O=()=>l(`system`),t[22]=l,t[23]=O);let k=r===`system`,A;t[24]!==i.system.title||t[25]!==D||t[26]!==O||t[27]!==k?(A=(0,X.jsx)(`button`,{type:`button`,className:D,onClick:O,"aria-pressed":k,children:i.system.title}),t[24]=i.system.title,t[25]=D,t[26]=O,t[27]=k,t[28]=A):A=t[28];let j;t[29]!==i.filters.ownership||t[30]!==T||t[31]!==A?(j=(0,X.jsxs)(`div`,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":b,children:[T,A]}),t[29]=i.filters.ownership,t[30]=T,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==i.refresh||t[34]!==s||t[35]!==u?(M=(0,X.jsx)(ae,{className:`size-9 shrink-0 p-0`,loading:s,label:i.refresh,onClick:u}),t[33]=i.refresh,t[34]=s,t[35]=u,t[36]=M):M=t[36];let N;t[37]!==j||t[38]!==M?(N=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[j,M]}),t[37]=j,t[38]=M,t[39]=N):N=t[39];let te;t[40]!==N||t[41]!==y?(te=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3 sm:px-5`,children:[y,N]}),t[40]=N,t[41]=y,t[42]=te):te=t[42];let P;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,X.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[43]=P):P=t[43];let F=i.metrics.total,I=String(n.length),L;t[44]!==i.metrics.total||t[45]!==I?(L=(0,X.jsx)(Lt,{icon:P,label:F,value:I}),t[44]=i.metrics.total,t[45]=I,t[46]=L):L=t[46];let ne;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,X.jsx)(G,{className:`size-4`,"aria-hidden":!0}),t[47]=ne):ne=t[47];let re=i.metrics.running,ie=String(p),R;t[48]!==i.metrics.running||t[49]!==ie?(R=(0,X.jsx)(Lt,{icon:ne,label:re,value:ie}),t[48]=i.metrics.running,t[49]=ie,t[50]=R):R=t[50];let oe;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,X.jsx)(de,{className:`size-4`,"aria-hidden":!0}),t[51]=oe):oe=t[51];let se=i.dashboard.needsAttention,z=String(g),ce=g>0?`danger`:`default`,le;t[52]!==i.dashboard.needsAttention||t[53]!==z||t[54]!==ce?(le=(0,X.jsx)(Lt,{icon:oe,label:se,value:z,tone:ce}),t[52]=i.dashboard.needsAttention,t[53]=z,t[54]=ce,t[55]=le):le=t[55];let B;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,X.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t[56]=B):B=t[56];let ue=i.filters.unread,fe=String(o),V;t[57]!==i.filters.unread||t[58]!==fe?(V=(0,X.jsx)(Lt,{icon:B,label:ue,value:fe}),t[57]=i.filters.unread,t[58]=fe,t[59]=V):V=t[59];let H;t[60]!==L||t[61]!==R||t[62]!==le||t[63]!==V?(H=(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[L,R,le,V]}),t[60]=L,t[61]=R,t[62]=le,t[63]=V,t[64]=H):H=t[64];let U;t[65]!==i||t[66]!==a||t[67]!==d||t[68]!==n?(U=n.length===0?(0,X.jsx)($t,{className:`min-h-64 rounded-none border-0 shadow-none`,icon:(0,X.jsx)(ee,{className:`size-5`}),title:i.empty.runs}):(0,X.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-3 px-4 py-3 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-5`,onClick:()=>d(e.id),children:[(0,X.jsx)(`span`,{className:m(`mt-1.5 size-2 shrink-0 rounded-full`,xt(e)?`bg-blue-500`:St(e)?`bg-red-500`:`bg-emerald-500`),"aria-hidden":!0}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.automationName}),e.readAtMs==null&&!xt(e)?(0,X.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-blue-500`,children:(0,X.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,X.jsx)(`span`,{className:m(`mt-1 line-clamp-2 block text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||i.status[e.status]}),(0,X.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:ft(e.createdAtMs,i,a)})]}),(0,X.jsx)(`span`,{className:m(`shrink-0 rounded-full px-2 py-0.5 text-xs`,yt(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=d,t[68]=n,t[69]=U):U=t[69];let W;return t[70]!==te||t[71]!==H||t[72]!==U?(W=(0,X.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,"aria-labelledby":`automation-activity-title`,children:[te,H,U]}),t[70]=te,t[71]=H,t[72]=U,t[73]=W):W=t[73],W}function zt(e){let t=(0,Le.c)(20),{automations:n,runs:r,labels:i,cronLabels:a,language:o,selectedAutomationId:s,onOpenDetails:c}=e;if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(B,{className:`size-5`}),t[0]=e):e=t[0];let n;return t[1]===i.empty.filtered?n=t[2]:(n=(0,X.jsx)($t,{className:`rounded-none border-0 shadow-none`,icon:e,title:i.empty.filtered}),t[1]=i.empty.filtered,t[2]=n),n}let l;if(t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==o||t[7]!==c||t[8]!==r||t[9]!==s){let e;t[11]!==a||t[12]!==i||t[13]!==o||t[14]!==c||t[15]!==r||t[16]!==s?(e=e=>{let t=r.filter(t=>t.automationId===e.id).sort(Bt),n=t.find(xt),l=t[0];return(0,X.jsxs)(`button`,{type:`button`,className:m(`block w-full p-3 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,s===e.id&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 130px`},"aria-current":s===e.id?`true`:void 0,onClick:()=>c(e.id),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:m(`size-2 shrink-0 rounded-full`,n?`bg-blue-500`:lt(e,t)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,X.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:e.enabled?i.enabled:i.paused}),l&&l.readAtMs==null&&!xt(l)?(0,X.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,X.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,X.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-1.5 pl-4 text-xs`,children:[(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge-subtle bg-surface-panel px-1.5 py-0.5 text-fg-muted`,children:[(0,X.jsx)(_t,{kind:e.action.kind,className:`size-3`}),mt(e.action,i)]}),(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 rounded-md bg-surface-panel px-1.5 py-0.5 text-fg-muted`,children:[(0,X.jsx)(H,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:Ce(e.trigger,i,a,o)})]})]}),(0,X.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center justify-between gap-2 pl-4 text-xs text-fg-subtle`,children:[(0,X.jsx)(`span`,{className:m(`line-clamp-2`,l?.error&&`text-red-700 dark:text-red-300`),children:l?l.error||l.summary||i.status[l.status]:e.state.lastError||(e.state.lastRunStatus?i.status[e.state.lastRunStatus]:i.experience.noRuns)}),l?.status?(0,X.jsx)(`span`,{className:m(`shrink-0 rounded-full px-1.5 py-0.5`,yt(l.status)),children:i.status[l.status]}):null]}),(0,X.jsxs)(`div`,{className:`mt-2 space-y-1 pl-4 text-xs text-fg-muted`,children:[l?(0,X.jsxs)(`div`,{children:[i.last,`: `,ft(l.createdAtMs,i,o)]}):null,(0,X.jsx)(`div`,{children:e.enabled?`${i.next}: ${q(e,i,o)}`:i.paused})]})]},e.id)},t[11]=a,t[12]=i,t[13]=o,t[14]=c,t[15]=r,t[16]=s,t[17]=e):e=t[17],l=n.map(e),t[3]=n,t[4]=a,t[5]=i,t[6]=o,t[7]=c,t[8]=r,t[9]=s,t[10]=l}else l=t[10];let u;return t[18]===l?u=t[19]:(u=(0,X.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:l}),t[18]=l,t[19]=u),u}function Bt(e,t){return t.createdAtMs-e.createdAtMs}function Vt(e,t){let n=t.events,r=e.data&&typeof e.data==`object`?e.data:{},i=typeof r.actionKind==`string`?r.actionKind:null,a=typeof r.status==`string`&&r.status in t.status?t.status[r.status]:null;switch(e.type){case`run.queued`:return e.message.toLowerCase().includes(`manual`)?n.manualQueued:e.message.toLowerCase().includes(`scheduled`)?n.scheduledQueued:n.eventQueued;case`run.started`:return n.runStarted;case`action.started`:return i?n.actionStarted.replace(`{kind}`,i):n.actionStartedFallback;case`action.completed`:return i?n.actionCompleted.replace(`{kind}`,i):n.actionCompletedFallback;case`action.failed`:return i?n.actionFailed.replace(`{kind}`,i):n.actionFailedFallback;case`run.completed`:return a?n.runCompleted.replace(`{status}`,a):n.runCompletedFallback;default:return e.message}}function Ht(e){let t=(0,Le.c)(17),{value:n,labels:r,title:i,defaultExpanded:a}=e,[o,s]=(0,Y.useState)(a===void 0?!1:a),c;t[0]===n?c=t[1]:(c=JSON.stringify(n,null,2),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.split(`
|
|
2
|
-
`),t[2]=l,t[3]=u);let d=u.length,f=l.length>720||d>18,p;t[4]!==f||t[5]!==l?(p=f?`${l.split(`
|
|
3
|
-
`).slice(0,10).join(`
|
|
4
|
-
`).trimEnd()}...`:l,t[4]=f,t[5]=l,t[6]=p):p=t[6];let h=p,g;t[7]!==o||t[8]!==f||t[9]!==r||t[10]!==i?(g=f?(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>s(Ut),"aria-expanded":o,children:[(0,X.jsx)(`span`,{children:i}),(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-accent-fg`,children:[o?r.details.hideDetails:r.details.showDetails,(0,X.jsx)(ge,{className:m(`size-3.5 transition-transform`,o&&`rotate-180`),"aria-hidden":!0})]})]}):(0,X.jsx)(`div`,{className:`px-2.5 py-2 text-xs font-medium text-fg-muted`,children:i}),t[7]=o,t[8]=f,t[9]=r,t[10]=i,t[11]=g):g=t[11];let _=o||!f?l:h,v;t[12]===_?v=t[13]:(v=(0,X.jsx)(`pre`,{className:`whitespace-pre-wrap break-all px-2.5 pb-2 text-xs leading-relaxed text-fg-muted`,children:_}),t[12]=_,t[13]=v);let y;return t[14]!==g||t[15]!==v?(y=(0,X.jsxs)(`div`,{className:`mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[g,v]}),t[14]=g,t[15]=v,t[16]=y):y=t[16],y}function Ut(e){return!e}function Wt(e){let t=(0,Le.c)(148),{className:n,run:r,events:i,labels:a,cronLabels:s,language:l,loading:d,repairDraft:f,repairLoading:p,repairApproved:h,busyAction:g,onRepairApprovedChange:_,onSuggestRepair:v,onApplyRepair:y}=e;if(!r){let e;t[0]===n?e=t[1]:(e=m(`flex min-h-64 flex-col justify-center rounded-lg border border-edge-subtle bg-surface-base px-4 text-center text-sm text-fg-muted shadow-surface`,n),t[0]=n,t[1]=e);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(ee,{className:`mx-auto size-5`}),t[2]=r):r=t[2];let i;t[3]===a.selectRun?i=t[4]:(i=(0,X.jsx)(`div`,{className:`mt-2`,children:a.selectRun}),t[3]=a.selectRun,t[4]=i);let o;return t[5]!==e||t[6]!==i?(o=(0,X.jsxs)(`aside`,{className:e,children:[r,i]}),t[5]=e,t[6]=i,t[7]=o):o=t[7],o}let b=r.error||r.summary,x=r.conversationId?`/chat/${encodeURIComponent(r.conversationId)}`:r.workflowRunId?`/workflows?run=${encodeURIComponent(r.workflowRunId)}`:null,S=r.conversationId?a.runDetail.openConversation:a.runDetail.openWorkflow,C=r.conversationId?M:se,w=xt(r)?ee:r.status===`succeeded`?c:de,T;t[8]===n?T=t[9]:(T=m(`rounded-lg border border-edge-subtle bg-surface-base shadow-surface`,n),t[8]=n,t[9]=T);let E;t[10]===r.automationName?E=t[11]:(E=(0,X.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:r.automationName}),t[10]=r.automationName,t[11]=E);let D;t[12]===r.id?D=t[13]:(D=r.id.slice(0,8),t[12]=r.id,t[13]=D);let A;t[14]===D?A=t[15]:(A=(0,X.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:D}),t[14]=D,t[15]=A);let j;t[16]!==E||t[17]!==A?(j=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[E,A]}),t[16]=E,t[17]=A,t[18]=j):j=t[18];let N;t[19]===r.status?N=t[20]:(N=m(`shrink-0 rounded-full px-2 py-0.5 text-xs`,yt(r.status)),t[19]=r.status,t[20]=N);let te=a.status[r.status],P;t[21]!==N||t[22]!==te?(P=(0,X.jsx)(`span`,{className:N,children:te}),t[21]=N,t[22]=te,t[23]=P):P=t[23];let F;t[24]!==j||t[25]!==P?(F=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[j,P]}),t[24]=j,t[25]=P,t[26]=F):F=t[26];let I;t[27]!==a||t[28]!==l||t[29]!==r.createdAtMs?(I=ft(r.createdAtMs,a,l),t[27]=a,t[28]=l,t[29]=r.createdAtMs,t[30]=I):I=t[30];let L;t[31]===I?L=t[32]:(L=(0,X.jsx)(`span`,{children:I}),t[31]=I,t[32]=L);let re;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,X.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t[33]=re):re=t[33];let ae=a.details.duration,oe;t[34]!==a||t[35]!==r.durationMs?(oe=bt(r.durationMs,a),t[34]=a,t[35]=r.durationMs,t[36]=oe):oe=t[36];let z;t[37]!==a.details.duration||t[38]!==oe?(z=(0,X.jsxs)(`span`,{children:[ae,` `,oe]}),t[37]=a.details.duration,t[38]=oe,t[39]=z):z=t[39];let ce;t[40]!==L||t[41]!==z?(ce=(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-muted`,children:[L,re,z]}),t[40]=L,t[41]=z,t[42]=ce):ce=t[42];let le;t[43]!==a.repair||t[44]!==v||t[45]!==p||t[46]!==r?(le=r.status===`failed`||r.status===`timeout`||r.status===`cancelled`?(0,X.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,X.jsxs)(O,{variant:`secondary`,onClick:()=>v(r),disabled:p,children:[(0,X.jsx)(ne,{className:`size-4`}),p?a.repair.generating:a.repair.suggest]})}):null,t[43]=a.repair,t[44]=v,t[45]=p,t[46]=r,t[47]=le):le=t[47];let B;t[48]!==ce||t[49]!==le||t[50]!==F?(B=(0,X.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[F,ce,le]}),t[48]=ce,t[49]=le,t[50]=F,t[51]=B):B=t[51];let ue;t[52]===r?ue=t[53]:(ue=xt(r)?`text-blue-500`:St(r)?`text-red-500`:r.status===`succeeded`?`text-emerald-500`:`text-fg-muted`,t[52]=r,t[53]=ue);let fe;t[54]===ue?fe=t[55]:(fe=m(`size-4`,ue),t[54]=ue,t[55]=fe);let V;t[56]!==w||t[57]!==fe?(V=(0,X.jsx)(w,{className:fe}),t[56]=w,t[57]=fe,t[58]=V):V=t[58];let H;t[59]!==a.runDetail.resultTitle||t[60]!==V?(H=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[V,a.runDetail.resultTitle]}),t[59]=a.runDetail.resultTitle,t[60]=V,t[61]=H):H=t[61];let U;t[62]!==C||t[63]!==S||t[64]!==x?(U=x?(0,X.jsx)(O,{asChild:!0,variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,children:(0,X.jsxs)(o,{to:x,children:[(0,X.jsx)(C,{className:`size-3.5`}),S,(0,X.jsx)(R,{className:`size-3.5`})]})}):null,t[62]=C,t[63]=S,t[64]=x,t[65]=U):U=t[65];let W;t[66]!==H||t[67]!==U?(W=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[H,U]}),t[66]=H,t[67]=U,t[68]=W):W=t[68];let pe=r.error&&`border-red-500/25 bg-red-500/5`,me;t[69]===pe?me=t[70]:(me=m(`mt-3 max-h-80 overflow-y-auto rounded-lg border border-edge/70 bg-surface-inset/25 p-3`,pe),t[69]=pe,t[70]=me);let he;t[71]!==a.runDetail.noResult||t[72]!==a.runDetail.resultPending||t[73]!==b||t[74]!==r?(he=b?r.error?(0,X.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-red-700 dark:text-red-300`,children:b}):(0,X.jsx)(u,{content:b,compact:!0,className:`text-sm`}):(0,X.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:xt(r)?a.runDetail.resultPending:a.runDetail.noResult}),t[71]=a.runDetail.noResult,t[72]=a.runDetail.resultPending,t[73]=b,t[74]=r,t[75]=he):he=t[75];let G;t[76]!==me||t[77]!==he?(G=(0,X.jsx)(`div`,{className:me,children:he}),t[76]=me,t[77]=he,t[78]=G):G=t[78];let _e;t[79]!==W||t[80]!==G?(_e=(0,X.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[W,G]}),t[79]=W,t[80]=G,t[81]=_e):_e=t[81];let K;t[82]===a.runDetail.runInfo?K=t[83]:(K=(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:a.runDetail.runInfo}),t[82]=a.runDetail.runInfo,t[83]=K);let ve;t[84]!==s||t[85]!==a||t[86]!==l||t[87]!==r.manual||t[88]!==r.triggerSnapshot?(ve=r.manual?a.trigger.manual:Ce(r.triggerSnapshot,a,s,l),t[84]=s,t[85]=a,t[86]=l,t[87]=r.manual,t[88]=r.triggerSnapshot,t[89]=ve):ve=t[89];let ye;t[90]!==a.explain.whyRan||t[91]!==ve?(ye=(0,X.jsx)(Xt,{label:a.explain.whyRan,value:ve}),t[90]=a.explain.whyRan,t[91]=ve,t[92]=ye):ye=t[92];let be=a.details.started,xe;t[93]!==a||t[94]!==l||t[95]!==r.startedAtMs?(xe=ft(r.startedAtMs,a,l),t[93]=a,t[94]=l,t[95]=r.startedAtMs,t[96]=xe):xe=t[96];let Se;t[97]!==a.details.started||t[98]!==xe?(Se=(0,X.jsx)(Xt,{label:be,value:xe}),t[97]=a.details.started,t[98]=xe,t[99]=Se):Se=t[99];let we;t[100]!==a.details.model||t[101]!==r.model?(we=r.model?(0,X.jsx)(Xt,{label:a.details.model,value:r.model}):null,t[100]=a.details.model,t[101]=r.model,t[102]=we):we=t[102];let Te;t[103]!==ye||t[104]!==Se||t[105]!==we?(Te=(0,X.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-fg-muted`,children:[ye,Se,we]}),t[103]=ye,t[104]=Se,t[105]=we,t[106]=Te):Te=t[106];let Ee;t[107]!==K||t[108]!==Te?(Ee=(0,X.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[K,Te]}),t[107]=K,t[108]=Te,t[109]=Ee):Ee=t[109];let q;t[110]!==g||t[111]!==a||t[112]!==y||t[113]!==_||t[114]!==h||t[115]!==f||t[116]!==r?(q=f?(0,X.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:a.repair.title}),(0,X.jsx)(`div`,{className:`mt-2 text-sm text-fg`,children:f.explanation}),f.expectedEffect?(0,X.jsx)(`div`,{className:`mt-2 text-sm text-fg-muted`,children:f.expectedEffect}):null,(0,X.jsx)(Ft,{title:a.repair.risks,items:f.risks,empty:a.none}),(0,X.jsx)(Ht,{value:f.patch,labels:a,title:a.details.repairPatch}),f.requiresApproval?(0,X.jsxs)(`label`,{className:`mt-3 flex items-start gap-2 text-sm text-fg`,children:[(0,X.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:h,onChange:e=>_(e.target.checked)}),(0,X.jsx)(`span`,{children:a.repair.approval})]}):null,(0,X.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,X.jsx)(O,{variant:`primary`,onClick:()=>y(r),disabled:g===`run:${r.id}:repair`||f.requiresApproval&&!h,children:g===`run:${r.id}:repair`?a.feedback.working:a.repair.apply})})]}):null,t[110]=g,t[111]=a,t[112]=y,t[113]=_,t[114]=h,t[115]=f,t[116]=r,t[117]=q):q=t[117];let De;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,X.jsx)(ie,{className:`size-4 shrink-0`}),t[118]=De):De=t[118];let Oe;t[119]===a.runDetail.technicalEvents?Oe=t[120]:(Oe=(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium text-fg-muted`,children:[De,a.runDetail.technicalEvents]}),t[119]=a.runDetail.technicalEvents,t[120]=Oe);let ke;t[121]!==i.length||t[122]!==a.runDetail.eventCount?(ke=a.runDetail.eventCount.replace(`{count}`,String(i.length)),t[121]=i.length,t[122]=a.runDetail.eventCount,t[123]=ke):ke=t[123];let Ae;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,X.jsx)(ge,{className:`size-4 transition-transform group-open:rotate-180`}),t[124]=Ae):Ae=t[124];let J;t[125]===ke?J=t[126]:(J=(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-fg-muted`,children:[ke,Ae]}),t[125]=ke,t[126]=J);let je;t[127]!==Oe||t[128]!==J?(je=(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 rounded-md outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[Oe,J]}),t[127]=Oe,t[128]=J,t[129]=je):je=t[129];let Me;t[130]===a.runDetail.technicalEventsDescription?Me=t[131]:(Me=(0,X.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:a.runDetail.technicalEventsDescription}),t[130]=a.runDetail.technicalEventsDescription,t[131]=Me);let Ne;t[132]!==i||t[133]!==a||t[134]!==l||t[135]!==d?(Ne=(0,X.jsx)(`div`,{className:`mt-4`,children:d?(0,X.jsxs)(`div`,{className:`space-y-3`,"aria-label":a.loading,children:[(0,X.jsx)(k,{className:`h-10 w-full`}),(0,X.jsx)(k,{className:`h-10 w-4/5`}),(0,X.jsx)(k,{className:`h-10 w-11/12`})]}):i.length===0?(0,X.jsx)(`div`,{className:`text-sm text-fg-muted`,children:a.empty.events}):(0,X.jsx)(`ol`,{className:`space-y-3`,children:i.map(e=>(0,X.jsxs)(`li`,{className:`grid grid-cols-[0.75rem_1fr] gap-3`,children:[(0,X.jsx)(`span`,{className:m(`mt-1 size-2 rounded-full`,Zt(e.type))}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm text-fg`,children:Vt(e,a)}),(0,X.jsxs)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:[ft(e.createdAtMs,a,l),` · `,e.type]}),e.data&&typeof e.data==`object`?(0,X.jsxs)(`details`,{className:`group/event mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 px-2.5 py-2 text-xs font-medium text-fg-muted outline-none hover:text-fg`,children:[a.details.eventData,(0,X.jsx)(ge,{className:`size-3.5 transition-transform group-open/event:rotate-180`})]}),(0,X.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-all border-t border-edge/70 px-2.5 py-2 text-xs leading-relaxed text-fg-muted`,children:JSON.stringify(e.data,null,2)})]}):null]})]},e.id))})}),t[132]=i,t[133]=a,t[134]=l,t[135]=d,t[136]=Ne):Ne=t[136];let Pe;t[137]!==je||t[138]!==Me||t[139]!==Ne?(Pe=(0,X.jsxs)(`details`,{className:`group px-4 py-3`,children:[je,Me,Ne]}),t[137]=je,t[138]=Me,t[139]=Ne,t[140]=Pe):Pe=t[140];let Fe;return t[141]!==T||t[142]!==B||t[143]!==_e||t[144]!==Ee||t[145]!==q||t[146]!==Pe?(Fe=(0,X.jsxs)(`aside`,{className:T,children:[B,_e,Ee,q,Pe]}),t[141]=T,t[142]=B,t[143]=_e,t[144]=Ee,t[145]=q,t[146]=Pe,t[147]=Fe):Fe=t[147],Fe}function Gt(e){let t=(0,Le.c)(146),{automation:n,runs:r,runsLoading:i,runsError:a,labels:o,cronLabels:s,language:d,projects:f,busyAction:p,onEdit:h,onSelectRun:g,onAction:_}=e,v=p===`automation:${n.id}:run`,y=p===`automation:${n.id}:toggle`,b=p===`automation:${n.id}:delete`,x;t[0]===n.management?x=t[1]:(x=!n.management||n.management.editable.includes(`enabled`),t[0]=n.management,t[1]=x);let S=x,w=!n.management||n.management.runnable,T;t[2]===n.management?T=t[3]:(T=!n.management||n.management.editable.includes(`trigger`),t[2]=n.management,t[3]=T);let E=T,D=!n.management||n.management.deletable,A;t[4]===n.name?A=t[5]:(A=(0,X.jsx)(`h2`,{className:`truncate text-lg font-semibold text-fg`,children:n.name}),t[4]=n.name,t[5]=A);let j=n.enabled?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-surface-hover text-fg-muted`,M;t[6]===j?M=t[7]:(M=m(`shrink-0 rounded-full px-2 py-0.5 text-xs`,j),t[6]=j,t[7]=M);let te=n.enabled?o.enabled:o.paused,P;t[8]!==M||t[9]!==te?(P=(0,X.jsx)(`span`,{className:M,children:te}),t[8]=M,t[9]=te,t[10]=P):P=t[10];let F;t[11]!==A||t[12]!==P?(F=(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[A,P]}),t[11]=A,t[12]=P,t[13]=F):F=t[13];let I;t[14]===n?I=t[15]:(I=wt(n)?(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:wt(n)}):null,t[14]=n,t[15]=I);let L;t[16]===n.action.kind?L=t[17]:(L=(0,X.jsx)(_t,{kind:n.action.kind,className:`size-3.5`}),t[16]=n.action.kind,t[17]=L);let ne;t[18]!==n.action||t[19]!==o?(ne=mt(n.action,o),t[18]=n.action,t[19]=o,t[20]=ne):ne=t[20];let re;t[21]!==L||t[22]!==ne?(re=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[L,ne]}),t[21]=L,t[22]=ne,t[23]=re):re=t[23];let ie;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,X.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),t[24]=ie):ie=t[24];let ae;t[25]!==n.trigger||t[26]!==s||t[27]!==o||t[28]!==d?(ae=Ce(n.trigger,o,s,d),t[25]=n.trigger,t[26]=s,t[27]=o,t[28]=d,t[29]=ae):ae=t[29];let R;t[30]===ae?R=t[31]:(R=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[ie,ae]}),t[30]=ae,t[31]=R);let le;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,X.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),t[32]=le):le=t[32];let B;t[33]!==n.projectId||t[34]!==o.info||t[35]!==f?(B=f.find(e=>e.id===n.projectId)?.name??o.info.noProject,t[33]=n.projectId,t[34]=o.info,t[35]=f,t[36]=B):B=t[36];let ue;t[37]===B?ue=t[38]:(ue=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[le,B]}),t[37]=B,t[38]=ue);let de;t[39]!==re||t[40]!==R||t[41]!==ue?(de=(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[re,R,ue]}),t[39]=re,t[40]=R,t[41]=ue,t[42]=de):de=t[42];let U;t[43]!==de||t[44]!==F||t[45]!==I?(U=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[F,I,de]}),t[43]=de,t[44]=F,t[45]=I,t[46]=U):U=t[46];let W;t[47]!==n||t[48]!==p||t[49]!==D||t[50]!==E||t[51]!==w||t[52]!==S||t[53]!==b||t[54]!==o.dashboard.delete||t[55]!==o.dashboard.deleted||t[56]!==o.dashboard.pause||t[57]!==o.dashboard.resume||t[58]!==o.dashboard.resumed||t[59]!==o.dashboard.runNow||t[60]!==o.details||t[61]!==o.edit||t[62]!==o.experience.deleteConfirm||t[63]!==o.feedback||t[64]!==_||t[65]!==h||t[66]!==v||t[67]!==y?(W=S||w||E||D?(0,X.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-2`,children:[S?(0,X.jsxs)(O,{variant:`secondary`,disabled:p!==null,onClick:()=>void _(`automation:${n.id}:toggle`,()=>n.enabled?V.pause(n.id):V.resume(n.id),n.enabled?o.feedback.paused:o.dashboard.resumed),children:[y?(0,X.jsx)(oe,{className:`size-4 animate-spin`}):n.enabled?(0,X.jsx)(z,{className:`size-4`}):(0,X.jsx)(G,{className:`size-4`}),n.enabled?o.dashboard.pause:o.dashboard.resume]}):null,w?(0,X.jsxs)(O,{variant:`primary`,disabled:p!==null,onClick:()=>void _(`automation:${n.id}:run`,()=>V.runNow(n.id),o.feedback.rerunQueued),children:[v?(0,X.jsx)(oe,{className:`size-4 animate-spin`}):(0,X.jsx)(G,{className:`size-4`}),o.dashboard.runNow]}):null,E||D?(0,X.jsxs)(pe,{children:[(0,X.jsx)(fe,{asChild:!0,children:(0,X.jsx)(O,{variant:`ghost`,className:`size-9 p-0`,"aria-label":o.details.moreActions,children:(0,X.jsx)(l,{className:`size-4`})})}),(0,X.jsx)(_e,{children:(0,X.jsxs)(C,{align:`end`,className:`z-70 min-w-40 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:[E?(0,X.jsxs)(ce,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover`,onSelect:()=>h(n),children:[(0,X.jsx)(ye,{className:`size-4`}),o.edit]}):null,D?(0,X.jsxs)(ce,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-red-700 outline-none hover:bg-red-500/10 dark:text-red-300`,disabled:p!==null,onSelect:()=>{window.confirm(o.experience.deleteConfirm)&&_(`automation:${n.id}:delete`,()=>V.remove(n.id),o.dashboard.deleted)},children:[b?(0,X.jsx)(oe,{className:`size-4 animate-spin`}):(0,X.jsx)(N,{className:`size-4`}),o.dashboard.delete]}):null]})})]}):null]}):null,t[47]=n,t[48]=p,t[49]=D,t[50]=E,t[51]=w,t[52]=S,t[53]=b,t[54]=o.dashboard.delete,t[55]=o.dashboard.deleted,t[56]=o.dashboard.pause,t[57]=o.dashboard.resume,t[58]=o.dashboard.resumed,t[59]=o.dashboard.runNow,t[60]=o.details,t[61]=o.edit,t[62]=o.experience.deleteConfirm,t[63]=o.feedback,t[64]=_,t[65]=h,t[66]=v,t[67]=y,t[68]=W):W=t[68];let me;t[69]!==U||t[70]!==W?(me=(0,X.jsxs)(`header`,{className:`flex flex-col items-start gap-3 border-b border-edge px-5 py-4`,children:[U,W]}),t[69]=U,t[70]=W,t[71]=me):me=t[71];let he;t[72]===o.dashboard.latestResult?he=t[73]:(he=(0,X.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.latestResult}),t[72]=o.dashboard.latestResult,t[73]=he);let ge;t[74]!==o.experience.viewResult||t[75]!==g||t[76]!==r[0]?(ge=r[0]?(0,X.jsx)(O,{variant:`secondary`,onClick:()=>g(r[0].id),children:o.experience.viewResult}):null,t[74]=o.experience.viewResult,t[75]=g,t[76]=r[0],t[77]=ge):ge=t[77];let K;t[78]!==he||t[79]!==ge?(K=(0,X.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[he,ge]}),t[78]=he,t[79]=ge,t[80]=K):K=t[80];let ve;t[81]!==o||t[82]!==d||t[83]!==r[0]||t[84]!==a||t[85]!==i?(ve=a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-red-700 dark:text-red-300`,children:a}):i?(0,X.jsx)(k,{className:`h-28 w-full`}):r[0]?(0,X.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge-subtle bg-surface-base p-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,X.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5`,yt(r[0].status)),children:o.status[r[0].status]}),ft(r[0].createdAtMs,o,d)]}),(0,X.jsx)(u,{content:r[0].error||r[0].summary||(xt(r[0])?o.runDetail.resultPending:o.runDetail.noResult),compact:!0})]}):(0,X.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.experience.noRuns}),t[81]=o,t[82]=d,t[83]=r[0],t[84]=a,t[85]=i,t[86]=ve):ve=t[86];let be;t[87]!==n||t[88]!==o||t[89]!==d?(be=n.enabled?`${o.next}: ${q(n,o,d)}`:o.paused,t[87]=n,t[88]=o,t[89]=d,t[90]=be):be=t[90];let xe;t[91]===be?xe=t[92]:(xe=(0,X.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:be}),t[91]=be,t[92]=xe);let Se;t[93]!==K||t[94]!==ve||t[95]!==xe?(Se=(0,X.jsxs)(`section`,{children:[K,ve,xe]}),t[93]=K,t[94]=ve,t[95]=xe,t[96]=Se):Se=t[96];let we;t[97]===o.dashboard.runHistory?we=t[98]:(we=(0,X.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.runHistory}),t[97]=o.dashboard.runHistory,t[98]=we);let Te;t[99]===o.dashboard.runHistoryDescription?Te=t[100]:(Te=(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:o.dashboard.runHistoryDescription}),t[99]=o.dashboard.runHistoryDescription,t[100]=Te);let Ee;t[101]!==we||t[102]!==Te?(Ee=(0,X.jsxs)(`div`,{children:[we,Te]}),t[101]=we,t[102]=Te,t[103]=Ee):Ee=t[103];let De;t[104]===r.length?De=t[105]:(De=(0,X.jsx)(`span`,{className:`rounded-full bg-surface-base px-2.5 py-1 text-xs text-fg-muted`,children:r.length}),t[104]=r.length,t[105]=De);let Oe;t[106]!==Ee||t[107]!==De?(Oe=(0,X.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[Ee,De]}),t[106]=Ee,t[107]=De,t[108]=Oe):Oe=t[108];let ke;t[109]!==o||t[110]!==d||t[111]!==g||t[112]!==r||t[113]!==i?(ke=i?(0,X.jsx)(k,{className:`h-24 w-full`}):r.length===0?(0,X.jsx)($t,{className:`min-h-24 py-6`,icon:(0,X.jsx)(ee,{className:`size-5`}),title:o.empty.runs}):(0,X.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge-subtle bg-surface-base`,children:r.slice(0,8).map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`block w-full p-3 text-left hover:bg-surface-hover`,onClick:()=>g(e.id),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.status===`succeeded`?(0,X.jsx)(c,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-300`}):(0,X.jsx)(ee,{className:`size-4 shrink-0 text-fg-muted`}),(0,X.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:ft(e.createdAtMs,o,d)})]}),(0,X.jsx)(`span`,{className:m(`shrink-0 rounded-full px-2 py-0.5 text-xs`,yt(e.status)),children:o.status[e.status]})]}),(0,X.jsx)(`p`,{className:m(`mt-1 line-clamp-2 pl-6 text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||pt(e.actionSnapshot,o)})]},e.id))}),t[109]=o,t[110]=d,t[111]=g,t[112]=r,t[113]=i,t[114]=ke):ke=t[114];let Ae;t[115]!==Oe||t[116]!==ke?(Ae=(0,X.jsxs)(`section`,{className:`min-w-0`,children:[Oe,ke]}),t[115]=Oe,t[116]=ke,t[117]=Ae):Ae=t[117];let J;t[118]===o.experience.settings?J=t[119]:(J=(0,X.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:o.experience.settings}),t[118]=o.experience.settings,t[119]=J);let je;t[120]!==n||t[121]!==o?(je=Ct(n,o),t[120]=n,t[121]=o,t[122]=je):je=t[122];let Me;t[123]===je?Me=t[124]:(Me=(0,X.jsx)(u,{content:je,compact:!0}),t[123]=je,t[124]=Me);let Ne;t[125]!==n||t[126]!==s||t[127]!==o||t[128]!==d||t[129]!==f?(Ne=(0,X.jsx)(qt,{automation:n,labels:o,cronLabels:s,language:d,projects:f}),t[125]=n,t[126]=s,t[127]=o,t[128]=d,t[129]=f,t[130]=Ne):Ne=t[130];let Pe;t[131]!==Me||t[132]!==Ne?(Pe=(0,X.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[Me,Ne]}),t[131]=Me,t[132]=Ne,t[133]=Pe):Pe=t[133];let Fe;t[134]!==J||t[135]!==Pe?(Fe=(0,X.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-4`,children:[J,Pe]}),t[134]=J,t[135]=Pe,t[136]=Fe):Fe=t[136];let Ie;t[137]!==Ae||t[138]!==Fe?(Ie=(0,X.jsxs)(`div`,{className:`grid gap-5`,children:[Ae,Fe]}),t[137]=Ae,t[138]=Fe,t[139]=Ie):Ie=t[139];let Y;t[140]!==Se||t[141]!==Ie?(Y=(0,X.jsxs)(`div`,{className:`grid gap-5 p-5`,children:[Se,Ie]}),t[140]=Se,t[141]=Ie,t[142]=Y):Y=t[142];let Re;return t[143]!==me||t[144]!==Y?(Re=(0,X.jsxs)(`article`,{className:`min-w-0 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel shadow-surface`,children:[me,Y]}),t[143]=me,t[144]=Y,t[145]=Re):Re=t[145],Re}function Kt(e,t){return e===`suggest_only`?t.safety.suggestOnlyDescription:e===`ask_before_apply`?t.safety.askBeforeApplyDescription:t.safety.autoApplyDescription}function qt(e){let t=(0,Le.c)(146),{automation:n,labels:r,cronLabels:i,language:a,projects:o}=e,s,l,u,d,f,p,m,h,g,_,v;if(t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a){let e=vt(n),o;t[15]!==n||t[16]!==r||t[17]!==a?(o=q(n,r,a),t[15]=n,t[16]=r,t[17]=a,t[18]=o):o=t[18];let y=o,b;t[19]!==n.state.nextRunAtMs||t[20]!==a?(b=n.state.nextRunAtMs?Ee(n.state.nextRunAtMs,a):void 0,t[19]=n.state.nextRunAtMs,t[20]=a,t[21]=b):b=t[21];let x=b;if(t[22]!==n.trigger.eventType||t[23]!==n.trigger.kind||t[24]!==n.trigger.schedule||t[25]!==n.trigger.secretId||t[26]!==n.trigger.source||t[27]!==r.info.anchor||t[28]!==r.info.calendarSchedule||t[29]!==r.info.eventSource||t[30]!==r.info.eventType||t[31]!==r.info.expression||t[32]!==r.info.fixedInterval||t[33]!==r.info.oneTimeSchedule||t[34]!==r.info.rawInterval||t[35]!==r.info.scheduleType||t[36]!==r.info.timezone||t[37]!==r.info.webhookSecret||t[38]!==a){if(v=[],n.trigger.kind===`schedule`){let e=n.trigger.schedule,i=e.kind===`interval`?r.info.fixedInterval:e.kind===`cron`?r.info.calendarSchedule:r.info.oneTimeSchedule,o;if(t[40]!==r.info.scheduleType||t[41]!==i?(o={label:r.info.scheduleType,value:i},t[40]=r.info.scheduleType,t[41]=i,t[42]=o):o=t[42],v.push(o),e.kind===`interval`){let n=`${e.everyMs} ms`,i;if(t[43]!==r.info.rawInterval||t[44]!==n?(i={label:r.info.rawInterval,value:n},t[43]=r.info.rawInterval,t[44]=n,t[45]=i):i=t[45],v.push(i),e.anchorMs){let n=r.info.anchor,i;t[46]!==a||t[47]!==e.anchorMs?(i=Ee(e.anchorMs,a),t[46]=a,t[47]=e.anchorMs,t[48]=i):i=t[48];let o;t[49]!==r.info.anchor||t[50]!==i?(o={label:n,value:i},t[49]=r.info.anchor,t[50]=i,t[51]=o):o=t[51],v.push(o)}}else if(e.kind===`cron`){let n;if(t[52]!==r.info.expression||t[53]!==e.expr?(n={label:r.info.expression,value:e.expr},t[52]=r.info.expression,t[53]=e.expr,t[54]=n):n=t[54],v.push(n),e.tz){let n;t[55]!==r.info.timezone||t[56]!==e.tz?(n={label:r.info.timezone,value:e.tz},t[55]=r.info.timezone,t[56]=e.tz,t[57]=n):n=t[57],v.push(n)}}else{let n;t[58]!==r.info.oneTimeSchedule||t[59]!==e.at?(n={label:r.info.oneTimeSchedule,value:e.at},t[58]=r.info.oneTimeSchedule,t[59]=e.at,t[60]=n):n=t[60],v.push(n)}}else if(n.trigger.kind===`event`){let e;if(t[61]!==n.trigger.eventType||t[62]!==r.info.eventType?(e={label:r.info.eventType,value:n.trigger.eventType},t[61]=n.trigger.eventType,t[62]=r.info.eventType,t[63]=e):e=t[63],v.push(e),n.trigger.source){let e;t[64]!==n.trigger.source||t[65]!==r.info.eventSource?(e={label:r.info.eventSource,value:n.trigger.source},t[64]=n.trigger.source,t[65]=r.info.eventSource,t[66]=e):e=t[66],v.push(e)}}else if(n.trigger.kind===`webhook`&&n.trigger.secretId){let e;t[67]!==n.trigger.secretId||t[68]!==r.info.webhookSecret?(e={label:r.info.webhookSecret,value:n.trigger.secretId},t[67]=n.trigger.secretId,t[68]=r.info.webhookSecret,t[69]=e):e=t[69],v.push(e)}t[22]=n.trigger.eventType,t[23]=n.trigger.kind,t[24]=n.trigger.schedule,t[25]=n.trigger.secretId,t[26]=n.trigger.source,t[27]=r.info.anchor,t[28]=r.info.calendarSchedule,t[29]=r.info.eventSource,t[30]=r.info.eventType,t[31]=r.info.expression,t[32]=r.info.fixedInterval,t[33]=r.info.oneTimeSchedule,t[34]=r.info.rawInterval,t[35]=r.info.scheduleType,t[36]=r.info.timezone,t[37]=r.info.webhookSecret,t[38]=a,t[39]=v}else v=t[39];g=`h-fit overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,t[70]===r.info.overview?_=t[71]:(_=(0,X.jsx)(`div`,{className:`border-b border-edge-subtle px-4 py-3`,children:(0,X.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r.info.overview})}),t[70]=r.info.overview,t[71]=_),p=`grid gap-4 p-4`;let S;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,X.jsx)(H,{className:`size-4`,"aria-hidden":!0}),t[72]=S):S=t[72];let C=r.info.schedule,w;t[73]!==n.trigger||t[74]!==i||t[75]!==r||t[76]!==a?(w=Ce(n.trigger,r,i,a),t[73]=n.trigger,t[74]=i,t[75]=r,t[76]=a,t[77]=w):w=t[77];let T=n.enabled?`${r.info.nextRun}:${y}`:y;t[78]!==r.info.schedule||t[79]!==x||t[80]!==w||t[81]!==T?(m=(0,X.jsx)(Yt,{icon:S,label:C,value:w,description:T,descriptionTitle:x}),t[78]=r.info.schedule,t[79]=x,t[80]=w,t[81]=T,t[82]=m):m=t[82];let E;t[83]===n.action.kind?E=t[84]:(E=n.action.kind===`workflow`?(0,X.jsx)(se,{className:`size-4`,"aria-hidden":!0}):n.action.kind===`browser_automation`?(0,X.jsx)(ie,{className:`size-4`,"aria-hidden":!0}):n.action.kind===`task_command`?(0,X.jsx)(c,{className:`size-4`,"aria-hidden":!0}):(0,X.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[83]=n.action.kind,t[84]=E);let D=r.info.action,O;t[85]!==n.action||t[86]!==r?(O=pt(n.action,r),t[85]=n.action,t[86]=r,t[87]=O):O=t[87],t[88]!==r.info.action||t[89]!==E||t[90]!==O?(h=(0,X.jsx)(Yt,{icon:E,label:D,value:O}),t[88]=r.info.action,t[89]=E,t[90]=O,t[91]=h):h=t[91],s=Yt,t[92]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(A,{className:`size-4`,"aria-hidden":!0}),t[92]=l):l=t[92],u=r.info.permission,d=r.safety[e],f=Kt(e,r),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h,t[12]=g,t[13]=_,t[14]=v}else s=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11],g=t[12],_=t[13],v=t[14];let y;t[93]!==s||t[94]!==l||t[95]!==u||t[96]!==d||t[97]!==f?(y=(0,X.jsx)(s,{icon:l,label:u,value:d,description:f}),t[93]=s,t[94]=l,t[95]=u,t[96]=d,t[97]=f,t[98]=y):y=t[98];let b;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(se,{className:`size-4`,"aria-hidden":!0}),t[99]=b):b=t[99];let x;t[100]!==n.projectId||t[101]!==r.info.noProject||t[102]!==o?(x=o.find(e=>e.id===n.projectId)?.name??r.info.noProject,t[100]=n.projectId,t[101]=r.info.noProject,t[102]=o,t[103]=x):x=t[103];let S;t[104]!==r.info.project||t[105]!==x?(S=(0,X.jsx)(Yt,{icon:b,label:r.info.project,value:x}),t[104]=r.info.project,t[105]=x,t[106]=S):S=t[106];let C;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(M,{className:`size-4`,"aria-hidden":!0}),t[107]=C):C=t[107];let w=n.conversationMode===`continuous`?r.info.continuousConversation:r.info.newConversation,T;t[108]!==r.info.conversation||t[109]!==w?(T=(0,X.jsx)(Yt,{icon:C,label:r.info.conversation,value:w}),t[108]=r.info.conversation,t[109]=w,t[110]=T):T=t[110];let E;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(de,{className:`size-4`,"aria-hidden":!0}),t[111]=E):E=t[111];let D=n.delivery.notificationPolicy===`all`?r.info.notifyAll:n.delivery.notificationPolicy===`none`?r.info.notifyNone:r.info.notifyAttention,O;t[112]!==r.info.notifications||t[113]!==D?(O=(0,X.jsx)(Yt,{icon:E,label:r.info.notifications,value:D}),t[112]=r.info.notifications,t[113]=D,t[114]=O):O=t[114];let k;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[115]=k):k=t[115];let j=r.info.lastRun,N;t[116]!==n||t[117]!==r||t[118]!==a?(N=Te(n,r,a),t[116]=n,t[117]=r,t[118]=a,t[119]=N):N=t[119];let te=n.state.lastRunStatus===`failed`||n.state.lastRunStatus===`timeout`?`danger`:`default`,P;t[120]!==r.info.lastRun||t[121]!==N||t[122]!==te?(P=(0,X.jsx)(Yt,{icon:k,label:j,value:N,valueTone:te}),t[120]=r.info.lastRun,t[121]=N,t[122]=te,t[123]=P):P=t[123];let F;t[124]!==n.state.consecutiveFailures||t[125]!==n.state.lastError||t[126]!==r.dashboard?(F=n.state.consecutiveFailures?(0,X.jsxs)(`div`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:[r.dashboard.failures,`:`,n.state.consecutiveFailures,n.state.lastError?(0,X.jsx)(`p`,{className:`mt-1 break-words text-xs`,children:n.state.lastError}):null]}):n.state.lastError?(0,X.jsx)(`p`,{className:`break-words text-sm text-red-700 dark:text-red-300`,children:n.state.lastError}):null,t[124]=n.state.consecutiveFailures,t[125]=n.state.lastError,t[126]=r.dashboard,t[127]=F):F=t[127];let I;t[128]!==r.info.technicalDetails||t[129]!==v?(I=v.length>0?(0,X.jsxs)(`details`,{className:`group border-t border-edge-subtle pt-3`,children:[(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-sm text-fg-muted outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,X.jsx)(`span`,{children:r.info.technicalDetails}),(0,X.jsx)(ge,{className:`size-4 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,X.jsx)(`div`,{className:`mt-3 grid gap-2`,children:v.map(Jt)})]}):null,t[128]=r.info.technicalDetails,t[129]=v,t[130]=I):I=t[130];let L;t[131]!==y||t[132]!==S||t[133]!==T||t[134]!==O||t[135]!==P||t[136]!==F||t[137]!==I||t[138]!==p||t[139]!==m||t[140]!==h?(L=(0,X.jsxs)(`div`,{className:p,children:[m,h,y,S,T,O,P,F,I]}),t[131]=y,t[132]=S,t[133]=T,t[134]=O,t[135]=P,t[136]=F,t[137]=I,t[138]=p,t[139]=m,t[140]=h,t[141]=L):L=t[141];let ne;return t[142]!==L||t[143]!==g||t[144]!==_?(ne=(0,X.jsxs)(`aside`,{className:g,children:[_,L]}),t[142]=L,t[143]=g,t[144]=_,t[145]=ne):ne=t[145],ne}function Jt(e){return(0,X.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,X.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e.label}),(0,X.jsx)(`span`,{className:`break-all font-mono text-xs text-fg-muted`,children:e.value})]},`${e.label}:${e.value}`)}function Yt(e){let t=(0,Le.c)(19),{icon:n,label:r,value:i,description:a,descriptionTitle:o,valueTone:s}=e,c=s===void 0?`default`:s,l;t[0]===n?l=t[1]:(l=(0,X.jsx)(`span`,{className:`mt-0.5 text-fg-subtle`,children:n}),t[0]=n,t[1]=l);let u;t[2]===r?u=t[3]:(u=(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r}),t[2]=r,t[3]=u);let d=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,f;t[4]===d?f=t[5]:(f=m(`mt-1 text-sm font-medium leading-5`,d),t[4]=d,t[5]=f);let p;t[6]!==f||t[7]!==i?(p=(0,X.jsx)(`div`,{className:f,children:i}),t[6]=f,t[7]=i,t[8]=p):p=t[8];let h;t[9]!==a||t[10]!==o?(h=a?(0,X.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,title:o,children:a}):null,t[9]=a,t[10]=o,t[11]=h):h=t[11];let g;t[12]!==u||t[13]!==p||t[14]!==h?(g=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[u,p,h]}),t[12]=u,t[13]=p,t[14]=h,t[15]=g):g=t[15];let _;return t[16]!==l||t[17]!==g?(_=(0,X.jsxs)(`div`,{className:`grid grid-cols-[1.25rem_1fr] gap-2.5`,children:[l,g]}),t[16]=l,t[17]=g,t[18]=_):_=t[18],_}function Xt(e){let t=(0,Le.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`grid grid-cols-[5rem_1fr] gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Zt(e){return e.endsWith(`.failed`)?`bg-red-500`:e.endsWith(`.completed`)?`bg-emerald-500`:e.endsWith(`.started`)?`bg-blue-500`:`bg-fg-muted`}function Qt(e){let t=(0,Le.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`div`,{className:`text-xs font-medium uppercase text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`div`,{className:`mt-1 truncate text-sm text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function $t(e){let t=(0,Le.c)(8),{className:n,icon:r,title:i}=e,a;t[0]===n?a=t[1]:(a=m(`flex min-h-48 flex-col items-center justify-center text-fg-muted`,n),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,X.jsx)(`div`,{className:`mt-2 text-sm`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==r||t[5]!==a||t[6]!==o?(s=(0,X.jsxs)(`div`,{className:a,children:[r,o]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function en(e){let t=(0,Le.c)(349),{form:n,labels:r,setForm:i,projects:a,workflowDefinitions:o,selectedWorkflow:s,workflowsLoading:c,browserAutomations:l,selectedBrowserAutomation:u,browserAutomationsLoading:d,agentOptions:f,agentsLoading:h,defaultAgentId:g,taskOptions:_,tasksLoading:v,language:y,projectLocked:b}=e,x=b===void 0?!1:b,S=p(y).agentsSettings,C;t[0]===i?C=t[1]:(C=e=>i(t=>({...t,...e})),t[0]=i,t[1]=C);let T=C,E=Oe(n.intervalValue,n.intervalUnit),D=Date.now(),O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=[1,2,3],t[2]=O):O=t[2];let k;t[3]!==E||t[4]!==D||t[5]!==y?(k=O.map(e=>we(D+E*e,y,D)),t[3]=E,t[4]=D,t[5]=y,t[6]=k):k=t[6];let A=k,j;if(t[7]!==n.projectId||t[8]!==n.taskId||t[9]!==_){let e;t[11]!==n.projectId||t[12]!==n.taskId?(e=e=>e.id===n.taskId||e.phase!==`closed`&&(!n.projectId||e.projectId===n.projectId),t[11]=n.projectId,t[12]=n.taskId,t[13]=e):e=t[13],j=_.filter(e),t[7]=n.projectId,t[8]=n.taskId,t[9]=_,t[10]=j}else j=t[10];let M=j,ee,N;t[14]!==g||t[15]!==n.actionMode||t[16]!==n.agentId||t[17]!==i?(ee=()=>{n.actionMode!==`task_command`||n.agentId.trim()||!g||i(e=>({...e,agentId:g}))},N=[g,n.actionMode,n.agentId,i],t[14]=g,t[15]=n.actionMode,t[16]=n.agentId,t[17]=i,t[18]=ee,t[19]=N):(ee=t[18],N=t[19]),(0,Y.useEffect)(ee,N);let F,I;t[20]!==n.actionMode||t[21]!==n.workflowId||t[22]!==i||t[23]!==o?(F=()=>{if(n.actionMode!==`workflow`||n.workflowId.trim())return;let e=o[0]?.id;e&&i(t=>({...t,workflowId:e,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0}))},I=[n.actionMode,n.workflowId,i,o],t[20]=n.actionMode,t[21]=n.workflowId,t[22]=i,t[23]=o,t[24]=F,t[25]=I):(F=t[24],I=t[25]),(0,Y.useEffect)(F,I);let L,ne;t[26]!==l||t[27]!==n.actionMode||t[28]!==n.browserAutomationId||t[29]!==i?(L=()=>{if(n.actionMode!==`browser_automation`||n.browserAutomationId.trim())return;let e=l[0];e&&i(t=>({...t,browserAutomationId:e.id,browserAutomationInputs:Fe(e)}))},ne=[l,n.actionMode,n.browserAutomationId,i],t[26]=l,t[27]=n.actionMode,t[28]=n.browserAutomationId,t[29]=i,t[30]=L,t[31]=ne):(L=t[30],ne=t[31]),(0,Y.useEffect)(L,ne);let re;t[32]===T?re=t[33]:(re=e=>T({name:e.target.value}),t[32]=T,t[33]=re);let ie;t[34]!==n.name||t[35]!==re?(ie=(0,X.jsx)(`input`,{className:Q,value:n.name,onChange:re}),t[34]=n.name,t[35]=re,t[36]=ie):ie=t[36];let ae;t[37]!==r.form.name||t[38]!==ie?(ae=(0,X.jsx)($,{label:r.form.name,children:ie}),t[37]=r.form.name,t[38]=ie,t[39]=ae):ae=t[39];let oe;t[40]===T?oe=t[41]:(oe=e=>T({description:e.target.value}),t[40]=T,t[41]=oe);let se;t[42]!==n.description||t[43]!==oe?(se=(0,X.jsx)(`input`,{className:Q,value:n.description,onChange:oe}),t[42]=n.description,t[43]=oe,t[44]=se):se=t[44];let z;t[45]!==r.form.description||t[46]!==se?(z=(0,X.jsx)($,{label:r.form.description,children:se}),t[45]=r.form.description,t[46]=se,t[47]=z):z=t[47];let ce;t[48]!==n.projectId||t[49]!==r.form.noProject||t[50]!==r.form.project||t[51]!==x||t[52]!==a||t[53]!==T?(ce=x?null:(0,X.jsx)($,{label:r.form.project,children:(0,X.jsxs)(U,{className:Q,value:n.projectId,onChange:e=>T({projectId:e.target.value}),children:[(0,X.jsx)(K,{value:``,children:r.form.noProject}),a.map(nn)]})}),t[48]=n.projectId,t[49]=r.form.noProject,t[50]=r.form.project,t[51]=x,t[52]=a,t[53]=T,t[54]=ce):ce=t[54];let le=r.form.rulePreview,B;t[55]===r.form.rulePreview?B=t[56]:(B=(0,X.jsx)(`div`,{className:`text-xs font-medium text-accent-fg`,children:r.form.rulePreview}),t[55]=r.form.rulePreview,t[56]=B);let ue;t[57]!==n.triggerMode||t[58]!==r?(ue=gt(n.triggerMode,r),t[57]=n.triggerMode,t[58]=r,t[59]=ue):ue=t[59];let de;t[60]===ue?de=t[61]:(de=(0,X.jsx)(`span`,{children:ue}),t[60]=ue,t[61]=de);let fe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,X.jsx)(R,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),t[62]=fe):fe=t[62];let V;t[63]!==n.actionMode||t[64]!==r?(V=ht(n.actionMode,r),t[63]=n.actionMode,t[64]=r,t[65]=V):V=t[65];let H;t[66]===V?H=t[67]:(H=(0,X.jsx)(`span`,{children:V}),t[66]=V,t[67]=H);let W;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(R,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),t[68]=W):W=t[68];let pe;t[69]!==n.projectId||t[70]!==r.form.noProject||t[71]!==r.form.project||t[72]!==a?(pe=n.projectId?a.find(e=>e.id===n.projectId)?.name??r.form.project:r.form.noProject,t[69]=n.projectId,t[70]=r.form.noProject,t[71]=r.form.project,t[72]=a,t[73]=pe):pe=t[73];let me;t[74]===pe?me=t[75]:(me=(0,X.jsx)(`span`,{children:pe}),t[74]=pe,t[75]=me);let he;t[76]!==de||t[77]!==H||t[78]!==me?(he=(0,X.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-sm text-fg`,children:[de,fe,H,W,me]}),t[76]=de,t[77]=H,t[78]=me,t[79]=he):he=t[79];let G;t[80]!==r.form.rulePreview||t[81]!==B||t[82]!==he?(G=(0,X.jsxs)(`div`,{className:`rounded-xl border border-accent/20 bg-accent/5 px-4 py-3`,"aria-label":le,children:[B,he]}),t[80]=r.form.rulePreview,t[81]=B,t[82]=he,t[83]=G):G=t[83];let _e;t[84]!==r.form.trigger||t[85]!==r.form.triggerStepDescription?(_e=(0,X.jsx)(rn,{step:`1`,title:r.form.trigger,description:r.form.triggerStepDescription}),t[84]=r.form.trigger,t[85]=r.form.triggerStepDescription,t[86]=_e):_e=t[86];let ve;t[87]===T?ve=t[88]:(ve=e=>T({triggerMode:e.target.value}),t[87]=T,t[88]=ve);let ye;t[89]===r.trigger.manual?ye=t[90]:(ye=(0,X.jsx)(K,{value:`manual`,children:r.trigger.manual}),t[89]=r.trigger.manual,t[90]=ye);let be;t[91]===r.trigger.once?be=t[92]:(be=(0,X.jsx)(K,{value:`once`,children:r.trigger.once}),t[91]=r.trigger.once,t[92]=be);let Ce;t[93]===r.trigger.daily?Ce=t[94]:(Ce=(0,X.jsx)(K,{value:`daily`,children:r.trigger.daily}),t[93]=r.trigger.daily,t[94]=Ce);let Te;t[95]===r.trigger.weekly?Te=t[96]:(Te=(0,X.jsx)(K,{value:`weekly`,children:r.trigger.weekly}),t[95]=r.trigger.weekly,t[96]=Te);let Ee;t[97]===r.trigger.interval?Ee=t[98]:(Ee=(0,X.jsx)(K,{value:`interval`,children:r.trigger.interval}),t[97]=r.trigger.interval,t[98]=Ee);let q;t[99]===r.trigger.customCron?q=t[100]:(q=(0,X.jsx)(K,{value:`cron`,children:r.trigger.customCron}),t[99]=r.trigger.customCron,t[100]=q);let ke;t[101]===r.trigger.webhook?ke=t[102]:(ke=(0,X.jsx)(K,{value:`webhook`,children:r.trigger.webhook}),t[101]=r.trigger.webhook,t[102]=ke);let Ae;t[103]===r.trigger.taskBlocked?Ae=t[104]:(Ae=(0,X.jsx)(K,{value:`taskBlocked`,children:r.trigger.taskBlocked}),t[103]=r.trigger.taskBlocked,t[104]=Ae);let J;t[105]===r.trigger.noteCreated?J=t[106]:(J=(0,X.jsx)(K,{value:`noteCreated`,children:r.trigger.noteCreated}),t[105]=r.trigger.noteCreated,t[106]=J);let Ne;t[107]===r.trigger.workflowFailed?Ne=t[108]:(Ne=(0,X.jsx)(K,{value:`workflowFailed`,children:r.trigger.workflowFailed}),t[107]=r.trigger.workflowFailed,t[108]=Ne);let Pe;t[109]===r.trigger.sessionUpdated?Pe=t[110]:(Pe=(0,X.jsx)(K,{value:`sessionUpdated`,children:r.trigger.sessionUpdated}),t[109]=r.trigger.sessionUpdated,t[110]=Pe);let Re;t[111]===r.trigger.customEvent?Re=t[112]:(Re=(0,X.jsx)(K,{value:`event`,children:r.trigger.customEvent}),t[111]=r.trigger.customEvent,t[112]=Re);let ze;t[113]!==n.triggerMode||t[114]!==ve||t[115]!==ye||t[116]!==be||t[117]!==Ce||t[118]!==Te||t[119]!==Ee||t[120]!==q||t[121]!==ke||t[122]!==Ae||t[123]!==J||t[124]!==Ne||t[125]!==Pe||t[126]!==Re?(ze=(0,X.jsxs)(U,{className:Q,value:n.triggerMode,onChange:ve,children:[ye,be,Ce,Te,Ee,q,ke,Ae,J,Ne,Pe,Re]}),t[113]=n.triggerMode,t[114]=ve,t[115]=ye,t[116]=be,t[117]=Ce,t[118]=Te,t[119]=Ee,t[120]=q,t[121]=ke,t[122]=Ae,t[123]=J,t[124]=Ne,t[125]=Pe,t[126]=Re,t[127]=ze):ze=t[127];let Be;t[128]!==n.onceAt||t[129]!==n.triggerMode||t[130]!==r.form.onceAt||t[131]!==T?(Be=n.triggerMode===`once`?(0,X.jsx)($,{label:r.form.onceAt,children:(0,X.jsx)(`input`,{className:Q,type:`datetime-local`,value:n.onceAt,onChange:e=>T({onceAt:e.target.value})})}):null,t[128]=n.onceAt,t[129]=n.triggerMode,t[130]=r.form.onceAt,t[131]=T,t[132]=Be):Be=t[132];let Ve;t[133]!==n.time||t[134]!==n.triggerMode||t[135]!==n.weekday||t[136]!==r.form.day||t[137]!==r.form.time||t[138]!==r.weekdays||t[139]!==T?(Ve=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:r.form.time,children:(0,X.jsx)(He,{value:n.time,onChange:e=>T({time:e}),ariaLabel:r.form.time})}),n.triggerMode===`weekly`?(0,X.jsx)($,{label:r.form.day,children:(0,X.jsxs)(U,{className:Q,value:n.weekday,onChange:e=>T({weekday:e.target.value}),children:[(0,X.jsx)(K,{value:`1`,children:r.weekdays.monday}),(0,X.jsx)(K,{value:`2`,children:r.weekdays.tuesday}),(0,X.jsx)(K,{value:`3`,children:r.weekdays.wednesday}),(0,X.jsx)(K,{value:`4`,children:r.weekdays.thursday}),(0,X.jsx)(K,{value:`5`,children:r.weekdays.friday}),(0,X.jsx)(K,{value:`6`,children:r.weekdays.saturday}),(0,X.jsx)(K,{value:`0`,children:r.weekdays.sunday})]})}):null]}):null,t[133]=n.time,t[134]=n.triggerMode,t[135]=n.weekday,t[136]=r.form.day,t[137]=r.form.time,t[138]=r.weekdays,t[139]=T,t[140]=Ve):Ve=t[140];let Ue=n.triggerMode===`interval`?(0,X.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,X.jsx)($,{label:r.form.intervalEvery,children:(0,X.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,X.jsx)(`input`,{className:Q,type:`number`,min:6e4/Oe(1,n.intervalUnit),step:`any`,inputMode:`decimal`,value:n.intervalValue,onChange:e=>T({intervalValue:e.target.value})}),(0,X.jsxs)(U,{className:Q,value:n.intervalUnit,onChange:e=>{let t=e.target.value;T({intervalValue:xe(n.intervalValue,n.intervalUnit,t),intervalUnit:t})},children:[(0,X.jsx)(K,{value:`minute`,children:r.form.intervalUnits.minute}),(0,X.jsx)(K,{value:`hour`,children:r.form.intervalUnits.hour}),(0,X.jsx)(K,{value:`day`,children:r.form.intervalUnits.day}),(0,X.jsx)(K,{value:`week`,children:r.form.intervalUnits.week})]})]})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.form.commonIntervals}),(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:qe.map(e=>{let t=Oe(e.value,e.unit),n=t===E;return(0,X.jsx)(`button`,{type:`button`,"aria-pressed":n,className:m(`rounded-full border px-2.5 py-1 text-xs transition-colors`,n?`border-accent bg-accent/10 text-accent`:`border-edge-subtle text-fg-muted hover:border-edge hover:bg-surface-hover hover:text-fg`),onClick:()=>T({intervalValue:e.value,intervalUnit:e.unit}),children:De(t,y)},`${e.value}:${e.unit}`)})})]}),(0,X.jsxs)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2.5`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:Se(E,y)}),(0,X.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r.form.nextThreeRuns,`:`,A.join(y===`zh`?`、`:`, `)]}),(0,X.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:r.form.fixedIntervalHint})]})]}):null,We;t[141]!==n.cronExpr||t[142]!==n.triggerMode||t[143]!==r.form.expression||t[144]!==T?(We=n.triggerMode===`cron`?(0,X.jsx)($,{label:r.form.expression,children:(0,X.jsx)(`input`,{className:Q,value:n.cronExpr,onChange:e=>T({cronExpr:e.target.value})})}):null,t[141]=n.cronExpr,t[142]=n.triggerMode,t[143]=r.form.expression,t[144]=T,t[145]=We):We=t[145];let Ge;t[146]!==n.triggerMode||t[147]!==n.webhookSecretId||t[148]!==r.form.secretId||t[149]!==T?(Ge=n.triggerMode===`webhook`?(0,X.jsx)($,{label:r.form.secretId,children:(0,X.jsx)(`input`,{className:Q,value:n.webhookSecretId,onChange:e=>T({webhookSecretId:e.target.value})})}):null,t[146]=n.triggerMode,t[147]=n.webhookSecretId,t[148]=r.form.secretId,t[149]=T,t[150]=Ge):Ge=t[150];let Ke;t[151]!==n.eventPayloadMatch||t[152]!==n.eventSource||t[153]!==n.eventType||t[154]!==n.triggerMode||t[155]!==r.form.eventPayloadMatch||t[156]!==r.form.eventSource||t[157]!==r.form.eventType||t[158]!==r.form.invalidJsonObject||t[159]!==T?(Ke=n.triggerMode===`event`?(0,X.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:r.form.eventType,children:(0,X.jsx)(`input`,{className:Q,value:n.eventType,onChange:e=>T({eventType:e.target.value})})}),(0,X.jsx)($,{label:r.form.eventSource,children:(0,X.jsx)(`input`,{className:Q,value:n.eventSource,onChange:e=>T({eventSource:e.target.value})})})]}),(0,X.jsxs)($,{label:r.form.eventPayloadMatch,children:[(0,X.jsx)(`textarea`,{className:m(Q,`min-h-24 resize-y font-mono text-xs`),value:n.eventPayloadMatch,onChange:e=>T({eventPayloadMatch:e.target.value}),placeholder:`{
|
|
5
|
-
"status": "blocked"
|
|
6
|
-
}`}),$e(n.eventPayloadMatch)?null:(0,X.jsx)(`span`,{className:`text-xs text-red-700 dark:text-red-300`,children:r.form.invalidJsonObject})]})]}):null,t[151]=n.eventPayloadMatch,t[152]=n.eventSource,t[153]=n.eventType,t[154]=n.triggerMode,t[155]=r.form.eventPayloadMatch,t[156]=r.form.eventSource,t[157]=r.form.eventType,t[158]=r.form.invalidJsonObject,t[159]=T,t[160]=Ke):Ke=t[160];let Je;t[161]!==r.form.action||t[162]!==r.form.actionStepDescription?(Je=(0,X.jsx)(rn,{step:`2`,title:r.form.action,description:r.form.actionStepDescription}),t[161]=r.form.action,t[162]=r.form.actionStepDescription,t[163]=Je):Je=t[163];let Ye;t[164]!==n.timeoutSeconds||t[165]!==n.workflowId||t[166]!==T||t[167]!==o?(Ye=e=>{let t=e.target.value,r=Number.parseInt(n.timeoutSeconds,10);T({actionMode:t,...r===600||r===1800?{timeoutSeconds:t===`browser_automation`?`600`:`1800`}:{},...t===`browser_automation`||t===`task_command`?{safetyMode:`auto_apply`}:{},...t===`workflow`&&!n.workflowId.trim()&&o[0]?{workflowId:o[0].id,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0}:{}})},t[164]=n.timeoutSeconds,t[165]=n.workflowId,t[166]=T,t[167]=o,t[168]=Ye):Ye=t[168];let Xe;t[169]===r.action.runAgent?Xe=t[170]:(Xe=(0,X.jsx)(K,{value:`agent`,children:r.action.runAgent}),t[169]=r.action.runAgent,t[170]=Xe);let Ze;t[171]===r.action.runWorkflow?Ze=t[172]:(Ze=(0,X.jsx)(K,{value:`workflow`,children:r.action.runWorkflow}),t[171]=r.action.runWorkflow,t[172]=Ze);let Z;t[173]===r.action.runTask?Z=t[174]:(Z=(0,X.jsx)(K,{value:`task_command`,children:r.action.runTask}),t[173]=r.action.runTask,t[174]=Z);let Qe=y===`zh`?`浏览器自动化`:`Browser automation`,et;t[175]===Qe?et=t[176]:(et=(0,X.jsx)(K,{value:`browser_automation`,children:Qe}),t[175]=Qe,t[176]=et);let tt;t[177]!==n.actionMode||t[178]!==Ye||t[179]!==Xe||t[180]!==Ze||t[181]!==Z||t[182]!==et?(tt=(0,X.jsxs)(U,{className:Q,value:n.actionMode,onChange:Ye,children:[Xe,Ze,Z,et]}),t[177]=n.actionMode,t[178]=Ye,t[179]=Xe,t[180]=Ze,t[181]=Z,t[182]=et,t[183]=tt):tt=t[183];let nt=n.actionMode===`browser_automation`?null:(0,X.jsx)($,{label:r.form.agent,children:(0,X.jsxs)(U,{className:Q,value:n.agentId,onChange:e=>T({agentId:e.target.value}),children:[(0,X.jsx)(K,{value:``,children:h?r.form.loadingAgents:r.form.defaultAgent}),f.map(e=>(0,X.jsx)(K,{value:e.id,children:P(e,S)},e.id))]})}),rt;t[184]!==M||t[185]!==l||t[186]!==d||t[187]!==n.actionMode||t[188]!==n.agentId||t[189]!==n.browserAutomationId||t[190]!==n.browserAutomationInputs||t[191]!==n.description||t[192]!==n.instruction||t[193]!==n.model||t[194]!==n.name||t[195]!==n.taskId||t[196]!==n.triggerMode||t[197]!==n.workflowId||t[198]!==n.workflowInput||t[199]!==r.form.defaultModel||t[200]!==r.form.instruction||t[201]!==r.form.loadingTasks||t[202]!==r.form.loadingWorkflows||t[203]!==r.form.model||t[204]!==r.form.modelHint||t[205]!==r.form.noModels||t[206]!==r.form.noTasks||t[207]!==r.form.noWorkflows||t[208]!==r.form.searchModels||t[209]!==r.form.task||t[210]!==r.form.taskClosed||t[211]!==r.form.taskContextHint||t[212]!==r.form.triggeredRun||t[213]!==r.form.workflow||t[214]!==y||t[215]!==u||t[216]!==s||t[217]!==v||t[218]!==T||t[219]!==o||t[220]!==c?(rt=n.actionMode===`agent`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)($,{label:r.form.model,children:[(0,X.jsx)(te,{value:n.model,onChange:e=>T({model:e}),placeholder:r.form.defaultModel,emptyLabel:r.form.defaultModel,searchPlaceholder:r.form.searchModels,noMatches:r.form.noModels,allowEmpty:!0,showProviderSettingsFooter:!0,contentAlign:`start`,className:`w-full`,ariaLabel:r.form.model}),(0,X.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:r.form.modelHint})]}),(0,X.jsxs)($,{label:r.form.instruction,children:[(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(je,{value:n.instruction,onApply:e=>T({instruction:e}),fieldId:`automation.instruction`,fieldLabel:r.form.instruction,scenario:`automation.instruction`,locale:y,context:{automationName:n.name,automationDescription:n.description,triggerMode:n.triggerMode,agentId:n.agentId,model:n.model},showLabel:!1})}),(0,X.jsx)(`textarea`,{className:m(Q,`min-h-32 resize-y`),value:n.instruction,onChange:e=>T({instruction:e.target.value})})]})]}):n.actionMode===`workflow`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{label:r.form.workflow,children:(0,X.jsxs)(U,{className:Q,value:n.workflowId,onChange:e=>T({workflowId:e.target.value,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0}),disabled:c||o.length===0,children:[c?(0,X.jsx)(K,{value:``,children:r.form.loadingWorkflows}):null,!c&&o.length===0?(0,X.jsx)(K,{value:``,children:r.form.noWorkflows}):null,o.map(e=>(0,X.jsx)(K,{value:e.id,children:w(e,y).title},e.id))]})}),s?(0,X.jsx)(Me,{definition:s,language:y,value:n.workflowInput,onChange:e=>T({workflowInput:e,workflowGoal:e.goal,workflowInputValid:!0}),mode:`automation`,badgeLabel:r.form.triggeredRun,onValidityChange:e=>T({workflowInputValid:e.valid}),aiAssist:{inputScenario:`automation.workflowInput`,goalScenario:`automation.workflowGoal`,context:{automationName:n.name,automationDescription:n.description,triggerMode:n.triggerMode,workflowId:s.id,workflowTitle:w(s,y).title,workflowDescription:w(s,y).description}},inputClassName:`rounded-lg`}):null]}):n.actionMode===`task_command`?(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)($,{label:r.form.task,children:[(0,X.jsxs)(U,{className:Q,value:n.taskId,onChange:e=>T({taskId:e.target.value}),disabled:v||M.length===0,children:[v?(0,X.jsx)(K,{value:``,children:r.form.loadingTasks}):null,!v&&M.length===0?(0,X.jsx)(K,{value:``,children:r.form.noTasks}):null,M.map(e=>(0,X.jsxs)(K,{value:e.id,disabled:e.phase===`closed`,children:[e.title,e.phase===`closed`?` · ${r.form.taskClosed}`:``]},e.id))]}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.form.taskContextHint})]})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{label:y===`zh`?`浏览器自动化`:`Browser automation`,children:(0,X.jsxs)(U,{className:Q,value:n.browserAutomationId,onChange:e=>{let t=l.find(t=>t.id===e.target.value);T({browserAutomationId:e.target.value,browserAutomationInputs:t?Fe(t):{}})},disabled:d||l.length===0,children:[l.length===0?(0,X.jsx)(K,{value:``,children:y===`zh`?`没有已启用的浏览器自动化`:`No enabled browser automations`}):null,l.map(tn)]})}),u&&Object.keys(u.inputs).length>0?(0,X.jsx)($,{label:y===`zh`?`运行时填写`:`Run inputs`,children:(0,X.jsx)(Ie,{automation:u,values:n.browserAutomationInputs,language:y,onChange:e=>T({browserAutomationInputs:e})})}):null]}),t[184]=M,t[185]=l,t[186]=d,t[187]=n.actionMode,t[188]=n.agentId,t[189]=n.browserAutomationId,t[190]=n.browserAutomationInputs,t[191]=n.description,t[192]=n.instruction,t[193]=n.model,t[194]=n.name,t[195]=n.taskId,t[196]=n.triggerMode,t[197]=n.workflowId,t[198]=n.workflowInput,t[199]=r.form.defaultModel,t[200]=r.form.instruction,t[201]=r.form.loadingTasks,t[202]=r.form.loadingWorkflows,t[203]=r.form.model,t[204]=r.form.modelHint,t[205]=r.form.noModels,t[206]=r.form.noTasks,t[207]=r.form.noWorkflows,t[208]=r.form.searchModels,t[209]=r.form.task,t[210]=r.form.taskClosed,t[211]=r.form.taskContextHint,t[212]=r.form.triggeredRun,t[213]=r.form.workflow,t[214]=y,t[215]=u,t[216]=s,t[217]=v,t[218]=T,t[219]=o,t[220]=c,t[221]=rt):rt=t[221];let it;t[222]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,X.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs text-fg-muted`,children:`3`}),t[222]=it):it=t[222];let at;t[223]===r.form.advancedDescription?at=t[224]:(at=(0,X.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:r.form.advancedDescription}),t[223]=r.form.advancedDescription,t[224]=at);let ot;t[225]!==r.form.advanced||t[226]!==at?(ot=(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[it,(0,X.jsxs)(`span`,{children:[r.form.advanced,at]})]}),t[225]=r.form.advanced,t[226]=at,t[227]=ot):ot=t[227];let st;t[228]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,X.jsx)(ge,{className:`size-4 transition-transform group-open:rotate-180`}),t[228]=st):st=t[228];let ct;t[229]===ot?ct=t[230]:(ct=(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[ot,st]}),t[229]=ot,t[230]=ct);let lt;t[231]!==n.actionMode||t[232]!==n.safetyMode||t[233]!==r.form.safety||t[234]!==r.safety||t[235]!==T?(lt=n.actionMode!==`browser_automation`&&n.actionMode!==`task_command`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(rn,{title:r.form.safety}),(0,X.jsxs)($,{label:r.form.safety,children:[(0,X.jsxs)(U,{className:Q,value:n.safetyMode,onChange:e=>{let t=e.target.value;T({safetyMode:t})},children:[(0,X.jsx)(K,{value:`suggest_only`,children:r.safety.suggest_only}),(0,X.jsx)(K,{value:`ask_before_apply`,children:r.safety.ask_before_apply}),(0,X.jsx)(K,{value:`auto_apply`,children:r.safety.auto_apply})]}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.safetyMode===`suggest_only`?r.safety.suggestOnlyDescription:n.safetyMode===`ask_before_apply`?r.safety.askBeforeApplyDescription:r.safety.autoApplyDescription})]})]}):null,t[231]=n.actionMode,t[232]=n.safetyMode,t[233]=r.form.safety,t[234]=r.safety,t[235]=T,t[236]=lt):lt=t[236];let ut;t[237]===r.form.results?ut=t[238]:(ut=(0,X.jsx)(rn,{title:r.form.results}),t[237]=r.form.results,t[238]=ut);let dt;t[239]===T?dt=t[240]:(dt=e=>T({conversationMode:e.target.value}),t[239]=T,t[240]=dt);let ft;t[241]===r.form.newConversation?ft=t[242]:(ft=(0,X.jsx)(K,{value:`new_session`,children:r.form.newConversation}),t[241]=r.form.newConversation,t[242]=ft);let pt;t[243]===r.form.continuousConversation?pt=t[244]:(pt=(0,X.jsx)(K,{value:`continuous`,children:r.form.continuousConversation}),t[243]=r.form.continuousConversation,t[244]=pt);let mt;t[245]!==n.conversationMode||t[246]!==dt||t[247]!==ft||t[248]!==pt?(mt=(0,X.jsxs)(U,{className:Q,value:n.conversationMode,onChange:dt,children:[ft,pt]}),t[245]=n.conversationMode,t[246]=dt,t[247]=ft,t[248]=pt,t[249]=mt):mt=t[249];let _t;t[250]!==r.form.conversation||t[251]!==mt?(_t=(0,X.jsx)($,{label:r.form.conversation,children:mt}),t[250]=r.form.conversation,t[251]=mt,t[252]=_t):_t=t[252];let vt;t[253]===T?vt=t[254]:(vt=e=>T({notificationPolicy:e.target.value}),t[253]=T,t[254]=vt);let yt;t[255]===r.form.notifyAttention?yt=t[256]:(yt=(0,X.jsx)(K,{value:`attention`,children:r.form.notifyAttention}),t[255]=r.form.notifyAttention,t[256]=yt);let bt;t[257]===r.form.notifyAll?bt=t[258]:(bt=(0,X.jsx)(K,{value:`all`,children:r.form.notifyAll}),t[257]=r.form.notifyAll,t[258]=bt);let xt;t[259]===r.form.notifyNone?xt=t[260]:(xt=(0,X.jsx)(K,{value:`none`,children:r.form.notifyNone}),t[259]=r.form.notifyNone,t[260]=xt);let St;t[261]!==n.notificationPolicy||t[262]!==vt||t[263]!==yt||t[264]!==bt||t[265]!==xt?(St=(0,X.jsxs)(U,{className:Q,value:n.notificationPolicy,onChange:vt,children:[yt,bt,xt]}),t[261]=n.notificationPolicy,t[262]=vt,t[263]=yt,t[264]=bt,t[265]=xt,t[266]=St):St=t[266];let Ct;t[267]!==r.form.notifications||t[268]!==St?(Ct=(0,X.jsx)($,{label:r.form.notifications,children:St}),t[267]=r.form.notifications,t[268]=St,t[269]=Ct):Ct=t[269];let wt;t[270]===T?wt=t[271]:(wt=e=>T({resultWebhookEndpoint:e.target.value}),t[270]=T,t[271]=wt);let Tt;t[272]!==n.resultWebhookEndpoint||t[273]!==wt?(Tt=(0,X.jsx)(`input`,{className:Q,value:n.resultWebhookEndpoint,onChange:wt}),t[272]=n.resultWebhookEndpoint,t[273]=wt,t[274]=Tt):Tt=t[274];let Et;t[275]===T?Et=t[276]:(Et=e=>T({resultWebhookSecretId:e.target.value}),t[275]=T,t[276]=Et);let Dt;t[277]!==n.resultWebhookSecretId||t[278]!==r.form.resultWebhookSecretId||t[279]!==Et?(Dt=(0,X.jsx)(`input`,{className:Q,value:n.resultWebhookSecretId,onChange:Et,placeholder:r.form.resultWebhookSecretId}),t[277]=n.resultWebhookSecretId,t[278]=r.form.resultWebhookSecretId,t[279]=Et,t[280]=Dt):Dt=t[280];let Ot;t[281]!==Tt||t[282]!==Dt?(Ot=(0,X.jsxs)(`div`,{className:`grid gap-2`,children:[Tt,Dt]}),t[281]=Tt,t[282]=Dt,t[283]=Ot):Ot=t[283];let kt;t[284]!==r.form.resultWebhookEndpoint||t[285]!==Ot?(kt=(0,X.jsx)($,{label:r.form.resultWebhookEndpoint,children:Ot}),t[284]=r.form.resultWebhookEndpoint,t[285]=Ot,t[286]=kt):kt=t[286];let At;t[287]===r.form.reliability?At=t[288]:(At=(0,X.jsx)(rn,{title:r.form.reliability}),t[287]=r.form.reliability,t[288]=At);let jt;t[289]===T?jt=t[290]:(jt=e=>T({timeoutSeconds:e.target.value}),t[289]=T,t[290]=jt);let Mt;t[291]!==n.timeoutSeconds||t[292]!==jt?(Mt=(0,X.jsx)(`input`,{className:Q,inputMode:`numeric`,value:n.timeoutSeconds,onChange:jt}),t[291]=n.timeoutSeconds,t[292]=jt,t[293]=Mt):Mt=t[293];let Nt;t[294]!==r.form.timeoutSeconds||t[295]!==Mt?(Nt=(0,X.jsx)($,{label:r.form.timeoutSeconds,children:Mt}),t[294]=r.form.timeoutSeconds,t[295]=Mt,t[296]=Nt):Nt=t[296];let Pt;t[297]===T?Pt=t[298]:(Pt=e=>T({disableAfterFailures:e.target.value}),t[297]=T,t[298]=Pt);let Ft;t[299]!==n.disableAfterFailures||t[300]!==Pt?(Ft=(0,X.jsx)(`input`,{className:Q,inputMode:`numeric`,value:n.disableAfterFailures,onChange:Pt}),t[299]=n.disableAfterFailures,t[300]=Pt,t[301]=Ft):Ft=t[301];let It;t[302]!==r.form.disableAfterFailures||t[303]!==Ft?(It=(0,X.jsx)($,{label:r.form.disableAfterFailures,children:Ft}),t[302]=r.form.disableAfterFailures,t[303]=Ft,t[304]=It):It=t[304];let Lt;t[305]!==Nt||t[306]!==It?(Lt=(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Nt,It]}),t[305]=Nt,t[306]=It,t[307]=Lt):Lt=t[307];let Rt;t[308]===r.form.effectivePolicy?Rt=t[309]:(Rt=(0,X.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:r.form.effectivePolicy}),t[308]=r.form.effectivePolicy,t[309]=Rt);let zt=n.timeoutSeconds||`—`,Bt;t[310]!==r.form.executionDeadline||t[311]!==zt?(Bt=(0,X.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[r.form.executionDeadline,`: `,zt,`s`]}),t[310]=r.form.executionDeadline,t[311]=zt,t[312]=Bt):Bt=t[312];let Vt;t[313]===r.form.downstreamTimeoutHint?Vt=t[314]:(Vt=(0,X.jsx)(`p`,{className:`mt-0.5 text-xs leading-relaxed text-fg-subtle`,children:r.form.downstreamTimeoutHint}),t[313]=r.form.downstreamTimeoutHint,t[314]=Vt);let Ht;t[315]!==Rt||t[316]!==Bt||t[317]!==Vt?(Ht=(0,X.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-inset/40 px-3 py-2.5`,children:[Rt,Bt,Vt]}),t[315]=Rt,t[316]=Bt,t[317]=Vt,t[318]=Ht):Ht=t[318];let Ut;t[319]!==Ht||t[320]!==lt||t[321]!==ut||t[322]!==_t||t[323]!==Ct||t[324]!==kt||t[325]!==At||t[326]!==Lt?(Ut=(0,X.jsxs)(`div`,{className:`grid gap-4 border-t border-edge-subtle p-4`,children:[lt,ut,_t,Ct,kt,At,Lt,Ht]}),t[319]=Ht,t[320]=lt,t[321]=ut,t[322]=_t,t[323]=Ct,t[324]=kt,t[325]=At,t[326]=Lt,t[327]=Ut):Ut=t[327];let Wt;t[328]!==Ut||t[329]!==ct?(Wt=(0,X.jsxs)(`details`,{className:`group rounded-xl border border-edge-subtle bg-surface-base`,children:[ct,Ut]}),t[328]=Ut,t[329]=ct,t[330]=Wt):Wt=t[330];let Gt;return t[331]!==Wt||t[332]!==ae||t[333]!==z||t[334]!==ce||t[335]!==G||t[336]!==_e||t[337]!==ze||t[338]!==Be||t[339]!==Ve||t[340]!==Ue||t[341]!==We||t[342]!==Ge||t[343]!==Ke||t[344]!==Je||t[345]!==tt||t[346]!==nt||t[347]!==rt?(Gt=(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[ae,z,ce,G,_e,ze,Be,Ve,Ue,We,Ge,Ke,Je,tt,nt,rt,Wt]})}),t[331]=Wt,t[332]=ae,t[333]=z,t[334]=ce,t[335]=G,t[336]=_e,t[337]=ze,t[338]=Be,t[339]=Ve,t[340]=Ue,t[341]=We,t[342]=Ge,t[343]=Ke,t[344]=Je,t[345]=tt,t[346]=nt,t[347]=rt,t[348]=Gt):Gt=t[348],Gt}function tn(e){return(0,X.jsx)(K,{value:e.id,children:e.name},e.id)}function nn(e){return(0,X.jsx)(K,{value:e.id,children:e.name},e.id)}var Q=`min-h-11 w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-base sm:min-h-0 sm:text-sm text-fg outline-none focus:border-accent`;function $(e){let t=(0,Le.c)(5),{label:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(`div`,{className:`grid gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function rn(e){let t=(0,Le.c)(12),{title:n,step:r,description:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,X.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent-fg`,children:r}):(0,X.jsx)(se,{className:`mt-0.5 size-4 text-fg-muted`}),t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,X.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,X.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:i}):null,t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,X.jsxs)(`div`,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,X.jsxs)(`div`,{className:`flex items-start gap-2 pt-2`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}export{At as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{f as r}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as i}from"./x-B_N4OPjy.js";import{a,n as ee,r as o}from"./locale-store-CE7L6MlS.js";import{$d as s,B as c,Fd as l,H as u,Hc as d,Hu as f,Ic as p,Kd as m,Ol as h,Uo as g,bl as _,cs as v,ef as y,lu as b,mf as x,pu as S,vu as C,zl as w}from"./index-CKdOZoVu.js";import{i as T,n as E,r as D,t as O}from"./browser-automation-inputs-DH9QHI9m.js";var k=e(t(),1),A=n();function j({availability:e,endpointId:t,recordingBusy:n,onSelect:s,onRefresh:l,onStart:m,onClose:h}){let g=ee(e=>e.language)===`zh`,_=r(),[y,x]=(0,k.useState)(),[S,C]=(0,k.useState)(!0),[w,T]=(0,k.useState)(!1),[E,D]=(0,k.useState)(``),[O,j]=(0,k.useState)(!1),M=e.endpoints.length>0,N=e.state===`update_required`;(0,k.useEffect)(()=>{let e=!1;if(M){C(!1);return}return a(o(`/api/browser/extension-status`)).then(t=>{e||x(t)}).catch(t=>{e||D(t instanceof Error?t.message:String(t))}).finally(()=>{e||C(!1)}),()=>{e=!0}},[M]);let P=async()=>{T(!0),D(``);try{(N||!y?.artifacts?.installed||y.artifacts.needsRefresh)&&await c(N||!!y?.artifacts?.needsRefresh),await u(y?.artifacts?.installed?`chrome`:`both`),j(!0),await l()}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1)}};return(0,A.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`mb-4 shrink-0 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(b,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M?g?`浏览器已连接`:`Browser connected`:N?g?`更新扩展后即可录制`:`Update the extension to record`:g?`连接 Chrome,录制你的操作`:`Connect Chrome to record your actions`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:M?g?`在 Chrome 中切换到要录制的网页,然后开始录制。`:`Switch to the website you want to record in Chrome, then start recording.`:N?g?`当前扩展还不支持录制。更新扩展文件后,在 Chrome 扩展页重新加载 xopc。`:`Your connected extension does not support recording yet. Update its files, then reload xopc in Chrome Extensions.`:g?`录制需要 xopc Chrome 扩展。已有扩展请打开 xopc 侧栏,它会自动连接本机服务。`:`Recording uses the xopc Chrome extension. If already installed, open its side panel to connect to your local Gateway.`})]}),(0,A.jsx)(`button`,{type:`button`,disabled:w||n,onClick:h,"aria-label":g?`收起连接引导`:`Close connection guide`,className:`rounded p-1 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(i,{className:`size-4`})})]}),O&&!M&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:y?.artifacts?.installed?g?`重新加载后打开 xopc 侧栏。连接状态会自动更新。`:`After reloading, open the xopc side panel. Connection status updates automatically.`:g?`在 Chrome 扩展页开启开发者模式,点击“加载已解压的扩展程序”,选择已打开的扩展目录,再打开 xopc 侧栏。连接状态会自动更新。`:`Enable Developer mode in Chrome Extensions, choose Load unpacked and select the opened extension folder, then open the xopc side panel. Connection status updates automatically.`}),M&&e.endpoints.length>1&&(0,A.jsx)(`div`,{className:`mt-3 max-w-sm`,children:(0,A.jsx)(v,{value:t??``,ariaLabel:g?`选择录制浏览器`:`Choose a browser to record`,placeholder:g?`选择浏览器`:`Choose a browser`,allowEmpty:!1,options:e.endpoints.map(e=>({value:e.endpointId,label:e.displayName})),onChange:s})}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M?(0,A.jsx)(d,{onClick:m,disabled:n||!t&&e.endpoints.length>1,children:g?`开始录制`:`Start recording`}):S?(0,A.jsx)(p,{className:`h-9 w-32 rounded-lg`}):y?.artifacts?.extensionDir?(0,A.jsxs)(d,{onClick:()=>void P(),disabled:w,children:[w&&(0,A.jsx)(f,{className:`size-4 animate-spin`}),N?g?`更新并打开扩展页`:`Update and open extensions`:y.artifacts.installed?g?`打开 Chrome 扩展页`:`Open Chrome Extensions`:g?`安装 Chrome 扩展`:`Install Chrome extension`]}):(0,A.jsx)(d,{onClick:()=>_(`/settings/agent-browser`),children:g?`设置浏览器连接`:`Set up browser connection`}),!M&&(0,A.jsx)(d,{variant:`secondary`,disabled:w,onClick:()=>void l().catch(e=>D(e instanceof Error?e.message:String(e))),children:g?`检查连接`:`Check connection`})]}),E&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-danger`,role:`alert`,children:E})]})}var M={en:{record:`Record my actions`,finishRecording:`Finish and save`,recording:`Recording`,syncing:`Saved locally, syncing…`,verified:`Result verified`,saved:`Saved draft`,unknown:`Check the business result before repeating`,title:`Browser automations`,subtitle:`Let your assistant repeat routine actions on the web.`,emptyTitle:`No browser automations yet`,emptyBody:`Tell your assistant what to do on the web. Once it works, save it and run it again whenever you need.`,create:`Create with assistant`,edit:`Edit with assistant`,run:`Run now`,stop:`Stop`,enable:`Enable`,pause:`Pause`,enabled:`Enabled`,paused:`Paused`,inputs:`Before running`,noInputs:`This automation is ready to run.`,history:`Recent activity`,delete:`Delete automation`,confirmDelete:`Delete this browser automation?`,required:`Please complete all required fields.`,queued:`Waiting to start`,running:`Running`,succeeded:`Completed`,failed:`Needs attention`,cancelled:`Stopped`,result:`Result`,read:`Reads information`,draft:`Edits the page locally`,external_effect:`Affects an external system`,destructive:`Destructive action`,sensitive:`Sensitive action`,createPrompt:`Help me create a reusable browser automation. Ask what I want the browser to do, perform it once with me, then save the successful steps. Keep all technical details hidden.`,editPrompt:`Help me update the browser automation "{name}" (id: {id}). Ask what should change, test the new browser steps, then save it.`},zh:{record:`录制我的操作`,finishRecording:`完成并保存`,recording:`正在录制`,syncing:`已保存到本机,正在同步…`,verified:`结果已验证`,saved:`已保存草稿`,unknown:`结果待检查,请先检查业务结果再重复运行`,title:`浏览器自动化`,subtitle:`让助手自动重复完成网页上的固定操作。`,emptyTitle:`还没有浏览器自动化`,emptyBody:`告诉助手你希望在网页上自动完成什么。成功执行一次后,即可保存并重复运行。`,create:`让助手帮我创建`,edit:`让助手帮我修改`,run:`立即运行`,stop:`停止`,enable:`启用`,pause:`暂停`,enabled:`已启用`,paused:`已暂停`,inputs:`运行前需要填写`,noInputs:`这个自动化可以直接运行。`,history:`最近运行`,delete:`删除自动化`,confirmDelete:`确定删除这个浏览器自动化吗?`,required:`请填写所有必填内容。`,queued:`等待开始`,running:`正在运行`,succeeded:`已完成`,failed:`需要处理`,cancelled:`已停止`,result:`运行结果`,read:`仅读取信息`,draft:`仅在页面内编辑`,external_effect:`会影响外部系统`,destructive:`破坏性操作`,sensitive:`包含敏感操作`,createPrompt:`请帮我创建一个可重复运行的浏览器自动化。先询问我希望浏览器完成什么,陪我实际执行成功一次,然后保存成功步骤。不要让我处理技术细节。`,editPrompt:`请帮我修改浏览器自动化“{name}”(id:{id})。先询问我要修改什么,实际测试新的浏览器步骤,然后保存。`}};function N(e){return e!==`queued`&&e!==`running`}function P(e){return e==null?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>`• ${P(e)}`).join(`
|
|
2
|
-
`):typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}: ${P(t)}`).join(`
|
|
3
|
-
`):String(e)}function F(){let e=ee(e=>e.language),t=M[e],n=r(),i=g(e=>e.setPageHeader),a=g(e=>e.clearPageHeader),[o,c]=(0,k.useState)(null),[u,f]=(0,k.useState)(),[v,b]=(0,k.useState)({}),[F,I]=(0,k.useState)([]),[L,R]=(0,k.useState)(),[z,B]=(0,k.useState)(``),[V,H]=(0,k.useState)(!1),[U,W]=(0,k.useState)(),[G,K]=(0,k.useState)(),[q,J]=(0,k.useState)(),Y=(0,k.useMemo)(()=>o?.find(e=>e.id===u),[u,o]),X=(0,k.useCallback)(async()=>{let e=await T.list();c(e.automations),f(t=>t&&e.automations.some(e=>e.id===t)?t:e.automations[0]?.id)},[]);(0,k.useEffect)(()=>{X().catch(e=>B(String(e)))},[X]),(0,k.useEffect)(()=>{Y&&(b(D(Y)),R(void 0),B(``),T.listRuns(Y.id).then(e=>I(e.runs)).catch(e=>B(String(e))))},[Y?.id,Y?.revision]),(0,k.useEffect)(()=>{if(!L||N(L.status))return;let e=window.setInterval(()=>{T.getRun(L.id).then(({run:e})=>{R(e),N(e.status)&&Y&&(T.listRuns(Y.id).then(e=>I(e.runs)),X())}).catch(e=>B(String(e)))},700);return()=>window.clearInterval(e)},[L,Y]);let Z=(0,k.useCallback)(async()=>{H(!0),B(``);try{let e=U&&[`recording`,`paused`].includes(U.state),t=G;if(!e){let e=await T.recordingAvailability();if(e.endpoints.length===1?t=e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)||(t=void 0),K(t),!t){J(e);return}}let n=await T.recording(e?`finish`:`start`,t);W(n.value),K(n.endpointId),J(void 0)}catch(e){let t=e.body;t?.code&&[`connect_required`,`update_required`,`choose_browser`].includes(t.code)?J({state:t.code,endpoints:t.endpoints??[]}):B(e instanceof Error?e.message:String(e))}finally{H(!1)}},[U,G]),te=(0,k.useCallback)(async()=>{let e=await T.recordingAvailability();J(e),K(t=>e.endpoints.length===1?e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)?t:void 0)},[]);(0,k.useEffect)(()=>{if(!q)return;let e=!1,t=window.setInterval(()=>{T.recordingAvailability().then(t=>{e||(J(t),K(e=>t.endpoints.length===1?t.endpoints[0].endpointId:t.endpoints.some(t=>t.endpointId===e)?e:void 0))}).catch(()=>void 0)},3e3);return()=>{e=!0,window.clearInterval(t)}},[!!q]),(0,k.useEffect)(()=>{if(!U||U.automationId)return;let e=!1,t=window.setInterval(()=>{T.recording(`status`,G).then(async t=>{let n=t.value.find(e=>e.id===U.id);!e&&n&&(W(n),n.automationId&&(await X(),e||f(n.automationId)))}).catch(t=>{e||B(String(t))})},1500);return()=>{e=!0,window.clearInterval(t)}},[U,G,X]);let Q=(0,k.useCallback)(e=>{n(`/chat/new?draft=${encodeURIComponent(e)}`)},[n]),ne=(0,k.useMemo)(()=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[z&&(0,A.jsx)(`span`,{role:`alert`,className:`max-w-64 truncate text-xs text-red-600`,title:z,children:z}),U?.state===`stopped`&&!U.automationId&&(0,A.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:U.error||t.syncing}),(0,A.jsxs)(d,{variant:`secondary`,disabled:V,onClick:()=>void Z(),children:[(0,A.jsx)(_,{className:`size-4`}),U&&[`recording`,`paused`].includes(U.state)?t.finishRecording:t.record]}),(0,A.jsxs)(d,{onClick:()=>Q(t.createPrompt),children:[(0,A.jsx)(x,{className:`size-4`}),t.create]})]}),[Q,t,V,Z,U,z]);(0,k.useLayoutEffect)(()=>(i({startExtra:null,main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),end:ne}),()=>a()),[a,ne,i,t.title]);let re=async()=>{if(Y){H(!0);try{await T.setEnabled(Y.id,!Y.enabled),await X()}catch(e){B(String(e))}finally{H(!1)}}},ie=async()=>{if(Y){if(!E(Y,v)){B(t.required);return}H(!0);try{let{run:e}=await T.run(Y.id,v);R(e),B(``)}catch(e){B(String(e))}finally{H(!1)}}},ae=async()=>{if(!(!Y||!window.confirm(t.confirmDelete))){H(!0);try{await T.remove(Y.id),f(void 0),I([]),await X()}catch(e){B(String(e))}finally{H(!1)}}},$=q&&(0,A.jsx)(j,{availability:q,endpointId:G,recordingBusy:V,onSelect:K,onRefresh:te,onStart:()=>void Z(),onClose:()=>J(void 0)});return o===null?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(p,{className:`h-[420px] rounded-xl`}),(0,A.jsx)(p,{className:`h-[420px] rounded-xl`})]})]}):o.length===0?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`m-auto max-w-md py-12 text-center`,children:[(0,A.jsx)(x,{className:`mx-auto size-10 text-accent`}),(0,A.jsx)(`h2`,{className:`mt-4 text-lg font-semibold text-fg`,children:t.emptyTitle}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:t.emptyBody}),(0,A.jsxs)(d,{className:`mt-5`,onClick:()=>Q(t.createPrompt),children:[(0,A.jsx)(x,{className:`size-4`}),t.create]})]})]}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-2`,children:o.map(e=>(0,A.jsxs)(`button`,{onClick:()=>f(e.id),className:`mb-1 w-full rounded-lg p-3 text-left ${u===e.id?`bg-accent-soft text-accent-fg`:`hover:bg-surface-hover`}`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,A.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-xs text-fg-muted`,children:[e.enabled?(0,A.jsx)(s,{className:`size-3.5 text-emerald-600`}):(0,A.jsx)(y,{className:`size-3.5`}),e.enabled?t.enabled:t.paused]})]},e.id))}),Y&&(0,A.jsxs)(`main`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-5 sm:p-6`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:Y.name}),Y.description&&(0,A.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:Y.description}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:t[Y.risk]}),(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:Y.verified?t.verified:t.saved}),Y.domains.map(e=>(0,A.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:[(0,A.jsx)(l,{className:`size-3`}),e]},e))]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(d,{variant:`secondary`,disabled:V,onClick:()=>void re(),children:[Y.enabled?(0,A.jsx)(y,{className:`size-4`}):(0,A.jsx)(s,{className:`size-4`}),Y.enabled?t.pause:t.enable]}),(0,A.jsxs)(d,{variant:`secondary`,onClick:()=>Q(t.editPrompt.replace(`{name}`,Y.name).replace(`{id}`,Y.id)),children:[(0,A.jsx)(C,{className:`size-4`}),t.edit]})]})]}),(0,A.jsxs)(`section`,{className:`mt-7 max-w-xl`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.inputs}),Object.keys(Y.inputs).length===0?(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.noInputs}):(0,A.jsx)(`div`,{className:`mt-3`,children:(0,A.jsx)(O,{automation:Y,values:v,language:e,onChange:b})}),(0,A.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,A.jsxs)(d,{variant:`primary`,disabled:!Y.enabled||V||!!(L&&!N(L.status)),onClick:()=>void ie(),children:[(0,A.jsx)(S,{className:`size-4`}),t.run]}),L&&!N(L.status)&&(0,A.jsxs)(d,{variant:`secondary`,onClick:()=>void T.cancel(L.id),children:[(0,A.jsx)(w,{className:`size-4`}),t.stop]})]}),z&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-red-700 dark:text-red-300`,children:z})]}),L&&(0,A.jsxs)(`section`,{className:`mt-7 rounded-xl border border-edge bg-surface-inset p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,A.jsx)(m,{className:`size-4`}),L.businessOutcome===`verified`?t.verified:t[L.status]]}),L.businessOutcome===`unknown`&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.unknown}),L.error&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-red-700 dark:text-red-300`,children:L.error}),L.status===`succeeded`&&L.result!==void 0&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:t.result}),(0,A.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-fg`,children:P(L.result)})]})]}),(0,A.jsxs)(`section`,{className:`mt-8`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.history}),(0,A.jsx)(`div`,{className:`mt-2 divide-y divide-edge`,children:F.slice(0,10).map(e=>(0,A.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 py-3 text-left text-sm hover:text-accent`,onClick:()=>R(e),children:[(0,A.jsx)(`span`,{children:t[e.status]}),(0,A.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[new Date(e.createdAtMs).toLocaleString(),e.durationMs?` · ${Math.max(1,Math.round(e.durationMs/1e3))}s`:``]})]},e.id))})]}),(0,A.jsx)(`div`,{className:`mt-8 border-t border-edge pt-4`,children:(0,A.jsxs)(d,{variant:`ghost`,className:`text-red-700 dark:text-red-300`,disabled:V,onClick:()=>void ae(),children:[(0,A.jsx)(h,{className:`size-4`}),t.delete]})})]})]})]})}export{F as BrowserAutomationsPage};
|
|
@@ -1,3 +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,g as a}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as o}from"./circle-check-C23XjkUj.js";import{t as s}from"./download-Dk-ZjtO6.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./eye-CABVeTq0.js";import{t as u}from"./folder-open-CyzJ19I9.js";import{t as d}from"./messages-CaeL_miw.js";import{a as f,c as p,n as m,r as h}from"./locale-store-CE7L6MlS.js";import{i as g}from"./vendor-swr-BIWyz7Rc.js";import{n as _,r as v}from"./gateway-config-swr-BEePO3Wl.js";import{$a as y,B as b,Dl as x,G as S,H as C,Hc as w,Hu as T,Ic as E,Ld as ee,On as te,Ou as D,R as O,U as ne,V as k,Vu as re,au as ie,cs as A,eo as j,mu as ae,xd as oe,z as M}from"./index-CKdOZoVu.js";import{t as se}from"./number-input-DDeqHK-G.js";import{n as N,r as P}from"./settings-page-layout-Dx5S-Msc.js";import{n as ce,t as F}from"./use-autosave-CY0YuljR.js";var I=n(),L=e(t(),1);function R(e){let[t,n]=(0,L.useState)(!1),[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(null),[s,c]=(0,L.useState)(null),l=(0,L.useRef)(null);return{running:t,cancelling:r,progress:a,error:s,install:(0,L.useCallback)(async()=>{if(l.current)return;let t=new AbortController;l.current=t,n(!0),o(null),c(null);try{let n=await k(o,t.signal);if(!n.ok){n.error!==`cancelled`&&c(n.message??n.error);return}e()}catch(e){t.signal.aborted||c(e instanceof Error?e.message:String(e))}finally{l.current===t&&(l.current=null),n(!1),i(!1)}},[e]),cancel:(0,L.useCallback)(async()=>{l.current&&(i(!0),await O().catch(()=>{}),l.current.abort())},[])}}var z=r(),B={extension:`Chrome extension`,playwright:`Playwright Chromium`,cdp:`CDP`,remote:`Remote browser`};function le(e){let{enabled:t,driverKind:n,autosaveStatus:r,zh:a}=e,s=i(),c=g(t?[`browser-control-status`,n]:null,M,{revalidateOnFocus:!0,refreshInterval:n===`extension`?3e3:0}),[l,u]=(0,L.useState)(null),[d,f]=(0,L.useState)(null),[p,m]=(0,L.useState)(null),h=r===`dirty`||r===`saving`;(0,L.useEffect)(()=>{r===`saved`&&c.mutate()},[r,c.mutate]);let _=(0,L.useCallback)(async(e,t,n)=>{u(e),f(null),m(null);try{await t(),m(n),await c.mutate()}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(null)}},[c.mutate]),v=R((0,L.useCallback)(()=>{m(a?`Chromium 已安装,可以开始连接测试。`:`Chromium is installed and ready to test.`),c.mutate()},[c.mutate,a])),y=c.data?.payload,b=y?.driverKind===n,S=t?h||!b?`syncing`:y?.state:`disabled`;return(0,z.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(S===`ready`?o:S===`syncing`?T:x,{className:`size-4 shrink-0 ${S===`ready`?`text-success`:S===`syncing`?`animate-spin text-fg-muted`:S===`disabled`?`text-fg-subtle`:`text-warning`}`}),(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:a?`浏览器就绪状态`:`Browser readiness`}),(0,z.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${S===`ready`?`bg-success-soft text-success`:S===`disabled`?`bg-surface-hover text-fg-muted`:`bg-warning-soft text-warning`}`,children:S===`ready`?a?`已就绪`:`Ready`:S===`disabled`?a?`未启用`:`Disabled`:S===`syncing`?a?`正在应用配置`:`Applying configuration`:a?`需要处理`:`Needs attention`})]}),(0,z.jsxs)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:[B[n],y?.detail&&b?` · ${y.detail}`:``]})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsxs)(w,{variant:`ghost`,className:`h-9`,onClick:()=>void c.mutate(),disabled:c.isValidating,children:[(0,z.jsx)(ie,{className:`size-3.5 ${c.isValidating?`animate-spin`:``}`}),a?`刷新`:`Refresh`]}),(0,z.jsxs)(w,{variant:`secondary`,className:`h-9`,disabled:!t||h||l!==null||v.running,onClick:()=>void _(`test`,ne,a?`连接测试成功。`:`Connection test passed.`),children:[l===`test`?(0,z.jsx)(T,{className:`size-3.5 animate-spin`}):(0,z.jsx)(ae,{className:`size-3.5`}),a?`测试连接`:`Test connection`]})]})]}),t&&c.isLoading?(0,z.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,z.jsx)(E,{className:`h-12`}),(0,z.jsx)(E,{className:`h-12`}),(0,z.jsx)(E,{className:`h-12`})]}):null,t&&c.error?(0,z.jsx)(U,{tone:`error`,children:c.error instanceof Error?c.error.message:String(c.error)}):null,d||v.error?(0,z.jsx)(U,{tone:`error`,children:d??v.error}):null,p?(0,z.jsx)(U,{tone:`success`,children:p}):null,t&&n===`extension`&&b?(0,z.jsx)(V,{status:y?.driverStatus,zh:a,busy:l,run:_,onConnectRemote:()=>s(`/settings/devices?startDevicePairing=browser`)}):null,t&&n===`playwright`&&b?(0,z.jsx)(fe,{status:y?.driverStatus,zh:a,installer:v}):null,t&&n===`cdp`?(0,z.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:a?`连接测试会验证已保存的 CDP 地址,并复用浏览器中现有的标签页和登录状态。`:`The connection test verifies the saved CDP endpoint and reuses that browser’s existing tabs and signed-in state.`}):null,t&&n===`remote`?(0,z.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:a?`连接测试会在服务商侧创建一个临时浏览器会话,并在测试结束后立即关闭。`:`The connection test creates a temporary provider session and closes it immediately after the test.`}):null]})}function V(e){let t=(0,I.c)(70),{status:n,zh:r,busy:i,run:a,onConnectRemote:o}=e,l=n?.artifacts,d=r?`扩展文件`:`Extension files`,f=l?.installed===!0,p=l?.installed?r?`已安装`:`Installed`:r?`未安装或需更新`:`Install or update required`,m;t[0]!==d||t[1]!==f||t[2]!==p?(m=(0,z.jsx)(H,{label:d,ok:f,value:p}),t[0]=d,t[1]=f,t[2]=p,t[3]=m):m=t[3];let h=r?`本机自动发现`:`Local auto-discovery`,g=l?.nativeHost?.installed===!0,_=l?.nativeHost?.installed?r?`已就绪`:`Ready`:l?.nativeHost?.reason??(r?`需要修复`:`Repair required`),v;t[4]!==h||t[5]!==g||t[6]!==_?(v=(0,z.jsx)(H,{label:h,ok:g,value:_}),t[4]=h,t[5]=g,t[6]=_,t[7]=v):v=t[7];let y=r?`安全通道`:`Secure channel`,x=n?.transport===`gateway-realtime`,S=n?.transport===`gateway-realtime`?`Gateway Realtime`:r?`不可用`:`Unavailable`,C;t[8]!==S||t[9]!==y||t[10]!==x?(C=(0,z.jsx)(H,{label:y,ok:x,value:S}),t[8]=S,t[9]=y,t[10]=x,t[11]=C):C=t[11];let E=r?`Chrome 连接`:`Chrome connection`,ee=n?.connected===!0,te=n?.connected?r?`已连接`:`Connected`:n?.socketConnected?r?`需要重新加载扩展`:`Reload extension`:r?`等待扩展连接`:`Waiting for extension`,D;t[12]!==E||t[13]!==ee||t[14]!==te?(D=(0,z.jsx)(H,{label:E,ok:ee,value:te}),t[12]=E,t[13]=ee,t[14]=te,t[15]=D):D=t[15];let O;t[16]!==C||t[17]!==D||t[18]!==m||t[19]!==v?(O=(0,z.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[m,v,C,D]}),t[16]=C,t[17]=D,t[18]=m,t[19]=v,t[20]=O):O=t[20];let ne=l?.extensionDir??`Gateway Realtime`,k;t[21]===ne?k=t[22]:(k=(0,z.jsx)(`p`,{className:`mt-3 break-all text-xs text-fg-subtle`,children:ne}),t[21]=ne,t[22]=k);let re=l?.installed?`secondary`:`primary`,ie=i!==null,A;t[23]!==l?.installed||t[24]!==a||t[25]!==r?(A=()=>void a(`extension-install`,()=>b(!!l?.installed),r?`扩展文件已准备好。`:`Extension files are ready.`),t[23]=l?.installed,t[24]=a,t[25]=r,t[26]=A):A=t[26];let j;t[27]===i?j=t[28]:(j=i===`extension-install`?(0,z.jsx)(T,{className:`size-3.5 animate-spin`}):(0,z.jsx)(s,{className:`size-3.5`}),t[27]=i,t[28]=j);let oe=l?.installed?r?`刷新扩展文件`:`Refresh files`:r?`安装扩展文件`:`Install extension`,M;t[29]!==re||t[30]!==ie||t[31]!==A||t[32]!==j||t[33]!==oe?(M=(0,z.jsxs)(w,{className:`h-9`,variant:re,disabled:ie,onClick:A,children:[j,oe]}),t[29]=re,t[30]=ie,t[31]=A,t[32]=j,t[33]=oe,t[34]=M):M=t[34];let se=!l?.installed||i!==null,N;t[35]!==a||t[36]!==r?(N=()=>void a(`extension-open`,de,r?`已打开 Chrome 扩展页。`:`Chrome extensions opened.`),t[35]=a,t[36]=r,t[37]=N):N=t[37];let P;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,z.jsx)(c,{className:`size-3.5`}),t[38]=P):P=t[38];let ce=r?`打开扩展页`:`Open extensions`,F;t[39]!==se||t[40]!==N||t[41]!==ce?(F=(0,z.jsxs)(w,{className:`h-9`,variant:`secondary`,disabled:se,onClick:N,children:[P,ce]}),t[39]=se,t[40]=N,t[41]=ce,t[42]=F):F=t[42];let L=!l?.installed||i!==null,R;t[43]!==a||t[44]!==r?(R=()=>void a(`extension-folder`,ue,r?`已打开扩展目录。`:`Extension folder opened.`),t[43]=a,t[44]=r,t[45]=R):R=t[45];let B;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,z.jsx)(u,{className:`size-3.5`}),t[46]=B):B=t[46];let le=r?`打开扩展目录`:`Open folder`,V;t[47]!==L||t[48]!==R||t[49]!==le?(V=(0,z.jsxs)(w,{className:`h-9`,variant:`ghost`,disabled:L,onClick:R,children:[B,le]}),t[47]=L,t[48]=R,t[49]=le,t[50]=V):V=t[50];let fe=i!==null,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,z.jsx)(ae,{className:`size-3.5`}),t[51]=U):U=t[51];let pe=r?`连接远程 Chrome`:`Connect remote Chrome`,W;t[52]!==o||t[53]!==fe||t[54]!==pe?(W=(0,z.jsxs)(w,{className:`h-9`,variant:`secondary`,disabled:fe,onClick:o,children:[U,pe]}),t[52]=o,t[53]=fe,t[54]=pe,t[55]=W):W=t[55];let G;t[56]!==M||t[57]!==F||t[58]!==V||t[59]!==W?(G=(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M,F,V,W]}),t[56]=M,t[57]=F,t[58]=V,t[59]=W,t[60]=G):G=t[60];let K;t[61]!==n?.connected||t[62]!==n?.socketConnected||t[63]!==r?(K=n?.connected?null:(0,z.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-fg-muted`,children:n?.socketConnected?r?`扩展仍在运行旧协议。请打开 Chrome 扩展页,找到 xopc 并点击“重新加载”,然后刷新状态。`:`The extension is still running an older protocol. Open Chrome Extensions, find xopc, click Reload, then refresh status.`:r?`打开 xopc Chrome 扩展后,它会自动发现并安全连接本机 Gateway;只有连接另一台电脑时才需要一次性邀请和手动确认。`:`Open the xopc Chrome extension to discover and securely connect to a local Gateway automatically. A one-time invitation and explicit approval are only required for Chrome on another computer.`}),t[61]=n?.connected,t[62]=n?.socketConnected,t[63]=r,t[64]=K):K=t[64];let q;return t[65]!==O||t[66]!==k||t[67]!==G||t[68]!==K?(q=(0,z.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base/45 p-4`,children:[O,k,G,K]}),t[65]=O,t[66]=k,t[67]=G,t[68]=K,t[69]=q):q=t[69],q}function ue(){return C(`folder`)}function de(){return C(`chrome`)}function fe(e){let t=(0,I.c)(28),{status:n,zh:r,installer:i}=e,a=n?.installed===!0,o=n?.installed?r?`已安装`:`Installed`:n?.reason??(r?`未安装`:`Not installed`),c;t[0]!==a||t[1]!==o?(c=(0,z.jsx)(H,{label:`Chromium`,ok:a,value:o}),t[0]=a,t[1]=o,t[2]=c):c=t[2];let l;t[3]===n?l=t[4]:(l=n?.executablePath?(0,z.jsx)(`p`,{className:`mt-2 break-all text-xs text-fg-subtle`,children:n.executablePath}):null,t[3]=n,t[4]=l);let u;t[5]===i.progress?u=t[6]:(u=i.progress?(0,z.jsxs)(`div`,{className:`mt-3`,children:[(0,z.jsxs)(`div`,{className:`flex justify-between text-xs text-fg-muted`,children:[(0,z.jsx)(`span`,{children:i.progress.message??i.progress.phase}),(0,z.jsx)(`span`,{children:i.progress.percent==null?``:`${Math.round(i.progress.percent)}%`})]}),(0,z.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-surface-hover`,children:(0,z.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width]`,style:{width:`${i.progress.percent??8}%`}})})]}):null,t[5]=i.progress,t[6]=u);let d=n?.installed?`secondary`:`primary`,f;t[7]===i?f=t[8]:(f=()=>void i.install(),t[7]=i,t[8]=f);let p;t[9]===i.running?p=t[10]:(p=i.running?(0,z.jsx)(T,{className:`size-3.5 animate-spin`}):(0,z.jsx)(s,{className:`size-3.5`}),t[9]=i.running,t[10]=p);let m=n?.installed?r?`重新安装 Chromium`:`Reinstall Chromium`:r?`安装 Chromium`:`Install Chromium`,h;t[11]!==i.running||t[12]!==d||t[13]!==f||t[14]!==p||t[15]!==m?(h=(0,z.jsxs)(w,{variant:d,className:`h-9`,disabled:i.running,onClick:f,children:[p,m]}),t[11]=i.running,t[12]=d,t[13]=f,t[14]=p,t[15]=m,t[16]=h):h=t[16];let g;t[17]!==i||t[18]!==r?(g=i.running?(0,z.jsx)(w,{variant:`ghost`,className:`h-9`,disabled:i.cancelling,onClick:()=>void i.cancel(),children:i.cancelling?r?`正在取消…`:`Cancelling…`:r?`取消`:`Cancel`}):null,t[17]=i,t[18]=r,t[19]=g):g=t[19];let _;t[20]!==g||t[21]!==h?(_=(0,z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[h,g]}),t[20]=g,t[21]=h,t[22]=_):_=t[22];let v;return t[23]!==_||t[24]!==c||t[25]!==l||t[26]!==u?(v=(0,z.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base/45 p-4`,children:[c,l,u,_]}),t[23]=_,t[24]=c,t[25]=l,t[26]=u,t[27]=v):v=t[27],v}function H(e){let t=(0,I.c)(11),{label:n,ok:r,value:i}=e,a;t[0]===n?a=t[1]:(a=(0,z.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=a);let o=`mt-1 flex items-center gap-1.5 text-sm ${r?`text-success`:`text-fg-muted`}`,s=`size-1.5 rounded-full ${r?`bg-success`:`bg-warning`}`,c;t[2]===s?c=t[3]:(c=(0,z.jsx)(`span`,{className:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c||t[6]!==i?(l=(0,z.jsxs)(`p`,{className:o,children:[c,i]}),t[4]=o,t[5]=c,t[6]=i,t[7]=l):l=t[7];let u;return t[8]!==a||t[9]!==l?(u=(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-inset px-3 py-2`,children:[a,l]}),t[8]=a,t[9]=l,t[10]=u):u=t[10],u}function U(e){let t=(0,I.c)(4),{tone:n,children:r}=e,i=`mt-3 rounded-lg px-3 py-2 text-xs ${n===`success`?`bg-success-soft text-success`:`bg-danger-soft text-danger`}`,a=n===`error`?`alert`:`status`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,z.jsx)(`p`,{className:i,role:a,children:r}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function pe(e){let t=(0,I.c)(36),{sectionId:n,vm:r,children:i}=e,a=m(W),o;t[0]===a?o=t[1]:(o=d(a),t[0]=a,t[1]=o);let s=o,c=s.agentSettings,l=s.settingsSections[n]??n;if(!r.hasToken){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(ee,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75}),t[2]=e):e=t[2];let n;t[3]===l?n=t[4]:(n=(0,z.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:l}),t[3]=l,t[4]=n);let r;t[5]===c.needToken?r=t[6]:(r=(0,z.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:c.needToken}),t[5]=c.needToken,t[6]=r);let i;return t[7]!==n||t[8]!==r?(i=(0,z.jsx)(P,{gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:(0,z.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[e,(0,z.jsxs)(`div`,{children:[n,r]})]})}),t[7]=n,t[8]=r,t[9]=i):i=t[9],i}if(r.loading){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(P,{gap:`gap-6`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:(0,z.jsx)(te,{sections:1})}),t[10]=e):e=t[10],e}if(!r.form){let e=r.error??r.fetchError??c.loadError,n;t[11]===e?n=t[12]:(n=(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n);let i;t[13]===r?i=t[14]:(i=()=>void r.mutate(),t[13]=r,t[14]=i);let a;t[15]!==s.logs.refresh||t[16]!==i?(a=(0,z.jsx)(w,{type:`button`,variant:`secondary`,onClick:i,children:s.logs.refresh}),t[15]=s.logs.refresh,t[16]=i,t[17]=a):a=t[17];let o;return t[18]!==n||t[19]!==a?(o=(0,z.jsxs)(P,{gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:[n,a]}),t[18]=n,t[19]=a,t[20]=o):o=t[20],o}let u;t[21]!==r.autosaveStatus||t[22]!==r.error?(u=(0,z.jsx)(ce,{status:r.autosaveStatus,error:r.error}),t[21]=r.autosaveStatus,t[22]=r.error,t[23]=u):u=t[23];let f;t[24]!==l||t[25]!==u?(f=(0,z.jsx)(N,{title:l,actions:u}),t[24]=l,t[25]=u,t[26]=f):f=t[26];let p;t[27]===r.error?p=t[28]:(p=r.error?(0,z.jsx)(`div`,{className:`rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/50 dark:text-red-400`,role:`alert`,children:r.error}):null,t[27]=r.error,t[28]=p);let h;t[29]===i?h=t[30]:(h=(0,z.jsx)(`div`,{className:`flex min-w-0 flex-col gap-5 pb-8`,children:i}),t[29]=i,t[30]=h);let g;return t[31]!==f||t[32]!==p||t[33]!==h||t[34]!==r.onBlurCapture?(g=(0,z.jsxs)(P,{gap:`gap-6`,onBlurCapture:r.onBlurCapture,children:[f,p,h]}),t[31]=f,t[32]=p,t[33]=h,t[34]=r.onBlurCapture,t[35]=g):g=t[35],g}function W(e){return e.language}var G={enabled:!0,driverKind:`extension`,headless:!1,executablePath:``,cdpEndpoint:`http://127.0.0.1:9222`,remoteProvider:`browserbase`,remoteApiKey:``,remoteProjectId:``,remoteRegion:``,maxNodes:180,maxCharacters:12e3,visualFallback:!0,actionTimeoutMs:3e4,sessionTimeoutMs:9e5,maxSequenceLength:5,allowedPrivateHosts:``,crossDomainNavigation:`allow`,uploads:`allow`,consequentialActions:`allow`};function K(e){let t=J(J(e).browser),n=J(t.driver),r=J(t.observation),i=J(t.limits),a=J(t.security),o=n.kind;return{...G,enabled:t.enabled!==!1,driverKind:o===`playwright`||o===`cdp`||o===`remote`?o:`extension`,headless:n.headless===!0,executablePath:Y(n.executablePath,``),cdpEndpoint:Y(n.endpoint,G.cdpEndpoint),remoteProvider:n.provider===`browser-use`?`browser-use`:`browserbase`,remoteApiKey:Y(n.apiKey,``),remoteProjectId:Y(n.projectId,``),remoteRegion:Y(n.region,``),maxNodes:X(r.maxNodes,G.maxNodes),maxCharacters:X(r.maxCharacters,G.maxCharacters),visualFallback:r.visualFallback!==!1,actionTimeoutMs:X(i.actionTimeoutMs,G.actionTimeoutMs),sessionTimeoutMs:X(i.sessionTimeoutMs,G.sessionTimeoutMs),maxSequenceLength:X(i.maxSequenceLength,G.maxSequenceLength),allowedPrivateHosts:Array.isArray(a.allowedPrivateHosts)?a.allowedPrivateHosts.filter(e=>typeof e==`string`).join(`
|
|
2
|
-
`):``,crossDomainNavigation:ge(a.crossDomainNavigation),uploads:ge(a.uploads),consequentialActions:ge(a.consequentialActions)}}function q(e){let t=e.driverKind===`extension`?{kind:`extension`}:e.driverKind===`playwright`?{kind:`playwright`,headless:e.headless,...e.executablePath.trim()?{executablePath:e.executablePath.trim()}:{}}:e.driverKind===`cdp`?{kind:`cdp`,endpoint:e.cdpEndpoint.trim()}:{kind:`remote`,provider:e.remoteProvider,...e.remoteApiKey.trim()?{apiKey:e.remoteApiKey.trim()}:{},...e.remoteProjectId.trim()?{projectId:e.remoteProjectId.trim()}:{},...e.remoteRegion.trim()?{region:e.remoteRegion.trim()}:{}};return{enabled:e.enabled,driver:t,observation:{maxNodes:e.maxNodes,maxCharacters:e.maxCharacters,visualFallback:e.visualFallback},limits:{actionTimeoutMs:e.actionTimeoutMs,sessionTimeoutMs:e.sessionTimeoutMs,maxSequenceLength:e.maxSequenceLength},security:{privateNetworks:`deny`,allowedPrivateHosts:e.allowedPrivateHosts.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(Boolean),crossDomainNavigation:e.crossDomainNavigation,uploads:e.uploads,consequentialActions:e.consequentialActions}}}function me(e){if(e.driverKind===`cdp`)try{let t=new URL(e.cdpEndpoint);if(t.protocol!==`http:`&&t.protocol!==`https:`&&t.protocol!==`ws:`&&t.protocol!==`wss:`)return`CDP endpoint must use http, https, ws, or wss.`}catch{return`Enter a valid CDP endpoint URL.`}return!Number.isInteger(e.maxNodes)||e.maxNodes<20||e.maxNodes>500?`Max nodes must be between 20 and 500.`:!Number.isInteger(e.maxCharacters)||e.maxCharacters<1e3||e.maxCharacters>5e4?`Max characters must be between 1,000 and 50,000.`:!Number.isInteger(e.actionTimeoutMs)||e.actionTimeoutMs<1e3||e.actionTimeoutMs>12e4?`Action timeout must be between 1,000 and 120,000 ms.`:!Number.isInteger(e.sessionTimeoutMs)||e.sessionTimeoutMs<6e4||e.sessionTimeoutMs>36e5?`Session timeout must be between 60,000 and 3,600,000 ms.`:!Number.isInteger(e.maxSequenceLength)||e.maxSequenceLength<1||e.maxSequenceLength>10?`Sequence length must be between 1 and 10.`:null}async function he(e){await f(h(`/api/config`),{method:`PATCH`,body:JSON.stringify({browser:q(e)})}),_()}function J(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Y(e,t){return typeof e==`string`?e:t}function X(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function ge(e){return e===`deny`?`deny`:`allow`}var _e=y();function ve(e){let t=!!p(e=>e.conversationId),[n,r]=(0,L.useReducer)(_e,{form:null,baseline:null}),i=n.form,a=n.baseline,o=(0,L.useRef)(!1),s=(0,L.useRef)(i);s.current=i;let c=(0,L.useRef)(null),{data:l,error:u,isLoading:d,mutate:f}=v(t);j({enabled:t,parsed:(0,L.useMemo)(()=>l?.payload?.config===void 0?null:K(l.payload.config),[l]),dirty:o.current,trackedParsedRef:c,dispatch:r,onResetDirty:()=>{o.current=!1}});let m=!!(t&&d&&l===void 0&&!u),h=u instanceof Error?u.message:u?String(u):null,g=(0,L.useMemo)(()=>!i||!a?!1:JSON.stringify(i)!==JSON.stringify(a),[i,a]),_=(0,L.useCallback)(e=>{o.current=!0,r({type:`patch`,patch:e})},[]),y=F({value:i,dirty:g,onSave:(0,L.useCallback)(async t=>{try{await he(t),r({type:`saved`,value:t}),o.current=!!(s.current&&JSON.stringify(s.current)!==JSON.stringify(t))}catch(t){throw Error(t instanceof Error?t.message:e.saveError)}},[e.saveError]),validate:me});return{hasToken:t,loading:m,fetchError:h,form:i,update:_,autosaveStatus:y.status,error:y.error,onBlurCapture:y.onBlurCapture,mutate:f}}var ye=[`extension`,`playwright`,`cdp`,`remote`];function be(){let e=(0,I.c)(29),t=m(xe),n;e[0]===t?n=e[1]:(n=d(t),e[0]=t,e[1]=n);let r=ve(n.agentSettings),i=r.form,o=t===`zh`,[s]=a(),c=(0,L.useRef)(!1),u;e[2]!==i||e[3]!==s||e[4]!==r?(u=()=>{if(!i||c.current)return;c.current=!0;let e=s.get(`driver`);ye.includes(e)&&e!==i.driverKind&&r.update({driverKind:e})},e[2]=i,e[3]=s,e[4]=r,e[5]=u):u=e[5];let f;e[6]!==i||e[7]!==s||e[8]!==r.update?(f=[i,s,r.update],e[6]=i,e[7]=s,e[8]=r.update,e[9]=f):f=e[9],(0,L.useEffect)(u,f);let p=o?`Chrome 扩展(推荐)`:`Chrome extension (recommended)`,h;e[10]===p?h=e[11]:(h={value:`extension`,label:p},e[10]=p,e[11]=h);let g;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(g={value:`playwright`,label:`Playwright Chromium`},e[12]=g):g=e[12];let _=o?`CDP 已有浏览器`:`Existing browser over CDP`,v;e[13]===_?v=e[14]:(v={value:`cdp`,label:_},e[13]=_,e[14]=v);let y=o?`远程浏览器`:`Remote browser`,b;e[15]===y?b=e[16]:(b={value:`remote`,label:y},e[15]=y,e[16]=b);let x;e[17]!==h||e[18]!==v||e[19]!==b?(x=[h,g,v,b],e[17]=h,e[18]=v,e[19]=b,e[20]=x):x=e[20];let C=x,w;e[21]!==C||e[22]!==i||e[23]!==r||e[24]!==o?(w=i?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(le,{enabled:i.enabled,driverKind:i.driverKind,autosaveStatus:r.autosaveStatus,zh:o}),(0,z.jsxs)(Ce,{title:o?`运行方式`:`Connection`,icon:(0,z.jsx)(D,{className:`size-4`}),children:[(0,z.jsx)(we,{label:o?`启用浏览器控制`:`Enable browser control`,checked:i.enabled,onChange:e=>r.update({enabled:e})}),(0,z.jsx)(Z,{label:o?`浏览器连接`:`Browser connection`,children:(0,z.jsx)(A,{value:i.driverKind,options:C,placeholder:o?`选择连接方式`:`Choose a connection`,allowEmpty:!1,onChange:e=>r.update({driverKind:e})})}),(0,z.jsx)(Se,{kind:i.driverKind,zh:o}),i.driverKind===`playwright`?(0,z.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,z.jsx)(we,{label:o?`无头模式`:`Headless mode`,description:o?`后台运行,不显示浏览器窗口。关闭后可观察智能体的操作过程。`:`Run in the background without a visible window. Turn off to watch the agent work.`,checked:i.headless,onChange:e=>r.update({headless:e})}),(0,z.jsx)(S,{title:o?`自定义 Chromium`:`Custom Chromium`,summary:i.executablePath||(o?`使用 xopc 安装的 Chromium`:`Use Chromium installed by xopc`),children:(0,z.jsx)(Q,{label:o?`Chromium 可执行文件(可选)`:`Chromium executable (optional)`,description:o?`留空时使用由 xopc 安装的 Chromium。`:`Leave empty to use Chromium installed by xopc.`,value:i.executablePath,onChange:e=>r.update({executablePath:e})})})]}):null,i.driverKind===`cdp`?(0,z.jsx)(`div`,{className:`rounded-lg bg-surface-inset p-4`,children:(0,z.jsx)(Q,{label:`CDP endpoint`,description:o?`例如 http://127.0.0.1:9222。Chrome 需要开启 remote debugging。`:`For example http://127.0.0.1:9222. Chrome must be started with remote debugging enabled.`,value:i.cdpEndpoint,onChange:e=>r.update({cdpEndpoint:e})})}):null,i.driverKind===`remote`?(0,z.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,z.jsx)(Z,{label:o?`服务商`:`Provider`,children:(0,z.jsx)(A,{value:i.remoteProvider,options:[{value:`browserbase`,label:`Browserbase`},{value:`browser-use`,label:`Browser Use`}],placeholder:o?`选择服务商`:`Choose a provider`,allowEmpty:!1,onChange:e=>r.update({remoteProvider:e})})}),(0,z.jsx)(Q,{label:`API key`,type:`password`,autoComplete:`off`,value:i.remoteApiKey,onChange:e=>r.update({remoteApiKey:e})}),(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,z.jsx)(Q,{label:`Project ID`,value:i.remoteProjectId,onChange:e=>r.update({remoteProjectId:e})}),(0,z.jsx)(Q,{label:`Region`,value:i.remoteRegion,onChange:e=>r.update({remoteRegion:e})})]})]}):null]}),(0,z.jsx)(S,{title:o?`页面理解与执行限制`:`Observation and execution limits`,summary:o?`当前截图、页面大小和超时策略继续生效。`:`Current screenshot, page size and timeout policies remain active.`,children:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Ce,{title:o?`页面理解`:`Page understanding`,icon:(0,z.jsx)(l,{className:`size-4`}),children:[(0,z.jsx)(we,{label:o?`需要时附加截图`:`Attach screenshots when needed`,checked:i.visualFallback,onChange:e=>r.update({visualFallback:e})}),(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,z.jsx)($,{label:o?`语义节点上限`:`Semantic node limit`,description:`20–500`,min:20,max:500,value:i.maxNodes,onChange:e=>r.update({maxNodes:e})}),(0,z.jsx)($,{label:o?`文本字符上限`:`Text character limit`,description:`1,000–50,000`,min:1e3,max:5e4,step:1e3,value:i.maxCharacters,onChange:e=>r.update({maxCharacters:e})})]})]}),(0,z.jsx)(Ce,{title:o?`执行限制`:`Execution limits`,icon:(0,z.jsx)(oe,{className:`size-4`}),children:(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,z.jsx)($,{label:o?`操作超时(毫秒)`:`Action timeout (ms)`,min:1e3,max:12e4,step:1e3,value:i.actionTimeoutMs,onChange:e=>r.update({actionTimeoutMs:e})}),(0,z.jsx)($,{label:o?`会话超时(毫秒)`:`Session timeout (ms)`,min:6e4,max:36e5,step:6e4,value:i.sessionTimeoutMs,onChange:e=>r.update({sessionTimeoutMs:e})}),(0,z.jsx)($,{label:o?`批量步骤上限`:`Sequence step limit`,min:1,max:10,value:i.maxSequenceLength,onChange:e=>r.update({maxSequenceLength:e})})]})})]})}),(0,z.jsxs)(Ce,{title:o?`访问策略`:`Access policies`,icon:(0,z.jsx)(re,{className:`size-4`}),children:[(0,z.jsx)(S,{title:o?`私网访问例外`:`Private network exceptions`,summary:i.allowedPrivateHosts||(o?`未设置私网例外`:`No private network exceptions`),children:(0,z.jsx)(Q,{label:o?`允许访问的私网主机`:`Allowed private hosts`,description:o?`每行一个主机名或 IP,不支持通配符。`:`One hostname or IP per line. Wildcards are not supported.`,multiline:!0,value:i.allowedPrivateHosts,onChange:e=>r.update({allowedPrivateHosts:e})})}),(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,z.jsx)(Te,{zh:o,label:o?`跨域导航`:`Cross-domain navigation`,value:i.crossDomainNavigation,onChange:e=>r.update({crossDomainNavigation:e})}),(0,z.jsx)(Te,{zh:o,label:o?`高影响动作`:`Consequential actions`,value:i.consequentialActions,onChange:e=>r.update({consequentialActions:e})}),(0,z.jsx)(Te,{zh:o,label:o?`文件上传`:`File uploads`,value:i.uploads,onChange:e=>r.update({uploads:e})})]})]})]}):null,e[21]=C,e[22]=i,e[23]=r,e[24]=o,e[25]=w):w=e[25];let T;return e[26]!==w||e[27]!==r?(T=(0,z.jsx)(pe,{sectionId:`agent-browser`,vm:r,children:w}),e[26]=w,e[27]=r,e[28]=T):T=e[28],T}function xe(e){return e.language}function Se(e){let t=(0,I.c)(7),{kind:n,zh:r}=e,i=r?`直接操作你正在使用的 Chrome,保留登录状态和现有标签页;最适合日常协作。`:`Operate your current Chrome with its signed-in state and existing tabs; best for daily collaboration.`,a=r?`由 xopc 启动独立 Chromium,环境隔离、自动化稳定,适合无人值守任务。`:`Let xopc launch an isolated Chromium; stable for unattended automation.`,o=r?`连接已开启远程调试的 Chrome 或 Chromium,适合自定义浏览器启动方式。`:`Connect to Chrome or Chromium already running with remote debugging.`,s=r?`使用 Browserbase 或 Browser Use 的云端浏览器,适合服务器环境和长任务。`:`Use a Browserbase or Browser Use cloud browser for servers and long-running tasks.`,c;t[0]!==i||t[1]!==a||t[2]!==o||t[3]!==s?(c={extension:i,playwright:a,cdp:o,remote:s},t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c):c=t[4];let l=c[n],u;return t[5]===l?u=t[6]:(u=(0,z.jsx)(`p`,{className:`rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:l}),t[5]=l,t[6]=u),u}function Ce(e){let t=(0,I.c)(17),{title:n,description:r,icon:i,children:a}=e,o;t[0]===i?o=t[1]:(o=(0,z.jsx)(`span`,{className:`mt-0.5 text-fg-subtle`,children:i}),t[0]=i,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[2]=n,t[3]=s);let c;t[4]===r?c=t[5]:(c=r?(0,z.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r}):null,t[4]=r,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,z.jsxs)(`div`,{children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==l?(u=(0,z.jsxs)(`div`,{className:`mb-4 flex items-start gap-2`,children:[o,l]}),t[9]=o,t[10]=l,t[11]=u):u=t[11];let d;t[12]===a?d=t[13]:(d=(0,z.jsx)(`div`,{className:`space-y-4`,children:a}),t[12]=a,t[13]=d);let f;return t[14]!==u||t[15]!==d?(f=(0,z.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[u,d]}),t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Z(e){let t=(0,I.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,z.jsx)(`span`,{className:`mb-1.5 block font-medium`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,z.jsx)(`span`,{className:`mt-1.5 block text-xs leading-5 text-fg-subtle`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,z.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Q(e){let t=(0,I.c)(10),{label:n,description:r,value:i,onChange:a,type:o,multiline:s,autoComplete:c}=e,l=o===void 0?`text`:o,u=s===void 0?!1:s,d;t[0]!==c||t[1]!==u||t[2]!==a||t[3]!==l||t[4]!==i?(d=u?(0,z.jsx)(`textarea`,{rows:3,value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg outline-none focus:border-accent`}):(0,z.jsx)(`input`,{type:l,autoComplete:c,value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg outline-none focus:border-accent`}),t[0]=c,t[1]=u,t[2]=a,t[3]=l,t[4]=i,t[5]=d):d=t[5];let f;return t[6]!==r||t[7]!==n||t[8]!==d?(f=(0,z.jsx)(Z,{label:n,description:r,children:d}),t[6]=r,t[7]=n,t[8]=d,t[9]=f):f=t[9],f}function $(e){let t=(0,I.c)(12),{label:n,description:r,value:i,onChange:a,min:o,max:s,step:c}=e,l=c===void 0?1:c,u;t[0]===a?u=t[1]:(u=e=>{let t=Number(e.target.value);Number.isFinite(t)&&a(t)},t[0]=a,t[1]=u);let d;t[2]!==s||t[3]!==o||t[4]!==l||t[5]!==u||t[6]!==i?(d=(0,z.jsx)(se,{type:`number`,min:o,max:s,step:l,value:i,onChange:u,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-accent`}),t[2]=s,t[3]=o,t[4]=l,t[5]=u,t[6]=i,t[7]=d):d=t[7];let f;return t[8]!==r||t[9]!==n||t[10]!==d?(f=(0,z.jsx)(Z,{label:n,description:r,children:d}),t[8]=r,t[9]=n,t[10]=d,t[11]=f):f=t[11],f}function we(e){let t=(0,I.c)(15),{label:n,description:r,checked:i,onChange:a}=e,o;t[0]===a?o=t[1]:(o=e=>a(e.target.checked),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==o?(s=(0,z.jsx)(`input`,{type:`checkbox`,checked:i,onChange:o,className:`mt-0.5 size-4 accent-accent`}),t[2]=i,t[3]=o,t[4]=s):s=t[4];let c;t[5]===n?c=t[6]:(c=(0,z.jsx)(`span`,{className:`block font-medium`,children:n}),t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=r?(0,z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-subtle`,children:r}):null,t[7]=r,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,z.jsxs)(`span`,{children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==s||t[13]!==u?(d=(0,z.jsxs)(`label`,{className:`flex items-start gap-3 text-sm text-fg`,children:[s,u]}),t[12]=s,t[13]=u,t[14]=d):d=t[14],d}function Te(e){let t=(0,I.c)(17),{zh:n,label:r,value:i,onChange:a}=e,o=n?`允许`:`Allow`,s;t[0]===o?s=t[1]:(s={value:`allow`,label:o},t[0]=o,t[1]=s);let c=n?`拒绝`:`Deny`,l;t[2]===c?l=t[3]:(l={value:`deny`,label:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==l?(u=[s,l],t[4]=s,t[5]=l,t[6]=u):u=t[6];let d=u,f=n?`选择策略`:`Choose a policy`,p;t[7]===a?p=t[8]:(p=e=>a(e),t[7]=a,t[8]=p);let m;t[9]!==d||t[10]!==f||t[11]!==p||t[12]!==i?(m=(0,z.jsx)(A,{value:i,options:d,placeholder:f,allowEmpty:!1,onChange:p}),t[9]=d,t[10]=f,t[11]=p,t[12]=i,t[13]=m):m=t[13];let h;return t[14]!==r||t[15]!==m?(h=(0,z.jsx)(Z,{label:r,children:m}),t[14]=r,t[15]=m,t[16]=h):h=t[16],h}export{be as AgentBrowserSettingsPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skills-page-D3JAw62U.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-CKdOZoVu.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/middleware-Pd0e8Igk.js","assets/locale-store-CE7L6MlS.js","assets/messages-CaeL_miw.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-PrKvVpRh.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-B2HK1psj.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/mermaid-render-604gISVe.js","assets/xml-_d7dTN2Q.js","assets/app-link-BV_eGr7l.js","assets/product-delivery-DwmnNJvk.js","assets/schemas-CObaziC7.js","assets/local-apps-yys1VChX.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-Ct4sKkUf.css","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/session-manager-DoFTlgNz.js","assets/gateway-realtime-Dng_VOvI.js","assets/gateway-realtime-store-DtlBf7oH.js","assets/local-session-drafts-CYEDUPH7.js","assets/session-api-CaAUJvu1.js","assets/gateway-startup-retry-CDCiy7Cd.js","assets/constants-DeXt1mV-.js","assets/tool-activity-BtJkgjFf.js","assets/registry-api-BO2Ck3aA.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-B5aykqg_.js","assets/gateway-config-swr-BEePO3Wl.js","assets/capabilities-pt2M56-E.js","assets/tasks-PuIUgF9L.js","assets/specialists-4bkS5rZ4.js","assets/files-Bw4SBGdM.js","assets/index-Rxjt-jc3.css","assets/capability-header-actions-CFVx3iaZ.js","assets/capability-icon-DVoZxEgW.js","assets/skill-api-CcYGkRPL.js","assets/skill-reload-api-PnUZjoPK.js","assets/connectors-page-DA2b6cJu.js","assets/number-input-DDeqHK-G.js","assets/connector-service-page-CDyCHkpK.js","assets/agent-plugin-dialog-cjJXJj_3.js","assets/apps-page-DOkyvOF0.js","assets/agents-DW3TlnIg.js","assets/directory-picker-path-field-C6cUgrvg.js","assets/image-generation-api-DwkO2y46.js","assets/settings-page-layout-Dx5S-Msc.js","assets/channels-BXA55GY2.js","assets/browser-BLJWD7WI.js","assets/schema-form-DNM2Zdyr.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{m as a,r as o}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as s}from"./messages-CaeL_miw.js";import{n as c}from"./locale-store-CE7L6MlS.js";import{Ic as l,Uo as u,hl as d}from"./index-CKdOZoVu.js";import{t as f}from"./capability-header-actions-CFVx3iaZ.js";var p=n(),m=e(t(),1),h=r(),g=(0,m.lazy)(()=>i(()=>import(`./skills-page-D3JAw62U.js`).then(e=>({default:e.SkillsPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]))),_=(0,m.lazy)(()=>i(()=>import(`./connectors-page-DA2b6cJu.js`).then(e=>({default:e.ConnectorsPage})),__vite__mapDeps([58,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,59,54,60,61]))),v=(0,m.lazy)(()=>i(()=>import(`./apps-page-DOkyvOF0.js`).then(e=>({default:e.ExtensionsPage})),__vite__mapDeps([62,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,61]))),y=(0,m.lazy)(()=>i(()=>import(`./agents-DW3TlnIg.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([63,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,59,64,65,66]))),b=(0,m.lazy)(()=>i(()=>import(`./channels-BXA55GY2.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([67,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,68,69,59,66])));function x(e){return d.includes(e)?e:null}function S(e){let t=(0,p.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Array.from({length:6},C),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,h.jsx)(`div`,{className:`mx-auto grid w-full max-w-7xl gap-4 px-4 pb-7 pt-3 sm:grid-cols-2 sm:px-6 lg:grid-cols-3 lg:px-8 lg:pb-9 lg:pt-4`,"aria-label":n,"aria-busy":!0,children:r}),t[1]=n,t[2]=i),i}function C(e,t){return(0,h.jsx)(l,{className:`h-40 rounded-xl`},t)}function w(){let e=(0,p.c)(41),t=c(D),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n,i=r.capabilitiesHub,{section:l,detailId:d}=a(),C;e[2]===l?C=e[3]:(C=x(l),e[2]=l,e[3]=C);let w=C,O=w??`skills`,k=r.productNavigation.sections[`capabilities-${O}`],A=u(E),j=u(T),M;e[4]===O?M=e[5]:(M={section:O,value:null},e[4]=O,e[5]=M);let[N,P]=(0,m.useState)(M),F=N.section===O?N.value:null,I;e[6]===O?I=e[7]:(I=e=>{P({section:O,value:e})},e[6]=O,e[7]=I);let L=I,R,z;if(e[8]!==j||e[9]!==F||e[10]!==k||e[11]!==A?(R=()=>(A({startExtra:null,main:(0,h.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:k}),end:(0,h.jsx)(f,{contribution:F})}),()=>j()),z=[j,F,k,A],e[8]=j,e[9]=F,e[10]=k,e[11]=A,e[12]=R,e[13]=z):(R=e[12],z=e[13]),(0,m.useLayoutEffect)(R,z),!w){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(o,{to:`/capabilities/skills`,replace:!0}),e[14]=t):t=e[14],t}let B;e[15]===i.discoverLoading?B=e[16]:(B=(0,h.jsx)(S,{label:i.discoverLoading}),e[15]=i.discoverLoading,e[16]=B);let V;e[17]!==d||e[18]!==L||e[19]!==O?(V=O===`agents`?(0,h.jsx)(y,{agentId:d,onHeaderActionChange:L}):null,e[17]=d,e[18]=L,e[19]=O,e[20]=V):V=e[20];let H;e[21]!==L||e[22]!==O?(H=O===`skills`?(0,h.jsx)(g,{embedded:!0,onHeaderActionChange:L}):null,e[21]=L,e[22]=O,e[23]=H):H=e[23];let U;e[24]!==L||e[25]!==O?(U=O===`connectors`?(0,h.jsx)(_,{embedded:!0,onHeaderActionChange:L}):null,e[24]=L,e[25]=O,e[26]=U):U=e[26];let W;e[27]!==d||e[28]!==L||e[29]!==O?(W=O===`channels`?(0,h.jsx)(b,{channelId:d,onHeaderActionChange:L}):null,e[27]=d,e[28]=L,e[29]=O,e[30]=W):W=e[30];let G;e[31]!==L||e[32]!==O?(G=O===`extensions`?(0,h.jsx)(v,{embedded:!0,onHeaderActionChange:L}):null,e[31]=L,e[32]=O,e[33]=G):G=e[33];let K;return e[34]!==W||e[35]!==G||e[36]!==B||e[37]!==V||e[38]!==H||e[39]!==U?(K=(0,h.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,h.jsxs)(m.Suspense,{fallback:B,children:[V,H,U,W,G]})}),e[34]=W,e[35]=G,e[36]=B,e[37]=V,e[38]=H,e[39]=U,e[40]=K):K=e[40],K}function T(e){return e.clearPageHeader}function E(e){return e.setPageHeader}function D(e){return e.language}export{w as CapabilitiesPage};
|