@xenon-device-management/xenon 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/lib/package.json +1 -1
  2. package/lib/public/assets/{AnnotationOverlay-PMj0TMCJ.js → AnnotationOverlay-U9aJANVi.js} +1 -1
  3. package/lib/public/assets/{ApiKeyGate-DXo-ecxe.js → ApiKeyGate-6265m84B.js} +1 -1
  4. package/lib/public/assets/{BugReportButton-DY9ltq27.js → BugReportButton-CGeVEuQ-.js} +1 -1
  5. package/lib/public/assets/{DeviceMosaicView-CT7nA_re.js → DeviceMosaicView-C_3HwhVZ.js} +1 -1
  6. package/lib/public/assets/{EmptyState-DX4jwZ9l.js → EmptyState-D5BTZSIa.js} +1 -1
  7. package/lib/public/assets/{FieldGroup-Czk8gPhv.js → FieldGroup-CDBhSDsT.js} +1 -1
  8. package/lib/public/assets/{FilterMenu-DTblXm4v.js → FilterMenu-7JEhwNEM.js} +1 -1
  9. package/lib/public/assets/{Menu-CdGgXICe.js → Menu-DWl5uJ9E.js} +1 -1
  10. package/lib/public/assets/{Modal-CtzTciQY.js → Modal-BZEfRpq8.js} +1 -1
  11. package/lib/public/assets/{RecordingPage-BjJH7AyA.js → RecordingPage-B_EK9yKX.js} +1 -1
  12. package/lib/public/assets/{RecordingsPage-BkgX2xkA.js → RecordingsPage-CptMr6IM.js} +1 -1
  13. package/lib/public/assets/{SegmentedControl-DEXgl8Qw.js → SegmentedControl-D7BBuUDP.js} +1 -1
  14. package/lib/public/assets/{SettingCard-BnwAoJhk.js → SettingCard-W3QrpCyh.js} +1 -1
  15. package/lib/public/assets/{Table-hmNY-ICS.js → Table-BthtE6KF.js} +1 -1
  16. package/lib/public/assets/{activity-Bmuu2fcZ.js → activity-CdoCkXe1.js} +1 -1
  17. package/lib/public/assets/{ai-settings-uAzHwRK_.js → ai-settings-CkGIJyKN.js} +1 -1
  18. package/lib/public/assets/{api-keys-CFZeXLs7.js → api-keys-2lHmq44B.js} +1 -1
  19. package/lib/public/assets/{apps-DgwQRGg6.js → apps-BCHpRvo_.js} +1 -1
  20. package/lib/public/assets/{arrow-left-D5x8OLs-.js → arrow-left-CpaUvzcV.js} +1 -1
  21. package/lib/public/assets/{arrow-right-DRYGEjl5.js → arrow-right-TCqk2-9N.js} +1 -1
  22. package/lib/public/assets/{arrow-up-right-DLtHJsd6.js → arrow-up-right-B6JBqR-t.js} +1 -1
  23. package/lib/public/assets/{auth-shell-D_TLCi0Y.js → auth-shell-BSyFjCa8.js} +2 -2
  24. package/lib/public/assets/builds-page-D0RnbdGV.js +11 -0
  25. package/lib/public/assets/{button-CbVMa9PL.js → button-CB1ehl9z.js} +1 -1
  26. package/lib/public/assets/{calendar-DgmwU-Oq.js → calendar-DXZ0-sa6.js} +1 -1
  27. package/lib/public/assets/{check-Du5vvLoJ.js → check-Bq0QWhtG.js} +1 -1
  28. package/lib/public/assets/{chevron-left-CiRlzB7w.js → chevron-left-BMI8J11V.js} +1 -1
  29. package/lib/public/assets/{chevron-right-i93nTPHX.js → chevron-right-tbezHlhW.js} +1 -1
  30. package/lib/public/assets/{circle-check-DxYO7yp5.js → circle-check-BgkLodxU.js} +1 -1
  31. package/lib/public/assets/{circle-x-Dw1DFg0I.js → circle-x-DuFD0enL.js} +1 -1
  32. package/lib/public/assets/{clock-0q-GqRU0.js → clock-C7AhkXMm.js} +1 -1
  33. package/lib/public/assets/{copy-Ds-F075f.js → copy-CiNhxJMO.js} +1 -1
  34. package/lib/public/assets/{device-explorer-Dsldlx2g.js → device-explorer-BFWU04bT.js} +1 -1
  35. package/lib/public/assets/{download-BdJEWL8b.js → download-Di_q2qj5.js} +1 -1
  36. package/lib/public/assets/{forgot-password-D7eNuw-V.js → forgot-password-gtciaIez.js} +1 -1
  37. package/lib/public/assets/{funnel-CY3Ovebz.js → funnel-BY1R0ydM.js} +1 -1
  38. package/lib/public/assets/{index-tW_VASh2.js → index-B1iJx0w1.js} +2 -2
  39. package/lib/public/assets/{index-BpJwb7cQ.js → index-Bgx65Mb_.js} +1 -1
  40. package/lib/public/assets/{input-DvCYrL_q.js → input-B83lhHJ_.js} +1 -1
  41. package/lib/public/assets/{keycodes-CyOBCkU6.js → keycodes-BjiWgQik.js} +1 -1
  42. package/lib/public/assets/{layers-ChEcsAc2.js → layers-CxMkF86z.js} +1 -1
  43. package/lib/public/assets/{list-checks-EWcywAEC.js → list-checks-2GnUUcTR.js} +1 -1
  44. package/lib/public/assets/{lock-DmkRlmQB.js → lock-BRKQ_6ix.js} +1 -1
  45. package/lib/public/assets/{login-BXeYWAn-.js → login-Chmwsz_d.js} +1 -1
  46. package/lib/public/assets/{maintenance-settings-Cd37WZ5e.js → maintenance-settings-DEb0LrBA.js} +1 -1
  47. package/lib/public/assets/{monitor-BTqiDmvk.js → monitor-ClL-76V7.js} +1 -1
  48. package/lib/public/assets/{mouse-pointer-2-BrwX4M5d.js → mouse-pointer-2-C815rsZl.js} +1 -1
  49. package/lib/public/assets/{network-8uySyPSM.js → network-CBd_S-GU.js} +1 -1
  50. package/lib/public/assets/{overview-CdBGYC95.js → overview-B0paJ7DP.js} +1 -1
  51. package/lib/public/assets/{page-header-BYzd5kfp.js → page-header-D9FkEgQm.js} +1 -1
  52. package/lib/public/assets/{plus-BIekJsya.js → plus-DF-cFokG.js} +1 -1
  53. package/lib/public/assets/{profile-page-a-nQ7xFX.js → profile-page-BrdnJBRA.js} +1 -1
  54. package/lib/public/assets/{reset-password-7Gbj29w1.js → reset-password-DJFBWJnT.js} +1 -1
  55. package/lib/public/assets/{runbook-page-Bgd9u7W6.js → runbook-page-D5SIpqrf.js} +1 -1
  56. package/lib/public/assets/{select-DEpRzm_3.js → select-Wc_B9XUe.js} +1 -1
  57. package/lib/public/assets/{selector-detail-page-CvqjXfvp.js → selector-detail-page-q7-lRo_l.js} +1 -1
  58. package/lib/public/assets/{selector-health-BEzkwE_K.js → selector-health-Qe-NusTk.js} +1 -1
  59. package/lib/public/assets/{selector-health-page-Dl_IE1Je.js → selector-health-page-Dw2WUlDJ.js} +1 -1
  60. package/lib/public/assets/{session-detail-page-CuF_EwRE.js → session-detail-page-bZpHxz1l.js} +3 -3
  61. package/lib/public/assets/{settings-CxLw5tlF.js → settings-DA_CIMVB.js} +1 -1
  62. package/lib/public/assets/stat-tile-CxsAGcDU.js +8 -0
  63. package/lib/public/assets/{tablet-DJBOerD6.js → tablet-_Uwg1m0t.js} +1 -1
  64. package/lib/public/assets/{teams-CDQQdVRl.js → teams-ZTGk8Wky.js} +1 -1
  65. package/lib/public/assets/{trash-2-B_zQvjI3.js → trash-2-BcWlaBK8.js} +1 -1
  66. package/lib/public/assets/{upload-9FV8q3NB.js → upload-47Lf5U7r.js} +1 -1
  67. package/lib/public/assets/{use-password-reset-mode-Cx5GHMnk.js → use-password-reset-mode-B3cWCSu5.js} +1 -1
  68. package/lib/public/assets/{users-ep-SOGaV.js → users-DGHET-4G.js} +1 -1
  69. package/lib/public/assets/{users-DC0IoOuZ.js → users-IiOEsNnr.js} +1 -1
  70. package/lib/public/assets/{video-off-BmUg-gKW.js → video-off-D-jBA0at.js} +1 -1
  71. package/lib/public/assets/{webhook-settings-CwUBzLGC.js → webhook-settings-HqV4V6_J.js} +1 -1
  72. package/lib/public/assets/{zap-CBld_5xf.js → zap-iAfVTWG0.js} +1 -1
  73. package/lib/public/index.html +1 -1
  74. package/lib/src/services/recording/RecordingOrchestrator.js +35 -50
  75. package/lib/test/integration/cross-workflow.spec.js +30 -6
  76. package/lib/test/unit/recording-orchestrator.spec.js +71 -9
  77. package/lib/test/unit/recording-source-ended.spec.js +17 -4
  78. package/package.json +1 -1
  79. package/lib/public/assets/builds-page-CwKR7w5o.js +0 -11
  80. package/lib/public/assets/stat-tile-DFuoxV5Y.js +0 -6
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-tW_VASh2.js";/**
1
+ import{c as t}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as p,t as z,r as c,X as m,j as e,S as k,A as N,P as I,Q as $}from"./index-tW_VASh2.js";/* empty css */import{S,A as F}from"./SettingCard-BnwAoJhk.js";import{P as B}from"./page-header-BYzd5kfp.js";import{L as T}from"./lock-DmkRlmQB.js";import{C as b}from"./circle-check-DxYO7yp5.js";import{A as E}from"./activity-Bmuu2fcZ.js";import"./button-CbVMa9PL.js";import"./utils-CDN07tui.js";/**
1
+ import{c as p,t as z,r as c,X as m,j as e,S as k,A as N,P as I,Q as $}from"./index-B1iJx0w1.js";/* empty css */import{S,A as F}from"./SettingCard-W3QrpCyh.js";import{P as B}from"./page-header-D9FkEgQm.js";import{L as T}from"./lock-BRKQ_6ix.js";import{C as b}from"./circle-check-BgkLodxU.js";import{A as E}from"./activity-CdoCkXe1.js";import"./button-CB1ehl9z.js";import"./utils-CDN07tui.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{t as le,r as a,j as e,A as $,V as g,y as oe}from"./index-tW_VASh2.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-hmNY-ICS.js";import{F as m}from"./FieldGroup-Czk8gPhv.js";import{P as O}from"./page-header-BYzd5kfp.js";import{M as B}from"./Modal-CtzTciQY.js";import{B as u}from"./button-CbVMa9PL.js";import{I as H}from"./input-DvCYrL_q.js";import{S as M}from"./select-DEpRzm_3.js";import{P as v}from"./plus-BIekJsya.js";import{T as pe}from"./trash-2-B_zQvjI3.js";import{C as he}from"./check-Du5vvLoJ.js";import{C as xe}from"./copy-Ds-F075f.js";import"./index-BpJwb7cQ.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Ee=()=>{const{toast:i}=le(),[n,w]=a.useState([]),[b,J]=a.useState([]),[X,N]=a.useState(!0),[G,k]=a.useState(!1),[V,d]=a.useState(!1),[r,y]=a.useState(null),[C,S]=a.useState(null),[T,_]=a.useState(!1),[p,A]=a.useState(""),[j,I]=a.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=a.useState(300),[E,D]=a.useState(""),[h,F]=a.useState("30d"),[x,K]=a.useState(!1),Q=s=>{var t;return s?((t=b.find(c=>c.id===s))==null?void 0:t.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,t]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),t.ok&&J(await t.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};a.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(t=>j[t]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const t=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!t.ok)throw new Error(`HTTP ${t.status}`);const c=await t.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(t){i(`Create failed: ${t.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const t=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);i("Key revoked","success"),await f()}catch(t){i(`Revoke failed: ${t.message}`,"error")}finally{S(null)}},te=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const ae=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ae}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:Q(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(t=>{const c=t.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},t)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:V,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver sessions (",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),")."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:t=>I({...j,[s]:t.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xe:options.team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&te(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Ee as ApiKeys};
1
+ import{t as le,r as a,j as e,A as $,V as g,y as oe}from"./index-B1iJx0w1.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-BthtE6KF.js";import{F as m}from"./FieldGroup-CDBhSDsT.js";import{P as O}from"./page-header-D9FkEgQm.js";import{M as B}from"./Modal-BZEfRpq8.js";import{B as u}from"./button-CB1ehl9z.js";import{I as H}from"./input-B83lhHJ_.js";import{S as M}from"./select-Wc_B9XUe.js";import{P as v}from"./plus-DF-cFokG.js";import{T as pe}from"./trash-2-BcWlaBK8.js";import{C as he}from"./check-Bq0QWhtG.js";import{C as xe}from"./copy-CiNhxJMO.js";import"./index-Bgx65Mb_.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Ee=()=>{const{toast:i}=le(),[n,w]=a.useState([]),[b,J]=a.useState([]),[X,N]=a.useState(!0),[G,k]=a.useState(!1),[V,d]=a.useState(!1),[r,y]=a.useState(null),[C,S]=a.useState(null),[T,_]=a.useState(!1),[p,A]=a.useState(""),[j,I]=a.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=a.useState(300),[E,D]=a.useState(""),[h,F]=a.useState("30d"),[x,K]=a.useState(!1),Q=s=>{var t;return s?((t=b.find(c=>c.id===s))==null?void 0:t.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,t]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),t.ok&&J(await t.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};a.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(t=>j[t]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const t=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!t.ok)throw new Error(`HTTP ${t.status}`);const c=await t.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(t){i(`Create failed: ${t.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const t=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);i("Key revoked","success"),await f()}catch(t){i(`Revoke failed: ${t.message}`,"error")}finally{S(null)}},te=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const ae=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ae}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:Q(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(t=>{const c=t.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},t)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:V,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver sessions (",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),")."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:t=>I({...j,[s]:t.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xe:options.team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&te(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Ee as ApiKeys};
@@ -1,4 +1,4 @@
1
- import{c as k,j as e,r as i,A as K,t as ve,b as fe,X as p,H as je,q as V,z as ye,v as ge}from"./index-tW_VASh2.js";import{f as Ne}from"./time-B8FIgwPE.js";import{c as be,B as x}from"./button-CbVMa9PL.js";import{c as ke}from"./utils-CDN07tui.js";import{P as we}from"./page-header-BYzd5kfp.js";import{S as Z}from"./select-DEpRzm_3.js";import{M as J}from"./Modal-CtzTciQY.js";import{F as Q}from"./FieldGroup-Czk8gPhv.js";import{U as ee,T as H}from"./upload-9FV8q3NB.js";import{C as Ce}from"./check-Du5vvLoJ.js";import{C as Ae}from"./copy-Ds-F075f.js";import{Z as Se}from"./zap-CBld_5xf.js";import{D as ze}from"./download-BdJEWL8b.js";import{T as Me}from"./trash-2-B_zQvjI3.js";import"./index-BpJwb7cQ.js";/**
1
+ import{c as k,j as e,r as i,A as K,t as ve,b as fe,X as p,H as je,q as V,z as ye,v as ge}from"./index-B1iJx0w1.js";import{f as Ne}from"./time-B8FIgwPE.js";import{c as be,B as x}from"./button-CB1ehl9z.js";import{c as ke}from"./utils-CDN07tui.js";import{P as we}from"./page-header-D9FkEgQm.js";import{S as Z}from"./select-Wc_B9XUe.js";import{M as J}from"./Modal-BZEfRpq8.js";import{F as Q}from"./FieldGroup-CDBhSDsT.js";import{U as ee,T as H}from"./upload-47Lf5U7r.js";import{C as Ce}from"./check-Bq0QWhtG.js";import{C as Ae}from"./copy-CiNhxJMO.js";import{Z as Se}from"./zap-iAfVTWG0.js";import{D as ze}from"./download-Di_q2qj5.js";import{T as Me}from"./trash-2-BcWlaBK8.js";import"./index-Bgx65Mb_.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-tW_VASh2.js";/**
1
+ import{c as o}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-tW_VASh2.js";/**
1
+ import{c as o}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-tW_VASh2.js";/**
1
+ import{c as o}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
- import{c as i,j as e,n,S as o}from"./index-tW_VASh2.js";import{N as l}from"./network-8uySyPSM.js";/**
1
+ import{c as i,j as e,n,S as o}from"./index-B1iJx0w1.js";import{N as l}from"./network-CBd_S-GU.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const d=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],c=i("monitor-smartphone",d),x=[{icon:o,title:"Self-healing selectors",body:"Broken locators recover through six escalating tiers before a test fails."},{icon:c,title:"Live Android & iOS devices",body:"Watch, drive and record real devices from the browser."},{icon:l,title:"Hub–node scaling",body:"One hub orchestrates device labs across machines."}];function b({children:t}){return e.jsxs("div",{className:"grid min-h-screen w-full grid-cols-1 bg-[var(--bg)] text-[var(--text)] md:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("aside",{className:"relative hidden overflow-hidden border-r border-[rgb(var(--rgb-fg)/0.06)] bg-[var(--surface-sunken)] md:flex md:flex-col",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_90%_60%_at_0%_0%,rgb(var(--rgb-accent)/0.14),transparent_60%)]"}),e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[linear-gradient(to_right,rgb(var(--rgb-white)/0.03)_1px,transparent_1px),linear-gradient(to_bottom,rgb(var(--rgb-white)/0.03)_1px,transparent_1px)] bg-[size:48px_48px] [mask-image:linear-gradient(to_bottom,black,transparent_85%)]"}),e.jsxs("div",{className:"relative flex flex-1 flex-col justify-between px-12 py-10",children:[e.jsx(n,{className:"h-8 w-auto self-start object-contain"}),e.jsxs("div",{className:"max-w-md",children:[e.jsxs("h2",{className:"text-4xl font-semibold leading-tight tracking-tight",children:["Your device lab,",e.jsx("br",{}),e.jsx("span",{className:"text-[var(--color-accent)]",children:"under control."})]}),e.jsx("p",{className:"mt-4 text-sm leading-relaxed text-[var(--text-muted)]",children:"Appium orchestration for the devices you own — with self-healing tests, live streaming and recordable proof of what ran."}),e.jsx("ul",{className:"mt-10 space-y-6",children:x.map(({icon:a,title:r,body:s})=>e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg border border-[var(--accent-border)] bg-[var(--accent-subtle)]",children:e.jsx(a,{className:"h-4 w-4 text-[var(--color-accent)]","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--text)]",children:r}),e.jsx("div",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:s})]})]},r))})]}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-[rgb(var(--rgb-fg)/0.06)] pt-5 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Xenon v","2.6.0"," · Self-hosted device lab"]}),e.jsx("a",{href:"/xenon/api-docs",target:"_blank",rel:"noreferrer",className:"text-[var(--text-muted)] underline-offset-4 hover:text-[var(--text)] hover:underline",children:"API docs"})]})]})]}),e.jsx("main",{className:"flex items-center justify-center px-6 py-10",children:e.jsx("div",{className:"w-full max-w-[400px] rounded-xl border border-[var(--border)] bg-[var(--surface)] px-8 py-9 shadow-[var(--shadow-lg)]",children:t})})]})}export{b as A};
6
+ */const d=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],c=i("monitor-smartphone",d),x=[{icon:o,title:"Self-healing selectors",body:"Broken locators recover through six escalating tiers before a test fails."},{icon:c,title:"Live Android & iOS devices",body:"Watch, drive and record real devices from the browser."},{icon:l,title:"Hub–node scaling",body:"One hub orchestrates device labs across machines."}];function b({children:t}){return e.jsxs("div",{className:"grid min-h-screen w-full grid-cols-1 bg-[var(--bg)] text-[var(--text)] md:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("aside",{className:"relative hidden overflow-hidden border-r border-[rgb(var(--rgb-fg)/0.06)] bg-[var(--surface-sunken)] md:flex md:flex-col",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_90%_60%_at_0%_0%,rgb(var(--rgb-accent)/0.14),transparent_60%)]"}),e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[linear-gradient(to_right,rgb(var(--rgb-white)/0.03)_1px,transparent_1px),linear-gradient(to_bottom,rgb(var(--rgb-white)/0.03)_1px,transparent_1px)] bg-[size:48px_48px] [mask-image:linear-gradient(to_bottom,black,transparent_85%)]"}),e.jsxs("div",{className:"relative flex flex-1 flex-col justify-between px-12 py-10",children:[e.jsx(n,{className:"h-8 w-auto self-start object-contain"}),e.jsxs("div",{className:"max-w-md",children:[e.jsxs("h2",{className:"text-4xl font-semibold leading-tight tracking-tight",children:["Your device lab,",e.jsx("br",{}),e.jsx("span",{className:"text-[var(--color-accent)]",children:"under control."})]}),e.jsx("p",{className:"mt-4 text-sm leading-relaxed text-[var(--text-muted)]",children:"Appium orchestration for the devices you own — with self-healing tests, live streaming and recordable proof of what ran."}),e.jsx("ul",{className:"mt-10 space-y-6",children:x.map(({icon:a,title:r,body:s})=>e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg border border-[var(--accent-border)] bg-[var(--accent-subtle)]",children:e.jsx(a,{className:"h-4 w-4 text-[var(--color-accent)]","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--text)]",children:r}),e.jsx("div",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:s})]})]},r))})]}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-[rgb(var(--rgb-fg)/0.06)] pt-5 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Xenon v","2.6.2"," · Self-hosted device lab"]}),e.jsx("a",{href:"/xenon/api-docs",target:"_blank",rel:"noreferrer",className:"text-[var(--text-muted)] underline-offset-4 hover:text-[var(--text)] hover:underline",children:"API docs"})]})]})]}),e.jsx("main",{className:"flex items-center justify-center px-6 py-10",children:e.jsx("div",{className:"w-full max-w-[400px] rounded-xl border border-[var(--border)] bg-[var(--surface)] px-8 py-9 shadow-[var(--shadow-lg)]",children:t})})]})}export{b as A};
@@ -0,0 +1,11 @@
1
+ import{c as ee,r as h,p as te,X,j as e,z as q,R as _,f as se,T as ae,q as re,u as ne,i as le,t as oe,M as ie}from"./index-B1iJx0w1.js";import{s as ce,b as I,P as de,T as B,i as ue,f as V,a as xe,c as me,d as pe,p as he,e as fe,r as ve,C as be,g as ge,h as je,j as O,k as Ne,l as W,S as w,m as ye,n as we,u as Se,o as Ce,q as $e}from"./stat-tile-CxsAGcDU.js";import{I as J}from"./input-B83lhHJ_.js";import{L as ke}from"./layers-CxMkF86z.js";import{B as F}from"./button-CB1ehl9z.js";import{D as Te}from"./download-Di_q2qj5.js";import{s as Ee}from"./labels-C21SA4JG.js";import{C as Re}from"./circle-x-DuFD0enL.js";import{C as Me}from"./circle-check-BgkLodxU.js";import{C as Be}from"./chevron-right-tbezHlhW.js";import{T as Ie}from"./tablet-_Uwg1m0t.js";import{M as Le}from"./monitor-ClL-76V7.js";import{P as _e}from"./page-header-D9FkEgQm.js";import{S as De}from"./select-Wc_B9XUe.js";import{E as U}from"./EmptyState-D5BTZSIa.js";import{L as Oe}from"./list-checks-2GnUUcTR.js";import"./time-B8FIgwPE.js";import"./utils-CDN07tui.js";/**
2
+ * @license lucide-react v0.555.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ae=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Pe=ee("clipboard-list",Ae),Fe=15e3;function Ue(t,a){const[s,r]=h.useState(null),x=h.useRef(!0),l=h.useRef(0),{on:d}=te(),u=h.useCallback(async()=>{const i=++l.current;try{const m=await X.getSessionSummary(a?{buildId:a}:{since:ce(t,Date.now())});x.current&&i===l.current&&m&&m.current&&r(m)}catch{}},[t,a]);return h.useEffect(()=>{x.current=!0,r(null),u();const i=setInterval(u,Fe);return()=>{x.current=!1,clearInterval(i)}},[u]),h.useEffect(()=>{const i=[d("session_started",u),d("session_stopped",u)];return()=>{for(const m of i)m()}},[d,u]),s}const z=(t,a)=>`${t} ${a}${t===1?"":"s"}`,ze=({build:t})=>{const{passedCount:a,failedCount:s,runningCount:r,sessionCount:x}=t,l=Math.max(0,x-a-s-r);if(x===0)return null;const d=[a>0&&`${a} passed`,s>0&&`${s} failed`,r>0&&`${r} running`,l>0&&`${l} without a verdict`].filter(Boolean);return e.jsxs("div",{role:"img","aria-label":d.join(", "),title:d.join(", "),className:"mt-2 flex h-1 w-full gap-px overflow-hidden rounded-full bg-[rgb(var(--rgb-fg)/0.08)]",children:[a>0&&e.jsx("span",{className:"bg-[var(--color-success)]",style:{flexGrow:a}}),s>0&&e.jsx("span",{className:"bg-[var(--color-danger)]",style:{flexGrow:s}}),r>0&&e.jsx("span",{className:"bg-[var(--color-warning)]",style:{flexGrow:r}}),l>0&&e.jsx("span",{style:{flexGrow:l}})]})},H=({active:t,onClick:a,children:s})=>e.jsxs("button",{type:"button",onClick:a,"aria-current":t?"true":void 0,className:`w-full text-left relative px-4 py-2.5 transition-colors ${t?"bg-[var(--surface-2)]":"hover:bg-[rgb(var(--rgb-fg)/0.04)]"}`,children:[t&&e.jsx("span",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r bg-[var(--color-accent)]"}),s]}),He=({builds:t,selectedBuildId:a,onSelect:s,timeFilter:r})=>{const[x,l]=h.useState(""),d=x.trim().toLowerCase(),u=Date.now(),i=t.filter(c=>{if(d&&!`${I(c)} ${c.name??""} ${c.id}`.toLowerCase().includes(d))return!1;if(r!=="all"){const n=Date.parse(String(c.createdAt));if(!Number.isFinite(n)||u-n>de[r])return!1}return!0}),m=d?"No builds match.":r!=="all"?`No builds in the ${B[r].toLowerCase()}.`:"No builds yet. They appear here after your first test run.";return e.jsxs("aside",{className:"w-[280px] shrink-0 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col min-h-0",children:[e.jsx("div",{className:"p-3 border-b border-[var(--border)]",children:e.jsxs("div",{className:"relative",children:[e.jsx(q,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--text-dim)]"}),e.jsx(J,{type:"text",value:x,onChange:c=>l(c.target.value),placeholder:"Find builds…","aria-label":"Find builds",className:"w-full h-8 pl-8 pr-2 text-xs"})]})}),e.jsxs("div",{role:"group","aria-label":"Builds",className:"flex-1 overflow-y-auto py-1",children:[e.jsxs(H,{active:a===null,onClick:()=>s(null),children:[e.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-medium text-[var(--text)]",children:[e.jsx(ke,{className:"h-3.5 w-3.5 text-[var(--text-dim)]","aria-hidden":"true"}),"All sessions"]}),e.jsxs("div",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:[B[r],", every build"]})]}),e.jsx("div",{className:"px-4 pt-3 pb-1 text-[11px] font-medium text-[var(--text-dim)]",children:"Builds"}),i.length===0&&e.jsx("div",{className:"px-4 py-6 text-xs text-[var(--text-dim)]",children:m}),i.map(c=>{const n=ue(c),j=n?z(c.sessionCount,"session"):`${V(c.createdAt)} · ${z(c.sessionCount,"session")}`;return e.jsxs(H,{active:c.id===a,onClick:()=>s(c.id),children:[e.jsx("div",{className:`text-[13px] font-medium truncate ${n?"text-[var(--text-muted)]":"text-[var(--text)]"}`,title:c.name||void 0,children:I(c)}),e.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] tabular-nums",children:j}),e.jsx(ze,{build:c})]},c.id)})]})]})},Ge={neutral:"bg-[var(--text-dim)]",green:"bg-[var(--color-success)]",red:"bg-[var(--red)]",amber:"bg-[var(--amber)]",blue:"bg-[var(--blue)]"},L=({label:t,count:a,active:s,onClick:r,tone:x="neutral",bullet:l=!0})=>e.jsxs("button",{type:"button",onClick:r,"aria-pressed":s,className:`inline-flex items-center gap-2 h-8 px-3 rounded-md border text-[11px] font-semibold transition-colors cursor-pointer ${s?"bg-[var(--surface-2)] border-[var(--border-strong)] text-[var(--text)]":"bg-transparent border-transparent text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--surface-2)]/50"}`,children:[l&&x!=="neutral"&&e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Ge[x]}`}),e.jsx("span",{children:t}),typeof a=="number"&&e.jsx("span",{className:"font-mono text-[10px] text-[var(--text-dim)]",children:a})]}),Xe=({sessions:t,active:a,onChange:s,search:r,onSearchChange:x,totalMatching:l,totalUnfiltered:d,capped:u=!1})=>{const i=xe(t);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-[var(--border)] bg-[var(--surface)]",children:[e.jsxs("div",{role:"group","aria-label":"Status",className:"flex items-center gap-1.5",children:[e.jsx(L,{label:"All",count:i.all,active:a==="all",onClick:()=>s("all"),tone:"neutral",bullet:!1}),e.jsx(L,{label:"Passed",count:i.passed,active:a==="passed",onClick:()=>s("passed"),tone:"green"}),e.jsx(L,{label:"Failed",count:i.failed,active:a==="failed",onClick:()=>s("failed"),tone:"red"}),e.jsx(L,{label:"Running",count:i.running,active:a==="running",onClick:()=>s("running"),tone:"amber"})]}),e.jsxs("span",{className:"ml-auto text-[11px] text-[var(--text-dim)] tabular-nums whitespace-nowrap",children:[l," of ",d," sessions",u?" (the newest)":""]}),e.jsxs("div",{className:"relative w-64 shrink-0",children:[e.jsx(q,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--text-dim)]"}),e.jsx(J,{type:"text",value:r,onChange:m=>x(m.target.value),placeholder:"Search tests, devices, people…","aria-label":"Search sessions",className:"w-full h-8 pl-8 pr-2 text-xs"})]})]})};function qe(t){return(t.split("-")[0]||t).slice(0,8).toUpperCase()}const Ve=({build:t,failedToCopy:a,onCopyFailed:s,onExport:r})=>{const[x,l]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{const i=m=>{d.current&&!d.current.contains(m.target)&&l(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);const u=a>0?`Copy the ${a} failed test${a===1?"":"s"}, with why each failed, for a re-run or a ticket`:"No failed tests to copy";return e.jsxs("header",{className:"flex items-start justify-between gap-4 px-4 py-3 border-b border-[var(--border)] bg-[var(--surface)]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--text-dim)]",children:[e.jsx("span",{children:"Build"}),e.jsxs("span",{className:"font-mono text-[var(--color-accent)]",title:t.id,children:["#",qe(t.id)]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{className:"tabular-nums",children:["Started ",V(t.createdAt)]})]}),e.jsx("h2",{className:"mt-0.5 text-sm font-semibold text-[var(--text)]",children:I(t)})]}),e.jsxs("div",{className:"flex items-center gap-2",ref:d,children:[e.jsxs(F,{type:"button",variant:"secondary",size:"sm",onClick:s,disabled:a===0,title:u,className:"gap-1.5",children:[e.jsx(Pe,{className:"h-3.5 w-3.5"}),"Copy failed tests"]}),e.jsxs("div",{className:"relative",children:[e.jsxs(F,{type:"button",variant:"secondary",size:"sm",onClick:()=>l(i=>!i),className:"gap-1.5",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),"Export"]}),x&&e.jsxs("div",{className:"absolute top-full right-0 mt-1 w-40 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden z-20",children:[e.jsx("button",{type:"button",onClick:()=>{l(!1),r("json")},className:"w-full text-left px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--surface-2)]",children:"Export as JSON"}),e.jsx("button",{type:"button",onClick:()=>{l(!1),r("csv")},className:"w-full text-left px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--surface-2)]",children:"Export as CSV"})]})]})]})]})};function We({platform:t}){const a=(t||"").toLowerCase(),s="h-3.5 w-3.5 shrink-0 text-[var(--text-dim)]";return a.includes("tv")?e.jsx(ae,{className:s}):a.includes("pad")||a.includes("tablet")?e.jsx(Ie,{className:s}):a.includes("android")||a.includes("ios")?e.jsx(re,{className:s}):e.jsx(Le,{className:s})}const Je={passed:{label:"Passed",Icon:Me,cls:"text-[var(--color-success)]"},failed:{label:"Failed",Icon:Re,cls:"text-[var(--color-danger)]"},running:{label:"Running",Icon:se,cls:"text-[var(--color-warning)]"},other:{Icon:be,cls:"text-[var(--text-dim)]"}},Ke="Unnamed session. Set xe:options.name in its capabilities to name it.",Qe=({session:t,buildName:a,showBuild:s,showSelection:r,selected:x,onToggleSelect:l,onOpen:d})=>{var N,C,$;const u=me(t.status),i=Je[u],m=u==="failed",c=pe(t),n=m?(N=t.failure_reason)==null?void 0:N.trim():"",j=[he(t),t.device_version].filter(f=>f&&f!=="—").join(" "),S=[fe(t),j].filter(Boolean).join(" · "),v=[ve(t.ranOn),(C=t.owner)==null?void 0:C.name].filter(Boolean).join(" · "),p=m?"shadow-[inset_3px_0_0_var(--color-danger)]":"";return e.jsxs("tr",{onClick:d,tabIndex:0,onKeyDown:f=>{f.target!==f.currentTarget||f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),d())},"data-outcome":u,className:`group border-b border-[var(--border)] cursor-pointer transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-focus-ring)] ${m?"bg-[rgb(var(--rgb-red)/0.04)] hover:bg-[rgb(var(--rgb-red)/0.08)]":"hover:bg-[var(--surface-2)]"}`,children:[r&&e.jsx("td",{className:`pl-4 pr-2 py-3 align-top ${p}`,onClick:f=>f.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:x,onChange:l,"aria-label":`Select session ${c.text}`})}),e.jsx("td",{className:`px-4 py-3 align-top ${r?"":p}`,children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium ${i.cls}`,children:[e.jsx(i.Icon,{className:`h-3.5 w-3.5 shrink-0 ${u==="running"?"animate-spin":""}`,"aria-hidden":"true"}),i.label??Ee(t.status||"unknown")]})}),e.jsxs("td",{className:"px-3 py-3 align-top min-w-0",children:[e.jsx("div",{className:`text-[13px] font-medium truncate ${c.source==="name"?"text-[var(--text)]":"text-[var(--text-muted)]"}`,title:c.source==="name"?c.text:`${c.text}
7
+ ${Ke}`,children:c.text}),n?e.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--color-danger)] truncate",title:n,children:n}):s&&a&&e.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] truncate",title:a,children:a})]}),e.jsxs("td",{className:"px-3 py-3 align-top min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[13px] text-[var(--text)] min-w-0",children:[e.jsx(We,{platform:t.device_platform}),e.jsx("span",{className:"truncate",title:t.device_udid,children:S})]}),v&&e.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] truncate",title:[t.ranOn==="here"?null:`Node ${t.node_id}`,($=t.owner)==null?void 0:$.email].filter(Boolean).join(`
8
+ `),children:v})]}),e.jsx("td",{className:"px-3 py-3 align-top text-xs text-[var(--text-muted)] tabular-nums whitespace-nowrap",title:je(t.startTime),children:ge(t.startTime)}),e.jsx("td",{className:"px-3 py-3 align-top text-xs text-[var(--text)] tabular-nums whitespace-nowrap text-right",children:O(Ne(t))}),e.jsx("td",{className:"pr-4 pl-1 py-3 align-top text-right",children:e.jsx(Be,{className:"inline h-4 w-4 text-[var(--text-dim)] group-hover:text-[var(--text)]","aria-hidden":"true"})})]})},M="px-3 py-2 text-[11px] font-medium text-[var(--text-dim)]",G=({sessions:t,statusFilter:a,searchQuery:s,buildNames:r,showBuild:x,showSelection:l,selectedIds:d,onToggleSelect:u,onToggleSelectAll:i,onOpenRow:m,empty:c})=>{const n=h.useMemo(()=>W(t,a,s),[t,a,s]);if(t.length===0)return e.jsx(e.Fragment,{children:c});if(n.length===0)return e.jsx("div",{className:"px-6 py-12 text-center text-xs text-[var(--text-dim)]",children:"No sessions match the current filters."});const j=n.every(p=>d.has(p.id)),S=n.some(p=>d.has(p.id)),v=n.some(p=>{var N;return!((N=p.name)!=null&&N.trim())});return e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsxs("table",{className:"w-full text-left table-fixed",children:[e.jsx("thead",{className:"sticky top-0 bg-[var(--surface)] border-b border-[var(--border)] z-10",children:e.jsxs("tr",{children:[l&&e.jsx("th",{className:"pl-4 pr-2 py-2 w-[44px]",children:e.jsx("input",{type:"checkbox","aria-label":"Select all shown",checked:j,ref:p=>{p&&(p.indeterminate=S&&!j)},onChange:()=>i(n.map(p=>p.id))})}),e.jsx("th",{className:`${M} pl-4 w-[112px]`,children:"Status"}),e.jsx("th",{className:M,children:"Test"}),e.jsx("th",{className:`${M} w-[240px]`,children:"Device"}),e.jsx("th",{className:`${M} w-[124px]`,children:"Started"}),e.jsx("th",{className:`${M} w-[84px] text-right`,children:"Duration"}),e.jsx("th",{className:"w-[40px]",children:e.jsx("span",{className:"sr-only",children:"Open"})})]})}),e.jsx("tbody",{children:n.map(p=>e.jsx(Qe,{session:p,buildName:p.build_id?r.get(p.build_id):null,showBuild:x,showSelection:l,selected:d.has(p.id),onToggleSelect:()=>u(p.id),onOpen:()=>m(p)},p.id))})]}),v&&e.jsxs("p",{className:"px-4 py-3 text-[11px] text-[var(--text-dim)]",children:["Unnamed sessions show their app. Name a test with"," ",e.jsx("code",{className:"font-mono text-[var(--text-muted)]",children:"xe:options.name"})," and a run with"," ",e.jsx("code",{className:"font-mono text-[var(--text-muted)]",children:"xe:options.build"})," in its capabilities."]})]})};function Ye(t,a){const s=Math.round(t);return s===0?{text:`No change vs prior ${a}`,tone:"neutral"}:s>0?{text:`+${s} pts vs prior ${a}`,tone:"good"}:{text:`−${-s} pts vs prior ${a}`,tone:"bad"}}const Ze=({summary:t,periodLabel:a})=>{if(!t)return e.jsxs("div",{className:"grid grid-cols-4 gap-3 px-6 py-3 border-b border-[var(--border)]",children:[e.jsx(w,{label:"Pass rate",value:"—"}),e.jsx(w,{label:"Failed",value:"—"}),e.jsx(w,{label:"Running now",value:"—"}),e.jsx(w,{label:"Median duration",value:"—"})]});const{current:s,previous:r,runningNow:x}=t,l=ye(s),d=s.passed+s.failed,u=a?we(s,r):null,i=u!==null?Ye(u,a):d>0?{text:`${s.passed} of ${d} passed`,tone:"neutral"}:{text:"No finished sessions",tone:"neutral"};return e.jsxs("div",{className:"grid grid-cols-4 gap-3 px-6 py-3 border-b border-[var(--border)]",children:[e.jsx(w,{label:"Pass rate",value:l===null?"—":`${Math.round(l)}%`,note:i.text,noteTone:i.tone}),e.jsx(w,{label:"Failed",value:s.failed,valueCls:s.failed>0?"text-[var(--color-danger)]":"text-[var(--text)]",note:`of ${s.total} session${s.total===1?"":"s"}`}),e.jsx(w,{label:"Running now",value:x.sessions,note:x.sessions>0?`on ${x.devices} device${x.devices===1?"":"s"}`:"Nothing running"}),e.jsx(w,{label:"Median duration",value:O(s.medianMs),note:s.p90Ms===null?"No finished sessions":`p90 ${O(s.p90Ms)}`})]})},et={"24h":"24 hours","7d":"7 days","30d":"30 days"},tt=`"xe:options": {
9
+ "name": "Checkout happy path",
10
+ "build": "Nightly smoke"
11
+ }`,st=()=>e.jsxs("div",{className:"text-xs text-[var(--text-muted)]",children:[e.jsx("p",{children:"Name each test, and group a run, in its capabilities:"}),e.jsx("pre",{className:"mt-2 inline-block rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-left font-mono text-[11px] text-[var(--text)]",children:tt})]}),Nt=()=>{const t=ne(),{buildId:a}=le(),{toast:s}=oe(),[r,x]=h.useState("7d"),[l,d]=h.useState("all"),[u,i]=h.useState(""),[m,c]=h.useState(new Set),n=Se({withSessions:!0,timeFilter:r}),j=Ue(r,n.selectedBuildId),{selectBuild:S,selectedBuildId:v}=n;_.useEffect(()=>{const o=a??null;o!==v&&(S(o),c(new Set))},[a,v,S]);const p=o=>t(o?`/builds/${o}`:"/builds"),N=o=>t(`/builds/${encodeURIComponent(o.build_id||"none")}/sessions/${o.id}`),C=h.useCallback(o=>{c(b=>{const g=new Set(b);return g.has(o)?g.delete(o):g.add(o),g})},[]),$=h.useCallback(o=>{c(b=>{const g=o.length>0&&o.every(y=>b.has(y)),E=new Set(b);return g?o.forEach(y=>E.delete(y)):o.forEach(y=>E.add(y)),E})},[]),f=h.useMemo(()=>new Map(n.builds.map(o=>[o.id,I(o)])),[n.builds]),k=n.builds.find(o=>o.id===v)||null,T=Ce(k?I(k):"this build",n.sessions,m),K=async()=>{if(T.count!==0)try{await navigator.clipboard.writeText(T.text),s(`Copied ${T.count} failed test${T.count===1?"":"s"}`,"success")}catch{s("Clipboard unavailable","error")}},Q=async o=>{if(v)try{const b=m.size>0?Array.from(m):void 0,{blob:g,filename:E}=await X.exportBuild(v,o,b),y=URL.createObjectURL(g),R=document.createElement("a");R.href=y,R.download=E,document.body.appendChild(R),R.click(),document.body.removeChild(R),URL.revokeObjectURL(y);const P=b?b.length:"all";s(`Exported ${P} session${P===1?"":"s"} as ${o.toUpperCase()}.`,"success")}catch(b){const g=b instanceof Error?b.message:String(b);s(`Export failed: ${g}`,"error")}},D=v===null,Y=D&&r!=="all"?et[r]:null,Z=!D&&!k&&!n.loading,A=e.jsx(Xe,{sessions:n.sessions,active:l,onChange:d,search:u,onSearchChange:i,totalMatching:W(n.sessions,l,u).length,totalUnfiltered:n.sessions.length,capped:n.sessions.length>=$e});return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(_e,{icon:ie,title:"Sessions",subtitle:"Every test session, newest first, with its build, device and outcome.",action:e.jsx(De,{value:r,onChange:o=>x(o.target.value),selectSize:"sm","aria-label":"Period",className:"w-40 text-xs",children:Object.keys(B).map(o=>e.jsx("option",{value:o,children:B[o]},o))})}),e.jsx(Ze,{summary:j,periodLabel:Y}),e.jsxs("div",{className:"flex flex-1 min-h-0",children:[e.jsx(He,{builds:n.builds,selectedBuildId:v,onSelect:p,timeFilter:r}),e.jsx("section",{className:"flex-1 flex flex-col min-w-0",children:Z?e.jsx(U,{title:"This build isn’t available",description:"It may have been removed, or belong to a team you’re not on."}):D?e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"sr-only",children:"All sessions"}),A,e.jsx(G,{sessions:n.sessions,statusFilter:l,searchQuery:u,buildNames:f,showBuild:!0,showSelection:!1,selectedIds:m,onToggleSelect:C,onToggleSelectAll:$,onOpenRow:N,empty:n.loading?null:e.jsx("div",{className:"px-6 py-6",children:e.jsx(U,{icon:e.jsx(Oe,{className:"h-5 w-5"}),title:r==="all"?"No sessions yet":`No sessions in the ${B[r].toLowerCase()}`,description:"Sessions appear here as your tests run.",action:e.jsx(st,{})})})})]}):k?e.jsxs(e.Fragment,{children:[e.jsx(Ve,{build:k,failedToCopy:T.count,onCopyFailed:K,onExport:Q}),A,e.jsx(G,{sessions:n.sessions,statusFilter:l,searchQuery:u,buildNames:f,showBuild:!1,showSelection:!0,selectedIds:m,onToggleSelect:C,onToggleSelectAll:$,onOpenRow:N,empty:e.jsx("div",{className:"px-6 py-12 text-center text-xs text-[var(--text-dim)]",children:"No sessions in this build yet. Trigger one from your test runner."})})]}):null})]})]})};export{Nt as BuildsPage,Nt as default};
@@ -1 +1 @@
1
- import{r as x,j as z}from"./index-tW_VASh2.js";import{a as j,c as g}from"./utils-CDN07tui.js";const v=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,b=j,k=(a,e)=>t=>{var l;if((e==null?void 0:e.variants)==null)return b(a,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:d,defaultVariants:r}=e,y=Object.keys(d).map(n=>{const s=t==null?void 0:t[n],o=r==null?void 0:r[n];if(s===null)return null;const i=v(s)||v(o);return d[n][i]}),c=t&&Object.entries(t).reduce((n,s)=>{let[o,i]=s;return i===void 0||(n[o]=i),n},{}),f=e==null||(l=e.compoundVariants)===null||l===void 0?void 0:l.reduce((n,s)=>{let{class:o,className:i,...V}=s;return Object.entries(V).every(N=>{let[m,u]=N;return Array.isArray(u)?u.includes({...r,...c}[m]):{...r,...c}[m]===u})?[...n,o,i]:n},[]);return b(a,y,f,t==null?void 0:t.class,t==null?void 0:t.className)},C=k("btn-base",{variants:{variant:{default:"btn-primary",primary:"btn-primary",secondary:"btn-secondary",outline:"btn-secondary",ghost:"btn-ghost",tonal:"btn-tonal",link:"btn-link",destructive:"btn-danger",danger:"btn-danger"},size:{default:"btn-size-md",md:"btn-size-md",sm:"btn-size-sm",lg:"btn-size-lg",icon:"btn-size-icon"}},defaultVariants:{variant:"primary",size:"md"}}),O=x.forwardRef(({className:a,variant:e,size:t,...l},d)=>z.jsx("button",{className:g(C({variant:e,size:t,className:a})),ref:d,...l}));O.displayName="Button";export{O as B,k as c};
1
+ import{r as x,j as z}from"./index-B1iJx0w1.js";import{a as j,c as g}from"./utils-CDN07tui.js";const v=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,b=j,k=(a,e)=>t=>{var l;if((e==null?void 0:e.variants)==null)return b(a,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:d,defaultVariants:r}=e,y=Object.keys(d).map(n=>{const s=t==null?void 0:t[n],o=r==null?void 0:r[n];if(s===null)return null;const i=v(s)||v(o);return d[n][i]}),c=t&&Object.entries(t).reduce((n,s)=>{let[o,i]=s;return i===void 0||(n[o]=i),n},{}),f=e==null||(l=e.compoundVariants)===null||l===void 0?void 0:l.reduce((n,s)=>{let{class:o,className:i,...V}=s;return Object.entries(V).every(N=>{let[m,u]=N;return Array.isArray(u)?u.includes({...r,...c}[m]):{...r,...c}[m]===u})?[...n,o,i]:n},[]);return b(a,y,f,t==null?void 0:t.class,t==null?void 0:t.className)},C=k("btn-base",{variants:{variant:{default:"btn-primary",primary:"btn-primary",secondary:"btn-secondary",outline:"btn-secondary",ghost:"btn-ghost",tonal:"btn-tonal",link:"btn-link",destructive:"btn-danger",danger:"btn-danger"},size:{default:"btn-size-md",md:"btn-size-md",sm:"btn-size-sm",lg:"btn-size-lg",icon:"btn-size-icon"}},defaultVariants:{variant:"primary",size:"md"}}),O=x.forwardRef(({className:a,variant:e,size:t,...l},d)=>z.jsx("button",{className:g(C({variant:e,size:t,className:a})),ref:d,...l}));O.displayName="Button";export{O as B,k as c};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-tW_VASh2.js";/**
1
+ import{c as e}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-tW_VASh2.js";/**
1
+ import{c}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-tW_VASh2.js";/**
1
+ import{c as e}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-tW_VASh2.js";/**
1
+ import{c as o}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-tW_VASh2.js";/**
1
+ import{c}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-tW_VASh2.js";/**
1
+ import{c}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-tW_VASh2.js";/**
1
+ import{c}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-tW_VASh2.js";/**
1
+ import{c}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as U,j as e,r as c,C as Ms,U as Hn,X as M,t as Ve,v as sn,b as Wn,u as ht,a as Mt,T as qn,q as ns,R as Fe,w as Kn,x as _s,y as $e,z as ms,I as nn,S as Nt,f as ct,A as St,i as an,B as Xn,D as Gn,E as Yn,p as Zn}from"./index-tW_VASh2.js";import{P as Jn}from"./page-header-BYzd5kfp.js";import{P as Ct,S as Qn,B as ea}from"./BugReportButton-DY9ltq27.js";import{A as ta}from"./activity-Bmuu2fcZ.js";import{h as sa,S as rn,C as na,H as aa,a as Gt,A as ot,I as Yt}from"./keycodes-CyOBCkU6.js";import{p as _t}from"./labels-C21SA4JG.js";import{B as Y}from"./button-CbVMa9PL.js";import{S as hs}from"./select-DEpRzm_3.js";import{P as on,M as cn,a as pe,b as ia}from"./Menu-CdGgXICe.js";import{M as ps}from"./Modal-CtzTciQY.js";import{F as $t}from"./FieldGroup-Czk8gPhv.js";import{C as ra}from"./clock-0q-GqRU0.js";import{P as oa}from"./plus-BIekJsya.js";import{C as Te}from"./copy-Ds-F075f.js";import{T as ca}from"./tablet-DJBOerD6.js";import{S as la,a as zs}from"./SegmentedControl-DEXgl8Qw.js";import{T as da,a as ua,b as ln,c as At,d as ma,e as Oe}from"./Table-hmNY-ICS.js";import{f as ha}from"./time-B8FIgwPE.js";import{L as dn}from"./layers-ChEcsAc2.js";import{C as pa}from"./chevron-right-i93nTPHX.js";import{M as Ls}from"./mouse-pointer-2-BrwX4M5d.js";import{L as fa}from"./list-checks-EWcywAEC.js";import{Z as un}from"./zap-CBld_5xf.js";import{C as dt}from"./check-Du5vvLoJ.js";import{C as mn}from"./circle-check-DxYO7yp5.js";import{C as hn}from"./circle-x-Dw1DFg0I.js";import{D as ya}from"./download-BdJEWL8b.js";import{T as as}from"./trash-2-B_zQvjI3.js";import{U as xa,T as va}from"./upload-9FV8q3NB.js";import{A as ga}from"./arrow-left-D5x8OLs-.js";import{A as ba}from"./arrow-right-DRYGEjl5.js";import{C as Os}from"./chevron-left-CiRlzB7w.js";import{L as ja}from"./lock-DmkRlmQB.js";import{F as Ps}from"./FilterMenu-DTblXm4v.js";import"./utils-CDN07tui.js";import"./index-BpJwb7cQ.js";/**
1
+ import{c as U,j as e,r as c,C as Ms,U as Hn,X as M,t as Ve,v as sn,b as Wn,u as ht,a as Mt,T as qn,q as ns,R as Fe,w as Kn,x as _s,y as $e,z as ms,I as nn,S as Nt,f as ct,A as St,i as an,B as Xn,D as Gn,E as Yn,p as Zn}from"./index-B1iJx0w1.js";import{P as Jn}from"./page-header-D9FkEgQm.js";import{P as Ct,S as Qn,B as ea}from"./BugReportButton-CGeVEuQ-.js";import{A as ta}from"./activity-CdoCkXe1.js";import{h as sa,S as rn,C as na,H as aa,a as Gt,A as ot,I as Yt}from"./keycodes-BjiWgQik.js";import{p as _t}from"./labels-C21SA4JG.js";import{B as Y}from"./button-CB1ehl9z.js";import{S as hs}from"./select-Wc_B9XUe.js";import{P as on,M as cn,a as pe,b as ia}from"./Menu-DWl5uJ9E.js";import{M as ps}from"./Modal-BZEfRpq8.js";import{F as $t}from"./FieldGroup-CDBhSDsT.js";import{C as ra}from"./clock-C7AhkXMm.js";import{P as oa}from"./plus-DF-cFokG.js";import{C as Te}from"./copy-CiNhxJMO.js";import{T as ca}from"./tablet-_Uwg1m0t.js";import{S as la,a as zs}from"./SegmentedControl-D7BBuUDP.js";import{T as da,a as ua,b as ln,c as At,d as ma,e as Oe}from"./Table-BthtE6KF.js";import{f as ha}from"./time-B8FIgwPE.js";import{L as dn}from"./layers-CxMkF86z.js";import{C as pa}from"./chevron-right-tbezHlhW.js";import{M as Ls}from"./mouse-pointer-2-C815rsZl.js";import{L as fa}from"./list-checks-2GnUUcTR.js";import{Z as un}from"./zap-iAfVTWG0.js";import{C as dt}from"./check-Bq0QWhtG.js";import{C as mn}from"./circle-check-BgkLodxU.js";import{C as hn}from"./circle-x-DuFD0enL.js";import{D as ya}from"./download-Di_q2qj5.js";import{T as as}from"./trash-2-BcWlaBK8.js";import{U as xa,T as va}from"./upload-47Lf5U7r.js";import{A as ga}from"./arrow-left-CpaUvzcV.js";import{A as ba}from"./arrow-right-TCqk2-9N.js";import{C as Os}from"./chevron-left-BMI8J11V.js";import{L as ja}from"./lock-BRKQ_6ix.js";import{F as Ps}from"./FilterMenu-7JEhwNEM.js";import"./utils-CDN07tui.js";import"./index-Bgx65Mb_.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-tW_VASh2.js";/**
1
+ import{c as o}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as t,j as e,e as m,g as b}from"./index-tW_VASh2.js";import{u as g}from"./use-password-reset-mode-Cx5GHMnk.js";import{A as c}from"./auth-shell-D_TLCi0Y.js";import"./network-8uySyPSM.js";function N(){const[s,d]=t.useState(""),[a,o]=t.useState(!1),[u,x]=t.useState(!1),[n,l]=t.useState(null),i=g();async function f(r){r.preventDefault(),o(!0),l(null);try{await b(s),x(!0)}catch(h){l(h.message||"Request failed")}finally{o(!1)}}return i!=="email"?e.jsxs(c,{children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),i==="admin"&&e.jsx("p",{className:"text-sm text-[var(--text-muted)] mb-6",children:"This Xenon server can't send email, so passwords are reset by an administrator. Ask a Xenon admin to send you a reset link from the Users page."}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(m,{to:"/login",className:"text-sm text-[var(--color-accent)] underline-offset-4 hover:underline",children:"Back to sign in"})})]}):e.jsx(c,{children:e.jsxs("form",{onSubmit:f,children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)] mb-6",children:"Enter your email and we'll send you a reset link if your account exists."}),u?e.jsx("div",{className:"text-sm text-[var(--text)] mb-6",children:"If your email is registered, you'll receive a reset link shortly. Check your spam folder if you don't see it within a minute."}):e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"forgot-email",className:"block text-sm font-medium text-[var(--text)] mb-1.5",children:"Email"}),e.jsx("input",{id:"forgot-email",type:"email",autoComplete:"username",value:s,onChange:r=>d(r.target.value),autoFocus:!0,required:!0,className:"w-full mb-4 h-10 px-3 rounded-lg bg-[var(--bg)] border border-[var(--border-strong)] text-sm text-[var(--text)] outline-none focus:border-[var(--color-accent)] focus:shadow-[0_0_0_3px_var(--accent-subtle)]"}),n&&e.jsx("div",{role:"alert",className:"text-sm text-[var(--red)] mb-3",children:n}),e.jsx("button",{type:"submit",disabled:a||!s,className:"mt-5 w-full h-10 rounded-md bg-[var(--color-accent)] text-[var(--color-on-accent)] font-medium text-sm disabled:opacity-50",children:a?"Sending…":"Send reset link"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(m,{to:"/login",className:"text-sm text-[var(--color-accent)] underline-offset-4 hover:underline",children:"Back to sign in"})})]})})}export{N as default};
1
+ import{r as t,j as e,e as m,g as b}from"./index-B1iJx0w1.js";import{u as g}from"./use-password-reset-mode-B3cWCSu5.js";import{A as c}from"./auth-shell-BSyFjCa8.js";import"./network-CBd_S-GU.js";function N(){const[s,d]=t.useState(""),[a,o]=t.useState(!1),[u,x]=t.useState(!1),[n,l]=t.useState(null),i=g();async function f(r){r.preventDefault(),o(!0),l(null);try{await b(s),x(!0)}catch(h){l(h.message||"Request failed")}finally{o(!1)}}return i!=="email"?e.jsxs(c,{children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),i==="admin"&&e.jsx("p",{className:"text-sm text-[var(--text-muted)] mb-6",children:"This Xenon server can't send email, so passwords are reset by an administrator. Ask a Xenon admin to send you a reset link from the Users page."}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(m,{to:"/login",className:"text-sm text-[var(--color-accent)] underline-offset-4 hover:underline",children:"Back to sign in"})})]}):e.jsx(c,{children:e.jsxs("form",{onSubmit:f,children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)] mb-6",children:"Enter your email and we'll send you a reset link if your account exists."}),u?e.jsx("div",{className:"text-sm text-[var(--text)] mb-6",children:"If your email is registered, you'll receive a reset link shortly. Check your spam folder if you don't see it within a minute."}):e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"forgot-email",className:"block text-sm font-medium text-[var(--text)] mb-1.5",children:"Email"}),e.jsx("input",{id:"forgot-email",type:"email",autoComplete:"username",value:s,onChange:r=>d(r.target.value),autoFocus:!0,required:!0,className:"w-full mb-4 h-10 px-3 rounded-lg bg-[var(--bg)] border border-[var(--border-strong)] text-sm text-[var(--text)] outline-none focus:border-[var(--color-accent)] focus:shadow-[0_0_0_3px_var(--accent-subtle)]"}),n&&e.jsx("div",{role:"alert",className:"text-sm text-[var(--red)] mb-3",children:n}),e.jsx("button",{type:"submit",disabled:a||!s,className:"mt-5 w-full h-10 rounded-md bg-[var(--color-accent)] text-[var(--color-on-accent)] font-medium text-sm disabled:opacity-50",children:a?"Sending…":"Send reset link"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(m,{to:"/login",className:"text-sm text-[var(--color-accent)] underline-offset-4 hover:underline",children:"Back to sign in"})})]})})}export{N as default};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-tW_VASh2.js";/**
1
+ import{c}from"./index-B1iJx0w1.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.