@overlordai/server 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/assets/{AccessTokensPage-DjXg_GcZ.js → AccessTokensPage-DQEUkklL.js} +1 -1
- package/public/assets/{AdminPage-LU3VU8sd.js → AdminPage-Dy3fDESU.js} +1 -1
- package/public/assets/{ApiReferencePage-BMDuk9em.js → ApiReferencePage-BdVahGqK.js} +1 -1
- package/public/assets/{AuditLogPage-BQnvLBUm.js → AuditLogPage-DrxGWVeq.js} +1 -1
- package/public/assets/{BotManage-Is69ZQBf.js → BotManage-B3-rqR1c.js} +1 -1
- package/public/assets/{CliReferencePage-DpDJXb2B.js → CliReferencePage-Ca6ENkKU.js} +1 -1
- package/public/assets/{DeveloperManage-Ma4FgQXQ.js → DeveloperManage-CSd18cTX.js} +1 -1
- package/public/assets/{EditProjectPage-C78aJ078.js → EditProjectPage-jeKBXKpU.js} +1 -1
- package/public/assets/{EmptyState-BQ2BNVJS.js → EmptyState-CN7755V2.js} +1 -1
- package/public/assets/{HomePage-Bl0KZPgn.js → HomePage-BsiwA4gW.js} +1 -1
- package/public/assets/{LandingPage-Bxv40luT.js → LandingPage-BWfR2oXt.js} +1 -1
- package/public/assets/{LoginPage-CMyyf5ts.js → LoginPage-Ca4FsK2j.js} +1 -1
- package/public/assets/{MachineDetailPage-BARcjlVJ.js → MachineDetailPage-BdJIcUfz.js} +1 -1
- package/public/assets/{MachineListPage-C044mEFY.js → MachineListPage-B59mZoVm.js} +1 -1
- package/public/assets/{NotFoundPage-Ck2hYu_B.js → NotFoundPage-rIa2IHZG.js} +1 -1
- package/public/assets/{PipelineEditorPage-hoXGXxtB.js → PipelineEditorPage-DqNJhpu_.js} +1 -1
- package/public/assets/{ProfilePage-DQQh-J_f.js → ProfilePage-_uegx1AA.js} +1 -1
- package/public/assets/{ProjectDetailPage-7wHRY-_7.js → ProjectDetailPage-ByDXJRZx.js} +1 -1
- package/public/assets/{ProjectListPage-Cpzf-qNq.js → ProjectListPage-cWKxZMbI.js} +1 -1
- package/public/assets/{QuickAuth-CoRuLOkE.js → QuickAuth-DeEGbSkE.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-C-UcPD2-.js → RemoveMemberConfirmDialog-BHYJebBS.js} +1 -1
- package/public/assets/{Select-cAwdx-J1.js → Select-0Q0gGMd5.js} +1 -1
- package/public/assets/{SettingsPage-vlEdzALt.js → SettingsPage-BVRak3kN.js} +1 -1
- package/public/assets/{Skeleton-DkwMPaZ1.js → Skeleton-Brvkv-R9.js} +1 -1
- package/public/assets/{TaskDetailPage-CSM2ew4E.js → TaskDetailPage-NP2PS_Ck.js} +1 -1
- package/public/assets/{TaskListPage-Dr_IZ2vJ.js → TaskListPage-BpkKh4Yk.js} +1 -1
- package/public/assets/{TaskStatusBadge-B6pZ1mXD.js → TaskStatusBadge-C5Shy8Nl.js} +1 -1
- package/public/assets/TokenManage-k5e6DyJG.js +1 -0
- package/public/assets/{TotpSetupPage-CedCLn9b.js → TotpSetupPage-skouZwAo.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-C-faBGTF.js → WorkerSetupGuidePage-BelFB95H.js} +1 -1
- package/public/assets/{arrow-left-B701wpRZ.js → arrow-left-DcjEsA7R.js} +1 -1
- package/public/assets/{arrow-right-B4SWX5QX.js → arrow-right-B4YEa3u9.js} +1 -1
- package/public/assets/{bot-BMG_Lak4.js → bot-BXlxShij.js} +1 -1
- package/public/assets/{chevron-right-Dv5NEUXH.js → chevron-right-DfZYT44U.js} +1 -1
- package/public/assets/{copy-C0vNNRrm.js → copy-I9UBz5kC.js} +1 -1
- package/public/assets/{external-link-CVx7jdXb.js → external-link-6OjArMHy.js} +1 -1
- package/public/assets/{index-BTxGPsOB.js → index-DYT_rof3.js} +2 -2
- package/public/assets/{key-OwB_ZR3T.js → key-EI2JM6VQ.js} +1 -1
- package/public/assets/{loader-circle-BN3eQzTt.js → loader-circle-BlLUEdfY.js} +1 -1
- package/public/assets/{pencil-BtnOFy3d.js → pencil-CQghwYru.js} +1 -1
- package/public/assets/{plus-Cm_mqbAL.js → plus-Bi9CBO0p.js} +1 -1
- package/public/assets/{rotate-ccw-Di9lk9Jq.js → rotate-ccw-B5xHESUx.js} +1 -1
- package/public/assets/{scroll-text-C8HTue-V.js → scroll-text-0Fjom98e.js} +1 -1
- package/public/assets/{settings-BxP_lYKz.js → settings-Dz53j3EB.js} +1 -1
- package/public/assets/{task.store-CRByTXd0.js → task.store-DwkjgoRM.js} +1 -1
- package/public/assets/{trash-2-Bzd6fyHf.js → trash-2-Cv7vzkVw.js} +1 -1
- package/public/assets/{users-DmYD60pt.js → users-7UXJB8XB.js} +1 -1
- package/public/index.html +1 -1
- package/public/assets/TokenManage-TLgRE0QO.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-BWfR2oXt.js","assets/arrow-right-B4YEa3u9.js","assets/bot-BXlxShij.js","assets/users-7UXJB8XB.js","assets/copy-I9UBz5kC.js","assets/HomePage-BsiwA4gW.js","assets/protocol-C4f2G7mk.js","assets/TaskStatusBadge-C5Shy8Nl.js","assets/Skeleton-Brvkv-R9.js","assets/chevron-right-DfZYT44U.js","assets/TaskListPage-BpkKh4Yk.js","assets/task.store-DwkjgoRM.js","assets/Select-0Q0gGMd5.js","assets/EmptyState-CN7755V2.js","assets/plus-Bi9CBO0p.js","assets/TaskDetailPage-NP2PS_Ck.js","assets/arrow-left-DcjEsA7R.js","assets/rotate-ccw-B5xHESUx.js","assets/external-link-6OjArMHy.js","assets/loader-circle-BlLUEdfY.js","assets/TaskDetailPage-Beg8tuEN.css","assets/MachineListPage-B59mZoVm.js","assets/WorkerSetupGuidePage-BelFB95H.js","assets/key-EI2JM6VQ.js","assets/settings-Dz53j3EB.js","assets/MachineDetailPage-BdJIcUfz.js","assets/ProjectListPage-cWKxZMbI.js","assets/ProjectDetailPage-ByDXJRZx.js","assets/RemoveMemberConfirmDialog-BHYJebBS.js","assets/pencil-CQghwYru.js","assets/trash-2-Cv7vzkVw.js","assets/EditProjectPage-jeKBXKpU.js","assets/PipelineEditorPage-DqNJhpu_.js","assets/AccessTokensPage-DQEUkklL.js","assets/CliReferencePage-Ca6ENkKU.js","assets/QuickAuth-DeEGbSkE.js","assets/ApiReferencePage-BdVahGqK.js","assets/AdminPage-Dy3fDESU.js","assets/scroll-text-0Fjom98e.js","assets/DeveloperManage-CSd18cTX.js","assets/BotManage-B3-rqR1c.js","assets/TokenManage-k5e6DyJG.js","assets/AuditLogPage-DrxGWVeq.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var C_=Object.defineProperty;var Jm=u=>{throw TypeError(u)};var M_=(u,r,o)=>r in u?C_(u,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):u[r]=o;var kt=(u,r,o)=>M_(u,typeof r!="symbol"?r+"":r,o),ho=(u,r,o)=>r.has(u)||Jm("Cannot "+o);var U=(u,r,o)=>(ho(u,r,"read from private field"),o?o.call(u):r.get(u)),It=(u,r,o)=>r.has(u)?Jm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,o),Vt=(u,r,o,c)=>(ho(u,r,"write to private field"),c?c.call(u,o):r.set(u,o),o),ge=(u,r,o)=>(ho(u,r,"access private method"),o);var $m=(u,r,o,c)=>({set _(f){Vt(u,r,f,o)},get _(){return U(u,r,c)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function o(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 c(f){if(f.ep)return;f.ep=!0;const m=o(f);fetch(f.href,m)}})();function N_(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var po={exports:{}},ei={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -204,4 +204,4 @@ Please change the parent <Route path="${B}"> to <Route path="${B==="/"?"*":`${B}
|
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
206
|
*/const Jv=Oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),hh=u=>{let r;const o=new Set,c=(h,j)=>{const S=typeof h=="function"?h(r):h;if(!Object.is(S,r)){const D=r;r=j??(typeof S!="object"||S===null)?S:Object.assign({},r,S),o.forEach(V=>V(r,D))}},f=()=>r,T={setState:c,getState:f,getInitialState:()=>g,subscribe:h=>(o.add(h),()=>o.delete(h))},g=r=u(c,f,T);return T},$v=(u=>u?hh(u):hh),Wv=u=>u;function Fv(u,r=Wv){const o=Ru.useSyncExternalStore(u.subscribe,Ru.useCallback(()=>r(u.getState()),[u,r]),Ru.useCallback(()=>r(u.getInitialState()),[u,r]));return Ru.useDebugValue(o),o}const ph=u=>{const r=$v(u),o=c=>Fv(r,c);return Object.assign(o,r),o},Qh=(u=>u?ph(u):ph),zu="overlord-access-token",Au="overlord-refresh-token",lt={getAccessToken(){return localStorage.getItem(zu)},setAccessToken(u){localStorage.setItem(zu,u)},getRefreshToken(){return localStorage.getItem(Au)},setRefreshToken(u){localStorage.setItem(Au,u)},setTokens(u,r){localStorage.setItem(zu,u),localStorage.setItem(Au,r)},clearTokens(){localStorage.removeItem(zu),localStorage.removeItem(Au)},parseToken(u){try{const r=u.split(".")[1];return JSON.parse(atob(r))}catch{return null}},hasScope(u,r){const o=lt.parseToken(u);return o?o.scope===r:!1},isExpired(u){const r=lt.parseToken(u);return!r||typeof r.exp!="number"?!0:Date.now()/1e3>r.exp-30}},$a=Qh((u,r)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const o=lt.getAccessToken();if(o&&!lt.isExpired(o)){const c=lt.parseToken(o),f=(c==null?void 0:c.name)??"";u({accessToken:o,user:c?{id:c.sub,username:f,display_name:f,role:c.role}:null,requireTotpSetup:lt.hasScope(o,"totp_setup"),initializing:!1})}else lt.getRefreshToken()?r().refresh().catch(()=>{lt.clearTokens()}).finally(()=>{u({initializing:!1})}):u({initializing:!1})},login:async o=>{var T;const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!c.ok){const g=await c.json().catch(()=>({message:"Login failed"})),h=((T=g.error)==null?void 0:T.message)??g.message??"Login failed";throw new Error(h)}const f=await c.json();if(f.totpSetup){lt.setAccessToken(f.accessToken),u({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}lt.setTokens(f.accessToken,f.refreshToken);const m=lt.parseToken(f.accessToken),p=(m==null?void 0:m.name)??"";u({accessToken:f.accessToken,user:m?{id:m.sub,username:p,display_name:p,role:m.role}:null,requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const o=lt.getRefreshToken();o&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})}).catch(()=>{}),lt.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:async()=>{const o=lt.getRefreshToken();if(!o)throw r().logout(),u({sessionExpired:!0}),new Error("No refresh token");const c=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!c.ok)throw r().logout(),u({sessionExpired:!0}),new Error("Refresh failed");const f=await c.json();lt.setTokens(f.accessToken,f.refreshToken);const m=lt.parseToken(f.accessToken),p=(m==null?void 0:m.name)??"";u({accessToken:f.accessToken,user:m?{id:m.sub,username:p,display_name:p,role:m.role}:null})},setSessionExpired:o=>{u({sessionExpired:o})}})),Vh="overlord-theme";function Iv(){try{const u=localStorage.getItem(Vh);if(u==="light"||u==="dark"||u==="system")return u}catch{}return"dark"}function yh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Zh=Qh(u=>{const r=Iv(),o=r==="system"?yh():r;return{theme:r,resolved:o,setTheme:c=>{localStorage.setItem(Vh,c);const f=c==="system"?yh():c;u({theme:c,resolved:f})},setResolved:c=>{u({resolved:c})}}}),Pv={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",back_to_site:"back to site",go_back:"go_back",go_home:"go_home",dismiss:"dismiss",retry:"retry",loading:"// loading...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",error:"error",success:"success",failed:"failed",active:"active",inactive:"inactive",enabled:"enabled",disabled:"disabled",showing_entries:"showing {start}-{end} of {total}",no_results:"no results found",runtime_error:"// runtime_error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page_not_found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view_all",discard:"discard",save_changes:"save_changes",add:"add",remove:"remove",search:"search",actions:"actions",name:"name",status:"status",role:"role",description:"description",type:"type",created_at:"created_at",ago:"{time} ago",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",navigation:"// navigation",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search...",search_input_placeholder:"search tasks, machines, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_machines:"machines",breadcrumb_machines_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_access_tokens:"access_tokens",breadcrumb_access_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli reference",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api reference",error_default_title:"something went wrong",error_default_message:"an unexpected error occurred. please try again."},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session_expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go_to_login",totp_setup_title:"2fa_setup",totp_setup_subtitle:"// scan the qr code with your authenticator app",scan_with_authenticator:"scan this qr code with your authenticator app (google authenticator, authy, etc.)",manual_entry_key:"manual_entry_key",enter_verification_code:"enter the 6-digit verification code from your authenticator app",verification_code:"verification code",enter_6_digit_code:"enter 6-digit code",verify_and_enable:"verify_and_enable",totp_setup_complete:"2fa setup complete",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",subtitle:"// system overview",active_tasks:"active_tasks",queued_tasks:"queued_tasks",online_workers:"online_workers",completed_today:"completed_today",task_success_rate:"> task_success_rate",last_7_days:"last 7 days",recent_tasks:"> recent_tasks",no_tasks_yet:"// no tasks yet",worker_status:"> worker_status",no_workers_registered:"// no workers registered",recent_activity:"> recent_activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",subtitle:"// queue management",create_task:"create_task",new_task:"new_task",task_description:"task_description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",target_machine:"target_machine (optional)",any_able:"any able",assign_developer:"assign_developer (auto only)",select_developer:"select developer...",search_tasks:"search_tasks...",id:"id",description_col:"description",status_col:"status",project_col:"project",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no_tasks_found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",confirm_create_similar:"are you sure you want to create this task?",view_existing:"view_existing",force_create:"force_create",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"cursor_tunnel",skip_stage:"skip stage",take_over:"take_over",release_control:"release_control",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task_not_found",task_does_not_exist:"this task does not exist or has been deleted.",back_to_tasks:"back_to_tasks",task_detail_subtitle:"#{id} {desc}",cancel_task_title:"cancel_task",task_cancelled:"task cancelled.",failed_to_cancel_task:"failed to cancel task.",task_retried:"task has been retried.",failed_to_retry_task:"failed to retry task.",retry_mr_title:"retry_mr",retry_mr_confirm:"retry creating the merge request for task #{id}?",mr_retry_submitted:"mr retry submitted.",failed_to_retry_mr:"failed to retry mr.",activity_log:"> activity_log",pipeline_section:"> pipeline",no_pipeline:"// no pipeline configured",no_activity:"// no activity yet",confirm_stage:"confirm_stage",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',stage_confirmed:"stage confirmed.",failed_to_confirm_stage:"failed to confirm stage.",loading_task:"// loading task...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending_confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm_and_proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task_info",stage_timeline:"> stage_timeline",workspace_section:"> workspace",no_machine_assigned:"// no machine assigned",no_output:"// no output",pty_output:"> pty_output",stage_progress:"> stage_progress",task_logs:"> task_logs",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> cursor_tunnel",auto_pipeline:"auto_pipeline",auto_mode:"auto_mode",manual_takeover:"manual_takeover",takeover_denied:"takeover_denied",requesting_takeover_ellipsis:"requesting_takeover...",take_over_label:"take over",release_label:"release",create_task_page_title:"// create_task",create_task_page_subtitle:"// submit a new task for processing",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_machine_preference:"machine_preference",form_machine_placeholder:"optional: machine id or name (--on)",form_machine_hint:"leave empty for automatic machine selection.",form_agent_type:"agent_type",form_agent_type_placeholder:"default (from project config)",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open_in_cursor",tunnel_header:"> cursor_tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start_tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open_in_cursor",tunnel_open_vscode:"> open_in_vscode",tunnel_stop:"> stop_tunnel",tunnel_restart:"> restart_tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",dedup_title:"> similar_task_exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_choose_option:"// choose an option",stage_your_response:"your_response",stage_type_answer:"type your answer...",stage_submitting:"submitting...",stage_continue:"continue",stage_submit:"submit",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry_task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt."},machines:{title:"machines",subtitle:"// fleet status",fleet:"fleet",setup_guide:"setup_guide",all_statuses:"all",register_worker:"register_worker",no_machines_found:"no_machines_found",no_machines_registered:"no machines have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view_setup_guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_machines:"back_to_machines",drain:"drain",undrain:"undrain",last_heartbeat:"last_heartbeat: {time}",resource_usage:"> resource_usage",connection_info:"> connection_info",capabilities:"> capabilities",current_tasks:"> current_tasks",no_capabilities:"// no capabilities reported",no_running_tasks:"// no running tasks",host:"host",port:"port",os:"os",cpu_model:"cpu_model",cpu_cores:"cpu_cores",memory:"memory",total_slots:"total_slots",confirm_drain:"drain_machine",confirm_drain_message:'drain machine "{name}"? it will finish current tasks but accept no new ones.',machine_drained:"machine drain initiated.",machine_undrained:"machine undrain initiated.",failed_to_update_machine:"failed to update machine status.",worker_setup_title:"worker_setup_guide",worker_setup_subtitle:"// register a new worker machine with overlord",step_1_title:"01. generate a registration token",step_1_desc:"generate a one-time registration token from the admin panel.",step_2_title:"02. install the worker cli",step_2_desc:"install the overlord worker cli on the target machine.",step_3_title:"03. register the worker",step_3_desc:"run the register command with your token and server url.",step_4_title:"04. start the worker",step_4_desc:"start the worker daemon. it will connect to overlord and begin accepting tasks.",generate_token:"generate_token",worker_token_modal_title:"worker_registration_token",worker_token_modal_message:"// copy this token now. it will not be shown again.",loading_machine:"// loading machine...",machine_not_found:"// machine not found",draining_warning:"// this machine is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active_tasks",no_active_tasks:"// no active tasks on this machine",machine_info:"> machine_info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_machine_title:"> undrain_machine",drain_machine_title:"> drain_machine",undrain_confirm:"are you sure you want to undrain {name}? the machine will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the machine is undrained.",setup_header_desc:"// follow these steps to add a new worker machine to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate_worker_token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go_to_token_management",step_install_worker:"install_worker_package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure_environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_machine_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start_worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",or_run_as_service:"// or run as a system service for auto-restart:",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify_connection",step_verify_connection_desc:'// once the worker connects, it will appear in the machines list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_machines:"check the machines page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last_heartbeat",worker_version:"worker_version",reg_title:"// worker_registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate_token",reg_step_install_worker:"install_worker",reg_step_waiting_activation:"waiting_activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_install_command:"// install cli & worker:",reg_run_setup:"// run setup on worker machine:",reg_running_installation:"// running installation on target machine",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",subtitle:"// repository index",create_project:"create_project",no_projects_yet:"no_projects_yet",create_first_project:"create your first project to get started",key:"key",name:"name",repository:"repository",agent:"agent",project_info:"> project_info",repo_url:"repo_url",default_branch:"default_branch",git_platform:"git_platform",agent_type:"agent_type",max_turns:"max_turns",allowed_tools:"allowed_tools",auto_merge:"auto_merge",members:"> members",developer:"developer",role:"role",added_at:"added_at",add_member:"add_member",remove_member:"remove_member",remove_member_confirm:"remove {name} from this project?",member_added:"member added.",member_removed:"member removed.",failed_to_add_member:"failed to add member.",failed_to_remove_member:"failed to remove member.",pipeline:"> pipeline",add_stage:"+ add_stage",recent_tasks:"> recent_tasks",no_recent_tasks:"// no recent tasks",edit_project:"edit project",delete_project:"delete_project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_deleted:"project deleted.",failed_to_delete_project:"failed to delete project.",project_name:"project_name",project_name_placeholder:"my awesome project",project_key:"project_key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",claude:"claude",cursor:"cursor",codex:"codex",custom:"custom",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",project_created:"project created.",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save_changes",basic_info:"> basic_info",agent_config:"> agent_config",security:"> security",pipeline_section:"> pipeline",edit_pipeline:"> edit_pipeline",pty_output_filter:"pty_output_filter",git_clean:"git_clean",workspace_root:"workspace_root",agent_command:"agent_command",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",select_role:"select role...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup_commands",post_command:"post_command",environment:"> environment",add_member_title:"// add_member",edit_project_title:"edit project"},pipeline:{title:"pipeline_editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add_stage",stage_properties:"> stage_properties",stage_name:"stage_name",executor:"executor",timeout:"timeout",max_turns:"max_turns",confirm_required:"confirm_required",on_failure:"on_failure",goto:"goto",max_loops:"max_loops",stop:"stop",stage_commands:"> stage_commands",environment:"> environment",commands_placeholder:"# commands to execute in this stage...",env_placeholder:"KEY=value (one per line)",no_stages:"// no stages defined",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",failed_to_load:"failed to load pipeline.",irreversible:"irreversible",loading_pipeline:"// loading pipeline...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",confirm_mode:"confirm_mode",confirm_timeout:"confirm_timeout",overrides:"// overrides",pty_only:"pty_only",allowed_tools:"allowed_tools",on_failure_section:"// on_failure",goto_stage:"goto_stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",subtitle:"// user settings",profile_info:"> profile_info",username:"username",git_name:"git_name",git_email:"git_email",status:"status",created_at:"created_at",edit_git_info:"edit_git_info",change_password:"> change_password",current_password:"current_password",new_password:"new_password",confirm_password:"confirm_password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update_password",two_factor_auth:"> two-factor_authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
|
|
207
|
-
you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate_2fa",regenerating:"regenerating...",access_tokens:"access_tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current_totp_code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa."},access_tokens:{title:"access_tokens",subtitle:"// personal access tokens",create_token:"create_token",no_tokens:"no_personal_access_tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token_name",token_name_placeholder:"my-cli-token",expires_in:"expires_in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke_token",last_used:"last_used",expires_at:"expires_at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker_tokens",tab_audit_logs:"audit_logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create_developer",search_developers:"search developers...",no_matching_developers:"no_matching_developers",no_developers_found:"no_developers_found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display_name",role:"role",status:"status",two_fa_status:"2fa_status",dev_name:"dev_name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create_developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit_developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create_bot",no_bots_configured:"no_bots_configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot_name",platform:"platform",app_id:"app_id",lark:"lark",slack:"slack",delete_bot:"delete_bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat_bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat_id",chat_name:"chat_name",project:"project",bot:"bot",edit_bot:"edit_bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app_secret",app_secret_keep_current:"app_secret (leave empty to keep current)",webhook_url_optional:"webhook_url (optional)",lark_feishu:"lark_(feishu)",failed_to_update_bot:"failed to update bot",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add_binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker_tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate_token",no_worker_tokens:"no_worker_tokens",generate_token_desc:"generate a token to register a new worker machine",label:"label",purpose:"purpose",expires_at:"expires_at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke_token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',audit_title:"admin / audit_logs",audit_subtitle:"// system activity audit trail",all_actions:"all_actions",filter_by_user:"filter by user...",no_audit_entries:"no_audit_log_entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user_id",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset_2fa",action_generate_token:"generate_token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate_worker_token",create_one_time_token:"// create a one-time registration token",label_identifies_machine:"// identifies which machine this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker_registered",worker_token_generated:"> worker_token_generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",machine:"machine",copied_wait_for_worker:"copied — wait_for_worker",close_worker_can_register:"close // worker can still register",view_machine:"view_machine",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save_settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max_concurrent_tasks_per_machine",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task_timeout_minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat_interval_seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",machine_offline_threshold:"machine_offline_threshold_seconds",machine_offline_threshold_desc:"// mark machine offline after missing heartbeats for this duration",default_agent_type:"default_agent_type",default_agent_type_desc:"// default agent type for new projects",server_url:"server_url",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat_bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"v1.0 — full automation platform",hero_line1:"your machines. your subscriptions.",hero_highlight:"full automation.",hero_desc:"orchestrate ai coding agents across your entire fleet. create tasks, watch them execute in real time, and merge the results — all from one dashboard.",get_started:"get_started",read_docs:"read_docs",how_it_works:"how it works",three_steps:"three steps from idea to merged code.",step_n:"step {n}",step_define:"define",step_define_desc:"describe your task in plain language — bug fixes, features, refactors. attach context and assign to any project.",step_dispatch:"dispatch",step_dispatch_desc:"overlord routes the task to the best available worker and ai agent. execution starts immediately across your fleet.",step_monitor:"monitor & take over",step_monitor_desc:"watch real-time progress via the built-in terminal. jump in at any point to guide, correct, or take full control.",everything_you_need:"everything you need",complete_platform:"a complete platform for ai-assisted software development.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running in seconds",install_desc:"one command to install. start orchestrating immediately.",install_command:"npm install -g @overlordai/developer-cli",go_to_app:"go_to_app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli_reference",cli_subtitle:"// command-line tools",api_reference:"api_reference",api_subtitle:"// rest api endpoints",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"}};function e0(u,r){const o=r.split(".");let c=u;for(const f of o){if(c==null||typeof c!="object")return r;c=c[f]}return typeof c=="string"?c:r}function t0(u,r){return r?u.replace(/\{(\w+)\}/g,(o,c)=>r[c]!=null?String(r[c]):`{${c}}`):u}function Hu(u,r){return t0(e0(Pv,u),r)}function ta(){return{t:x.useCallback((r,o)=>Hu(r,o),[])}}function Kh(){const{theme:u,setTheme:r}=Zh(),{t:o}=ta(),c=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches,f=()=>{r(c?"light":"dark")};return y.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":o(c?"common.switch_to_light":"common.switch_to_dark"),title:o(c?"common.light_mode":"common.dark_mode"),children:c?y.jsx(Vv,{size:16}):y.jsx(Lv,{size:16})})}class Ao extends Error{constructor(o,c,f){const m=o.status||o.status===0?o.status:"",p=o.statusText??"",T=`${m} ${p}`.trim(),g=T?`status code ${T}`:"an unknown error";super(`Request failed with ${g}: ${c.method} ${c.url}`);kt(this,"response");kt(this,"request");kt(this,"options");this.name="HTTPError",this.response=o,this.request=c,this.options=f}}class Jh extends Error{constructor(o){let c="Non-error value was thrown";try{typeof o=="string"?c=o:o&&typeof o=="object"&&"message"in o&&typeof o.message=="string"&&(c=o.message)}catch{}super(c);kt(this,"name","NonError");kt(this,"value");this.value=o}}class To extends Error{constructor(o){const c=o!=null&&o.cause?o.cause instanceof Error?o.cause:new Jh(o.cause):void 0;super(o!=null&&o.code?`Forced retry: ${o.code}`:"Forced retry",c?{cause:c}:void 0);kt(this,"name","ForceRetryError");kt(this,"customDelay");kt(this,"code");kt(this,"customRequest");this.customDelay=o==null?void 0:o.delay,this.code=o==null?void 0:o.code,this.customRequest=o==null?void 0:o.request}}const _h=(()=>{let u=!1,r=!1;const o=typeof globalThis.ReadableStream=="function",c=typeof globalThis.Request=="function";if(o&&c)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),a0=typeof globalThis.AbortController=="function",$h=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",l0=typeof globalThis.ReadableStream=="function",n0=typeof globalThis.FormData=="function",Wh=["get","post","put","patch","head","delete"],i0={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},wo=2147483647,u0=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Fh=Symbol("stop");class Ih{constructor(r){kt(this,"options");this.options=r}}const r0=u=>new Ih(u),c0={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},o0={next:!0},s0={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},f0=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[o,c]of u)r+=u0,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${o}"`).length,r+=typeof c=="string"?new TextEncoder().encode(c).length:c.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},Ph=(u,r,o)=>{let c,f=0;return u.pipeThrough(new TransformStream({transform(m,p){if(p.enqueue(m),c){f+=c.byteLength;let T=r===0?0:f/r;T>=1&&(T=1-Number.EPSILON),o==null||o({percent:T,totalBytes:Math.max(r,f),transferredBytes:f},c)}c=m},flush(){c&&(f+=c.byteLength,o==null||o({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},c))}}))},d0=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const o=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(Ph(u.body,o,r),{status:u.status,statusText:u.statusText,headers:u.headers})},m0=(u,r,o)=>{if(!u.body)return u;const c=f0(o??u.body);return new Request(u,{duplex:"half",body:Ph(u.body,c,r)})},yl=u=>u!==null&&typeof u=="object",Ou=(...u)=>{for(const r of u)if((!yl(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return Vo({},...u)},ep=(u={},r={})=>{const o=new globalThis.Headers(u),c=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,p]of f.entries())c&&p==="undefined"||p===void 0?o.delete(m):o.set(m,p);return o};function Cu(u,r,o){return Object.hasOwn(r,o)&&r[o]===void 0?[]:Vo(u[o]??[],r[o]??[])}const tp=(u={},r={})=>({beforeRequest:Cu(u,r,"beforeRequest"),beforeRetry:Cu(u,r,"beforeRetry"),afterResponse:Cu(u,r,"afterResponse"),beforeError:Cu(u,r,"beforeError")}),h0=(u,r)=>{const o=new URLSearchParams;for(const c of[u,r])if(c!==void 0)if(c instanceof URLSearchParams)for(const[f,m]of c.entries())o.append(f,m);else if(Array.isArray(c))for(const f of c){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");o.append(String(f[0]),String(f[1]))}else if(yl(c))for(const[f,m]of Object.entries(c))m!==void 0&&o.append(f,String(m));else{const f=new URLSearchParams(c);for(const[m,p]of f.entries())o.append(m,p)}return o},Vo=(...u)=>{let r={},o={},c={},f;const m=[];for(const p of u)if(Array.isArray(p))Array.isArray(r)||(r=[]),r=[...r,...p];else if(yl(p)){for(let[T,g]of Object.entries(p)){if(T==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(T==="context"){if(g!=null&&(!yl(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(T==="searchParams"){g==null?f=void 0:f=f===void 0?g:h0(f,g);continue}yl(g)&&T in r&&(g=Vo(r[T],g)),r={...r,[T]:g}}yl(p.hooks)&&(c=tp(c,p.hooks),r.hooks=c),yl(p.headers)&&(o=ep(o,p.headers),r.headers=o)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:$h?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},p0=u=>Wh.includes(u)?u.toUpperCase():u,y0=["get","put","head","delete","options","trace"],_0=[408,413,429,500,502,503,504],g0=[413,429,503],gh={limit:2,methods:y0,statusCodes:_0,afterStatusCodes:g0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},v0=(u={})=>{if(typeof u=="number")return{...gh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(o=>o.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,o])=>o!==void 0));return{...gh,...r}};class Oo extends Error{constructor(o){super(`Request timed out: ${o.method} ${o.url}`);kt(this,"request");this.name="TimeoutError",this.request=o}}async function b0(u,r,o,c){return new Promise((f,m)=>{const p=setTimeout(()=>{o&&o.abort(),m(new Oo(u))},c.timeout);c.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(p)})})}async function x0(u,{signal:r}){return new Promise((o,c)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),c(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),o()},u)})}const S0=(u,r)=>{const o={};for(const c in r)Object.hasOwn(r,c)&&!(c in s0)&&!(c in c0)&&(!(c in u)||c in o0)&&(o[c]=r[c]);return o},E0=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function T0(u){return u instanceof Ao||(u==null?void 0:u.name)===Ao.name}function w0(u){return u instanceof Oo||(u==null?void 0:u.name)===Oo.name}var Vu,ap,Zt,Bt,nt,Q,Ja,Pt,_l,ie,Bu,lp,Co,Lu,Ka,Mo,np,li,Yu,No;const ii=class ii{constructor(r,o={}){It(this,ie);kt(this,"request");It(this,Zt);It(this,Bt,0);It(this,nt);It(this,Q);It(this,Ja);It(this,Pt);It(this,_l);var f,m,p;if(Vt(this,nt,r),Vt(this,Q,{...o,headers:ep(U(this,nt).headers,o.headers),hooks:tp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},o.hooks),method:p0(o.method??U(this,nt).method??"GET"),prefixUrl:String(o.prefixUrl||""),retry:v0(o.retry),throwHttpErrors:o.throwHttpErrors??!0,timeout:o.timeout??1e4,fetch:o.fetch??globalThis.fetch.bind(globalThis),context:o.context??{}}),typeof U(this,nt)!="string"&&!(U(this,nt)instanceof URL||U(this,nt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,Q).prefixUrl&&typeof U(this,nt)=="string"){if(U(this,nt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,Q).prefixUrl.endsWith("/")||(U(this,Q).prefixUrl+="/"),Vt(this,nt,U(this,Q).prefixUrl+U(this,nt))}a0&&$h&&(Vt(this,Pt,U(this,Q).signal??U(this,nt).signal),Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal),_h&&(U(this,Q).duplex="half"),U(this,Q).json!==void 0&&(U(this,Q).body=((m=(f=U(this,Q)).stringifyJson)==null?void 0:m.call(f,U(this,Q).json))??JSON.stringify(U(this,Q).json),U(this,Q).headers.set("content-type",U(this,Q).headers.get("content-type")??"application/json"));const c=o.headers&&new globalThis.Headers(o.headers).has("content-type");if(U(this,nt)instanceof globalThis.Request&&(n0&&U(this,Q).body instanceof globalThis.FormData||U(this,Q).body instanceof URLSearchParams)&&!c&&U(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(U(this,nt),U(this,Q)),E0(U(this,Q).searchParams)){const g="?"+(typeof U(this,Q).searchParams=="string"?U(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ge(p=ii,Vu,ap).call(p,U(this,Q).searchParams)).toString()),h=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(h,U(this,Q))}if(U(this,Q).onUploadProgress){if(typeof U(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!_h)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ge(this,ie,No).call(this,this.request,U(this,Q).body??void 0)}}static create(r,o){var p,T,g;const c=new ii(r,o),f=async()=>{var j,S,D,V,q,H,L,B,P,F,me,fe;if(typeof U(c,Q).timeout=="number"&&U(c,Q).timeout>wo)throw new RangeError(`The \`timeout\` option cannot be greater than ${wo}`);await Promise.resolve();let h=await ge(j=c,ie,np).call(j);for(const K of U(c,Q).hooks.afterResponse){const X=ge(S=c,ie,Co).call(S,h.clone());let ve;try{ve=await K(c.request,ge(D=c,ie,li).call(D),X,{retryCount:U(c,Bt)})}catch(Ze){throw ge(V=c,ie,Ka).call(V,X),ge(q=c,ie,Ka).call(q,h),Ze}if(ve instanceof Ih)throw ge(H=c,ie,Ka).call(H,X),ge(L=c,ie,Ka).call(L,h),new To(ve.options);const De=ve instanceof globalThis.Response?ve:h;X!==De&&ge(B=c,ie,Ka).call(B,X),h!==De&&ge(P=c,ie,Ka).call(P,h),h=De}if(ge(F=c,ie,Co).call(F,h),!h.ok&&(typeof U(c,Q).throwHttpErrors=="function"?U(c,Q).throwHttpErrors(h.status):U(c,Q).throwHttpErrors)){let K=new Ao(h,c.request,ge(me=c,ie,li).call(me));for(const X of U(c,Q).hooks.beforeError)K=await X(K,{retryCount:U(c,Bt)});throw K}if(U(c,Q).onDownloadProgress){if(typeof U(c,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!l0)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const K=h.clone();return ge(fe=c,ie,Ka).call(fe,h),d0(K,U(c,Q).onDownloadProgress)}return h},m=ge(p=c,ie,Mo).call(p,f).finally(()=>{var j,S;const h=U(c,Ja);ge(j=c,ie,Lu).call(j,(h==null?void 0:h.body)??void 0),ge(S=c,ie,Lu).call(S,c.request.body??void 0)});for(const[h,j]of Object.entries(i0))h==="bytes"&&typeof((g=(T=globalThis.Response)==null?void 0:T.prototype)==null?void 0:g.bytes)!="function"||(m[h]=async()=>{c.request.headers.set("accept",c.request.headers.get("accept")||j);const S=await m;if(h==="json"){if(S.status===204)return"";const D=await S.text();return D===""?"":o.parseJson?o.parseJson(D):JSON.parse(D)}return S[h]()});return m}};Vu=new WeakSet,ap=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,o])=>o!==void 0)):r},Zt=new WeakMap,Bt=new WeakMap,nt=new WeakMap,Q=new WeakMap,Ja=new WeakMap,Pt=new WeakMap,_l=new WeakMap,ie=new WeakSet,Bu=function(){const r=U(this,Q).retry.delay(U(this,Bt));let o=r;U(this,Q).retry.jitter===!0?o=Math.random()*r:typeof U(this,Q).retry.jitter=="function"&&(o=U(this,Q).retry.jitter(r),(!Number.isFinite(o)||o<0)&&(o=r));const c=U(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(c,o)},lp=async function(r){if($m(this,Bt)._++,U(this,Bt)>U(this,Q).retry.limit)throw r;const o=r instanceof Error?r:new Jh(r);if(o instanceof To)return o.customDelay??ge(this,ie,Bu).call(this);if(!U(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,Q).retry.shouldRetry!==void 0){const c=await U(this,Q).retry.shouldRetry({error:o,retryCount:U(this,Bt)});if(c===!1)throw r;if(c===!0)return ge(this,ie,Bu).call(this)}if(w0(r)&&!U(this,Q).retry.retryOnTimeout)throw r;if(T0(r)){if(!U(this,Q).retry.statusCodes.includes(r.response.status))throw r;const c=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(c&&U(this,Q).retry.afterStatusCodes.includes(r.response.status)){let f=Number(c)*1e3;Number.isNaN(f)?f=Date.parse(c)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return ge(this,ie,Bu).call(this)},Co=function(r){return U(this,Q).parseJson&&(r.json=async()=>U(this,Q).parseJson(await r.text())),r},Lu=function(r){r&&r.cancel().catch(()=>{})},Ka=function(r){ge(this,ie,Lu).call(this,r.body??void 0)},Mo=async function(r){try{return await r()}catch(o){const c=Math.min(await ge(this,ie,lp).call(this,o),wo);if(U(this,Bt)<1)throw o;if(await x0(c,U(this,Pt)?{signal:U(this,Pt)}:{}),o instanceof To&&o.customRequest){const f=U(this,Q).signal?new globalThis.Request(o.customRequest,{signal:U(this,Q).signal}):new globalThis.Request(o.customRequest);ge(this,ie,Yu).call(this,f)}for(const f of U(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ge(this,ie,li).call(this),error:o,retryCount:U(this,Bt)});if(m instanceof globalThis.Request){ge(this,ie,Yu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===Fh)return}return ge(this,ie,Mo).call(this,r)}},np=async function(){var o;(o=U(this,Zt))!=null&&o.signal.aborted&&(Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,Q).signal}));for(const c of U(this,Q).hooks.beforeRequest){const f=await c(this.request,ge(this,ie,li).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ge(this,ie,Yu).call(this,f);break}}const r=S0(this.request,U(this,Q));return Vt(this,Ja,this.request),this.request=U(this,Ja).clone(),U(this,Q).timeout===!1?U(this,Q).fetch(U(this,Ja),r):b0(U(this,Ja),r,U(this,Zt),U(this,Q))},li=function(){if(!U(this,_l)){const{hooks:r,...o}=U(this,Q);Vt(this,_l,Object.freeze(o))}return U(this,_l)},Yu=function(r){Vt(this,_l,void 0),this.request=ge(this,ie,No).call(this,r)},No=function(r,o){return!U(this,Q).onUploadProgress||!r.body?r:m0(r,U(this,Q).onUploadProgress,o??U(this,Q).body??void 0)},It(ii,Vu);let Qu=ii;/*! MIT License © Sindre Sorhus */const Do=u=>{const r=(o,c)=>Qu.create(o,Ou(u,c));for(const o of Wh)r[o]=(c,f)=>Qu.create(c,Ou(u,f,{method:o}));return r.create=o=>Do(Ou(o)),r.extend=o=>(typeof o=="function"&&(o=o(u??{})),Do(Ou(u,o))),r.stop=Fh,r.retry=r0,r},vh=Do();let ko=!1,Ro=null;const Gu=vh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=$a.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,o)=>{if(o.status===401){ko||(ko=!0,Ro=$a.getState().refresh().finally(()=>{ko=!1,setTimeout(()=>{Ro=null},0)}));try{await Ro}catch{throw o}const c=$a.getState().accessToken;return c&&u.headers.set("Authorization",`Bearer ${c}`),vh(u,r)}}]}}),k0=3e4;function R0(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const o=(u.title+" "+u.body).match(/machine\s+(\S+)/i);return o?`/machines/${o[1]}`:null}function ip(){const u=gl(),[r,o]=x.useState([]),[c,f]=x.useState(0),[m,p]=x.useState(!1),[T,g]=x.useState(!1),h=x.useRef(null),{t:j}=ta(),S=x.useCallback(async()=>{try{g(!0);const q=await Gu.get("web/notifications",{searchParams:{limit:"20"}}).json();o(q.data),f(q.data.filter(H=>!H.isRead).length)}catch{}finally{g(!1)}},[]);x.useEffect(()=>{S();const q=setInterval(S,k0);return()=>clearInterval(q)},[S]),x.useEffect(()=>{function q(H){h.current&&!h.current.contains(H.target)&&p(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);const D=async q=>{try{await Gu.post(`web/notifications/${q}/read`),o(H=>H.map(L=>L.id===q?{...L,isRead:!0}:L)),f(H=>Math.max(0,H-1))}catch{}},V=async()=>{try{await Gu.post("web/notifications/read-all"),o(q=>q.map(H=>({...H,isRead:!0}))),f(0)}catch{}};return y.jsxs("div",{className:"relative",ref:h,children:[y.jsxs("button",{type:"button",onClick:()=>p(q=>!q),"aria-label":j("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:[y.jsx(jv,{size:16}),c>0&&y.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--destructive)] px-1 text-[10px] font-bold text-white",children:c})]}),m&&y.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-80 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[y.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[y.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),c>0&&y.jsxs("button",{type:"button",onClick:V,className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[y.jsx(zv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),y.jsx("div",{className:"max-h-80 overflow-y-auto",children:T&&r.length===0?y.jsx("div",{className:"flex justify-center py-8",children:y.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?y.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[y.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),y.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(q=>{const H=R0(q);return y.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)]":""} ${q.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(q.isRead||D(q.id),p(!1),u(H))},children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("p",{className:"text-sm font-medium",children:q.title}),y.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:q.body}),y.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(q.createdAt).toLocaleString()})]}),!q.isRead&&y.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),D(q.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:y.jsx(Av,{className:"h-3.5 w-3.5"})})]},q.id)})})]})]})}function j0(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),machines:u.machines.map(r=>({type:"machine",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const z0=300,bh={tasks:Qv,machines:Qo,projects:Nv},A0={tasks:"tasks",machines:"machines",projects:"projects"};function O0(){const[u,r]=x.useState(""),[o,c]=x.useState({tasks:[],machines:[],projects:[]}),[f,m]=x.useState(!1),[p,T]=x.useState(!1),[g,h]=x.useState(0),j=x.useRef(null),S=x.useRef(null),D=x.useRef(void 0),V=gl(),{t:q}=ta(),H=[...o.tasks,...o.machines,...o.projects],L=x.useCallback(async K=>{if(!K.trim()){c({tasks:[],machines:[],projects:[]});return}try{m(!0);const X=await Gu.get("web/search",{searchParams:{q:K}}).json();c(j0(X)),h(0)}catch{}finally{m(!1)}},[]);x.useEffect(()=>(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>L(u),z0),()=>{D.current&&clearTimeout(D.current)}),[u,L]),x.useEffect(()=>{function K(X){X.key==="/"&&!p&&!(X.target instanceof HTMLInputElement||X.target instanceof HTMLTextAreaElement)&&(X.preventDefault(),T(!0)),X.key==="Escape"&&p&&(X.preventDefault(),B())}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[p]),x.useEffect(()=>{p&&setTimeout(()=>{var K;return(K=S.current)==null?void 0:K.focus()},50)},[p]);const B=()=>{T(!1),r(""),c({tasks:[],machines:[],projects:[]}),h(0)},P=K=>{switch(B(),K.type){case"task":V(`/tasks/${K.id}`);break;case"machine":V(`/machines/${K.id}`);break;case"project":V(`/projects/${K.id}`);break}},F=K=>{K.key==="ArrowDown"?(K.preventDefault(),h(X=>Math.min(X+1,H.length-1))):K.key==="ArrowUp"?(K.preventDefault(),h(X=>Math.max(X-1,0))):K.key==="Enter"&&H[g]&&(K.preventDefault(),P(H[g]))},me=H.length>0;let fe=0;return y.jsxs(y.Fragment,{children:[y.jsxs("button",{type:"button",onClick:()=>T(!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:[y.jsx(Gv,{className:"h-3.5 w-3.5"}),y.jsx("span",{children:q("common.search_placeholder")}),y.jsx("kbd",{className:"ml-2 rounded border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"/"})]}),p&&y.jsx("div",{ref:j,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:K=>{K.target===j.current&&B()},children:y.jsxs("div",{className:"w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl",style:{fontFamily:"'JetBrains Mono', monospace"},children:[y.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[y.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),y.jsx("input",{ref:S,type:"text",placeholder:q("common.search_input_placeholder"),value:u,onChange:K=>r(K.target.value),onKeyDown:F,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),f&&y.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),y.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:u.trim()&&!me&&!f?y.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:q("common.no_search_results",{query:u})}):Object.keys(bh).map(K=>{const X=o[K];if(X.length===0)return null;const ve=bh[K],De=fe;return fe+=X.length,y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[y.jsx(ve,{className:"h-3 w-3"}),y.jsx("span",{className:"text-[10px] uppercase tracking-wider",children:A0[K]})]}),X.map((Ze,rt)=>{const Ke=De+rt,ct=Ke===g;return y.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${ct?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>P(Ze),onMouseEnter:()=>h(Ke),children:[y.jsx("span",{className:`text-xs ${ct?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:ct?">":" "}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("p",{className:"truncate text-sm",children:Ze.title}),Ze.subtitle&&y.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:Ze.subtitle})]})]},`${Ze.type}-${Ze.id}`)})]},K)})}),y.jsxs("div",{className:"flex items-center gap-4 border-t border-[var(--border)] px-4 py-2",children:[y.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[y.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↑↓"})," ",q("common.navigate_hint")]}),y.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[y.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↵"})," ",q("common.select_hint")]}),y.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[y.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"esc"})," ",q("common.close_hint")]})]})]})})]})}const C0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function M0({isOpen:u,onClose:r,onConfirm:o,title:c,message:f,confirmVariant:m="danger",isLoading:p,...T}){const{t:g}=ta(),h=T.confirmLabel??g("common.confirm"),j=T.cancelLabel??g("common.cancel");if(!u)return null;const S=C0[m];return y.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:y.jsxs("div",{onClick:D=>D.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[y.jsx("div",{style:{marginBottom:"1.25rem"},children:y.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[y.jsx(Xh,{style:{width:"1rem",height:"1rem"}}),c]})}),y.jsx("div",{style:{marginBottom:"1.25rem"},children:y.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),y.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[y.jsx("button",{type:"button",onClick:r,disabled:p,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",fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),y.jsx("button",{type:"button",onClick:o,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:S,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1},children:p?g("common.processing"):h})]})]})})}const up=x.createContext({setActions:()=>{}});function jb(u){const{setActions:r}=x.useContext(up);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const rp=x.createContext({setSubtitle:()=>{}});function zb(u){const{setSubtitle:r}=x.useContext(rp);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const N0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qo},{to:"/projects",label:"projects",icon:Dv},{to:"/access-tokens",label:"access_tokens",icon:qv}],D0=[{to:"/docs/cli",label:"cli_reference",icon:Zv},{to:"/docs/api",label:"api_reference",icon:Mv}],U0=[{to:"/admin",label:"admin",icon:Xv}],q0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qo},{to:"/profile",label:"profile",icon:Kv}],Mu={"/home":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/machines":{title:"common.breadcrumb_machines",subtitle:"common.breadcrumb_machines_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_access_tokens",subtitle:"common.breadcrumb_access_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"}};function H0(u){const{t:r}=ta();if(Mu[u]){const c=Mu[u];return{title:r(c.title),subtitle:r(c.subtitle)}}const o="/"+u.split("/").filter(Boolean)[0];if(Mu[o]){const c=Mu[o],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(c.title),subtitle:f||r(c.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function B0(u,r){return u==="/home"?r==="/home":r.startsWith(u)}function L0(){const u=Yt(),{t:r}=ta();return y.jsx("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:q0.map(({to:o,label:c,icon:f})=>{const m=B0(o,u.pathname);return y.jsxs(ni,{to:o,className:"flex flex-col items-center gap-1",style:{width:70},children:[y.jsx(f,{size:18,className:m?"text-[var(--accent)]":"text-[var(--text-muted)]"}),y.jsx("span",{className:`text-[8px] lowercase ${m?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:{dashboard:r("dashboard.title"),tasks:r("tasks.title"),machines:r("machines.title"),profile:r("common.profile")}[c]??c})]},o)})})}function Y0(){const u=gl(),{t:r}=ta();return y.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:56,minHeight:56},children:[y.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[y.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:y.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),y.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:r("common.overlord")})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(ip,{}),y.jsx(Kh,{})]})]})}function G0(){const{user:u,logout:r}=$a(),o=gl(),[c,f]=x.useState(!1),m=(u==null?void 0:u.role)==="admin",{t:p}=ta(),T=()=>{r(),o("/login")};return y.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)]",style:{width:240,minWidth:240,backgroundColor:"var(--bg-card)"},children:[y.jsx("div",{className:"flex items-center px-5",style:{height:48},children:y.jsxs("button",{onClick:()=>o("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[y.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:y.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),y.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:p("common.overlord")})]})}),y.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[y.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.navigation")}),N0.map(({to:g,label:h,icon:j})=>y.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>y.jsxs(y.Fragment,{children:[y.jsx(j,{size:14,style:{flexShrink:0}}),y.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),y.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.docs_section")}),D0.map(({to:g,label:h,icon:j})=>y.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>y.jsxs(y.Fragment,{children:[y.jsx(j,{size:14,style:{flexShrink:0}}),y.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),m&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.admin_section")}),U0.map(({to:g,label:h,icon:j})=>y.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>y.jsxs(y.Fragment,{children:[y.jsx(j,{size:14,style:{flexShrink:0}}),y.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g))]})]}),y.jsx("div",{className:"border-t border-[var(--border)] p-3",children:y.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[y.jsx("button",{onClick:()=>o("/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:p("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),y.jsxs("button",{onClick:()=>o("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:p("common.profile"),children:[y.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),y.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),y.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":p("common.log_out"),children:y.jsx(Bv,{size:14})})]})}),y.jsx(M0,{isOpen:c,onClose:()=>f(!1),onConfirm:T,title:p("common.logout_title"),message:p("common.logout_message"),confirmLabel:p("common.logout"),confirmVariant:"warning"})]})}function X0({headerActions:u,subtitleOverride:r}){const o=Yt(),{title:c,subtitle:f}=H0(o.pathname),m=r??f;return y.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:[y.jsxs("div",{className:"text-sm lowercase",style:{fontFamily:"'JetBrains Mono', monospace"},children:[y.jsx("span",{style:{color:"var(--text-primary)"},children:c}),m&&y.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),y.jsxs("div",{className:"flex items-center gap-3",children:[u,y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(O0,{}),y.jsx(ip,{}),y.jsx(Kh,{})]})]})]})}function Q0(){const[u,r]=x.useState(null),[o,c]=x.useState(null);return y.jsxs("div",{className:"flex h-screen font-mono",children:[y.jsx(G0,{}),y.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[y.jsx(Y0,{}),y.jsx(X0,{headerActions:u,subtitleOverride:o}),y.jsx("main",{className:"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 md:p-6",children:y.jsx(up.Provider,{value:{setActions:r},children:y.jsx(rp.Provider,{value:{setSubtitle:c},children:y.jsx(Qg,{})})})}),y.jsx(L0,{})]})]})}function Nu({children:u,requireAdmin:r=!1}){const{accessToken:o,user:c,requireTotpSetup:f,initializing:m}=$a(),p=Yt();return m?y.jsx("div",{className:"flex h-screen items-center justify-center",children:y.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):o?f?p.pathname!=="/totp-setup"?y.jsx(Du,{to:"/totp-setup",replace:!0}):y.jsx(y.Fragment,{children:u}):r&&(c==null?void 0:c.role)!=="admin"?y.jsx(Du,{to:"/home",replace:!0}):y.jsx(y.Fragment,{children:u}):y.jsx(Du,{to:"/login",state:{from:p},replace:!0})}function V0({children:u}){const{theme:r,resolved:o,setResolved:c}=Zh();return x.useEffect(()=>{if(r!=="system"){c(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");c(f.matches?"dark":"light");const m=p=>c(p.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,c]),x.useEffect(()=>{document.documentElement.classList.toggle("dark",o==="dark")},[o]),y.jsx(y.Fragment,{children:u})}class Z0 extends x.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?y.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8",children:[y.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Hu("common.runtime_error")}),y.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Hu("common.an_unexpected_error_occurred")}),y.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:[y.jsx(Yv,{className:"h-3.5 w-3.5"}),Hu("common.reload")]})]}):this.props.children}}function K0({isOpen:u}){const r=gl(),{logout:o,setSessionExpired:c}=$a(),{t:f}=ta();function m(){o(),c(!1),r("/login")}return u?y.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[y.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),y.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:y.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[y.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:y.jsx(Hv,{className:"h-7 w-7 text-[var(--warning)]"})}),y.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),y.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),y.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 xh=5;let ba=[];const Uo=new Set;function cp(){Uo.forEach(u=>u())}function J0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,o=4e3){const c=J0();return ba=[...ba,{id:c,variant:u,message:r,duration:o}],ba.length>xh&&(ba=ba.slice(ba.length-xh)),cp(),c}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function $0(u){ba=ba.filter(r=>r.id!==u),cp()}function W0(){const[,u]=x.useState(0);return x.useEffect(()=>{const r=()=>u(o=>o+1);return Uo.add(r),()=>{Uo.delete(r)}},[]),ba}const F0={success:{icon:Ov,borderColor:"var(--accent)"},error:{icon:Cv,borderColor:"var(--destructive)"},warning:{icon:Xh,borderColor:"var(--warning)"},info:{icon:Uv,borderColor:"var(--info)"}};function I0({item:u}){const r=F0[u.variant],o=r.icon,{t:c}=ta(),f=x.useCallback(()=>$0(u.id),[u.id]);return x.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),y.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[y.jsx(o,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),y.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),y.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":c("common.dismiss_notification"),children:y.jsx(Jv,{className:"h-3.5 w-3.5"})})]})}function P0(){const u=W0();return u.length===0?null:y.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:u.map(r=>y.jsx("div",{className:"pointer-events-auto",children:y.jsx(I0,{item:r})},r.id))})}const eb=x.lazy(()=>Ne(()=>import("./LandingPage-Bxv40luT.js"),__vite__mapDeps([0,1,2,3,4]))),tb=x.lazy(()=>Ne(()=>import("./LoginPage-CMyyf5ts.js"),[])),ab=x.lazy(()=>Ne(()=>import("./TotpSetupPage-CedCLn9b.js"),[])),lb=x.lazy(()=>Ne(()=>import("./NotFoundPage-Ck2hYu_B.js"),[])),nb=x.lazy(()=>Ne(()=>import("./HomePage-Bl0KZPgn.js"),__vite__mapDeps([5,6,7,8,9,1]))),ib=x.lazy(()=>Ne(()=>import("./TaskListPage-Dr_IZ2vJ.js"),__vite__mapDeps([10,11,7,12,4,13,8,14]))),ub=x.lazy(()=>Ne(()=>import("./TaskDetailPage-CSM2ew4E.js"),__vite__mapDeps([15,11,12,16,17,18,19,20]))),rb=x.lazy(()=>Ne(()=>import("./MachineListPage-C044mEFY.js"),__vite__mapDeps([21,6,22,23,24,4,19,12,13,8,14]))),cb=x.lazy(()=>Ne(()=>import("./MachineDetailPage-BARcjlVJ.js"),__vite__mapDeps([25,6,16]))),ob=x.lazy(()=>Ne(()=>import("./WorkerSetupGuidePage-C-faBGTF.js"),__vite__mapDeps([22,23,24]))),sb=x.lazy(()=>Ne(()=>import("./ProjectListPage-Cpzf-qNq.js"),__vite__mapDeps([26,6,12,13,8,14]))),fb=x.lazy(()=>Ne(()=>import("./ProjectDetailPage-7wHRY-_7.js"),__vite__mapDeps([27,6,28,12,29,30,14]))),db=x.lazy(()=>Ne(()=>import("./EditProjectPage-C78aJ078.js"),__vite__mapDeps([31,6,12,28,14]))),mb=x.lazy(()=>Ne(()=>import("./PipelineEditorPage-hoXGXxtB.js"),__vite__mapDeps([32,12]))),hb=x.lazy(()=>Ne(()=>import("./ProfilePage-DQQh-J_f.js"),[])),pb=x.lazy(()=>Ne(()=>import("./AccessTokensPage-DjXg_GcZ.js"),__vite__mapDeps([33,12,13,8,14,4,30]))),yb=x.lazy(()=>Ne(()=>import("./CliReferencePage-DpDJXb2B.js"),__vite__mapDeps([34,35,4,14]))),_b=x.lazy(()=>Ne(()=>import("./ApiReferencePage-BMDuk9em.js"),__vite__mapDeps([36,35,4,14]))),gb=x.lazy(()=>Ne(()=>import("./AdminPage-LU3VU8sd.js"),__vite__mapDeps([37,3,2,38,24]))),vb=x.lazy(()=>Ne(()=>import("./DeveloperManage-Ma4FgQXQ.js"),__vite__mapDeps([39,12,13,8,14,3,29,17]))),bb=x.lazy(()=>Ne(()=>import("./BotManage-Is69ZQBf.js"),__vite__mapDeps([40,12,30,14,13,8,2,29]))),xb=x.lazy(()=>Ne(()=>import("./TokenManage-TLgRE0QO.js"),__vite__mapDeps([41,23,4,18,13,8,14]))),Sb=x.lazy(()=>Ne(()=>import("./AuditLogPage-BQnvLBUm.js"),__vite__mapDeps([42,12,13,8,38,9]))),Eb=x.lazy(()=>Ne(()=>import("./SettingsPage-vlEdzALt.js"),[]));function Tb(){return y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function wb(){const u=$a(r=>r.sessionExpired);return y.jsxs(V0,{children:[y.jsx(P0,{}),y.jsx(Z0,{children:y.jsxs(yv,{children:[y.jsx(K0,{isOpen:u}),y.jsx(x.Suspense,{fallback:y.jsx(Tb,{}),children:y.jsxs(Zg,{children:[y.jsx(je,{path:"/",element:y.jsx(eb,{})}),y.jsx(je,{path:"/login",element:y.jsx(tb,{})}),y.jsx(je,{path:"/totp-setup",element:y.jsx(Nu,{children:y.jsx(ab,{})})}),y.jsxs(je,{element:y.jsx(Nu,{children:y.jsx(Q0,{})}),children:[y.jsx(je,{path:"/home",element:y.jsx(nb,{})}),y.jsx(je,{path:"/tasks",element:y.jsx(ib,{})}),y.jsx(je,{path:"/tasks/:id",element:y.jsx(ub,{})}),y.jsx(je,{path:"/machines",element:y.jsx(rb,{})}),y.jsx(je,{path:"/machines/setup",element:y.jsx(Nu,{requireAdmin:!0,children:y.jsx(ob,{})})}),y.jsx(je,{path:"/machines/:id",element:y.jsx(cb,{})}),y.jsx(je,{path:"/projects",element:y.jsx(sb,{})}),y.jsx(je,{path:"/projects/:key",element:y.jsx(fb,{})}),y.jsx(je,{path:"/projects/:key/edit",element:y.jsx(db,{})}),y.jsx(je,{path:"/projects/:key/pipeline",element:y.jsx(mb,{})}),y.jsx(je,{path:"/profile",element:y.jsx(hb,{})}),y.jsx(je,{path:"/access-tokens",element:y.jsx(pb,{})}),y.jsx(je,{path:"/docs/cli",element:y.jsx(yb,{})}),y.jsx(je,{path:"/docs/api",element:y.jsx(_b,{})}),y.jsxs(je,{path:"/admin",element:y.jsx(Nu,{requireAdmin:!0,children:y.jsx(gb,{})}),children:[y.jsx(je,{index:!0,element:y.jsx(Du,{to:"developers",replace:!0})}),y.jsx(je,{path:"developers",element:y.jsx(vb,{})}),y.jsx(je,{path:"bots",element:y.jsx(bb,{})}),y.jsx(je,{path:"tokens",element:y.jsx(xb,{})}),y.jsx(je,{path:"audit-logs",element:y.jsx(Sb,{})}),y.jsx(je,{path:"settings",element:y.jsx(Eb,{})})]})]}),y.jsx(je,{path:"*",element:y.jsx(lb,{})})]})})]})})]})}$a.getState().initialize();Q_.createRoot(document.getElementById("root")).render(y.jsx(x.StrictMode,{children:y.jsx(wb,{})}));export{Av as C,Ao as H,qv as K,Hh as L,Du as N,Qg as O,Ru as R,Xv as S,Kh as T,Jv as X,ta as a,Zv as b,Oe as c,gl as d,Yt as e,Gu as f,Hu as g,jb as h,Gv as i,y as j,Gh as k,M0 as l,Rb as m,zb as n,Ov as o,Qh as p,Qo as q,x as r,Xh as s,Wa as t,$a as u,Yv as v,ni as w,Cv as x};
|
|
207
|
+
you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate_2fa",regenerating:"regenerating...",access_tokens:"access_tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current_totp_code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa."},access_tokens:{title:"access_tokens",subtitle:"// personal access tokens",create_token:"create_token",no_tokens:"no_personal_access_tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token_name",token_name_placeholder:"my-cli-token",expires_in:"expires_in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke_token",last_used:"last_used",expires_at:"expires_at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker_tokens",tab_audit_logs:"audit_logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create_developer",search_developers:"search developers...",no_matching_developers:"no_matching_developers",no_developers_found:"no_developers_found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display_name",role:"role",status:"status",two_fa_status:"2fa_status",dev_name:"dev_name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create_developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit_developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create_bot",no_bots_configured:"no_bots_configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot_name",platform:"platform",app_id:"app_id",lark:"lark",slack:"slack",delete_bot:"delete_bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat_bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat_id",chat_name:"chat_name",project:"project",bot:"bot",edit_bot:"edit_bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app_secret",app_secret_keep_current:"app_secret (leave empty to keep current)",webhook_url_optional:"webhook_url (optional)",lark_feishu:"lark_(feishu)",failed_to_update_bot:"failed to update bot",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add_binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker_tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate_token",no_worker_tokens:"no_worker_tokens",generate_token_desc:"generate a token to register a new worker machine",label:"label",purpose:"purpose",expires_at:"expires_at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke_token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',audit_title:"admin / audit_logs",audit_subtitle:"// system activity audit trail",all_actions:"all_actions",filter_by_user:"filter by user...",no_audit_entries:"no_audit_log_entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user_id",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset_2fa",action_generate_token:"generate_token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate_worker_token",create_one_time_token:"// create a one-time registration token",label_identifies_machine:"// identifies which machine this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker_registered",worker_token_generated:"> worker_token_generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",machine:"machine",copied_wait_for_worker:"copied — wait_for_worker",close_worker_can_register:"close // worker can still register",view_machine:"view_machine",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save_settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max_concurrent_tasks_per_machine",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task_timeout_minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat_interval_seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",machine_offline_threshold:"machine_offline_threshold_seconds",machine_offline_threshold_desc:"// mark machine offline after missing heartbeats for this duration",default_agent_type:"default_agent_type",default_agent_type_desc:"// default agent type for new projects",server_url:"server_url",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat_bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"v1.0 — full automation platform",hero_line1:"your machines. your subscriptions.",hero_highlight:"full automation.",hero_desc:"orchestrate ai coding agents across your entire fleet. create tasks, watch them execute in real time, and merge the results — all from one dashboard.",get_started:"get_started",read_docs:"read_docs",how_it_works:"how it works",three_steps:"three steps from idea to merged code.",step_n:"step {n}",step_define:"define",step_define_desc:"describe your task in plain language — bug fixes, features, refactors. attach context and assign to any project.",step_dispatch:"dispatch",step_dispatch_desc:"overlord routes the task to the best available worker and ai agent. execution starts immediately across your fleet.",step_monitor:"monitor & take over",step_monitor_desc:"watch real-time progress via the built-in terminal. jump in at any point to guide, correct, or take full control.",everything_you_need:"everything you need",complete_platform:"a complete platform for ai-assisted software development.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running in seconds",install_desc:"one command to install. start orchestrating immediately.",install_command:"npm install -g @overlordai/developer-cli",go_to_app:"go_to_app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli_reference",cli_subtitle:"// command-line tools",api_reference:"api_reference",api_subtitle:"// rest api endpoints",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"}};function e0(u,r){const o=r.split(".");let c=u;for(const f of o){if(c==null||typeof c!="object")return r;c=c[f]}return typeof c=="string"?c:r}function t0(u,r){return r?u.replace(/\{(\w+)\}/g,(o,c)=>r[c]!=null?String(r[c]):`{${c}}`):u}function Hu(u,r){return t0(e0(Pv,u),r)}function ta(){return{t:x.useCallback((r,o)=>Hu(r,o),[])}}function Kh(){const{theme:u,setTheme:r}=Zh(),{t:o}=ta(),c=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches,f=()=>{r(c?"light":"dark")};return y.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":o(c?"common.switch_to_light":"common.switch_to_dark"),title:o(c?"common.light_mode":"common.dark_mode"),children:c?y.jsx(Vv,{size:16}):y.jsx(Lv,{size:16})})}class Ao extends Error{constructor(o,c,f){const m=o.status||o.status===0?o.status:"",p=o.statusText??"",T=`${m} ${p}`.trim(),g=T?`status code ${T}`:"an unknown error";super(`Request failed with ${g}: ${c.method} ${c.url}`);kt(this,"response");kt(this,"request");kt(this,"options");this.name="HTTPError",this.response=o,this.request=c,this.options=f}}class Jh extends Error{constructor(o){let c="Non-error value was thrown";try{typeof o=="string"?c=o:o&&typeof o=="object"&&"message"in o&&typeof o.message=="string"&&(c=o.message)}catch{}super(c);kt(this,"name","NonError");kt(this,"value");this.value=o}}class To extends Error{constructor(o){const c=o!=null&&o.cause?o.cause instanceof Error?o.cause:new Jh(o.cause):void 0;super(o!=null&&o.code?`Forced retry: ${o.code}`:"Forced retry",c?{cause:c}:void 0);kt(this,"name","ForceRetryError");kt(this,"customDelay");kt(this,"code");kt(this,"customRequest");this.customDelay=o==null?void 0:o.delay,this.code=o==null?void 0:o.code,this.customRequest=o==null?void 0:o.request}}const _h=(()=>{let u=!1,r=!1;const o=typeof globalThis.ReadableStream=="function",c=typeof globalThis.Request=="function";if(o&&c)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),a0=typeof globalThis.AbortController=="function",$h=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",l0=typeof globalThis.ReadableStream=="function",n0=typeof globalThis.FormData=="function",Wh=["get","post","put","patch","head","delete"],i0={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},wo=2147483647,u0=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Fh=Symbol("stop");class Ih{constructor(r){kt(this,"options");this.options=r}}const r0=u=>new Ih(u),c0={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},o0={next:!0},s0={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},f0=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[o,c]of u)r+=u0,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${o}"`).length,r+=typeof c=="string"?new TextEncoder().encode(c).length:c.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},Ph=(u,r,o)=>{let c,f=0;return u.pipeThrough(new TransformStream({transform(m,p){if(p.enqueue(m),c){f+=c.byteLength;let T=r===0?0:f/r;T>=1&&(T=1-Number.EPSILON),o==null||o({percent:T,totalBytes:Math.max(r,f),transferredBytes:f},c)}c=m},flush(){c&&(f+=c.byteLength,o==null||o({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},c))}}))},d0=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const o=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(Ph(u.body,o,r),{status:u.status,statusText:u.statusText,headers:u.headers})},m0=(u,r,o)=>{if(!u.body)return u;const c=f0(o??u.body);return new Request(u,{duplex:"half",body:Ph(u.body,c,r)})},yl=u=>u!==null&&typeof u=="object",Ou=(...u)=>{for(const r of u)if((!yl(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return Vo({},...u)},ep=(u={},r={})=>{const o=new globalThis.Headers(u),c=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,p]of f.entries())c&&p==="undefined"||p===void 0?o.delete(m):o.set(m,p);return o};function Cu(u,r,o){return Object.hasOwn(r,o)&&r[o]===void 0?[]:Vo(u[o]??[],r[o]??[])}const tp=(u={},r={})=>({beforeRequest:Cu(u,r,"beforeRequest"),beforeRetry:Cu(u,r,"beforeRetry"),afterResponse:Cu(u,r,"afterResponse"),beforeError:Cu(u,r,"beforeError")}),h0=(u,r)=>{const o=new URLSearchParams;for(const c of[u,r])if(c!==void 0)if(c instanceof URLSearchParams)for(const[f,m]of c.entries())o.append(f,m);else if(Array.isArray(c))for(const f of c){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");o.append(String(f[0]),String(f[1]))}else if(yl(c))for(const[f,m]of Object.entries(c))m!==void 0&&o.append(f,String(m));else{const f=new URLSearchParams(c);for(const[m,p]of f.entries())o.append(m,p)}return o},Vo=(...u)=>{let r={},o={},c={},f;const m=[];for(const p of u)if(Array.isArray(p))Array.isArray(r)||(r=[]),r=[...r,...p];else if(yl(p)){for(let[T,g]of Object.entries(p)){if(T==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(T==="context"){if(g!=null&&(!yl(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(T==="searchParams"){g==null?f=void 0:f=f===void 0?g:h0(f,g);continue}yl(g)&&T in r&&(g=Vo(r[T],g)),r={...r,[T]:g}}yl(p.hooks)&&(c=tp(c,p.hooks),r.hooks=c),yl(p.headers)&&(o=ep(o,p.headers),r.headers=o)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:$h?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},p0=u=>Wh.includes(u)?u.toUpperCase():u,y0=["get","put","head","delete","options","trace"],_0=[408,413,429,500,502,503,504],g0=[413,429,503],gh={limit:2,methods:y0,statusCodes:_0,afterStatusCodes:g0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},v0=(u={})=>{if(typeof u=="number")return{...gh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(o=>o.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,o])=>o!==void 0));return{...gh,...r}};class Oo extends Error{constructor(o){super(`Request timed out: ${o.method} ${o.url}`);kt(this,"request");this.name="TimeoutError",this.request=o}}async function b0(u,r,o,c){return new Promise((f,m)=>{const p=setTimeout(()=>{o&&o.abort(),m(new Oo(u))},c.timeout);c.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(p)})})}async function x0(u,{signal:r}){return new Promise((o,c)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),c(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),o()},u)})}const S0=(u,r)=>{const o={};for(const c in r)Object.hasOwn(r,c)&&!(c in s0)&&!(c in c0)&&(!(c in u)||c in o0)&&(o[c]=r[c]);return o},E0=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function T0(u){return u instanceof Ao||(u==null?void 0:u.name)===Ao.name}function w0(u){return u instanceof Oo||(u==null?void 0:u.name)===Oo.name}var Vu,ap,Zt,Bt,nt,Q,Ja,Pt,_l,ie,Bu,lp,Co,Lu,Ka,Mo,np,li,Yu,No;const ii=class ii{constructor(r,o={}){It(this,ie);kt(this,"request");It(this,Zt);It(this,Bt,0);It(this,nt);It(this,Q);It(this,Ja);It(this,Pt);It(this,_l);var f,m,p;if(Vt(this,nt,r),Vt(this,Q,{...o,headers:ep(U(this,nt).headers,o.headers),hooks:tp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},o.hooks),method:p0(o.method??U(this,nt).method??"GET"),prefixUrl:String(o.prefixUrl||""),retry:v0(o.retry),throwHttpErrors:o.throwHttpErrors??!0,timeout:o.timeout??1e4,fetch:o.fetch??globalThis.fetch.bind(globalThis),context:o.context??{}}),typeof U(this,nt)!="string"&&!(U(this,nt)instanceof URL||U(this,nt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,Q).prefixUrl&&typeof U(this,nt)=="string"){if(U(this,nt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,Q).prefixUrl.endsWith("/")||(U(this,Q).prefixUrl+="/"),Vt(this,nt,U(this,Q).prefixUrl+U(this,nt))}a0&&$h&&(Vt(this,Pt,U(this,Q).signal??U(this,nt).signal),Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal),_h&&(U(this,Q).duplex="half"),U(this,Q).json!==void 0&&(U(this,Q).body=((m=(f=U(this,Q)).stringifyJson)==null?void 0:m.call(f,U(this,Q).json))??JSON.stringify(U(this,Q).json),U(this,Q).headers.set("content-type",U(this,Q).headers.get("content-type")??"application/json"));const c=o.headers&&new globalThis.Headers(o.headers).has("content-type");if(U(this,nt)instanceof globalThis.Request&&(n0&&U(this,Q).body instanceof globalThis.FormData||U(this,Q).body instanceof URLSearchParams)&&!c&&U(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(U(this,nt),U(this,Q)),E0(U(this,Q).searchParams)){const g="?"+(typeof U(this,Q).searchParams=="string"?U(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ge(p=ii,Vu,ap).call(p,U(this,Q).searchParams)).toString()),h=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(h,U(this,Q))}if(U(this,Q).onUploadProgress){if(typeof U(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!_h)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ge(this,ie,No).call(this,this.request,U(this,Q).body??void 0)}}static create(r,o){var p,T,g;const c=new ii(r,o),f=async()=>{var j,S,D,V,q,H,L,B,P,F,me,fe;if(typeof U(c,Q).timeout=="number"&&U(c,Q).timeout>wo)throw new RangeError(`The \`timeout\` option cannot be greater than ${wo}`);await Promise.resolve();let h=await ge(j=c,ie,np).call(j);for(const K of U(c,Q).hooks.afterResponse){const X=ge(S=c,ie,Co).call(S,h.clone());let ve;try{ve=await K(c.request,ge(D=c,ie,li).call(D),X,{retryCount:U(c,Bt)})}catch(Ze){throw ge(V=c,ie,Ka).call(V,X),ge(q=c,ie,Ka).call(q,h),Ze}if(ve instanceof Ih)throw ge(H=c,ie,Ka).call(H,X),ge(L=c,ie,Ka).call(L,h),new To(ve.options);const De=ve instanceof globalThis.Response?ve:h;X!==De&&ge(B=c,ie,Ka).call(B,X),h!==De&&ge(P=c,ie,Ka).call(P,h),h=De}if(ge(F=c,ie,Co).call(F,h),!h.ok&&(typeof U(c,Q).throwHttpErrors=="function"?U(c,Q).throwHttpErrors(h.status):U(c,Q).throwHttpErrors)){let K=new Ao(h,c.request,ge(me=c,ie,li).call(me));for(const X of U(c,Q).hooks.beforeError)K=await X(K,{retryCount:U(c,Bt)});throw K}if(U(c,Q).onDownloadProgress){if(typeof U(c,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!l0)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const K=h.clone();return ge(fe=c,ie,Ka).call(fe,h),d0(K,U(c,Q).onDownloadProgress)}return h},m=ge(p=c,ie,Mo).call(p,f).finally(()=>{var j,S;const h=U(c,Ja);ge(j=c,ie,Lu).call(j,(h==null?void 0:h.body)??void 0),ge(S=c,ie,Lu).call(S,c.request.body??void 0)});for(const[h,j]of Object.entries(i0))h==="bytes"&&typeof((g=(T=globalThis.Response)==null?void 0:T.prototype)==null?void 0:g.bytes)!="function"||(m[h]=async()=>{c.request.headers.set("accept",c.request.headers.get("accept")||j);const S=await m;if(h==="json"){if(S.status===204)return"";const D=await S.text();return D===""?"":o.parseJson?o.parseJson(D):JSON.parse(D)}return S[h]()});return m}};Vu=new WeakSet,ap=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,o])=>o!==void 0)):r},Zt=new WeakMap,Bt=new WeakMap,nt=new WeakMap,Q=new WeakMap,Ja=new WeakMap,Pt=new WeakMap,_l=new WeakMap,ie=new WeakSet,Bu=function(){const r=U(this,Q).retry.delay(U(this,Bt));let o=r;U(this,Q).retry.jitter===!0?o=Math.random()*r:typeof U(this,Q).retry.jitter=="function"&&(o=U(this,Q).retry.jitter(r),(!Number.isFinite(o)||o<0)&&(o=r));const c=U(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(c,o)},lp=async function(r){if($m(this,Bt)._++,U(this,Bt)>U(this,Q).retry.limit)throw r;const o=r instanceof Error?r:new Jh(r);if(o instanceof To)return o.customDelay??ge(this,ie,Bu).call(this);if(!U(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,Q).retry.shouldRetry!==void 0){const c=await U(this,Q).retry.shouldRetry({error:o,retryCount:U(this,Bt)});if(c===!1)throw r;if(c===!0)return ge(this,ie,Bu).call(this)}if(w0(r)&&!U(this,Q).retry.retryOnTimeout)throw r;if(T0(r)){if(!U(this,Q).retry.statusCodes.includes(r.response.status))throw r;const c=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(c&&U(this,Q).retry.afterStatusCodes.includes(r.response.status)){let f=Number(c)*1e3;Number.isNaN(f)?f=Date.parse(c)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return ge(this,ie,Bu).call(this)},Co=function(r){return U(this,Q).parseJson&&(r.json=async()=>U(this,Q).parseJson(await r.text())),r},Lu=function(r){r&&r.cancel().catch(()=>{})},Ka=function(r){ge(this,ie,Lu).call(this,r.body??void 0)},Mo=async function(r){try{return await r()}catch(o){const c=Math.min(await ge(this,ie,lp).call(this,o),wo);if(U(this,Bt)<1)throw o;if(await x0(c,U(this,Pt)?{signal:U(this,Pt)}:{}),o instanceof To&&o.customRequest){const f=U(this,Q).signal?new globalThis.Request(o.customRequest,{signal:U(this,Q).signal}):new globalThis.Request(o.customRequest);ge(this,ie,Yu).call(this,f)}for(const f of U(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ge(this,ie,li).call(this),error:o,retryCount:U(this,Bt)});if(m instanceof globalThis.Request){ge(this,ie,Yu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===Fh)return}return ge(this,ie,Mo).call(this,r)}},np=async function(){var o;(o=U(this,Zt))!=null&&o.signal.aborted&&(Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,Q).signal}));for(const c of U(this,Q).hooks.beforeRequest){const f=await c(this.request,ge(this,ie,li).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ge(this,ie,Yu).call(this,f);break}}const r=S0(this.request,U(this,Q));return Vt(this,Ja,this.request),this.request=U(this,Ja).clone(),U(this,Q).timeout===!1?U(this,Q).fetch(U(this,Ja),r):b0(U(this,Ja),r,U(this,Zt),U(this,Q))},li=function(){if(!U(this,_l)){const{hooks:r,...o}=U(this,Q);Vt(this,_l,Object.freeze(o))}return U(this,_l)},Yu=function(r){Vt(this,_l,void 0),this.request=ge(this,ie,No).call(this,r)},No=function(r,o){return!U(this,Q).onUploadProgress||!r.body?r:m0(r,U(this,Q).onUploadProgress,o??U(this,Q).body??void 0)},It(ii,Vu);let Qu=ii;/*! MIT License © Sindre Sorhus */const Do=u=>{const r=(o,c)=>Qu.create(o,Ou(u,c));for(const o of Wh)r[o]=(c,f)=>Qu.create(c,Ou(u,f,{method:o}));return r.create=o=>Do(Ou(o)),r.extend=o=>(typeof o=="function"&&(o=o(u??{})),Do(Ou(u,o))),r.stop=Fh,r.retry=r0,r},vh=Do();let ko=!1,Ro=null;const Gu=vh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=$a.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,o)=>{if(o.status===401){ko||(ko=!0,Ro=$a.getState().refresh().finally(()=>{ko=!1,setTimeout(()=>{Ro=null},0)}));try{await Ro}catch{throw o}const c=$a.getState().accessToken;return c&&u.headers.set("Authorization",`Bearer ${c}`),vh(u,r)}}]}}),k0=3e4;function R0(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const o=(u.title+" "+u.body).match(/machine\s+(\S+)/i);return o?`/machines/${o[1]}`:null}function ip(){const u=gl(),[r,o]=x.useState([]),[c,f]=x.useState(0),[m,p]=x.useState(!1),[T,g]=x.useState(!1),h=x.useRef(null),{t:j}=ta(),S=x.useCallback(async()=>{try{g(!0);const q=await Gu.get("web/notifications",{searchParams:{limit:"20"}}).json();o(q.data),f(q.data.filter(H=>!H.isRead).length)}catch{}finally{g(!1)}},[]);x.useEffect(()=>{S();const q=setInterval(S,k0);return()=>clearInterval(q)},[S]),x.useEffect(()=>{function q(H){h.current&&!h.current.contains(H.target)&&p(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);const D=async q=>{try{await Gu.post(`web/notifications/${q}/read`),o(H=>H.map(L=>L.id===q?{...L,isRead:!0}:L)),f(H=>Math.max(0,H-1))}catch{}},V=async()=>{try{await Gu.post("web/notifications/read-all"),o(q=>q.map(H=>({...H,isRead:!0}))),f(0)}catch{}};return y.jsxs("div",{className:"relative",ref:h,children:[y.jsxs("button",{type:"button",onClick:()=>p(q=>!q),"aria-label":j("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:[y.jsx(jv,{size:16}),c>0&&y.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--destructive)] px-1 text-[10px] font-bold text-white",children:c})]}),m&&y.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-80 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[y.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[y.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),c>0&&y.jsxs("button",{type:"button",onClick:V,className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[y.jsx(zv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),y.jsx("div",{className:"max-h-80 overflow-y-auto",children:T&&r.length===0?y.jsx("div",{className:"flex justify-center py-8",children:y.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?y.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[y.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),y.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(q=>{const H=R0(q);return y.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)]":""} ${q.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(q.isRead||D(q.id),p(!1),u(H))},children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("p",{className:"text-sm font-medium",children:q.title}),y.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:q.body}),y.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(q.createdAt).toLocaleString()})]}),!q.isRead&&y.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),D(q.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:y.jsx(Av,{className:"h-3.5 w-3.5"})})]},q.id)})})]})]})}function j0(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),machines:u.machines.map(r=>({type:"machine",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const z0=300,bh={tasks:Qv,machines:Qo,projects:Nv},A0={tasks:"tasks",machines:"machines",projects:"projects"};function O0(){const[u,r]=x.useState(""),[o,c]=x.useState({tasks:[],machines:[],projects:[]}),[f,m]=x.useState(!1),[p,T]=x.useState(!1),[g,h]=x.useState(0),j=x.useRef(null),S=x.useRef(null),D=x.useRef(void 0),V=gl(),{t:q}=ta(),H=[...o.tasks,...o.machines,...o.projects],L=x.useCallback(async K=>{if(!K.trim()){c({tasks:[],machines:[],projects:[]});return}try{m(!0);const X=await Gu.get("web/search",{searchParams:{q:K}}).json();c(j0(X)),h(0)}catch{}finally{m(!1)}},[]);x.useEffect(()=>(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>L(u),z0),()=>{D.current&&clearTimeout(D.current)}),[u,L]),x.useEffect(()=>{function K(X){X.key==="/"&&!p&&!(X.target instanceof HTMLInputElement||X.target instanceof HTMLTextAreaElement)&&(X.preventDefault(),T(!0)),X.key==="Escape"&&p&&(X.preventDefault(),B())}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[p]),x.useEffect(()=>{p&&setTimeout(()=>{var K;return(K=S.current)==null?void 0:K.focus()},50)},[p]);const B=()=>{T(!1),r(""),c({tasks:[],machines:[],projects:[]}),h(0)},P=K=>{switch(B(),K.type){case"task":V(`/tasks/${K.id}`);break;case"machine":V(`/machines/${K.id}`);break;case"project":V(`/projects/${K.id}`);break}},F=K=>{K.key==="ArrowDown"?(K.preventDefault(),h(X=>Math.min(X+1,H.length-1))):K.key==="ArrowUp"?(K.preventDefault(),h(X=>Math.max(X-1,0))):K.key==="Enter"&&H[g]&&(K.preventDefault(),P(H[g]))},me=H.length>0;let fe=0;return y.jsxs(y.Fragment,{children:[y.jsxs("button",{type:"button",onClick:()=>T(!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:[y.jsx(Gv,{className:"h-3.5 w-3.5"}),y.jsx("span",{children:q("common.search_placeholder")}),y.jsx("kbd",{className:"ml-2 rounded border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"/"})]}),p&&y.jsx("div",{ref:j,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:K=>{K.target===j.current&&B()},children:y.jsxs("div",{className:"w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl",style:{fontFamily:"'JetBrains Mono', monospace"},children:[y.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[y.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),y.jsx("input",{ref:S,type:"text",placeholder:q("common.search_input_placeholder"),value:u,onChange:K=>r(K.target.value),onKeyDown:F,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),f&&y.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),y.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:u.trim()&&!me&&!f?y.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:q("common.no_search_results",{query:u})}):Object.keys(bh).map(K=>{const X=o[K];if(X.length===0)return null;const ve=bh[K],De=fe;return fe+=X.length,y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[y.jsx(ve,{className:"h-3 w-3"}),y.jsx("span",{className:"text-[10px] uppercase tracking-wider",children:A0[K]})]}),X.map((Ze,rt)=>{const Ke=De+rt,ct=Ke===g;return y.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${ct?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>P(Ze),onMouseEnter:()=>h(Ke),children:[y.jsx("span",{className:`text-xs ${ct?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:ct?">":" "}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("p",{className:"truncate text-sm",children:Ze.title}),Ze.subtitle&&y.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:Ze.subtitle})]})]},`${Ze.type}-${Ze.id}`)})]},K)})}),y.jsxs("div",{className:"flex items-center gap-4 border-t border-[var(--border)] px-4 py-2",children:[y.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[y.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↑↓"})," ",q("common.navigate_hint")]}),y.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[y.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↵"})," ",q("common.select_hint")]}),y.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[y.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"esc"})," ",q("common.close_hint")]})]})]})})]})}const C0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function M0({isOpen:u,onClose:r,onConfirm:o,title:c,message:f,confirmVariant:m="danger",isLoading:p,...T}){const{t:g}=ta(),h=T.confirmLabel??g("common.confirm"),j=T.cancelLabel??g("common.cancel");if(!u)return null;const S=C0[m];return y.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:y.jsxs("div",{onClick:D=>D.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[y.jsx("div",{style:{marginBottom:"1.25rem"},children:y.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[y.jsx(Xh,{style:{width:"1rem",height:"1rem"}}),c]})}),y.jsx("div",{style:{marginBottom:"1.25rem"},children:y.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),y.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[y.jsx("button",{type:"button",onClick:r,disabled:p,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",fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),y.jsx("button",{type:"button",onClick:o,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:S,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1},children:p?g("common.processing"):h})]})]})})}const up=x.createContext({setActions:()=>{}});function jb(u){const{setActions:r}=x.useContext(up);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const rp=x.createContext({setSubtitle:()=>{}});function zb(u){const{setSubtitle:r}=x.useContext(rp);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const N0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qo},{to:"/projects",label:"projects",icon:Dv},{to:"/access-tokens",label:"access_tokens",icon:qv}],D0=[{to:"/docs/cli",label:"cli_reference",icon:Zv},{to:"/docs/api",label:"api_reference",icon:Mv}],U0=[{to:"/admin",label:"admin",icon:Xv}],q0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qo},{to:"/profile",label:"profile",icon:Kv}],Mu={"/home":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/machines":{title:"common.breadcrumb_machines",subtitle:"common.breadcrumb_machines_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_access_tokens",subtitle:"common.breadcrumb_access_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"}};function H0(u){const{t:r}=ta();if(Mu[u]){const c=Mu[u];return{title:r(c.title),subtitle:r(c.subtitle)}}const o="/"+u.split("/").filter(Boolean)[0];if(Mu[o]){const c=Mu[o],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(c.title),subtitle:f||r(c.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function B0(u,r){return u==="/home"?r==="/home":r.startsWith(u)}function L0(){const u=Yt(),{t:r}=ta();return y.jsx("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:q0.map(({to:o,label:c,icon:f})=>{const m=B0(o,u.pathname);return y.jsxs(ni,{to:o,className:"flex flex-col items-center gap-1",style:{width:70},children:[y.jsx(f,{size:18,className:m?"text-[var(--accent)]":"text-[var(--text-muted)]"}),y.jsx("span",{className:`text-[8px] lowercase ${m?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:{dashboard:r("dashboard.title"),tasks:r("tasks.title"),machines:r("machines.title"),profile:r("common.profile")}[c]??c})]},o)})})}function Y0(){const u=gl(),{t:r}=ta();return y.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:56,minHeight:56},children:[y.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[y.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:y.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),y.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:r("common.overlord")})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(ip,{}),y.jsx(Kh,{})]})]})}function G0(){const{user:u,logout:r}=$a(),o=gl(),[c,f]=x.useState(!1),m=(u==null?void 0:u.role)==="admin",{t:p}=ta(),T=()=>{r(),o("/login")};return y.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)]",style:{width:240,minWidth:240,backgroundColor:"var(--bg-card)"},children:[y.jsx("div",{className:"flex items-center px-5",style:{height:48},children:y.jsxs("button",{onClick:()=>o("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[y.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:y.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),y.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:p("common.overlord")})]})}),y.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[y.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.navigation")}),N0.map(({to:g,label:h,icon:j})=>y.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>y.jsxs(y.Fragment,{children:[y.jsx(j,{size:14,style:{flexShrink:0}}),y.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),y.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.docs_section")}),D0.map(({to:g,label:h,icon:j})=>y.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>y.jsxs(y.Fragment,{children:[y.jsx(j,{size:14,style:{flexShrink:0}}),y.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),m&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.admin_section")}),U0.map(({to:g,label:h,icon:j})=>y.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>y.jsxs(y.Fragment,{children:[y.jsx(j,{size:14,style:{flexShrink:0}}),y.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g))]})]}),y.jsx("div",{className:"border-t border-[var(--border)] p-3",children:y.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[y.jsx("button",{onClick:()=>o("/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:p("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),y.jsxs("button",{onClick:()=>o("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:p("common.profile"),children:[y.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),y.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),y.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":p("common.log_out"),children:y.jsx(Bv,{size:14})})]})}),y.jsx(M0,{isOpen:c,onClose:()=>f(!1),onConfirm:T,title:p("common.logout_title"),message:p("common.logout_message"),confirmLabel:p("common.logout"),confirmVariant:"warning"})]})}function X0({headerActions:u,subtitleOverride:r}){const o=Yt(),{title:c,subtitle:f}=H0(o.pathname),m=r??f;return y.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:[y.jsxs("div",{className:"text-sm lowercase",style:{fontFamily:"'JetBrains Mono', monospace"},children:[y.jsx("span",{style:{color:"var(--text-primary)"},children:c}),m&&y.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),y.jsxs("div",{className:"flex items-center gap-3",children:[u,y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(O0,{}),y.jsx(ip,{}),y.jsx(Kh,{})]})]})]})}function Q0(){const[u,r]=x.useState(null),[o,c]=x.useState(null);return y.jsxs("div",{className:"flex h-screen font-mono",children:[y.jsx(G0,{}),y.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[y.jsx(Y0,{}),y.jsx(X0,{headerActions:u,subtitleOverride:o}),y.jsx("main",{className:"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 md:p-6",children:y.jsx(up.Provider,{value:{setActions:r},children:y.jsx(rp.Provider,{value:{setSubtitle:c},children:y.jsx(Qg,{})})})}),y.jsx(L0,{})]})]})}function Nu({children:u,requireAdmin:r=!1}){const{accessToken:o,user:c,requireTotpSetup:f,initializing:m}=$a(),p=Yt();return m?y.jsx("div",{className:"flex h-screen items-center justify-center",children:y.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):o?f?p.pathname!=="/totp-setup"?y.jsx(Du,{to:"/totp-setup",replace:!0}):y.jsx(y.Fragment,{children:u}):r&&(c==null?void 0:c.role)!=="admin"?y.jsx(Du,{to:"/home",replace:!0}):y.jsx(y.Fragment,{children:u}):y.jsx(Du,{to:"/login",state:{from:p},replace:!0})}function V0({children:u}){const{theme:r,resolved:o,setResolved:c}=Zh();return x.useEffect(()=>{if(r!=="system"){c(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");c(f.matches?"dark":"light");const m=p=>c(p.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,c]),x.useEffect(()=>{document.documentElement.classList.toggle("dark",o==="dark")},[o]),y.jsx(y.Fragment,{children:u})}class Z0 extends x.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?y.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8",children:[y.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Hu("common.runtime_error")}),y.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Hu("common.an_unexpected_error_occurred")}),y.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:[y.jsx(Yv,{className:"h-3.5 w-3.5"}),Hu("common.reload")]})]}):this.props.children}}function K0({isOpen:u}){const r=gl(),{logout:o,setSessionExpired:c}=$a(),{t:f}=ta();function m(){o(),c(!1),r("/login")}return u?y.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[y.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),y.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:y.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[y.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:y.jsx(Hv,{className:"h-7 w-7 text-[var(--warning)]"})}),y.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),y.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),y.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 xh=5;let ba=[];const Uo=new Set;function cp(){Uo.forEach(u=>u())}function J0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,o=4e3){const c=J0();return ba=[...ba,{id:c,variant:u,message:r,duration:o}],ba.length>xh&&(ba=ba.slice(ba.length-xh)),cp(),c}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function $0(u){ba=ba.filter(r=>r.id!==u),cp()}function W0(){const[,u]=x.useState(0);return x.useEffect(()=>{const r=()=>u(o=>o+1);return Uo.add(r),()=>{Uo.delete(r)}},[]),ba}const F0={success:{icon:Ov,borderColor:"var(--accent)"},error:{icon:Cv,borderColor:"var(--destructive)"},warning:{icon:Xh,borderColor:"var(--warning)"},info:{icon:Uv,borderColor:"var(--info)"}};function I0({item:u}){const r=F0[u.variant],o=r.icon,{t:c}=ta(),f=x.useCallback(()=>$0(u.id),[u.id]);return x.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),y.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[y.jsx(o,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),y.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),y.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":c("common.dismiss_notification"),children:y.jsx(Jv,{className:"h-3.5 w-3.5"})})]})}function P0(){const u=W0();return u.length===0?null:y.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:u.map(r=>y.jsx("div",{className:"pointer-events-auto",children:y.jsx(I0,{item:r})},r.id))})}const eb=x.lazy(()=>Ne(()=>import("./LandingPage-BWfR2oXt.js"),__vite__mapDeps([0,1,2,3,4]))),tb=x.lazy(()=>Ne(()=>import("./LoginPage-Ca4FsK2j.js"),[])),ab=x.lazy(()=>Ne(()=>import("./TotpSetupPage-skouZwAo.js"),[])),lb=x.lazy(()=>Ne(()=>import("./NotFoundPage-rIa2IHZG.js"),[])),nb=x.lazy(()=>Ne(()=>import("./HomePage-BsiwA4gW.js"),__vite__mapDeps([5,6,7,8,9,1]))),ib=x.lazy(()=>Ne(()=>import("./TaskListPage-BpkKh4Yk.js"),__vite__mapDeps([10,11,7,12,4,13,8,14]))),ub=x.lazy(()=>Ne(()=>import("./TaskDetailPage-NP2PS_Ck.js"),__vite__mapDeps([15,11,12,16,17,18,19,20]))),rb=x.lazy(()=>Ne(()=>import("./MachineListPage-B59mZoVm.js"),__vite__mapDeps([21,6,22,23,24,4,19,12,13,8,14]))),cb=x.lazy(()=>Ne(()=>import("./MachineDetailPage-BdJIcUfz.js"),__vite__mapDeps([25,6,16]))),ob=x.lazy(()=>Ne(()=>import("./WorkerSetupGuidePage-BelFB95H.js"),__vite__mapDeps([22,23,24]))),sb=x.lazy(()=>Ne(()=>import("./ProjectListPage-cWKxZMbI.js"),__vite__mapDeps([26,6,12,13,8,14]))),fb=x.lazy(()=>Ne(()=>import("./ProjectDetailPage-ByDXJRZx.js"),__vite__mapDeps([27,6,28,12,29,30,14]))),db=x.lazy(()=>Ne(()=>import("./EditProjectPage-jeKBXKpU.js"),__vite__mapDeps([31,6,12,28,14]))),mb=x.lazy(()=>Ne(()=>import("./PipelineEditorPage-DqNJhpu_.js"),__vite__mapDeps([32,12]))),hb=x.lazy(()=>Ne(()=>import("./ProfilePage-_uegx1AA.js"),[])),pb=x.lazy(()=>Ne(()=>import("./AccessTokensPage-DQEUkklL.js"),__vite__mapDeps([33,12,13,8,14,4,30]))),yb=x.lazy(()=>Ne(()=>import("./CliReferencePage-Ca6ENkKU.js"),__vite__mapDeps([34,35,4,14]))),_b=x.lazy(()=>Ne(()=>import("./ApiReferencePage-BdVahGqK.js"),__vite__mapDeps([36,35,4,14]))),gb=x.lazy(()=>Ne(()=>import("./AdminPage-Dy3fDESU.js"),__vite__mapDeps([37,3,2,38,24]))),vb=x.lazy(()=>Ne(()=>import("./DeveloperManage-CSd18cTX.js"),__vite__mapDeps([39,12,13,8,14,3,29,17]))),bb=x.lazy(()=>Ne(()=>import("./BotManage-B3-rqR1c.js"),__vite__mapDeps([40,12,30,14,13,8,2,29]))),xb=x.lazy(()=>Ne(()=>import("./TokenManage-k5e6DyJG.js"),__vite__mapDeps([41,23,4,18,13,8,14]))),Sb=x.lazy(()=>Ne(()=>import("./AuditLogPage-DrxGWVeq.js"),__vite__mapDeps([42,12,13,8,38,9]))),Eb=x.lazy(()=>Ne(()=>import("./SettingsPage-BVRak3kN.js"),[]));function Tb(){return y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function wb(){const u=$a(r=>r.sessionExpired);return y.jsxs(V0,{children:[y.jsx(P0,{}),y.jsx(Z0,{children:y.jsxs(yv,{children:[y.jsx(K0,{isOpen:u}),y.jsx(x.Suspense,{fallback:y.jsx(Tb,{}),children:y.jsxs(Zg,{children:[y.jsx(je,{path:"/",element:y.jsx(eb,{})}),y.jsx(je,{path:"/login",element:y.jsx(tb,{})}),y.jsx(je,{path:"/totp-setup",element:y.jsx(Nu,{children:y.jsx(ab,{})})}),y.jsxs(je,{element:y.jsx(Nu,{children:y.jsx(Q0,{})}),children:[y.jsx(je,{path:"/home",element:y.jsx(nb,{})}),y.jsx(je,{path:"/tasks",element:y.jsx(ib,{})}),y.jsx(je,{path:"/tasks/:id",element:y.jsx(ub,{})}),y.jsx(je,{path:"/machines",element:y.jsx(rb,{})}),y.jsx(je,{path:"/machines/setup",element:y.jsx(Nu,{requireAdmin:!0,children:y.jsx(ob,{})})}),y.jsx(je,{path:"/machines/:id",element:y.jsx(cb,{})}),y.jsx(je,{path:"/projects",element:y.jsx(sb,{})}),y.jsx(je,{path:"/projects/:key",element:y.jsx(fb,{})}),y.jsx(je,{path:"/projects/:key/edit",element:y.jsx(db,{})}),y.jsx(je,{path:"/projects/:key/pipeline",element:y.jsx(mb,{})}),y.jsx(je,{path:"/profile",element:y.jsx(hb,{})}),y.jsx(je,{path:"/access-tokens",element:y.jsx(pb,{})}),y.jsx(je,{path:"/docs/cli",element:y.jsx(yb,{})}),y.jsx(je,{path:"/docs/api",element:y.jsx(_b,{})}),y.jsxs(je,{path:"/admin",element:y.jsx(Nu,{requireAdmin:!0,children:y.jsx(gb,{})}),children:[y.jsx(je,{index:!0,element:y.jsx(Du,{to:"developers",replace:!0})}),y.jsx(je,{path:"developers",element:y.jsx(vb,{})}),y.jsx(je,{path:"bots",element:y.jsx(bb,{})}),y.jsx(je,{path:"tokens",element:y.jsx(xb,{})}),y.jsx(je,{path:"audit-logs",element:y.jsx(Sb,{})}),y.jsx(je,{path:"settings",element:y.jsx(Eb,{})})]})]}),y.jsx(je,{path:"*",element:y.jsx(lb,{})})]})})]})})]})}$a.getState().initialize();Q_.createRoot(document.getElementById("root")).render(y.jsx(x.StrictMode,{children:y.jsx(wb,{})}));export{Av as C,Ao as H,qv as K,Hh as L,Du as N,Qg as O,Ru as R,Xv as S,Kh as T,Jv as X,ta as a,Zv as b,Oe as c,gl as d,Yt as e,Gu as f,Hu as g,jb as h,Gv as i,y as j,Gh as k,M0 as l,Rb as m,zb as n,Ov as o,Qh as p,Qo as q,x as r,Xh as s,Wa as t,$a as u,Yv as v,ni as w,Cv as x};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as i,f as o}from"./index-
|
|
1
|
+
import{p as i,f as o}from"./index-DYT_rof3.js";const f=i((t,l)=>({tasks:[],currentTask:null,loading:!1,nextCursor:null,fetchTasks:async s=>{t({loading:!0});try{const a={};s!=null&&s.status&&(a.status=s.status),s!=null&&s.projectKey&&(a.projectKey=s.projectKey),s!=null&&s.cursor&&(a.cursor=s.cursor),s!=null&&s.limit&&(a.limit=String(s.limit));const n=await o.get("web/tasks",{searchParams:a}).json();s!=null&&s.cursor?t(c=>({tasks:[...c.tasks,...n.data],nextCursor:n.nextCursor??null})):t({tasks:n.data,nextCursor:n.nextCursor??null})}finally{t({loading:!1})}},fetchTask:async s=>{t({loading:!0});try{const a=await o.get(`web/tasks/${s}`).json();t({currentTask:a})}finally{t({loading:!1})}},createTask:async s=>{const a=await o.post("web/tasks",{json:s}).json();return t(n=>({tasks:[a,...n.tasks]})),a},cancelTask:async s=>{await o.post(`web/tasks/${s}/cancel`);const{currentTask:a}=l();(a==null?void 0:a.id)===s&&await l().fetchTask(s)},reset:()=>{t({tasks:[],currentTask:null,loading:!1,nextCursor:null})}}));export{f as u};
|
package/public/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DYT_rof3.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-v5rpOoDH.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as _,r as a,j as e,f as N,d as T,o as C,K as L,x as E,l as M}from"./index-BTxGPsOB.js";import{K as F}from"./key-OwB_ZR3T.js";import{C as D}from"./copy-C0vNNRrm.js";import{E as A}from"./external-link-CVx7jdXb.js";import{E as I}from"./EmptyState-BQ2BNVJS.js";import{T as O}from"./Skeleton-DkwMPaZ1.js";import{P}from"./plus-Cm_mqbAL.js";function B({isOpen:r,onClose:h,onCreated:y}){const{t:s}=_(),[t,c]=a.useState(""),[i,x]=a.useState(!1),[m,p]=a.useState(""),u=()=>{c(""),p(""),h()},d=async()=>{if(p(""),!t.trim()){p(s("admin.pat_label_required"));return}try{x(!0);const n=await N.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:n.token,id:n.id})}catch(n){const l=n instanceof Error?n.message:s("admin.pat_failed_to_generate");p(l)}finally{x(!1)}};return r?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:n=>{n.target===n.currentTarget&&u()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(F,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[m&&e.jsx("div",{className:"border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",style:{borderRadius:"4px"},children:m}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:t,onChange:n=>c(n.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:n=>{n.key==="Enter"&&d()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("admin.label_identifies_machine")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:u,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s("common.cancel")}),e.jsx("button",{onClick:d,disabled:i,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s(i?"admin.generating":"admin.generate")})]})]})}):null}const J=3e3,K=600*1e3;function $({isOpen:r,token:h,tokenId:y,onClose:s}){const{t}=_(),[c,i]=a.useState("command"),[x,m]=a.useState(!1),[p,u]=a.useState(""),[d,n]=a.useState(null),l=a.useRef(void 0),j=a.useRef(Date.now()),f=T(),k=typeof window<"u"?window.location.origin:"https://overlord.example.com",g=`overlord setup worker --token ${h} --server ${k}`,w=async()=>{try{await navigator.clipboard.writeText(g),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},o=a.useCallback(async()=>{try{const v=await N.get(`admin/worker-tokens/${y}/status`).json();v.status==="used"&&v.machine_name&&(i("success"),u(v.machine_name),n(v.machine_id??null),l.current&&clearInterval(l.current))}catch{}Date.now()-j.current>K&&(i("timeout"),l.current&&clearInterval(l.current))},[y]),S=()=>{i("waiting"),j.current=Date.now(),l.current=setInterval(o,J)};a.useEffect(()=>()=>{l.current&&clearInterval(l.current)},[]);const R=()=>{s(),d&&f(`/machines/${d}`)};if(!r)return null;const b={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:v=>{v.target===v.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...b,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_registered")})]}):e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_token_generated")})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.run_command_desc")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-4",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:g}),e.jsx("button",{onClick:w,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:x?e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"h-3 w-3 text-[var(--accent)]"}),t("common.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"h-3 w-3"}),t("common.copy")]})})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:t("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:t("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:t("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[t("admin.machine"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:p})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("common.close")}),e.jsx("button",{onClick:S,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:b,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("common.close")}),e.jsxs("button",{onClick:R,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:b,children:[e.jsx(A,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function H(){const{t:r}=_(),[h,y]=a.useState([]),[s,t]=a.useState(!0),[c,i]=a.useState(!1),[x,m]=a.useState(null),[p,u]=a.useState(!1),[d,n]=a.useState(null),[l,j]=a.useState(!1),f=a.useCallback(async()=>{try{t(!0);const o=await N.get("admin/worker-tokens").json();y(o)}catch{}finally{t(!1)}},[]);a.useEffect(()=>{f()},[f]);const k=async()=>{if(d){j(!0);try{await N.post(`admin/worker-tokens/${d.id}/revoke`),u(!1),n(null),f()}catch{}finally{j(!1)}}},g=o=>{i(!1),m(o),f()},w=o=>{switch(o){case"active":return"text-green-400";case"used":return"text-blue-400";case"revoked":return"text-red-400";case"expired":return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:r("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>i(!0),children:[e.jsx(P,{className:"h-3.5 w-3.5"}),r("admin.generate_token")]})]}),s?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(O,{rows:3})}):h.length===0?e.jsx(I,{icon:L,title:r("admin.no_worker_tokens"),description:r("admin.generate_token_desc"),actionLabel:r("admin.generate_token"),onAction:()=>i(!0)}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:r("common.actions")})]})}),e.jsx("tbody",{children:h.map(o=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:o.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:o.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:w(o.status),children:o.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(o.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:o.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(o.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:o.status==="active"&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{n(o),u(!0)},children:[e.jsx(E,{className:"h-3.5 w-3.5"}),r("admin.revoke")]})})]},o.id))})]})}),e.jsx(B,{isOpen:c,onClose:()=>i(!1),onCreated:g}),x&&e.jsx($,{isOpen:!!x,token:x.token,tokenId:x.id,onClose:()=>m(null)}),e.jsx(M,{isOpen:p,onClose:()=>{u(!1),n(null)},onConfirm:k,title:r("admin.revoke_token"),message:r("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:r("admin.revoke"),confirmVariant:"danger",isLoading:l})]})}export{H as default};
|