{"version":3,"file":"RefusedCard.cjs","names":["useT","useActiveSessionMeta","Dialog","DialogContent","DialogHeader","DialogTitle","Spinner","abbreviateCwd"],"sources":["../../../../src/web/features/connection/RefusedCard.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, Spinner } from '@agimon-ai/po-web-components';\n\nimport { abbreviateCwd } from '../../lib/sessionSummary';\nimport { useActiveSessionMeta } from '../../stores/sessionsStore';\n\nfunction Detail({ label, value }: { label: string; value: string }) {\n  return (\n    <div className=\"flex items-center justify-between gap-3\">\n      <span className=\"shrink-0 text-sm text-po-dim\">{label}</span>\n      <span className=\"truncate text-sm text-po-text\">{value}</span>\n    </div>\n  );\n}\n\n/** Shown when the focused session refuses this browser connection. */\nexport function RefusedCard() {\n  const t = useT();\n  const meta = useActiveSessionMeta();\n  if (meta === null || meta.attach !== 'refused') return null;\n\n  return (\n    <Dialog open>\n      <DialogContent\n        width=\"lg\"\n        data-testid=\"refused-card\"\n        aria-describedby={undefined}\n        className=\"w-[520px] border-po-red/50\"\n        onEscapeKeyDown={(event) => event.preventDefault()}\n        onPointerDownOutside={(event) => event.preventDefault()}\n        onInteractOutside={(event) => event.preventDefault()}\n      >\n        <DialogHeader className=\"border-po-red/40 bg-po-red/10\">\n          <DialogTitle data-testid=\"refused-title\" className=\"text-po-red\">\n            {t('webDashboard.refused.title', 'session already attached')}\n          </DialogTitle>\n          <Spinner className=\"text-po-red/70\" />\n        </DialogHeader>\n        <div className=\"flex flex-col gap-3 px-4 py-4\">\n          <p className=\"text-sm leading-relaxed text-po-text\">\n            {t(\n              'webDashboard.refused.body',\n              'This session is already controlled by another browser connection. Po keeps retrying in the background.',\n            )}\n          </p>\n          <div className=\"flex flex-col gap-1.5 rounded border border-po-border bg-po-deep px-3 py-2.5\">\n            <Detail label={t('webDashboard.refused.reason', 'reason')} value={meta.reason || 'attach_error'} />\n            <Detail label=\"cwd\" value={abbreviateCwd(meta.summary.cwd)} />\n            <Detail\n              label={t('webDashboard.refused.retry', 'retry')}\n              value={t('webDashboard.refused.retryValue', 'automatic, with backoff')}\n            />\n          </div>\n          <p data-testid=\"refused-hint\" className=\"text-sm text-po-dim\">\n            {t(\n              'webDashboard.refused.hint',\n              'close the other browser connection and this one takes over on the next attempt.',\n            )}\n          </p>\n        </div>\n      </DialogContent>\n    </Dialog>\n  );\n}\n"],"mappings":";;;;;;AAMA,SAAS,OAAO,EAAE,OAAO,SAA2C;CAClE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAU;GAAgC,UAAA;EAAY,CAAA,GAC5D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAU;GAAiC,UAAA;EAAY,CAAA,CAC1D;;AAET;;AAGA,SAAgB,cAAc;CAC5B,MAAM,KAAA,GAAIA,uBAAAA,KAAAA,CAAK;CACf,MAAM,OAAOC,sBAAAA,qBAAqB;CAClC,IAAI,SAAS,QAAQ,KAAK,WAAW,WAAW,OAAO;CAEvD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,QAAD;EAAQ,MAAA;EACN,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,6BAAAA,eAAD;GACE,OAAM;GACN,eAAY;GACZ,oBAAkB,KAAA;GAClB,WAAU;GACV,kBAAkB,UAAU,MAAM,eAAe;GACjD,uBAAuB,UAAU,MAAM,eAAe;GACtD,oBAAoB,UAAU,MAAM,eAAe;GAPrD,UAAA,CASE,iBAAA,GAAA,kBAAA,KAAA,CAACC,6BAAAA,cAAD;IAAc,WAAU;IAAxB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,aAAD;KAAa,eAAY;KAAgB,WAAU;KAChD,UAAA,EAAE,8BAA8B,0BAA0B;IAChD,CAAA,GACb,iBAAA,GAAA,kBAAA,IAAA,CA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