@hearsay-tools/squawk 0.19.0-pr4599.9140 → 0.19.0-pr4604.9147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/hosts.d.ts +254 -0
- package/dist/contract/index.js +35 -0
- package/dist/core/http-route-registry.d.ts +7 -4
- package/dist/core/http-route-registry.js +6 -0
- package/dist/core/http-route-registry.js.map +1 -1
- package/dist/delegation/transport.d.ts +78 -78
- package/dist/features/automations/automations-routes.d.ts +150 -150
- package/dist/features/automations/server-plugin.js.map +1 -1
- package/dist/features/github/github-comments.js +19 -6
- package/dist/features/github/github-comments.js.map +1 -1
- package/dist/features/hosts/bootstrap.d.ts +1 -0
- package/dist/features/hosts/bootstrap.js +18 -6
- package/dist/features/hosts/bootstrap.js.map +1 -1
- package/dist/features/hosts/gateway-routes.d.ts +14 -0
- package/dist/features/hosts/gateway-routes.js +20 -0
- package/dist/features/hosts/gateway-routes.js.map +1 -0
- package/dist/features/hosts/gateway.d.ts +105 -0
- package/dist/features/hosts/gateway.js +800 -0
- package/dist/features/hosts/gateway.js.map +1 -0
- package/dist/features/hosts/index.d.ts +7 -1
- package/dist/features/hosts/index.js +23 -16
- package/dist/features/hosts/index.js.map +1 -1
- package/dist/features/hosts/routes.d.ts +91 -2
- package/dist/features/hosts/routes.js +142 -11
- package/dist/features/hosts/routes.js.map +1 -1
- package/dist/features/hosts/supervisor.d.ts +22 -8
- package/dist/features/hosts/supervisor.js +94 -37
- package/dist/features/hosts/supervisor.js.map +1 -1
- package/dist/features/webhooks/server-plugin.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/server/checkout.d.ts +10 -0
- package/dist/server/checkout.js +1 -1
- package/dist/server/checkout.js.map +1 -1
- package/dist/server/create-project.d.ts +6 -0
- package/dist/server/create-project.js +1 -1
- package/dist/server/create-project.js.map +1 -1
- package/dist/server/plugin-http-routes.d.ts +18 -6
- package/dist/server/plugin-http-routes.js +30 -14
- package/dist/server/plugin-http-routes.js.map +1 -1
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/repo-routes.d.ts +52 -52
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/server.d.ts +1170 -1170
- package/dist/server/server.js +10 -8
- package/dist/server/server.js.map +1 -1
- package/dist/server/workspace-identity-routes.d.ts +5 -5
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-BXIfRpqn.js → accounts-section-BsgnDmow.js} +1 -1
- package/web/dist/assets/{activity-motion-CiMnzmaL.js → activity-motion-Ckq9kC3I.js} +1 -1
- package/web/dist/assets/{activity-route-7rgwez-p.js → activity-route-5S9WhN9U.js} +1 -1
- package/web/dist/assets/{agent-config-section-D35Gh915.js → agent-config-section-D8pxNy2V.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-qela9Lh0.js → agent-defaults-section-et5LHv9W.js} +1 -1
- package/web/dist/assets/{appearance-PSBR-L16.js → appearance-D_t3wCjY.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-BJFWDQ73.js → archive-on-merge-field-C63xRNFZ.js} +1 -1
- package/web/dist/assets/ask-card-kqWOqKIc.js +9 -0
- package/web/dist/assets/{automations-route-DvhHg4fm.js → automations-route-B5YBpGMc.js} +1 -1
- package/web/dist/assets/{commit-list-DebGaysy.js → commit-list-Bjc-pQxv.js} +1 -1
- package/web/dist/assets/{diff-controls-BBgyFS1R.js → diff-controls-CaCUSyxs.js} +1 -1
- package/web/dist/assets/{diff-BSfVn71B.js → diff-lwWO-At7.js} +2 -2
- package/web/dist/assets/{diff-view-CmGMWIlZ.js → diff-view-4wxDvYXE.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-C6sD9mz8.js → discard-changes-dialog-B3gvm7lX.js} +1 -1
- package/web/dist/assets/{file-preview-Clm9psfR.js → file-preview-98pJhZJj.js} +1 -1
- package/web/dist/assets/{git-toolbar-G_q1J1Qo.js → git-toolbar-CepvG0Ng.js} +1 -1
- package/web/dist/assets/{github-S25ca8_M.js → github-4Jhl7lLG.js} +1 -1
- package/web/dist/assets/{global-activity-route-C6wsa2VH.js → global-activity-route-DhmrWj31.js} +1 -1
- package/web/dist/assets/index-BK1FcZrA.css +1 -0
- package/web/dist/assets/{index-n7br_LJj.js → index-DJB0lid-.js} +4 -4
- package/web/dist/assets/{markdown-DBTrMXVS.js → markdown-BAPhDASs.js} +1 -1
- package/web/dist/assets/{option-select-lxOL23-m.js → option-select-BwSkbCrQ.js} +1 -1
- package/web/dist/assets/{preferences-section-BjUffanB.js → preferences-section-Cvh644K0.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-DzT-ebVU.js → preview-pane-connected-B08ZdGux.js} +1 -1
- package/web/dist/assets/{project-location-BEdaj_mZ.js → project-location-DR8go8oL.js} +1 -1
- package/web/dist/assets/{projects-section-DBfKeeqR.js → projects-section-XDboHBFP.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-D7SvCECE.js → prompt-templates-section-DcxD28iA.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-BFW5hckZ.js → remote-settings-notice-Dtaa3ovl.js} +1 -1
- package/web/dist/assets/{repo-git-DufonnxZ.js → repo-git-Dp9R2TuI.js} +1 -1
- package/web/dist/assets/{report-reader-BNeaSf9l.js → report-reader-mbkd2DKt.js} +1 -1
- package/web/dist/assets/{reports-Dg96OgK_.js → reports-ya2OW-iR.js} +1 -1
- package/web/dist/assets/{resources-section-mlWGic7N.js → resources-section-g5XRlefz.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-B8XEe0To.js → review-notes-drafts-BdBvLP6E.js} +1 -1
- package/web/dist/assets/{review-panel-DeGoLgcB.js → review-panel-Ba8yb8Fu.js} +1 -1
- package/web/dist/assets/{review-strip-B0dxLGVX.js → review-strip-CdlMeV2i.js} +1 -1
- package/web/dist/assets/{run-header-CO7X2ksL.js → run-header-BTRXYB4W.js} +1 -1
- package/web/dist/assets/{select-BCP0bQL_.js → select-DdH25sWT.js} +1 -1
- package/web/dist/assets/{session-context-section-DNHeVwaW.js → session-context-section-BqEdLdTv.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-DpNZjBNf.js → settings-agent-picker-b4M6fQ8m.js} +1 -1
- package/web/dist/assets/{settings-save-bar-DTuXtrOh.js → settings-save-bar-DFY_Km4X.js} +1 -1
- package/web/dist/assets/{settings-shell-DA8Ljpv9.js → settings-shell-BUwdvhI9.js} +1 -1
- package/web/dist/assets/{sidebar-section-CXPEyE4l.js → sidebar-section-CcucfASN.js} +1 -1
- package/web/dist/assets/{skills-CNCCc6b5.js → skills-BLkPhZO8.js} +1 -1
- package/web/dist/assets/{task-changes-BIdArX0Y.js → task-changes-Drvnew5P.js} +1 -1
- package/web/dist/assets/{task-commits-BMEqcu53.js → task-commits-1MJHuX1i.js} +1 -1
- package/web/dist/assets/{task-file-scope-DHm_aCX9.js → task-file-scope-CB3L3KQl.js} +1 -1
- package/web/dist/assets/{task-files-Dmc9mysp.js → task-files-B9okW1TC.js} +1 -1
- package/web/dist/assets/{task-github-item-BVQHPtmd.js → task-github-item-CMNk7FxR.js} +1 -1
- package/web/dist/assets/task-thread-_2ch8BRt.js +2 -0
- package/web/dist/assets/{task-thread-BObu0KsD.css → task-thread-a6CXLxwn.css} +1 -1
- package/web/dist/assets/{thread-state-qIdHMY4r.js → thread-state-qNczqxZQ.js} +1 -1
- package/web/dist/assets/{use-finish-run-BRlt2Xcp.js → use-finish-run-Dvm4JnAH.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DA5WLXGY.js → use-hand-to-agent-state-CBJvP-US.js} +1 -1
- package/web/dist/assets/use-path-bases-C9yvZF5B.js +1 -0
- package/web/dist/assets/{workflows-BGZZkVU_.js → workflows-BUcx-n8J.js} +1 -1
- package/web/dist/assets/{workspace-tools-DIcwDrFd.js → workspace-tools-dbiR1fzO.js} +1 -1
- package/web/dist/assets/{worktrees-section-BTKs5R9c.js → worktrees-section-Dyb_QkSd.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/ask-card-BOsa7Rhk.js +0 -9
- package/web/dist/assets/index-QckSsk-V.css +0 -1
- package/web/dist/assets/task-thread-DonhRFPP.js +0 -2
- package/web/dist/assets/use-path-bases-DJciTjQE.js +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{m as r,o as i}from"./dist-C_rn70hE.js";import{N as a,Yt as o,nn as s}from"./queries-CchoEEzj.js";import{mr as c}from"./toaster-zMN8cNZQ.js";import{f as l,n as u,p as d}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{J as f,Q as p,V as m,c as h,d as g,f as _,mt as v,pt as y,st as b,u as x,y as S}from"./design-icons-QbNMZniQ.js";import{t as C}from"./createLucideIcon-BHp8sXmF.js";import{t as w}from"./check-OP-CVgZG.js";import{t as T}from"./chevron-right-BENZ-1ZN.js";import{n as ee}from"./smartphone-Lr8Ug2z_.js";import{t as E}from"./loader-circle-CPBhhDbB.js";import{t as te}from"./message-square-B-MD-8rD.js";import{n as D,t as ne}from"./tool-display-B9NN44oU.js";import{t as O}from"./square-terminal-B6RYYieR.js";import{t as k}from"./button-B22ANdCY.js";import{n as A,r as j,t as M}from"./collapsible-Bx2vViFx.js";import{t as N}from"./project-router-j0uBi7Ep.js";import{a as re,c as ie,i as ae,l as oe,o as se,s as ce,t as le}from"./report-selection-BdGxjISG.js";import{r as ue}from"./html-report-BX3msvci.js";import{Dn as de,T as fe,Tr as pe,mr as me,pn as he,w as ge,yr as P}from"./index-n7br_LJj.js";import{t as _e}from"./zoomable-image-BUTgYpld.js";import{t as F}from"./textarea-vEsJAUAV.js";import{t as I}from"./markdown-DBTrMXVS.js";import{t as ve}from"./task-file-scope-DHm_aCX9.js";import{t as ye}from"./report-title-D4Mbu2Er.js";var be=C(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),xe=C(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Se=C(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Ce=C(`locate-fixed`,[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),L=C(`message-square-text`,[[`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`}]]),we=C(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),R=e(t(),1),z=n();function Te(e,t){if(e.length===1)return[t.replace(RegExp(`^${Ee(e[0].header)}: ?`),``)];let n=t,r=[];for(let[t,i]of e.entries()){let a=`${i.header}: `;if(!n.startsWith(a))return;n=n.slice(a.length);let o=e[t+1],s=o?n.indexOf(`\n${o.header}: `):n.length;if(s<0)return;r.push(n.slice(0,s)),n=n.slice(s+1)}return r}function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function De(e,t){if(t===void 0)return[];let n=e.options??[];if(!e.multiSelect)return n.filter(e=>e.label===t).map(e=>e.label);let r=[];function i(e,t){for(let{label:a}of n)t.includes(a)||(e===a?r.push([...t,a]):e.startsWith(`${a}, `)&&i(e.slice(a.length+2),[...t,a]))}return i(t,[]),r.length===1?r[0]:[]}var Oe=`
|
|
2
|
-
|
|
3
|
-
Additional comments:
|
|
4
|
-
`;function ke(e){let t=e.indexOf(Oe);if(t<0)return{body:e,comment:void 0};let n=e.slice(t+23).trim();return{body:e.slice(0,t),comment:n||void 0}}function Ae({ask:e}){let t=e.answer===void 0?void 0:ke(e.answer),n=t===void 0?void 0:Te(e.questions,t.body);return(0,z.jsxs)(`div`,{"data-slot":`ask-answers`,className:`flex flex-col gap-4 text-sm`,children:[e.questions.map((t,r)=>{let i=n?.[r],a=De(t,i),o=i!==void 0&&a.length===0;return(0,z.jsxs)(`section`,{className:`flex flex-col gap-2`,"aria-label":t.question,children:[(0,z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[t.header,` · Question `,r+1,` of `,e.questions.length]}),(0,z.jsx)(`p`,{className:`break-words font-semibold`,children:t.question}),t.options?(0,z.jsxs)(`ul`,{className:`flex list-none flex-col gap-1.5`,children:[t.options.map(e=>(0,z.jsxs)(`li`,{"data-selected":a.includes(e.label),className:`flex items-start gap-2 rounded-md border border-border px-3 py-2 data-[selected=true]:border-message-user-border data-[selected=true]:bg-message-user-accent/5`,children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-message-user-accent`,children:a.includes(e.label)?`✓`:`○`}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1 break-words`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description?(0,z.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description}):null]}),a.includes(e.label)?(0,z.jsx)(`span`,{className:`shrink-0 text-xs text-message-user-accent`,children:`Selected`}):null]},e.label)),(0,z.jsxs)(`li`,{"data-selected":o,className:`rounded-md border border-border px-3 py-2 data-[selected=true]:border-message-user-border`,children:[(0,z.jsxs)(`p`,{className:`flex items-start gap-2 font-medium`,children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`text-message-user-accent`,children:o?`✓`:`○`}),(0,z.jsx)(`span`,{className:`flex-1`,children:`Other`}),o?(0,z.jsx)(`span`,{className:`text-xs text-message-user-accent`,children:`Selected`}):null]}),o?(0,z.jsx)(B,{text:i}):null]})]}):i===void 0?null:(0,z.jsx)(B,{text:i})]},t.id??r)}),n&&t?.comment?(0,z.jsxs)(`section`,{className:`flex flex-col gap-1`,"aria-label":`Additional comments`,children:[(0,z.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Additional comments`}),(0,z.jsx)(B,{text:t.comment})]}):null,!n&&e.answer!==void 0?(0,z.jsx)(B,{text:e.answer}):null]})}function B({text:e}){return(0,z.jsx)(`blockquote`,{className:`[margin-block-start:0.5rem] border-s-2 border-message-user-accent ps-3 break-words whitespace-pre-wrap`,children:e})}function V(e,t,n){let r=n[e];return r===void 0?(t[e]?.length??0)>0:r.trim().length>0}function je(e,t,n){let r=n[e]?.trim();if(r)return r;let i=t[e]??[];return i.length>0?i.join(`, `):`Not answered yet`}function Me({stepped:e,mode:t,onModeChange:n,showModeSwitch:r,stepLabel:a,hasSheetContext:o,showContextButtonRef:s,onOpenContext:c,onShowOrigin:l,onFold:u}){let d=u!==void 0,f=o?(0,z.jsxs)(k,{ref:s,type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-show-context`,"aria-label":d?`Show context`:void 0,className:i(`px-2 text-xs font-medium text-link-foreground underline underline-offset-4`,d&&`ms-auto`),onClick:c,children:[(0,z.jsx)(P,{"aria-hidden":`true`,className:`size-3.5`}),d?`Context`:`Show context`]}):l&&d?(0,z.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-slot":`ask-show-origin`,"aria-label":`Show where it was asked`,title:`Show where it was asked`,className:`ms-auto shrink-0 text-link-foreground`,onClick:l,children:(0,z.jsx)(Ce,{"aria-hidden":`true`,className:`size-4`})}):l?(0,z.jsx)(Ve,{onShowOrigin:l}):null,p=r?(0,z.jsx)(Ne,{mode:t,onModeChange:n}):null;return d?(0,z.jsxs)(`div`,{"data-slot":`ask-header`,"data-compact":`true`,className:`flex shrink-0 items-center gap-1.5 border-b border-border/70 py-1 ps-1.5 pe-1`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Needs your answer`}),e&&t===`options`?(0,z.jsx)(`span`,{"data-slot":`ask-step-indicator`,className:`sr-only`,children:a}):null,p,f,(0,z.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-slot":`ask-fold`,"aria-label":`Fold the question`,"aria-expanded":`true`,className:i(`shrink-0 text-muted-foreground`,!f&&`ms-auto`),onClick:u,children:(0,z.jsx)(x,{"aria-hidden":`true`,className:`size-4`})})]}):(0,z.jsxs)(`div`,{"data-slot":`ask-header`,className:`flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b border-border/70 px-2.5 py-1.5 md:px-3 md:py-2`,children:[(0,z.jsx)(`span`,{className:`text-xs font-semibold text-link-foreground`,children:`Needs your answer`}),e&&t===`options`?(0,z.jsx)(`span`,{"data-slot":`ask-step-indicator`,className:`rounded-full bg-accent-strong/15 px-2 py-0.5 text-xs font-semibold text-foreground tabular-nums`,children:a}):null,(0,z.jsxs)(`div`,{className:`ms-auto flex flex-wrap items-center gap-1.5`,children:[f,p]})]})}function Ne({mode:e,onModeChange:t}){return(0,z.jsxs)(`div`,{"data-slot":`ask-mode-switch`,role:`group`,"aria-label":`Reply mode`,className:`inline-flex shrink-0 items-center rounded-lg border border-border bg-card p-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,"data-slot":`ask-mode-options`,"aria-pressed":e===`options`,onClick:()=>t(`options`),className:i(`min-h-11 rounded-md px-2.5 text-xs font-medium transition-colors focus-visible:outline-2 focus-visible:outline-ring md:min-h-7`,e===`options`?`bg-accent-strong text-accent-strong-foreground`:`text-foreground hover:bg-muted/60`),children:`Options`}),(0,z.jsx)(`button`,{type:`button`,"data-slot":`ask-mode-reply`,"aria-pressed":e===`reply`,onClick:()=>t(`reply`),className:i(`min-h-11 rounded-md px-2.5 text-xs font-medium transition-colors focus-visible:outline-2 focus-visible:outline-ring md:min-h-7`,e===`reply`?`bg-accent-strong text-accent-strong-foreground`:`text-foreground hover:bg-muted/60`),children:`Write a reply`})]})}function Pe({tag:e,text:t,position:n,onOpen:r}){return(0,z.jsxs)(`button`,{type:`button`,"data-slot":`ask-folded-row`,"aria-expanded":`false`,onClick:r,className:`flex min-h-11 w-full min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-start focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,z.jsx)(`span`,{className:`shrink-0 rounded-md bg-accent-strong px-1.5 py-0.5 text-xs font-semibold uppercase tracking-wide text-accent-strong-foreground`,children:e}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:t}),n===void 0?null:(0,z.jsx)(`span`,{"data-slot":`ask-folded-position`,className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:n}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Open the question`}),(0,z.jsx)(_,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]})}function Fe({questions:e,stepIndex:t,selections:n,otherAnswers:r,hasComment:a,onSelectStep:o}){let s=e.length;return(0,z.jsxs)(`div`,{"data-slot":`ask-step-pills`,role:`group`,"aria-label":`Question steps`,className:`hidden shrink-0 flex-wrap items-center gap-1.5 border-b border-border/60 px-3 py-1.5 md:flex`,children:[e.map((e,a)=>{let s=t===a,c=V(a,n,r);return(0,z.jsxs)(`button`,{type:`button`,"aria-current":s?`step`:void 0,onClick:()=>o(a),className:i(`inline-flex min-h-8 items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-2 focus-visible:outline-ring`,s?`border-accent-strong bg-accent-strong/15 text-foreground`:c?`border-border bg-card text-foreground hover:border-accent-strong/50`:`border-border bg-transparent text-muted-foreground hover:text-foreground`),children:[(0,z.jsx)(`span`,{className:`tabular-nums text-xs font-semibold`,children:c?(0,z.jsx)(w,{"aria-hidden":`true`,className:`size-3 text-semantic-green`}):`${a+1}.`}),(0,z.jsx)(`span`,{className:`max-w-[140px] truncate`,children:e.header})]},e.id??a)}),(0,z.jsxs)(`button`,{type:`button`,"aria-current":t===s?`step`:void 0,onClick:()=>o(s),className:i(`inline-flex min-h-8 items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-2 focus-visible:outline-ring`,t===s?`border-accent-strong bg-accent-strong/15 text-foreground`:a?`border-border bg-card text-foreground hover:border-accent-strong/50`:`border-dashed border-border bg-transparent text-muted-foreground hover:text-foreground`),children:[(0,z.jsx)(L,{"aria-hidden":`true`,className:`size-3`}),(0,z.jsx)(`span`,{children:`Comment`})]})]})}function Ie({questions:e,selections:t,otherAnswers:n,comment:r,disabled:a,onCommentChange:o,onJumpToQuestion:s}){let c=(0,R.useId)();return(0,z.jsxs)(`div`,{"data-slot":`ask-comment-step`,className:`flex flex-col gap-2.5`,children:[(0,z.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-2.5`,children:[(0,z.jsx)(`p`,{className:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Selected answers`}),(0,z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map((e,r)=>{let a=V(r,t,n);return(0,z.jsxs)(`li`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>s(r),className:`min-h-11 text-start font-medium text-link-foreground underline-offset-4 hover:underline md:min-h-6`,children:e.header}),(0,z.jsx)(`span`,{className:i(`min-w-0 truncate text-end`,a?`text-foreground`:`text-semantic-red`),children:je(r,t,n)})]},e.id??r)})})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{htmlFor:c,className:`mb-1 block text-xs font-medium text-foreground`,children:`Additional comments (optional)`}),(0,z.jsx)(F,{id:c,"data-slot":`ask-additional-comment`,rows:2,value:r,disabled:a,placeholder:`Optional extra notes to send with your selections…`,onChange:e=>o(e.target.value),className:`bg-card text-base md:text-[13px]`})]})]})}function Le({value:e,onValueChange:t,disabled:n,renderFreeTextReply:r}){let i=(0,R.useId)();return r?(0,z.jsx)(`div`,{"data-slot":`ask-free-text`,children:r({value:e,onValueChange:t,disabled:n})}):(0,z.jsxs)(`div`,{"data-slot":`ask-free-text`,className:`flex flex-col gap-2`,children:[(0,z.jsx)(`label`,{htmlFor:i,className:`text-xs font-medium text-foreground`,children:`Reply to the agent`}),(0,z.jsx)(F,{id:i,rows:2,value:e,disabled:n,placeholder:`Write a free-text reply…`,onChange:e=>t(e.target.value),className:`bg-card text-base md:text-[13px]`})]})}function Re({stepIndex:e,questionCount:t,answeredCount:n,allAnswered:r,hasComment:a,resuming:o,disabled:s,onBack:c,onNext:l,onOpenComment:u,onSend:d,questions:f,selections:p,otherAnswers:m,stopControl:h,compact:g=!1}){let _=e===t-1,v=e===t,y=o?`Send answer & reopen`:`Send answer`,b=o?(0,z.jsx)(`span`,{"data-slot":`ask-resume-hint`,className:`text-xs text-soft-foreground`,children:`Reopens the closed session.`}):null,x=!_&&!v?(0,z.jsxs)(k,{type:`button`,variant:`outline`,size:`sm`,className:`px-3`,onClick:l,children:[`Next`,(0,z.jsx)(T,{"aria-hidden":`true`,className:`size-4`})]}):null,S=_?(0,z.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,className:`px-3`,onClick:u,children:a?`Edit comment`:`+ Comment`}):null,C=_||v||r?(0,z.jsx)(k,{type:`button`,size:`sm`,className:`px-3.5`,disabled:s||!r,onClick:d,children:y}):null;return(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e>0?(0,z.jsxs)(k,{type:`button`,variant:`outline`,size:`sm`,className:`px-3`,onClick:c,children:[(0,z.jsx)(pe,{"aria-hidden":`true`,className:`size-4`}),`Back`]}):null,(0,z.jsxs)(`span`,{"data-slot":`ask-progress-dots`,"aria-hidden":`true`,className:`flex items-center gap-1.5 px-1 md:hidden`,children:[f.map((t,n)=>{let r=n===e,a=V(n,p,m);return(0,z.jsx)(`span`,{className:i(`size-2 rounded-full motion-safe:transition-colors`,r?`bg-accent-strong`:a?`bg-success`:`bg-border`)},t.id??n)}),(0,z.jsx)(`span`,{className:i(`size-2 rounded-full motion-safe:transition-colors`,v?`bg-accent-strong`:a?`bg-success`:`bg-border/60`)})]}),(0,z.jsxs)(`span`,{"data-slot":`ask-progress-summary`,className:`hidden text-xs text-soft-foreground tabular-nums sm:inline`,children:[n,` of `,t,` answered`]}),g?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{"data-slot":`ask-step-actions`,className:`ms-auto flex items-center gap-2`,children:[x,C]}),S||h?(0,z.jsxs)(`div`,{"data-slot":`ask-secondary-actions`,className:`ms-auto flex items-center gap-2`,children:[S,h]}):null,b]}):(0,z.jsxs)(z.Fragment,{children:[b,(0,z.jsxs)(`div`,{className:`ms-auto flex flex-wrap items-center gap-2`,children:[h,x,S,C]})]})]})}function ze({oneTap:e,hasOtherAnswer:t,allowComment:n,commentOpen:r,hasComment:i,resuming:a,disabled:o,onToggleComment:s,onSend:c,stopControl:l,compact:u=!1}){return(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n?(0,z.jsxs)(k,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-add-comment`,className:`px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:s,children:[(0,z.jsx)(L,{"aria-hidden":`true`,className:`size-3.5`}),r?`Hide comment`:i?`Edit comment`:`+ Add comment`]}):null,u&&!a?null:(0,z.jsx)(`span`,{"data-slot":a?`ask-resume-hint`:`ask-hint`,className:`text-xs text-soft-foreground`,children:a?`Reopens the closed session.`:e?`Tap an option to send.`:`Choose an answer, then send.`}),(0,z.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[l,!e||t||r||i?(0,z.jsx)(k,{type:`button`,size:`sm`,className:`px-3.5`,disabled:o,onClick:c,children:a?`Send answer & reopen`:`Send answer`}):null]})]})}function Be({blockedBy:e,reason:t,error:n}){return(0,z.jsxs)(z.Fragment,{children:[t?(0,z.jsxs)(`p`,{"data-slot":`ask-blocked-reason`,className:`text-xs text-muted-foreground`,children:[t,` `,e===`provider`?(0,z.jsx)(N,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`}):null]}):null,n?(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-semantic-red`,children:n}):null]})}function Ve({onShowOrigin:e,className:t}){return(0,z.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-show-origin`,onClick:e,className:i(`px-2 text-xs font-medium text-link-foreground underline underline-offset-4`,t),children:`Show where it was asked`})}function He({open:e,onOpenChange:t,runId:n,context:r,onShowOrigin:i,returnFocusRef:a}){let o=(0,R.useRef)(!1);return(0,z.jsx)(ae,{open:e,onOpenChange:t,children:(0,z.jsxs)(se,{side:`right`,showCloseButton:!1,"data-slot":`ask-context-sheet`,className:`flex w-full max-w-[540px] flex-col gap-0 p-0 sm:max-w-[540px]`,onCloseAutoFocus:e=>{if(e.preventDefault(),o.current){o.current=!1,i?.();return}a?.current?.focus()},children:[(0,z.jsxs)(ie,{className:`relative shrink-0 border-b border-border px-5 py-4 pr-14`,children:[(0,z.jsx)(oe,{children:`Question context`}),(0,z.jsx)(ce,{children:`Your selections and drafts stay intact while you read.`}),(0,z.jsx)(re,{asChild:!0,children:(0,z.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,className:`absolute inset-bs-2 end-2`,children:(0,z.jsx)(v,{"aria-hidden":`true`,className:`size-4`})})})]}),(0,z.jsx)(`div`,{"data-slot":`ask-context`,role:`region`,"aria-label":`Context`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain break-words px-5 py-4 text-sm text-foreground`,children:(0,z.jsx)(ve,{runId:n,children:(0,z.jsx)(I,{breaks:!0,children:r})})}),i?(0,z.jsx)(`div`,{className:`flex shrink-0 items-center justify-end border-t border-border px-5 py-3`,children:(0,z.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-slot":`ask-show-origin`,onClick:()=>{o.current=!0,t(!1),i()},children:`Show where it was asked`})}):null]})})}function Ue(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var We=/^[A-Za-z0-9_./:=+,@%-]+$/;function Ge(e){return e.replaceAll(`'`,`'\\''`)}function Ke(e){return e===``?`''`:We.test(e)?e:`\u0027${Ge(e)}\u0027`}function qe(e){if(!Ue(e))return;let t=e.command;if(typeof t==`string`&&t!==``)return t;if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return e.map(Ke).join(` `)}}function Je(e){let t="`".repeat(3),n=`~`.repeat(3);return e.split(t).filter((e,t)=>t%2==0).join(` `).split(n).filter((e,t)=>t%2==0).join(` `).split("`").filter((e,t)=>t%2==0).join(` `)}function Ye(e){return e.replace(/!\[(?:\\.|[^\]\\])*\]\([^)\s]*(?:\s+"[^"]*")?\)/g,` `)}function Xe(e){return e.replace(/(?<!\\)(?:\*\*|\*|__|~~|`)/g,``).replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~])/g,`$1`)}function H(e){let t=e.trim();return t===``||t.startsWith(`#`)||/^(https?:|mailto:)/i.test(t)?!0:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function Ze(e){let t=Je(Ye(e)),n=new Map;for(let e of t.matchAll(/^\s*\[([^\]]+)\]:\s*(\S+)/gm))H(e[2])&&n.set(e[1].toLowerCase(),e[2]);let r=t.replace(/^\s*\[[^\]]+\]:\s*\S+.*$/gm,` `),i=[];for(let e of r.matchAll(/(?<!!)\[((?:\\.|[^\]\\])+)\](?:\(((?:[^()\s]|\([^)]*\))+)(?:\s+"[^"]*")?\)|\[([^\]]*)\])|<(https?:\/\/[^>\s]+)>|(https?:\/\/[^\s<]+)/g)){if(e[2]){H(e[2])&&i.push({label:Xe(e[1]),href:e[2]});continue}if(e[1]!==void 0&&e[3]!==void 0){let t=(e[3].length>0?e[3]:e[1]).toLowerCase(),r=n.get(t);r&&i.push({label:Xe(e[1]),href:r});continue}let t=(e[4]??e[5])?.replace(/[.,;:!?]+$/,``);t&&H(t)&&i.push({label:t,href:t})}return i}var Qe=(0,R.createContext)(void 0),U=(0,R.createContext)(void 0);function $e(e,t){let n=new Map;for(let r of Ze(e)){let e=fe(r.href,t);if(!e)continue;let i=new URL(e,`https://cockpit.invalid`),a=/^\/p\/([^/]+)\/tasks\/([^/]+)\/report$/.exec(i.pathname),o=/^\/tasks\/([^/]+)\/report$/.exec(i.pathname),s=i.searchParams.get(`artifact`);if(!s||(a?decodeURIComponent(a[1])!==t.projectId:!o))continue;let c=decodeURIComponent(a?a[2]:o[1]),l=`${c}:${s}`;n.has(l)||n.set(l,{runId:c,artifactId:s,label:r.label,href:e})}return[...n.values()]}function W(e,t){return`report-card-${encodeURIComponent(e)}-${t}`}function et({text:e,messageKey:t}){let n=(0,R.useContext)(ge),r=(0,R.useContext)(U),i=t??r;if(!n||i===void 0)return null;let a=$e(e,n);return a.length===0?null:(0,z.jsx)(`div`,{"data-slot":`report-cards`,className:`flex flex-col gap-3 [margin-block-start:1rem]`,children:a.map(e=>(0,z.jsx)(tt,{reference:e,messageKey:i},`${e.runId}:${e.artifactId}`))})}function tt({reference:e,messageKey:t}){let{artifactId:n,runId:r,label:i,href:o}=e,s=(0,R.useContext)(Qe),c=(0,R.useContext)(le);(0,R.useLayoutEffect)(()=>c?.register(n,r),[c,n,r]);let f=a(r,n),p=l(),m=d();if(f.isError)return(0,z.jsx)(u,{id:W(t,n),"data-slot":`report-card-fallback`,to:o,state:{readerFrom:p.pathname+p.search},children:i});let h=f.data?.artifact;if(h&&!ue(h.name))return null;let g=new URLSearchParams(p.search);g.set(`report`,n),g.set(`card`,t);let _=new URLSearchParams(p.search).has(`report`)?p.state:null,v=new URLSearchParams(p.search);v.delete(`report`),v.delete(`card`);let y=`${p.pathname}${v.size?`?${v}`:``}`,b=window.navigation,x={reportCardEntry:!0,reportReturnTo:_?.reportReturnTo??y,reportReturnKey:_?.reportReturnKey??b?.currentEntry?.key,reportScrollTop:_?.reportScrollTop},S={pathname:p.pathname,search:`?${g}`,hash:new URL(o,`https://cockpit.invalid`).hash};return(0,z.jsxs)(`section`,{"data-slot":`report-card`,"data-artifact-id":n,"data-report-run-id":r,"aria-busy":f.isPending,className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card p-3 text-foreground`,children:[(0,z.jsx)(`h3`,{className:`break-words text-sm font-medium`,children:h?ye(h):i}),(0,z.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`HTML report`}),(0,z.jsx)(u,{id:W(t,n),to:S,state:x,onClick:e=>{if(e.button!==0||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault(),s?.(t);let n=x.reportScrollTop??(document.querySelector(`[data-slot="thread-transcript"]`)??document.querySelector(`[data-slot="main"]`))?.scrollTop;m(S,{state:{...x,reportScrollTop:n}})},className:`inline-flex min-h-11 min-w-11 items-center self-start rounded-md border border-border px-3 text-sm active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring ${f.isPending?`text-soft-foreground`:`text-accent-text`}`,children:`Read report`})]})}var nt={message:!0,reasoning:!0,tool:!0,hook:!0};function rt(e){return Object.hasOwn(nt,e)&&nt[e]}var G=e=>e.kind===`tool`,it=e=>e.kind===`conversation`,at=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,ot=(e,t,n)=>`${e} ${e===1?t:n}`;function st(e,t){let n=[];return e>0&&n.push(ot(e,`file`,`files`)),t>0&&n.push(ot(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function ct(e){return`${e} earlier tool call${e===1?``:`s`}`}var lt=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function ut(e){for(let t of lt)if(e.startsWith(`${t} `)&&e.length>t.length+1)return{verb:t===`Task:`?`Task`:t,detail:e.slice(t.length+1)};return{verb:e}}var dt=new WeakMap;function ft(e){let t=dt.get(e);if(t)return t;let n=pt(e);return dt.set(e,n),n}function pt(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)&&!((e.kind===`reasoning`||e.kind===`message`)&&e.text.trim()===``)),n=new Set(t.filter(G).map(e=>e.id)),r=new Map,i=[];for(let e of t){let t=rt(e.kind)&&`parentItemId`in e&&e.parentItemId!==void 0&&e.parentItemId!==e.id&&n.has(e.parentItemId)?e.parentItemId:void 0;if(t===void 0)i.push(e);else{let n=r.get(t);n?n.push(e):r.set(t,[e])}}let a=[],o=[],s=()=>{if(o.length>=2){let e=o.filter(e=>e.toolKind===`read`).length;a.push({kind:`context-group`,id:`group:${o[0].id}`,tools:o,files:e,searches:o.length-e,label:st(e,o.length-e)})}else for(let e of o)a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]});o=[]},c=[],l=()=>{if(c.length!==0){for(let e of mt(c).batches)a.push({kind:`worker-conversation`,id:`worker:${e.messages[0].id}`,batches:[e]});c=[]}};for(let e of i){if(it(e)){s(),c.push(e);continue}l(),G(e)&&at(e)&&!r.has(e.id)?o.push(e):(s(),G(e)?a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]}):a.push({kind:`entry`,id:e.id,entry:e}))}s(),l();let u=e=>e.kind===`context-group`||e.kind===`tool-card`&&e.item.status===`completed`,d=e=>e.kind===`context-group`?e.tools.length:1,f=[],p=[],m=()=>{if(p.length>3){let e=p.slice(0,p.length-3);f.push({kind:`streak`,id:`streak:${e[0].id}`,count:e.reduce((e,t)=>e+d(t),0),blocks:e}),f.push(...p.slice(p.length-3))}else f.push(...p);p=[]};for(let e of a)u(e)?p.push(e):(m(),f.push(e));return m(),f}function mt(e){let t=[];for(let n of e){let e=t.at(-1);n.messageKind===`request`&&e?.kind===`request`&&e.senderRunId===n.senderRunId&&e.text===n.text&&e.messages[0].relationship===`peer`==(n.relationship===`peer`)&&!e.messages.some(e=>e.recipientRunId===n.recipientRunId)?e.messages.push(n):t.push({id:`worker-batch:${n.messageId}`,kind:n.messageKind,text:n.text,senderRunId:n.senderRunId,messages:[n]})}return{kind:`worker-conversation`,id:`worker:${e[0].id}`,batches:t}}var K=new Map,ht=(0,R.createContext)(null);function q(){return(0,R.useContext)(ht)}function gt({runId:e,children:t}){let n=(0,R.useMemo)(()=>({get:t=>K.get(e)?.get(t),set:(t,n)=>{let r=K.get(e)??new Map;r.set(t,n),K.set(e,r)}}),[e]);return(0,z.jsx)(ht.Provider,{value:n,children:t})}function _t(e){return e.scrollTop<Math.max(600,e.clientHeight)}function vt(e,t){let n=t.find(({bottom:t})=>t>e);return n===void 0?void 0:{key:n.key,offset:n.top-e}}function yt(e,t,n,r,i){if(n===void 0)return i;let a=r.find(({key:e})=>e===n.key);return a===void 0?i:e+(a.top-t-n.offset)}function bt(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function xt(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var St=new Map;function Ct(e,t){St.set(e,t)}function wt(e){return St.get(e)}var J=new Map;function Tt(e,t){J.set(e,{...t,...t.rowKeys?{rowKeys:[...t.rowKeys]}:{}})}function Et(e){return J.get(e)}function Dt(e,t,n){let r=J.get(e);if(!r||r.rows!==t)return;let i=r.rowKeys;if(!(n&&i&&(n.length!==t||i.length!==t||!n.every((e,t)=>e===i[t]))))return r.cache}var Ot=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),kt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`medium`}),At=new Intl.DateTimeFormat(void 0,{weekday:`short`,month:`short`,day:`numeric`}),jt=new Intl.DateTimeFormat(void 0,{weekday:`short`,year:`numeric`,month:`short`,day:`numeric`}),Mt=new Intl.DateTimeFormat(void 0,{dateStyle:`full`});function Y(e){if(typeof e!=`string`||e===``)return;let t=new Date(e);return Number.isFinite(t.getTime())?t:void 0}function X(e){let t=Y(e);return t===void 0?void 0:Ot.format(t)}function Nt(e){let t=Y(e);return t===void 0?void 0:kt.format(t)}var Z=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;function Pt(e){let t=Y(e);return t===void 0?void 0:Z(t)}function Ft(e,t=new Date){let n=Y(e);if(n===void 0)return;let r=Z(n);return r===Z(t)?`Today`:r===Z(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1))?`Yesterday`:(n.getFullYear()===t.getFullYear()?At:jt).format(n)}function It(e,t){let n=Y(e),r=Y(t);if(n===void 0||r===void 0)return;let i=Math.round((r.getTime()-n.getTime())/1e3);if(i<0)return;if(i<60)return`${i}s`;let a=Math.floor(i/60);return a<60?`${a}m ${String(i%60).padStart(2,`0`)}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,`0`)}m`}function Lt({ts:e}){let t=X(e);return t===void 0?null:(0,z.jsx)(`time`,{"data-slot":`message-time`,dateTime:e,title:Nt(e),className:`text-xs leading-none text-soft-foreground`,children:t})}function Rt({startedAt:e,completedAt:t}){let n=X(t);if(n===void 0)return null;let r=It(e,t);return(0,z.jsxs)(`div`,{"data-slot":`turn-time`,className:`flex items-center gap-1.5 px-0.5 text-xs leading-none text-soft-foreground`,children:[(0,z.jsx)(`time`,{dateTime:t,title:Nt(t),children:n}),r===void 0?null:(0,z.jsxs)(`span`,{title:`Replied in ${r}`,children:[`· `,r]})]})}function zt({ts:e}){let t=Ft(e),n=Y(e);if(t===void 0||n===void 0)return null;let r=Mt.format(n);return(0,z.jsxs)(`div`,{"data-slot":`day-separator`,role:`separator`,"aria-label":t===`Today`||t===`Yesterday`?`${t}, ${r}`:r,className:`flex items-center gap-3 py-1 text-xs font-medium text-soft-foreground`,children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),(0,z.jsx)(`time`,{dateTime:Pt(e),title:r,children:t}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]})}var Bt={assistant:`Agent message`,error:`Runner error`,"session.error":`Session error`,"step-end":`Step status`,lifecycle:`Run status`};function Vt({note:e}){return e.icon===`handoff`?(0,z.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,"data-icon":`handoff`,className:`flex items-start gap-2 px-0.5 text-xs text-muted-foreground`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`mt-[-1px] flex size-5 shrink-0 items-center justify-center rounded-full border border-border text-success`,children:(0,z.jsx)(me,{className:`size-3`})}),(0,z.jsx)(`span`,{className:`min-w-0 break-words`,children:e.text})]}):e.details&&e.details.length>0?(0,z.jsxs)(M,{"data-slot":`note-line`,"data-tone":e.tone,className:`group/failure min-w-0 px-0.5 text-xs`,children:[(0,z.jsxs)(`div`,{className:i(`flex items-start gap-2`,e.tone===`danger`?`text-semantic-red`:`text-soft-foreground`),children:[(0,z.jsxs)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap wrap-anywhere`,children:[e.tone===`danger`?`✗ `:null,e.text]}),(0,z.jsxs)(j,{"data-slot":`note-details-toggle`,className:`inline-flex shrink-0 items-center gap-1 rounded-sm px-1.5 py-0.5 text-xs font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11 max-md:min-w-11 max-md:justify-center pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center`,children:[(0,z.jsx)(g,{"aria-hidden":`true`,className:`size-3 shrink-0 motion-safe:transition-transform group-data-[state=open]/failure:rotate-90`}),`Details`]})]}),(0,z.jsx)(A,{children:(0,z.jsx)(`ul`,{"data-slot":`note-details`,className:`mbs-1.5 flex flex-col gap-1 border-s border-border ps-3 font-mono text-xs text-muted-foreground`,children:e.details.map((e,t)=>(0,z.jsxs)(`li`,{className:`min-w-0 whitespace-pre-wrap wrap-anywhere`,children:[(0,z.jsxs)(`span`,{className:`font-sans font-medium text-foreground`,children:[Bt[e.source],`:`,` `]}),e.text]},`${e.source}:${t}`))})})]}):(0,z.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:i(`px-0.5 text-xs`,e.tone===`danger`?`text-semantic-red`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:null,e.text]})}var Ht={user:{label:`YOUR MESSAGE`,speaker:`Your message`,classes:`border-message-user-border bg-message-user-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-user-accent`,accent:`text-message-user-accent`,body:`max-md:text-[12px]`},agent:{label:`AGENT RESPONSE`,speaker:`Agent response`,classes:`border-message-agent-border bg-message-agent-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-agent-accent`,accent:`text-message-agent-accent`,body:`text-[15px] md:text-[14px]`}};function Q({role:e,children:t,className:n,ts:r,headerActions:a,...o}){let s=Ht[e],c=r===void 0?void 0:X(r);return(0,z.jsxs)(`article`,{...o,"data-role":e,"aria-label":s.speaker,className:i(`flex w-full min-w-0 flex-col gap-2 self-stretch rounded-[8px] border p-3 md:px-4 md:py-[14px]`,s.classes,n),children:[(0,z.jsxs)(`p`,{className:i(`m-0 flex w-full min-w-0 items-start gap-2 text-xs leading-[1.2] font-semibold tracking-[0.6px] uppercase`,s.accent),children:[(0,z.jsxs)(`span`,{className:`inline-flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 normal-case tracking-normal`,children:[(0,z.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 uppercase tracking-[0.6px]`,children:[(0,z.jsx)(te,{"aria-hidden":`true`,className:`size-4 shrink-0`}),s.label]}),a]}),c===void 0?null:(0,z.jsx)(`span`,{className:`shrink-0 font-normal tracking-normal normal-case`,children:(0,z.jsx)(Lt,{ts:r})})]}),(0,z.jsx)(`div`,{className:i(`min-w-0 break-words text-[14px] text-foreground select-text [overflow-wrap:anywhere]`,s.body,`leading-[1.6]`),children:t})]})}var Ut=[],Wt=(0,R.memo)(function({text:e,imageCount:t=0,images:n=Ut,ts:i,onEdit:a,onRemove:o,editLabel:s=`Edit message`,removeLabel:l=`Remove message`,children:u}){let d=t-n.length,[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(e),[_,v]=(0,R.useState)(!1),[y,x]=(0,R.useState)(),S=()=>{g(e),x(void 0),m(!0)},C=async()=>{let t=h.trim();if(!t||t===e){m(!1);return}v(!0),x(void 0);try{await a?.(t),m(!1)}catch(e){x(e instanceof Error?e.message:`Could not save the message`)}finally{v(!1)}},w=async()=>{v(!0),x(void 0);try{await o?.()}catch(e){x(e instanceof Error?e.message:`Could not remove the message`)}finally{v(!1)}};return p?(0,z.jsxs)(Q,{role:`user`,ts:i,"data-slot":`user-bubble`,"data-editing":`true`,children:[(0,z.jsx)(`textarea`,{autoFocus:!0,"aria-label":`Edit the message`,value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),m(!1)):e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),C())},className:`block max-h-[220px] min-h-[60px] w-full resize-none rounded-md bg-background px-2 py-1.5 text-[14px] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`}),(0,z.jsxs)(`span`,{className:`mt-1.5 flex justify-end gap-1.5`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>m(!1),disabled:_,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm px-2 text-xs font-medium text-muted-foreground hover:bg-background hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:`Cancel`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void C(),disabled:_,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm bg-action px-2 text-xs font-semibold text-action-foreground hover:brightness-[0.96] focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:_?(0,z.jsx)(E,{className:`size-3.5 animate-spin`}):`Save`})]}),y?(0,z.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-xs text-danger`,children:y}):null]}):(0,z.jsxs)(Q,{role:`user`,ts:i,"data-slot":`user-bubble`,className:`group`,children:[a||o?(0,z.jsxs)(`span`,{"data-slot":`bubble-actions`,className:`mb-1 flex justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[a?(0,z.jsx)(`button`,{type:`button`,"aria-label":s,onClick:S,disabled:_,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,z.jsx)(we,{className:`size-3.5`})}):null,o?(0,z.jsx)(`button`,{type:`button`,"aria-label":l,onClick:()=>void w(),disabled:_,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-danger focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,z.jsx)(b,{className:`size-3.5`})}):null]}):null,y?(0,z.jsx)(`p`,{role:`alert`,className:`mb-1 text-xs text-danger`,children:y}):null,u??(0,z.jsx)(I,{breaks:!0,children:e}),n.length>0?(0,z.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap items-center justify-end gap-1.5`,children:n.map(e=>c(e.split(`/`).pop()??``)?(0,z.jsx)(_e,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e):(0,z.jsxs)(`a`,{href:r(e),download:!0,"data-slot":`user-file`,className:`inline-flex min-h-11 min-w-11 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background/60 px-2 py-1 text-xs text-muted-foreground hover:text-foreground`,children:[(0,z.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()})]},e))}):null,d>0?(0,z.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[d,` image`,d>1?`s`:``,` attached`]}):null]})}),Gt=`inline-flex h-11 min-w-11 items-center justify-center gap-1 rounded-sm px-2 text-xs font-medium text-soft-foreground hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,Kt=[`[data-streamdown="code-block-actions"]`,`[data-streamdown="code-copy-button"]`,`[data-streamdown="code-block-copy-button"]`,`[data-streamdown="code-block-header"]`].join(`,`);function qt(e,t){let n=e.cloneNode(!0);n.querySelectorAll(Kt).forEach(e=>e.remove());let r=Ze(t);return[...n.querySelectorAll(`button[data-streamdown="link"]`)].forEach(e=>{let t=e.textContent??``,i=r.findIndex(e=>e.label===t);if(i<0)return;let a=r.splice(i,1)[0];if(!a||!H(a.href))return;let o=n.ownerDocument.createElement(`a`);o.setAttribute(`href`,a.href),o.setAttribute(`data-streamdown`,`link`),o.textContent=e.textContent,e.replaceWith(o)}),n.innerHTML}async function Jt(e,t,n){if(e===`markdown`){if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(t);return}if(!navigator.clipboard?.write||typeof ClipboardItem>`u`||!n)throw Error(`Clipboard unavailable`);let r=qt(n,t);await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:`text/html`}),"text/plain":new Blob([t],{type:`text/plain`})})])}var Yt=(0,R.memo)(function({text:e,ts:t,messageKey:n}){let r=(0,R.useRef)(null),[i,a]=(0,R.useState)(null),[o,s]=(0,R.useState)(null),c=(0,R.useRef)(null);(0,R.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=async t=>{c.current!==null&&clearTimeout(c.current),a(null),s(null);try{await Jt(t,e,r.current),a(t),c.current=setTimeout(()=>a(null),2e3)}catch{s(`Couldn't copy to the clipboard`)}};return(0,z.jsxs)(Q,{role:`agent`,ts:t,"data-slot":`assistant-message`,headerActions:(0,z.jsxs)(`span`,{"data-slot":`bubble-actions`,className:`flex items-center gap-0.5`,children:[(0,z.jsxs)(`button`,{type:`button`,"aria-label":`Copy reply`,onClick:()=>void l(`html`),className:Gt,children:[(0,z.jsx)(S,{className:`size-3.5`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{"aria-live":`polite`,children:i===`html`?`Copied`:`Copy`})]}),(0,z.jsxs)(`button`,{type:`button`,"aria-label":`Copy reply as markdown`,onClick:()=>void l(`markdown`),className:Gt,children:[(0,z.jsx)(P,{className:`size-3.5`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{"aria-live":`polite`,children:i===`markdown`?`Copied`:`Copy markdown`})]})]}),children:[o?(0,z.jsx)(`p`,{role:`alert`,className:`mb-1 text-xs text-danger`,children:o}):null,(0,z.jsx)(`div`,{ref:r,children:(0,z.jsx)(I,{breaks:!0,children:e})}),(0,z.jsx)(et,{text:e,messageKey:n})]})});function Xt({incident:e}){let t=s().data;if(!t)return null;let n=o(t,e.provider);return(0,z.jsxs)(`div`,{role:`alert`,"data-slot":`provider-auth-required`,className:`rounded-md border border-danger/30 bg-danger/5 px-3.5 py-3`,children:[(0,z.jsxs)(`p`,{className:`text-[13px] font-semibold text-foreground`,children:[`This run needed `,n,` authorization`]}),(0,z.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Review `,n,` settings before retrying.`]}),(0,z.jsx)(N,{to:`/settings/agent-defaults#providers`,className:`mt-2 inline-flex text-xs font-medium text-foreground underline-offset-2 hover:underline`,children:`Open provider settings`})]})}var Zt=(0,R.memo)(function({text:e}){let t=(0,R.useId)();if(e.trim()===``)return null;let n=e.split(`
|
|
5
|
-
`,1)[0]??``,r=n.length<e.length;return(0,z.jsxs)(M,{"data-slot":`reasoning`,className:`group/reasoning min-w-0`,children:[(0,z.jsxs)(`div`,{id:t,className:`relative flex w-full items-center gap-1.5 rounded-md p-0.5 text-left text-[13px] text-soft-foreground hover:text-muted-foreground`,children:[(0,z.jsx)(g,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]/reasoning:rotate-90`}),(0,z.jsx)(`span`,{className:`shrink-0`,children:`Thinking — `}),(0,z.jsx)(`div`,{className:`min-w-0 truncate text-muted-foreground max-md:[&_*]:inline max-md:[&_*]:whitespace-nowrap`,children:(0,z.jsx)(I,{inline:!0,children:n})}),r?(0,z.jsx)(`span`,{"aria-hidden":!0,children:`…`}):null,(0,z.jsx)(j,{"aria-labelledby":t,className:`absolute inset-0 rounded-md focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`})]}),(0,z.jsx)(A,{children:(0,z.jsx)(`div`,{className:`px-6 py-1.5 text-[13px] leading-[1.6] text-soft-foreground`,children:(0,z.jsx)(I,{children:e})})})]})});function Qt(){return(0,z.jsxs)(`div`,{"data-slot":`working-indicator`,className:`flex items-center gap-2 py-1 text-[13px] text-soft-foreground`,children:[(0,z.jsx)(E,{role:`status`,"aria-label":`Working`,className:`size-3.5 shrink-0 animate-spin`}),(0,z.jsx)(`span`,{className:`shimmer font-medium`,children:`Working…`})]})}var $t={read:P,edit:we,delete:b,move:Se,search:p,execute:O,think:xe,fetch:ee,task:h,plan:m,other:y},en=e=>e.split(`
|
|
6
|
-
`).length;function tn({text:e,streaming:t}){let[n,r]=(0,R.useState)(!1),a=(0,R.useRef)(null),o=(0,R.useRef)(!0);(0,R.useEffect)(()=>{let e=a.current;t&&e&&o.current&&(e.scrollTop=e.scrollHeight)},[e,t]);let s=en(e),c=!t&&!n&&s>12;return(0,z.jsxs)(`div`,{"data-slot":`tool-output`,"data-clamped":c?`true`:void 0,children:[(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsx)(`div`,{ref:a,onScroll:t?e=>{o.current=bt(e.currentTarget)}:void 0,className:i(`overflow-x-auto`,t&&`max-h-[216px] overflow-y-auto`,c&&`max-h-[216px] overflow-y-hidden`),children:(0,z.jsx)(`pre`,{className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre text-muted-foreground`,children:e})}),c?(0,z.jsx)(`div`,{"data-slot":`tool-output-fade`,"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-b from-transparent to-card-2`}):null]}),!t&&s>12?(0,z.jsx)(`button`,{type:`button`,"data-slot":`tool-output-toggle`,onClick:()=>r(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-xs font-medium text-soft-foreground hover:text-foreground`,children:n?`Show less`:`Show all ${s} lines`}):null]})}function nn({diffs:e}){return(0,z.jsx)(z.Fragment,{children:e.map((e,t)=>(0,z.jsxs)(`div`,{"data-slot":`diff-preview`,className:`min-w-0`,children:[(0,z.jsx)(`div`,{className:`border-b border-border/50 px-4 py-1.5 font-mono text-xs wrap-anywhere text-muted-foreground`,children:e.path}),(0,z.jsx)(`pre`,{className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:e.unified===void 0?[...rn(e.oldText).map((e,t)=>(0,z.jsxs)(`span`,{className:`block bg-diff-del px-4 text-muted-foreground`,children:[`- `,e]},`old-${t}`)),...rn(e.newText).map((e,t)=>(0,z.jsxs)(`span`,{className:`block bg-diff-add px-4`,children:[`+ `,e]},`new-${t}`))]:e.unified.split(`
|
|
7
|
-
`).map((e,t)=>(0,z.jsx)(an,{text:e},t))})]},`${e.path}:${t}`))})}function rn(e){return e==null||e===``?[]:e.replace(/\n$/,``).split(`
|
|
8
|
-
`)}function an({text:e}){return(0,z.jsx)(`span`,{className:i(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del text-muted-foreground`,e.startsWith(`@@`)&&`text-soft-foreground`),children:e})}function on(e){return e.toolKind===`execute`&&e.status===`running`&&e.output!==void 0}function sn(e){let t=e.status===`running`||e.status===`pending`,n=ut(e.title),{verb:r,detail:i}=e.toolKind===`execute`&&n.detail===void 0?{verb:`Ran`,detail:e.title}:n;return{busy:t,verb:r,detail:i,expandedCommand:(e.toolKind===`execute`?qe(e.input):D(e.name).toolKind===e.toolKind?ne(e.name,e.input):void 0)??i,Icon:$t[e.toolKind]??y}}function cn(e,t){return e.output!==void 0&&e.output!==``||e.error!==void 0&&e.error!==``||e.diffs!==void 0&&e.diffs.length>0||t>0}function ln({item:e,busy:t}){return(0,z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[t?(0,z.jsx)(E,{role:`status`,"aria-label":`Running`,className:`size-3.5 animate-spin text-soft-foreground`}):null,e.status===`failed`?(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`failed`}):null,e.status===`declined`?(0,z.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`declined`}):null,e.toolKind===`execute`&&typeof e.exitCode==`number`?(0,z.jsx)(`span`,{"data-slot":`tool-exit`,className:i(`rounded-full px-2 py-px font-mono text-xs font-semibold`,e.exitCode===0?`bg-success/10 text-success`:`bg-danger/10 text-danger`),children:e.exitCode}):null]})}function un({item:e,command:t,busy:n,nested:r,cacheKey:i,renderNested:a}){return(0,z.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[t===void 0?null:(0,z.jsx)(`pre`,{"data-slot":`tool-command`,className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:t}),e.error!==void 0&&e.error!==``?(0,z.jsx)(`div`,{"data-slot":`tool-error`,className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre-wrap wrap-anywhere text-signal-word-red`,children:e.error}):null,e.diffs!==void 0&&e.diffs.length>0?(0,z.jsx)(nn,{diffs:e.diffs}):null,e.output!==void 0&&e.output!==``?(0,z.jsx)(tn,{text:e.output,streaming:n}):null,r.length>0?(0,z.jsx)(`div`,{"data-slot":`tool-nested`,className:`flex flex-col gap-2 border-l-2 border-border py-2.5 pr-3 pl-3 ml-4 my-2`,children:a?.(r,i??e.id)}):null]})}function dn({item:e,nested:t=[],cacheKey:n,renderNested:r}){let a=q(),[o,s]=(0,R.useState)(()=>n===void 0?null:a?.get(n)??null),c=e=>{n!==void 0&&a?.set(n,e),s(e)},{busy:l,verb:u,detail:d,expandedCommand:f,Icon:p}=sn(e),m=cn(e,t.length),h=f!==void 0||m,_=h&&(o??(m&&on(e)));return(0,z.jsxs)(M,{"data-slot":`tool-card`,"data-status":e.status,"data-kind":e.toolKind,open:_,onOpenChange:c,className:i(`min-w-0 overflow-hidden rounded-md border bg-card`,e.status===`failed`?`border-danger/25`:`border-border`),children:[(0,z.jsxs)(j,{disabled:!h,className:`group flex min-h-[28px] w-full items-center gap-1.5 px-2.5 py-0.5 text-left text-[13px] enabled:hover:bg-muted`,children:[(0,z.jsx)(g,{"aria-hidden":!0,className:i(`size-3 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`,!h&&`invisible`)}),(0,z.jsx)(p,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:i(`shrink-0 font-semibold`,l&&`shimmer`,e.status===`declined`&&`text-muted-foreground`),children:u}),d===void 0?null:(0,z.jsx)(`code`,{title:d,className:`block min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground`,children:d}),(0,z.jsx)(ln,{item:e,busy:l})]}),(0,z.jsx)(A,{children:(0,z.jsx)(un,{item:e,command:f,busy:l,nested:t,cacheKey:n,renderNested:r})})]})}function fn(e){let t=e.name??e.event,n=t.indexOf(`:`);return n>0?`${t.slice(0,n)} · ${t.slice(n+1)}`:t}function pn({item:e,cacheKey:t}){let n=q(),[r,a]=(0,R.useState)(()=>t===void 0?!1:n?.get(t)??!1),o=e=>{t!==void 0&&n?.set(t,e),a(e)},s=e.status!==`completed`,c=e.entries.some(e=>e.kind===`context`),l=(e.stdout??``)!==``||(e.stderr??``)!==``,u=fn(e);return(0,z.jsxs)(M,{"data-slot":`hook-card`,"data-status":e.status,open:r,onOpenChange:o,className:i(`min-w-0 overflow-hidden rounded-md border bg-card`,s?`border-danger/25`:`border-border`),children:[(0,z.jsxs)(j,{className:`group flex min-h-[28px] w-full items-center gap-1.5 px-2.5 py-0.5 text-left text-[13px] hover:bg-muted`,children:[(0,z.jsx)(g,{"aria-hidden":!0,className:`size-3 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,z.jsx)(be,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Hook`}),(0,z.jsx)(`code`,{title:u,className:`block min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground`,children:u}),(0,z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[s?(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.status}):c?(0,z.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`context`}):null,s&&typeof e.exitCode==`number`&&e.exitCode!==0?(0,z.jsx)(`span`,{"data-slot":`hook-exit`,className:`rounded-full bg-danger/10 px-2 py-px font-mono text-xs font-semibold text-danger`,children:e.exitCode}):null]})]}),(0,z.jsx)(A,{children:(0,z.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[e.entries.map((e,t)=>(0,z.jsx)(`pre`,{"data-slot":`hook-entry`,"data-kind":e.kind,className:i(`px-3 py-2 font-mono text-xs leading-[1.7] whitespace-pre-wrap [overflow-wrap:anywhere]`,(e.kind===`error`||e.kind===`stop`)&&`text-signal-word-red`),children:e.text},t)),e.source===void 0?null:(0,z.jsx)(`p`,{"data-slot":`hook-source`,className:`px-3 pb-2 font-mono text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:e.source}),l?(0,z.jsxs)(M,{className:`border-t border-border`,children:[(0,z.jsxs)(j,{"data-slot":`hook-raw-toggle`,className:`group flex w-full items-center gap-1 px-3 py-1 text-left text-xs text-muted-foreground hover:text-foreground`,children:[(0,z.jsx)(g,{"aria-hidden":!0,className:`size-3 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),`Raw output${typeof e.exitCode==`number`?` · exit ${e.exitCode}`:``}`]}),(0,z.jsxs)(A,{children:[e.stdout?(0,z.jsx)(`pre`,{"data-slot":`hook-stdout`,className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.stdout}):null,e.stderr?(0,z.jsx)(`pre`,{"data-slot":`hook-stderr`,className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-signal-word-red [overflow-wrap:anywhere]`,children:e.stderr}):null]})]}):null]})})]})}function mn({group:e,scope:t}){return(0,z.jsxs)(M,{"data-slot":`ctx-group`,className:`min-w-0`,children:[(0,z.jsxs)(j,{className:`group flex h-[34px] tabular-nums w-full items-center gap-2 rounded-md px-2 -mx-2 text-left text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,z.jsx)(g,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),e.label]}),(0,z.jsx)(A,{children:(0,z.jsx)(`div`,{className:`flex flex-col gap-1.5 pt-1.5 pl-4`,children:e.tools.map(e=>(0,z.jsx)(dn,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`},e.id))})})]})}function hn({count:e,children:t}){return(0,z.jsxs)(M,{"data-slot":`tool-streak`,className:`min-w-0`,children:[(0,z.jsxs)(j,{className:`group flex items-center gap-1.5 rounded-md p-0.5 tabular-nums text-left text-xs text-soft-foreground hover:text-muted-foreground`,children:[(0,z.jsx)(g,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),ct(e)]}),(0,z.jsx)(A,{children:(0,z.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:t})})]})}function gn({image:e}){return(0,z.jsx)(_e,{"data-slot":`thread-image`,src:e.url,alt:e.name??`image from the agent session`,className:`max-h-72 max-w-full self-start rounded-lg border border-border`})}var _n={finish:`Closed when the task finished`,superseded:`Closed when the worker went on`,"parent-stopped":`Closed when the parent stopped`,"worker-stopped":`Closed when the worker stopped`,undeliverable:`Closed: not delivered`};function vn(e,t,n){return`${e.header}: ${n?.trim()||t.join(`, `)}`}function yn(e,t,n,r=``){let i=e.map((e,r)=>vn(e,t[r]??[],n[r])).join(`
|
|
9
|
-
`),a=r.trim();return a?`${i}\n\nAdditional comments:\n${a}`:i}function bn({ask:e,run:t,projectId:n,onShowOrigin:r,onAnswered:i,renderFreeTextReply:a,onStop:o,stopping:s=!1,onFinish:c,finishing:l=!1,mode:u,onModeChange:d,hideReplyBody:f=!1,delivery:p,surface:m=`transcript`,fold:h}){let g=m===`transcript`&&e.context?(0,z.jsx)($,{text:e.context}):null;if(e.resolved)return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.context?(0,z.jsx)($,{text:e.context}):null,(0,z.jsxs)(Q,{role:`user`,"data-slot":`ask-card`,"data-resolved":`true`,children:[(0,z.jsx)(`span`,{className:`text-soft-foreground`,children:e.closed?_n[e.closed]:e.answeredBy===`parent`?`Answered by parent`:`Answered`}),(0,z.jsx)(Ae,{ask:e})]})]});let _=e.placement===`pinned`&&r?r:void 0;return e.routedToParent?(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,(0,z.jsx)(xn,{ask:e,runId:t.id,surface:m,onShowOrigin:_})]}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,(0,z.jsx)(Tn,{ask:e,run:t,projectId:n,surface:m,onShowOrigin:_,onAnswered:i,renderFreeTextReply:a,onStop:o,stopping:s,onFinish:c,finishing:l,controlledMode:u,onModeChange:d,hideReplyBody:f,delivery:p,fold:h})]})}function $({text:e}){return(0,z.jsx)(Q,{role:`agent`,children:(0,z.jsx)(`div`,{"data-slot":`ask-context`,role:`region`,"aria-label":`Context`,className:`break-words text-sm text-foreground`,children:(0,z.jsx)(I,{breaks:!0,children:e})})})}function xn({ask:e,runId:t,surface:n,onShowOrigin:r}){let[i,a]=(0,R.useState)(!1),o=(0,R.useRef)(null),s=n===`decision-zone`&&!!e.context;return(0,z.jsxs)(`div`,{"data-slot":`ask-card`,"data-resolved":`false`,"data-ask-id":e.id,"data-pinned":e.placement===`pinned`?`true`:void 0,"data-routed":`parent`,className:`rounded-xl border border-card-edge bg-card shadow-card px-3 py-2.5`,children:[(0,z.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`text-xs font-medium text-link-foreground`,children:`The agent is asking its parent`}),s?(0,z.jsx)(k,{ref:o,type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-show-context`,className:`ms-auto px-2 text-xs font-medium text-link-foreground underline underline-offset-4`,onClick:()=>a(!0),children:`Show context`}):null]}),(0,z.jsx)(`div`,{"data-slot":`ask-body`,className:`flex flex-col gap-3`,children:e.questions.map((e,t)=>(0,z.jsxs)(`div`,{role:`group`,"aria-label":e.question,children:[(0,z.jsx)(`div`,{className:`mb-0.5 flex items-center gap-2`,children:(0,z.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e.header})}),(0,z.jsx)(`p`,{className:`mb-1.5 break-words text-sm font-semibold text-foreground`,children:e.question}),e.options?(0,z.jsx)(`ul`,{className:`flex list-disc flex-col gap-0.5 pl-5 text-[13px] text-muted-foreground`,children:e.options.map(e=>(0,z.jsxs)(`li`,{className:`break-words`,children:[(0,z.jsx)(`span`,{className:`text-foreground`,children:e.label}),e.description?(0,z.jsxs)(`span`,{children:[`: `,e.description]}):null]},e.label))}):(0,z.jsx)(`p`,{"data-slot":`ask-open-routed`,className:`text-[13px] text-muted-foreground`,children:`Open question: answered in words, with no options.`})]},e.id??t))}),(0,z.jsxs)(`div`,{"data-slot":`ask-footer`,className:`mt-2.5 flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(`p`,{"data-slot":`ask-routed-hint`,className:`text-xs text-muted-foreground`,children:[`Routed to parent: answer it in the`,` `,e.parentRunId?(0,z.jsx)(N,{to:`/tasks/${e.parentRunId}`,className:`font-medium text-foreground underline underline-offset-4`,children:`parent task`}):`parent task`,`.`]}),!s&&r?(0,z.jsx)(Ve,{onShowOrigin:r,className:`ms-auto`}):null]}),s&&e.context?(0,z.jsx)(He,{open:i,onOpenChange:a,runId:t,context:e.context,onShowOrigin:r,returnFocusRef:o}):null]})}function Sn(e,t,n,r,i){let a=t.blockedBy!==void 0,o=e.questions,s=o.length>1,c=o.length,[l,u]=(0,R.useState)(`options`),d=n??l,f=e=>{u(e),r?.(e)},[p,m]=(0,R.useState)(0),[h,g]=(0,R.useState)({}),[_,v]=(0,R.useState)({}),[y,b]=(0,R.useState)(``),[x,S]=(0,R.useState)(!1),[C,w]=(0,R.useState)(``),[T,ee]=(0,R.useState)(!1),E=s&&p===c,te=o.length===1&&o[0]?.options!==void 0&&o[0]?.multiSelect!==!0&&!x&&y.trim()===``;de(Object.values(h).some(e=>e.length>0)||Object.values(_).some(e=>e.trim()!==``)||y.trim()!==``||C.trim()!==``);let D=(e,t)=>g(n=>({...n,[e]:t})),ne=e=>v(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n}),O=e=>{D(e,[]),v(t=>({...t,[e]:t[e]??``}))},k=o.some((e,t)=>!e.options||_[t]!==void 0),A=o.filter((e,t)=>V(t,h,_)).length,j=A===o.length,M=async e=>{let n=await t.send(e);return n===void 0&&i?.(),n};return{delivery:t,blocked:a,questions:o,stepped:s,commentStepIndex:c,mode:d,setMode:f,stepIndex:p,setStepIndex:m,selections:h,otherAnswers:_,setOtherAnswers:v,additionalComment:y,setAdditionalComment:b,singleCommentOpen:x,setSingleCommentOpen:S,freeTextDraft:C,setFreeTextDraft:w,contextOpen:T,setContextOpen:ee,onCommentStep:E,oneTap:te,setQuestion:D,clearOtherAnswer:ne,selectOther:O,hasOtherAnswer:k,answeredCount:A,allAnswered:j,deliver:M,sendAll:()=>void M(yn(o,h,_,y)),sendFreeText:()=>{let e=C.trim();e&&M(e).then(e=>{e===void 0&&w(``)})}}}function Cn({state:e,renderFreeTextReply:t}){let n=(0,R.useId)(),r=e.delivery.isPending||e.blocked;if(e.mode===`reply`)return(0,z.jsx)(Le,{value:e.freeTextDraft,onValueChange:e.setFreeTextDraft,disabled:r,renderFreeTextReply:t});if(e.onCommentStep)return(0,z.jsx)(Ie,{questions:e.questions,selections:e.selections,otherAnswers:e.otherAnswers,comment:e.additionalComment,disabled:r,onCommentChange:e.setAdditionalComment,onJumpToQuestion:e.setStepIndex});let i=e.stepped?Math.min(e.stepIndex,e.questions.length-1):0,a=e.questions[i];return a?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(jn,{question:a,disabled:r,selected:e.selections[i]??[],isOther:e.otherAnswers[i]!==void 0,otherAnswer:e.otherAnswers[i]??``,onSelect:t=>{e.blocked||(e.clearOtherAnswer(i),e.oneTap?e.deliver(vn(a,t)):e.setQuestion(i,t))},onOtherToggle:()=>{e.blocked||(e.otherAnswers[i]===void 0?e.selectOther(i):e.clearOtherAnswer(i))},onOtherChange:t=>e.setOtherAnswers(e=>({...e,[i]:t}))},a.id??i),!e.stepped&&e.singleCommentOpen?(0,z.jsxs)(`div`,{className:`pt-1`,children:[(0,z.jsx)(`label`,{htmlFor:n,className:`mb-1 block text-xs font-medium text-foreground`,children:`Additional comments (optional)`}),(0,z.jsx)(F,{id:n,"data-slot":`ask-additional-comment`,rows:2,value:e.additionalComment,disabled:r,placeholder:`Optional extra notes for the agent…`,onChange:t=>e.setAdditionalComment(t.target.value),className:`bg-card text-base md:text-[13px]`})]}):null]}):null}function wn({onFinish:e,finishing:t,onStop:n,stopping:r,onActionError:i}){if(!e&&!n)return null;let a=e=>{i(void 0),Promise.resolve(e()).catch(e=>{i(e instanceof Error?e.message:String(e))})};return(0,z.jsxs)(z.Fragment,{children:[e?(0,z.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-slot":`ask-finish`,disabled:t||r,title:`Close the session and mark this task done`,className:`px-3`,onClick:()=>a(e),children:t?`Finishing…`:`Finish`}):null,n?(0,z.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,disabled:r||t,className:`px-3`,onClick:()=>a(n),children:r?`Stopping…`:`Stop`}):null]})}function Tn(e){return e.delivery===void 0?(0,z.jsx)(En,{...e}):(0,z.jsx)(Dn,{...e,delivery:e.delivery})}function En(e){let t=he(e.run,e.projectId);return(0,z.jsx)(Dn,{...e,delivery:t})}function Dn({ask:e,run:t,surface:n,onShowOrigin:r,onAnswered:a,renderFreeTextReply:o,onStop:s,stopping:c,onFinish:l,finishing:u,controlledMode:d,onModeChange:f,hideReplyBody:p,delivery:m,fold:h}){let g=Sn(e,m,d,f,a),[_,v]=(0,R.useState)(void 0),y=(0,R.useRef)(null),b=n===`decision-zone`||o!==void 0,x=n===`decision-zone`&&!!e.context,S=g.mode===`reply`&&p,C=g.onCommentStep?`Comment (optional)`:`${g.stepIndex+1} of ${g.questions.length}`,w=h?.folded===!0,T=(0,z.jsx)(wn,{onFinish:l,finishing:u,onStop:s,stopping:c,onActionError:v});return(0,z.jsxs)(`div`,{"data-slot":`ask-card`,"data-resolved":`false`,"data-ask-id":e.id,"data-ask-mode":g.mode,"data-pinned":e.placement===`pinned`?`true`:void 0,"data-delivery":g.delivery.mode,"data-folded":h?String(w):void 0,className:i(`rounded-xl border border-accent-strong/30 bg-accent-strong/[0.04] [html:not(.light)_&]:bg-card`,S&&!w&&`rounded-b-none border-b-0`),children:[w?(0,z.jsx)(kn,{state:g,stepLabel:C,onOpen:()=>h.onFoldChange(!1)}):(0,z.jsx)(On,{state:g,stepLabel:C,showModeSwitch:b,hasSheetContext:x,contextButtonRef:y,onShowOrigin:r,onFold:h?()=>h.onFoldChange(!0):void 0,replyDockedOutside:S,renderFreeTextReply:o,stopControl:T,actionError:_}),x&&e.context?(0,z.jsx)(He,{open:g.contextOpen,onOpenChange:g.setContextOpen,runId:t.id,context:e.context,onShowOrigin:r,returnFocusRef:y}):null]})}function On({state:e,stepLabel:t,showModeSwitch:n,hasSheetContext:r,contextButtonRef:i,onShowOrigin:a,onFold:o,replyDockedOutside:s,renderFreeTextReply:c,stopControl:l,actionError:u}){let d=e.additionalComment.trim()!==``;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Me,{stepped:e.stepped,mode:e.mode,onModeChange:e.setMode,showModeSwitch:n,stepLabel:t,hasSheetContext:r,showContextButtonRef:i,onOpenContext:()=>e.setContextOpen(!0),onShowOrigin:r?void 0:a,onFold:o}),e.stepped&&e.mode===`options`?(0,z.jsx)(Fe,{questions:e.questions,stepIndex:e.stepIndex,selections:e.selections,otherAnswers:e.otherAnswers,hasComment:d,onSelectStep:e.setStepIndex}):null,s?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{"data-slot":`ask-body`,className:`flex flex-col gap-2.5 px-3 py-2.5`,children:(0,z.jsx)(Cn,{state:e,renderFreeTextReply:c})}),(0,z.jsxs)(`div`,{"data-slot":`ask-footer`,className:`flex shrink-0 flex-col gap-2 border-t border-border/70 px-3 py-2`,children:[(0,z.jsx)(An,{state:e,hasComment:d,resuming:e.delivery.mode===`resume`,hasCustomReply:c!==void 0,stopControl:l,compact:o!==void 0}),(0,z.jsx)(Be,{blockedBy:e.delivery.blockedBy,reason:e.delivery.reason,error:e.delivery.error??u})]})]})]})}function kn({state:e,stepLabel:t,onOpen:n}){let r=e.questions[Math.min(e.stepIndex,e.questions.length-1)];return e.onCommentStep?(0,z.jsx)(Pe,{tag:`Comment`,text:`Add a comment, then send.`,position:void 0,onOpen:n}):(0,z.jsx)(Pe,{tag:r?.header??``,text:r?.question??``,position:e.stepped?t:void 0,onOpen:n})}function An({state:e,hasComment:t,resuming:n,hasCustomReply:r,stopControl:i,compact:a}){return e.mode===`reply`?r?null:(0,z.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[i,(0,z.jsx)(k,{type:`button`,size:`sm`,className:`px-3.5`,disabled:e.delivery.isPending||e.blocked||e.freeTextDraft.trim()===``,onClick:e.sendFreeText,children:`Send reply`})]}):e.stepped?(0,z.jsx)(Re,{stepIndex:e.stepIndex,questionCount:e.questions.length,answeredCount:e.answeredCount,allAnswered:e.allAnswered,hasComment:t,resuming:n,disabled:e.delivery.isPending||e.blocked,onBack:()=>e.setStepIndex(e=>Math.max(0,e-1)),onNext:()=>e.setStepIndex(t=>Math.min(e.commentStepIndex,t+1)),onOpenComment:()=>e.setStepIndex(e.commentStepIndex),onSend:e.sendAll,questions:e.questions,selections:e.selections,otherAnswers:e.otherAnswers,stopControl:i,compact:a}):(0,z.jsx)(ze,{oneTap:e.oneTap,hasOtherAnswer:e.hasOtherAnswer,allowComment:e.questions[0]?.allowFreeText!==!1,commentOpen:e.singleCommentOpen,hasComment:t,resuming:n,disabled:e.delivery.isPending||e.blocked||!e.allAnswered,onToggleComment:()=>e.setSingleCommentOpen(e=>!e),onSend:e.sendAll,stopControl:i,compact:a})}function jn({question:e,disabled:t,selected:n,isOther:r,otherAnswer:a,onSelect:o,onOtherToggle:s,onOtherChange:c}){let l=(0,R.useId)(),u=(0,R.useRef)(null),d=(0,R.useRef)(r),f=e.options,p=f!==void 0,m=p&&e.multiSelect===!0;(0,R.useEffect)(()=>{let e=r&&!d.current;d.current=r,e&&p&&u.current?.focus()},[r,p]);let h=e=>{if(!m){o([e]);return}o(n.includes(e)?n.filter(t=>t!==e):[...n,e])};return(0,z.jsxs)(`div`,{"data-slot":`ask-question`,role:`group`,"aria-label":e.question,children:[(0,z.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,z.jsx)(`span`,{className:`shrink-0 rounded-md bg-accent-strong px-1.5 py-0.5 text-xs font-semibold uppercase tracking-wide text-accent-strong-foreground`,children:e.header}),(0,z.jsx)(`p`,{className:`min-w-0 flex-1 break-words text-sm font-semibold text-foreground`,children:e.question}),m?(0,z.jsx)(`span`,{className:`ms-auto text-xs text-soft-foreground`,children:`select all that apply`}):null]}),f?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{"data-slot":`ask-options`,className:`grid grid-cols-1 gap-1.5 sm:grid-cols-2 sm:gap-2`,children:[f.map(e=>{let r=n.includes(e.label);return(0,z.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":r,onClick:()=>h(e.label),className:i(`flex min-h-11 w-full flex-col items-start justify-start content-start gap-0.5 rounded-md border px-2.5 py-1.5 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50`,r?`border-accent-strong bg-accent-strong/15 ring-1 ring-accent-strong/30 pointer-hover:border-accent-strong pointer-hover:bg-accent-strong/15`:`border-border bg-card pointer-hover:border-accent-strong/50 pointer-hover:bg-accent-strong/[0.08]`),children:[(0,z.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 text-[13px] font-semibold text-foreground`,children:[m?(0,z.jsx)(`span`,{"aria-hidden":`true`,className:i(`flex size-4 shrink-0 items-center justify-center rounded border text-[12px]`,r?`border-accent-strong bg-accent-strong text-accent-strong-foreground`:`border-soft-foreground`),children:r?`✓`:``}):null,(0,z.jsx)(`span`,{className:`min-w-0 break-words`,children:e.label})]}),e.description?(0,z.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:e.description}):null]},e.label)}),e.allowFreeText===!1?null:(0,z.jsx)(k,{type:`button`,variant:`outline`,"aria-pressed":r,"aria-expanded":r,"aria-controls":r?l:void 0,disabled:t,onClick:s,size:`block`,className:i(`px-2.5`,f.length%2==0&&`sm:col-span-2`,r&&`border-accent-strong bg-accent-strong/15 ring-1 ring-accent-strong/30 pointer-hover:border-accent-strong pointer-hover:bg-accent-strong/15`),children:`Other`})]}),e.allowFreeText!==!1&&r?(0,z.jsxs)(`div`,{className:`mt-2`,children:[(0,z.jsx)(`label`,{htmlFor:l,className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Your answer`}),(0,z.jsx)(F,{ref:u,id:l,rows:2,value:a,disabled:t,placeholder:`Type your custom answer…`,onChange:e=>c(e.target.value),className:`bg-card text-base md:text-[13px]`})]}):null]}):(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{htmlFor:l,className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Your answer`}),(0,z.jsx)(F,{id:l,rows:2,value:a,disabled:t,placeholder:`Type your answer…`,onChange:e=>c(e.target.value),className:`bg-card text-base md:text-[13px]`})]})]})}export{q as A,Dt as C,yt as D,Ct as E,Qe as F,W as I,$e as L,ut as M,rt as N,xt as O,U as P,Ae as R,Et as S,Tt as T,X as _,pn as a,bt as b,Zt as c,Wt as d,Qt as f,Rt as g,Lt as h,mn as i,ft as j,gt as k,dn as l,zt as m,$ as n,gn as o,Vt as p,Yt as r,Xt as s,bn as t,hn as u,Pt as v,wt as w,_t as x,vt as y,L as z};
|