@overlordai/server 1.0.141 → 1.0.142

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.
Files changed (95) hide show
  1. package/package.json +4 -4
  2. package/public/assets/{AccessTokensPage-wTxicSeE.js → AccessTokensPage-DsNgVUdv.js} +1 -1
  3. package/public/assets/{AdminPage-CBovEOm4.js → AdminPage-NZC6yOHW.js} +1 -1
  4. package/public/assets/{AgentCliPage-DfqlFdFN.js → AgentCliPage-Bp8tQiWl.js} +1 -1
  5. package/public/assets/{ApiReferencePage-7TUHB8sC.js → ApiReferencePage-DXNSPdww.js} +1 -1
  6. package/public/assets/{ArchitecturePage-CycvJ1HW.js → ArchitecturePage-DFUNHKTN.js} +1 -1
  7. package/public/assets/{AuditLogPage-CqqCDd8o.js → AuditLogPage-Wtpr8CDi.js} +1 -1
  8. package/public/assets/{BindPlatformPage-BV5wNIi2.js → BindPlatformPage-Bp_NG22g.js} +1 -1
  9. package/public/assets/{BotIntegrationPage-B2bQytks.js → BotIntegrationPage-DuH_f_mp.js} +1 -1
  10. package/public/assets/{BotManage-BBBrqdT_.js → BotManage-CJ5GZ0HR.js} +1 -1
  11. package/public/assets/{BotSetupPage-DdDPniAd.js → BotSetupPage-Ct_gjzJt.js} +1 -1
  12. package/public/assets/{ChangelogPage-D5YE3BFH.js → ChangelogPage-DrpgpyjK.js} +1 -1
  13. package/public/assets/{CliReferencePage-yJgtPpFn.js → CliReferencePage-BiUl0LtI.js} +1 -1
  14. package/public/assets/{ConfirmStageDialog-BOGr-qSN.js → ConfirmStageDialog-BsoAtSes.js} +1 -1
  15. package/public/assets/{DeploymentPage-C0CXq8yl.js → DeploymentPage-DtlH8d7p.js} +1 -1
  16. package/public/assets/{DevWorkflowPage-I4Io3nYz.js → DevWorkflowPage-BoZm03L7.js} +1 -1
  17. package/public/assets/{DeveloperManage-Cy0LRyHh.js → DeveloperManage-hoNX7J5P.js} +1 -1
  18. package/public/assets/{DeveloperSetupPage-DzGCH2XG.js → DeveloperSetupPage-D3FDp-R7.js} +1 -1
  19. package/public/assets/{DocsIndexPage-PIEcc9gX.js → DocsIndexPage-ZBDBTreg.js} +1 -1
  20. package/public/assets/{DocsLayout-ChIliA9A.js → DocsLayout-CX3AKUlL.js} +1 -1
  21. package/public/assets/{DocsPrimitives-BMgSDhur.js → DocsPrimitives-B3qhkVFu.js} +1 -1
  22. package/public/assets/{EditProjectPage-D0rfXGZR.js → EditProjectPage-DKaSpnod.js} +1 -1
  23. package/public/assets/{EmptyState-Di2nOiOt.js → EmptyState-BKUHLcAb.js} +1 -1
  24. package/public/assets/{EnvVariablesPage-EmfRwttc.js → EnvVariablesPage-C2nu-wxe.js} +1 -1
  25. package/public/assets/{HomePage-CeOmNhkc.js → HomePage-CQ0Upd0D.js} +1 -1
  26. package/public/assets/{InfoRow-5vQ-_wWv.js → InfoRow-CBKDMEtd.js} +1 -1
  27. package/public/assets/{InstallationPage-CUbe1AD-.js → InstallationPage-0TO7IQzJ.js} +1 -1
  28. package/public/assets/{LandingPage-DSHGbkXw.js → LandingPage-YcgE-OTL.js} +1 -1
  29. package/public/assets/{LocalDevelopmentPage-fialPCnX.js → LocalDevelopmentPage-BDpTHWAo.js} +1 -1
  30. package/public/assets/{LoginPage-C4oz9yjV.js → LoginPage-F34Kt4ot.js} +1 -1
  31. package/public/assets/{MetricBar-ByQYVWVi.js → MetricBar-xV1juDz6.js} +1 -1
  32. package/public/assets/{NotFoundPage-BeayCSH7.js → NotFoundPage-DPZDwk1M.js} +1 -1
  33. package/public/assets/{OnboardingGuide-CqcX04SL.js → OnboardingGuide-C8QTC3cZ.js} +1 -1
  34. package/public/assets/{PermissionsPage-Bb2CYzMf.js → PermissionsPage-DsNmsUoe.js} +1 -1
  35. package/public/assets/{PipelineConfigPage-DwY__0Ag.js → PipelineConfigPage-D5gx3bIv.js} +1 -1
  36. package/public/assets/{PipelineEditorPage-FkckQpQX.js → PipelineEditorPage-18u7wxjE.js} +1 -1
  37. package/public/assets/{PlanPage-BOzGJd2h.js → PlanPage-Dds_7koM.js} +1 -1
  38. package/public/assets/{ProfilePage-CT_kk3a8.js → ProfilePage-D3YRdW9C.js} +1 -1
  39. package/public/assets/{ProjectDetailPage-B-t7L84T.js → ProjectDetailPage-1mftEUqP.js} +1 -1
  40. package/public/assets/{ProjectListPage-C2uStUVE.js → ProjectListPage-D62NmkBp.js} +1 -1
  41. package/public/assets/{PtyTerminal-BYXg_ahq.js → PtyTerminal-B3lRN-u1.js} +1 -1
  42. package/public/assets/{QuickAuth-CohuPihd.js → QuickAuth-DzYrNwL-.js} +1 -1
  43. package/public/assets/{RemoveMemberConfirmDialog-DLq9g7Td.js → RemoveMemberConfirmDialog-svHE4uU4.js} +1 -1
  44. package/public/assets/{ReviewAggregatePage-dWQb52Df.js → ReviewAggregatePage-Dq3hl9db.js} +1 -1
  45. package/public/assets/{ReviewPage-DtdWSBgK.js → ReviewPage-CNeCz2eT.js} +1 -1
  46. package/public/assets/{Select-BAl7H-Y0.js → Select-BMBYwPr-.js} +1 -1
  47. package/public/assets/{SettingsPage-qCfF6rzU.js → SettingsPage-Ml3L-j5R.js} +1 -1
  48. package/public/assets/{Skeleton-DA5o8Wqi.js → Skeleton-9LGrFcdv.js} +1 -1
  49. package/public/assets/{SkillPage-C6p0dXbu.js → SkillPage-BGYJMqPr.js} +1 -1
  50. package/public/assets/{TaskDetailPage-D4sGfico.js → TaskDetailPage-Beto_Zqp.js} +1 -1
  51. package/public/assets/{TaskGuidePage-COT0chCI.js → TaskGuidePage-CKnugDRu.js} +1 -1
  52. package/public/assets/{TaskListPage-Bvq5ow7r.js → TaskListPage-CFri9wCk.js} +1 -1
  53. package/public/assets/{TaskStatusBadge-BdNFkrjU.js → TaskStatusBadge-B_S_xjEI.js} +1 -1
  54. package/public/assets/{TerminalHomePage-XJ5daAJC.js → TerminalHomePage-CDr4Mq6o.js} +1 -1
  55. package/public/assets/{TokenManage-JLFD8xAN.js → TokenManage-BqOEJDHV.js} +1 -1
  56. package/public/assets/{Tooltip-Bl8LCgWr.js → Tooltip-BFj-n88a.js} +1 -1
  57. package/public/assets/{TotpSetupPage-BGE6pDdn.js → TotpSetupPage-CI411-Y7.js} +1 -1
  58. package/public/assets/{WorkerDetailPage-Dd-IbO6r.js → WorkerDetailPage-DcMycoTh.js} +1 -1
  59. package/public/assets/{WorkerListPage-e4P55nJc.js → WorkerListPage-nPKvREXn.js} +1 -1
  60. package/public/assets/{WorkerOperationsPage-ioBw_i1j.js → WorkerOperationsPage-qgdLSK1X.js} +1 -1
  61. package/public/assets/{WorkerSetupGuidePage-CRicnVVm.js → WorkerSetupGuidePage-DHbju_7j.js} +1 -1
  62. package/public/assets/{WorkerSetupPage-DXOlNqUZ.js → WorkerSetupPage-D0Cob5nl.js} +1 -1
  63. package/public/assets/{agent-type-options-BVIYXf2V.js → agent-type-options-CdJpMswW.js} +1 -1
  64. package/public/assets/{arrow-left-CTo0KHGY.js → arrow-left-BOJ_pZwC.js} +1 -1
  65. package/public/assets/{arrow-right-C9oQyTKw.js → arrow-right-GWPYDcKr.js} +1 -1
  66. package/public/assets/{bot-B301pflD.js → bot-DZ_48uoa.js} +1 -1
  67. package/public/assets/{chevron-down-B0Leook1.js → chevron-down-DiFQzkq3.js} +1 -1
  68. package/public/assets/{chevron-left-59qctCaF.js → chevron-left-PB0m_3-R.js} +1 -1
  69. package/public/assets/{chevron-right-XfJqITCa.js → chevron-right-Bsbm1nYp.js} +1 -1
  70. package/public/assets/{chevron-up-BW2PVBfH.js → chevron-up-CvYNL872.js} +1 -1
  71. package/public/assets/{copy-DEWCNXDf.js → copy-DR5cQtVj.js} +1 -1
  72. package/public/assets/{download-7d5kMwpH.js → download-FpaVrNQK.js} +1 -1
  73. package/public/assets/{external-link-DjBNV7ga.js → external-link-CiQhHCsl.js} +1 -1
  74. package/public/assets/{file-text-DHEz_RFq.js → file-text-Gk2VyRBd.js} +1 -1
  75. package/public/assets/{git-fork-cRLOBM6a.js → git-fork-CLaKXs0Y.js} +1 -1
  76. package/public/assets/{index-eKvCyU64.js → index-CfvO5R0v.js} +2 -2
  77. package/public/assets/{key-D5BbAzTj.js → key-b2-JaSCL.js} +1 -1
  78. package/public/assets/{loader-circle-B_f_h4fq.js → loader-circle-_Xw40aLD.js} +1 -1
  79. package/public/assets/{pencil-CTTWvWuS.js → pencil-z5Zqj0qg.js} +1 -1
  80. package/public/assets/{play-Cqf1Kvc7.js → play-D2z1wzeo.js} +1 -1
  81. package/public/assets/{plus-DwBKB0x6.js → plus-DDEIETPT.js} +1 -1
  82. package/public/assets/{rotate-ccw-CZR8KOZn.js → rotate-ccw-DryDtPrl.js} +1 -1
  83. package/public/assets/{scroll-text-BeQeZkLb.js → scroll-text-DdAPH940.js} +1 -1
  84. package/public/assets/{settings-CsdOqob5.js → settings-DLSb7OkM.js} +1 -1
  85. package/public/assets/{skip-forward-BqiRx2ZQ.js → skip-forward-Dshgkb5J.js} +1 -1
  86. package/public/assets/{status-colors-yfNzOmz-.js → status-colors-w6Ie5LWO.js} +1 -1
  87. package/public/assets/{task-constants-BWLt-ivk.js → task-constants-DpDhF7YW.js} +1 -1
  88. package/public/assets/{task.store-BDZwafPm.js → task.store-QLdgw-z_.js} +1 -1
  89. package/public/assets/{trash-2-CXPG2vQr.js → trash-2-DN1oshyp.js} +1 -1
  90. package/public/assets/{useFetch-CVFGit7a.js → useFetch-DpOLDSFc.js} +1 -1
  91. package/public/assets/{users-DmefWRaM.js → users-DrLwCx8Z.js} +1 -1
  92. package/public/assets/{wifi-BJIfMBKB.js → wifi-B4XgJ6JW.js} +1 -1
  93. package/public/assets/{workflow-CuZasRLA.js → workflow-Cd6zqDgi.js} +1 -1
  94. package/public/index.html +1 -1
  95. package/public/sw.js +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-DSHGbkXw.js","assets/arrow-right-C9oQyTKw.js","assets/bot-B301pflD.js","assets/workflow-CuZasRLA.js","assets/users-DmefWRaM.js","assets/copy-DEWCNXDf.js","assets/HomePage-CeOmNhkc.js","assets/TaskStatusBadge-BdNFkrjU.js","assets/status-colors-yfNzOmz-.js","assets/Skeleton-DA5o8Wqi.js","assets/OnboardingGuide-CqcX04SL.js","assets/chevron-right-XfJqITCa.js","assets/date-RFA7-ZGs.js","assets/useFetch-CVFGit7a.js","assets/Tooltip-Bl8LCgWr.js","assets/TerminalHomePage-XJ5daAJC.js","assets/ConfirmStageDialog-BOGr-qSN.js","assets/loader-circle-B_f_h4fq.js","assets/rotate-ccw-CZR8KOZn.js","assets/PtyTerminal-BYXg_ahq.js","assets/PtyTerminal-6GBZ9nXN.css","assets/file-text-DHEz_RFq.js","assets/task.store-BDZwafPm.js","assets/Select-BAl7H-Y0.js","assets/chevron-down-B0Leook1.js","assets/task-constants-BWLt-ivk.js","assets/agent-type-options-BVIYXf2V.js","assets/plus-DwBKB0x6.js","assets/chevron-up-BW2PVBfH.js","assets/wifi-BJIfMBKB.js","assets/TaskListPage-Bvq5ow7r.js","assets/git-fork-cRLOBM6a.js","assets/EmptyState-Di2nOiOt.js","assets/chevron-left-59qctCaF.js","assets/TaskDetailPage-D4sGfico.js","assets/arrow-left-CTo0KHGY.js","assets/play-Cqf1Kvc7.js","assets/external-link-DjBNV7ga.js","assets/skip-forward-BqiRx2ZQ.js","assets/PlanPage-BOzGJd2h.js","assets/ReviewPage-DtdWSBgK.js","assets/ReviewAggregatePage-dWQb52Df.js","assets/WorkerListPage-e4P55nJc.js","assets/MetricBar-ByQYVWVi.js","assets/WorkerSetupGuidePage-CRicnVVm.js","assets/key-D5BbAzTj.js","assets/download-7d5kMwpH.js","assets/settings-CsdOqob5.js","assets/WorkerDetailPage-Dd-IbO6r.js","assets/InfoRow-5vQ-_wWv.js","assets/trash-2-CXPG2vQr.js","assets/ProjectListPage-C2uStUVE.js","assets/ProjectDetailPage-B-t7L84T.js","assets/RemoveMemberConfirmDialog-DLq9g7Td.js","assets/pencil-CTTWvWuS.js","assets/EditProjectPage-D0rfXGZR.js","assets/PipelineEditorPage-FkckQpQX.js","assets/ProfilePage-CT_kk3a8.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-wTxicSeE.js","assets/CliReferencePage-yJgtPpFn.js","assets/DocsPrimitives-BMgSDhur.js","assets/QuickAuth-CohuPihd.js","assets/ApiReferencePage-7TUHB8sC.js","assets/SkillPage-C6p0dXbu.js","assets/DocsLayout-ChIliA9A.js","assets/InstallationPage-CUbe1AD-.js","assets/DeveloperSetupPage-DzGCH2XG.js","assets/WorkerSetupPage-DXOlNqUZ.js","assets/BotSetupPage-DdDPniAd.js","assets/LocalDevelopmentPage-fialPCnX.js","assets/DeploymentPage-C0CXq8yl.js","assets/PipelineConfigPage-DwY__0Ag.js","assets/DevWorkflowPage-I4Io3nYz.js","assets/EnvVariablesPage-EmfRwttc.js","assets/ArchitecturePage-CycvJ1HW.js","assets/AgentCliPage-DfqlFdFN.js","assets/TaskGuidePage-COT0chCI.js","assets/DocsIndexPage-PIEcc9gX.js","assets/AdminPage-CBovEOm4.js","assets/scroll-text-BeQeZkLb.js","assets/DeveloperManage-Cy0LRyHh.js","assets/BotManage-BBBrqdT_.js","assets/TokenManage-JLFD8xAN.js","assets/AuditLogPage-CqqCDd8o.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-YcgE-OTL.js","assets/arrow-right-GWPYDcKr.js","assets/bot-DZ_48uoa.js","assets/workflow-Cd6zqDgi.js","assets/users-DrLwCx8Z.js","assets/copy-DR5cQtVj.js","assets/HomePage-CQ0Upd0D.js","assets/TaskStatusBadge-B_S_xjEI.js","assets/status-colors-w6Ie5LWO.js","assets/Skeleton-9LGrFcdv.js","assets/OnboardingGuide-C8QTC3cZ.js","assets/chevron-right-Bsbm1nYp.js","assets/date-RFA7-ZGs.js","assets/useFetch-DpOLDSFc.js","assets/Tooltip-BFj-n88a.js","assets/TerminalHomePage-CDr4Mq6o.js","assets/ConfirmStageDialog-BsoAtSes.js","assets/loader-circle-_Xw40aLD.js","assets/rotate-ccw-DryDtPrl.js","assets/PtyTerminal-B3lRN-u1.js","assets/PtyTerminal-6GBZ9nXN.css","assets/file-text-Gk2VyRBd.js","assets/task.store-QLdgw-z_.js","assets/Select-BMBYwPr-.js","assets/chevron-down-DiFQzkq3.js","assets/task-constants-DpDhF7YW.js","assets/agent-type-options-CdJpMswW.js","assets/plus-DDEIETPT.js","assets/chevron-up-CvYNL872.js","assets/wifi-B4XgJ6JW.js","assets/TaskListPage-CFri9wCk.js","assets/git-fork-CLaKXs0Y.js","assets/EmptyState-BKUHLcAb.js","assets/chevron-left-PB0m_3-R.js","assets/TaskDetailPage-Beto_Zqp.js","assets/arrow-left-BOJ_pZwC.js","assets/play-D2z1wzeo.js","assets/external-link-CiQhHCsl.js","assets/skip-forward-Dshgkb5J.js","assets/PlanPage-Dds_7koM.js","assets/ReviewPage-CNeCz2eT.js","assets/ReviewAggregatePage-Dq3hl9db.js","assets/WorkerListPage-nPKvREXn.js","assets/MetricBar-xV1juDz6.js","assets/WorkerSetupGuidePage-DHbju_7j.js","assets/key-b2-JaSCL.js","assets/download-FpaVrNQK.js","assets/settings-DLSb7OkM.js","assets/WorkerDetailPage-DcMycoTh.js","assets/InfoRow-CBKDMEtd.js","assets/trash-2-DN1oshyp.js","assets/ProjectListPage-D62NmkBp.js","assets/ProjectDetailPage-1mftEUqP.js","assets/RemoveMemberConfirmDialog-svHE4uU4.js","assets/pencil-z5Zqj0qg.js","assets/EditProjectPage-DKaSpnod.js","assets/PipelineEditorPage-18u7wxjE.js","assets/ProfilePage-D3YRdW9C.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-DsNgVUdv.js","assets/CliReferencePage-BiUl0LtI.js","assets/DocsPrimitives-B3qhkVFu.js","assets/QuickAuth-DzYrNwL-.js","assets/ApiReferencePage-DXNSPdww.js","assets/SkillPage-BGYJMqPr.js","assets/DocsLayout-CX3AKUlL.js","assets/InstallationPage-0TO7IQzJ.js","assets/DeveloperSetupPage-D3FDp-R7.js","assets/WorkerSetupPage-D0Cob5nl.js","assets/BotSetupPage-Ct_gjzJt.js","assets/LocalDevelopmentPage-BDpTHWAo.js","assets/DeploymentPage-DtlH8d7p.js","assets/PipelineConfigPage-D5gx3bIv.js","assets/DevWorkflowPage-BoZm03L7.js","assets/EnvVariablesPage-C2nu-wxe.js","assets/ArchitecturePage-DFUNHKTN.js","assets/AgentCliPage-Bp8tQiWl.js","assets/TaskGuidePage-CKnugDRu.js","assets/DocsIndexPage-ZBDBTreg.js","assets/AdminPage-NZC6yOHW.js","assets/scroll-text-DdAPH940.js","assets/DeveloperManage-hoNX7J5P.js","assets/BotManage-CJ5GZ0HR.js","assets/TokenManage-BqOEJDHV.js","assets/AuditLogPage-Wtpr8CDi.js"])))=>i.map(i=>d[i]);
