specrails-desktop 2.63.2 → 2.64.0
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/client/dist/assets/{ActivityFeedPage-B1bpTy7O.js → ActivityFeedPage-D23wXKgy.js} +1 -1
- package/client/dist/assets/{AgentBrowserCapture-BussBbN3.js → AgentBrowserCapture-DQzS4XcK.js} +1 -1
- package/client/dist/assets/{AgentModeAnalyticsPane-BiT1n3BU.js → AgentModeAnalyticsPane-CFTiSl8T.js} +2 -2
- package/client/dist/assets/{AgentModeCodePane-CUjNfeKa.js → AgentModeCodePane-DAaSzIPA.js} +2 -2
- package/client/dist/assets/{AgentModeJobsPane-RVEwyS59.js → AgentModeJobsPane-C29YpixV.js} +1 -1
- package/client/dist/assets/{AgentsPage-DKE-eMC5.js → AgentsPage-B-sSTP1I.js} +1 -1
- package/client/dist/assets/{AnalyticsPage-Bser2Ly3.js → AnalyticsPage-81fI80nA.js} +1 -1
- package/client/dist/assets/{CodePage-BK0grm6e.js → CodePage-Ct4XEPdx.js} +1 -1
- package/client/dist/assets/{DesktopAnalyticsPage-DEBidZbs.js → DesktopAnalyticsPage-Bt37XOLF.js} +1 -1
- package/client/dist/assets/{DocsDialog-Dhyo57n9.js → DocsDialog-_IEr8umI.js} +1 -1
- package/client/dist/assets/{DocsPage-BcEkPXd6.js → DocsPage-DX9WOqt2.js} +1 -1
- package/client/dist/assets/{ExportDropdown-mRmqdkjr.js → ExportDropdown-Bb1lHx3r.js} +1 -1
- package/client/dist/assets/{InteractiveJobComposer-BlCe3vrU.js → InteractiveJobComposer-DDI6TdsS.js} +1 -1
- package/client/dist/assets/{JobDetailModal-CkAejD1F.js → JobDetailModal-CkD0PBaZ.js} +1 -1
- package/client/dist/assets/{JobDetailPage-P-FS_lKz.js → JobDetailPage-B8Rd4U5J.js} +1 -1
- package/client/dist/assets/{JobsPage-CoUXgYse.js → JobsPage-ChOiSbJn.js} +1 -1
- package/client/dist/assets/{LoopBuilderPage-iFylNk68.js → LoopBuilderPage-6Xwt2G6G.js} +1 -1
- package/client/dist/assets/{LoopPreviewModal-4obS_Ptg.js → LoopPreviewModal-CyDapSvB.js} +1 -1
- package/client/dist/assets/{LoopWindowSurface-CLr5OPqj.js → LoopWindowSurface-gRdx4nmg.js} +1 -1
- package/client/dist/assets/{LoopsPage-eKpWFtCp.js → LoopsPage-BPGVFsH-.js} +1 -1
- package/client/dist/assets/{MinimizedChatsContext-BHIUPVmC.js → MinimizedChatsContext-DHfigjHS.js} +1 -1
- package/client/dist/assets/{PluginsPage-BgTC2CQx.js → PluginsPage-DQRRdCUi.js} +1 -1
- package/client/dist/assets/{ProjectSettingsDialog-B4chTfU8.js → ProjectSettingsDialog-Ce8DSG6H.js} +1 -1
- package/client/dist/assets/{RepositoryDeliveries-DAIxIYsl.js → RepositoryDeliveries-B4ybHOyB.js} +1 -1
- package/client/dist/assets/{RepositoryScopeSelector-DeCoUsRN.js → RepositoryScopeSelector-2eSqR9WK.js} +1 -1
- package/client/dist/assets/{ReviewPacketPage-Cktv0-9b.js → ReviewPacketPage-WVoio8GJ.js} +1 -1
- package/client/dist/assets/{TemplatePreviewModal-BZTV1TM1.js → TemplatePreviewModal-CTBZUXAN.js} +1 -1
- package/client/dist/assets/{TicketDetailModalContext-DiPngt2g.js → TicketDetailModalContext-Dkwo2cDs.js} +1 -1
- package/client/dist/assets/{Trans-ZiXIfj50.js → Trans-BbFxRFtR.js} +1 -1
- package/client/dist/assets/{formatDistanceToNow-CdN5lTyD.js → formatDistanceToNow-NjPHBLfB.js} +1 -1
- package/client/dist/assets/{getTimezoneOffsetInMilliseconds-62h40I4t.js → getTimezoneOffsetInMilliseconds-vJ7qUoqN.js} +1 -1
- package/client/dist/assets/{index-CECj3joE.js → index-IdGpV21X.js} +36 -36
- package/client/dist/assets/{jira-api-C_D_RDhl.js → jira-api-Cabj-H0J.js} +1 -1
- package/client/dist/assets/{project-repositories-Be0CWklo.js → project-repositories-Cnnuj9Ia.js} +1 -1
- package/client/dist/assets/{settings-Hw7av-B1.js → settings-B1NV8Ow9.js} +1 -1
- package/client/dist/assets/settings-BQ8XFZeE.js +1 -0
- package/client/dist/assets/settings-BRkxfBbO.js +1 -0
- package/client/dist/assets/settings-C_CcU1dP.js +1 -0
- package/client/dist/assets/settings-Cto9n0eL.js +1 -0
- package/client/dist/assets/{settings-nryN6wuS.js → settings-Pyw8uYtL.js} +1 -1
- package/client/dist/assets/settings-b3HVCNNd.js +1 -0
- package/client/dist/assets/settings-hdive4u6.js +1 -0
- package/client/dist/assets/{spending-eWiZGhC_.js → spending-CQnrWiR3.js} +1 -1
- package/client/dist/assets/{useDesktop-C0mRIlHT.js → useDesktop-BjLT0_EE.js} +1 -1
- package/client/dist/assets/{useRuntimeRuns-B1a6GChu.js → useRuntimeRuns-C97qEqMg.js} +1 -1
- package/client/dist/assets/{useSharedWebSocket-CcsE5986.js → useSharedWebSocket-Bj4LMp7b.js} +2 -2
- package/client/dist/index.html +15 -15
- package/docs/internals/api-reference.md +26 -0
- package/docs/internals/source-map.md +9 -2
- package/package.json +1 -1
- package/server/dist/index.js +14 -1
- package/server/dist/mobile/mobile-admin-router.js +16 -0
- package/server/dist/mobile/mobile-gateway.js +18 -0
- package/server/dist/mobile/mobile-missions.js +6 -4
- package/server/dist/mobile/mobile-preview-channel.js +179 -0
- package/server/dist/mobile/mobile-preview.js +366 -0
- package/server/dist/mobile/mobile-router.js +9 -1
- package/server/dist/mobile/mobile-webrtc-peer.js +54 -4
- package/server/dist/mobile/mobile-ws.js +4 -2
- package/server/dist/modules/browser/domain/preview-origins.js +117 -0
- package/server/dist/modules/browser/runtime/browser-capture-manager.js +141 -18
- package/server/dist/modules/browser/runtime/browser-capture-types.js +10 -1
- package/server/dist/modules/browser/runtime/browser-playwright.js +19 -0
- package/server/dist/modules/browser/runtime/preview-targets.js +80 -0
- package/server/dist/modules/terminals/runtime/background-process-service.js +24 -1
- package/server/dist/project-registry.js +10 -0
- package/client/dist/assets/settings-BO2N-oPf.js +0 -1
- package/client/dist/assets/settings-BQChAs_w.js +0 -1
- package/client/dist/assets/settings-BzmYlcQB.js +0 -1
- package/client/dist/assets/settings-CGjXb6TX.js +0 -1
- package/client/dist/assets/settings-CMxEWY46.js +0 -1
- package/client/dist/assets/settings-C_dRSgI2.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{l as r,r as i,t as a}from"./useSharedWebSocket-CcsE5986.js";import{n as o,t as s}from"./createLucideIcon-DtODIU64.js";import{n as c,r as l,s as u}from"./useDesktop-C0mRIlHT.js";import{s as d}from"./provider-capabilities-lePfeT_Y.js";import{t as f}from"./download-C9wP_42h.js";import{t as p}from"./external-link-CZ6Q-v1-.js";import{t as m}from"./loader-circle-BqV9xYGf.js";import{t as h}from"./search-BDVp3fkH.js";import{t as g}from"./trash-D8zYUmTg.js";import{t as _}from"./triangle-alert-Cxpn8bqr.js";import{n as v,t as y}from"./jira-api-C_D_RDhl.js";import{i as b,l as x,o as S,r as C,t as w}from"./dialog-DtdR05v1.js";import{t as T}from"./utils-BC4DHlz2.js";import{t as E}from"./button-4FS1ZDTp.js";import{Ct as D,Jt as O,Ot as k,W as A,Zt as j,bt as M,kt as N,ln as ee,un as te,xt as ne,yt as re}from"./index-CECj3joE.js";var P={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};P.node;var ie=s(P),F={name:`folder-kanban`,size:24,node:[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]};F.node;var ae=s(F),I={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};I.node;var L=s(I),R=e(t(),1),z=n(),B=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],oe={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function V(e){let{activeProjectId:t}=l();return(0,z.jsx)(H,{...e},e.apiBase??t??`legacy`)}function H({onConnected:e,onSkip:t,apiBase:n}){let{t:r}=o(`jira`),[i,a]=(0,R.useState)(1),[s,c]=(0,R.useState)(``),[l,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(``),[m,h]=(0,R.useState)(`idle`),[g,_]=(0,R.useState)(null),[v,b]=(0,R.useState)(`cloud`),[x,S]=(0,R.useState)([]),[C,w]=(0,R.useState)(``),[T,D]=(0,R.useState)(``),[O,k]=(0,R.useState)(``),[j,M]=(0,R.useState)(!1),[N,ee]=(0,R.useState)([]),[te,ne]=(0,R.useState)({}),[re,P]=(0,R.useState)(``),[ie,F]=(0,R.useState)(!1),[ae,I]=(0,R.useState)(!1),L=(0,R.useRef)(0),V=(0,R.useRef)(!0);(0,R.useEffect)(()=>(V.current=!0,()=>{V.current=!1,L.current++}),[]);let[H,se]=(0,R.useState)(!1),K=()=>({baseUrl:s.trim(),accountEmail:l.trim()||null,token:f});async function ce(){h(`testing`);try{let e=await y.test(K(),n);if(!V.current)return;h(`ok`),_(e.displayName),b(e.deployment)}catch(e){if(!V.current)return;h(`error`),u.error(G(e,r))}}async function q(){a(2),M(!0);try{let{projects:e}=await y.discoverProjects({...K(),query:C.trim()||void 0},n);if(!V.current)return;S(e)}catch(e){V.current&&u.error(G(e,r))}finally{V.current&&M(!1)}}async function le(){a(3),await J()}async function J(){if(!T)return;let e=++L.current;F(!0);try{let{statuses:t}=await y.discoverStatuses({...K(),projectKey:T},n);if(!V.current||e!==L.current)return;ee(t),I(!1)}catch{V.current&&e===L.current&&I(!0)}finally{V.current&&e===L.current&&F(!1)}}function ue(e,t){e!==T&&(L.current++,ee([]),ne({}),P(``),I(!1),F(!1)),D(e),k(t)}async function Y(){se(!0);try{let t=Object.fromEntries(Object.entries(te).filter(([,e])=>e));if(await y.connect({...K(),jiraProjectKey:T.trim(),statusMap:Object.keys(t).length?t:null,discardStatus:re.trim()||null},n),!V.current)return;u.success(r(`status.connected`,{key:T.trim()})),e()}catch(e){V.current&&u.error(G(e,r))}finally{V.current&&se(!1)}}return(0,z.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-wizard`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`wizard.step`,{current:i,total:4})}),t&&(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs text-muted-foreground hover:text-foreground hover:underline`,"data-testid":`jira-later`,children:r(`wizard.later`)})]}),i===1&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step1Title`)}),(0,z.jsx)(U,{label:r(`creds.baseUrlLabel`),help:r(`creds.baseUrlHelp`),children:(0,z.jsx)(A,{value:s,onChange:e=>{c(e.target.value),h(`idle`)},placeholder:r(`creds.baseUrlPlaceholder`)})}),(0,z.jsx)(U,{label:r(`creds.emailLabel`),help:r(`creds.emailHelp`),children:(0,z.jsx)(A,{value:l,onChange:e=>{d(e.target.value),h(`idle`)},placeholder:r(`creds.emailPlaceholder`)})}),(0,z.jsx)(U,{label:r(`creds.tokenLabel`),help:r(`creds.tokenHelp`),children:(0,z.jsx)(A,{type:`password`,value:f,onChange:e=>{p(e.target.value),h(`idle`)}})}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(E,{size:`sm`,variant:`outline`,onClick:ce,disabled:!s.trim()||!f.trim()||m===`testing`,children:r(m===`testing`?`creds.testing`:m===`ok`?`creds.retest`:`creds.test`)}),m===`ok`&&(0,z.jsxs)(`span`,{className:`text-xs text-accent-success`,"data-testid":`jira-test-ok`,children:[`✓ `,r(`creds.testOk`,{name:g??``}),` · `,r(v===`cloud`?`review.cloud`:`review.dc`)]})]}),(0,z.jsx)(`div`,{className:`flex justify-end`,children:(0,z.jsx)(E,{size:`sm`,onClick:q,disabled:m!==`ok`,children:r(`wizard.next`)})})]}),i===2&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step2Title`)}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(A,{value:C,onChange:e=>w(e.target.value),placeholder:r(`project.searchPlaceholder`)}),(0,z.jsx)(E,{size:`sm`,variant:`outline`,onClick:q,children:r(`project.searchPlaceholder`)})]}),j?(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`project.loading`)}):x.length===0?(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`project.none`)}):(0,z.jsx)(`div`,{className:`max-h-48 space-y-1 overflow-y-auto`,"data-testid":`jira-project-list`,children:x.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>ue(e.key,e.name),className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left text-sm hover:bg-muted ${T===e.key?`bg-muted`:``}`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.key}),(0,z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.name})]},e.id))}),(0,z.jsx)(U,{label:r(`project.manualLabel`),children:(0,z.jsx)(A,{value:T,onChange:e=>ue(e.target.value.toUpperCase(),``),placeholder:r(`project.manualPlaceholder`)})}),(0,z.jsxs)(`div`,{className:`flex justify-between`,children:[(0,z.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(1),children:r(`wizard.back`)}),(0,z.jsx)(E,{size:`sm`,onClick:le,disabled:!T.trim(),children:r(`wizard.next`)})]})]}),i===3&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step3Title`)}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`mapping.intro`)}),ae&&(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-accent-warning`,children:r(`mapping.loadFailed`)}),(0,z.jsx)(E,{size:`sm`,variant:`outline`,disabled:ie,onClick:()=>void J(),children:r(`mapping.retry`)})]}),ie&&(0,z.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:r(`mapping.loading`)}),B.map(e=>(0,z.jsx)(U,{label:r(`mapping.${oe[e]}`),children:(0,z.jsxs)(`select`,{value:te[e]??``,onChange:t=>ne(n=>({...n,[e]:t.target.value||void 0})),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,children:[(0,z.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),N.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id))]})},e)),(0,z.jsx)(U,{label:r(`discard.configLabel`),help:r(`discard.configHelp`),children:(0,z.jsxs)(`select`,{value:re,onChange:e=>P(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,z.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),N.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id))]})}),(0,z.jsxs)(`div`,{className:`flex justify-between`,children:[(0,z.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(2),children:r(`wizard.back`)}),(0,z.jsx)(E,{size:`sm`,onClick:()=>a(4),children:r(`wizard.next`)})]})]}),i===4&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step4Title`)}),(0,z.jsxs)(`dl`,{className:`space-y-1 text-sm`,children:[(0,z.jsx)(W,{label:r(`review.site`),value:s}),(0,z.jsx)(W,{label:r(`review.project`),value:O?`${T} — ${O}`:T}),(0,z.jsx)(W,{label:r(`review.account`),value:g??l}),(0,z.jsx)(W,{label:r(`review.type`),value:r(v===`cloud`?`review.cloud`:`review.dc`)}),(0,z.jsx)(W,{label:r(`discard.reviewLabel`),value:re||r(`discard.configNone`)})]}),(0,z.jsxs)(`div`,{className:`flex justify-between`,children:[(0,z.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(3),children:r(`wizard.back`)}),(0,z.jsx)(E,{size:`sm`,onClick:Y,disabled:H,children:r(H?`wizard.connecting`:`wizard.connect`)})]})]})]})}function U({label:e,help:t,children:n}){return(0,z.jsxs)(`label`,{className:`block space-y-1`,children:[(0,z.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e}),n,t&&(0,z.jsx)(`span`,{className:`block text-[11px] text-muted-foreground`,children:t})]})}function W({label:e,value:t}){return(0,z.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,z.jsx)(`dd`,{className:`truncate text-right font-medium`,children:t})]})}function G(e,t){return e instanceof Error?e.message:t(`errors.generic`)}var se={pending:0,inflight:0,done:0,dead:0};function K({projectId:e,baseUrl:t,apiBase:n,initialCounts:r,refreshToken:i}){let{t:s}=o(`jira`),[c,l]=(0,R.useState)(null),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(()=>new Set),h=(0,R.useRef)(!0),g=(0,R.useRef)(0),_=(0,R.useContext)(a),v=(0,R.useId)(),b=(0,R.useCallback)(async()=>{if(!h.current)return;let e=++g.current;try{let t=n?await y.listOutbox(`dead`,n):await y.listOutbox(`dead`);if(!h.current||e!==g.current)return;l({...t,ops:t.ops.filter(e=>e.state===`dead`)}),f(!1)}catch{h.current&&e===g.current&&f(!0)}},[n]);(0,R.useEffect)(()=>(h.current=!0,b(),()=>{h.current=!1,g.current++}),[b,i,r?.dead,r?.pending,r?.inflight,r?.done,r?.superseded]),(0,R.useEffect)(()=>{if(_)return _.registerHandler(v,t=>{if(!t||typeof t!=`object`)return;let n=t;n.type===`jira.outbox_changed`&&n.projectId===e&&b()}),()=>_.unregisterHandler(v)},[_,v,e,b]);async function x(e){if(!p.has(e)){m(t=>new Set(t).add(e));try{n?await y.retryOutbox(e,n):await y.retryOutbox(e),h.current&&await b()}catch(e){h.current&&u.error(e instanceof Error?e.message:s(`errors.generic`))}finally{h.current&&m(t=>{let n=new Set(t);return n.delete(e),n})}}}let S=c?.counts??r??se,C=S.pending+S.inflight;return(0,z.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:s(`outbox.title`)}),(0,z.jsx)(`p`,{className:`mt-1 text-xs ${S.dead>0?`text-accent-warning`:`text-muted-foreground`}`,children:S.dead>0?s(`outbox.dead`,{count:S.dead}):C>0?s(`outbox.pending`,{count:C}):s(S.superseded?`outbox.nonePending`:`outbox.allSynced`)}),d&&(0,z.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-accent-warning`,children:s(`outbox.loadFailed`)}),(0,z.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:s(`outbox.retry`)})]}),!!c?.ops.length&&(0,z.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`outbox.deadHelp`)}),c.ops.map(e=>{let n=e.targetStatus||(e.logicalState?s(`mapping.${ce(e.logicalState)}`):null),r=e.deadReason??e.lastError??``;return(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded border border-border/60 px-2 py-2`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 space-y-1 text-xs`,children:[(0,z.jsxs)(`p`,{className:`break-words`,children:[e.jiraKey?(0,z.jsx)(`a`,{href:`${t.replace(/\/$/,``)}/browse/${encodeURIComponent(e.jiraKey)}`,target:`_blank`,rel:`noreferrer`,className:`font-medium text-accent-primary hover:underline`,children:e.jiraKey}):(0,z.jsx)(`span`,{className:`font-medium`,children:s(`outbox.issueFallback`,{id:e.jiraIssueId})}),` · `,s(e.opType===`transition`?`outbox.opTransition`:e.opType===`comment`?`outbox.opComment`:e.opType===`update`?`outbox.opUpdate`:`outbox.opCreate`)]}),n&&(0,z.jsx)(`p`,{className:`break-words text-muted-foreground`,children:s(`outbox.target`,{status:n})}),(0,z.jsx)(`p`,{className:`max-h-32 overflow-y-auto whitespace-pre-wrap break-words text-muted-foreground`,children:r})]}),(0,z.jsx)(E,{className:`shrink-0`,variant:`outline`,size:`sm`,disabled:p.has(e.id),onClick:()=>void x(e.id),children:s(p.has(e.id)?`outbox.retrying`:`outbox.retry`)})]},e.id)})]})]})}function ce(e){return e===`in_progress`?`inProgress`:e===`on_review`?`onReview`:e}var q=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],le={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function J(e){let{activeProjectId:t}=l(),n=`${e.apiBase??t??``}:${e.state.connection.projectId}`;return(0,z.jsx)(ue,{...e},n)}function ue({state:e,onChanged:t,apiBase:n}){let{t:r}=o(`jira`),i=e.connection,[a,s]=(0,R.useState)(i.enabled),[c,l]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(0),[h,g]=(0,R.useState)([]),[_,v]=(0,R.useState)(i.discardStatus??``),[b,x]=(0,R.useState)(i.statusMap??{}),[S,C]=(0,R.useState)(!1),[w,T]=(0,R.useState)(!1),D=(0,R.useRef)(0),O=(0,R.useRef)(!0),k=(0,R.useCallback)(async()=>{let e=++D.current;T(!0);try{let{statuses:t}=await y.listStatuses(n);if(!O.current||e!==D.current)return;g(t),C(!1)}catch{O.current&&e===D.current&&C(!0)}finally{O.current&&e===D.current&&T(!1)}},[n]);(0,R.useEffect)(()=>(O.current=!0,k(),()=>{O.current=!1,D.current++}),[k]);async function A(e){let i=_;v(e);try{if(n?await y.patchConnection({discardStatus:e||null},n):await y.patchConnection({discardStatus:e||null}),!O.current)return;t()}catch(e){if(!O.current)return;v(i),u.error(Y(e,r))}}async function j(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{if(n?await y.patchConnection({statusMap:Object.keys(s).length?s:null},n):await y.patchConnection({statusMap:Object.keys(s).length?s:null}),!O.current)return;m(e=>e+1),t()}catch(e){if(!O.current)return;x(a),u.error(Y(e,r))}}async function M(){let e=!a;s(e),f(!0);try{n?await y.setEnabled(e,n):await y.setEnabled(e)}catch(t){if(!O.current)return;s(!e),u.error(Y(t,r))}finally{O.current&&f(!1)}}async function N(){l(!0);try{let e=n?await y.syncNow(n):await y.syncNow();if(!O.current)return;u.success(r(`status.syncedToast`,{count:e.upserted})),m(e=>e+1)}catch(e){O.current&&u.error(Y(e,r))}finally{O.current&&l(!1)}}async function ee(){if(window.confirm(r(`status.disconnectConfirm`))){f(!0);try{if(n?await y.disconnect(n):await y.disconnect(),!O.current)return;u.success(r(`status.disconnectedToast`)),t()}catch(e){O.current&&u.error(Y(e,r))}finally{O.current&&f(!1)}}}return(0,z.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:i.jiraProjectKey})}),(0,z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,z.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":r(`status.enabledLabel`),disabled:d,onClick:M,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,z.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,z.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,z.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),S&&(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-accent-warning`,children:r(`mapping.loadFailed`)}),(0,z.jsx)(E,{variant:`outline`,size:`sm`,disabled:w,onClick:()=>void k(),children:r(`mapping.retry`)})]}),w&&(0,z.jsx)(`p`,{role:`status`,className:`mb-2 text-xs text-muted-foreground`,children:r(`mapping.loading`)}),(0,z.jsx)(`div`,{className:`space-y-2`,children:q.map(e=>(0,z.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${le[e]}`)}),(0,z.jsxs)(`select`,{value:b[e]??``,onChange:t=>void j(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,z.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),h.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!h.some(t=>t.name===b[e])&&(0,z.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,z.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,z.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,z.jsxs)(`select`,{value:_,onChange:e=>void A(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,z.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),h.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id)),_&&!h.some(e=>e.name===_)&&(0,z.jsx)(`option`,{value:_,children:_})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(E,{variant:`outline`,size:`sm`,onClick:N,disabled:c,children:r(c?`status.syncing`:`status.syncNow`)}),(0,z.jsx)(E,{variant:`ghost`,size:`sm`,onClick:ee,disabled:d,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,z.jsx)(K,{projectId:i.projectId,baseUrl:i.baseUrl,apiBase:n,initialCounts:e.outbox,refreshToken:p})]})}function Y(e,t){return e instanceof Error?e.message:t(`errors.generic`)}var de=new Set([`claude`,`codex`,`kimi`]);function fe(e){return{provider:e,label:e===`codex`?`Codex`:`Claude`,active:!1,available:!1,detectedRoute:!1,requests:0,inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0,outputSavingsPercent:0,outputSavingsMethod:`none`,outputSavingsAllocated:!1}}function pe(){return{updatedAt:null,proxyStatsAvailable:!1,durableSavingsAvailable:!1,outputSavingsAvailable:!1,outputSavingsMethod:null,outputConfidence:null,providers:{codex:fe(`codex`),claude:fe(`claude`)},lastIssue:null}}var X={installed:!1,installSource:null,version:null,executablePath:null,uvPath:null,port:8787,phase:`idle`,activeProviders:{codex:!1,claude:!1},availableProviders:{codex:!1,claude:!1},detectedRoutes:{codex:!1,claude:!1},proxyRunning:!1,proxyPid:null,learning:{enabled:!1,baselineReady:!1,baselineSamples:0,updatedAt:null,lastIssue:null},metrics:pe(),lastIssue:null,updatedAt:null};function me(e){let t=e?.metrics??pe();return{...X,...e,activeProviders:{...X.activeProviders,...e?.activeProviders},availableProviders:{...X.availableProviders,...e?.availableProviders},detectedRoutes:{...X.detectedRoutes,...e?.detectedRoutes},learning:{...X.learning,...e?.learning},metrics:{...pe(),...t,providers:{codex:{...fe(`codex`),...t.providers?.codex},claude:{...fe(`claude`),...t.providers?.claude}}}}}async function Z(e){let t=await e.text(),n=t?JSON.parse(t):{};if(!e.ok){let t=n.issue;throw Object.assign(Error(t?.title??n.error??`HTTP ${e.status}`),{payload:n})}return n}function Q(e){return`${r}/api/projects/${e}`}function he(e,t=`en`){if(!Number.isFinite(e))return`0`;try{return Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}catch{return Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}}function $(e,t,n){return`${he(e,t)} ${n}`}function ge({onWindowOpened:e}={}){let{t}=o(`integrations`),{projects:n}=l(),{registerHandler:a,unregisterHandler:s}=i(),[c,d]=(0,R.useState)(``),[f,m]=(0,R.useState)(`all`),[g,_]=(0,R.useState)(X),[v,y]=(0,R.useState)(!0),[E,D]=(0,R.useState)(null),[O,A]=(0,R.useState)([]),[j,P]=(0,R.useState)(!1),[ie,F]=(0,R.useState)(!1),[I,L]=(0,R.useState)(null),[B,oe]=(0,R.useState)({jira:0,serena:0,projects:0}),V=(0,R.useCallback)(async()=>{try{let e=await fetch(`${r}/api/global-plugins/headroom`).then(e=>Z(e));_(me(e.state))}finally{y(!1)}},[]);(0,R.useEffect)(()=>{V()},[V]),(0,R.useEffect)(()=>(a(`plugins-page`,e=>{let t=e;t.type===`plugin.headroom_progress`&&(t.line&&A(e=>[...e.slice(-80),t.line]),V())}),()=>s(`plugins-page`)),[a,s,V]),(0,R.useEffect)(()=>{let e=!1;async function t(){let t=await Promise.all(n.map(async e=>{let[t,n]=await Promise.all([fetch(`${Q(e.id)}/jira/connection`).then(e=>Z(e)).catch(()=>({connected:!1})),fetch(`${Q(e.id)}/plugins`).then(e=>Z(e)).catch(()=>({plugins:[]}))]),r=n.plugins.find(e=>e.name===`serena`);return{jira:+!!t.connected,serena:r&&r.status!==`not-installed`&&r.status!==`orphan`?1:0}}));e||oe({jira:t.reduce((e,t)=>e+t.jira,0),serena:t.reduce((e,t)=>e+t.serena,0),projects:n.length})}return t(),()=>{e=!0}},[n]);async function H(e,t){D(e),A([]);try{let e=(await t()).state;e&&_(me(e))}catch(e){let t=e.payload;t?.state&&_(me(t.state))}finally{D(null),V()}}let U=(0,R.useMemo)(()=>[{id:`headroom-ai`,title:`Headroom AI`,scope:`global`,icon:N,description:t(`plugins.catalog.headroom.description`),installed:g.installed,status:g.lastIssue?`attention`:g.installed?g.activeProviders.codex||g.activeProviders.claude?g.installSource===`system`?`external-active`:`active`:g.installSource===`system`?`external`:`installed`:`available`,statusLabel:g.lastIssue?t(`plugins.status.attention`):g.installed?g.activeProviders.codex||g.activeProviders.claude?g.installSource===`system`?t(`plugins.status.externalActive`):t(`plugins.status.active`):g.installSource===`system`?t(`plugins.status.external`):t(`plugins.status.installed`):t(`plugins.status.available`),actionKind:g.lastIssue?`review`:g.installed?`manage`:`install`,actionLabel:g.lastIssue?t(`plugins.actions.review`):g.installed?t(`plugins.actions.manage`):t(`plugins.actions.install`),busy:E===`install`,action:()=>{if(g.lastIssue||g.installed){P(!0);return}H(`install`,()=>fetch(`${r}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>Z(e)))}}],[g,E,t]),W=(0,R.useMemo)(()=>[{id:`jira`,title:`Jira`,scope:`project`,icon:ae,description:t(`plugins.catalog.jira.description`),installed:B.jira>0,status:B.jira>0?`configured`:`available`,statusLabel:B.jira>0?t(`plugins.status.configuredCount`,{count:B.jira}):t(`plugins.status.available`),actionKind:B.jira>0?`manage`:`install`,actionLabel:B.jira>0?t(`plugins.actions.manage`):t(`plugins.actions.install`),action:()=>L(`jira`)},{id:`serena`,title:`Serena`,scope:`project`,icon:re,description:t(`plugins.catalog.serena.description`),installed:B.serena>0,status:B.serena>0?`installed`:`available`,statusLabel:B.serena>0?t(`plugins.status.installedCount`,{count:B.serena}):t(`plugins.status.available`),actionKind:B.serena>0?`manage`:`install`,actionLabel:B.serena>0?t(`plugins.actions.manage`):t(`plugins.actions.install`),action:()=>L(`serena`)}],[B,t]),G=c.trim().toLowerCase(),se=e=>`${e.title} ${e.description} ${e.statusLabel} ${t(`plugins.scope.${e.scope}`)}`.toLowerCase().includes(G),K=[...U,...W].filter(e=>f!==`all`&&e.scope!==f?!1:se(e)),ce=K.filter(e=>e.scope===`global`&&e.installed),q=K.filter(e=>e.scope===`project`&&e.installed),le=K.filter(e=>e.scope===`global`&&!e.installed),J=K.filter(e=>e.scope===`project`&&!e.installed),ue=ce.length>0||q.length>0,Y=le.length>0||J.length>0,de=[g.installed,B.jira>0,B.serena>0].filter(Boolean).length;return(0,z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[(0,z.jsxs)(`div`,{className:`border-b border-border px-6 py-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,z.jsx)(`div`,{className:`grid h-9 w-9 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,z.jsx)(k,{className:`h-4 w-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold tracking-normal`,children:t(`plugins.page.title`)}),(0,z.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t(`plugins.page.subtitle`)})]}),!ee()&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void te().then(()=>e?.()).catch(e=>u.error(String(e))),className:`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-2 text-xs hover:bg-muted`,children:[(0,z.jsx)(p,{className:`h-3.5 w-3.5`}),t(`plugins.page.openWindow`)]}),(0,z.jsxs)(`div`,{className:`mr-12 flex items-center gap-2 rounded-lg border border-border bg-card/60 px-3 py-2 text-xs`,children:[(0,z.jsx)(ne,{className:`h-3.5 w-3.5 text-accent-success`}),(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:t(`plugins.page.readyCount`,{count:de})})]})]}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 md:flex-row md:items-center`,children:[(0,z.jsxs)(`label`,{className:`relative flex-1`,children:[(0,z.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,z.jsx)(`input`,{value:c,onChange:e=>d(e.target.value),placeholder:t(`plugins.search.placeholder`),className:`h-9 w-full rounded-lg border border-border bg-background pl-9 pr-3 text-sm outline-none transition-colors focus:border-accent-primary/60`})]}),(0,z.jsx)(`div`,{className:`inline-flex h-9 rounded-lg border border-border bg-card p-1`,children:[`all`,`global`,`project`].map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(e),className:T(`rounded-md px-3 text-xs capitalize transition-colors`,f===e?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:t(`plugins.filters.${e}`)},e))})]})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-auto px-6 py-5`,children:[(0,z.jsxs)(`section`,{className:`mb-6`,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,z.jsx)(M,{className:`h-3.5 w-3.5`}),t(`plugins.sections.installed`)]}),ue?(0,z.jsx)(_e,{globalPlugins:ce,projectPlugins:q}):(0,z.jsx)(ve,{text:t(G?`plugins.empty.installedSearch`:`plugins.empty.installed`)})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),t(`plugins.sections.available`)]}),Y?(0,z.jsx)(_e,{globalPlugins:le,projectPlugins:J}):(0,z.jsx)(ve,{text:t(G?`plugins.empty.availableSearch`:`plugins.empty.allInstalled`)})]})]}),(0,z.jsx)(w,{open:j,onOpenChange:P,children:(0,z.jsxs)(C,{className:`w-[calc(100vw-2rem)] max-w-xl overflow-x-hidden p-4 sm:p-6`,children:[(0,z.jsxs)(S,{children:[(0,z.jsx)(x,{children:t(`plugins.headroom.title`)}),(0,z.jsx)(b,{children:t(`plugins.headroom.dialogDescription`)})]}),(0,z.jsx)(Se,{state:g,loading:v,busy:E,logs:O,onInstall:()=>H(`install`,()=>fetch(`${r}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>Z(e))),onToggleProvider:(e,t)=>H(`${t?`deactivate`:`activate`}-${e}`,()=>fetch(`${r}/api/global-plugins/headroom/${t?`deactivate`:`activate`}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e})}).then(e=>Z(e))),onDeactivateAll:()=>H(`deactivate-all`,async()=>{let e={state:g};for(let t of[`codex`,`claude`])g.activeProviders[t]&&(e=await fetch(`${r}/api/global-plugins/headroom/deactivate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:t})}).then(e=>Z(e)));return e}),onUninstall:()=>H(`uninstall`,()=>fetch(`${r}/api/global-plugins/headroom/uninstall`,{method:`POST`}).then(e=>Z(e))),onSetPort:e=>H(`port`,()=>fetch(`${r}/api/global-plugins/headroom/port`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({port:e})}).then(e=>Z(e))),onOpenDiagnostics:()=>F(!0)})]})}),(0,z.jsx)(ke,{plugin:I,projects:n,onClose:()=>L(null)}),(0,z.jsx)(Me,{open:ie,onClose:()=>F(!1)})]})}function _e({globalPlugins:e,projectPlugins:t}){let{t:n}=o(`integrations`);return(0,z.jsxs)(`div`,{className:T(`grid grid-cols-1 gap-4`,e.length>0&&t.length>0&&`xl:grid-cols-2`),children:[e.length>0&&(0,z.jsxs)(`section`,{children:[(0,z.jsx)(be,{title:n(`plugins.groups.global.title`),detail:n(`plugins.groups.global.detail`),scope:`global`}),(0,z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:e.map(e=>(0,z.jsx)(xe,{plugin:e},e.id))})]}),t.length>0&&(0,z.jsxs)(`section`,{children:[(0,z.jsx)(be,{title:n(`plugins.groups.project.title`),detail:n(`plugins.groups.project.detail`),scope:`project`}),(0,z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:t.map(e=>(0,z.jsx)(xe,{plugin:e},e.id))})]})]})}function ve({text:e}){return(0,z.jsx)(`div`,{className:`flex h-[74px] max-w-[320px] items-center rounded-lg border border-dashed border-border bg-card/35 px-3 text-xs text-muted-foreground`,children:e})}function ye({scope:e}){let{t}=o(`integrations`);return(0,z.jsx)(`span`,{className:T(`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wide`,e===`global`?`bg-accent-primary/10 text-accent-primary`:`bg-accent-info/10 text-accent-info`),children:t(`plugins.scope.${e}`)})}function be({title:e,detail:t,scope:n}){return(0,z.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,z.jsx)(`div`,{className:T(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card/70 px-2 py-1`,children:[(0,z.jsx)(ye,{scope:n}),(0,z.jsx)(`span`,{className:`text-xs font-medium`,children:e}),(0,z.jsx)(`span`,{className:`hidden text-[11px] text-muted-foreground sm:inline`,children:t})]}),(0,z.jsx)(`div`,{className:T(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)})]})}function xe({plugin:e}){let{t}=o(`integrations`),n=e.icon,r=e.scope===`global`,i=e.status===`attention`,a=e.busy?m:e.actionKind===`install`?f:e.actionKind===`review`?_:D,s=T(`shrink-0 rounded border px-1.5 py-0.5 text-[10px] leading-none`,i?`border-accent-warning/30 bg-accent-warning/10 text-accent-warning`:e.installed?`border-accent-success/25 bg-accent-success/10 text-accent-success`:`border-border bg-muted text-muted-foreground`);return(0,z.jsxs)(`article`,{className:`grid h-[88px] w-full grid-cols-[38px_minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-card/70 px-3 transition-colors hover:border-accent-primary/35 hover:bg-card`,children:[(0,z.jsx)(`div`,{className:T(`grid h-[38px] w-[38px] shrink-0 place-items-center rounded-lg border`,r?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-accent-info/25 bg-accent-info/10 text-accent-info`),children:(0,z.jsx)(n,{className:`h-4 w-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold leading-5`,children:e.title}),(0,z.jsx)(`p`,{className:`mt-1 truncate text-[11px] leading-4 text-muted-foreground`,children:e.description}),(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,z.jsx)(ye,{scope:e.scope}),(0,z.jsx)(`span`,{className:s,children:e.statusLabel})]})]}),(0,z.jsxs)(`button`,{type:`button`,disabled:e.busy,onClick:e.action,className:`flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs font-medium transition-colors hover:bg-muted disabled:opacity-50`,children:[(0,z.jsx)(a,{className:T(`h-3.5 w-3.5`,e.busy&&`animate-spin`)}),e.busy?t(`plugins.actions.installing`):e.actionLabel]})]})}function Se({state:e,loading:t,busy:n,logs:r,onInstall:i,onToggleProvider:a,onDeactivateAll:s,onUninstall:c,onSetPort:l,onOpenDiagnostics:u}){let{t:d}=o(`integrations`),[p,h]=(0,R.useState)(String(e.port)),[_,y]=(0,R.useState)(!1);(0,R.useEffect)(()=>h(String(e.port)),[e.port]),(0,R.useEffect)(()=>{e.installed||y(!1)},[e.installed]);let b=e.activeProviders.codex||e.activeProviders.claude,x=e.installSource===`system`;return(0,z.jsxs)(`aside`,{className:`w-full min-w-0 overflow-hidden rounded-lg border border-border bg-card/80 p-4`,children:[(0,z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,z.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,z.jsx)(N,{className:`h-4 w-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold`,children:d(`plugins.headroom.title`)}),(0,z.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:d(`plugins.headroom.panelDescription`)})]})]}),(0,z.jsxs)(`div`,{className:`mb-4 grid grid-cols-3 gap-2 text-xs`,children:[(0,z.jsx)(Ce,{label:d(`plugins.headroom.metrics.install`),value:t?d(`plugins.headroom.metrics.checking`):e.installed?d(`plugins.headroom.metrics.ready`):d(`plugins.headroom.metrics.missing`),good:e.installed}),(0,z.jsx)(Ce,{label:d(`plugins.headroom.metrics.source`),value:e.installSource===`system`?d(`plugins.headroom.metrics.system`):e.installSource===`managed`?d(`plugins.headroom.metrics.specrails`):d(`plugins.headroom.metrics.none`),good:e.installed}),(0,z.jsx)(Ce,{label:d(`plugins.headroom.metrics.proxy`),value:e.proxyRunning?`:${e.port}`:d(b?`plugins.headroom.metrics.starting`:`plugins.headroom.metrics.off`),good:e.proxyRunning||!b})]}),e.lastIssue&&(0,z.jsx)(we,{issue:e.lastIssue}),e.installed?(0,z.jsxs)(`div`,{className:`mb-4 space-y-2`,children:[(0,z.jsx)(Oe,{provider:`codex`,active:e.activeProviders.codex,available:e.availableProviders.codex,detectedRoute:e.detectedRoutes.codex,busy:n===`activate-codex`||n===`deactivate-codex`,onClick:()=>a(`codex`,e.activeProviders.codex)}),(0,z.jsx)(Oe,{provider:`claude`,active:e.activeProviders.claude,available:e.availableProviders.claude,detectedRoute:e.detectedRoutes.claude,busy:n===`activate-claude`||n===`deactivate-claude`,onClick:()=>a(`claude`,e.activeProviders.claude)}),b&&(0,z.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:s,className:`flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border bg-background/45 text-xs hover:bg-muted/50 disabled:opacity-50`,children:[n===`deactivate-all`?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(L,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.disableAllRoutes`)]})]}):(0,z.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:i,className:`mb-3 flex h-9 w-full items-center justify-center gap-2 rounded-lg bg-accent-primary px-3 text-xs font-medium text-white disabled:opacity-50`,children:[n===`install`?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(f,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.installWithUv`)]}),e.installed&&(0,z.jsx)(Te,{state:e}),(0,z.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,z.jsx)(`label`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:d(`plugins.headroom.port.label`)}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(`input`,{value:p,onChange:e=>h(e.target.value),className:`h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-sm`}),(0,z.jsx)(`button`,{type:`button`,disabled:!!n||Number(p)===e.port,onClick:()=>l(Number(p)),className:`rounded-md border border-border px-2 text-xs hover:bg-muted disabled:opacity-50`,children:d(`plugins.headroom.port.apply`)})]})]}),r.length>0&&(0,z.jsx)(`pre`,{className:`mb-3 max-h-32 overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background/60 p-2 text-[10px] text-muted-foreground`,children:r.join(`
|
|
1
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{l as r,r as i,t as a}from"./useSharedWebSocket-Bj4LMp7b.js";import{n as o,t as s}from"./createLucideIcon-DtODIU64.js";import{n as c,r as l,s as u}from"./useDesktop-BjLT0_EE.js";import{s as d}from"./provider-capabilities-lePfeT_Y.js";import{t as f}from"./download-C9wP_42h.js";import{t as p}from"./external-link-CZ6Q-v1-.js";import{t as m}from"./loader-circle-BqV9xYGf.js";import{t as h}from"./search-BDVp3fkH.js";import{t as g}from"./trash-D8zYUmTg.js";import{t as _}from"./triangle-alert-Cxpn8bqr.js";import{n as v,t as y}from"./jira-api-Cabj-H0J.js";import{i as b,l as x,o as S,r as C,t as w}from"./dialog-DtdR05v1.js";import{t as T}from"./utils-BC4DHlz2.js";import{t as E}from"./button-4FS1ZDTp.js";import{Ct as D,Jt as O,Ot as k,W as A,Zt as j,bt as M,kt as N,ln as ee,un as te,xt as ne,yt as re}from"./index-IdGpV21X.js";var P={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};P.node;var ie=s(P),F={name:`folder-kanban`,size:24,node:[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]};F.node;var ae=s(F),I={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};I.node;var L=s(I),R=e(t(),1),z=n(),B=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],oe={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function V(e){let{activeProjectId:t}=l();return(0,z.jsx)(H,{...e},e.apiBase??t??`legacy`)}function H({onConnected:e,onSkip:t,apiBase:n}){let{t:r}=o(`jira`),[i,a]=(0,R.useState)(1),[s,c]=(0,R.useState)(``),[l,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(``),[m,h]=(0,R.useState)(`idle`),[g,_]=(0,R.useState)(null),[v,b]=(0,R.useState)(`cloud`),[x,S]=(0,R.useState)([]),[C,w]=(0,R.useState)(``),[T,D]=(0,R.useState)(``),[O,k]=(0,R.useState)(``),[j,M]=(0,R.useState)(!1),[N,ee]=(0,R.useState)([]),[te,ne]=(0,R.useState)({}),[re,P]=(0,R.useState)(``),[ie,F]=(0,R.useState)(!1),[ae,I]=(0,R.useState)(!1),L=(0,R.useRef)(0),V=(0,R.useRef)(!0);(0,R.useEffect)(()=>(V.current=!0,()=>{V.current=!1,L.current++}),[]);let[H,se]=(0,R.useState)(!1),K=()=>({baseUrl:s.trim(),accountEmail:l.trim()||null,token:f});async function ce(){h(`testing`);try{let e=await y.test(K(),n);if(!V.current)return;h(`ok`),_(e.displayName),b(e.deployment)}catch(e){if(!V.current)return;h(`error`),u.error(G(e,r))}}async function q(){a(2),M(!0);try{let{projects:e}=await y.discoverProjects({...K(),query:C.trim()||void 0},n);if(!V.current)return;S(e)}catch(e){V.current&&u.error(G(e,r))}finally{V.current&&M(!1)}}async function le(){a(3),await J()}async function J(){if(!T)return;let e=++L.current;F(!0);try{let{statuses:t}=await y.discoverStatuses({...K(),projectKey:T},n);if(!V.current||e!==L.current)return;ee(t),I(!1)}catch{V.current&&e===L.current&&I(!0)}finally{V.current&&e===L.current&&F(!1)}}function ue(e,t){e!==T&&(L.current++,ee([]),ne({}),P(``),I(!1),F(!1)),D(e),k(t)}async function Y(){se(!0);try{let t=Object.fromEntries(Object.entries(te).filter(([,e])=>e));if(await y.connect({...K(),jiraProjectKey:T.trim(),statusMap:Object.keys(t).length?t:null,discardStatus:re.trim()||null},n),!V.current)return;u.success(r(`status.connected`,{key:T.trim()})),e()}catch(e){V.current&&u.error(G(e,r))}finally{V.current&&se(!1)}}return(0,z.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-wizard`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`wizard.step`,{current:i,total:4})}),t&&(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs text-muted-foreground hover:text-foreground hover:underline`,"data-testid":`jira-later`,children:r(`wizard.later`)})]}),i===1&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step1Title`)}),(0,z.jsx)(U,{label:r(`creds.baseUrlLabel`),help:r(`creds.baseUrlHelp`),children:(0,z.jsx)(A,{value:s,onChange:e=>{c(e.target.value),h(`idle`)},placeholder:r(`creds.baseUrlPlaceholder`)})}),(0,z.jsx)(U,{label:r(`creds.emailLabel`),help:r(`creds.emailHelp`),children:(0,z.jsx)(A,{value:l,onChange:e=>{d(e.target.value),h(`idle`)},placeholder:r(`creds.emailPlaceholder`)})}),(0,z.jsx)(U,{label:r(`creds.tokenLabel`),help:r(`creds.tokenHelp`),children:(0,z.jsx)(A,{type:`password`,value:f,onChange:e=>{p(e.target.value),h(`idle`)}})}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(E,{size:`sm`,variant:`outline`,onClick:ce,disabled:!s.trim()||!f.trim()||m===`testing`,children:r(m===`testing`?`creds.testing`:m===`ok`?`creds.retest`:`creds.test`)}),m===`ok`&&(0,z.jsxs)(`span`,{className:`text-xs text-accent-success`,"data-testid":`jira-test-ok`,children:[`✓ `,r(`creds.testOk`,{name:g??``}),` · `,r(v===`cloud`?`review.cloud`:`review.dc`)]})]}),(0,z.jsx)(`div`,{className:`flex justify-end`,children:(0,z.jsx)(E,{size:`sm`,onClick:q,disabled:m!==`ok`,children:r(`wizard.next`)})})]}),i===2&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step2Title`)}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(A,{value:C,onChange:e=>w(e.target.value),placeholder:r(`project.searchPlaceholder`)}),(0,z.jsx)(E,{size:`sm`,variant:`outline`,onClick:q,children:r(`project.searchPlaceholder`)})]}),j?(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`project.loading`)}):x.length===0?(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`project.none`)}):(0,z.jsx)(`div`,{className:`max-h-48 space-y-1 overflow-y-auto`,"data-testid":`jira-project-list`,children:x.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>ue(e.key,e.name),className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left text-sm hover:bg-muted ${T===e.key?`bg-muted`:``}`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.key}),(0,z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.name})]},e.id))}),(0,z.jsx)(U,{label:r(`project.manualLabel`),children:(0,z.jsx)(A,{value:T,onChange:e=>ue(e.target.value.toUpperCase(),``),placeholder:r(`project.manualPlaceholder`)})}),(0,z.jsxs)(`div`,{className:`flex justify-between`,children:[(0,z.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(1),children:r(`wizard.back`)}),(0,z.jsx)(E,{size:`sm`,onClick:le,disabled:!T.trim(),children:r(`wizard.next`)})]})]}),i===3&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step3Title`)}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`mapping.intro`)}),ae&&(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-accent-warning`,children:r(`mapping.loadFailed`)}),(0,z.jsx)(E,{size:`sm`,variant:`outline`,disabled:ie,onClick:()=>void J(),children:r(`mapping.retry`)})]}),ie&&(0,z.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:r(`mapping.loading`)}),B.map(e=>(0,z.jsx)(U,{label:r(`mapping.${oe[e]}`),children:(0,z.jsxs)(`select`,{value:te[e]??``,onChange:t=>ne(n=>({...n,[e]:t.target.value||void 0})),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,children:[(0,z.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),N.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id))]})},e)),(0,z.jsx)(U,{label:r(`discard.configLabel`),help:r(`discard.configHelp`),children:(0,z.jsxs)(`select`,{value:re,onChange:e=>P(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,z.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),N.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id))]})}),(0,z.jsxs)(`div`,{className:`flex justify-between`,children:[(0,z.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(2),children:r(`wizard.back`)}),(0,z.jsx)(E,{size:`sm`,onClick:()=>a(4),children:r(`wizard.next`)})]})]}),i===4&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step4Title`)}),(0,z.jsxs)(`dl`,{className:`space-y-1 text-sm`,children:[(0,z.jsx)(W,{label:r(`review.site`),value:s}),(0,z.jsx)(W,{label:r(`review.project`),value:O?`${T} — ${O}`:T}),(0,z.jsx)(W,{label:r(`review.account`),value:g??l}),(0,z.jsx)(W,{label:r(`review.type`),value:r(v===`cloud`?`review.cloud`:`review.dc`)}),(0,z.jsx)(W,{label:r(`discard.reviewLabel`),value:re||r(`discard.configNone`)})]}),(0,z.jsxs)(`div`,{className:`flex justify-between`,children:[(0,z.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(3),children:r(`wizard.back`)}),(0,z.jsx)(E,{size:`sm`,onClick:Y,disabled:H,children:r(H?`wizard.connecting`:`wizard.connect`)})]})]})]})}function U({label:e,help:t,children:n}){return(0,z.jsxs)(`label`,{className:`block space-y-1`,children:[(0,z.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e}),n,t&&(0,z.jsx)(`span`,{className:`block text-[11px] text-muted-foreground`,children:t})]})}function W({label:e,value:t}){return(0,z.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,z.jsx)(`dd`,{className:`truncate text-right font-medium`,children:t})]})}function G(e,t){return e instanceof Error?e.message:t(`errors.generic`)}var se={pending:0,inflight:0,done:0,dead:0};function K({projectId:e,baseUrl:t,apiBase:n,initialCounts:r,refreshToken:i}){let{t:s}=o(`jira`),[c,l]=(0,R.useState)(null),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(()=>new Set),h=(0,R.useRef)(!0),g=(0,R.useRef)(0),_=(0,R.useContext)(a),v=(0,R.useId)(),b=(0,R.useCallback)(async()=>{if(!h.current)return;let e=++g.current;try{let t=n?await y.listOutbox(`dead`,n):await y.listOutbox(`dead`);if(!h.current||e!==g.current)return;l({...t,ops:t.ops.filter(e=>e.state===`dead`)}),f(!1)}catch{h.current&&e===g.current&&f(!0)}},[n]);(0,R.useEffect)(()=>(h.current=!0,b(),()=>{h.current=!1,g.current++}),[b,i,r?.dead,r?.pending,r?.inflight,r?.done,r?.superseded]),(0,R.useEffect)(()=>{if(_)return _.registerHandler(v,t=>{if(!t||typeof t!=`object`)return;let n=t;n.type===`jira.outbox_changed`&&n.projectId===e&&b()}),()=>_.unregisterHandler(v)},[_,v,e,b]);async function x(e){if(!p.has(e)){m(t=>new Set(t).add(e));try{n?await y.retryOutbox(e,n):await y.retryOutbox(e),h.current&&await b()}catch(e){h.current&&u.error(e instanceof Error?e.message:s(`errors.generic`))}finally{h.current&&m(t=>{let n=new Set(t);return n.delete(e),n})}}}let S=c?.counts??r??se,C=S.pending+S.inflight;return(0,z.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:s(`outbox.title`)}),(0,z.jsx)(`p`,{className:`mt-1 text-xs ${S.dead>0?`text-accent-warning`:`text-muted-foreground`}`,children:S.dead>0?s(`outbox.dead`,{count:S.dead}):C>0?s(`outbox.pending`,{count:C}):s(S.superseded?`outbox.nonePending`:`outbox.allSynced`)}),d&&(0,z.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-accent-warning`,children:s(`outbox.loadFailed`)}),(0,z.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:s(`outbox.retry`)})]}),!!c?.ops.length&&(0,z.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`outbox.deadHelp`)}),c.ops.map(e=>{let n=e.targetStatus||(e.logicalState?s(`mapping.${ce(e.logicalState)}`):null),r=e.deadReason??e.lastError??``;return(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded border border-border/60 px-2 py-2`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 space-y-1 text-xs`,children:[(0,z.jsxs)(`p`,{className:`break-words`,children:[e.jiraKey?(0,z.jsx)(`a`,{href:`${t.replace(/\/$/,``)}/browse/${encodeURIComponent(e.jiraKey)}`,target:`_blank`,rel:`noreferrer`,className:`font-medium text-accent-primary hover:underline`,children:e.jiraKey}):(0,z.jsx)(`span`,{className:`font-medium`,children:s(`outbox.issueFallback`,{id:e.jiraIssueId})}),` · `,s(e.opType===`transition`?`outbox.opTransition`:e.opType===`comment`?`outbox.opComment`:e.opType===`update`?`outbox.opUpdate`:`outbox.opCreate`)]}),n&&(0,z.jsx)(`p`,{className:`break-words text-muted-foreground`,children:s(`outbox.target`,{status:n})}),(0,z.jsx)(`p`,{className:`max-h-32 overflow-y-auto whitespace-pre-wrap break-words text-muted-foreground`,children:r})]}),(0,z.jsx)(E,{className:`shrink-0`,variant:`outline`,size:`sm`,disabled:p.has(e.id),onClick:()=>void x(e.id),children:s(p.has(e.id)?`outbox.retrying`:`outbox.retry`)})]},e.id)})]})]})}function ce(e){return e===`in_progress`?`inProgress`:e===`on_review`?`onReview`:e}var q=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],le={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function J(e){let{activeProjectId:t}=l(),n=`${e.apiBase??t??``}:${e.state.connection.projectId}`;return(0,z.jsx)(ue,{...e},n)}function ue({state:e,onChanged:t,apiBase:n}){let{t:r}=o(`jira`),i=e.connection,[a,s]=(0,R.useState)(i.enabled),[c,l]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(0),[h,g]=(0,R.useState)([]),[_,v]=(0,R.useState)(i.discardStatus??``),[b,x]=(0,R.useState)(i.statusMap??{}),[S,C]=(0,R.useState)(!1),[w,T]=(0,R.useState)(!1),D=(0,R.useRef)(0),O=(0,R.useRef)(!0),k=(0,R.useCallback)(async()=>{let e=++D.current;T(!0);try{let{statuses:t}=await y.listStatuses(n);if(!O.current||e!==D.current)return;g(t),C(!1)}catch{O.current&&e===D.current&&C(!0)}finally{O.current&&e===D.current&&T(!1)}},[n]);(0,R.useEffect)(()=>(O.current=!0,k(),()=>{O.current=!1,D.current++}),[k]);async function A(e){let i=_;v(e);try{if(n?await y.patchConnection({discardStatus:e||null},n):await y.patchConnection({discardStatus:e||null}),!O.current)return;t()}catch(e){if(!O.current)return;v(i),u.error(Y(e,r))}}async function j(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{if(n?await y.patchConnection({statusMap:Object.keys(s).length?s:null},n):await y.patchConnection({statusMap:Object.keys(s).length?s:null}),!O.current)return;m(e=>e+1),t()}catch(e){if(!O.current)return;x(a),u.error(Y(e,r))}}async function M(){let e=!a;s(e),f(!0);try{n?await y.setEnabled(e,n):await y.setEnabled(e)}catch(t){if(!O.current)return;s(!e),u.error(Y(t,r))}finally{O.current&&f(!1)}}async function N(){l(!0);try{let e=n?await y.syncNow(n):await y.syncNow();if(!O.current)return;u.success(r(`status.syncedToast`,{count:e.upserted})),m(e=>e+1)}catch(e){O.current&&u.error(Y(e,r))}finally{O.current&&l(!1)}}async function ee(){if(window.confirm(r(`status.disconnectConfirm`))){f(!0);try{if(n?await y.disconnect(n):await y.disconnect(),!O.current)return;u.success(r(`status.disconnectedToast`)),t()}catch(e){O.current&&u.error(Y(e,r))}finally{O.current&&f(!1)}}}return(0,z.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:i.jiraProjectKey})}),(0,z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,z.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":r(`status.enabledLabel`),disabled:d,onClick:M,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,z.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,z.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,z.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),S&&(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-accent-warning`,children:r(`mapping.loadFailed`)}),(0,z.jsx)(E,{variant:`outline`,size:`sm`,disabled:w,onClick:()=>void k(),children:r(`mapping.retry`)})]}),w&&(0,z.jsx)(`p`,{role:`status`,className:`mb-2 text-xs text-muted-foreground`,children:r(`mapping.loading`)}),(0,z.jsx)(`div`,{className:`space-y-2`,children:q.map(e=>(0,z.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${le[e]}`)}),(0,z.jsxs)(`select`,{value:b[e]??``,onChange:t=>void j(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,z.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),h.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!h.some(t=>t.name===b[e])&&(0,z.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,z.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,z.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,z.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,z.jsxs)(`select`,{value:_,onChange:e=>void A(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,z.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),h.map(e=>(0,z.jsx)(`option`,{value:e.name,children:e.name},e.id)),_&&!h.some(e=>e.name===_)&&(0,z.jsx)(`option`,{value:_,children:_})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(E,{variant:`outline`,size:`sm`,onClick:N,disabled:c,children:r(c?`status.syncing`:`status.syncNow`)}),(0,z.jsx)(E,{variant:`ghost`,size:`sm`,onClick:ee,disabled:d,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,z.jsx)(K,{projectId:i.projectId,baseUrl:i.baseUrl,apiBase:n,initialCounts:e.outbox,refreshToken:p})]})}function Y(e,t){return e instanceof Error?e.message:t(`errors.generic`)}var de=new Set([`claude`,`codex`,`kimi`]);function fe(e){return{provider:e,label:e===`codex`?`Codex`:`Claude`,active:!1,available:!1,detectedRoute:!1,requests:0,inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0,outputSavingsPercent:0,outputSavingsMethod:`none`,outputSavingsAllocated:!1}}function pe(){return{updatedAt:null,proxyStatsAvailable:!1,durableSavingsAvailable:!1,outputSavingsAvailable:!1,outputSavingsMethod:null,outputConfidence:null,providers:{codex:fe(`codex`),claude:fe(`claude`)},lastIssue:null}}var X={installed:!1,installSource:null,version:null,executablePath:null,uvPath:null,port:8787,phase:`idle`,activeProviders:{codex:!1,claude:!1},availableProviders:{codex:!1,claude:!1},detectedRoutes:{codex:!1,claude:!1},proxyRunning:!1,proxyPid:null,learning:{enabled:!1,baselineReady:!1,baselineSamples:0,updatedAt:null,lastIssue:null},metrics:pe(),lastIssue:null,updatedAt:null};function me(e){let t=e?.metrics??pe();return{...X,...e,activeProviders:{...X.activeProviders,...e?.activeProviders},availableProviders:{...X.availableProviders,...e?.availableProviders},detectedRoutes:{...X.detectedRoutes,...e?.detectedRoutes},learning:{...X.learning,...e?.learning},metrics:{...pe(),...t,providers:{codex:{...fe(`codex`),...t.providers?.codex},claude:{...fe(`claude`),...t.providers?.claude}}}}}async function Z(e){let t=await e.text(),n=t?JSON.parse(t):{};if(!e.ok){let t=n.issue;throw Object.assign(Error(t?.title??n.error??`HTTP ${e.status}`),{payload:n})}return n}function Q(e){return`${r}/api/projects/${e}`}function he(e,t=`en`){if(!Number.isFinite(e))return`0`;try{return Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}catch{return Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}}function $(e,t,n){return`${he(e,t)} ${n}`}function ge({onWindowOpened:e}={}){let{t}=o(`integrations`),{projects:n}=l(),{registerHandler:a,unregisterHandler:s}=i(),[c,d]=(0,R.useState)(``),[f,m]=(0,R.useState)(`all`),[g,_]=(0,R.useState)(X),[v,y]=(0,R.useState)(!0),[E,D]=(0,R.useState)(null),[O,A]=(0,R.useState)([]),[j,P]=(0,R.useState)(!1),[ie,F]=(0,R.useState)(!1),[I,L]=(0,R.useState)(null),[B,oe]=(0,R.useState)({jira:0,serena:0,projects:0}),V=(0,R.useCallback)(async()=>{try{let e=await fetch(`${r}/api/global-plugins/headroom`).then(e=>Z(e));_(me(e.state))}finally{y(!1)}},[]);(0,R.useEffect)(()=>{V()},[V]),(0,R.useEffect)(()=>(a(`plugins-page`,e=>{let t=e;t.type===`plugin.headroom_progress`&&(t.line&&A(e=>[...e.slice(-80),t.line]),V())}),()=>s(`plugins-page`)),[a,s,V]),(0,R.useEffect)(()=>{let e=!1;async function t(){let t=await Promise.all(n.map(async e=>{let[t,n]=await Promise.all([fetch(`${Q(e.id)}/jira/connection`).then(e=>Z(e)).catch(()=>({connected:!1})),fetch(`${Q(e.id)}/plugins`).then(e=>Z(e)).catch(()=>({plugins:[]}))]),r=n.plugins.find(e=>e.name===`serena`);return{jira:+!!t.connected,serena:r&&r.status!==`not-installed`&&r.status!==`orphan`?1:0}}));e||oe({jira:t.reduce((e,t)=>e+t.jira,0),serena:t.reduce((e,t)=>e+t.serena,0),projects:n.length})}return t(),()=>{e=!0}},[n]);async function H(e,t){D(e),A([]);try{let e=(await t()).state;e&&_(me(e))}catch(e){let t=e.payload;t?.state&&_(me(t.state))}finally{D(null),V()}}let U=(0,R.useMemo)(()=>[{id:`headroom-ai`,title:`Headroom AI`,scope:`global`,icon:N,description:t(`plugins.catalog.headroom.description`),installed:g.installed,status:g.lastIssue?`attention`:g.installed?g.activeProviders.codex||g.activeProviders.claude?g.installSource===`system`?`external-active`:`active`:g.installSource===`system`?`external`:`installed`:`available`,statusLabel:g.lastIssue?t(`plugins.status.attention`):g.installed?g.activeProviders.codex||g.activeProviders.claude?g.installSource===`system`?t(`plugins.status.externalActive`):t(`plugins.status.active`):g.installSource===`system`?t(`plugins.status.external`):t(`plugins.status.installed`):t(`plugins.status.available`),actionKind:g.lastIssue?`review`:g.installed?`manage`:`install`,actionLabel:g.lastIssue?t(`plugins.actions.review`):g.installed?t(`plugins.actions.manage`):t(`plugins.actions.install`),busy:E===`install`,action:()=>{if(g.lastIssue||g.installed){P(!0);return}H(`install`,()=>fetch(`${r}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>Z(e)))}}],[g,E,t]),W=(0,R.useMemo)(()=>[{id:`jira`,title:`Jira`,scope:`project`,icon:ae,description:t(`plugins.catalog.jira.description`),installed:B.jira>0,status:B.jira>0?`configured`:`available`,statusLabel:B.jira>0?t(`plugins.status.configuredCount`,{count:B.jira}):t(`plugins.status.available`),actionKind:B.jira>0?`manage`:`install`,actionLabel:B.jira>0?t(`plugins.actions.manage`):t(`plugins.actions.install`),action:()=>L(`jira`)},{id:`serena`,title:`Serena`,scope:`project`,icon:re,description:t(`plugins.catalog.serena.description`),installed:B.serena>0,status:B.serena>0?`installed`:`available`,statusLabel:B.serena>0?t(`plugins.status.installedCount`,{count:B.serena}):t(`plugins.status.available`),actionKind:B.serena>0?`manage`:`install`,actionLabel:B.serena>0?t(`plugins.actions.manage`):t(`plugins.actions.install`),action:()=>L(`serena`)}],[B,t]),G=c.trim().toLowerCase(),se=e=>`${e.title} ${e.description} ${e.statusLabel} ${t(`plugins.scope.${e.scope}`)}`.toLowerCase().includes(G),K=[...U,...W].filter(e=>f!==`all`&&e.scope!==f?!1:se(e)),ce=K.filter(e=>e.scope===`global`&&e.installed),q=K.filter(e=>e.scope===`project`&&e.installed),le=K.filter(e=>e.scope===`global`&&!e.installed),J=K.filter(e=>e.scope===`project`&&!e.installed),ue=ce.length>0||q.length>0,Y=le.length>0||J.length>0,de=[g.installed,B.jira>0,B.serena>0].filter(Boolean).length;return(0,z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[(0,z.jsxs)(`div`,{className:`border-b border-border px-6 py-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,z.jsx)(`div`,{className:`grid h-9 w-9 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,z.jsx)(k,{className:`h-4 w-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold tracking-normal`,children:t(`plugins.page.title`)}),(0,z.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t(`plugins.page.subtitle`)})]}),!ee()&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void te().then(()=>e?.()).catch(e=>u.error(String(e))),className:`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-2 text-xs hover:bg-muted`,children:[(0,z.jsx)(p,{className:`h-3.5 w-3.5`}),t(`plugins.page.openWindow`)]}),(0,z.jsxs)(`div`,{className:`mr-12 flex items-center gap-2 rounded-lg border border-border bg-card/60 px-3 py-2 text-xs`,children:[(0,z.jsx)(ne,{className:`h-3.5 w-3.5 text-accent-success`}),(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:t(`plugins.page.readyCount`,{count:de})})]})]}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 md:flex-row md:items-center`,children:[(0,z.jsxs)(`label`,{className:`relative flex-1`,children:[(0,z.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,z.jsx)(`input`,{value:c,onChange:e=>d(e.target.value),placeholder:t(`plugins.search.placeholder`),className:`h-9 w-full rounded-lg border border-border bg-background pl-9 pr-3 text-sm outline-none transition-colors focus:border-accent-primary/60`})]}),(0,z.jsx)(`div`,{className:`inline-flex h-9 rounded-lg border border-border bg-card p-1`,children:[`all`,`global`,`project`].map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(e),className:T(`rounded-md px-3 text-xs capitalize transition-colors`,f===e?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:t(`plugins.filters.${e}`)},e))})]})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-auto px-6 py-5`,children:[(0,z.jsxs)(`section`,{className:`mb-6`,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,z.jsx)(M,{className:`h-3.5 w-3.5`}),t(`plugins.sections.installed`)]}),ue?(0,z.jsx)(_e,{globalPlugins:ce,projectPlugins:q}):(0,z.jsx)(ve,{text:t(G?`plugins.empty.installedSearch`:`plugins.empty.installed`)})]}),(0,z.jsxs)(`section`,{children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),t(`plugins.sections.available`)]}),Y?(0,z.jsx)(_e,{globalPlugins:le,projectPlugins:J}):(0,z.jsx)(ve,{text:t(G?`plugins.empty.availableSearch`:`plugins.empty.allInstalled`)})]})]}),(0,z.jsx)(w,{open:j,onOpenChange:P,children:(0,z.jsxs)(C,{className:`w-[calc(100vw-2rem)] max-w-xl overflow-x-hidden p-4 sm:p-6`,children:[(0,z.jsxs)(S,{children:[(0,z.jsx)(x,{children:t(`plugins.headroom.title`)}),(0,z.jsx)(b,{children:t(`plugins.headroom.dialogDescription`)})]}),(0,z.jsx)(Se,{state:g,loading:v,busy:E,logs:O,onInstall:()=>H(`install`,()=>fetch(`${r}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>Z(e))),onToggleProvider:(e,t)=>H(`${t?`deactivate`:`activate`}-${e}`,()=>fetch(`${r}/api/global-plugins/headroom/${t?`deactivate`:`activate`}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e})}).then(e=>Z(e))),onDeactivateAll:()=>H(`deactivate-all`,async()=>{let e={state:g};for(let t of[`codex`,`claude`])g.activeProviders[t]&&(e=await fetch(`${r}/api/global-plugins/headroom/deactivate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:t})}).then(e=>Z(e)));return e}),onUninstall:()=>H(`uninstall`,()=>fetch(`${r}/api/global-plugins/headroom/uninstall`,{method:`POST`}).then(e=>Z(e))),onSetPort:e=>H(`port`,()=>fetch(`${r}/api/global-plugins/headroom/port`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({port:e})}).then(e=>Z(e))),onOpenDiagnostics:()=>F(!0)})]})}),(0,z.jsx)(ke,{plugin:I,projects:n,onClose:()=>L(null)}),(0,z.jsx)(Me,{open:ie,onClose:()=>F(!1)})]})}function _e({globalPlugins:e,projectPlugins:t}){let{t:n}=o(`integrations`);return(0,z.jsxs)(`div`,{className:T(`grid grid-cols-1 gap-4`,e.length>0&&t.length>0&&`xl:grid-cols-2`),children:[e.length>0&&(0,z.jsxs)(`section`,{children:[(0,z.jsx)(be,{title:n(`plugins.groups.global.title`),detail:n(`plugins.groups.global.detail`),scope:`global`}),(0,z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:e.map(e=>(0,z.jsx)(xe,{plugin:e},e.id))})]}),t.length>0&&(0,z.jsxs)(`section`,{children:[(0,z.jsx)(be,{title:n(`plugins.groups.project.title`),detail:n(`plugins.groups.project.detail`),scope:`project`}),(0,z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:t.map(e=>(0,z.jsx)(xe,{plugin:e},e.id))})]})]})}function ve({text:e}){return(0,z.jsx)(`div`,{className:`flex h-[74px] max-w-[320px] items-center rounded-lg border border-dashed border-border bg-card/35 px-3 text-xs text-muted-foreground`,children:e})}function ye({scope:e}){let{t}=o(`integrations`);return(0,z.jsx)(`span`,{className:T(`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wide`,e===`global`?`bg-accent-primary/10 text-accent-primary`:`bg-accent-info/10 text-accent-info`),children:t(`plugins.scope.${e}`)})}function be({title:e,detail:t,scope:n}){return(0,z.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,z.jsx)(`div`,{className:T(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card/70 px-2 py-1`,children:[(0,z.jsx)(ye,{scope:n}),(0,z.jsx)(`span`,{className:`text-xs font-medium`,children:e}),(0,z.jsx)(`span`,{className:`hidden text-[11px] text-muted-foreground sm:inline`,children:t})]}),(0,z.jsx)(`div`,{className:T(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)})]})}function xe({plugin:e}){let{t}=o(`integrations`),n=e.icon,r=e.scope===`global`,i=e.status===`attention`,a=e.busy?m:e.actionKind===`install`?f:e.actionKind===`review`?_:D,s=T(`shrink-0 rounded border px-1.5 py-0.5 text-[10px] leading-none`,i?`border-accent-warning/30 bg-accent-warning/10 text-accent-warning`:e.installed?`border-accent-success/25 bg-accent-success/10 text-accent-success`:`border-border bg-muted text-muted-foreground`);return(0,z.jsxs)(`article`,{className:`grid h-[88px] w-full grid-cols-[38px_minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-card/70 px-3 transition-colors hover:border-accent-primary/35 hover:bg-card`,children:[(0,z.jsx)(`div`,{className:T(`grid h-[38px] w-[38px] shrink-0 place-items-center rounded-lg border`,r?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-accent-info/25 bg-accent-info/10 text-accent-info`),children:(0,z.jsx)(n,{className:`h-4 w-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold leading-5`,children:e.title}),(0,z.jsx)(`p`,{className:`mt-1 truncate text-[11px] leading-4 text-muted-foreground`,children:e.description}),(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,z.jsx)(ye,{scope:e.scope}),(0,z.jsx)(`span`,{className:s,children:e.statusLabel})]})]}),(0,z.jsxs)(`button`,{type:`button`,disabled:e.busy,onClick:e.action,className:`flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs font-medium transition-colors hover:bg-muted disabled:opacity-50`,children:[(0,z.jsx)(a,{className:T(`h-3.5 w-3.5`,e.busy&&`animate-spin`)}),e.busy?t(`plugins.actions.installing`):e.actionLabel]})]})}function Se({state:e,loading:t,busy:n,logs:r,onInstall:i,onToggleProvider:a,onDeactivateAll:s,onUninstall:c,onSetPort:l,onOpenDiagnostics:u}){let{t:d}=o(`integrations`),[p,h]=(0,R.useState)(String(e.port)),[_,y]=(0,R.useState)(!1);(0,R.useEffect)(()=>h(String(e.port)),[e.port]),(0,R.useEffect)(()=>{e.installed||y(!1)},[e.installed]);let b=e.activeProviders.codex||e.activeProviders.claude,x=e.installSource===`system`;return(0,z.jsxs)(`aside`,{className:`w-full min-w-0 overflow-hidden rounded-lg border border-border bg-card/80 p-4`,children:[(0,z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,z.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,z.jsx)(N,{className:`h-4 w-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold`,children:d(`plugins.headroom.title`)}),(0,z.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:d(`plugins.headroom.panelDescription`)})]})]}),(0,z.jsxs)(`div`,{className:`mb-4 grid grid-cols-3 gap-2 text-xs`,children:[(0,z.jsx)(Ce,{label:d(`plugins.headroom.metrics.install`),value:t?d(`plugins.headroom.metrics.checking`):e.installed?d(`plugins.headroom.metrics.ready`):d(`plugins.headroom.metrics.missing`),good:e.installed}),(0,z.jsx)(Ce,{label:d(`plugins.headroom.metrics.source`),value:e.installSource===`system`?d(`plugins.headroom.metrics.system`):e.installSource===`managed`?d(`plugins.headroom.metrics.specrails`):d(`plugins.headroom.metrics.none`),good:e.installed}),(0,z.jsx)(Ce,{label:d(`plugins.headroom.metrics.proxy`),value:e.proxyRunning?`:${e.port}`:d(b?`plugins.headroom.metrics.starting`:`plugins.headroom.metrics.off`),good:e.proxyRunning||!b})]}),e.lastIssue&&(0,z.jsx)(we,{issue:e.lastIssue}),e.installed?(0,z.jsxs)(`div`,{className:`mb-4 space-y-2`,children:[(0,z.jsx)(Oe,{provider:`codex`,active:e.activeProviders.codex,available:e.availableProviders.codex,detectedRoute:e.detectedRoutes.codex,busy:n===`activate-codex`||n===`deactivate-codex`,onClick:()=>a(`codex`,e.activeProviders.codex)}),(0,z.jsx)(Oe,{provider:`claude`,active:e.activeProviders.claude,available:e.availableProviders.claude,detectedRoute:e.detectedRoutes.claude,busy:n===`activate-claude`||n===`deactivate-claude`,onClick:()=>a(`claude`,e.activeProviders.claude)}),b&&(0,z.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:s,className:`flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border bg-background/45 text-xs hover:bg-muted/50 disabled:opacity-50`,children:[n===`deactivate-all`?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(L,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.disableAllRoutes`)]})]}):(0,z.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:i,className:`mb-3 flex h-9 w-full items-center justify-center gap-2 rounded-lg bg-accent-primary px-3 text-xs font-medium text-white disabled:opacity-50`,children:[n===`install`?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(f,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.installWithUv`)]}),e.installed&&(0,z.jsx)(Te,{state:e}),(0,z.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,z.jsx)(`label`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:d(`plugins.headroom.port.label`)}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(`input`,{value:p,onChange:e=>h(e.target.value),className:`h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-sm`}),(0,z.jsx)(`button`,{type:`button`,disabled:!!n||Number(p)===e.port,onClick:()=>l(Number(p)),className:`rounded-md border border-border px-2 text-xs hover:bg-muted disabled:opacity-50`,children:d(`plugins.headroom.port.apply`)})]})]}),r.length>0&&(0,z.jsx)(`pre`,{className:`mb-3 max-h-32 overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background/60 p-2 text-[10px] text-muted-foreground`,children:r.join(`
|
|
2
2
|
`)}),(0,z.jsxs)(`button`,{type:`button`,onClick:u,className:`mb-2 flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border text-xs hover:bg-muted/50`,children:[(0,z.jsx)(v,{className:`h-3.5 w-3.5`}),d(`plugins.headroom.actions.viewDiagnostics`)]}),e.installed&&(0,z.jsx)(`div`,{className:`rounded-lg border border-destructive/25 bg-destructive/5 p-3`,children:_?(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:d(x?`plugins.headroom.confirmDetach`:`plugins.headroom.confirmUninstall`)}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,disabled:!!n,onClick:()=>y(!1),className:`h-8 rounded-md border border-border text-xs hover:bg-muted/50 disabled:opacity-50`,children:d(`plugins.actions.cancel`)}),(0,z.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:c,className:`flex h-8 items-center justify-center gap-2 rounded-md bg-destructive px-2 text-xs font-medium text-destructive-foreground disabled:opacity-50`,children:[n===`uninstall`?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(g,{className:`h-3.5 w-3.5`}),d(x?`plugins.headroom.actions.detach`:`plugins.headroom.actions.uninstall`)]})]})]}):(0,z.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:()=>y(!0),className:`flex h-8 w-full items-center justify-center gap-2 rounded-md text-xs font-medium text-destructive hover:bg-destructive/10 disabled:opacity-50`,children:[(0,z.jsx)(g,{className:`h-3.5 w-3.5`}),d(x?`plugins.headroom.actions.detachHeadroom`:`plugins.headroom.actions.uninstallHeadroom`)]})})]})}function Ce({label:e,value:t,good:n}){return(0,z.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/45 p-2`,children:[(0,z.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e}),(0,z.jsx)(`div`,{className:T(`mt-0.5 font-medium`,n?`text-foreground`:`text-accent-warning`),children:t})]})}function we({issue:e}){let{t}=o(`integrations`),n=`plugins.headroom.issues.${e.code}`,r=t(`${n}.title`,{defaultValue:e.title}),i=t(`${n}.guidance`,{defaultValue:e.guidance});return(0,z.jsx)(`div`,{className:`mb-3 rounded-lg border border-accent-warning/35 bg-accent-warning/10 p-3`,children:(0,z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,z.jsx)(_,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-warning`}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`div`,{className:`text-xs font-medium`,children:r}),(0,z.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:i}),(0,z.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(`plugins.headroom.issueCode`,{code:e.code})})]})]})})}function Te({state:e}){let{t,i18n:n}=o(`integrations`),r=e.metrics,i=r.outputSavingsAvailable,a=[`codex`,`claude`].map(e=>({provider:e,metric:r.providers[e]})),s=t(`plugins.headroom.savings.tokens`),c=a.reduce((e,{metric:t})=>({inputTokens:e.inputTokens+t.inputTokens,inputTokensSaved:e.inputTokensSaved+t.inputTokensSaved,outputTokens:e.outputTokens+t.outputTokens,outputTokensSaved:e.outputTokensSaved+t.outputTokensSaved}),{inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0}),l=a.some(({metric:e})=>e.inputTokensSaved>0),u=a.some(({metric:e})=>e.active),d=t(i?`plugins.headroom.savings.statusInputOutput`:l?`plugins.headroom.savings.statusInputOnly`:u?`plugins.headroom.savings.statusRouting`:`plugins.headroom.savings.statusInactive`),f=i||l;return(0,z.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(j,{className:`h-3.5 w-3.5 text-accent-primary`}),(0,z.jsx)(`div`,{className:`truncate text-xs font-medium`,children:t(`plugins.headroom.savings.title`)})]}),(0,z.jsx)(`span`,{className:T(`shrink-0 rounded border px-1.5 py-0.5 text-[10px]`,f?`border-accent-success/25 bg-accent-success/10 text-accent-success`:u?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-border bg-muted text-muted-foreground`),children:d})]}),(0,z.jsxs)(`div`,{className:`mb-2 rounded-md bg-muted/35 px-2.5 py-2`,children:[(0,z.jsx)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase text-muted-foreground`,children:t(`plugins.headroom.savings.totals`)}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,z.jsx)(Ee,{label:t(`plugins.headroom.savings.input`),processed:c.inputTokens>0?$(c.inputTokens,n.language,s):t(`plugins.headroom.savings.noData`),saved:$(c.inputTokensSaved,n.language,s)}),(0,z.jsx)(Ee,{align:`right`,label:t(`plugins.headroom.savings.output`),processed:c.outputTokens>0?$(c.outputTokens,n.language,s):t(`plugins.headroom.savings.noData`),saved:i?$(c.outputTokensSaved,n.language,s):t(`plugins.headroom.savings.noData`)})]})]}),(0,z.jsx)(`div`,{className:`grid gap-2`,children:a.map(({provider:e,metric:t})=>(0,z.jsx)(De,{metric:t,outputAvailable:r.outputSavingsAvailable},e))}),(0,z.jsx)(`div`,{className:`mt-2 flex items-center justify-end gap-2 text-[10px] text-muted-foreground`,children:r.updatedAt?t(`plugins.headroom.savings.updatedLive`):t(`plugins.headroom.savings.baselineSamples`,{count:e.learning.baselineSamples})})]})}function Ee({label:e,processed:t,saved:n,detail:r,align:i=`left`}){let{t:a}=o(`integrations`);return(0,z.jsxs)(`div`,{className:T(`min-w-0`,i===`right`&&`text-right`),children:[(0,z.jsx)(`div`,{className:`text-[10px] font-medium uppercase text-muted-foreground`,children:e}),(0,z.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-[11px]`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:a(`plugins.headroom.savings.processed`)}),(0,z.jsx)(`span`,{className:`truncate font-semibold tabular-nums text-foreground`,children:t})]}),(0,z.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:a(`plugins.headroom.savings.saved`)}),(0,z.jsx)(`span`,{className:`truncate font-semibold tabular-nums text-foreground`,children:n})]})]}),r&&(0,z.jsx)(`div`,{className:`mt-1 truncate text-[10px] text-muted-foreground`,children:r})]})}function De({metric:e,outputAvailable:t}){let{t:n,i18n:r}=o(`integrations`),i=!e.available,a=i||!e.active,s=n(`plugins.headroom.savings.tokens`),c=e.inputTokens>0?$(e.inputTokens,r.language,s):n(`plugins.headroom.savings.noData`),l=$(e.inputTokensSaved,r.language,s),u=e.outputTokens>0?$(e.outputTokens,r.language,s):n(`plugins.headroom.savings.noData`),d=t?$(e.outputTokensSaved,r.language,s):e.active?n(`plugins.headroom.savings.noData`):n(`plugins.headroom.savings.off`),f=e.requests>0?n(`plugins.headroom.savings.requestCount`,{count:he(e.requests,r.language)}):i?n(`plugins.headroom.provider.noProjectUsesProvider`):e.active?n(`plugins.headroom.savings.inputSavingsActive`):n(`plugins.headroom.savings.routeDisabled`);return(0,z.jsxs)(`div`,{className:T(`rounded-md border border-border bg-card/45 px-2.5 py-2`,a&&`opacity-70`),children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`text-xs font-medium`,children:e.label}),e.detectedRoute&&(0,z.jsx)(`span`,{className:`rounded bg-accent-primary/10 px-1.5 py-0.5 text-[9px] uppercase text-accent-primary`,children:n(`plugins.headroom.savings.detected`)})]}),(0,z.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:f}),(0,z.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-3`,children:[(0,z.jsx)(Ee,{label:n(`plugins.headroom.savings.input`),processed:c,saved:l}),(0,z.jsx)(Ee,{align:`right`,label:n(`plugins.headroom.savings.output`),processed:u,saved:d})]})]})}function Oe({provider:e,active:t,available:n,detectedRoute:r,busy:i,onClick:a}){let{t:s}=o(`integrations`),c=s(n?t?`plugins.headroom.provider.routedThroughHeadroom`:r?`plugins.headroom.provider.detectedExternalRoute`:`plugins.headroom.provider.notRouted`:`plugins.headroom.provider.noProjectUsesProvider`);return(0,z.jsxs)(`button`,{type:`button`,onClick:a,disabled:i||!n,className:`flex w-full items-center gap-3 rounded-lg border border-border bg-background/45 p-3 text-left hover:bg-muted/35 disabled:opacity-50`,children:[(0,z.jsx)(`div`,{className:T(`grid h-8 w-8 place-items-center rounded-md`,t?`bg-accent-success/15 text-accent-success`:`bg-muted text-muted-foreground`),children:i?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(ie,{className:`h-3.5 w-3.5`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`div`,{className:`text-xs font-medium capitalize`,children:e}),(0,z.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:c})]}),(0,z.jsx)(`span`,{className:T(`h-5 w-9 rounded-full p-0.5 transition-colors`,t?`bg-accent-success`:`bg-muted`),children:(0,z.jsx)(`span`,{className:T(`block h-4 w-4 rounded-full bg-white shadow transition-transform`,t&&`translate-x-4`)})})]})}function ke({plugin:e,projects:t,onClose:n}){let{t:r}=o(`integrations`),[i,a]=(0,R.useState)(``);(0,R.useEffect)(()=>a(``),[e]);let s=t.find(e=>e.id===i)??null;return(0,z.jsx)(w,{open:!!e,onOpenChange:e=>{e||n()},children:(0,z.jsxs)(C,{className:`w-[calc(100vw-2rem)] max-w-3xl overflow-x-hidden p-4 sm:p-6`,children:[(0,z.jsxs)(S,{children:[(0,z.jsx)(x,{children:r(e===`jira`?`plugins.projectWizard.configureJira`:`plugins.projectWizard.installSerena`)}),(0,z.jsx)(b,{children:r(`plugins.projectWizard.description`)})]}),(0,z.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-[260px_minmax(0,1fr)]`,children:[(0,z.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/70 p-3`,children:[(0,z.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:r(`plugins.projectWizard.chooseProject`)}),(0,z.jsx)(`div`,{className:`max-h-[52vh] space-y-1 overflow-auto`,children:t.map(t=>{let n=e===`serena`&&!c(t).some(e=>de.has(e));return(0,z.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>a(t.id),className:T(`w-full rounded-md px-2 py-2 text-left transition-colors`,t.id===i?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,n&&`cursor-not-allowed opacity-45`),children:[(0,z.jsx)(`div`,{className:`truncate text-xs font-medium`,children:t.name}),(0,z.jsx)(`div`,{className:`truncate text-[10px]`,children:n?r(`plugins.projectWizard.requiresSupportedProvider`,{defaultValue:`Requires Claude or Codex`}):t.path})]},t.id)})})]}),(0,z.jsx)(`div`,{className:`min-h-[360px] rounded-lg border border-border bg-card/70 p-4`,children:s?e===`jira`?(0,z.jsx)(Ae,{project:s,onDone:n}):(0,z.jsx)(je,{project:s,onDone:n}):(0,z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:r(`plugins.projectWizard.selectProjectToContinue`)})})]})]})})}function Ae({project:e,onDone:t}){let{t:n}=o(`integrations`),r=Q(e.id),[i,a]=(0,R.useState)(null),[s,c]=(0,R.useState)(!0),[l,u]=(0,R.useState)(null),d=(0,R.useCallback)(async()=>{c(!0),u(null);try{let e=await fetch(`${r}/jira/connection`).then(e=>Z(e));a(e)}catch(e){a({connected:!1}),u(e.message)}finally{c(!1)}},[r]);return(0,R.useEffect)(()=>{d()},[d]),s?(0,z.jsxs)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:[(0,z.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),n(`plugins.jira.loading`,{defaultValue:`Loading Jira...`})]}):i?.connected&&i.connection?(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.jira.titleForProject`,{name:e.name,defaultValue:`Jira for ${e.name}`})}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`plugins.jira.configuredDescription`,{defaultValue:`Manage the Jira project, status mapping, discard status, sync, and connection state.`})})]}),(0,z.jsx)(J,{state:i,apiBase:r,onChanged:()=>{d()}})]}):(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.jira.titleForProject`,{name:e.name,defaultValue:`Jira for ${e.name}`})}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:l?n(`plugins.jira.loadFailed`,{message:l,defaultValue:`Could not load the current Jira configuration: ${l}`}):n(`plugins.jira.notConfiguredDescription`,{defaultValue:`Connect this project to Jira.`})})]}),(0,z.jsx)(V,{apiBase:r,onConnected:()=>{d()},onSkip:t})]})}function je({project:e,onDone:t}){let{t:n}=o(`integrations`),r=(0,R.useMemo)(()=>c(e).filter(e=>de.has(e)),[e]),i=r.includes(e.provider)?e.provider:r[0]??e.provider,[a,s]=(0,R.useState)(i),[l,u]=(0,R.useState)(null),[p,h]=(0,R.useState)(null),[g,v]=(0,R.useState)(!1),[y,b]=(0,R.useState)(null),x=(0,R.useRef)(0);(0,R.useEffect)(()=>{s(i),u(null),h(null)},[e.id,i]);let S=(0,R.useCallback)(async()=>{let t=++x.current;b(null);try{let n=`?provider=${encodeURIComponent(a)}`,r=await fetch(`${Q(e.id)}/plugins${n}`).then(e=>Z(e));if(t!==x.current)return;let i=r.plugins.find(e=>e.name===`serena`)??null;if(u(i),h(null),i?.status===`not-installed`){let r=await fetch(`${Q(e.id)}/plugins/serena/preview-install${n}`).then(e=>Z(e));t===x.current&&h(r)}}catch(e){t===x.current&&b(e.message)}},[e.id,a]);(0,R.useEffect)(()=>{S()},[S]);async function C(){v(!0),b(null);try{await fetch(`${Q(e.id)}/plugins/serena/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:a})}).then(e=>Z(e)),await S(),t()}catch(e){b(e.message)}finally{v(!1)}}let w=(p?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum),T=l?n(`plugins.projectStatus.${l.status}`,{defaultValue:l.status}):``,E=l?.name===`serena`?n(`plugins.catalog.serena.description`):l?.description;return!l&&!y?(0,z.jsxs)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:[(0,z.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),` `,n(`plugins.serena.loading`)]}):(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.serena.titleForProject`,{name:e.name})}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`plugins.serena.description`)})]}),(0,z.jsxs)(`label`,{className:`block space-y-1`,children:[(0,z.jsx)(`span`,{className:`text-xs font-medium`,children:n(`plugins.serena.provider`,{defaultValue:`AI provider`})}),(0,z.jsx)(`select`,{"aria-label":n(`plugins.serena.provider`,{defaultValue:`AI provider`}),value:a,disabled:g,onChange:e=>{u(null),h(null),s(e.target.value)},className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs`,children:r.map(e=>(0,z.jsx)(`option`,{value:e,children:d(e)},e))})]}),l&&(0,z.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/45 p-3`,children:[(0,z.jsx)(`div`,{className:`text-xs font-medium`,children:n(`plugins.serena.status`,{status:T})}),E&&(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:E})]}),p&&(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:n(`plugins.serena.files`)}),(0,z.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:p.files.map(e=>(0,z.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path]},e.path))})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:n(`plugins.serena.prerequisites`)}),(0,z.jsx)(`ul`,{className:`space-y-1 text-xs`,children:p.requirements.map(e=>(0,z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.installed&&e.executable&&e.meetsMinimum?(0,z.jsx)(O,{className:`h-3 w-3 text-accent-success`}):(0,z.jsx)(_,{className:`h-3 w-3 text-accent-warning`}),(0,z.jsxs)(`span`,{children:[e.name,e.minVersion?` >= ${e.minVersion}`:``]}),e.version&&(0,z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]})]},e.name))})]})]}),y&&(0,z.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-xs text-destructive`,children:y}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-border px-3 py-1.5 text-xs`,children:n(`plugins.actions.cancel`)}),(0,z.jsxs)(`button`,{type:`button`,disabled:g||l?.status!==`not-installed`||!w,onClick:C,className:`flex items-center gap-2 rounded-md bg-accent-primary px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:[g?(0,z.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):(0,z.jsx)(f,{className:`h-3.5 w-3.5`}),n(`plugins.actions.install`)]})]})]})}function Me({open:e,onClose:t}){let{t:n}=o(`integrations`),[i,a]=(0,R.useState)(null);return(0,R.useEffect)(()=>{e&&fetch(`${r}/api/global-plugins/headroom/diagnostics`).then(e=>Z(e)).then(a).catch(e=>a({error:e.message}))},[e]),(0,z.jsx)(w,{open:e,onOpenChange:e=>{e||t()},children:(0,z.jsxs)(C,{className:`max-w-3xl`,children:[(0,z.jsxs)(S,{children:[(0,z.jsxs)(x,{className:`flex items-center gap-2`,children:[(0,z.jsx)(D,{className:`h-4 w-4`}),` `,n(`plugins.diagnostics.title`)]}),(0,z.jsx)(b,{children:n(`plugins.diagnostics.description`)})]}),(0,z.jsx)(`pre`,{className:`max-h-[62vh] overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background p-3 text-xs`,children:JSON.stringify(i,null,2)})]})})}export{ge as default};
|
package/client/dist/assets/{ProjectSettingsDialog-B4chTfU8.js → ProjectSettingsDialog-Ce8DSG6H.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{n as r,t as i}from"./createLucideIcon-DtODIU64.js";import{r as a}from"./useDesktop-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{n as r,t as i}from"./createLucideIcon-DtODIU64.js";import{r as a}from"./useDesktop-BjLT0_EE.js";import{t as o}from"./git-branch-yf6LE1Bw.js";import{i as s,l as c,o as l,r as u,t as d}from"./dialog-DtdR05v1.js";import{t as f}from"./utils-BC4DHlz2.js";import{St as p,_ as m,a as h,bt as g,en as _,g as v,gt as y,h as b,i as x,jt as S,n as C,o as w,r as T,rn as E,s as D,yt as O}from"./index-IdGpV21X.js";var k={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};k.node;var A=i(k),j=e(t(),1),M=n(),N=[{id:`general`,icon:g,labelKey:`projectDialog.nav.general`},{id:`agentRuntime`,icon:_,labelKey:`projectDialog.nav.agentRuntime`},{id:`subagents`,icon:S,labelKey:`projectDialog.nav.subagents`},{id:`branch`,icon:o,labelKey:`projectDialog.nav.branch`},{id:`environment`,icon:A,labelKey:`projectDialog.nav.environment`},{id:`budget`,icon:y,labelKey:`projectDialog.nav.budget`},{id:`telemetry`,icon:E,labelKey:`projectDialog.nav.telemetry`},{id:`terminal`,icon:O,labelKey:`projectDialog.nav.terminal`}];function P({open:e,onClose:t}){let{t:n}=r(`settings`),{activeProjectId:i,projects:o}=a(),g=o.find(e=>e.id===i),[_,y]=(0,j.useState)(`general`),S=e=>f(`space-y-5`,_===e?``:`hidden`);return(0,M.jsx)(d,{open:e,onOpenChange:e=>{e||t()},children:(0,M.jsxs)(u,{movableResizable:!0,className:`flex max-w-5xl w-[92vw] h-[82vh] flex-col overflow-hidden`,children:[(0,M.jsxs)(l,{children:[(0,M.jsxs)(c,{className:`flex items-center gap-2`,children:[(0,M.jsx)(p,{className:`w-4 h-4`}),g?n(`projectDialog.title`,{name:g.name}):n(`page.title`)]}),(0,M.jsx)(s,{children:n(`projectDialog.description`)})]}),(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-5 py-2`,children:[(0,M.jsx)(`nav`,{className:`w-40 shrink-0 space-y-0.5 overflow-y-auto border-r border-border pr-2`,children:N.map(e=>{let t=e.icon;return(0,M.jsxs)(`button`,{type:`button`,onClick:()=>y(e.id),className:f(`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors`,_===e.id?`bg-accent-primary/15 font-medium text-foreground`:`text-muted-foreground hover:bg-muted/40 hover:text-foreground`),children:[(0,M.jsx)(t,{className:`w-3.5 h-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`truncate`,children:n(e.labelKey)})]},e.id)})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto pr-1`,children:[(0,M.jsxs)(`div`,{className:S(`general`),children:[(0,M.jsx)(b,{}),(0,M.jsx)(x,{})]}),(0,M.jsx)(`div`,{className:S(`agentRuntime`),children:(0,M.jsx)(D,{})}),(0,M.jsx)(`div`,{className:S(`subagents`),children:(0,M.jsx)(m,{})}),(0,M.jsx)(`div`,{className:S(`branch`),children:(0,M.jsx)(T,{})}),(0,M.jsx)(`div`,{className:S(`environment`),children:(0,M.jsx)(w,{})}),(0,M.jsx)(`div`,{className:S(`budget`),children:(0,M.jsx)(C,{})}),(0,M.jsx)(`div`,{className:S(`telemetry`),children:(0,M.jsx)(h,{})}),(0,M.jsx)(`div`,{className:S(`terminal`),children:(0,M.jsx)(v,{mode:`project`})})]})]})]})})}export{P as ProjectSettingsDialog};
|
package/client/dist/assets/{RepositoryDeliveries-DAIxIYsl.js → RepositoryDeliveries-B4ybHOyB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{t as r}from"./useSharedWebSocket-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{t as r}from"./useSharedWebSocket-Bj4LMp7b.js";import{n as i,t as a}from"./createLucideIcon-DtODIU64.js";import{i as o}from"./useDesktop-BjLT0_EE.js";import{a as s,i as c,l,o as u,r as d,t as f}from"./dialog-DtdR05v1.js";import{t as p}from"./button-4FS1ZDTp.js";var m=new Set([`building`,`on_review`,`pr_draft`,`pr_ready`,`no_changes`,`completed`,`pr_closed`,`superseded`,`merged`,`discarded`,`implementation_failed`,`pr_failed`]),h=new Set([`none`,`local-only`,`pushed`,`pr-created`]),g=new Set([`running`,`succeeded`,`partially_succeeded`,`failed`,`unknown`]),_=new Set([`pending`,`ready`,`delivered`,`partial`,`no_changes`,`retryable_failure`,`blocked`,`not_started`,`unknown`]),v=new Set([`create-pr`,`publish`,`discard`,`poll-merge`,`merge-local`,`dismiss`,`reopen`,`acknowledge-no-changes`,`recover-and-retry`,`checkout`]),y=new Set([`implementation_running`,`implementation_failed`,`ready_for_review`,`restart_pending`,`partial_success`,`partial_delivery`,`existing_pr_updated`,`no_changes`,`commit_failed`,`branch_verification_failed`,`push_failed`,`settlement_interrupted`,`recovery_unavailable`,`operation_interrupted`,`delivery_failed`,`pr_draft_ready`,`pr_ready`,`pr_closed`,`merged`,`discarded`,`superseded`,`cleanup_incomplete`,`status_failed`,`ref_mismatch`]);function b(e){return typeof e==`string`&&y.has(e)}var x=`previous delivery action was interrupted by restart`;function S(e,t){return e===`operation_interrupted`||typeof t==`string`&&t.toLowerCase().includes(x)}var C=e=>typeof e==`string`&&e.length>0?e:null,w=e=>typeof e==`string`&&e.length>0?e:null;function T(e){if(!e)return null;let t=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?`${e.replace(` `,`T`)}Z`:e,n=Date.parse(t);return Number.isFinite(n)?n:null}function ee(e,t){let n=T(e),r=T(t);return n==null||r==null?null:r<n?-1:+(r>n)}function te(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.ticketId!=`number`||!Number.isFinite(t.ticketId)||typeof t.branch!=`string`)return null;let n=typeof t.implementationOutcome==`string`&&g.has(t.implementationOutcome)?t.implementationOutcome:void 0,r=typeof t.deliveryOutcome==`string`&&_.has(t.deliveryOutcome)?t.deliveryOutcome:void 0;return{ticketId:t.ticketId,branch:t.branch,succeeded:t.succeeded===!0,...C(t.runId)?{runId:C(t.runId)}:{},...n?{implementationOutcome:n}:{},...r?{deliveryOutcome:r}:{},initialSha:w(t.initialSha),finalSha:w(t.finalSha),...typeof t.changed==`boolean`?{changed:t.changed}:{},failureCode:w(t.failureCode),...t.branchOwnership===`created`||t.branchOwnership===`preexisting`||t.branchOwnership===`borrowed-pr`?{branchOwnership:t.branchOwnership}:{},worktreePath:w(t.worktreePath)}}function E(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=C(n.prDeliveryId)??C(n.id),i=typeof n.railIndex==`number`&&Number.isFinite(n.railIndex)?n.railIndex:t;if(!r||i==null||typeof n.decision!=`string`||!m.has(n.decision))return null;let a=typeof n.implementationOutcome==`string`&&g.has(n.implementationOutcome)?n.implementationOutcome:void 0,o=typeof n.deliveryOutcome==`string`&&_.has(n.deliveryOutcome)?n.deliveryOutcome:void 0,s=(Array.isArray(n.units)?n.units:Array.isArray(n.branches)?n.branches:[]).map(te).filter(e=>e!==null);return{prDeliveryId:r,railIndex:i,railKey:typeof n.railKey==`string`?n.railKey:``,ticketIds:Array.isArray(n.ticketIds)?n.ticketIds.filter(e=>typeof e==`number`&&Number.isFinite(e)):[],baseBranch:typeof n.baseBranch==`string`?n.baseBranch:``,branch:w(n.branch),prUrl:w(n.prUrl),prNumber:typeof n.prNumber==`number`&&Number.isInteger(n.prNumber)&&n.prNumber>0?n.prNumber:null,prState:typeof n.prState==`string`&&h.has(n.prState)?n.prState:`none`,decision:n.decision,runIds:Array.isArray(n.runIds)?n.runIds.filter(e=>typeof e==`string`&&e.length>0):s.map(e=>e.runId).filter(e=>typeof e==`string`&&e.length>0),originConversationId:w(n.originConversationId),createdAt:typeof n.createdAt==`string`?n.createdAt:void 0,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:void 0,...a?{implementationOutcome:a}:{},...o?{deliveryOutcome:o}:{},statusCode:w(n.statusCode),statusDetail:w(n.statusDetail),deliverySha:w(n.deliverySha),isContinuation:n.isContinuation===!0,supersedesDeliveryId:w(n.supersedesDeliveryId),restoredFromDeliveryId:w(n.restoredFromDeliveryId),operation:typeof n.operation==`string`&&v.has(n.operation)?n.operation:null,cleanupWarnings:Array.isArray(n.cleanupWarnings)?n.cleanupWarnings.filter(e=>typeof e==`string`&&e.length>0):[],safetyArchives:Array.isArray(n.safetyArchives)?n.safetyArchives.filter(e=>typeof e==`string`&&e.length>0):[],units:s,executionManifest:n.executionManifest&&typeof n.executionManifest==`object`&&n.executionManifest.version===1?n.executionManifest:void 0,repositoryDeliveries:Array.isArray(n.repositoryDeliveries)?n.repositoryDeliveries.slice(0,100).flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;if(typeof t.repositoryId!=`string`||typeof t.deliveryId!=`string`||typeof t.name!=`string`||typeof t.path!=`string`)return[];let n=E({...t,prDeliveryId:t.deliveryId,repositoryDeliveries:void 0},i);return n?[{repositoryId:t.repositoryId,deliveryId:t.deliveryId,name:t.name,path:t.path,baseBranch:n.baseBranch,...C(t.integrationBranch)?{integrationBranch:C(t.integrationBranch)}:{},branch:n.branch,deliverySha:n.deliverySha??null,decision:n.decision,implementationOutcome:n.implementationOutcome??`unknown`,deliveryOutcome:n.deliveryOutcome??`unknown`,statusCode:n.statusCode??null,statusDetail:n.statusDetail??null,prUrl:n.prUrl,prNumber:n.prNumber,runIds:n.runIds,worktreeIds:Array.isArray(t.worktreeIds)?t.worktreeIds.filter(e=>typeof e==`string`):[]}]:[]}):void 0}}function ne(e){let t=D(e);if(t.terminal||t.deliveryBlocked||t.implementationFailed||t.noChanges||e.decision===`building`||e.decision===`implementation_failed`)return null;if(e.branch||e.deliverySha)return e.branch&&/^[0-9a-f]{40,64}$/i.test(e.deliverySha??``)?e.branch:null;let n=e.units??[];if(n.length!==1)return null;let r=n[0];return!r.succeeded||r.implementationOutcome===`failed`||r.deliveryOutcome===`blocked`||r.deliveryOutcome===`no_changes`||r.changed===!1?null:r.branch&&/^[0-9a-f]{40,64}$/i.test(r.finalSha??``)?r.branch:null}function D(e){let t=e.units??[],n=t.length>0?t.filter(e=>e.implementationOutcome===`succeeded`||e.implementationOutcome==null&&e.succeeded).length:e.implementationOutcome===`failed`?0:e.ticketIds.length,r=t.length>0?t.filter(e=>e.implementationOutcome===`failed`||e.implementationOutcome==null&&!e.succeeded).length:e.implementationOutcome===`failed`?e.ticketIds.length:0,i=e.decision===`no_changes`||e.decision===`completed`||e.deliveryOutcome===`no_changes`||e.statusCode===`no_changes`,a=e.implementationOutcome===`partially_succeeded`||e.deliveryOutcome===`partial`||n>0&&r>0,o=t.length>0?t.filter(e=>e.deliveryOutcome===`ready`||e.deliveryOutcome===`delivered`||e.deliveryOutcome==null&&e.succeeded).length:a?0:n,s=a&&o===0,c=e.implementationOutcome===`failed`||e.implementationOutcome==null&&e.decision===`implementation_failed`,l=e.deliveryOutcome===`retryable_failure`,u=!c&&!l&&(s||e.deliveryOutcome===`blocked`||[`commit_failed`,`branch_verification_failed`,`settlement_interrupted`,`recovery_unavailable`,`status_failed`,`ref_mismatch`,`delivery_failed`].includes(e.statusCode??``)),d=e.isContinuation===!0,f=[...new Set((e.runIds??[]).filter(e=>typeof e==`string`&&e.length>0))],p=f.length===1?f[0]:null,m=p&&e.branch?t.filter(t=>t.runId===p&&t.branch===e.branch):[],h=[...new Set(m.map(e=>e.worktreePath).filter(e=>!!e))],g=(e.statusCode===`settlement_interrupted`||e.statusCode===`recovery_unavailable`)&&d?h:[...new Set(t.map(e=>e.worktreePath).filter(e=>!!e))],_=e.decision===`pr_failed`&&e.deliveryOutcome===`blocked`&&u&&d&&!!e.prUrl&&!!e.branch&&f.length===1&&m.length>0&&h.length<=1&&e.statusCode===`settlement_interrupted`&&(e.implementationOutcome===`succeeded`||e.implementationOutcome===`partially_succeeded`),v=e.decision===`pr_failed`&&e.deliveryOutcome===`blocked`&&u&&d&&e.statusCode===`recovery_unavailable`,y=v&&!!e.prUrl&&!!e.branch&&f.length===1&&m.length>0&&h.length<=1&&(e.implementationOutcome===`succeeded`||e.implementationOutcome===`partially_succeeded`),b=g.length>0||v&&!!e.deliverySha,x=!c&&l&&(e.statusCode===`push_failed`||d||!!e.prUrl),S=!c&&l&&!x,C=e.decision===`pr_closed`,w=e.decision===`superseded`;return{noChanges:i,partial:a,partialUndeliverable:s,implementationFailed:c,deliveryBlocked:u,retryablePush:x,retryablePrCreation:S,manualRecovery:_,recoveryUnavailable:v,recoveryRecheck:y,hasDiscardableRecoveryResult:b,continuation:d,localOnly:e.prState===`local-only`,closed:C,superseded:w,terminal:e.decision===`merged`||e.decision===`discarded`||e.decision===`completed`||w,succeededCount:n,deliverableCount:o,failedCount:r,totalCount:t.length>0?t.length:e.ticketIds.length,units:t,cleanupWarnings:e.cleanupWarnings??[],safetyArchives:e.safetyArchives??[],recoveryWorktreePaths:g}}var O={name:`send-horizontal`,size:24,node:[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]],aliases:[`send-horizonal`]};O.node;var re=a(O),k=e(t(),1),ie=`"\\/bfnrtu`;function A(e){return e===` `||e===` `||e===`\r`||e===`
|
|
2
2
|
`}function ae(e){let t=new Set,n=e.trim(),r=/^```[A-Za-z0-9_-]*[ \t]*\r?\n/.exec(n);r&&(n=n.slice(r[0].length),t.add(`nested_fence`));let i=/\r?\n[ \t]*```[ \t]*$/.exec(n);i&&(n=n.slice(0,i.index),t.add(`nested_fence`));let a=n.indexOf(`{`),o=n.lastIndexOf(`}`);a!==-1&&o>a&&(a>0||o<n.length-1)&&(n=n.slice(a,o+1),t.add(`trimmed_wrapper`));let s=``,c=!1;for(let e=0;e<n.length;e++){let r=n[e];if(c){if(r===`\\`){let i=n[e+1];if(i===void 0){t.add(`dangling_escape`);break}if(ie.includes(i)){s+=r+i,e+=1;continue}s+=i===`
|
|
3
3
|
`?`\\n`:i,e+=1,t.add(`invalid_escape`);continue}if(r===`"`){let i=e+1;for(;i<n.length&&A(n[i]);)i+=1;let a=n[i];if(a===void 0||a===`,`||a===`}`||a===`]`||a===`:`){c=!1,s+=r;continue}s+=`\\"`,t.add(`inner_quote`);continue}if(r===`
|
|
4
4
|
`){s+=`\\n`,t.add(`raw_newline`);continue}if(r===`\r`){t.add(`raw_newline`);continue}if(r===` `){s+=`\\t`,t.add(`raw_control`);continue}let i=r.charCodeAt(0);if(i<32){s+=`\\u`+i.toString(16).padStart(4,`0`),t.add(`raw_control`);continue}s+=r;continue}if(r===`"`){c=!0,s+=r;continue}if(r===`,`){let i=e+1;for(;i<n.length&&A(n[i]);)i+=1;if(n[i]===`}`||n[i]===`]`){t.add(`trailing_comma`);continue}s+=r;continue}if(r===`/`&&n[e+1]===`/`){let r=n.indexOf(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BbYvbtY8.js";import{n as t}from"./createLucideIcon-DtODIU64.js";import{r as n}from"./useDesktop-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BbYvbtY8.js";import{n as t}from"./createLucideIcon-DtODIU64.js";import{r as n}from"./useDesktop-BjLT0_EE.js";import{t as r}from"./project-repositories-Cnnuj9Ia.js";var i=e();function a({value:e,onChange:a,disabled:o=!1,repositories:s,workspaceOnly:c=!1,workspaceSelection:l,onWorkspaceChange:u,showSingle:d=!1,label:f,hint:p}){let{t:m}=t(`common`),{activeProjectId:h,projects:g}=n(),_=s??r(g.find(e=>e.id===h)),v=_.find(e=>e.isPrimary),y=e??(v?[v.id]:[]),b=y.some(e=>!_.some(t=>t.id===e));if(c){let e=_.filter(e=>y.includes(e.id)&&(e.workspacePaths?.length||e.workspacePath));return e.length?(0,i.jsxs)(`fieldset`,{className:`space-y-2`,disabled:o,children:[(0,i.jsx)(`legend`,{className:`text-xs font-medium`,children:m(`repositories.launchWorkspaces`)}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:m(`repositories.launchWorkspaceHint`)}),e.map(e=>{let t=e.workspacePaths??[e.workspacePath],n=l?.[e.id]??t;return(0,i.jsxs)(`div`,{className:`space-y-1`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium`,children:e.name}),t.map(t=>(0,i.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,title:t,children:[(0,i.jsx)(`input`,{type:`checkbox`,"data-agent-interactive":!0,checked:n.includes(t),disabled:o||n.length===1&&n[0]===t,onChange:r=>u?.({...Object.fromEntries(Object.entries(l??{}).filter(([e])=>y.includes(e))),[e.id]:r.target.checked?[...n,t]:n.filter(e=>e!==t)})}),(0,i.jsx)(`span`,{className:`break-all`,children:t})]},t))]},e.id)})]}):null}return!d&&_.length<=1&&!b?null:(0,i.jsxs)(`fieldset`,{className:`space-y-2`,disabled:o,children:[(0,i.jsx)(`legend`,{className:`mb-1 text-xs font-medium`,children:f??m(`repositories.specScope`)}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p??m(`repositories.scopeHint`)}),(0,i.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[_.map(e=>(0,i.jsxs)(`label`,{title:e.workspacePaths?.join(`
|
|
2
2
|
`)??e.workspacePath??e.path,className:`flex items-center gap-2 rounded border border-border px-2 py-1.5 text-xs`,children:[(0,i.jsx)(`input`,{type:`checkbox`,"data-agent-interactive":!0,checked:y.includes(e.id),"aria-label":e.available===!1?`${m(`repositories.unavailable`)}: ${e.name}`:void 0,disabled:o||(e.available===!1||e.kind===`folder`&&!e.isPrimary)&&!y.includes(e.id)||y.length===1&&y[0]===e.id,onChange:t=>a(t.target.checked?[...y,e.id]:y.filter(t=>t!==e.id))}),(0,i.jsx)(`span`,{children:e.name}),e.available===!1&&(0,i.jsxs)(`span`,{className:`text-destructive`,children:[` `,m(`repositories.unavailable`)]}),e.workspacePaths?.map(e=>(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:e},e)),!e.workspacePaths&&e.workspacePath&&(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:e.workspacePath}),e.kind===`folder`&&!e.isPrimary&&(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:m(`repositories.contextOnly`)})]},e.id)),y.filter(e=>!_.some(t=>t.id===e)).map(e=>(0,i.jsxs)(`label`,{className:`flex items-center gap-2 rounded border border-destructive px-2 py-1.5 text-xs`,children:[(0,i.jsx)(`input`,{type:`checkbox`,"data-agent-interactive":!0,checked:!0,disabled:o||y.length===1,onChange:()=>a(y.filter(t=>t!==e))}),m(`repositories.unavailable`),`: `,e]},e))]}),b&&(0,i.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:m(`repositories.invalidSelection`)})]})}export{a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{d as r,f as i,u as a}from"./chunk-OB3PAWPO-B1EMk45A.js";import{n as ee,t as o}from"./createLucideIcon-DtODIU64.js";import{a as s,r as te}from"./useDesktop-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{d as r,f as i,u as a}from"./chunk-OB3PAWPO-B1EMk45A.js";import{n as ee,t as o}from"./createLucideIcon-DtODIU64.js";import{a as s,r as te}from"./useDesktop-BjLT0_EE.js";import{H as ne,K as re,n as ie}from"./TicketDetailModalContext-Dkwo2cDs.js";import{C as ae,E as oe,b as se,r as ce,t as le,w as ue}from"./RepositoryDeliveries-B4ybHOyB.js";import{n as de}from"./save-LmPSfsvZ.js";import{t as fe}from"./ban-wqfdzoXt.js";import{n as pe}from"./chevron-up-6EFqEHBj.js";import{n as c}from"./file-text-C0blZHLh.js";import{t as l}from"./loader-circle-BqV9xYGf.js";import{t as u}from"./sparkles-CCfUdFGY.js";import{t as me}from"./triangle-alert-Cxpn8bqr.js";import{t as he}from"./utils-BC4DHlz2.js";import{n as d,t as f}from"./lib-DWJfei6y.js";import{Tt as ge,Xt as p,xt as m,y as _e}from"./index-IdGpV21X.js";var h={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};h.node;var ve=o(h),g={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};g.node;var _=o(g),v=e(t(),1),y=n();function b(e){return e.split(/\n{2,}/).map(e=>{if(e.includes(`
|
|
2
2
|
`))return e;let t=e.match(/(?:^|\s)(\d{1,2})\.\s+(?=\S)/g);return!t||t.length<3?e:e.replace(/\s+(\d{1,2})\.\s+(?=\S)/g,(e,t,n)=>n===0?e:`\n${t}. `)}).join(`
|
|
3
3
|
|
|
4
4
|
`)}function x({children:e,muted:t=!1,className:n}){let r=(0,v.useMemo)(()=>({a:({href:e,children:t})=>(0,y.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-accent-primary underline decoration-accent-primary/40 underline-offset-2 hover:decoration-accent-primary`,children:t}),img:()=>null,code:({className:e,children:t})=>e?(0,y.jsx)(`code`,{className:e,children:t}):(0,y.jsx)(`code`,{className:`rounded-md border border-border/50 bg-background-deep/60 px-1.5 py-px font-mono text-[0.85em] text-accent-info`,children:t})}),[]);return(0,y.jsx)(`div`,{"data-testid":`packet-markdown`,className:he(`prose prose-invert prose-sm max-w-none leading-relaxed`,`prose-p:my-1.5 prose-headings:mt-3 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold`,`prose-strong:text-foreground prose-ul:my-1.5 prose-ol:my-1.5 prose-li:my-0.5 prose-li:marker:text-accent-primary/70`,`prose-pre:my-2 prose-pre:rounded-lg prose-pre:border prose-pre:border-border/50 prose-pre:bg-background-deep/60 prose-pre:text-xs`,`prose-blockquote:border-accent-primary/40 prose-blockquote:text-muted-foreground prose-hr:border-border/50`,t?`text-muted-foreground`:`text-foreground/85`,n),children:(0,y.jsx)(d,{remarkPlugins:[f],skipHtml:!0,components:r,children:b(e)})})}var S=(e={})=>({verbs:[],acceptMeaning:null,fineControlOnly:!1,inFlight:!1,terminal:!1,requiresIrreversibleConfirm:!1,...e});function ye(e){let{decision:t,presentation:n,prUrl:r,canCreatePr:i}=e;if(t===`building`)return S({inFlight:!0});if(t===`merged`||t===`discarded`||n.superseded)return S({terminal:!0});if(n.manualRecovery||n.recoveryUnavailable||n.recoveryRecheck||n.retryablePush||n.retryablePrCreation||n.closed||n.deliveryBlocked&&!n.implementationFailed)return S({fineControlOnly:!0});if(n.noChanges)return S({verbs:[`accept`,`request-changes`],acceptMeaning:`mark-done`});if(n.implementationFailed)return S({verbs:n.succeededCount>0?[`request-changes`,`discard`]:[`discard`]});if(t===`pr_draft`)return S(r?{verbs:[`accept`,`request-changes`,`discard`],acceptMeaning:`publish`}:{fineControlOnly:!0});if(t===`pr_ready`)return S({verbs:[`request-changes`,`discard`]});if(t===`on_review`){let e=i?`create-pr`:`merge-local`;return S({verbs:[`accept`,`request-changes`,`discard`],acceptMeaning:e,requiresIrreversibleConfirm:e===`merge-local`})}return S({fineControlOnly:!0})}function be(e,t){if(e===`discard`)return`discard`;if(e===`request-changes`)return null;switch(t.acceptMeaning){case`create-pr`:return`create-pr`;case`publish`:return`publish`;case`merge-local`:return`merge-local`;case`mark-done`:return`acknowledge-no-changes`;default:return null}}var xe=[`app-verified`,`ai-reported`,`reviewer-score`],Se={"app-verified":m,"ai-reported":u,"reviewer-score":_},Ce={"app-verified":`text-accent-success border-accent-success/30 bg-accent-success/5`,"ai-reported":`text-accent-highlight border-accent-highlight/30 bg-accent-highlight/5`,"reviewer-score":`text-accent-info border-accent-info/30 bg-accent-info/5`};function C({item:e}){let{t}=ee(`packet`);return(0,y.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5`,children:[(0,y.jsx)(`span`,{className:`text-sm text-foreground`,children:t(e.code,{...e.values??{},defaultValue:e.code})}),e.rawExcerpt?(0,y.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded border border-border/60 bg-background-deep/60 p-2 text-[11px] leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:e.rawExcerpt}):null]})}function we(e){return e.implementationOutcome===`failed`?`failed`:e.deliveryOutcome===`no_changes`||e.implementationOutcome===`succeeded`&&e.changed===!1?`noChanges`:e.deliveryOutcome===`not_started`?`notStarted`:e.implementationOutcome===`succeeded`?`succeeded`:`unknown`}var w={resolved:`border-accent-success/40 bg-accent-success/10 text-accent-success`,partial:`border-accent-warning/40 bg-accent-warning/10 text-accent-warning`,blocked:`border-destructive/40 bg-destructive/10 text-destructive`,unreported:`border-border bg-background-deep/50 text-muted-foreground`},Te={succeeded:`border-accent-success/40 bg-accent-success/10 text-accent-success`,noChanges:`border-accent-info/40 bg-accent-info/10 text-accent-info`,failed:`border-destructive/40 bg-destructive/10 text-destructive`,notStarted:`border-border bg-background-deep/50 text-muted-foreground`,unknown:`border-border bg-background-deep/50 text-muted-foreground`};function T({title:e,children:t,defaultOpen:n=!1,badge:r}){let[i,a]=(0,v.useState)(n);return(0,y.jsxs)(`div`,{className:`rounded-lg border border-border/60 bg-surface/40`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 px-4 py-3 text-left`,"aria-expanded":i,children:[i?(0,y.jsx)(p,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,y.jsx)(c,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`flex-1 text-sm font-medium text-foreground`,children:e}),r]}),i?(0,y.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3`,children:t}):null]})}function E(e={}){let t=r(),n=e.prDeliveryId??t.prDeliveryId,{t:o}=ee([`packet`,`common`]),c=a(),[u,he]=i(),d=u.get(`repositoryId`),f=(0,v.useRef)(0),p=e.onClose??(()=>c(`/`)),{activeProjectId:m}=te(),h=ce(m),g=n?h.has(n):!1,{act:_,checkout:b}=_e(),{openTicketDetail:S}=ie(),E=JSON.stringify([m,n,d]),D=(0,v.useRef)({key:E,epoch:0});D.current.key!==E&&(D.current={key:E,epoch:D.current.epoch+1});let O=D.current.epoch,k=(0,v.useRef)(!0);(0,v.useEffect)(()=>(k.current=!0,()=>{k.current=!1}),[]);let A=(0,v.useCallback)(()=>k.current&&D.current.key===E&&D.current.epoch===O,[E,O]),[j,M]=(0,v.useState)(null),N=j?.key===E&&j.epoch===O?j:null,P=N?.data??null,F=N?.loading??!0,I=N?.error??null,[L,R]=(0,v.useState)(null),[Ee,z]=(0,v.useState)(!1),[B,V]=(0,v.useState)(null),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(!1),[De,K]=(0,v.useState)(null),[Oe,q]=(0,v.useState)(!1),J=(0,v.useCallback)(async()=>{if(!n||!m||!A())return;let e=++f.current,t=()=>A()&&f.current===e;M(e=>({key:E,epoch:O,data:e?.key===E&&e.epoch===O?e.data:null,loading:!0,error:null}));try{let e=d?`?repositoryId=${encodeURIComponent(d)}`:``,r=await fetch(`${s()}/rails/pr-deliveries/${n}/packet${e}`);if(!t())return;if(!r.ok){M({key:E,epoch:O,data:null,loading:!1,error:r.status===404?`notFound`:`loadFailed`});return}let i=await r.json();if(!t())return;M({key:E,epoch:O,data:i,loading:!1,error:null})}catch{if(!t())return;M({key:E,epoch:O,data:null,loading:!1,error:`loadFailed`})}},[n,m,d,E,O,A]);(0,v.useEffect)(()=>(J(),z(!1),q(!1),R(null),V(null),K(null),G(!1),U(``),()=>{f.current++}),[J]);let Y=(0,v.useMemo)(()=>ue(P?.snapshot),[P?.snapshot]),X=P?.packet??null,Z=F||L!==null||W||!!Y?.operation,ke=P?.acceptCapability??null,Q=(0,v.useMemo)(()=>{if(!X)return null;let e=oe({decision:X.decision,ticketIds:X.ticketIds,prState:X.prUrl?`pr-created`:`none`,statusCode:X.statusCode,prUrl:X.prUrl,runIds:X.runIds});return ye({decision:X.decision,presentation:e,prUrl:X.prUrl,canCreatePr:ke?.target===`create-pr`})},[X,ke]),$=(0,v.useCallback)(async e=>{if(!X||!Q||Z||!A())return;let t=be(e,Q);if(t){V(null),R(e);try{let e=await(d&&Y?_(Y.railIndex,t,Y.decision,Y.prDeliveryId,d):_(X.railIndex,t,X.decision,X.prDeliveryId));if(!A())return;e.ok?m&&se(m):V(e.status===409&&e.error===`stale_decision`?`alreadyResolved`:`actionFailed`),await J()}finally{A()&&(R(null),z(!1))}}},[_,m,J,X,Q,Y,d,Z,A]),Ae=(0,v.useCallback)(async()=>{if(!(!X||!H.trim()||!m||Z||!A())){K(null),G(!0);try{let t=await fetch(`${s()}/rails/${X.railIndex}/launch`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({loopId:`factory:sdd-quick-openspec`,revisionOfDeliveryId:Y?.prDeliveryId??X.prDeliveryId,revisionNote:H.trim(),...Y?.executionManifest?{repositoryIds:Y.executionManifest.selectedRepositoryIds}:{}})});if(!A())return;if(!t.ok){let e=await t.json().catch(()=>null);if(!A())return;K(e?.error===`invalid_revision_target`?`revisionStale`:`revisionFailed`);return}U(``),q(!1);let r=await t.json().catch(()=>null);if(!A())return;r?.prDeliveryId&&r.prDeliveryId!==n?e.onClose?e.onClose():c(`/review/${encodeURIComponent(r.prDeliveryId)}`):await J()}catch{A()&&K(`revisionFailed`)}finally{A()&&G(!1)}}},[m,J,X,H,Y,Z,A,n,e.onClose,c]);if(F&&!X)return(0,y.jsxs)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:[(0,y.jsx)(l,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}),o(`common:states.loading`)]});if(I||!X||!Q)return(0,y.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col items-center gap-4 p-10 text-center`,children:[(0,y.jsx)(me,{className:`size-6 text-accent-warning`,"aria-hidden":!0}),(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(I===`notFound`?`error.notFound`:`error.loadFailed`)}),(0,y.jsx)(`button`,{type:`button`,onClick:p,className:`rounded-md border border-border px-3 py-1.5 text-sm text-foreground hover:bg-surface`,children:o(`backToBoard`)})]});let je=xe.map(e=>({tier:e,items:X.proof.filter(t=>t.tier===e)})).filter(e=>e.items.length>0),Me=X.cost.totalUsd===null?`—`:`${X.cost.estimated?`~`:``}$${X.cost.totalUsd.toFixed(2)}`;return(0,y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-4 p-6`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:p,className:`flex w-fit items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,y.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),o(`backToBoard`)]}),Y?.repositoryDeliveries?.length?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[o(`common:repositories.select`),(0,y.jsxs)(`select`,{value:d??``,onChange:e=>{let t=new URLSearchParams(u);e.target.value?t.set(`repositoryId`,e.target.value):t.delete(`repositoryId`),he(t,{replace:!0})},className:`rounded border border-border bg-background px-2 py-1`,children:[(0,y.jsx)(`option`,{value:``,children:o(`common:repositories.all`)}),Y.repositoryDeliveries.map(e=>(0,y.jsx)(`option`,{value:e.repositoryId,children:e.name},e.repositoryId))]})]}),(0,y.jsx)(le,{deliveryId:Y.prDeliveryId,repositories:Y.repositoryDeliveries,busy:Z,onAct:async(e,t)=>{if(!(Z||!A())){R(`accept`);try{let n=await _(Y.railIndex,e,Y.decision,Y.prDeliveryId,t);if(!A())return;n.ok||V(`actionFailed`),await J()}finally{A()&&R(null)}}},onCheckout:async e=>{if(!(Z||!A())){R(`accept`);try{let t=await b(Y.railIndex,Y.prDeliveryId,e);if(!A())return;t.ok||V(`actionFailed`),await J()}finally{A()&&R(null)}}}})]}):null,(0,y.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-surface/60 p-5 shadow-sm`,children:[(0,y.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:o(X.headlineCode,{count:X.totalCount,succeeded:X.succeededCount,total:X.totalCount,defaultValue:X.headlineCode})}),(0,y.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs`,children:[X.confidence?.overall!==null&&X.confidence?.overall!==void 0?(0,y.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-accent-info/30 bg-accent-info/10 px-2 py-0.5 text-accent-info`,title:o(`confidence.tooltip`),children:o(`confidence.pill`,{overall:X.confidence.overall})}):(0,y.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border bg-background-deep/50 px-2 py-0.5 text-muted-foreground`,children:o(`confidence.unavailable`)}),(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,y.jsx)(ve,{className:`size-3.5`,"aria-hidden":!0}),o(`cost.thisBuild`,{amount:Me})]}),X.prUrl?(0,y.jsxs)(`a`,{href:X.prUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-info hover:underline`,children:[(0,y.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),o(`openPr`,{number:X.prNumber??``})]}):null]}),Q.fineControlOnly?(0,y.jsx)(`p`,{className:`mt-4 rounded-md border border-accent-warning/30 bg-accent-warning/5 px-3 py-2 text-xs text-accent-warning`,children:o(`fineControlOnly`)}):Q.inFlight?(0,y.jsxs)(`p`,{className:`mt-4 flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,y.jsx)(l,{className:`size-4 animate-spin`,"aria-hidden":!0}),o(`stillWorking`)]}):Q.terminal?(0,y.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:o(`alreadyResolved`)}):(0,y.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[Q.verbs.includes(`accept`)&&(!Y?.repositoryDeliveries?.length||d)?Ee?(0,y.jsxs)(`div`,{className:`flex w-full flex-col gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3`,children:[(0,y.jsx)(`p`,{className:`text-xs text-foreground`,children:o(`accept.irreversibleWarning`)}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>void $(`accept`),disabled:Z,className:`rounded-md bg-destructive px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50`,"data-testid":`packet-accept-confirm`,children:o(`accept.irreversibleConfirm`)}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>z(!1),className:`rounded-md border border-border px-3 py-1.5 text-sm text-foreground`,children:o(`common:actions.cancel`)})]})]}):(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{Q.requiresIrreversibleConfirm?z(!0):$(`accept`)},disabled:Z,className:`inline-flex items-center gap-1.5 rounded-md bg-accent-success px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50`,"data-testid":`packet-accept`,children:[L===`accept`?(0,y.jsx)(l,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,y.jsx)(pe,{className:`size-4`,"aria-hidden":!0}),o(`accept.${Q.acceptMeaning??`generic`}`)]}):null,Q.verbs.includes(`request-changes`)?(0,y.jsxs)(`button`,{type:`button`,onClick:()=>q(e=>!e),disabled:Z||W,"aria-expanded":Oe,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm text-foreground hover:bg-surface disabled:opacity-50`,"data-testid":`packet-request-changes`,children:[(0,y.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),o(`requestChanges.label`)]}):null,Q.verbs.includes(`discard`)?(0,y.jsxs)(`button`,{type:`button`,onClick:()=>void $(`discard`),disabled:Z,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm text-foreground hover:bg-surface disabled:opacity-50`,"data-testid":`packet-discard`,children:[L===`discard`?(0,y.jsx)(l,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,y.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),o(`discard.label`)]}):null]}),g&&Q.verbs.includes(`discard`)?(0,y.jsx)(`p`,{className:`mt-3 rounded-md border border-accent-warning/40 bg-accent-warning/10 px-3 py-2 text-xs text-accent-warning`,"data-testid":`packet-discard-stacked-note`,children:o(`discard.stackedNote`)}):null,B?(0,y.jsx)(`p`,{className:`mt-3 text-xs text-accent-warning`,children:o(`error.${B}`)}):null,Oe?(0,y.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 rounded-md border border-border/70 bg-background-deep/40 p-3`,children:[(0,y.jsx)(`label`,{htmlFor:`packet-revision-note`,className:`text-xs font-medium text-foreground`,children:o(`requestChanges.prompt`)}),(0,y.jsx)(`textarea`,{id:`packet-revision-note`,value:H,onChange:e=>U(e.target.value),rows:2,placeholder:o(`requestChanges.placeholder`),className:`resize-y rounded-md border border-border bg-surface px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground`,"data-testid":`packet-revision-input`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>void Ae(),disabled:Z||H.trim().length===0,className:`inline-flex items-center gap-1.5 rounded-md bg-accent-primary px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50`,"data-testid":`packet-revision-submit`,children:[W?(0,y.jsx)(l,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,y.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),o(`requestChanges.submit`)]}),(0,y.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:o(`requestChanges.hint`)})]}),De?(0,y.jsx)(`p`,{className:`text-xs text-accent-warning`,children:o(`error.${De}`)}):null]}):null]}),X.driftNudges.length>0?(0,y.jsxs)(`div`,{className:`rounded-lg border border-accent-highlight/30 bg-accent-highlight/5 p-4`,"data-testid":`packet-drift-nudges`,children:[(0,y.jsx)(`h2`,{className:`mb-1 text-sm font-medium text-accent-highlight`,children:o(`drift.title`)}),(0,y.jsx)(`ul`,{className:`space-y-1 text-xs text-foreground`,children:X.driftNudges.map(e=>(0,y.jsx)(`li`,{children:o(e.code,{...e.values,defaultValue:e.code})},e.code))}),(0,y.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:o(`drift.advisory`)})]}):null,X.versions.length>1?(0,y.jsxs)(T,{title:o(`versions.title`,{count:X.versions.length}),badge:(0,y.jsx)(ge,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),children:[(0,y.jsx)(`ol`,{className:`space-y-2`,"data-testid":`packet-versions`,children:X.versions.map(e=>(0,y.jsxs)(`li`,{className:`flex flex-col gap-0.5 text-sm`,children:[(0,y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:e.current?`font-medium text-foreground`:`text-muted-foreground`,children:o(`versions.label`,{version:e.version})}),e.current?(0,y.jsx)(`span`,{className:`rounded-full border border-accent-primary/40 bg-accent-primary/10 px-1.5 text-[10px] text-accent-primary`,children:o(`versions.current`)}):null,(0,y.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.costUsd===null?`—`:`${e.costEstimated?`~`:``}$${e.costUsd.toFixed(2)}`})]}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.revisionNote??o(`versions.originalBuild`)})]},e.prDeliveryId))}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:o(`cost.allVersions`,{amount:X.chainCostUsd===null?`—`:`${X.chainCostEstimated?`~`:``}$${X.chainCostUsd.toFixed(2)}`})})]}):null,X.watchOut.length>0?(0,y.jsxs)(`div`,{className:`rounded-lg border border-accent-warning/30 bg-accent-warning/5 p-4`,children:[(0,y.jsxs)(`h2`,{className:`mb-2 flex items-center gap-1.5 text-sm font-medium text-accent-warning`,children:[(0,y.jsx)(me,{className:`size-4`,"aria-hidden":!0}),o(`watchOut.title`)]}),(0,y.jsx)(`ul`,{className:`space-y-1`,children:X.watchOut.map((e,t)=>(0,y.jsx)(C,{item:e},`${e.code}-${t}`))})]}):null,(0,y.jsx)(T,{title:o(`sections.whatYouAsked`),defaultOpen:!0,children:(0,y.jsx)(`ul`,{className:`space-y-3`,children:X.sections.map(e=>(0,y.jsxs)(`li`,{className:`text-sm`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>S(e.ticketId),className:`text-accent-primary hover:underline`,children:[`#`,e.ticketId,` `,e.title??``]}),e.problem?(0,y.jsx)(x,{muted:!0,className:`mt-1`,children:e.problem}):null]},e.ticketId))})}),X.followUp&&(0,y.jsxs)(T,{title:o(`followUp.title`,{count:X.followUp.comments.length}),defaultOpen:!0,children:[(0,y.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:o(`followUp.caveat`)}),(0,y.jsx)(`ul`,{className:`space-y-3`,"data-testid":`packet-follow-up`,children:X.followUp.comments.map(e=>{let t=X.followUpReport?.find(t=>t.commentId===e.id)??null,n=t?t.verdict:`unreported`;return(0,y.jsxs)(`li`,{className:`rounded-md border border-border/50 bg-background-deep/30 px-3 py-2 text-sm`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`rounded bg-surface/70 px-1 font-mono text-[10px] text-muted-foreground`,children:e.id}),e.path?(0,y.jsxs)(`span`,{className:`font-mono text-xs text-accent-info`,children:[e.path,e.line?`:${e.line}`:``]}):null,(0,y.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${w[n]}`,"data-testid":`packet-follow-up-verdict`,children:o(`followUp.verdict.${n}`)}),(0,y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[o(`followUp.source.${e.source===`github`?`github`:`pasted`}`),e.author?` · ${e.author}`:``]})]}),(0,y.jsx)(x,{muted:!0,className:`mt-1`,children:e.body}),t?(0,y.jsxs)(`dl`,{className:`mt-1 grid gap-x-3 gap-y-0.5 text-xs text-muted-foreground sm:grid-cols-[auto_1fr]`,children:[t.files?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`dt`,{className:`font-medium`,children:o(`followUp.files`)}),(0,y.jsx)(`dd`,{className:`font-mono`,children:t.files})]}):null,t.tests?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`dt`,{className:`font-medium`,children:o(`followUp.tests`)}),(0,y.jsx)(`dd`,{children:t.tests})]}):null,t.notes?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`dt`,{className:`font-medium`,children:o(`followUp.notes`)}),(0,y.jsx)(`dd`,{children:t.notes})]}):null]}):(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(`followUp.noReport`)})]},e.id)})}),X.followUp.scope.excludedChanges.length>0&&(0,y.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,y.jsxs)(`span`,{className:`font-medium`,children:[o(`followUp.excluded`),`:`]}),` `,X.followUp.scope.excludedChanges.join(` · `)]})]}),X.specAddenda&&X.specAddenda.length>0&&(0,y.jsxs)(T,{title:o(`addenda.title`,{count:X.specAddenda.length}),defaultOpen:!0,children:[(0,y.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:o(`addenda.caveat`)}),(0,y.jsx)(`ul`,{className:`space-y-2`,"data-testid":`packet-addenda`,children:X.specAddenda.map(e=>{let t=X.specAddendaReport?.find(t=>t.addendumId===e.id)??null,n=t?t.verdict:`unreported`,r=n===`applied`?w.resolved:w[n];return(0,y.jsxs)(`li`,{className:`rounded-md border border-border/50 bg-background-deep/30 px-3 py-2 text-sm`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsxs)(`span`,{className:`font-mono text-xs text-accent-primary`,children:[`#`,e.ticketId]}),(0,y.jsx)(`span`,{className:`rounded-full border border-border/50 px-1.5 py-px text-[10px] text-muted-foreground`,children:o(`addenda.kind.${e.kind}`)}),(0,y.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,y.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${r}`,"data-testid":`packet-addenda-verdict`,children:o(`addenda.verdict.${n}`)})]}),t?(0,y.jsxs)(`dl`,{className:`mt-1 grid gap-x-3 gap-y-0.5 text-xs text-muted-foreground sm:grid-cols-[auto_1fr]`,children:[t.files?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`dt`,{className:`font-medium`,children:o(`followUp.files`)}),(0,y.jsx)(`dd`,{className:`font-mono`,children:t.files})]}):null,t.tests?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`dt`,{className:`font-medium`,children:o(`followUp.tests`)}),(0,y.jsx)(`dd`,{children:t.tests})]}):null,t.notes?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`dt`,{className:`font-medium`,children:o(`followUp.notes`)}),(0,y.jsx)(`dd`,{children:t.notes})]}):null]}):(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(`addenda.noReport`)})]},e.id)})})]}),(0,y.jsx)(T,{title:o(`sections.whatIDid`),children:(0,y.jsx)(`ul`,{className:`space-y-3`,children:X.sections.map(e=>(0,y.jsxs)(`li`,{className:`text-sm`,"data-testid":`packet-done-${e.ticketId}`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`#`,e.ticketId]}),e.title?(0,y.jsx)(`span`,{className:`text-foreground/80`,children:e.title}):null,(()=>{let t=we(e);return(0,y.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${Te[t]}`,"data-testid":`packet-outcome-pill`,children:o(`outcome.${t}`)})})()]}),e.churn?(0,y.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[o(`churn.line`,{files:e.churn.filesTouched,added:e.churn.addedLines,removed:e.churn.removedLines}),` · `,e.churn.testFilesTouched.length>0?o(`churn.testFiles`,{count:e.churn.testFilesTouched.length}):o(`churn.noTestFiles`)]}):(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(`churn.batchNotSplittable`)}),e.solution?(0,y.jsxs)(`details`,{className:`group mt-2 rounded-md border border-border/50 bg-background-deep/30 px-3 py-2`,children:[(0,y.jsx)(`summary`,{className:`cursor-pointer select-none text-xs font-medium text-muted-foreground group-open:text-foreground/80`,children:o(`planned.title`)}),(0,y.jsx)(`p`,{className:`mt-1 text-[11px] italic text-muted-foreground/80`,children:o(`planned.caveat`)}),(0,y.jsx)(x,{className:`mt-2`,children:e.solutionOverflow??e.solution})]}):(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(`noSolutionRecorded`)})]},e.ticketId))})}),(0,y.jsx)(T,{title:o(`sections.howItWasChecked`),badge:X.evidenceUnavailable?(0,y.jsx)(`span`,{className:`rounded-full border border-border bg-background-deep/50 px-2 py-0.5 text-[10px] text-muted-foreground`,children:o(`proof.evidenceUnavailable`)}):void 0,children:(0,y.jsx)(`div`,{className:`space-y-4`,children:je.map(({tier:e,items:t})=>{let n=Se[e];return(0,y.jsxs)(`div`,{className:`rounded-md border px-3 py-2 ${Ce[e]}`,children:[(0,y.jsxs)(`h3`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium`,children:[(0,y.jsx)(n,{className:`size-3.5`,"aria-hidden":!0}),o(`tier.${e}.title`)]}),(0,y.jsx)(`p`,{className:`mb-2 text-[11px] opacity-80`,children:o(`tier.${e}.caveat`)}),(0,y.jsx)(`ul`,{className:`space-y-1`,children:t.map((e,t)=>(0,y.jsx)(C,{item:e},`${e.code}-${t}`))})]},e)})})})]})}export{E as default};
|
package/client/dist/assets/{TemplatePreviewModal-BZTV1TM1.js → TemplatePreviewModal-CTBZUXAN.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BbYvbtY8.js";import{n as t}from"./createLucideIcon-DtODIU64.js";import{t as n}from"./download-C9wP_42h.js";import{t as r}from"./git-branch-yf6LE1Bw.js";import{n as i,t as a}from"./square-D0JTbRSR.js";import{a as o,i as s,l as c,o as l,r as u,t as d}from"./dialog-DtdR05v1.js";import{t as f}from"./button-4FS1ZDTp.js";import{$t as p,_t as m,rt as h}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BbYvbtY8.js";import{n as t}from"./createLucideIcon-DtODIU64.js";import{t as n}from"./download-C9wP_42h.js";import{t as r}from"./git-branch-yf6LE1Bw.js";import{n as i,t as a}from"./square-D0JTbRSR.js";import{a as o,i as s,l as c,o as l,r as u,t as d}from"./dialog-DtdR05v1.js";import{t as f}from"./button-4FS1ZDTp.js";import{$t as p,_t as m,rt as h}from"./index-IdGpV21X.js";var g=e(),_={core:p,start:i,"ai-step":p,shell:m,decider:r,condition:r,end:a};function v(e){if(e.type===`core`){let t=e.data?.params;return t?String(t.text??t.prompt??t.goal??t.expr??t.question??t.message??t.ref??t.body??t.outcome??JSON.stringify(t,null,2)):null}return e.type===`ai-step`?typeof e.data?.prompt==`string`?e.data.prompt:null:e.type===`shell`?typeof e.data?.command==`string`?e.data.command:null:e.type===`decider`?typeof e.data?.goal==`string`?e.data.goal:null:e.type===`end`?e.data?.outcome===`failure`?`failure`:`success`:null}function y({template:e,onClose:r,onUse:i}){let{t:m}=t(`loops`);return(0,g.jsx)(d,{open:e!==null,onOpenChange:e=>{e||r()},children:(0,g.jsx)(u,{movableResizable:!0,className:`max-w-lg`,children:e&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(l,{children:[(0,g.jsxs)(c,{className:`flex items-center gap-2`,children:[(0,g.jsx)(p,{className:`w-4 h-4 text-accent-highlight`}),e.name]}),(0,g.jsx)(s,{children:e.description})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[h(e.graph)?(0,g.jsx)(`span`,{title:m(`gallery.needsSpecHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-secondary/15 text-accent-secondary`,children:m(`gallery.needsSpec`)}):(0,g.jsx)(`span`,{title:m(`gallery.standaloneHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-success/15 text-accent-success`,children:m(`gallery.standalone`)}),e.category&&(0,g.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-info/15 text-accent-info`,children:m(`categories.${e.category}`,{defaultValue:e.category})}),e.tags.map(e=>(0,g.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))]}),(0,g.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.graph.config.timeoutMinutes>0?m(`preview.limits`,{iterations:e.graph.config.maxIterations,timeout:e.graph.config.timeoutMinutes}):m(`preview.limitsNoTimeout`,{iterations:e.graph.config.maxIterations})}),(0,g.jsxs)(`div`,{className:`max-h-[50vh] overflow-y-auto space-y-1.5 pr-1`,children:[(0,g.jsx)(`span`,{className:`block text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m(`preview.steps`)}),e.graph.nodes.map((e,t)=>{let n=_[e.type]??a,r=v(e);return(0,g.jsxs)(`div`,{className:`rounded border border-border bg-surface/30 p-2`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,g.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,g.jsx)(n,{className:`w-3.5 h-3.5 text-accent-primary`}),m(e.type===`core`?`builder.core.pieces.${e.data?.kind}`:`builder.nodes.${e.type}`)]}),r&&(0,g.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground font-mono`,children:r})]},e.id)})]}),(0,g.jsxs)(o,{children:[(0,g.jsx)(f,{variant:`ghost`,onClick:r,children:m(`common:actions.cancel`)}),(0,g.jsxs)(f,{onClick:()=>i(e.id),children:[(0,g.jsx)(n,{className:`w-3.5 h-3.5 mr-1.5`}),m(`actions.use`)]})]})]})})})}export{y as n,v as r,_ as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-B3mKBIh5.js","assets/rolldown-runtime-CNC7AqOf.js","assets/event-Bt7f3wXe.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{t as r}from"./react-dom-DDD8FYaU.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{u as a}from"./chunk-OB3PAWPO-B1EMk45A.js";import{n as o,t as s}from"./tauri-shell-DE6LfGPw.js";import{D as c,E as l,a as u,h as d,l as f,m as p,r as m,w as h,x as g}from"./useSharedWebSocket-CcsE5986.js";import{t as _}from"./Trans-ZiXIfj50.js";import{n as v,t as y}from"./createLucideIcon-DtODIU64.js";import{a as b,r as x,s as S}from"./useDesktop-C0mRIlHT.js";import{a as C}from"./provider-capabilities-lePfeT_Y.js";import{n as w,t as T}from"./save-LmPSfsvZ.js";import{n as E,r as D}from"./spending-eWiZGhC_.js";import{c as O,n as k}from"./MinimizedChatsContext-BHIUPVmC.js";import{t as A}from"./ban-wqfdzoXt.js";import{n as j}from"./chevron-up-6EFqEHBj.js";import{t as M}from"./file-text-C0blZHLh.js";import{t as ee}from"./circle-x-D2ttKotB.js";import{t as N}from"./download-C9wP_42h.js";import{t as P}from"./external-link-CZ6Q-v1-.js";import{t as F}from"./git-branch-yf6LE1Bw.js";import{t as I}from"./layers-BCLTgHXO.js";import{t as te}from"./loader-circle-BqV9xYGf.js";import{t as L}from"./pencil-CxrRbDwb.js";import{n as R,t as z}from"./square-D0JTbRSR.js";import{t as ne}from"./plus-fHDdjBk1.js";import{t as B}from"./rotate-ccw-DalJAQQX.js";import{t as re}from"./search-BDVp3fkH.js";import{t as ie}from"./trash-D8zYUmTg.js";import{t as V}from"./triangle-alert-Cxpn8bqr.js";import{n as ae,t as oe}from"./jira-api-C_D_RDhl.js";import{t as se}from"./x-Bu7X_eR2.js";import{t as ce}from"./zap-bugHyWzQ.js";import{F as le,I as ue,P as de,a as fe,i as pe,l as me,o as he,r as ge,t as _e}from"./dialog-DtdR05v1.js";import{t as H}from"./utils-BC4DHlz2.js";import{n as U,t as ve}from"./lib-DWJfei6y.js";import{t as ye}from"./formatDistanceToNow-CdN5lTyD.js";import{t as W}from"./button-4FS1ZDTp.js";import{t as be}from"./RepositoryScopeSelector-DeCoUsRN.js";function xe(e=``){return e||(typeof window<`u`&&(`__TAURI_INTERNALS__`in window||window.location.hostname===`tauri.localhost`)||typeof window<`u`&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`ws://127.0.0.1:4200`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`)}var Se=xe(),Ce=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_TERMINAL_PANEL;return typeof e!=`string`||e!==`false`})(),we=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENTS_SECTION;return typeof e!=`string`||e!==`false`})(),Te=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_CODE_EXPLORER;return typeof e!=`string`||e!==`false`})(),Ee=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_JIRA;return typeof e!=`string`||e!==`false`})(),De=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MCP;return typeof e!=`string`||e!==`false`})(),Oe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_CHAT;return typeof e!=`string`||e!==`false`})(),ke=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_MODE;return Oe&&(typeof e!=`string`||e!==`false`)})();(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_INTERACTIVE_JOBS;return typeof e!=`string`||e!==`false`})();var Ae=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOOPS_SECTION;return typeof e!=`string`||e!==`false`})(),je=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NATIVE_BROWSER;return typeof e!=`string`||e!==`false`})(),Me=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_PROJECT_BUILDER;return typeof e!=`string`||e!==`false`})(),Ne=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_REVIEW_PACKET;return typeof e!=`string`||e!==`false`})(),Pe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NARRATED_PROGRESS;return typeof e!=`string`||e!==`false`})(),Fe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOCAL_ENGINES;return typeof e!=`string`||e!==`false`})();function Ie(){return Fe}var Le=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MISSION_RAIL_CARDS;return typeof e!=`string`||e!==`false`})(),Re={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Re.node;var ze=y(Re),Be={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Be.node;var Ve=y(Be),G={name:`circle-arrow-right`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m12 16 4-4-4-4`,key:`1i9zcv`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`arrow-right-circle`]};G.node;var He=y(G),Ue={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Ue.node;var We=y(Ue),Ge={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ge.node;var Ke=y(Ge),qe={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};qe.node;var Je=y(qe),Ye={name:`droplet`,size:24,node:[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]};Ye.node;var Xe=y(Ye),Ze={name:`file-minus-corner`,size:24,node:[[`path`,{d:`M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12`,key:`l9p8hp`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]],aliases:[`file-minus-2`]};Ze.node;var Qe=y(Ze),$e={name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]};$e.node;var et=y($e),tt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};tt.node;var K=y(tt),nt={name:`git-pull-request-arrow`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]};nt.node;var rt=y(nt),it={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};it.node;var at=y(it),q={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};q.node;var ot=y(q),st={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};st.node;var ct=y(st),lt={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};lt.node;var ut=y(lt),dt={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};dt.node;var ft=y(dt),pt={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};pt.node;var mt=y(pt),ht={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};ht.node;var gt=y(ht),_t={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};_t.node;var vt=y(_t),yt={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};yt.node;var bt=y(yt),xt={name:`split`,size:24,node:[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]};xt.node;var St=y(xt),Ct={name:`ticket`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]};Ct.node;var wt=y(Ct),Tt={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Tt.node;var Et=y(Tt),Dt={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Dt.node;var Ot=y(Dt),kt={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};kt.node;var At=y(kt),jt={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};jt.node;var Mt=y(jt),Nt=new Map,Pt=2e3;function Ft(e){Nt.set(e,(Nt.get(e)??0)+1)}function It(e){(Nt.get(e)??0)<=0||setTimeout(()=>{let t=(Nt.get(e)??0)-1;t<=0?Nt.delete(e):Nt.set(e,t)},Pt)}function Lt(e){return e?(Nt.get(e)??0)>0:!1}var J=e(t(),1),Rt=3e3,zt=`
|
|
2
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-BbYvbtY8.js";import{t as r}from"./react-dom-DDD8FYaU.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{u as a}from"./chunk-OB3PAWPO-B1EMk45A.js";import{n as o,t as s}from"./tauri-shell-DE6LfGPw.js";import{D as c,E as l,a as u,h as d,l as f,m as p,r as m,w as h,x as g}from"./useSharedWebSocket-Bj4LMp7b.js";import{t as _}from"./Trans-BbFxRFtR.js";import{n as v,t as y}from"./createLucideIcon-DtODIU64.js";import{a as b,r as x,s as S}from"./useDesktop-BjLT0_EE.js";import{a as C}from"./provider-capabilities-lePfeT_Y.js";import{n as w,t as T}from"./save-LmPSfsvZ.js";import{n as E,r as D}from"./spending-CQnrWiR3.js";import{c as O,n as k}from"./MinimizedChatsContext-DHfigjHS.js";import{t as A}from"./ban-wqfdzoXt.js";import{n as j}from"./chevron-up-6EFqEHBj.js";import{t as M}from"./file-text-C0blZHLh.js";import{t as ee}from"./circle-x-D2ttKotB.js";import{t as N}from"./download-C9wP_42h.js";import{t as P}from"./external-link-CZ6Q-v1-.js";import{t as F}from"./git-branch-yf6LE1Bw.js";import{t as I}from"./layers-BCLTgHXO.js";import{t as te}from"./loader-circle-BqV9xYGf.js";import{t as L}from"./pencil-CxrRbDwb.js";import{n as R,t as z}from"./square-D0JTbRSR.js";import{t as ne}from"./plus-fHDdjBk1.js";import{t as B}from"./rotate-ccw-DalJAQQX.js";import{t as re}from"./search-BDVp3fkH.js";import{t as ie}from"./trash-D8zYUmTg.js";import{t as V}from"./triangle-alert-Cxpn8bqr.js";import{n as ae,t as oe}from"./jira-api-Cabj-H0J.js";import{t as se}from"./x-Bu7X_eR2.js";import{t as ce}from"./zap-bugHyWzQ.js";import{F as le,I as ue,P as de,a as fe,i as pe,l as me,o as he,r as ge,t as _e}from"./dialog-DtdR05v1.js";import{t as H}from"./utils-BC4DHlz2.js";import{n as U,t as ve}from"./lib-DWJfei6y.js";import{t as ye}from"./formatDistanceToNow-NjPHBLfB.js";import{t as W}from"./button-4FS1ZDTp.js";import{t as be}from"./RepositoryScopeSelector-2eSqR9WK.js";function xe(e=``){return e||(typeof window<`u`&&(`__TAURI_INTERNALS__`in window||window.location.hostname===`tauri.localhost`)||typeof window<`u`&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`ws://127.0.0.1:4200`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`)}var Se=xe(),Ce=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_TERMINAL_PANEL;return typeof e!=`string`||e!==`false`})(),we=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENTS_SECTION;return typeof e!=`string`||e!==`false`})(),Te=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_CODE_EXPLORER;return typeof e!=`string`||e!==`false`})(),Ee=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_JIRA;return typeof e!=`string`||e!==`false`})(),De=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MCP;return typeof e!=`string`||e!==`false`})(),Oe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_CHAT;return typeof e!=`string`||e!==`false`})(),ke=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_MODE;return Oe&&(typeof e!=`string`||e!==`false`)})();(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_INTERACTIVE_JOBS;return typeof e!=`string`||e!==`false`})();var Ae=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOOPS_SECTION;return typeof e!=`string`||e!==`false`})(),je=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NATIVE_BROWSER;return typeof e!=`string`||e!==`false`})(),Me=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_PROJECT_BUILDER;return typeof e!=`string`||e!==`false`})(),Ne=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_REVIEW_PACKET;return typeof e!=`string`||e!==`false`})(),Pe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NARRATED_PROGRESS;return typeof e!=`string`||e!==`false`})(),Fe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOCAL_ENGINES;return typeof e!=`string`||e!==`false`})();function Ie(){return Fe}var Le=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MISSION_RAIL_CARDS;return typeof e!=`string`||e!==`false`})(),Re={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Re.node;var ze=y(Re),Be={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Be.node;var Ve=y(Be),G={name:`circle-arrow-right`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m12 16 4-4-4-4`,key:`1i9zcv`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`arrow-right-circle`]};G.node;var He=y(G),Ue={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Ue.node;var We=y(Ue),Ge={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ge.node;var Ke=y(Ge),qe={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};qe.node;var Je=y(qe),Ye={name:`droplet`,size:24,node:[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]};Ye.node;var Xe=y(Ye),Ze={name:`file-minus-corner`,size:24,node:[[`path`,{d:`M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12`,key:`l9p8hp`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]],aliases:[`file-minus-2`]};Ze.node;var Qe=y(Ze),$e={name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]};$e.node;var et=y($e),tt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};tt.node;var K=y(tt),nt={name:`git-pull-request-arrow`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]};nt.node;var rt=y(nt),it={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};it.node;var at=y(it),q={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};q.node;var ot=y(q),st={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};st.node;var ct=y(st),lt={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};lt.node;var ut=y(lt),dt={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};dt.node;var ft=y(dt),pt={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};pt.node;var mt=y(pt),ht={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};ht.node;var gt=y(ht),_t={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};_t.node;var vt=y(_t),yt={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};yt.node;var bt=y(yt),xt={name:`split`,size:24,node:[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]};xt.node;var St=y(xt),Ct={name:`ticket`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]};Ct.node;var wt=y(Ct),Tt={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Tt.node;var Et=y(Tt),Dt={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Dt.node;var Ot=y(Dt),kt={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};kt.node;var At=y(kt),jt={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};jt.node;var Mt=y(jt),Nt=new Map,Pt=2e3;function Ft(e){Nt.set(e,(Nt.get(e)??0)+1)}function It(e){(Nt.get(e)??0)<=0||setTimeout(()=>{let t=(Nt.get(e)??0)-1;t<=0?Nt.delete(e):Nt.set(e,t)},Pt)}function Lt(e){return e?(Nt.get(e)??0)>0:!1}var J=e(t(),1),Rt=3e3,zt=`
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t}from"./jsx-runtime-BbYvbtY8.js";import{j as n}from"./useSharedWebSocket-CcsE5986.js";import{a as r,d as i,f as a,i as o,l as s,p as c,s as l,u}from"./createLucideIcon-DtODIU64.js";var d=e(t()),f={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},p=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function m(e){let t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(f[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){let t=e.indexOf(`-->`);return{type:`comment`,comment:t===-1?``:e.slice(4,t)}}let r=new RegExp(p),i=null;for(;i=r.exec(e),i!==null;)if(i[0].trim())if(i[1]){let e=i[1].trim(),n=[e,null],a=e.indexOf(`=`);a>-1&&(n=[e.slice(0,a),e.slice(a+1)]),t.attrs[n[0]]=n[1],r.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var h=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,g=/<\/?([^\s]+?)[/\s>]/,_=/^\s*$/,v=/^(script|style)$/i,y=`\0`,b=Object.create(null);function x(e){e.forEach(function(e){if(e.type===`text`){e.content=e.content.split(y).join(`<`);return}if(e.type===`comment`){e.comment=e.comment.split(y).join(`<`);return}for(let t in e.attrs){let n=e.attrs[t];typeof n==`string`&&n.indexOf(y)>-1&&(e.attrs[t]=n.split(y).join(`<`))}e.children.length&&x(e.children)})}function S(e,t){let n=t&&t.components||b,r=t&&t.allowedTags,i=!1;if(r){let t=typeof r==`function`?r:function(e){return r.indexOf(e)>-1},n=``,a=0;h.lastIndex=0;let o;for(;o=h.exec(e);){let r=o[0];n+=e.slice(a,o.index);let s=r.match(g);r.startsWith(`<!--`)||s&&t(s[1])?(n+=r,a=o.index+r.length):(i=!0,n+=y,a=o.index+1,h.lastIndex=a)}e=n+e.slice(a)}let a=[],o=[],s,c=-1,l=!1,u=0,d;if(e.indexOf(`<`)!==0){let t=e.indexOf(`<`);a.push({type:`text`,content:t===-1?e:e.substring(0,t)})}let f=[],p;for(;p=h.exec(e);)f.push(p);return f.forEach(function(e,t){let n=e[0];if(!n||n.startsWith(`<!--`))return;let r=0,i=0,a=-1,o=null;for(let e=0;e<n.length;e++){let t=n.charAt(e);o?t===o&&(o=null):t===`"`||t===`'`?o=t:t===`<`?(r++,r===2&&(a=e)):t===`>`&&i++}let s=a>-1&&/[a-zA-Z0-9\-!/]/.test(n.charAt(a+1));if(r>i&&s){let e=n.substring(0,a),r=n.substring(e.length);f[t][0]=r,f[t].index+=e.length}}),f.forEach(function(t,r){let i=t[0];if(!i)return;let p=t.index;if(p<u)return;if(l){if(i!==`</`+s.name+`>`)return;l=!1}let h=i.charAt(1)!==`/`,g=i.startsWith(`<!--`),y=p+i.length,b=e.charAt(y),x=f[r+1],S;if(b===`<`&&x){let t=e.substring(y,x.index);S=t.split(`<`).length>t.split(`>`).length}let C;if(g){let t=m(i);if(c<0)return a.push(t),a;C=o[c],C.children.push(t);let n=e.slice(y,x?x.index:void 0);return n.length>0&&C.children.push({type:`text`,content:n}),a}if(h){c++,s=m(i),s.type===`tag`&&n[s.name]&&(s.type=`component`,l=!0);let t=!1;if(!l&&!s.voidElement&&v.test(s.name)){t=!0,d||=e.toLowerCase();let n=d.indexOf(`</`+s.name.toLowerCase()+`>`,y),r=n===-1?e.length:n,i=e.slice(y,r);i&&s.children.push({type:`text`,content:i}),u=r}!s.voidElement&&!l&&!t&&b&&b!==`<`&&s.children.push({type:`text`,content:e.slice(y,x?x.index:void 0)}),c===0&&a.push(s),C=o[c-1],C&&C.children.push(s),o[c]=s}if((!h||s.voidElement)&&(c>-1&&(s.voidElement||s.name===i.slice(2,-1))&&(c--,s=c===-1?a:o[c]),!l&&(b!==`<`||S)&&b)){C=c===-1?a:o[c].children;let t=x?x.index:-1,n=e.slice(y,t===-1?void 0:t);_.test(n)&&(n=` `),(t>-1&&c+C.length>=0||n!==` `)&&C.push({type:`text`,content:n})}}),i&&x(a),a}function C(e){let t=[];for(let n in e)e[n]===null?t.push(n):t.push(n+`="`+String(e[n]).replace(/"/g,`"`)+`"`);return t.length?` `+t.join(` `):``}function w(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:{let n=t.voidElement&&t.name.toLowerCase()!==`!doctype`?`/>`:`>`;return e+=`<`+t.name+(t.attrs?C(t.attrs):``)+n,t.voidElement?e:e+t.children.reduce(w,``)+`</`+t.name+`>`}case`comment`:return e+=`<!--`+t.comment+`-->`,e}}function T(e){return e.reduce(function(e,t){return e+w(``,t)},``)}var E={parse:S,stringify:T},D=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},O=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?A(t):t},k=e=>A(e).every(d.isValidElement),A=e=>Array.isArray(e)?e:[e],j=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},M=e=>{let t={};if(!e)return t;let n=e=>{A(e).forEach(e=>{i(e)||(D(e)?n(O(e)):u(e)&&!(0,d.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},N=(e,t,n,r)=>{if(!e)return``;let o=``,s=A(e),c=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((e,s)=>{if(i(e)){o+=`${e}`;return}if((0,d.isValidElement)(e)){let{props:a,type:l}=e,u=Object.keys(a).length,d=c.indexOf(l)>-1,f=a.children;if(!f&&d&&!u){o+=`<${l}/>`;return}if(!f&&(!d||u)||a.i18nIsDynamicList){o+=`<${s}></${s}>`;return}if(d&&u<=1){let e=i(f)?f:N(f,t,n,r);o+=`<${l}>${e}</${l}>`;return}let p=N(f,t,n,r);o+=`<${s}>${p}</${s}>`;return}if(e===null){a(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(u(e)){let{format:t,...i}=e,s=Object.keys(i);if(s.length===1){let e=t?`${s[0]}, ${t}`:s[0];o+=`{{${e}}}`;return}a(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}a(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),o},P=(e,t,n,r,a,o,c)=>{if(n===``)return[];let f=a.transKeepBasicHtmlNodesFor||[],p=n&&new RegExp(f.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!p&&!c)return[n];let m=t??{},h=e=>{A(e).forEach(e=>{i(e)||(D(e)?h(O(e)):u(e)&&!(0,d.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=Object.keys(m),_=E.parse(`<0>${n}</0>`,{allowedTags:e=>/^\d+$/.test(e)||f.indexOf(e)>-1||g.indexOf(e)>-1}),v={...m,...o},y=(e,t,n)=>{let r=O(e),i=x(r,t.children,n);return k(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,d.cloneElement)(e,{key:r},i?void 0:t))):n.push(...d.Children.map([e],e=>{if(e.type===d.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,d.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,d.cloneElement)(e,n,i?null:t)}))},x=(e,n,o)=>{let m=A(e),h=A(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&r.services.interpolator.interpolate(n.children[0].content,v,r.language);if(n.type===`tag`){let l=m[parseInt(n.name,10)];!l&&t&&(l=t[n.name]),o.length===1&&!l&&(l=o[0][n.name]),l||={};let S={...n.attrs};c&&Object.keys(S).forEach(e=>{let t=S[e];i(t)&&(S[e]=s(t))});let C=Object.keys(S).length===0?l:j({props:S},l),w=(0,d.isValidElement)(C),T=w&&D(n,!0)&&!n.voidElement,E=p&&u(C)&&C.dummy&&!w,k=u(t)&&Object.hasOwnProperty.call(t,n.name);if(i(C)){let t=r.services.interpolator.interpolate(C,v,r.language);e.push(t)}else if(D(C)||T){let t=y(C,n,o);b(C,t,e,h)}else if(E){let t=x(m,n.children,o);b(C,t,e,h)}else if(Number.isNaN(parseFloat(n.name)))if(k){let t=y(C,n,o);b(C,t,e,h,n.voidElement)}else if(a.transSupportBasicHtmlNodes&&f.indexOf(n.name)>-1)if(n.voidElement)e.push((0,d.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,d.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=r?A(O(r)):m,s=x(a,n.children,o);e.push((0,d.createElement)(n.name,{key:`${n.name}-${h}`},s))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=x(m,n.children,o);e.push(`<${n.name}>${t}</${n.name}>`)}else if(u(C)&&!w){let t=n.children[0]?_:null;t&&e.push(t)}else b(C,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=a.transWrapTextNodes,i=typeof a.unescape==`function`?a.unescape:l().unescape,o=c?i(r.services.interpolator.interpolate(n.content,v,r.language)):r.services.interpolator.interpolate(n.content,v,r.language);t?e.push((0,d.createElement)(t,{key:`${n.name}-${h}`},o)):e.push(o)}return e},[])};return O(x([{dummy:!0,children:e||[]}],_,A(e||[]))[0])},F=(e,t,n)=>{let r=e.key||t,i=(0,d.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,d.createElement)(d.Fragment,null,i)}return(0,d.createElement)(a,{key:r})},I=(e,t)=>e.map((e,n)=>F(e,n,t)),L=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:F(e[r],r,t)})}),n},R=(e,t,n,r)=>e?Array.isArray(e)?I(e,t):u(e)?L(e,t):(c(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,z=e=>!u(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function B({children:e,count:t,parent:a,i18nKey:o,context:s,tOptions:u={},values:f,defaults:p,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||r();if(!b)return c(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`,{i18nKey:o}),e;let x=_||b.t.bind(b)||(e=>e),S={...l(),...b.options?.react},C=h||(x.ns?void 0:b.options?.defaultNS||`translation`);i(C)&&(C=[C]);let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...u}:u,E=v??w?.shouldUnescape,D=w?.values?{...w.values,...f}:f,O=w?.components?{...w.components,...m}:m,k=N(e,S,b,o),A=p||T?.defaultValue||k||S.transEmptyNodeValue||(typeof o==`function`?n(o):o),{hashTransKey:j}=S,F=o||(j?j(k||A):k||A);f=b.options?.interpolation?.defaultVariables?D&&Object.keys(D).length>0?{...D,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:D;let I=M(e);I&&typeof I.count==`number`&&t===void 0&&(t=I.count);let L=f||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:s||T.context,count:t,...f,...L,defaultValue:A,ns:C},V=F?x(F,B):A;V===F&&A&&(V=A);let H=R(O,V,b,o),U=H||e,W=null;z(H)&&(W=H,U=e);let G=P(U,W,V,b,S,B,E),K=a??S.defaultTransParent;return K?(0,d.createElement)(K,y,G):G}function V({children:e,count:t,parent:n,i18nKey:i,context:a,tOptions:s={},values:c,defaults:l,components:u,ns:f,i18n:p,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,d.useContext)(o)||{},y=p||_||r(),b=m||y?.t.bind(y);return B({children:e,count:t,parent:n,i18nKey:i,context:a,tOptions:s,values:c,defaults:l,components:u,ns:f||(b?.ns?void 0:v||y?.options?.defaultNS),i18n:y,t:m,shouldUnescape:h,...g})}export{V as t};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t}from"./jsx-runtime-BbYvbtY8.js";import{j as n}from"./useSharedWebSocket-Bj4LMp7b.js";import{a as r,d as i,f as a,i as o,l as s,p as c,s as l,u}from"./createLucideIcon-DtODIU64.js";var d=e(t()),f={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},p=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function m(e){let t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(f[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){let t=e.indexOf(`-->`);return{type:`comment`,comment:t===-1?``:e.slice(4,t)}}let r=new RegExp(p),i=null;for(;i=r.exec(e),i!==null;)if(i[0].trim())if(i[1]){let e=i[1].trim(),n=[e,null],a=e.indexOf(`=`);a>-1&&(n=[e.slice(0,a),e.slice(a+1)]),t.attrs[n[0]]=n[1],r.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var h=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,g=/<\/?([^\s]+?)[/\s>]/,_=/^\s*$/,v=/^(script|style)$/i,y=`\0`,b=Object.create(null);function x(e){e.forEach(function(e){if(e.type===`text`){e.content=e.content.split(y).join(`<`);return}if(e.type===`comment`){e.comment=e.comment.split(y).join(`<`);return}for(let t in e.attrs){let n=e.attrs[t];typeof n==`string`&&n.indexOf(y)>-1&&(e.attrs[t]=n.split(y).join(`<`))}e.children.length&&x(e.children)})}function S(e,t){let n=t&&t.components||b,r=t&&t.allowedTags,i=!1;if(r){let t=typeof r==`function`?r:function(e){return r.indexOf(e)>-1},n=``,a=0;h.lastIndex=0;let o;for(;o=h.exec(e);){let r=o[0];n+=e.slice(a,o.index);let s=r.match(g);r.startsWith(`<!--`)||s&&t(s[1])?(n+=r,a=o.index+r.length):(i=!0,n+=y,a=o.index+1,h.lastIndex=a)}e=n+e.slice(a)}let a=[],o=[],s,c=-1,l=!1,u=0,d;if(e.indexOf(`<`)!==0){let t=e.indexOf(`<`);a.push({type:`text`,content:t===-1?e:e.substring(0,t)})}let f=[],p;for(;p=h.exec(e);)f.push(p);return f.forEach(function(e,t){let n=e[0];if(!n||n.startsWith(`<!--`))return;let r=0,i=0,a=-1,o=null;for(let e=0;e<n.length;e++){let t=n.charAt(e);o?t===o&&(o=null):t===`"`||t===`'`?o=t:t===`<`?(r++,r===2&&(a=e)):t===`>`&&i++}let s=a>-1&&/[a-zA-Z0-9\-!/]/.test(n.charAt(a+1));if(r>i&&s){let e=n.substring(0,a),r=n.substring(e.length);f[t][0]=r,f[t].index+=e.length}}),f.forEach(function(t,r){let i=t[0];if(!i)return;let p=t.index;if(p<u)return;if(l){if(i!==`</`+s.name+`>`)return;l=!1}let h=i.charAt(1)!==`/`,g=i.startsWith(`<!--`),y=p+i.length,b=e.charAt(y),x=f[r+1],S;if(b===`<`&&x){let t=e.substring(y,x.index);S=t.split(`<`).length>t.split(`>`).length}let C;if(g){let t=m(i);if(c<0)return a.push(t),a;C=o[c],C.children.push(t);let n=e.slice(y,x?x.index:void 0);return n.length>0&&C.children.push({type:`text`,content:n}),a}if(h){c++,s=m(i),s.type===`tag`&&n[s.name]&&(s.type=`component`,l=!0);let t=!1;if(!l&&!s.voidElement&&v.test(s.name)){t=!0,d||=e.toLowerCase();let n=d.indexOf(`</`+s.name.toLowerCase()+`>`,y),r=n===-1?e.length:n,i=e.slice(y,r);i&&s.children.push({type:`text`,content:i}),u=r}!s.voidElement&&!l&&!t&&b&&b!==`<`&&s.children.push({type:`text`,content:e.slice(y,x?x.index:void 0)}),c===0&&a.push(s),C=o[c-1],C&&C.children.push(s),o[c]=s}if((!h||s.voidElement)&&(c>-1&&(s.voidElement||s.name===i.slice(2,-1))&&(c--,s=c===-1?a:o[c]),!l&&(b!==`<`||S)&&b)){C=c===-1?a:o[c].children;let t=x?x.index:-1,n=e.slice(y,t===-1?void 0:t);_.test(n)&&(n=` `),(t>-1&&c+C.length>=0||n!==` `)&&C.push({type:`text`,content:n})}}),i&&x(a),a}function C(e){let t=[];for(let n in e)e[n]===null?t.push(n):t.push(n+`="`+String(e[n]).replace(/"/g,`"`)+`"`);return t.length?` `+t.join(` `):``}function w(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:{let n=t.voidElement&&t.name.toLowerCase()!==`!doctype`?`/>`:`>`;return e+=`<`+t.name+(t.attrs?C(t.attrs):``)+n,t.voidElement?e:e+t.children.reduce(w,``)+`</`+t.name+`>`}case`comment`:return e+=`<!--`+t.comment+`-->`,e}}function T(e){return e.reduce(function(e,t){return e+w(``,t)},``)}var E={parse:S,stringify:T},D=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},O=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?A(t):t},k=e=>A(e).every(d.isValidElement),A=e=>Array.isArray(e)?e:[e],j=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},M=e=>{let t={};if(!e)return t;let n=e=>{A(e).forEach(e=>{i(e)||(D(e)?n(O(e)):u(e)&&!(0,d.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},N=(e,t,n,r)=>{if(!e)return``;let o=``,s=A(e),c=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((e,s)=>{if(i(e)){o+=`${e}`;return}if((0,d.isValidElement)(e)){let{props:a,type:l}=e,u=Object.keys(a).length,d=c.indexOf(l)>-1,f=a.children;if(!f&&d&&!u){o+=`<${l}/>`;return}if(!f&&(!d||u)||a.i18nIsDynamicList){o+=`<${s}></${s}>`;return}if(d&&u<=1){let e=i(f)?f:N(f,t,n,r);o+=`<${l}>${e}</${l}>`;return}let p=N(f,t,n,r);o+=`<${s}>${p}</${s}>`;return}if(e===null){a(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(u(e)){let{format:t,...i}=e,s=Object.keys(i);if(s.length===1){let e=t?`${s[0]}, ${t}`:s[0];o+=`{{${e}}}`;return}a(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}a(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),o},P=(e,t,n,r,a,o,c)=>{if(n===``)return[];let f=a.transKeepBasicHtmlNodesFor||[],p=n&&new RegExp(f.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!p&&!c)return[n];let m=t??{},h=e=>{A(e).forEach(e=>{i(e)||(D(e)?h(O(e)):u(e)&&!(0,d.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=Object.keys(m),_=E.parse(`<0>${n}</0>`,{allowedTags:e=>/^\d+$/.test(e)||f.indexOf(e)>-1||g.indexOf(e)>-1}),v={...m,...o},y=(e,t,n)=>{let r=O(e),i=x(r,t.children,n);return k(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,d.cloneElement)(e,{key:r},i?void 0:t))):n.push(...d.Children.map([e],e=>{if(e.type===d.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,d.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,d.cloneElement)(e,n,i?null:t)}))},x=(e,n,o)=>{let m=A(e),h=A(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&r.services.interpolator.interpolate(n.children[0].content,v,r.language);if(n.type===`tag`){let l=m[parseInt(n.name,10)];!l&&t&&(l=t[n.name]),o.length===1&&!l&&(l=o[0][n.name]),l||={};let S={...n.attrs};c&&Object.keys(S).forEach(e=>{let t=S[e];i(t)&&(S[e]=s(t))});let C=Object.keys(S).length===0?l:j({props:S},l),w=(0,d.isValidElement)(C),T=w&&D(n,!0)&&!n.voidElement,E=p&&u(C)&&C.dummy&&!w,k=u(t)&&Object.hasOwnProperty.call(t,n.name);if(i(C)){let t=r.services.interpolator.interpolate(C,v,r.language);e.push(t)}else if(D(C)||T){let t=y(C,n,o);b(C,t,e,h)}else if(E){let t=x(m,n.children,o);b(C,t,e,h)}else if(Number.isNaN(parseFloat(n.name)))if(k){let t=y(C,n,o);b(C,t,e,h,n.voidElement)}else if(a.transSupportBasicHtmlNodes&&f.indexOf(n.name)>-1)if(n.voidElement)e.push((0,d.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,d.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=r?A(O(r)):m,s=x(a,n.children,o);e.push((0,d.createElement)(n.name,{key:`${n.name}-${h}`},s))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=x(m,n.children,o);e.push(`<${n.name}>${t}</${n.name}>`)}else if(u(C)&&!w){let t=n.children[0]?_:null;t&&e.push(t)}else b(C,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=a.transWrapTextNodes,i=typeof a.unescape==`function`?a.unescape:l().unescape,o=c?i(r.services.interpolator.interpolate(n.content,v,r.language)):r.services.interpolator.interpolate(n.content,v,r.language);t?e.push((0,d.createElement)(t,{key:`${n.name}-${h}`},o)):e.push(o)}return e},[])};return O(x([{dummy:!0,children:e||[]}],_,A(e||[]))[0])},F=(e,t,n)=>{let r=e.key||t,i=(0,d.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,d.createElement)(d.Fragment,null,i)}return(0,d.createElement)(a,{key:r})},I=(e,t)=>e.map((e,n)=>F(e,n,t)),L=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:F(e[r],r,t)})}),n},R=(e,t,n,r)=>e?Array.isArray(e)?I(e,t):u(e)?L(e,t):(c(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,z=e=>!u(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function B({children:e,count:t,parent:a,i18nKey:o,context:s,tOptions:u={},values:f,defaults:p,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||r();if(!b)return c(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`,{i18nKey:o}),e;let x=_||b.t.bind(b)||(e=>e),S={...l(),...b.options?.react},C=h||(x.ns?void 0:b.options?.defaultNS||`translation`);i(C)&&(C=[C]);let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...u}:u,E=v??w?.shouldUnescape,D=w?.values?{...w.values,...f}:f,O=w?.components?{...w.components,...m}:m,k=N(e,S,b,o),A=p||T?.defaultValue||k||S.transEmptyNodeValue||(typeof o==`function`?n(o):o),{hashTransKey:j}=S,F=o||(j?j(k||A):k||A);f=b.options?.interpolation?.defaultVariables?D&&Object.keys(D).length>0?{...D,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:D;let I=M(e);I&&typeof I.count==`number`&&t===void 0&&(t=I.count);let L=f||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:s||T.context,count:t,...f,...L,defaultValue:A,ns:C},V=F?x(F,B):A;V===F&&A&&(V=A);let H=R(O,V,b,o),U=H||e,W=null;z(H)&&(W=H,U=e);let G=P(U,W,V,b,S,B,E),K=a??S.defaultTransParent;return K?(0,d.createElement)(K,y,G):G}function V({children:e,count:t,parent:n,i18nKey:i,context:a,tOptions:s={},values:c,defaults:l,components:u,ns:f,i18n:p,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,d.useContext)(o)||{},y=p||_||r(),b=m||y?.t.bind(y);return B({children:e,count:t,parent:n,i18nKey:i,context:a,tOptions:s,values:c,defaults:l,components:u,ns:f||(b?.ns?void 0:v||y?.options?.defaultNS),i18n:y,t:m,shouldUnescape:h,...g})}export{V as t};
|
package/client/dist/assets/{formatDistanceToNow-CdN5lTyD.js → formatDistanceToNow-NjPHBLfB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,S as n,k as r,w as i,x as a,y as o}from"./useSharedWebSocket-
|
|
1
|
+
import{A as e,C as t,S as n,k as r,w as i,x as a,y as o}from"./useSharedWebSocket-Bj4LMp7b.js";import{t as s}from"./getTimezoneOffsetInMilliseconds-vJ7qUoqN.js";function c(e,t){let n=a(e)-+a(t);return n<0?-1:n>0?1:n}function l(e){return i(e,Date.now())}function u(e,n,r){let[i,a]=t(r?.in,e,n),o=i.getFullYear()-a.getFullYear(),s=i.getMonth()-a.getMonth();return o*12+s}function d(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function f(e,t){return a(e)-+a(t)}function p(e,t){let n=a(e,t?.in);return n.setHours(23,59,59,999),n}function m(e,t){let n=a(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function h(e,t){let n=a(e,t?.in);return+p(n,t)==+m(n,t)}function g(e,n,r){let[i,a,o]=t(r?.in,e,e,n),s=c(a,o),l=Math.abs(u(a,o));if(l<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-s*l);let d=c(a,o)===-s;h(i)&&l===1&&c(i,o)===1&&(d=!1);let f=s*(l-+d);return f===0?0:f}function _(e,t,n){let r=f(e,t)/1e3;return d(n?.roundingMethod)(r)}function v(i,a,l){let u=n(),d=l?.locale??u.locale??o,f=c(i,a);if(isNaN(f))throw RangeError(`Invalid time value`);let p=Object.assign({},l,{addSuffix:l?.addSuffix,comparison:f}),[m,h]=t(l?.in,...f>0?[a,i]:[i,a]),v=_(h,m),y=(s(h)-s(m))/1e3,b=Math.round((v-y)/60),x;if(b<2)return l?.includeSeconds?v<5?d.formatDistance(`lessThanXSeconds`,5,p):v<10?d.formatDistance(`lessThanXSeconds`,10,p):v<20?d.formatDistance(`lessThanXSeconds`,20,p):v<40?d.formatDistance(`halfAMinute`,0,p):v<60?d.formatDistance(`lessThanXMinutes`,1,p):d.formatDistance(`xMinutes`,1,p):b===0?d.formatDistance(`lessThanXMinutes`,1,p):d.formatDistance(`xMinutes`,b,p);if(b<45)return d.formatDistance(`xMinutes`,b,p);if(b<90)return d.formatDistance(`aboutXHours`,1,p);if(b<1440){let e=Math.round(b/60);return d.formatDistance(`aboutXHours`,e,p)}else if(b<2520)return d.formatDistance(`xDays`,1,p);else if(b<43200){let e=Math.round(b/r);return d.formatDistance(`xDays`,e,p)}else if(b<43200*2)return x=Math.round(b/e),d.formatDistance(`aboutXMonths`,x,p);if(x=g(h,m),x<12){let t=Math.round(b/e);return d.formatDistance(`xMonths`,t,p)}else{let e=x%12,t=Math.trunc(x/12);return e<3?d.formatDistance(`aboutXYears`,t,p):e<9?d.formatDistance(`overXYears`,t,p):d.formatDistance(`almostXYears`,t+1,p)}}function y(e,t){return v(e,l(e),t)}export{y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as e}from"./useSharedWebSocket-
|
|
1
|
+
import{x as e}from"./useSharedWebSocket-Bj4LMp7b.js";function t(t){let n=e(t),r=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return r.setUTCFullYear(n.getFullYear()),t-+r}export{t};
|