2
2
  var a_=Object.defineProperty;var Pm=i=>{throw TypeError(i)};var n_=(i,u,s)=>u in i?a_(i,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[u]=s;var Ve=(i,u,s)=>n_(i,typeof u!="symbol"?u+"":u,s),_s=(i,u,s)=>u.has(i)||Pm("Cannot "+s);var q=(i,u,s)=>(_s(i,u,"read from private field"),s?s.call(i):u.get(i)),Pt=(i,u,s)=>u.has(i)?Pm("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(i):u.set(i,s),Kt=(i,u,s,o)=>(_s(i,u,"write to private field"),o?o.call(i,s):u.set(i,s),s),ke=(i,u,s)=>(_s(i,u,"access private method"),s);var eh=(i,u,s,o)=>({set _(f){Kt(i,u,f,s)},get _(){return q(i,u,o)}});(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function s(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=s(f);fetch(f.href,m)}})();function l_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var vs={exports:{}},ti={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -249,4 +249,4 @@ overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"reg
249
249
  overlord setup worker`,setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:`npm install -g @overlordai/developer-cli
250
250
  ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header",docs_nav_getting_started:"// getting started",docs_nav_guides:"// guides",docs_nav_reference:"// reference",docs_nav_other:"// other",docs_installation:"installation",docs_developer_setup:"developer setup",docs_worker_setup:"worker setup",docs_bot_setup:"bot setup",docs_local_dev:"local development",docs_worker_ops:"worker operations",docs_deployment:"deployment",docs_bot_integration:"bot integration",docs_pipeline:"pipeline config",docs_dev_workflow:"dev workflow",docs_cli:"cli reference",docs_api:"api reference",docs_task_guide:"task guide",docs_skill:"skill reference",docs_permissions:"permissions & roles",docs_env_vars:"environment variables",docs_architecture:"architecture",docs_changelog:"changelog",docs_back:"< back",docs_all_title:"// all documentation",docs_all_subtitle:"browse all guides, references, and resources",docs_desc_installation:"install overlord server and cli tools",docs_desc_developer_setup:"set up your local development environment",docs_desc_worker_setup:"register and configure worker machines",docs_desc_bot_setup:"connect lark or slack bots to overlord",docs_desc_local_dev:"run and debug overlord locally",docs_desc_worker_ops:"manage worker lifecycle and monitoring",docs_desc_deployment:"deploy overlord to production servers",docs_desc_bot_integration:"interactive cards, adapter pattern, troubleshooting",docs_desc_pipeline:"define multi-stage task pipelines",docs_desc_dev_workflow:"git workflow, branching, and merge requests",docs_desc_cli:"cli command reference",docs_desc_api:"http api endpoint reference",docs_desc_task_guide:"task modes, task types, forks, and task relationships",docs_desc_skill:"custom skill definitions and configuration",docs_desc_permissions:"roles, access control, and authorization",docs_desc_env_vars:"environment variables for server and worker",docs_desc_architecture:"system architecture and component overview",docs_desc_changelog:"version history and release notes",docs_agent_cli:"agent cli",docs_desc_agent_cli:"claude, cursor, and codex cli integration and flag mapping"},onboarding:{getting_started:"// getting started",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},pwa_install:{title:"overlord://install",command:"overlord --install",desc_1:"add to home screen for standalone app experience",desc_2:"works offline · full-screen · instant launch",install:"y — install",skip:"n — skip",ios_command:"install --manual",ios_step_1:"tap share button in safari toolbar",ios_step_2:'scroll down → tap "add to home screen"',ios_step_3:'tap "add" to confirm'},pwa_update:{message:"new version available",reload:"reload"},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started",confirm_create_title:"create task",confirm_create_message:`create a [{taskType}] task in project [{projectKey}]?
251
251
 
252
- "{description}"`},plan:{title:"plan",create:"create plan",description_placeholder:"describe what you want to build...",spec_generated:"spec generated",decompose:"decompose into tasks",save_only:"save spec only",no_plans:"no plan tasks yet",view_spec:"view spec"},review:{title:"review",pending:"pending review",in_progress:"in progress",history:"history",launch:"launch review",select_agents:"select review agents",approve_fix:"fix issues",skip_fix:"no fix needed",review_again:"review again",round:"round",no_reviews:"no reviews yet",issues_summary:"{critical} critical · {warning} warning · {suggestion} suggestion",description_placeholder:"review instructions (optional)...",empty_report_warning:"review completed but no structured report was produced. check the terminal output for details.",fix_push_info:"selected agent will push fixes to the source branch",waiting_agents:"waiting for review agents to finish...",skip_fix_label:"review only (skip fix stage)"}};function Ob(i,u){const s=u.split(".");let o=i;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Cb(i,u){return u?i.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):i}function Yr(i,u){return Cb(Ob(zb,i),u)}function Vt(){return{t:y.useCallback((u,s)=>Yr(u,s),[])}}function dp(){const{theme:i,setTheme:u}=fp(),{t:s}=Vt(),o=i==="dark"||i==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return h.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?h.jsx(bb,{size:16}):h.jsx(pb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",g=s.statusText??"",b=`${m} ${g}`.trim(),_=b?`status code ${b}`:"an unknown error";super(`Request failed with ${_}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class mp extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class As extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new mp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const Sh=(()=>{let i=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return i&&!u})(),Db=typeof globalThis.AbortController=="function",hp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nb=typeof globalThis.ReadableStream=="function",Mb=typeof globalThis.FormData=="function",pp=["get","post","put","patch","head","delete"],Ub={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},zs=2147483647,qb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,gp=Symbol("stop");class yp{constructor(u){Ve(this,"options");this.options=u}}const Lb=i=>new yp(i),Hb={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Bb={next:!0},Yb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Gb=i=>{if(!i)return 0;if(i instanceof FormData){let u=0;for(const[s,o]of i)u+=qb,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(i instanceof Blob)return i.size;if(i instanceof ArrayBuffer)return i.byteLength;if(typeof i=="string")return new TextEncoder().encode(i).length;if(i instanceof URLSearchParams)return new TextEncoder().encode(i.toString()).length;if("byteLength"in i)return i.byteLength;if(typeof i=="object"&&i!==null)try{const u=JSON.stringify(i);return new TextEncoder().encode(u).length}catch{return 0}return 0},_p=(i,u,s)=>{let o,f=0;return i.pipeThrough(new TransformStream({transform(m,g){if(g.enqueue(m),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},Vb=(i,u)=>{if(!i.body)return i;if(i.status===204)return new Response(null,{status:i.status,statusText:i.statusText,headers:i.headers});const s=Math.max(0,Number(i.headers.get("content-length"))||0);return new Response(_p(i.body,s,u),{status:i.status,statusText:i.statusText,headers:i.headers})},Xb=(i,u,s)=>{if(!i.body)return i;const o=Gb(s??i.body);return new Request(i,{duplex:"half",body:_p(i.body,o,u)})},_n=i=>i!==null&&typeof i=="object",Nr=(...i)=>{for(const u of i)if((!_n(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...i)},vp=(i={},u={})=>{const s=new globalThis.Headers(i),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[m,g]of f.entries())o&&g==="undefined"||g===void 0?s.delete(m):s.set(m,g);return s};function Mr(i,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(i[s]??[],u[s]??[])}const bp=(i={},u={})=>({beforeRequest:Mr(i,u,"beforeRequest"),beforeRetry:Mr(i,u,"beforeRetry"),afterResponse:Mr(i,u,"afterResponse"),beforeError:Mr(i,u,"beforeError")}),Qb=(i,u)=>{const s=new URLSearchParams;for(const o of[i,u])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())s.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(_n(o))for(const[f,m]of Object.entries(o))m!==void 0&&s.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,g]of f.entries())s.append(m,g)}return s},Ws=(...i)=>{let u={},s={},o={},f;const m=[];for(const g of i)if(Array.isArray(g))Array.isArray(u)||(u=[]),u=[...u,...g];else if(_n(g)){for(let[b,_]of Object.entries(g)){if(b==="signal"&&_ instanceof globalThis.AbortSignal){m.push(_);continue}if(b==="context"){if(_!=null&&(!_n(_)||Array.isArray(_)))throw new TypeError("The `context` option must be an object");u={...u,context:_==null?{}:{...u.context,..._}};continue}if(b==="searchParams"){_==null?f=void 0:f=f===void 0?_:Qb(f,_);continue}_n(_)&&b in u&&(_=Ws(u[b],_)),u={...u,[b]:_}}_n(g.hooks)&&(o=bp(o,g.hooks),u.hooks=o),_n(g.headers)&&(s=vp(s,g.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),m.length>0&&(m.length===1?u.signal=m[0]:hp?u.signal=AbortSignal.any(m):u.signal=m.at(-1)),u},Zb=i=>pp.includes(i)?i.toUpperCase():i,Kb=["get","put","head","delete","options","trace"],Jb=[408,413,429,500,502,503,504],$b=[413,429,503],kh={limit:2,methods:Kb,statusCodes:Jb,afterStatusCodes:$b,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:i=>.3*2**(i-1)*1e3,jitter:void 0,retryOnTimeout:!1},Wb=(i={})=>{if(typeof i=="number")return{...kh,limit:i};if(i.methods&&!Array.isArray(i.methods))throw new Error("retry.methods must be an array");if(i.methods&&(i.methods=i.methods.map(s=>s.toLowerCase())),i.statusCodes&&!Array.isArray(i.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(i).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Fb(i,u,s,o){return new Promise((f,m)=>{const g=setTimeout(()=>{s&&s.abort(),m(new Ms(i))},o.timeout);o.fetch(i,u).then(f).catch(m).then(()=>{clearTimeout(g)})})}async function Ib(i,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(u.reason)}const m=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},i)})}const Pb=(i,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Yb)&&!(o in Hb)&&(!(o in i)||o in Bb)&&(s[o]=u[o]);return s},e0=i=>i===void 0?!1:Array.isArray(i)?i.length>0:i instanceof URLSearchParams?i.size>0:typeof i=="object"?Object.keys(i).length>0:typeof i=="string"?i.trim().length>0:!!i;function t0(i){return i instanceof Ns||(i==null?void 0:i.name)===Ns.name}function a0(i){return i instanceof Ms||(i==null?void 0:i.name)===Ms.name}var Jr,xp,Jt,Bt,rt,Q,$a,ea,vn,oe,Gr,Sp,Us,Vr,Ja,qs,kp,ri,Xr,Ls;const ui=class ui{constructor(u,s={}){Pt(this,oe);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,m,g;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:vp(q(this,rt).headers,s.headers),hooks:bp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Zb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Wb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof q(this,rt)!="string"&&!(q(this,rt)instanceof URL||q(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(q(this,Q).prefixUrl&&typeof q(this,rt)=="string"){if(q(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");q(this,Q).prefixUrl.endsWith("/")||(q(this,Q).prefixUrl+="/"),Kt(this,rt,q(this,Q).prefixUrl+q(this,rt))}Db&&hp&&(Kt(this,ea,q(this,Q).signal??q(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal),Sh&&(q(this,Q).duplex="half"),q(this,Q).json!==void 0&&(q(this,Q).body=((m=(f=q(this,Q)).stringifyJson)==null?void 0:m.call(f,q(this,Q).json))??JSON.stringify(q(this,Q).json),q(this,Q).headers.set("content-type",q(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(q(this,rt)instanceof globalThis.Request&&(Mb&&q(this,Q).body instanceof globalThis.FormData||q(this,Q).body instanceof URLSearchParams)&&!o&&q(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(q(this,rt),q(this,Q)),e0(q(this,Q).searchParams)){const _="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(g=ui,Jr,xp).call(g,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,_);this.request=new globalThis.Request(p,q(this,Q))}if(q(this,Q).onUploadProgress){if(typeof q(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,oe,Ls).call(this,this.request,q(this,Q).body??void 0)}}static create(u,s){var g,b,_;const o=new ui(u,s),f=async()=>{var w,k,N,Y,L,H,B,U,K,X,ue,ce;if(typeof q(o,Q).timeout=="number"&&q(o,Q).timeout>zs)throw new RangeError(`The \`timeout\` option cannot be greater than ${zs}`);await Promise.resolve();let p=await ke(w=o,oe,kp).call(w);for(const ge of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await ge(o.request,ke(N=o,oe,ri).call(N),F,{retryCount:q(o,Bt)})}catch(Pe){throw ke(Y=o,oe,Ja).call(Y,F),ke(L=o,oe,Ja).call(L,p),Pe}if(W instanceof yp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new As(W.options);const se=W instanceof globalThis.Response?W:p;F!==se&&ke(U=o,oe,Ja).call(U,F),p!==se&&ke(K=o,oe,Ja).call(K,p),p=se}if(ke(X=o,oe,Us).call(X,p),!p.ok&&(typeof q(o,Q).throwHttpErrors=="function"?q(o,Q).throwHttpErrors(p.status):q(o,Q).throwHttpErrors)){let ge=new Ns(p,o.request,ke(ue=o,oe,ri).call(ue));for(const F of q(o,Q).hooks.beforeError)ge=await F(ge,{retryCount:q(o,Bt)});throw ge}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const ge=p.clone();return ke(ce=o,oe,Ja).call(ce,p),Vb(ge,q(o,Q).onDownloadProgress)}return p},m=ke(g=o,oe,qs).call(g,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Vr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Vr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(Ub))p==="bytes"&&typeof((_=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:_.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await m;if(p==="json"){if(k.status===204)return"";const N=await k.text();return N===""?"":s.parseJson?s.parseJson(N):JSON.parse(N)}return k[p]()});return m}};Jr=new WeakSet,xp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,oe=new WeakSet,Gr=function(){const u=q(this,Q).retry.delay(q(this,Bt));let s=u;q(this,Q).retry.jitter===!0?s=Math.random()*u:typeof q(this,Q).retry.jitter=="function"&&(s=q(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=q(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},Sp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new mp(u);if(s instanceof As)return s.customDelay??ke(this,oe,Gr).call(this);if(!q(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(q(this,Q).retry.shouldRetry!==void 0){const o=await q(this,Q).retry.shouldRetry({error:s,retryCount:q(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,oe,Gr).call(this)}if(a0(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if(t0(u)){if(!q(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&q(this,Q).retry.afterStatusCodes.includes(u.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=q(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(u.response.status===413)throw u}return ke(this,oe,Gr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Vr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Vr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,Sp).call(this,s),zs);if(q(this,Bt)<1)throw s;if(await Ib(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof As&&s.customRequest){const f=q(this,Q).signal?new globalThis.Request(s.customRequest,{signal:q(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,oe,Xr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ke(this,oe,ri).call(this),error:s,retryCount:q(this,Bt)});if(m instanceof globalThis.Request){ke(this,oe,Xr).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===gp)return}return ke(this,oe,qs).call(this,u)}},kp=async function(){var s;(s=q(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:q(this,Q).signal}));for(const o of q(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,oe,ri).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Xr).call(this,f);break}}const u=Pb(this.request,q(this,Q));return Kt(this,$a,this.request),this.request=q(this,$a).clone(),q(this,Q).timeout===!1?q(this,Q).fetch(q(this,$a),u):Fb(q(this,$a),u,q(this,Jt),q(this,Q))},ri=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Xr=function(u){Kt(this,vn,void 0),this.request=ke(this,oe,Ls).call(this,u)},Ls=function(u,s){return!q(this,Q).onUploadProgress||!u.body?u:Xb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ui,Jr);let Kr=ui;/*! MIT License © Sindre Sorhus */const Hs=i=>{const u=(s,o)=>Kr.create(s,Nr(i,o));for(const s of pp)u[s]=(o,f)=>Kr.create(o,Nr(i,f,{method:s}));return u.create=s=>Hs(Nr(s)),u.extend=s=>(typeof s=="function"&&(s=s(i??{})),Hs(Nr(i,s))),u.stop=gp,u.retry=Lb,u},Eh=Hs();let Ur=null;const Qr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[i=>{const u=xa.getState().accessToken;u&&i.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(i,u,s)=>{if(s.status===401&&!i.headers.has("X-Retry-After-Refresh")){Ur||(Ur=xa.getState().refresh().finally(()=>{Ur=null}));try{await Ur}catch{throw s}const o=xa.getState().accessToken;return o&&i.headers.set("Authorization",`Bearer ${o}`),i.headers.set("X-Retry-After-Refresh","1"),Eh(i,u)}}]}}),n0=3e4;function l0(i){if(i.link)return i.link;const u=(i.title+" "+i.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(i.title+" "+i.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function Ep(){const i=Fa(),[u,s]=y.useState([]),[o,f]=y.useState(0),[m,g]=y.useState(!1),[b,_]=y.useState(!1),p=y.useRef(null),{t:w}=Vt(),k=y.useRef(async()=>{try{_(!0);const H=(await Qr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,B=H.filter(U=>!U.isRead).length;s(U=>U.length===H.length&&U.every((K,X)=>K.id===H[X].id&&K.isRead===H[X].isRead)?U:H),f(U=>U===B?U:B)}catch{}finally{_(!1)}});y.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),n0);return()=>clearInterval(L)},[]),y.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Qr.post(`web/notifications/${L}/read`),s(H=>H.map(B=>B.id===L?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}}async function Y(){try{await Qr.post("web/notifications/read-all"),s(L=>L.map(H=>({...H,isRead:!0}))),f(0)}catch{}}return h.jsxs("div",{className:"relative",ref:p,children:[h.jsxs("button",{type:"button",onClick:()=>g(L=>!L),"aria-label":w("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[h.jsx(Pv,{size:16}),o>0&&h.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),m&&h.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&h.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[h.jsx(eb,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),h.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?h.jsx("div",{className:"flex justify-center py-8",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[h.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),h.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(L=>{const H=l0(L);return h.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${L.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(L.isRead||N(L.id),g(!1),i(H))},children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm font-medium",title:L.title,children:L.title}),h.jsx("p",{className:"truncate text-xs text-[var(--text-secondary)]",title:L.body,children:L.body}),h.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(L.createdAt).toLocaleString()})]}),!L.isRead&&h.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),N(L.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:h.jsx(tb,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function i0(i){return i&&i.trim().length>0?i:null}function wp(i,u=50){return i0(i.name)??Wh(i.description,u)}function r0(i){return i.description}function Tp(i){return`#${i.id} ${r0(i)}`}function ex(i,u=100){return{text:`#${i.id} ${wp(i,u)}`,title:Tp(i)}}function u0(i){return{tasks:i.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${wp(u)}`,subtitle:`${u.status} · ${u.project_key}`,hoverTitle:Tp(u)})),workers:(i.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:i.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const o0=300,wh={tasks:vb,workers:lp,projects:ub},s0={tasks:"tasks",workers:"workers",projects:"projects"};function jp({renderTrigger:i}={}){const[u,s]=y.useState(""),[o,f]=y.useState({tasks:[],workers:[],projects:[]}),[m,g]=y.useState(!1),[b,_]=y.useState(!1),[p,w]=y.useState(0),k=y.useRef(null),N=y.useRef(null),Y=y.useRef(void 0),L=y.useRef(void 0),H=Fa(),{t:B}=Vt(),U=y.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=y.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=L.current)==null||Pe.abort();const se=new AbortController;L.current=se;try{g(!0);const Je=await Qr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(u0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||g(!1)}},[]);y.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),o0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),y.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),_(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),y.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){_(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function ue(W){switch(X(),W.type){case"task":H(`/tasks/${W.id}`);break;case"worker":H(`/workers/${W.id}`);break;case"project":H(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(se=>Math.min(se+1,U.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(se=>Math.max(se-1,0))):W.key==="Enter"&&U[p]&&(W.preventDefault(),ue(U[p]))}const ge=U.length>0;let F=0;return h.jsxs(h.Fragment,{children:[i?i(()=>_(!0)):h.jsxs("button",{type:"button",onClick:()=>_(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[h.jsx(np,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:B("common.search_placeholder")}),h.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),b&&h.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&X()},children:h.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[h.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),h.jsx("input",{ref:N,type:"text",placeholder:B("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),h.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!ge&&!m?h.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:B("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const se=o[W];if(se.length===0)return null;const Pe=wh[W],Je=F;return F+=se.length,h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[h.jsx(Pe,{className:"h-3 w-3"}),h.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:s0[W]})]}),se.map((Ce,At)=>{const ut=Je+At,Me=ut===p;return h.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Me?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>ue(Ce),onMouseEnter:()=>w(ut),children:[h.jsx("span",{className:`text-xs ${Me?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Me?">":" "}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm",title:Ce.hoverTitle??Ce.title,children:Ce.title}),Ce.subtitle&&h.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",title:Ce.subtitle,children:Ce.subtitle})]})]},`${Ce.type}-${Ce.id}`)})]},W)})}),h.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",B("common.navigate_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",B("common.select_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",B("common.close_hint")]})]})]})})]})}const c0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function Th(i){return Array.from(i.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function f0({isOpen:i,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:m,cancelLabel:g,confirmVariant:b="danger",isLoading:_,children:p}){const{t:w}=Vt(),k=y.useId(),N=m??w("common.confirm"),Y=g??w("common.cancel"),L=y.useRef(null),H=y.useRef(null),B=c0[b];y.useEffect(()=>{if(!i)return;H.current=document.activeElement;const K=requestAnimationFrame(()=>{if(L.current){const X=Th(L.current);X.length>0&&X[0].focus()}});return()=>{var X;cancelAnimationFrame(K),(X=H.current)==null||X.focus()}},[i]);const U=y.useCallback(K=>{if(K.key==="Escape"){u();return}if(K.key==="Tab"&&L.current){const X=Th(L.current);if(X.length===0)return;const ue=X[0],ce=X[X.length-1];K.shiftKey?document.activeElement===ue&&(K.preventDefault(),ce.focus()):document.activeElement===ce&&(K.preventDefault(),ue.focus())}},[u]);return i?h.jsx("div",{onClick:u,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:h.jsxs("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":k,onClick:K=>K.stopPropagation(),onKeyDown:U,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[h.jsx("div",{style:{marginBottom:"1.25rem"},children:h.jsxs("div",{id:k,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[h.jsx(ip,{style:{width:"1rem",height:"1rem"}}),o]})}),h.jsxs("div",{style:{marginBottom:"1.25rem"},children:[h.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f}),p]}),h.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[h.jsx("button",{type:"button",onClick:u,disabled:_,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",cursor:_?"not-allowed":"pointer",opacity:_?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),h.jsx("button",{type:"button",onClick:s,disabled:_,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:_?"not-allowed":"pointer",opacity:_?.7:1},children:_?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function d0(){const i=navigator.userAgent;return/iP(hone|od|ad)/.test(i)&&/WebKit/.test(i)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(i)}function m0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function h0(){const{t:i}=Vt(),[u,s]=y.useState("hidden"),[o,f]=y.useState(!1),m=y.useRef(null),g=y.useRef(void 0);y.useEffect(()=>{if(m0()||localStorage.getItem(jh)||window.innerWidth>=768)return;const p=k=>{k.preventDefault(),m.current=k};window.addEventListener("beforeinstallprompt",p);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",p),clearTimeout(w),clearTimeout(g.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),g.current=setTimeout(()=>s("hidden"),200)}async function _(){if(m.current){await m.current.prompt();const{outcome:p}=await m.current.userChoice;p==="accepted"&&b(),m.current=null}else d0()&&f(!0)}return u==="hidden"?null:h.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":i("pwa_install.title"),children:h.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),h.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:i("pwa_install.title")})]}),h.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:h.jsx(rp,{size:14})})]}),h.jsx("div",{className:"px-3.5 py-3",children:o?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.ios_command")]}),h.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[i("pwa_install.ios_step_1"),i("pwa_install.ios_step_2"),i("pwa_install.ios_step_3")].map((p,w)=>h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:h.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),h.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&h.jsx(gb,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),p]})]},w))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.command")]}),h.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",i("pwa_install.desc_1"),h.jsx("br",{}),"→ ",i("pwa_install.desc_2")]}),h.jsxs("div",{className:"mt-2.5 flex gap-2",children:[h.jsx("button",{onClick:_,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_install.install")}),h.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:i("pwa_install.skip")})]})]})})]})})}function p0(){const{t:i}=Vt(),[u,s]=y.useState(!1);return y.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,m=null,g=null,b=null;function _(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",_);function p(k){if(f=k,k.waiting){s(!0);return}g=()=>{const N=k.installing;N&&(m=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",g)}navigator.serviceWorker.getRegistration().then(k=>{k&&!o&&p(k)});const w=setInterval(()=>{navigator.serviceWorker.getRegistration().then(k=>{!k||o||(k.update().catch(()=>{}),k.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(w),navigator.serviceWorker.removeEventListener("controllerchange",_),f&&g&&f.removeEventListener("updatefound",g),m&&b&&m.removeEventListener("statechange",b)}},[]),u?h.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsx(ap,{size:14,className:"shrink-0 text-[var(--accent)]"}),h.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:i("pwa_update.message")}),h.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_update.reload")})]})}):null}const qr=64,g0=96,Rh=32;function y0({children:i,className:u}){const s=y.useRef(null),o=y.useRef(0),f=y.useRef("idle"),[m,g]=y.useState(0),[b,_]=y.useState("idle"),p=y.useCallback(U=>{f.current=U,_(U)},[]),w=y.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=y.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=y.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(g(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,g0);g(ue),p(ue>=qr?"ready":"pulling")},[w,p]),Y=y.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),g(qr),setTimeout(()=>{window.location.reload()},300)):(g(0),p("idle")),o.current=0)},[p]);y.useEffect(()=>{const U=s.current;if(U)return U.addEventListener("touchstart",k,{passive:!0}),U.addEventListener("touchmove",N,{passive:!1}),U.addEventListener("touchend",Y,{passive:!0}),()=>{U.removeEventListener("touchstart",k),U.removeEventListener("touchmove",N),U.removeEventListener("touchend",Y)}},[k,N,Y]);const L=Math.min(m/qr,1),H=b==="refreshing"?0:m/qr*180,B=m>0||b==="refreshing";return h.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&h.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:m,transition:b==="idle"?"height 200ms ease-out":void 0},children:h.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Rh,height:Rh,opacity:L,transition:b==="idle"?"opacity 200ms ease-out":void 0},children:b==="refreshing"?h.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[h.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),h.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):h.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:b==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${H}deg)`,transition:"color 150ms"},children:h.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i]})}const Rp=y.createContext({setActions:()=>{}});function tx(i){const{setActions:u}=y.useContext(Rp);y.useEffect(()=>(u(i),()=>u(null)),[i,u])}const Ap=y.createContext({setSubtitle:()=>{}});function ax(i){const{setSubtitle:u}=y.useContext(Ap),s=typeof i=="string"?i:(i==null?void 0:i.text)??null,o=typeof i=="string"?i:(i==null?void 0:i.title)??(i==null?void 0:i.text)??null;y.useEffect(()=>s?(u(o&&o!==s?{text:s,title:o}:s),()=>u(null)):(u(null),()=>u(null)),[s,o,u])}const _0=[{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph}],v0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/dashboard",label:"dashboard",icon:ep}],b0=[{to:"/workers",label:"workers",icon:lp},{to:"/projects",label:"projects",icon:ob},{to:"/access-tokens",label:"tokens",icon:cb}],x0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:rb},{to:"/docs/bot",label:"bot",icon:hb},{to:"/docs/skill",label:"skill",icon:_b},{to:"/docs/all",label:"all",icon:fb}],S0=[{to:"/admin",label:"admin",icon:yb}],k0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph},{to:"/dashboard",label:"dashboard",icon:ep}],Lr={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/plan":{title:"plan.title",subtitle:"plan.title"},"/review":{title:"review.title",subtitle:"review.title"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_tokens",subtitle:"common.breadcrumb_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function E0(i){const{t:u}=Vt();if(Lr[i]){const o=Lr[i];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+i.split("/").filter(Boolean)[0];if(Lr[s]){const o=Lr[s],f=i.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:i.slice(1).replace(/\//g," // ")||"home"}}function w0(i,u){return i==="/home"?u==="/home":i==="/dashboard"?u==="/dashboard":u.startsWith(i)}function T0(){const i=yt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title"),plan:u("plan.title"),review:u("review.title")};return h.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[k0.map(({to:o,label:f,icon:m})=>{const g=w0(o,i.pathname);return h.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(m,{size:18,className:g?"text-[var(--accent)]":"text-[var(--text-muted)]"}),h.jsx("span",{className:`text-[11px] lowercase ${g?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),h.jsx(jp,{renderTrigger:o=>h.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(np,{size:18,className:"text-[var(--text-muted)]"}),h.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function j0(){const i=Fa(),{t:u}=Vt();return h.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[h.jsxs("button",{onClick:()=>i("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:h.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),h.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:()=>i("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:h.jsx(xb,{size:18})}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})}function li({label:i,items:u,collapsed:s}){return h.jsxs("div",{className:"mt-4 first:mt-0",children:[h.jsx("div",{className:`overflow-hidden transition-all duration-300 ${s?"max-h-0 mb-0 opacity-0":"max-h-6 mb-2 opacity-100"}`,children:h.jsx("div",{className:"px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:i})}),u.map(({to:o,label:f,icon:m})=>h.jsx(Js,{to:o,className:({isActive:g})=>`flex items-center text-sm lowercase transition-all duration-300 ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${g?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:g})=>h.jsxs(h.Fragment,{children:[h.jsx(m,{size:14,style:{flexShrink:0}}),!s&&h.jsx("span",{children:g?`> ${f}`:` ${f}`})]})},o))]})}function R0(){const{user:i,logout:u}=xa(),s=Fa(),[o,f]=y.useState(!1),m=wb(),{t:g}=Vt(),{sidebarCollapsed:b,toggleSidebar:_}=jb();function p(){u(),s("/login")}return h.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[h.jsx("div",{className:"flex items-center px-5",style:{height:48},children:h.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:h.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&h.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:g("common.overlord")})]})}),h.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[h.jsx(li,{label:g("common.loop_section"),items:_0,collapsed:b}),h.jsx(li,{label:g("common.tasks_section"),items:v0,collapsed:b}),h.jsx(li,{label:g("common.fleet_section"),items:b0,collapsed:b}),h.jsx(li,{label:g("common.docs_section"),items:x0,collapsed:b}),m&&h.jsx(li,{label:g("common.admin_section"),items:S0,collapsed:b})]}),h.jsx("div",{className:"flex px-3 py-1",children:h.jsx("button",{onClick:_,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":b?"expand sidebar":"collapse sidebar",children:b?h.jsx(nb,{size:14}):h.jsx(ab,{size:14})})}),h.jsx("div",{className:"border-t border-[var(--border)] p-3",children:h.jsxs("div",{className:`flex min-h-[44px] items-center px-3 transition-[gap] duration-300 ${b?"gap-0":"gap-3"}`,children:[h.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:g("common.profile"),children:((i==null?void 0:i.username)??"u")[0].toUpperCase()}),h.jsxs("div",{className:`flex min-w-0 flex-1 items-center overflow-hidden transition-[max-width,opacity] duration-300 ${b?"pointer-events-none max-w-0 opacity-0":"max-w-[calc(100%-28px)] opacity-100"}`,"aria-hidden":b,children:[h.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:g("common.profile"),tabIndex:b?-1:void 0,children:[h.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(i==null?void 0:i.username)??"user"}),h.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(i==null?void 0:i.role)??"user"})]}),h.jsx("button",{onClick:()=>f(!0),className:"ml-2 p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":g("common.log_out"),tabIndex:b?-1:void 0,children:h.jsx(mb,{size:14})})]})]})}),h.jsx(f0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:g("common.logout_title"),message:g("common.logout_message"),confirmLabel:g("common.logout"),confirmVariant:"warning"})]})}function A0({headerActions:i,subtitleOverride:u}){const s=yt(),{title:o,subtitle:f}=E0(s.pathname),m=u??f,g=typeof m=="string"?m:m==null?void 0:m.text,b=typeof m=="string"?m:(m==null?void 0:m.title)??(m==null?void 0:m.text);return h.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[h.jsxs("div",{className:"text-sm lowercase",children:[h.jsx("span",{style:{color:"var(--text-primary)"},children:o}),g&&h.jsxs("span",{style:{color:"var(--text-muted)"},title:b,children:[" ","// ",Wh(g,40)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(jp,{}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})]})}function z0(){const[i,u]=y.useState(null),[s,o]=y.useState(null),f=yt(),m=f.pathname==="/home",g=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return y.useEffect(()=>sp.getState().init(),[]),h.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[h.jsx(R0,{}),h.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[h.jsx(j0,{}),!b&&h.jsx(A0,{headerActions:i,subtitleOverride:s}),h.jsx(y0,{className:m||g?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:h.jsx(Rp.Provider,{value:{setActions:u},children:h.jsx(Ap.Provider,{value:{setSubtitle:o},children:h.jsx(hv,{})})})}),h.jsx(h0,{}),h.jsx(p0,{}),h.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:h.jsx(T0,{})})]})]})}function Ah(i){var s;const u=(s=i.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:i.pathname,search:i.search}}}function ii({children:i,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),g=yt();if(m)return h.jsx("div",{className:"flex h-screen items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return h.jsx(ll,{to:"/login",state:Ah(g),replace:!0});if(f){const b=Ah(g);return g.pathname!=="/totp-setup"&&g.pathname!=="/bind"?h.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):g.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),h.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):h.jsx(h.Fragment,{children:i})}return u&&(o==null?void 0:o.role)!==up.ADMIN?h.jsx(ll,{to:"/home",replace:!0}):h.jsx(h.Fragment,{children:i})}function O0({children:i}){const{theme:u,resolved:s,setResolved:o}=fp();return y.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=g=>o(g.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[u,o]),y.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),h.jsx(h.Fragment,{children:i})}class C0 extends y.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?h.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[h.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Yr("common.runtime_error")}),h.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Yr("common.an_unexpected_error_occurred")}),h.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[h.jsx(ap,{className:"h-3.5 w-3.5"}),Yr("common.reload")]})]}):this.props.children}}function D0({isOpen:i}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function m(){s(),o(!1),u("/login")}return i?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),h.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:h.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[h.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:h.jsx(db,{className:"h-7 w-7 text-[var(--warning)]"})}),h.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),h.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),h.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const zh=5;let ba=[];const Bs=new Set;function zp(){Bs.forEach(i=>i())}function N0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(i,u,s=4e3){const o=N0();return ba=[...ba,{id:o,variant:i,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),zp(),o}Wa.success=(i,u)=>Wa("success",i,u);Wa.error=(i,u)=>Wa("error",i,u);Wa.warning=(i,u)=>Wa("warning",i,u);Wa.info=(i,u)=>Wa("info",i,u);function M0(i){ba=ba.filter(u=>u.id!==i),zp()}function U0(){const[,i]=y.useState(0);return y.useEffect(()=>{const u=()=>i(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const q0={success:{icon:lb,borderColor:"var(--accent)"},error:{icon:ib,borderColor:"var(--destructive)"},warning:{icon:ip,borderColor:"var(--warning)"},info:{icon:sb,borderColor:"var(--info)"}};function L0({item:i}){const u=q0[i.variant],s=u.icon,{t:o}=Vt(),f=y.useCallback(()=>M0(i.id),[i.id]);return y.useEffect(()=>{if(!i.duration)return;const m=setTimeout(f,i.duration);return()=>clearTimeout(m)},[i.duration,f]),h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[h.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),h.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:i.message}),h.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:h.jsx(rp,{className:"h-3.5 w-3.5"})})]})}function H0(){const i=U0();return i.length===0?null:h.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:i.map(u=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(L0,{item:u})},u.id))})}const B0=y.lazy(()=>ae(()=>import("./LandingPage-DSHGbkXw.js"),__vite__mapDeps([0,1,2,3,4,5]))),Y0=y.lazy(()=>ae(()=>import("./LoginPage-C4oz9yjV.js"),[])),G0=y.lazy(()=>ae(()=>import("./TotpSetupPage-BGE6pDdn.js"),[])),V0=y.lazy(()=>ae(()=>import("./NotFoundPage-BeayCSH7.js"),[])),X0=y.lazy(()=>ae(()=>import("./HomePage-CeOmNhkc.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),Q0=y.lazy(()=>ae(()=>import("./TerminalHomePage-XJ5daAJC.js"),__vite__mapDeps([15,16,17,18,19,20,12,21,22,10,11,23,24,8,25,26,13,27,28,29]))),Z0=y.lazy(()=>ae(()=>import("./TaskListPage-Bvq5ow7r.js"),__vite__mapDeps([30,22,7,8,12,14,31,23,24,25,26,5,32,9,27,33,11]))),K0=y.lazy(()=>ae(()=>import("./TaskDetailPage-D4sGfico.js"),__vite__mapDeps([34,22,16,17,18,19,20,12,21,23,24,8,26,25,14,35,31,36,37,38]))),J0=y.lazy(()=>ae(()=>import("./PlanPage-BOzGJd2h.js"),__vite__mapDeps([39,32,9,12,23,24,27,37,33,11]))),$0=y.lazy(()=>ae(()=>import("./ReviewPage-DtdWSBgK.js"),__vite__mapDeps([40,32,9,12,26,25,36]))),W0=y.lazy(()=>ae(()=>import("./ReviewAggregatePage-dWQb52Df.js"),__vite__mapDeps([41,19,20,9,12,26,25,35,17,36,38,18,28,24]))),F0=y.lazy(()=>ae(()=>import("./WorkerListPage-e4P55nJc.js"),__vite__mapDeps([42,8,43,44,45,46,47,36,29,5,17,23,24,32,9,13,27,35]))),I0=y.lazy(()=>ae(()=>import("./WorkerDetailPage-Dd-IbO6r.js"),__vite__mapDeps([48,12,8,49,43,13,14,50,35]))),P0=y.lazy(()=>ae(()=>import("./WorkerSetupGuidePage-CRicnVVm.js"),__vite__mapDeps([44,45,46,47,36,29]))),e1=y.lazy(()=>ae(()=>import("./ProjectListPage-C2uStUVE.js"),__vite__mapDeps([51,23,24,26,32,9,12,13,27,35]))),t1=y.lazy(()=>ae(()=>import("./ProjectDetailPage-B-t7L84T.js"),__vite__mapDeps([52,53,23,24,14,12,8,49,13,54,50,35,27]))),a1=y.lazy(()=>ae(()=>import("./EditProjectPage-D0rfXGZR.js"),__vite__mapDeps([55,23,24,53,26,27]))),n1=y.lazy(()=>ae(()=>import("./PipelineEditorPage-FkckQpQX.js"),__vite__mapDeps([56,23,24]))),l1=y.lazy(()=>ae(()=>import("./ProfilePage-CT_kk3a8.js"),__vite__mapDeps([57,58,49,13]))),i1=y.lazy(()=>ae(()=>import("./BindPlatformPage-BV5wNIi2.js"),[])),r1=y.lazy(()=>ae(()=>import("./AccessTokensPage-wTxicSeE.js"),__vite__mapDeps([59,23,24,32,9,12,13,27,5,50]))),u1=y.lazy(()=>ae(()=>import("./CliReferencePage-yJgtPpFn.js"),__vite__mapDeps([60,61,5,62,27]))),o1=y.lazy(()=>ae(()=>import("./ApiReferencePage-7TUHB8sC.js"),__vite__mapDeps([63,62,5,27]))),s1=y.lazy(()=>ae(()=>import("./SkillPage-C6p0dXbu.js"),__vite__mapDeps([64,61,5,37]))),c1=y.lazy(()=>ae(()=>import("./DocsLayout-ChIliA9A.js"),__vite__mapDeps([65,35]))),f1=y.lazy(()=>ae(()=>import("./InstallationPage-CUbe1AD-.js"),__vite__mapDeps([66,61,5]))),d1=y.lazy(()=>ae(()=>import("./DeveloperSetupPage-DzGCH2XG.js"),__vite__mapDeps([67,61,5]))),m1=y.lazy(()=>ae(()=>import("./WorkerSetupPage-DXOlNqUZ.js"),__vite__mapDeps([68,61,5]))),h1=y.lazy(()=>ae(()=>import("./BotSetupPage-DdDPniAd.js"),__vite__mapDeps([69,61,5]))),p1=y.lazy(()=>ae(()=>import("./LocalDevelopmentPage-fialPCnX.js"),__vite__mapDeps([70,61,5]))),g1=y.lazy(()=>ae(()=>import("./WorkerOperationsPage-ioBw_i1j.js"),[])),y1=y.lazy(()=>ae(()=>import("./DeploymentPage-C0CXq8yl.js"),__vite__mapDeps([71,61,5]))),Oh=y.lazy(()=>ae(()=>import("./BotIntegrationPage-B2bQytks.js"),[])),_1=y.lazy(()=>ae(()=>import("./PipelineConfigPage-DwY__0Ag.js"),__vite__mapDeps([72,61,5]))),v1=y.lazy(()=>ae(()=>import("./DevWorkflowPage-I4Io3nYz.js"),__vite__mapDeps([73,61,5]))),b1=y.lazy(()=>ae(()=>import("./PermissionsPage-Bb2CYzMf.js"),[])),x1=y.lazy(()=>ae(()=>import("./EnvVariablesPage-EmfRwttc.js"),__vite__mapDeps([74,61,5]))),S1=y.lazy(()=>ae(()=>import("./ArchitecturePage-CycvJ1HW.js"),__vite__mapDeps([75,61,5]))),k1=y.lazy(()=>ae(()=>import("./ChangelogPage-D5YE3BFH.js"),[])),E1=y.lazy(()=>ae(()=>import("./AgentCliPage-DfqlFdFN.js"),__vite__mapDeps([76,61,5]))),w1=y.lazy(()=>ae(()=>import("./TaskGuidePage-COT0chCI.js"),__vite__mapDeps([77,61,5]))),T1=y.lazy(()=>ae(()=>import("./DocsIndexPage-PIEcc9gX.js"),__vite__mapDeps([78,46,2,3,47,21]))),j1=y.lazy(()=>ae(()=>import("./AdminPage-CBovEOm4.js"),__vite__mapDeps([79,4,2,80,47]))),R1=y.lazy(()=>ae(()=>import("./DeveloperManage-Cy0LRyHh.js"),__vite__mapDeps([81,23,24,58,32,9,13,8,27,4,54,18]))),A1=y.lazy(()=>ae(()=>import("./BotManage-BBBrqdT_.js"),__vite__mapDeps([82,23,24,61,5,50,27,32,9,13,8,2,54]))),z1=y.lazy(()=>ae(()=>import("./TokenManage-JLFD8xAN.js"),__vite__mapDeps([83,45,5,37,32,9,13,8,27]))),O1=y.lazy(()=>ae(()=>import("./AuditLogPage-CqqCDd8o.js"),__vite__mapDeps([84,23,24,32,9,80,33,11]))),C1=y.lazy(()=>ae(()=>import("./SettingsPage-qCfF6rzU.js"),[]));function D1(){return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function N1(){const i=xa(u=>u.sessionExpired);return h.jsxs(O0,{children:[h.jsx(H0,{}),h.jsx(C0,{children:h.jsxs(Yv,{children:[h.jsx(D0,{isOpen:i}),h.jsx(y.Suspense,{fallback:h.jsx(D1,{}),children:h.jsxs(gv,{children:[h.jsx(P,{path:"/",element:h.jsx(B0,{})}),h.jsx(P,{path:"/login",element:h.jsx(Y0,{})}),h.jsx(P,{path:"/totp-setup",element:h.jsx(ii,{children:h.jsx(G0,{})})}),h.jsx(P,{path:"/bind",element:h.jsx(ii,{children:h.jsx(i1,{})})}),h.jsxs(P,{element:h.jsx(ii,{children:h.jsx(z0,{})}),children:[h.jsx(P,{path:"/home",element:h.jsx(Q0,{})}),h.jsx(P,{path:"/dashboard",element:h.jsx(X0,{})}),h.jsx(P,{path:"/tasks",element:h.jsx(Z0,{})}),h.jsx(P,{path:"/tasks/:id",element:h.jsx(K0,{})}),h.jsx(P,{path:"/plan",element:h.jsx(J0,{})}),h.jsx(P,{path:"/review",element:h.jsx($0,{})}),h.jsx(P,{path:"/review/:sourceTaskId",element:h.jsx(W0,{})}),h.jsx(P,{path:"/workers",element:h.jsx(F0,{})}),h.jsx(P,{path:"/workers/setup",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(P0,{})})}),h.jsx(P,{path:"/workers/:id",element:h.jsx(I0,{})}),h.jsx(P,{path:"/projects",element:h.jsx(e1,{})}),h.jsx(P,{path:"/projects/:key",element:h.jsx(t1,{})}),h.jsx(P,{path:"/projects/:key/edit",element:h.jsx(a1,{})}),h.jsx(P,{path:"/projects/:key/pipeline",element:h.jsx(n1,{})}),h.jsx(P,{path:"/profile",element:h.jsx(l1,{})}),h.jsx(P,{path:"/access-tokens",element:h.jsx(r1,{})}),h.jsxs(P,{path:"/docs",element:h.jsx(c1,{}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"cli",replace:!0})}),h.jsx(P,{path:"cli",element:h.jsx(u1,{})}),h.jsx(P,{path:"api",element:h.jsx(o1,{})}),h.jsx(P,{path:"bot",element:h.jsx(Oh,{})}),h.jsx(P,{path:"all",element:h.jsx(T1,{})}),h.jsx(P,{path:"skill",element:h.jsx(s1,{})}),h.jsx(P,{path:"installation",element:h.jsx(f1,{})}),h.jsx(P,{path:"developer-setup",element:h.jsx(d1,{})}),h.jsx(P,{path:"worker-setup",element:h.jsx(m1,{})}),h.jsx(P,{path:"bot-setup",element:h.jsx(h1,{})}),h.jsx(P,{path:"local-development",element:h.jsx(p1,{})}),h.jsx(P,{path:"worker-operations",element:h.jsx(g1,{})}),h.jsx(P,{path:"deployment",element:h.jsx(y1,{})}),h.jsx(P,{path:"bot-integration",element:h.jsx(Oh,{})}),h.jsx(P,{path:"pipeline-config",element:h.jsx(_1,{})}),h.jsx(P,{path:"dev-workflow",element:h.jsx(v1,{})}),h.jsx(P,{path:"permissions",element:h.jsx(b1,{})}),h.jsx(P,{path:"env-variables",element:h.jsx(x1,{})}),h.jsx(P,{path:"architecture",element:h.jsx(S1,{})}),h.jsx(P,{path:"task-guide",element:h.jsx(w1,{})}),h.jsx(P,{path:"agent-cli",element:h.jsx(E1,{})}),h.jsx(P,{path:"changelog",element:h.jsx(k1,{})})]}),h.jsxs(P,{path:"/admin",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(j1,{})}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"developers",replace:!0})}),h.jsx(P,{path:"developers",element:h.jsx(R1,{})}),h.jsx(P,{path:"bots",element:h.jsx(A1,{})}),h.jsx(P,{path:"tokens",element:h.jsx(z1,{})}),h.jsx(P,{path:"audit-logs",element:h.jsx(O1,{})}),h.jsx(P,{path:"settings",element:h.jsx(C1,{})})]})]}),h.jsx(P,{path:"*",element:h.jsx(V0,{})})]})})]})})]})}function Op(i=window){var u,s;return((u=i.matchMedia)==null?void 0:u.call(i,"(display-mode: standalone)").matches)===!0||((s=i.navigator)==null?void 0:s.standalone)===!0}async function M1(i=window,u="portrait"){var o,f;if(!Op(i))return!1;const s=(f=(o=i.screen)==null?void 0:o.orientation)==null?void 0:f.lock;if(typeof s!="function")return!1;try{return await s.call(i.screen.orientation,u),!0}catch{return!1}}function U1(i){var u,s;return((u=i.matchMedia)==null?void 0:u.call(i,"(display-mode: standalone)").matches)===!0||((s=i.navigator)==null?void 0:s.standalone)===!0}function q1(i){var s,o;const u=((s=i.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=i.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function L1(i){const u=i.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function H1(i){const u=i.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return i.innerHeight>=i.innerWidth?Math.max(s,o):Math.min(s,o)}function B1(i=window,u=document){const s=u.documentElement,o=i.visualViewport??null;let f=-1;const m=()=>{const g=Math.round((o==null?void 0:o.height)??0),b=Math.round(i.innerHeight);let _=g>0?g:b;if(U1(i)&&q1(i)&&!L1(u)){const p=H1(i);p!==null&&(_=Math.max(_,b,p))}_!==f&&(f=_,s.style.setProperty("--app-height",`${_}px`))};return m(),i.addEventListener("resize",m),i.addEventListener("orientationchange",m),o==null||o.addEventListener("resize",m),()=>{i.removeEventListener("resize",m),i.removeEventListener("orientationchange",m),o==null||o.removeEventListener("resize",m)}}xa.getState().initialize();B1(window,document);const Cp=window,Y1=Op(Cp);M1(Cp);if(Y1){document.documentElement.classList.add("pwa-standalone");const i=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&i;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}h_.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(N1,{})}));export{f_ as $,V1 as A,X1 as B,tb as C,up as D,Ph as E,lb as F,W1 as G,Ns as H,db as I,ib as J,rb as K,Jh as L,hb as M,ll as N,Ih as O,h0 as P,J1 as Q,Ar as R,lp as S,dp as T,xb as U,ip as V,Z1 as W,rp as X,sb as Y,K1 as Z,ap as _,Vt as a,Wh as a0,cb as a1,mb as a2,$1 as a3,_b as a4,Js as a5,hv as a6,F1 as a7,I1 as a8,$s as b,_e as c,yb as d,fb as e,Fa as f,yt as g,Qr as h,wb as i,h as j,sp as k,wp as l,Tp as m,r0 as n,Ir as o,Q1 as p,ax as q,y as r,ex as s,Wa as t,xa as u,f0 as v,tx as w,np as x,tp as y,P1 as z};
252
+ "{description}"`},plan:{title:"plan",create:"create plan",description_placeholder:"describe what you want to build...",spec_generated:"spec generated",decompose:"decompose into tasks",save_only:"save spec only",no_plans:"no plan tasks yet",view_spec:"view spec"},review:{title:"review",pending:"pending review",in_progress:"in progress",history:"history",launch:"launch review",select_agents:"select review agents",approve_fix:"fix issues",skip_fix:"no fix needed",review_again:"review again",round:"round",no_reviews:"no reviews yet",issues_summary:"{critical} critical · {warning} warning · {suggestion} suggestion",description_placeholder:"review instructions (optional)...",empty_report_warning:"review completed but no structured report was produced. check the terminal output for details.",fix_push_info:"selected agent will push fixes to the source branch",waiting_agents:"waiting for review agents to finish...",skip_fix_label:"review only (skip fix stage)"}};function Ob(i,u){const s=u.split(".");let o=i;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Cb(i,u){return u?i.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):i}function Yr(i,u){return Cb(Ob(zb,i),u)}function Vt(){return{t:y.useCallback((u,s)=>Yr(u,s),[])}}function dp(){const{theme:i,setTheme:u}=fp(),{t:s}=Vt(),o=i==="dark"||i==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return h.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?h.jsx(bb,{size:16}):h.jsx(pb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",g=s.statusText??"",b=`${m} ${g}`.trim(),_=b?`status code ${b}`:"an unknown error";super(`Request failed with ${_}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class mp extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class As extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new mp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const Sh=(()=>{let i=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return i&&!u})(),Db=typeof globalThis.AbortController=="function",hp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nb=typeof globalThis.ReadableStream=="function",Mb=typeof globalThis.FormData=="function",pp=["get","post","put","patch","head","delete"],Ub={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},zs=2147483647,qb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,gp=Symbol("stop");class yp{constructor(u){Ve(this,"options");this.options=u}}const Lb=i=>new yp(i),Hb={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Bb={next:!0},Yb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Gb=i=>{if(!i)return 0;if(i instanceof FormData){let u=0;for(const[s,o]of i)u+=qb,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(i instanceof Blob)return i.size;if(i instanceof ArrayBuffer)return i.byteLength;if(typeof i=="string")return new TextEncoder().encode(i).length;if(i instanceof URLSearchParams)return new TextEncoder().encode(i.toString()).length;if("byteLength"in i)return i.byteLength;if(typeof i=="object"&&i!==null)try{const u=JSON.stringify(i);return new TextEncoder().encode(u).length}catch{return 0}return 0},_p=(i,u,s)=>{let o,f=0;return i.pipeThrough(new TransformStream({transform(m,g){if(g.enqueue(m),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},Vb=(i,u)=>{if(!i.body)return i;if(i.status===204)return new Response(null,{status:i.status,statusText:i.statusText,headers:i.headers});const s=Math.max(0,Number(i.headers.get("content-length"))||0);return new Response(_p(i.body,s,u),{status:i.status,statusText:i.statusText,headers:i.headers})},Xb=(i,u,s)=>{if(!i.body)return i;const o=Gb(s??i.body);return new Request(i,{duplex:"half",body:_p(i.body,o,u)})},_n=i=>i!==null&&typeof i=="object",Nr=(...i)=>{for(const u of i)if((!_n(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...i)},vp=(i={},u={})=>{const s=new globalThis.Headers(i),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[m,g]of f.entries())o&&g==="undefined"||g===void 0?s.delete(m):s.set(m,g);return s};function Mr(i,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(i[s]??[],u[s]??[])}const bp=(i={},u={})=>({beforeRequest:Mr(i,u,"beforeRequest"),beforeRetry:Mr(i,u,"beforeRetry"),afterResponse:Mr(i,u,"afterResponse"),beforeError:Mr(i,u,"beforeError")}),Qb=(i,u)=>{const s=new URLSearchParams;for(const o of[i,u])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())s.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(_n(o))for(const[f,m]of Object.entries(o))m!==void 0&&s.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,g]of f.entries())s.append(m,g)}return s},Ws=(...i)=>{let u={},s={},o={},f;const m=[];for(const g of i)if(Array.isArray(g))Array.isArray(u)||(u=[]),u=[...u,...g];else if(_n(g)){for(let[b,_]of Object.entries(g)){if(b==="signal"&&_ instanceof globalThis.AbortSignal){m.push(_);continue}if(b==="context"){if(_!=null&&(!_n(_)||Array.isArray(_)))throw new TypeError("The `context` option must be an object");u={...u,context:_==null?{}:{...u.context,..._}};continue}if(b==="searchParams"){_==null?f=void 0:f=f===void 0?_:Qb(f,_);continue}_n(_)&&b in u&&(_=Ws(u[b],_)),u={...u,[b]:_}}_n(g.hooks)&&(o=bp(o,g.hooks),u.hooks=o),_n(g.headers)&&(s=vp(s,g.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),m.length>0&&(m.length===1?u.signal=m[0]:hp?u.signal=AbortSignal.any(m):u.signal=m.at(-1)),u},Zb=i=>pp.includes(i)?i.toUpperCase():i,Kb=["get","put","head","delete","options","trace"],Jb=[408,413,429,500,502,503,504],$b=[413,429,503],kh={limit:2,methods:Kb,statusCodes:Jb,afterStatusCodes:$b,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:i=>.3*2**(i-1)*1e3,jitter:void 0,retryOnTimeout:!1},Wb=(i={})=>{if(typeof i=="number")return{...kh,limit:i};if(i.methods&&!Array.isArray(i.methods))throw new Error("retry.methods must be an array");if(i.methods&&(i.methods=i.methods.map(s=>s.toLowerCase())),i.statusCodes&&!Array.isArray(i.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(i).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Fb(i,u,s,o){return new Promise((f,m)=>{const g=setTimeout(()=>{s&&s.abort(),m(new Ms(i))},o.timeout);o.fetch(i,u).then(f).catch(m).then(()=>{clearTimeout(g)})})}async function Ib(i,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(u.reason)}const m=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},i)})}const Pb=(i,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Yb)&&!(o in Hb)&&(!(o in i)||o in Bb)&&(s[o]=u[o]);return s},e0=i=>i===void 0?!1:Array.isArray(i)?i.length>0:i instanceof URLSearchParams?i.size>0:typeof i=="object"?Object.keys(i).length>0:typeof i=="string"?i.trim().length>0:!!i;function t0(i){return i instanceof Ns||(i==null?void 0:i.name)===Ns.name}function a0(i){return i instanceof Ms||(i==null?void 0:i.name)===Ms.name}var Jr,xp,Jt,Bt,rt,Q,$a,ea,vn,oe,Gr,Sp,Us,Vr,Ja,qs,kp,ri,Xr,Ls;const ui=class ui{constructor(u,s={}){Pt(this,oe);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,m,g;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:vp(q(this,rt).headers,s.headers),hooks:bp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Zb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Wb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof q(this,rt)!="string"&&!(q(this,rt)instanceof URL||q(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(q(this,Q).prefixUrl&&typeof q(this,rt)=="string"){if(q(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");q(this,Q).prefixUrl.endsWith("/")||(q(this,Q).prefixUrl+="/"),Kt(this,rt,q(this,Q).prefixUrl+q(this,rt))}Db&&hp&&(Kt(this,ea,q(this,Q).signal??q(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal),Sh&&(q(this,Q).duplex="half"),q(this,Q).json!==void 0&&(q(this,Q).body=((m=(f=q(this,Q)).stringifyJson)==null?void 0:m.call(f,q(this,Q).json))??JSON.stringify(q(this,Q).json),q(this,Q).headers.set("content-type",q(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(q(this,rt)instanceof globalThis.Request&&(Mb&&q(this,Q).body instanceof globalThis.FormData||q(this,Q).body instanceof URLSearchParams)&&!o&&q(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(q(this,rt),q(this,Q)),e0(q(this,Q).searchParams)){const _="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(g=ui,Jr,xp).call(g,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,_);this.request=new globalThis.Request(p,q(this,Q))}if(q(this,Q).onUploadProgress){if(typeof q(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,oe,Ls).call(this,this.request,q(this,Q).body??void 0)}}static create(u,s){var g,b,_;const o=new ui(u,s),f=async()=>{var w,k,N,Y,L,H,B,U,K,X,ue,ce;if(typeof q(o,Q).timeout=="number"&&q(o,Q).timeout>zs)throw new RangeError(`The \`timeout\` option cannot be greater than ${zs}`);await Promise.resolve();let p=await ke(w=o,oe,kp).call(w);for(const ge of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await ge(o.request,ke(N=o,oe,ri).call(N),F,{retryCount:q(o,Bt)})}catch(Pe){throw ke(Y=o,oe,Ja).call(Y,F),ke(L=o,oe,Ja).call(L,p),Pe}if(W instanceof yp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new As(W.options);const se=W instanceof globalThis.Response?W:p;F!==se&&ke(U=o,oe,Ja).call(U,F),p!==se&&ke(K=o,oe,Ja).call(K,p),p=se}if(ke(X=o,oe,Us).call(X,p),!p.ok&&(typeof q(o,Q).throwHttpErrors=="function"?q(o,Q).throwHttpErrors(p.status):q(o,Q).throwHttpErrors)){let ge=new Ns(p,o.request,ke(ue=o,oe,ri).call(ue));for(const F of q(o,Q).hooks.beforeError)ge=await F(ge,{retryCount:q(o,Bt)});throw ge}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const ge=p.clone();return ke(ce=o,oe,Ja).call(ce,p),Vb(ge,q(o,Q).onDownloadProgress)}return p},m=ke(g=o,oe,qs).call(g,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Vr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Vr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(Ub))p==="bytes"&&typeof((_=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:_.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await m;if(p==="json"){if(k.status===204)return"";const N=await k.text();return N===""?"":s.parseJson?s.parseJson(N):JSON.parse(N)}return k[p]()});return m}};Jr=new WeakSet,xp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,oe=new WeakSet,Gr=function(){const u=q(this,Q).retry.delay(q(this,Bt));let s=u;q(this,Q).retry.jitter===!0?s=Math.random()*u:typeof q(this,Q).retry.jitter=="function"&&(s=q(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=q(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},Sp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new mp(u);if(s instanceof As)return s.customDelay??ke(this,oe,Gr).call(this);if(!q(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(q(this,Q).retry.shouldRetry!==void 0){const o=await q(this,Q).retry.shouldRetry({error:s,retryCount:q(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,oe,Gr).call(this)}if(a0(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if(t0(u)){if(!q(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&q(this,Q).retry.afterStatusCodes.includes(u.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=q(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(u.response.status===413)throw u}return ke(this,oe,Gr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Vr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Vr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,Sp).call(this,s),zs);if(q(this,Bt)<1)throw s;if(await Ib(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof As&&s.customRequest){const f=q(this,Q).signal?new globalThis.Request(s.customRequest,{signal:q(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,oe,Xr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ke(this,oe,ri).call(this),error:s,retryCount:q(this,Bt)});if(m instanceof globalThis.Request){ke(this,oe,Xr).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===gp)return}return ke(this,oe,qs).call(this,u)}},kp=async function(){var s;(s=q(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:q(this,Q).signal}));for(const o of q(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,oe,ri).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Xr).call(this,f);break}}const u=Pb(this.request,q(this,Q));return Kt(this,$a,this.request),this.request=q(this,$a).clone(),q(this,Q).timeout===!1?q(this,Q).fetch(q(this,$a),u):Fb(q(this,$a),u,q(this,Jt),q(this,Q))},ri=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Xr=function(u){Kt(this,vn,void 0),this.request=ke(this,oe,Ls).call(this,u)},Ls=function(u,s){return!q(this,Q).onUploadProgress||!u.body?u:Xb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ui,Jr);let Kr=ui;/*! MIT License © Sindre Sorhus */const Hs=i=>{const u=(s,o)=>Kr.create(s,Nr(i,o));for(const s of pp)u[s]=(o,f)=>Kr.create(o,Nr(i,f,{method:s}));return u.create=s=>Hs(Nr(s)),u.extend=s=>(typeof s=="function"&&(s=s(i??{})),Hs(Nr(i,s))),u.stop=gp,u.retry=Lb,u},Eh=Hs();let Ur=null;const Qr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[i=>{const u=xa.getState().accessToken;u&&i.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(i,u,s)=>{if(s.status===401&&!i.headers.has("X-Retry-After-Refresh")){Ur||(Ur=xa.getState().refresh().finally(()=>{Ur=null}));try{await Ur}catch{throw s}const o=xa.getState().accessToken;return o&&i.headers.set("Authorization",`Bearer ${o}`),i.headers.set("X-Retry-After-Refresh","1"),Eh(i,u)}}]}}),n0=3e4;function l0(i){if(i.link)return i.link;const u=(i.title+" "+i.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(i.title+" "+i.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function Ep(){const i=Fa(),[u,s]=y.useState([]),[o,f]=y.useState(0),[m,g]=y.useState(!1),[b,_]=y.useState(!1),p=y.useRef(null),{t:w}=Vt(),k=y.useRef(async()=>{try{_(!0);const H=(await Qr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,B=H.filter(U=>!U.isRead).length;s(U=>U.length===H.length&&U.every((K,X)=>K.id===H[X].id&&K.isRead===H[X].isRead)?U:H),f(U=>U===B?U:B)}catch{}finally{_(!1)}});y.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),n0);return()=>clearInterval(L)},[]),y.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Qr.post(`web/notifications/${L}/read`),s(H=>H.map(B=>B.id===L?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}}async function Y(){try{await Qr.post("web/notifications/read-all"),s(L=>L.map(H=>({...H,isRead:!0}))),f(0)}catch{}}return h.jsxs("div",{className:"relative",ref:p,children:[h.jsxs("button",{type:"button",onClick:()=>g(L=>!L),"aria-label":w("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[h.jsx(Pv,{size:16}),o>0&&h.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),m&&h.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&h.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[h.jsx(eb,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),h.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?h.jsx("div",{className:"flex justify-center py-8",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[h.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),h.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(L=>{const H=l0(L);return h.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${L.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(L.isRead||N(L.id),g(!1),i(H))},children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm font-medium",title:L.title,children:L.title}),h.jsx("p",{className:"truncate text-xs text-[var(--text-secondary)]",title:L.body,children:L.body}),h.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(L.createdAt).toLocaleString()})]}),!L.isRead&&h.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),N(L.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:h.jsx(tb,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function i0(i){return i&&i.trim().length>0?i:null}function wp(i,u=50){return i0(i.name)??Wh(i.description,u)}function r0(i){return i.description}function Tp(i){return`#${i.id} ${r0(i)}`}function ex(i,u=100){return{text:`#${i.id} ${wp(i,u)}`,title:Tp(i)}}function u0(i){return{tasks:i.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${wp(u)}`,subtitle:`${u.status} · ${u.project_key}`,hoverTitle:Tp(u)})),workers:(i.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:i.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const o0=300,wh={tasks:vb,workers:lp,projects:ub},s0={tasks:"tasks",workers:"workers",projects:"projects"};function jp({renderTrigger:i}={}){const[u,s]=y.useState(""),[o,f]=y.useState({tasks:[],workers:[],projects:[]}),[m,g]=y.useState(!1),[b,_]=y.useState(!1),[p,w]=y.useState(0),k=y.useRef(null),N=y.useRef(null),Y=y.useRef(void 0),L=y.useRef(void 0),H=Fa(),{t:B}=Vt(),U=y.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=y.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=L.current)==null||Pe.abort();const se=new AbortController;L.current=se;try{g(!0);const Je=await Qr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(u0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||g(!1)}},[]);y.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),o0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),y.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),_(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),y.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){_(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function ue(W){switch(X(),W.type){case"task":H(`/tasks/${W.id}`);break;case"worker":H(`/workers/${W.id}`);break;case"project":H(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(se=>Math.min(se+1,U.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(se=>Math.max(se-1,0))):W.key==="Enter"&&U[p]&&(W.preventDefault(),ue(U[p]))}const ge=U.length>0;let F=0;return h.jsxs(h.Fragment,{children:[i?i(()=>_(!0)):h.jsxs("button",{type:"button",onClick:()=>_(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[h.jsx(np,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:B("common.search_placeholder")}),h.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),b&&h.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&X()},children:h.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[h.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),h.jsx("input",{ref:N,type:"text",placeholder:B("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),h.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!ge&&!m?h.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:B("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const se=o[W];if(se.length===0)return null;const Pe=wh[W],Je=F;return F+=se.length,h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[h.jsx(Pe,{className:"h-3 w-3"}),h.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:s0[W]})]}),se.map((Ce,At)=>{const ut=Je+At,Me=ut===p;return h.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Me?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>ue(Ce),onMouseEnter:()=>w(ut),children:[h.jsx("span",{className:`text-xs ${Me?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Me?">":" "}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm",title:Ce.hoverTitle??Ce.title,children:Ce.title}),Ce.subtitle&&h.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",title:Ce.subtitle,children:Ce.subtitle})]})]},`${Ce.type}-${Ce.id}`)})]},W)})}),h.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",B("common.navigate_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",B("common.select_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",B("common.close_hint")]})]})]})})]})}const c0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function Th(i){return Array.from(i.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function f0({isOpen:i,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:m,cancelLabel:g,confirmVariant:b="danger",isLoading:_,children:p}){const{t:w}=Vt(),k=y.useId(),N=m??w("common.confirm"),Y=g??w("common.cancel"),L=y.useRef(null),H=y.useRef(null),B=c0[b];y.useEffect(()=>{if(!i)return;H.current=document.activeElement;const K=requestAnimationFrame(()=>{if(L.current){const X=Th(L.current);X.length>0&&X[0].focus()}});return()=>{var X;cancelAnimationFrame(K),(X=H.current)==null||X.focus()}},[i]);const U=y.useCallback(K=>{if(K.key==="Escape"){u();return}if(K.key==="Tab"&&L.current){const X=Th(L.current);if(X.length===0)return;const ue=X[0],ce=X[X.length-1];K.shiftKey?document.activeElement===ue&&(K.preventDefault(),ce.focus()):document.activeElement===ce&&(K.preventDefault(),ue.focus())}},[u]);return i?h.jsx("div",{onClick:u,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:h.jsxs("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":k,onClick:K=>K.stopPropagation(),onKeyDown:U,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[h.jsx("div",{style:{marginBottom:"1.25rem"},children:h.jsxs("div",{id:k,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[h.jsx(ip,{style:{width:"1rem",height:"1rem"}}),o]})}),h.jsxs("div",{style:{marginBottom:"1.25rem"},children:[h.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f}),p]}),h.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[h.jsx("button",{type:"button",onClick:u,disabled:_,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",cursor:_?"not-allowed":"pointer",opacity:_?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),h.jsx("button",{type:"button",onClick:s,disabled:_,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:_?"not-allowed":"pointer",opacity:_?.7:1},children:_?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function d0(){const i=navigator.userAgent;return/iP(hone|od|ad)/.test(i)&&/WebKit/.test(i)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(i)}function m0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function h0(){const{t:i}=Vt(),[u,s]=y.useState("hidden"),[o,f]=y.useState(!1),m=y.useRef(null),g=y.useRef(void 0);y.useEffect(()=>{if(m0()||localStorage.getItem(jh)||window.innerWidth>=768)return;const p=k=>{k.preventDefault(),m.current=k};window.addEventListener("beforeinstallprompt",p);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",p),clearTimeout(w),clearTimeout(g.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),g.current=setTimeout(()=>s("hidden"),200)}async function _(){if(m.current){await m.current.prompt();const{outcome:p}=await m.current.userChoice;p==="accepted"&&b(),m.current=null}else d0()&&f(!0)}return u==="hidden"?null:h.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":i("pwa_install.title"),children:h.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),h.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:i("pwa_install.title")})]}),h.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:h.jsx(rp,{size:14})})]}),h.jsx("div",{className:"px-3.5 py-3",children:o?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.ios_command")]}),h.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[i("pwa_install.ios_step_1"),i("pwa_install.ios_step_2"),i("pwa_install.ios_step_3")].map((p,w)=>h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:h.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),h.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&h.jsx(gb,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),p]})]},w))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.command")]}),h.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",i("pwa_install.desc_1"),h.jsx("br",{}),"→ ",i("pwa_install.desc_2")]}),h.jsxs("div",{className:"mt-2.5 flex gap-2",children:[h.jsx("button",{onClick:_,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_install.install")}),h.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:i("pwa_install.skip")})]})]})})]})})}function p0(){const{t:i}=Vt(),[u,s]=y.useState(!1);return y.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,m=null,g=null,b=null;function _(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",_);function p(k){if(f=k,k.waiting){s(!0);return}g=()=>{const N=k.installing;N&&(m=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",g)}navigator.serviceWorker.getRegistration().then(k=>{k&&!o&&p(k)});const w=setInterval(()=>{navigator.serviceWorker.getRegistration().then(k=>{!k||o||(k.update().catch(()=>{}),k.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(w),navigator.serviceWorker.removeEventListener("controllerchange",_),f&&g&&f.removeEventListener("updatefound",g),m&&b&&m.removeEventListener("statechange",b)}},[]),u?h.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsx(ap,{size:14,className:"shrink-0 text-[var(--accent)]"}),h.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:i("pwa_update.message")}),h.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_update.reload")})]})}):null}const qr=64,g0=96,Rh=32;function y0({children:i,className:u}){const s=y.useRef(null),o=y.useRef(0),f=y.useRef("idle"),[m,g]=y.useState(0),[b,_]=y.useState("idle"),p=y.useCallback(U=>{f.current=U,_(U)},[]),w=y.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=y.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=y.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(g(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,g0);g(ue),p(ue>=qr?"ready":"pulling")},[w,p]),Y=y.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),g(qr),setTimeout(()=>{window.location.reload()},300)):(g(0),p("idle")),o.current=0)},[p]);y.useEffect(()=>{const U=s.current;if(U)return U.addEventListener("touchstart",k,{passive:!0}),U.addEventListener("touchmove",N,{passive:!1}),U.addEventListener("touchend",Y,{passive:!0}),()=>{U.removeEventListener("touchstart",k),U.removeEventListener("touchmove",N),U.removeEventListener("touchend",Y)}},[k,N,Y]);const L=Math.min(m/qr,1),H=b==="refreshing"?0:m/qr*180,B=m>0||b==="refreshing";return h.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&h.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:m,transition:b==="idle"?"height 200ms ease-out":void 0},children:h.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Rh,height:Rh,opacity:L,transition:b==="idle"?"opacity 200ms ease-out":void 0},children:b==="refreshing"?h.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[h.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),h.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):h.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:b==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${H}deg)`,transition:"color 150ms"},children:h.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i]})}const Rp=y.createContext({setActions:()=>{}});function tx(i){const{setActions:u}=y.useContext(Rp);y.useEffect(()=>(u(i),()=>u(null)),[i,u])}const Ap=y.createContext({setSubtitle:()=>{}});function ax(i){const{setSubtitle:u}=y.useContext(Ap),s=typeof i=="string"?i:(i==null?void 0:i.text)??null,o=typeof i=="string"?i:(i==null?void 0:i.title)??(i==null?void 0:i.text)??null;y.useEffect(()=>s?(u(o&&o!==s?{text:s,title:o}:s),()=>u(null)):(u(null),()=>u(null)),[s,o,u])}const _0=[{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph}],v0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/dashboard",label:"dashboard",icon:ep}],b0=[{to:"/workers",label:"workers",icon:lp},{to:"/projects",label:"projects",icon:ob},{to:"/access-tokens",label:"tokens",icon:cb}],x0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:rb},{to:"/docs/bot",label:"bot",icon:hb},{to:"/docs/skill",label:"skill",icon:_b},{to:"/docs/all",label:"all",icon:fb}],S0=[{to:"/admin",label:"admin",icon:yb}],k0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph},{to:"/dashboard",label:"dashboard",icon:ep}],Lr={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/plan":{title:"plan.title",subtitle:"plan.title"},"/review":{title:"review.title",subtitle:"review.title"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_tokens",subtitle:"common.breadcrumb_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function E0(i){const{t:u}=Vt();if(Lr[i]){const o=Lr[i];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+i.split("/").filter(Boolean)[0];if(Lr[s]){const o=Lr[s],f=i.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:i.slice(1).replace(/\//g," // ")||"home"}}function w0(i,u){return i==="/home"?u==="/home":i==="/dashboard"?u==="/dashboard":u.startsWith(i)}function T0(){const i=yt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title"),plan:u("plan.title"),review:u("review.title")};return h.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[k0.map(({to:o,label:f,icon:m})=>{const g=w0(o,i.pathname);return h.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(m,{size:18,className:g?"text-[var(--accent)]":"text-[var(--text-muted)]"}),h.jsx("span",{className:`text-[11px] lowercase ${g?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),h.jsx(jp,{renderTrigger:o=>h.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(np,{size:18,className:"text-[var(--text-muted)]"}),h.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function j0(){const i=Fa(),{t:u}=Vt();return h.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[h.jsxs("button",{onClick:()=>i("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:h.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),h.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:()=>i("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:h.jsx(xb,{size:18})}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})}function li({label:i,items:u,collapsed:s}){return h.jsxs("div",{className:"mt-4 first:mt-0",children:[h.jsx("div",{className:`overflow-hidden transition-all duration-300 ${s?"max-h-0 mb-0 opacity-0":"max-h-6 mb-2 opacity-100"}`,children:h.jsx("div",{className:"px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:i})}),u.map(({to:o,label:f,icon:m})=>h.jsx(Js,{to:o,className:({isActive:g})=>`flex items-center text-sm lowercase transition-all duration-300 ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${g?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:g})=>h.jsxs(h.Fragment,{children:[h.jsx(m,{size:14,style:{flexShrink:0}}),!s&&h.jsx("span",{children:g?`> ${f}`:` ${f}`})]})},o))]})}function R0(){const{user:i,logout:u}=xa(),s=Fa(),[o,f]=y.useState(!1),m=wb(),{t:g}=Vt(),{sidebarCollapsed:b,toggleSidebar:_}=jb();function p(){u(),s("/login")}return h.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[h.jsx("div",{className:"flex items-center px-5",style:{height:48},children:h.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:h.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&h.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:g("common.overlord")})]})}),h.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[h.jsx(li,{label:g("common.loop_section"),items:_0,collapsed:b}),h.jsx(li,{label:g("common.tasks_section"),items:v0,collapsed:b}),h.jsx(li,{label:g("common.fleet_section"),items:b0,collapsed:b}),h.jsx(li,{label:g("common.docs_section"),items:x0,collapsed:b}),m&&h.jsx(li,{label:g("common.admin_section"),items:S0,collapsed:b})]}),h.jsx("div",{className:"flex px-3 py-1",children:h.jsx("button",{onClick:_,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":b?"expand sidebar":"collapse sidebar",children:b?h.jsx(nb,{size:14}):h.jsx(ab,{size:14})})}),h.jsx("div",{className:"border-t border-[var(--border)] p-3",children:h.jsxs("div",{className:`flex min-h-[44px] items-center px-3 transition-[gap] duration-300 ${b?"gap-0":"gap-3"}`,children:[h.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:g("common.profile"),children:((i==null?void 0:i.username)??"u")[0].toUpperCase()}),h.jsxs("div",{className:`flex min-w-0 flex-1 items-center overflow-hidden transition-[max-width,opacity] duration-300 ${b?"pointer-events-none max-w-0 opacity-0":"max-w-[calc(100%-28px)] opacity-100"}`,"aria-hidden":b,children:[h.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:g("common.profile"),tabIndex:b?-1:void 0,children:[h.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(i==null?void 0:i.username)??"user"}),h.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(i==null?void 0:i.role)??"user"})]}),h.jsx("button",{onClick:()=>f(!0),className:"ml-2 p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":g("common.log_out"),tabIndex:b?-1:void 0,children:h.jsx(mb,{size:14})})]})]})}),h.jsx(f0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:g("common.logout_title"),message:g("common.logout_message"),confirmLabel:g("common.logout"),confirmVariant:"warning"})]})}function A0({headerActions:i,subtitleOverride:u}){const s=yt(),{title:o,subtitle:f}=E0(s.pathname),m=u??f,g=typeof m=="string"?m:m==null?void 0:m.text,b=typeof m=="string"?m:(m==null?void 0:m.title)??(m==null?void 0:m.text);return h.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[h.jsxs("div",{className:"text-sm lowercase",children:[h.jsx("span",{style:{color:"var(--text-primary)"},children:o}),g&&h.jsxs("span",{style:{color:"var(--text-muted)"},title:b,children:[" ","// ",Wh(g,40)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(jp,{}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})]})}function z0(){const[i,u]=y.useState(null),[s,o]=y.useState(null),f=yt(),m=f.pathname==="/home",g=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return y.useEffect(()=>sp.getState().init(),[]),h.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[h.jsx(R0,{}),h.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[h.jsx(j0,{}),!b&&h.jsx(A0,{headerActions:i,subtitleOverride:s}),h.jsx(y0,{className:m||g?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:h.jsx(Rp.Provider,{value:{setActions:u},children:h.jsx(Ap.Provider,{value:{setSubtitle:o},children:h.jsx(hv,{})})})}),h.jsx(h0,{}),h.jsx(p0,{}),h.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:h.jsx(T0,{})})]})]})}function Ah(i){var s;const u=(s=i.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:i.pathname,search:i.search}}}function ii({children:i,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),g=yt();if(m)return h.jsx("div",{className:"flex h-screen items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return h.jsx(ll,{to:"/login",state:Ah(g),replace:!0});if(f){const b=Ah(g);return g.pathname!=="/totp-setup"&&g.pathname!=="/bind"?h.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):g.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),h.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):h.jsx(h.Fragment,{children:i})}return u&&(o==null?void 0:o.role)!==up.ADMIN?h.jsx(ll,{to:"/home",replace:!0}):h.jsx(h.Fragment,{children:i})}function O0({children:i}){const{theme:u,resolved:s,setResolved:o}=fp();return y.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=g=>o(g.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[u,o]),y.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),h.jsx(h.Fragment,{children:i})}class C0 extends y.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?h.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[h.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Yr("common.runtime_error")}),h.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Yr("common.an_unexpected_error_occurred")}),h.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[h.jsx(ap,{className:"h-3.5 w-3.5"}),Yr("common.reload")]})]}):this.props.children}}function D0({isOpen:i}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function m(){s(),o(!1),u("/login")}return i?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),h.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:h.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[h.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:h.jsx(db,{className:"h-7 w-7 text-[var(--warning)]"})}),h.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),h.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),h.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const zh=5;let ba=[];const Bs=new Set;function zp(){Bs.forEach(i=>i())}function N0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(i,u,s=4e3){const o=N0();return ba=[...ba,{id:o,variant:i,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),zp(),o}Wa.success=(i,u)=>Wa("success",i,u);Wa.error=(i,u)=>Wa("error",i,u);Wa.warning=(i,u)=>Wa("warning",i,u);Wa.info=(i,u)=>Wa("info",i,u);function M0(i){ba=ba.filter(u=>u.id!==i),zp()}function U0(){const[,i]=y.useState(0);return y.useEffect(()=>{const u=()=>i(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const q0={success:{icon:lb,borderColor:"var(--accent)"},error:{icon:ib,borderColor:"var(--destructive)"},warning:{icon:ip,borderColor:"var(--warning)"},info:{icon:sb,borderColor:"var(--info)"}};function L0({item:i}){const u=q0[i.variant],s=u.icon,{t:o}=Vt(),f=y.useCallback(()=>M0(i.id),[i.id]);return y.useEffect(()=>{if(!i.duration)return;const m=setTimeout(f,i.duration);return()=>clearTimeout(m)},[i.duration,f]),h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[h.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),h.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:i.message}),h.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:h.jsx(rp,{className:"h-3.5 w-3.5"})})]})}function H0(){const i=U0();return i.length===0?null:h.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:i.map(u=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(L0,{item:u})},u.id))})}const B0=y.lazy(()=>ae(()=>import("./LandingPage-YcgE-OTL.js"),__vite__mapDeps([0,1,2,3,4,5]))),Y0=y.lazy(()=>ae(()=>import("./LoginPage-F34Kt4ot.js"),[])),G0=y.lazy(()=>ae(()=>import("./TotpSetupPage-CI411-Y7.js"),[])),V0=y.lazy(()=>ae(()=>import("./NotFoundPage-DPZDwk1M.js"),[])),X0=y.lazy(()=>ae(()=>import("./HomePage-CQ0Upd0D.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),Q0=y.lazy(()=>ae(()=>import("./TerminalHomePage-CDr4Mq6o.js"),__vite__mapDeps([15,16,17,18,19,20,12,21,22,10,11,23,24,8,25,26,13,27,28,29]))),Z0=y.lazy(()=>ae(()=>import("./TaskListPage-CFri9wCk.js"),__vite__mapDeps([30,22,7,8,12,14,31,23,24,25,26,5,32,9,27,33,11]))),K0=y.lazy(()=>ae(()=>import("./TaskDetailPage-Beto_Zqp.js"),__vite__mapDeps([34,22,16,17,18,19,20,12,21,23,24,8,26,25,14,35,31,36,37,38]))),J0=y.lazy(()=>ae(()=>import("./PlanPage-Dds_7koM.js"),__vite__mapDeps([39,32,9,12,23,24,27,37,33,11]))),$0=y.lazy(()=>ae(()=>import("./ReviewPage-CNeCz2eT.js"),__vite__mapDeps([40,32,9,12,26,25,36]))),W0=y.lazy(()=>ae(()=>import("./ReviewAggregatePage-Dq3hl9db.js"),__vite__mapDeps([41,19,20,9,12,26,25,35,17,36,38,18,28,24]))),F0=y.lazy(()=>ae(()=>import("./WorkerListPage-nPKvREXn.js"),__vite__mapDeps([42,8,43,44,45,46,47,36,29,5,17,23,24,32,9,13,27,35]))),I0=y.lazy(()=>ae(()=>import("./WorkerDetailPage-DcMycoTh.js"),__vite__mapDeps([48,12,8,49,43,13,14,50,35]))),P0=y.lazy(()=>ae(()=>import("./WorkerSetupGuidePage-DHbju_7j.js"),__vite__mapDeps([44,45,46,47,36,29]))),e1=y.lazy(()=>ae(()=>import("./ProjectListPage-D62NmkBp.js"),__vite__mapDeps([51,23,24,26,32,9,12,13,27,35]))),t1=y.lazy(()=>ae(()=>import("./ProjectDetailPage-1mftEUqP.js"),__vite__mapDeps([52,53,23,24,14,12,8,49,13,54,50,35,27]))),a1=y.lazy(()=>ae(()=>import("./EditProjectPage-DKaSpnod.js"),__vite__mapDeps([55,23,24,53,26,27]))),n1=y.lazy(()=>ae(()=>import("./PipelineEditorPage-18u7wxjE.js"),__vite__mapDeps([56,23,24]))),l1=y.lazy(()=>ae(()=>import("./ProfilePage-D3YRdW9C.js"),__vite__mapDeps([57,58,49,13]))),i1=y.lazy(()=>ae(()=>import("./BindPlatformPage-Bp_NG22g.js"),[])),r1=y.lazy(()=>ae(()=>import("./AccessTokensPage-DsNgVUdv.js"),__vite__mapDeps([59,23,24,32,9,12,13,27,5,50]))),u1=y.lazy(()=>ae(()=>import("./CliReferencePage-BiUl0LtI.js"),__vite__mapDeps([60,61,5,62,27]))),o1=y.lazy(()=>ae(()=>import("./ApiReferencePage-DXNSPdww.js"),__vite__mapDeps([63,62,5,27]))),s1=y.lazy(()=>ae(()=>import("./SkillPage-BGYJMqPr.js"),__vite__mapDeps([64,61,5,37]))),c1=y.lazy(()=>ae(()=>import("./DocsLayout-CX3AKUlL.js"),__vite__mapDeps([65,35]))),f1=y.lazy(()=>ae(()=>import("./InstallationPage-0TO7IQzJ.js"),__vite__mapDeps([66,61,5]))),d1=y.lazy(()=>ae(()=>import("./DeveloperSetupPage-D3FDp-R7.js"),__vite__mapDeps([67,61,5]))),m1=y.lazy(()=>ae(()=>import("./WorkerSetupPage-D0Cob5nl.js"),__vite__mapDeps([68,61,5]))),h1=y.lazy(()=>ae(()=>import("./BotSetupPage-Ct_gjzJt.js"),__vite__mapDeps([69,61,5]))),p1=y.lazy(()=>ae(()=>import("./LocalDevelopmentPage-BDpTHWAo.js"),__vite__mapDeps([70,61,5]))),g1=y.lazy(()=>ae(()=>import("./WorkerOperationsPage-qgdLSK1X.js"),[])),y1=y.lazy(()=>ae(()=>import("./DeploymentPage-DtlH8d7p.js"),__vite__mapDeps([71,61,5]))),Oh=y.lazy(()=>ae(()=>import("./BotIntegrationPage-DuH_f_mp.js"),[])),_1=y.lazy(()=>ae(()=>import("./PipelineConfigPage-D5gx3bIv.js"),__vite__mapDeps([72,61,5]))),v1=y.lazy(()=>ae(()=>import("./DevWorkflowPage-BoZm03L7.js"),__vite__mapDeps([73,61,5]))),b1=y.lazy(()=>ae(()=>import("./PermissionsPage-DsNmsUoe.js"),[])),x1=y.lazy(()=>ae(()=>import("./EnvVariablesPage-C2nu-wxe.js"),__vite__mapDeps([74,61,5]))),S1=y.lazy(()=>ae(()=>import("./ArchitecturePage-DFUNHKTN.js"),__vite__mapDeps([75,61,5]))),k1=y.lazy(()=>ae(()=>import("./ChangelogPage-DrpgpyjK.js"),[])),E1=y.lazy(()=>ae(()=>import("./AgentCliPage-Bp8tQiWl.js"),__vite__mapDeps([76,61,5]))),w1=y.lazy(()=>ae(()=>import("./TaskGuidePage-CKnugDRu.js"),__vite__mapDeps([77,61,5]))),T1=y.lazy(()=>ae(()=>import("./DocsIndexPage-ZBDBTreg.js"),__vite__mapDeps([78,46,2,3,47,21]))),j1=y.lazy(()=>ae(()=>import("./AdminPage-NZC6yOHW.js"),__vite__mapDeps([79,4,2,80,47]))),R1=y.lazy(()=>ae(()=>import("./DeveloperManage-hoNX7J5P.js"),__vite__mapDeps([81,23,24,58,32,9,13,8,27,4,54,18]))),A1=y.lazy(()=>ae(()=>import("./BotManage-CJ5GZ0HR.js"),__vite__mapDeps([82,23,24,61,5,50,27,32,9,13,8,2,54]))),z1=y.lazy(()=>ae(()=>import("./TokenManage-BqOEJDHV.js"),__vite__mapDeps([83,45,5,37,32,9,13,8,27]))),O1=y.lazy(()=>ae(()=>import("./AuditLogPage-Wtpr8CDi.js"),__vite__mapDeps([84,23,24,32,9,80,33,11]))),C1=y.lazy(()=>ae(()=>import("./SettingsPage-Ml3L-j5R.js"),[]));function D1(){return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function N1(){const i=xa(u=>u.sessionExpired);return h.jsxs(O0,{children:[h.jsx(H0,{}),h.jsx(C0,{children:h.jsxs(Yv,{children:[h.jsx(D0,{isOpen:i}),h.jsx(y.Suspense,{fallback:h.jsx(D1,{}),children:h.jsxs(gv,{children:[h.jsx(P,{path:"/",element:h.jsx(B0,{})}),h.jsx(P,{path:"/login",element:h.jsx(Y0,{})}),h.jsx(P,{path:"/totp-setup",element:h.jsx(ii,{children:h.jsx(G0,{})})}),h.jsx(P,{path:"/bind",element:h.jsx(ii,{children:h.jsx(i1,{})})}),h.jsxs(P,{element:h.jsx(ii,{children:h.jsx(z0,{})}),children:[h.jsx(P,{path:"/home",element:h.jsx(Q0,{})}),h.jsx(P,{path:"/dashboard",element:h.jsx(X0,{})}),h.jsx(P,{path:"/tasks",element:h.jsx(Z0,{})}),h.jsx(P,{path:"/tasks/:id",element:h.jsx(K0,{})}),h.jsx(P,{path:"/plan",element:h.jsx(J0,{})}),h.jsx(P,{path:"/review",element:h.jsx($0,{})}),h.jsx(P,{path:"/review/:sourceTaskId",element:h.jsx(W0,{})}),h.jsx(P,{path:"/workers",element:h.jsx(F0,{})}),h.jsx(P,{path:"/workers/setup",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(P0,{})})}),h.jsx(P,{path:"/workers/:id",element:h.jsx(I0,{})}),h.jsx(P,{path:"/projects",element:h.jsx(e1,{})}),h.jsx(P,{path:"/projects/:key",element:h.jsx(t1,{})}),h.jsx(P,{path:"/projects/:key/edit",element:h.jsx(a1,{})}),h.jsx(P,{path:"/projects/:key/pipeline",element:h.jsx(n1,{})}),h.jsx(P,{path:"/profile",element:h.jsx(l1,{})}),h.jsx(P,{path:"/access-tokens",element:h.jsx(r1,{})}),h.jsxs(P,{path:"/docs",element:h.jsx(c1,{}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"cli",replace:!0})}),h.jsx(P,{path:"cli",element:h.jsx(u1,{})}),h.jsx(P,{path:"api",element:h.jsx(o1,{})}),h.jsx(P,{path:"bot",element:h.jsx(Oh,{})}),h.jsx(P,{path:"all",element:h.jsx(T1,{})}),h.jsx(P,{path:"skill",element:h.jsx(s1,{})}),h.jsx(P,{path:"installation",element:h.jsx(f1,{})}),h.jsx(P,{path:"developer-setup",element:h.jsx(d1,{})}),h.jsx(P,{path:"worker-setup",element:h.jsx(m1,{})}),h.jsx(P,{path:"bot-setup",element:h.jsx(h1,{})}),h.jsx(P,{path:"local-development",element:h.jsx(p1,{})}),h.jsx(P,{path:"worker-operations",element:h.jsx(g1,{})}),h.jsx(P,{path:"deployment",element:h.jsx(y1,{})}),h.jsx(P,{path:"bot-integration",element:h.jsx(Oh,{})}),h.jsx(P,{path:"pipeline-config",element:h.jsx(_1,{})}),h.jsx(P,{path:"dev-workflow",element:h.jsx(v1,{})}),h.jsx(P,{path:"permissions",element:h.jsx(b1,{})}),h.jsx(P,{path:"env-variables",element:h.jsx(x1,{})}),h.jsx(P,{path:"architecture",element:h.jsx(S1,{})}),h.jsx(P,{path:"task-guide",element:h.jsx(w1,{})}),h.jsx(P,{path:"agent-cli",element:h.jsx(E1,{})}),h.jsx(P,{path:"changelog",element:h.jsx(k1,{})})]}),h.jsxs(P,{path:"/admin",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(j1,{})}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"developers",replace:!0})}),h.jsx(P,{path:"developers",element:h.jsx(R1,{})}),h.jsx(P,{path:"bots",element:h.jsx(A1,{})}),h.jsx(P,{path:"tokens",element:h.jsx(z1,{})}),h.jsx(P,{path:"audit-logs",element:h.jsx(O1,{})}),h.jsx(P,{path:"settings",element:h.jsx(C1,{})})]})]}),h.jsx(P,{path:"*",element:h.jsx(V0,{})})]})})]})})]})}function Op(i=window){var u,s;return((u=i.matchMedia)==null?void 0:u.call(i,"(display-mode: standalone)").matches)===!0||((s=i.navigator)==null?void 0:s.standalone)===!0}async function M1(i=window,u="portrait"){var o,f;if(!Op(i))return!1;const s=(f=(o=i.screen)==null?void 0:o.orientation)==null?void 0:f.lock;if(typeof s!="function")return!1;try{return await s.call(i.screen.orientation,u),!0}catch{return!1}}function U1(i){var u,s;return((u=i.matchMedia)==null?void 0:u.call(i,"(display-mode: standalone)").matches)===!0||((s=i.navigator)==null?void 0:s.standalone)===!0}function q1(i){var s,o;const u=((s=i.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=i.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function L1(i){const u=i.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function H1(i){const u=i.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return i.innerHeight>=i.innerWidth?Math.max(s,o):Math.min(s,o)}function B1(i=window,u=document){const s=u.documentElement,o=i.visualViewport??null;let f=-1;const m=()=>{const g=Math.round((o==null?void 0:o.height)??0),b=Math.round(i.innerHeight);let _=g>0?g:b;if(U1(i)&&q1(i)&&!L1(u)){const p=H1(i);p!==null&&(_=Math.max(_,b,p))}_!==f&&(f=_,s.style.setProperty("--app-height",`${_}px`))};return m(),i.addEventListener("resize",m),i.addEventListener("orientationchange",m),o==null||o.addEventListener("resize",m),()=>{i.removeEventListener("resize",m),i.removeEventListener("orientationchange",m),o==null||o.removeEventListener("resize",m)}}xa.getState().initialize();B1(window,document);const Cp=window,Y1=Op(Cp);M1(Cp);if(Y1){document.documentElement.classList.add("pwa-standalone");const i=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&i;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}h_.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(N1,{})}));export{f_ as $,V1 as A,X1 as B,tb as C,up as D,Ph as E,lb as F,W1 as G,Ns as H,db as I,ib as J,rb as K,Jh as L,hb as M,ll as N,Ih as O,h0 as P,J1 as Q,Ar as R,lp as S,dp as T,xb as U,ip as V,Z1 as W,rp as X,sb as Y,K1 as Z,ap as _,Vt as a,Wh as a0,cb as a1,mb as a2,$1 as a3,_b as a4,Js as a5,hv as a6,F1 as a7,I1 as a8,$s as b,_e as c,yb as d,fb as e,Fa as f,yt as g,Qr as h,wb as i,h as j,sp as k,wp as l,Tp as m,r0 as n,Ir as o,Q1 as p,ax as q,y as r,ex as s,Wa as t,xa as u,f0 as v,tx as w,np as x,tp as y,P1 as z};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-eKvCyU64.js";/**
1
+ import{c as e}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-eKvCyU64.js";/**
1
+ import{c as e}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-eKvCyU64.js";/**
1
+ import{c as a}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-eKvCyU64.js";/**
1
+ import{c as o}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-eKvCyU64.js";/**
1
+ import{c as e}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-eKvCyU64.js";/**
1
+ import{c as t}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-eKvCyU64.js";/**
1
+ import{c as a}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-eKvCyU64.js";/**
1
+ import{c as a}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-eKvCyU64.js";/**
1
+ import{c as o}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{W as r,p as e,a7 as s,a8 as u,a3 as a}from"./index-eKvCyU64.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
1
+ import{W as r,p as e,a7 as s,a8 as u,a3 as a}from"./index-CfvO5R0v.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
@@ -1 +1 @@
1
- import{p as a,Q as t}from"./index-eKvCyU64.js";import{a as l}from"./agent-type-options-BVIYXf2V.js";const r=[a.COMPLETED,a.FAILED,a.CANCELLED],E=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],o=l(e=>e);[...o];function c(e){return(e??t.CLAUDE).toLowerCase()}export{r as T,E as a,c as g};
1
+ import{p as a,Q as t}from"./index-CfvO5R0v.js";import{a as l}from"./agent-type-options-CdJpMswW.js";const r=[a.COMPLETED,a.FAILED,a.CANCELLED],E=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],o=l(e=>e);[...o];function c(e){return(e??t.CLAUDE).toLowerCase()}export{r as T,E as a,c as g};
@@ -1 +1 @@
1
- import{o as i,h as c}from"./index-eKvCyU64.js";const k=i((a,o)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async s=>{const t=o()._fetchTasksAbort;t&&t.abort();const e=new AbortController,n=o()._fetchTasksRequestId+1;a({loading:!0,error:null,_fetchTasksAbort:e,_fetchTasksRequestId:n});try{const r={};s!=null&&s.status&&(r.status=s.status),s!=null&&s.projectKey&&(r.projectKey=s.projectKey),s!=null&&s.developerId&&(r.developerId=s.developerId),s!=null&&s.cursor&&(r.cursor=s.cursor),s!=null&&s.limit&&(r.limit=String(s.limit));const l=await c.get("web/tasks",{searchParams:r,signal:e.signal}).json();if(o()._fetchTasksRequestId!==n)return;a({tasks:l.data,nextCursor:l.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;o()._fetchTasksRequestId===n&&a({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{o()._fetchTasksRequestId===n&&a({loading:!1,_fetchTasksAbort:null})}},fetchTask:async s=>{a({loading:!0,error:null});try{const t=await c.get(`web/tasks/${s}`).json();a({currentTask:t})}catch(t){a({error:t instanceof Error?t.message:"Failed to fetch task"})}finally{a({loading:!1})}},createTask:async s=>{a({error:null});try{const t=await c.post("web/tasks",{json:s}).json();return a(e=>({tasks:[t,...e.tasks]})),t}catch(t){throw a({error:t instanceof Error?t.message:"Failed to create task"}),t}},cancelTask:async s=>{a({error:null});try{await c.post(`web/tasks/${s}/cancel`);const{currentTask:t}=o();(t==null?void 0:t.id)===s&&await o().fetchTask(s)}catch(t){throw a({error:t instanceof Error?t.message:"Failed to cancel task"}),t}},reset:()=>{a({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}}));export{k as u};
1
+ import{o as i,h as c}from"./index-CfvO5R0v.js";const k=i((a,o)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async s=>{const t=o()._fetchTasksAbort;t&&t.abort();const e=new AbortController,n=o()._fetchTasksRequestId+1;a({loading:!0,error:null,_fetchTasksAbort:e,_fetchTasksRequestId:n});try{const r={};s!=null&&s.status&&(r.status=s.status),s!=null&&s.projectKey&&(r.projectKey=s.projectKey),s!=null&&s.developerId&&(r.developerId=s.developerId),s!=null&&s.cursor&&(r.cursor=s.cursor),s!=null&&s.limit&&(r.limit=String(s.limit));const l=await c.get("web/tasks",{searchParams:r,signal:e.signal}).json();if(o()._fetchTasksRequestId!==n)return;a({tasks:l.data,nextCursor:l.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;o()._fetchTasksRequestId===n&&a({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{o()._fetchTasksRequestId===n&&a({loading:!1,_fetchTasksAbort:null})}},fetchTask:async s=>{a({loading:!0,error:null});try{const t=await c.get(`web/tasks/${s}`).json();a({currentTask:t})}catch(t){a({error:t instanceof Error?t.message:"Failed to fetch task"})}finally{a({loading:!1})}},createTask:async s=>{a({error:null});try{const t=await c.post("web/tasks",{json:s}).json();return a(e=>({tasks:[t,...e.tasks]})),t}catch(t){throw a({error:t instanceof Error?t.message:"Failed to create task"}),t}},cancelTask:async s=>{a({error:null});try{await c.post(`web/tasks/${s}/cancel`);const{currentTask:t}=o();(t==null?void 0:t.id)===s&&await o().fetchTask(s)}catch(t){throw a({error:t instanceof Error?t.message:"Failed to cancel task"}),t}},reset:()=>{a({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}}));export{k as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-eKvCyU64.js";/**
1
+ import{c as e}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as e}from"./index-eKvCyU64.js";function p(s,l){const[i,d]=e.useState(null),[R,a]=e.useState(!0),[m,o]=e.useState(null),f=e.useRef(s);f.current=s;const r=e.useRef(0),t=e.useRef(!0),u=e.useCallback(async()=>{const c=++r.current;a(!0),o(null);try{const n=await f.current();t.current&&c===r.current&&d(n)}catch(n){if(t.current&&c===r.current){const E=n instanceof Error?n.message:"An unexpected error occurred";o(E)}}finally{t.current&&c===r.current&&a(!1)}},l);return e.useEffect(()=>{u()},[u]),e.useEffect(()=>()=>{t.current=!1,r.current+=1},[]),{data:i,loading:R,error:m,refetch:u}}export{p as u};
1
+ import{r as e}from"./index-CfvO5R0v.js";function p(s,l){const[i,d]=e.useState(null),[R,a]=e.useState(!0),[m,o]=e.useState(null),f=e.useRef(s);f.current=s;const r=e.useRef(0),t=e.useRef(!0),u=e.useCallback(async()=>{const c=++r.current;a(!0),o(null);try{const n=await f.current();t.current&&c===r.current&&d(n)}catch(n){if(t.current&&c===r.current){const E=n instanceof Error?n.message:"An unexpected error occurred";o(E)}}finally{t.current&&c===r.current&&a(!1)}},l);return e.useEffect(()=>{u()},[u]),e.useEffect(()=>()=>{t.current=!1,r.current+=1},[]),{data:i,loading:R,error:m,refetch:u}}export{p as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-eKvCyU64.js";/**
1
+ import{c as e}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-eKvCyU64.js";/**
1
+ import{c as e}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-eKvCyU64.js";/**
1
+ import{c}from"./index-CfvO5R0v.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/public/index.html CHANGED
@@ -28,7 +28,7 @@
28
28
  href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
29
29
  rel="stylesheet"
30
30
  />
31
- <script type="module" crossorigin src="/assets/index-eKvCyU64.js"></script>
31
+ <script type="module" crossorigin src="/assets/index-CfvO5R0v.js"></script>
32
32
  <link rel="stylesheet" crossorigin href="/assets/index-kJfGgL_V.css">
33
33
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
34
34
  <body>