@huynle/hub 0.8.2 → 0.8.4

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 (68) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/README.md +31 -0
  3. package/package.json +1 -1
  4. package/packages/claude-code/package.json +1 -1
  5. package/packages/cli/dist/hub-cli.js +35 -7
  6. package/packages/cli/package.json +1 -1
  7. package/packages/codex/package.json +1 -1
  8. package/packages/node/package.json +1 -1
  9. package/packages/preset/package.json +1 -1
  10. package/packages/protocol/package.json +1 -1
  11. package/packages/protocol/src/index.ts +16 -3
  12. package/packages/protocol/src/voice-recording.ts +107 -0
  13. package/packages/runtime-openshell/package.json +1 -1
  14. package/packages/runtime-sdk/package.json +1 -1
  15. package/packages/sdk/package.json +1 -1
  16. package/packages/spoke-sdk/package.json +1 -1
  17. package/src/central/agent/routes.ts +7 -1
  18. package/src/central/artifacts/blob-store.ts +6 -1
  19. package/src/central/artifacts/blob-support.ts +3 -1
  20. package/src/central/concierge/board-render.ts +34 -11
  21. package/src/central/concierge/index.ts +1 -1
  22. package/src/central/concierge/notifier.ts +2 -1
  23. package/src/central/config.ts +4 -0
  24. package/src/central/csp.ts +55 -0
  25. package/src/central/http.ts +85 -9
  26. package/src/central/profiles/content.ts +16 -0
  27. package/src/central/recording/clock.ts +76 -0
  28. package/src/central/recording/concierge-taps.ts +104 -0
  29. package/src/central/recording/export.ts +215 -0
  30. package/src/central/recording/index.ts +658 -0
  31. package/src/central/recording/ingest.ts +209 -0
  32. package/src/central/recording/retention.ts +71 -0
  33. package/src/central/recording/routes.ts +281 -0
  34. package/src/central/recording/schema.ts +232 -0
  35. package/src/central/recording/settings.ts +35 -0
  36. package/src/central/recording/store.ts +316 -0
  37. package/src/central/recording/taps.ts +105 -0
  38. package/src/central/recording/zip.ts +138 -0
  39. package/src/central/registry.ts +161 -25
  40. package/src/central/spoke-ws.ts +2 -0
  41. package/src/index.ts +28 -0
  42. package/src/spoke/session-context.ts +28 -8
  43. package/src/spoke/spoke.ts +153 -10
  44. package/src/spoke/tracker.ts +6 -1
  45. package/src/status.ts +101 -19
  46. package/web/dist/assets/{ArtifactPage-R0ZTpHca.js → ArtifactPage-Cb1DcrQf.js} +1 -1
  47. package/web/dist/assets/{ArtifactPane-C9KrBna8.js → ArtifactPane-XTnwXl-Y.js} +1 -1
  48. package/web/dist/assets/{ArtifactWorkbench-sP2mZccC.js → ArtifactWorkbench-C37tZZ3e.js} +1 -1
  49. package/web/dist/assets/{Library-BXbJvTUS.js → Library-CZSSHvOJ.js} +2 -2
  50. package/web/dist/assets/ProfilesDestination-dZa3vioh.js +1 -0
  51. package/web/dist/assets/{TeamsPage-Dgxt8UI3.js → TeamsPage-DJt-Kk84.js} +1 -1
  52. package/web/dist/assets/Watchtower-BXaUaXO1.js +2 -0
  53. package/web/dist/assets/index-DVSkeAvn.css +1 -0
  54. package/web/dist/assets/index-DifgVuKS.js +34 -0
  55. package/web/dist/assets/{live-OgQWPrSY.js → live-D-RZbeUi.js} +1 -1
  56. package/web/dist/assets/{pane-layout-DWXfDU-1.js → pane-layout-Csk-vPNe.js} +1 -1
  57. package/web/dist/assets/{renderer2d-DjEipyto.js → renderer2d-DILxLFEq.js} +1 -1
  58. package/web/dist/assets/renderer3d-Co5yCKMg.css +1 -0
  59. package/web/dist/assets/{renderer3d-B648jKGO.js → renderer3d-PvN9Qbt2.js} +4 -56
  60. package/web/dist/assets/{safe-area-CNLyboIj.js → safe-area-BS6ii3M7.js} +1 -1
  61. package/web/dist/assets/{source-CDU04kYw.js → source-BFLJQ43_.js} +1 -1
  62. package/web/dist/assets/{ui-Dh1-78Cl.js → ui-Qo2Pd9-O.js} +1 -1
  63. package/web/dist/index.html +5 -16
  64. package/web/dist/theme-boot.js +12 -0
  65. package/web/dist/assets/ProfilesDestination-D7XyLTJ7.js +0 -1
  66. package/web/dist/assets/Watchtower-DJHx6cWw.js +0 -2
  67. package/web/dist/assets/index-BabrNDB3.css +0 -1
  68. package/web/dist/assets/index-g4V9mfSr.js +0 -34
@@ -1 +1 @@
1
- import{E as e}from"./live-OgQWPrSY.js";var t=`watchtower.layout`,n=1e3,r=[`--accent`,`--blue`,`--violet`,`--orange`,`--ok`,`--warn`];function i(e,t=0){let n=110+26*Math.sqrt(Math.max(1,e))+7*Math.sqrt(Math.max(0,t)),r=Math.PI*(3-Math.sqrt(5));return Array.from({length:e},(t,i)=>{let a=e===1?0:1-i/(e-1)*2,o=Math.sqrt(1-a*a),s=i*r;return[l(Math.cos(s)*o*n),l(a*n*.55),l(Math.sin(s)*o*n)]})}function a(t){let n=new Set(t.nodes.map(e=>e.id)),a=i(t.groups.length,t.groups.reduce((e,t)=>e+t.sections.reduce((e,t)=>e+t.members.length,0),0));return t.groups.map((t,i)=>{let o=[];n.has(t.id)&&o.push(t.id);for(let e of t.sections)e.id!==void 0&&n.has(e.id)&&o.push(e.id),o.push(...e.members);let s=t.machine===void 0?r[i%r.length]:e[t.machine%e.length];return{id:t.id,label:t.label,color:s,center:a[i],members:o}})}function o(e){let t=new Map;for(let n of e.links)n.kind!==`structure`&&n.kind!==`policy`&&(t.set(n.source,(t.get(n.source)??0)+n.count),t.set(n.target,(t.get(n.target)??0)+n.count));return t}function s(e,t){let n=new Set,r=new Set(e.groups.map(e=>e.id));for(let t of e.nodes)(t.kind===`hub`||t.kind===`user`||t.kind===`app`||t.kind===`role`||r.has(t.id)||t.match)&&n.add(t.id);let i=o(e),a=e.nodes.filter(e=>!n.has(e.id)&&e.kind!==`role`);a.sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||(e.id<t.id?-1:+(e.id>t.id)));for(let e of a.slice(0,Math.max(0,t.max)))n.add(e.id);for(let e of t.extra??[])n.add(e);return n}var c=e=>e.kind===`role`&&e.vacant?`${e.label} · vacant`:e.label,l=e=>Math.round(e*10)/10,u=e=>typeof e==`number`&&Number.isFinite(e);function d(e){let t=new Map;if(!e)return t;let n;try{n=JSON.parse(e)}catch{return t}if(typeof n!=`object`||!n||Array.isArray(n))return t;let{v:r,p:i}=n;if(r!==1||typeof i!=`object`||!i||Array.isArray(i))return t;for(let[e,n]of Object.entries(i)){if(t.size>=1e3)break;if(!Array.isArray(n)||n.length!==3)continue;let[r,i,a]=n;u(r)&&u(i)&&u(a)&&t.set(e,[r,i,a])}return t}function f(e,t,r=n){let i={},a=0;for(let n of[e,t])for(let[e,t]of n){if(a>=r)break;e in i||!t.every(u)||(i[e]=[l(t[0]),l(t[1]),l(t[2])],a++)}return JSON.stringify({v:1,p:i})}function p(e,t){let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=(n>>>0)%1e3/1e3,i=(Math.imul(n,2654435761)>>>0)%1e3/1e3,a=r*Math.PI*2,o=i*2-1,s=Math.sqrt(1-o*o),c=t*(.6+.4*r);return[Math.cos(a)*s*c,o*c,Math.sin(a)*s*c]}function m(e,t){let n=new Map,r=new Set,i=new Map;for(let t of a(e))for(let e of t.members)i.set(e,t);let o=new Map,s=new Map;for(let t of e.links)t.kind===`structure`&&(o.get(t.target)??o.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.target)??s.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.source)??s.set(t.source,[]).get(t.source)).push(t.target);n.set(`hub`,[0,0,0]);for(let r of e.nodes){if(r.id===`hub`)continue;let e=t.get(r.id);e&&n.set(r.id,e)}let c=new Set(e.groups.map(e=>e.id)),u=[...e.nodes.filter(e=>c.has(e.id)),...e.nodes.filter(e=>!c.has(e.id))];for(let e of u){if(n.has(e.id))continue;r.add(e.id);let t=[...o.get(e.id)??[],...s.get(e.id)??[]].find(e=>e!==`hub`&&n.has(e)),a=i.get(e.id),c=t===void 0?a?.center:n.get(t),u=p(e.id,t===void 0?a?24:40:14),d=c??[0,0,0];n.set(e.id,[l(d[0]+u[0]),l(d[1]+u[1]),l(d[2]+u[2])])}return{positions:n,fresh:r}}function h(e,t){let n=new Map,r=[],i=e=>r.some(t=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h),a=[...e.filter(e=>e.pinned),...e.filter(e=>!e.pinned)];for(let e of a)for(let a of e.texts){let o=t(a,e),s={x:e.x-o/2,y:e.y,w:o,h:e.h};if(e.pinned||!i(s)){r.push(s),n.set(e.id,{text:a,box:s});break}}return n}var g=8,_=900;function v(e){let t={top:0,right:0,bottom:0,left:0},n=e.closest(`.wt-stage`);if(!n)return t;let r=e.getBoundingClientRect();if(!r.height)return t;let i=n.querySelector(`.wt-dock`)?.getBoundingClientRect(),a=n.querySelector(`.wt-chips`)?.getBoundingClientRect(),o=r.width>=_?n.querySelector(`.wt-pop-legend`)?.getBoundingClientRect():void 0,s=o&&o.width?Math.max(0,o.right-r.left+g):0,c=i&&i.height?Math.max(0,r.bottom-i.top+g):0,l=a&&a.height?Math.max(0,a.bottom-r.top+g):0;return{top:Math.min(l,r.height/3),right:0,bottom:Math.min(c,r.height/3),left:Math.min(s,r.width/3)}}export{c as a,a as c,s as i,m as l,t as n,d as o,o as r,h as s,v as t,f as u};
1
+ import{E as e}from"./live-D-RZbeUi.js";var t=`watchtower.layout`,n=1e3,r=[`--accent`,`--blue`,`--violet`,`--orange`,`--ok`,`--warn`];function i(e,t=0){let n=110+26*Math.sqrt(Math.max(1,e))+7*Math.sqrt(Math.max(0,t)),r=Math.PI*(3-Math.sqrt(5));return Array.from({length:e},(t,i)=>{let a=e===1?0:1-i/(e-1)*2,o=Math.sqrt(1-a*a),s=i*r;return[l(Math.cos(s)*o*n),l(a*n*.55),l(Math.sin(s)*o*n)]})}function a(t){let n=new Set(t.nodes.map(e=>e.id)),a=i(t.groups.length,t.groups.reduce((e,t)=>e+t.sections.reduce((e,t)=>e+t.members.length,0),0));return t.groups.map((t,i)=>{let o=[];n.has(t.id)&&o.push(t.id);for(let e of t.sections)e.id!==void 0&&n.has(e.id)&&o.push(e.id),o.push(...e.members);let s=t.machine===void 0?r[i%r.length]:e[t.machine%e.length];return{id:t.id,label:t.label,color:s,center:a[i],members:o}})}function o(e){let t=new Map;for(let n of e.links)n.kind!==`structure`&&n.kind!==`policy`&&(t.set(n.source,(t.get(n.source)??0)+n.count),t.set(n.target,(t.get(n.target)??0)+n.count));return t}function s(e,t){let n=new Set,r=new Set(e.groups.map(e=>e.id));for(let t of e.nodes)(t.kind===`hub`||t.kind===`user`||t.kind===`app`||t.kind===`role`||r.has(t.id)||t.match)&&n.add(t.id);let i=o(e),a=e.nodes.filter(e=>!n.has(e.id)&&e.kind!==`role`);a.sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||(e.id<t.id?-1:+(e.id>t.id)));for(let e of a.slice(0,Math.max(0,t.max)))n.add(e.id);for(let e of t.extra??[])n.add(e);return n}var c=e=>e.kind===`role`&&e.vacant?`${e.label} · vacant`:e.label,l=e=>Math.round(e*10)/10,u=e=>typeof e==`number`&&Number.isFinite(e);function d(e){let t=new Map;if(!e)return t;let n;try{n=JSON.parse(e)}catch{return t}if(typeof n!=`object`||!n||Array.isArray(n))return t;let{v:r,p:i}=n;if(r!==1||typeof i!=`object`||!i||Array.isArray(i))return t;for(let[e,n]of Object.entries(i)){if(t.size>=1e3)break;if(!Array.isArray(n)||n.length!==3)continue;let[r,i,a]=n;u(r)&&u(i)&&u(a)&&t.set(e,[r,i,a])}return t}function f(e,t,r=n){let i={},a=0;for(let n of[e,t])for(let[e,t]of n){if(a>=r)break;e in i||!t.every(u)||(i[e]=[l(t[0]),l(t[1]),l(t[2])],a++)}return JSON.stringify({v:1,p:i})}function p(e,t){let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=(n>>>0)%1e3/1e3,i=(Math.imul(n,2654435761)>>>0)%1e3/1e3,a=r*Math.PI*2,o=i*2-1,s=Math.sqrt(1-o*o),c=t*(.6+.4*r);return[Math.cos(a)*s*c,o*c,Math.sin(a)*s*c]}function m(e,t){let n=new Map,r=new Set,i=new Map;for(let t of a(e))for(let e of t.members)i.set(e,t);let o=new Map,s=new Map;for(let t of e.links)t.kind===`structure`&&(o.get(t.target)??o.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.target)??s.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.source)??s.set(t.source,[]).get(t.source)).push(t.target);n.set(`hub`,[0,0,0]);for(let r of e.nodes){if(r.id===`hub`)continue;let e=t.get(r.id);e&&n.set(r.id,e)}let c=new Set(e.groups.map(e=>e.id)),u=[...e.nodes.filter(e=>c.has(e.id)),...e.nodes.filter(e=>!c.has(e.id))];for(let e of u){if(n.has(e.id))continue;r.add(e.id);let t=[...o.get(e.id)??[],...s.get(e.id)??[]].find(e=>e!==`hub`&&n.has(e)),a=i.get(e.id),c=t===void 0?a?.center:n.get(t),u=p(e.id,t===void 0?a?24:40:14),d=c??[0,0,0];n.set(e.id,[l(d[0]+u[0]),l(d[1]+u[1]),l(d[2]+u[2])])}return{positions:n,fresh:r}}function h(e,t){let n=new Map,r=[],i=e=>r.some(t=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h),a=[...e.filter(e=>e.pinned),...e.filter(e=>!e.pinned)];for(let e of a)for(let a of e.texts){let o=t(a,e),s={x:e.x-o/2,y:e.y,w:o,h:e.h};if(e.pinned||!i(s)){r.push(s),n.set(e.id,{text:a,box:s});break}}return n}var g=8,_=900;function v(e){let t={top:0,right:0,bottom:0,left:0},n=e.closest(`.wt-stage`);if(!n)return t;let r=e.getBoundingClientRect();if(!r.height)return t;let i=n.querySelector(`.wt-dock`)?.getBoundingClientRect(),a=n.querySelector(`.wt-chips`)?.getBoundingClientRect(),o=r.width>=_?n.querySelector(`.wt-pop-legend`)?.getBoundingClientRect():void 0,s=o&&o.width?Math.max(0,o.right-r.left+g):0,c=i&&i.height?Math.max(0,r.bottom-i.top+g):0,l=a&&a.height?Math.max(0,a.bottom-r.top+g):0;return{top:Math.min(l,r.height/3),right:0,bottom:Math.min(c,r.height/3),left:Math.min(s,r.width/3)}}export{c as a,a as c,s as i,m as l,t as n,d as o,o as r,h as s,v as t,f as u};
@@ -1 +1 @@
1
- import{G as e,Q as t,it as n}from"./ui-Dh1-78Cl.js";var r={artifactsPerUser:5e3,revisionsPerArtifact:500,blobBytes:26214400,userBlobBytes:2147483648,bundleFiles:200,chunkBytes:1048576,aiJobsPerUser:8,aiJobsPerArtifact:2,aiInstructionChars:8e3},i=[`markdown`,`code`,`image`,`table`,`chart`,`dashboard`,`html`,`app`,`file`],a=[`html`,`app`],o=[`text/markdown`,`text/plain`,`text/csv`,`text/html`,`text/css`,`text/javascript`,`application/json`,`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`],s=e=>typeof e==`string`&&/^sha256:[0-9a-f]{64}$/.test(e);function c(e){if(!t(e))return`blob must be an object`;if(!s(e.hash))return`hash must be sha256:<64 hex>`;if(typeof e.bytes!=`number`||!Number.isSafeInteger(e.bytes)||e.bytes<0||e.bytes>r.blobBytes)return`bytes must be 0–${r.blobBytes}`;if(!o.includes(e.mediaType))return`mediaType is not allowed`;if(e.path!==void 0&&(typeof e.path!=`string`||!/^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[A-Za-z0-9._/-]{1,200}$/.test(e.path)))return`path must be a relative path without . or .. segments`}var l=`/api/agent/artifacts`,u={workspace:``,type:``},d=e=>typeof e==`string`&&i.includes(e);function f(t){let n=typeof t==`string`?new URLSearchParams(t):t,r=n.get(`workspace`)??``,i=n.get(`type`)??``;return{workspace:r===`none`||e(`workspace`,r)?r:``,type:d(i)?i:``}}function p(e){let t=new URLSearchParams;e.workspace&&t.set(`workspace`,e.workspace),e.type&&t.set(`type`,e.type);let n=t.toString();return n?`?${n}`:``}var m=e=>e.workspace&&e.workspace!==`none`?e.workspace:``;function h(e,t){let n=new URLSearchParams({state:`active`,limit:`50`}),r=m(e);return r&&n.set(`workspace`,r),t&&n.set(`cursor`,t),`${l}?${n}`}var g=e=>typeof e==`string`&&e.length>0;function _(e){if(!e||typeof e!=`object`)return;let t=e;if(g(t.id)&&typeof t.title==`string`&&d(t.kind)&&typeof t.updatedAt==`number`)return{id:t.id,title:t.title,kind:t.kind,visibility:t.visibility===`workspace`?`workspace`:`private`,...g(t.workspaceID)?{workspaceID:t.workspaceID}:{},...g(t.description)?{description:t.description}:{},updatedAt:t.updatedAt}}function v(e){let t=e&&typeof e==`object`?e:{};return{items:Array.isArray(t.items)?t.items.flatMap(e=>_(e)??[]):[],...g(t.cursor)?{cursor:t.cursor}:{}}}function y(e,t){return e.filter(e=>(t.type===``||e.kind===t.type)&&(t.workspace===``||(t.workspace===`none`?!e.workspaceID:e.workspaceID===t.workspace)))}function b(e){return e.status===422||e.code===`unsupported`?{kind:`unsupported`,text:`Artifacts aren't supported on this hub yet.`}:e.status===404?{kind:`unavailable`,text:`This hub doesn't have artifacts.`}:e.status===403||e.status===401?{kind:`forbidden`,text:`This device isn't allowed to read artifacts.`}:{kind:`error`,text:e.message?`Could not load artifacts: ${e.message}`:`Could not load artifacts (HTTP ${e.status}).`}}function x(e){let t=e&&typeof e==`object`?e:{};return{status:typeof t.status==`number`?t.status:0,...typeof t.code==`string`?{code:t.code}:{},message:typeof t.message==`string`?t.message:String(e)}}function S(e,t){return t?`None of the artifacts loaded so far match. Load more to keep looking.`:e.workspace===``&&e.type===``?`No artifacts yet. Artifacts that your sessions create show up here.`:`No artifacts match these filters.`}var C=(e,t)=>t.get(e)??`Workspace ${e.slice(0,12)}…`,w=e=>`/artifacts/${encodeURIComponent(e)}`;function T(e,t){let n=u,r,i=0,a=[],o,s={status:`loading`},c=()=>s.status===`ready`?{status:`ready`,items:y(a,n),total:a.length,more:o!==void 0,loadingMore:s.loadingMore,...s.moreError?{moreError:s.moreError}:{}}:s,l=e=>{s=e,t(c())};function d(u){n=u;let d=m(u);if(d===r&&s.status===`ready`){t(c());return}r=d;let f=++i;a=[],o=void 0,l({status:`loading`}),e.list(u).then(e=>{f===i&&(a=[...e.items],o=e.cursor,l({status:`ready`,loadingMore:!1}))},e=>f===i&&l({status:`error`,error:b(x(e))}))}function f(){if(s.status!==`ready`||s.loadingMore||o===void 0)return;let t=i;l({status:`ready`,loadingMore:!0}),e.list(n,o).then(e=>{if(t!==i)return;let n=new Set(a.map(e=>e.id));a=[...a,...e.items.filter(e=>!n.has(e.id))],o=e.cursor,l({status:`ready`,loadingMore:!1})},e=>t===i&&l({status:`ready`,loadingMore:!1,moreError:b(x(e)).text}))}function p(){r=void 0,d(n)}return{load:d,more:f,reload:p,view:c}}var E={list:async(e,t)=>v(await n(h(e,t)))};async function D(){try{return((await n(`/api/agent/workspaces?state=active&limit=200`)).items??[]).flatMap(e=>typeof e.id==`string`&&typeof e.title==`string`?[{id:e.id,title:e.title}]:[])}catch{return[]}}export{S as a,C as c,a as d,c as f,T as i,i as l,D as n,p as o,w as r,f as s,E as t,r as u};
1
+ import{G as e,Q as t,it as n}from"./ui-Qo2Pd9-O.js";var r={artifactsPerUser:5e3,revisionsPerArtifact:500,blobBytes:26214400,userBlobBytes:2147483648,bundleFiles:200,chunkBytes:1048576,aiJobsPerUser:8,aiJobsPerArtifact:2,aiInstructionChars:8e3},i=[`markdown`,`code`,`image`,`table`,`chart`,`dashboard`,`html`,`app`,`file`],a=[`html`,`app`],o=[`text/markdown`,`text/plain`,`text/csv`,`text/html`,`text/css`,`text/javascript`,`application/json`,`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`],s=e=>typeof e==`string`&&/^sha256:[0-9a-f]{64}$/.test(e);function c(e){if(!t(e))return`blob must be an object`;if(!s(e.hash))return`hash must be sha256:<64 hex>`;if(typeof e.bytes!=`number`||!Number.isSafeInteger(e.bytes)||e.bytes<0||e.bytes>r.blobBytes)return`bytes must be 0–${r.blobBytes}`;if(!o.includes(e.mediaType))return`mediaType is not allowed`;if(e.path!==void 0&&(typeof e.path!=`string`||!/^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[A-Za-z0-9._/-]{1,200}$/.test(e.path)))return`path must be a relative path without . or .. segments`}var l=`/api/agent/artifacts`,u={workspace:``,type:``},d=e=>typeof e==`string`&&i.includes(e);function f(t){let n=typeof t==`string`?new URLSearchParams(t):t,r=n.get(`workspace`)??``,i=n.get(`type`)??``;return{workspace:r===`none`||e(`workspace`,r)?r:``,type:d(i)?i:``}}function p(e){let t=new URLSearchParams;e.workspace&&t.set(`workspace`,e.workspace),e.type&&t.set(`type`,e.type);let n=t.toString();return n?`?${n}`:``}var m=e=>e.workspace&&e.workspace!==`none`?e.workspace:``;function h(e,t){let n=new URLSearchParams({state:`active`,limit:`50`}),r=m(e);return r&&n.set(`workspace`,r),t&&n.set(`cursor`,t),`${l}?${n}`}var g=e=>typeof e==`string`&&e.length>0;function _(e){if(!e||typeof e!=`object`)return;let t=e;if(g(t.id)&&typeof t.title==`string`&&d(t.kind)&&typeof t.updatedAt==`number`)return{id:t.id,title:t.title,kind:t.kind,visibility:t.visibility===`workspace`?`workspace`:`private`,...g(t.workspaceID)?{workspaceID:t.workspaceID}:{},...g(t.description)?{description:t.description}:{},updatedAt:t.updatedAt}}function v(e){let t=e&&typeof e==`object`?e:{};return{items:Array.isArray(t.items)?t.items.flatMap(e=>_(e)??[]):[],...g(t.cursor)?{cursor:t.cursor}:{}}}function y(e,t){return e.filter(e=>(t.type===``||e.kind===t.type)&&(t.workspace===``||(t.workspace===`none`?!e.workspaceID:e.workspaceID===t.workspace)))}function b(e){return e.status===422||e.code===`unsupported`?{kind:`unsupported`,text:`Artifacts aren't supported on this hub yet.`}:e.status===404?{kind:`unavailable`,text:`This hub doesn't have artifacts.`}:e.status===403||e.status===401?{kind:`forbidden`,text:`This device isn't allowed to read artifacts.`}:{kind:`error`,text:e.message?`Could not load artifacts: ${e.message}`:`Could not load artifacts (HTTP ${e.status}).`}}function x(e){let t=e&&typeof e==`object`?e:{};return{status:typeof t.status==`number`?t.status:0,...typeof t.code==`string`?{code:t.code}:{},message:typeof t.message==`string`?t.message:String(e)}}function S(e,t){return t?`None of the artifacts loaded so far match. Load more to keep looking.`:e.workspace===``&&e.type===``?`No artifacts yet. Artifacts that your sessions create show up here.`:`No artifacts match these filters.`}var C=(e,t)=>t.get(e)??`Workspace ${e.slice(0,12)}…`,w=e=>`/artifacts/${encodeURIComponent(e)}`;function T(e,t){let n=u,r,i=0,a=[],o,s={status:`loading`},c=()=>s.status===`ready`?{status:`ready`,items:y(a,n),total:a.length,more:o!==void 0,loadingMore:s.loadingMore,...s.moreError?{moreError:s.moreError}:{}}:s,l=e=>{s=e,t(c())};function d(u){n=u;let d=m(u);if(d===r&&s.status===`ready`){t(c());return}r=d;let f=++i;a=[],o=void 0,l({status:`loading`}),e.list(u).then(e=>{f===i&&(a=[...e.items],o=e.cursor,l({status:`ready`,loadingMore:!1}))},e=>f===i&&l({status:`error`,error:b(x(e))}))}function f(){if(s.status!==`ready`||s.loadingMore||o===void 0)return;let t=i;l({status:`ready`,loadingMore:!0}),e.list(n,o).then(e=>{if(t!==i)return;let n=new Set(a.map(e=>e.id));a=[...a,...e.items.filter(e=>!n.has(e.id))],o=e.cursor,l({status:`ready`,loadingMore:!1})},e=>t===i&&l({status:`ready`,loadingMore:!1,moreError:b(x(e)).text}))}function p(){r=void 0,d(n)}return{load:d,more:f,reload:p,view:c}}var E={list:async(e,t)=>v(await n(h(e,t)))};async function D(){try{return((await n(`/api/agent/workspaces?state=active&limit=200`)).items??[]).flatMap(e=>typeof e.id==`string`&&typeof e.title==`string`?[{id:e.id,title:e.title}]:[])}catch{return[]}}export{S as a,C as c,a as d,c as f,T as i,i as l,D as n,p as o,w as r,f as s,E as t,r as u};
@@ -1,3 +1,3 @@
1
- var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ge,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p={},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>L(o)));m=o,g=null;try{return F(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){M(N(e,t,!0,u))}function S(e,t,n){M(N(e,t,!1,u))}function C(e,t,n){l=_e;let r=N(e,t,!1,u),i=j&&le(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):M(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,M(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=p,l=null,u=!1,d=!1,f=`initialValue`in o,_=typeof i==`function`&&w(i),v=new Set,[y,b]=(o.storage||x)(o.initialValue),[S,C]=x(void 0),[ne,re]=x(void 0,{equals:!1}),[ie,E]=x(f?`ready`:`unresolved`);m&&D(()=>{for(let e of v.keys())e.decrement();v.clear(),h&&s&&h.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=p,h&&e&&u?(h.promises.delete(e),u=!1,F(()=>{h.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){F(()=>{t===void 0&&b(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),C(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function oe(){let e=j&&le(j),t=y(),n=S();if(n!==void 0&&!s)throw n;return g&&!g.user&&e&&ee(()=>{ne(),s&&(e.resolved&&h&&u?h.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function A(e=!0){if(e!==!1&&d)return;d=!1;let t=_?_():i;if(u=h&&h.running,t==null||t===!1){O(s,T(y));return}h&&s&&h.promises.delete(s);let n,r=c===p?T(()=>{try{return a(t,{value:y(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0)O(s,void 0,R(n),t);else return te(r)?(s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,R(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),F(()=>{E(f?`refreshing`:`pending`),re()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,R(e),t)))):(O(s,r,void 0,t),r)}Object.defineProperties(oe,{state:{get:()=>ie()},error:{get:()=>S()},loading:{get(){let e=ie();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return oe();let e=S();if(e&&!s)throw e;return y()}}});let se=m;return _?ee(()=>(se=m,A(!1))):A(!1),[oe,{refetch:e=>ae(se,()=>A(e)),mutate:b}]}function re(e){return F(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function E(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return g}function k(){return m}function ae(e,t){let n=m,r=g;m=e,g=null;try{return F(t,!0)}catch(e){z(e)}finally{m=n,g=r}}var[oe,A]=x(!1);function se(e){v.push.apply(v,e),e.length=0}function ce(e,t){let n=Symbol(`context`);return{id:n,Provider:Se(n),defaultValue:e}}function le(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function ue(e){let t=w(e),n=w(()=>xe(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function de(){return j||=ce()}function fe(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)M(this);else{let e=_;_=null,F(()=>I(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function M(e){if(!e.fn)return;L(e);let t=y;me(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{F(()=>{h&&(h.running=!0),g=m=e,me(e,e.tValue,t),g=m=null},!1)})}function me(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,z(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==f&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function P(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return I(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===u)M(e);else if((t?e.tState:e.state)===d){let t=_;_=null,F(()=>I(e,n[0]),!1),_=t}}}function F(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return he(n),t}catch(e){n||(v=null),_=null,z(e)}}function he(e){if(_&&=(ge(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,F(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,A(!0);return}}let n=v;v=null,n.length&&F(()=>l(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)P(e[t])}function _e(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function I(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<y)&&P(i):e===d&&I(i,t)}}}function ve(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?_.push(r):v.push(r),r.observers&&ve(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function R(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function be(e,t,n){try{for(let n of t)n(e)}catch(e){z(e,n&&n.owner||null)}}function z(e,t=m){let n=c&&t&&t.context&&t.context[c],r=R(e);if(!n)throw r;v?v.push({fn(){be(r,n,t)},state:u}):be(r,n,t)}function xe(e){if(typeof e==`function`&&!e.length)return xe(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=xe(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Se(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},ue(()=>t.children))),void 0),n}}var Ce=Symbol(`fallback`);function B(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return D(()=>B(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,y;if(u===0)s!==0&&(B(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Te(e,t,n={}){let r=[],i=[],a=[],s=[],c=0,l;return D(()=>B(a)),()=>{let u=e()||[],d=u.length;return u[o],T(()=>{if(d===0)return c!==0&&(B(a),a=[],r=[],i=[],c=0,s=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===Ce&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(i[l]=b(f));for(;l<r.length;l++)a[l]();return c=s.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=x(u[l]);return s[l]=r,t(n,l)}}}function V(e,t){return T(()=>e(t||{}))}function H(){return!0}var Ee={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:H,deleteProperty:H,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:H,deleteProperty:H}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function Ae(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Ee)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function je(t){let r,i,a=()=>{if(!i){let e=i=t();e.then(e=>{r=()=>e.default},()=>{i===e&&(i=void 0)})}return i},o=t=>{let i=e.context;if(i){let[t,o]=x();e.count||=0,e.count++,a().then(t=>{!e.done&&n(i),e.count--,o(()=>t.default),n()},t=>{!e.done&&n(i),e.count--,o(()=>()=>{throw t}),n()}),r=t}else if(!r){let[e]=ne(()=>a().then(e=>e.default));r=e,D(()=>r=void 0)}let o;return w(()=>(o=r?.())?T(()=>{if(!i||e.done)return o(t);let r=e.context;n(i);let a=o(t);return n(r),a}):``)};return o.preload=()=>a(),o}var Me=0;function Ne(){return e.context?e.getNextContextId():`cl-${Me++}`}var Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(we(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(Te(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Le(e){let t=ue(()=>e.children),n=w(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=w(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:w(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return w(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function Re(e){return e}var ze=ce();function Be(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=de(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=k();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=le(ze);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),V(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,se(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}var Ve=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),He=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ue=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),We=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ge(e,t){let n=We[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ke=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),qe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Je={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ye=e=>w(()=>e());function Xe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ze=`_$DX_DELEGATE`;function Qe(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():Y(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function G(e,t=window.document){let n=t[Ze]||(t[Ze]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function K(e,t,n){X(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){X(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){X(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function q(e,t){X(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function tt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function nt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(lt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(lt(e,i,!0),n[i]=o)}return n}function rt(e,t,n){if(!t)return n?K(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function it(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function at(e,t={},n,r){let i={};return r||S(()=>i.children=Z(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&J(t.ref,e)),S(()=>ot(e,t,n,!0,i,!0)),i}function J(e,t,n){return T(()=>e(t,n))}function Y(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Z(e,t,r,n);S(r=>Z(e,t(),r,n),r)}function ot(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ut(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Z(e,t.children);continue}let s=t[o];i[o]=ut(e,o,s,i[o],n,a,t)}}function st(t){let n,r;return!X()||!(n=e.registry.get(r=mt()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function X(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ct(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function lt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ut(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return rt(e,n,r);if(t===`classList`)return nt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ke.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(tt(e,i,n,a),a&&G([i]))}else if(t.slice(0,5)===`attr:`)K(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=He.has(t))||!i&&((u=Ge(t,e.tagName))||(c=Ve.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(X(e))return n;t===`class`||t===`className`?q(e,n):s&&!c&&!l?e[ct(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Je[t.split(`:`)[0]];r?$e(e,r,t,n):K(e,Ue[t]||t,n)}return n}function dt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Z(e,t,n,r,i){let a=X(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Q(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Z(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return S(()=>n=Z(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Q(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Xe(e,n,o):(n&&Q(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Q(e,n,r,t);Q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function mt(){return e.getNextContextId()}var ht=`http://www.w3.org/2000/svg`;function gt(e,t=!1,n=void 0){return t?document.createElementNS(ht,e):document.createElement(e,{is:n})}function _t(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=k(),o,s=!!e.context;return C(()=>{s&&(k().user=s=!1),o||=ae(a,()=>w(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=x(!1);b(n=>Y(e,()=>t()?n():o(),null)),D(()=>n(!0))}else{let i=gt(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),Y(a,o),e.appendChild(i),t.ref&&t.ref(i),D(()=>e.contains(i)&&e.removeChild(i))}},void 0,{render:!s}),r}function vt(t,n){let r=w(t);return w(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=qe.has(t),i=e.context?st():gt(t,r,T(()=>n.is));return at(i,n,r),i}})}function yt(e){let[,t]=Ae(e,[`component`]);return vt(()=>e.component,t)}var bt=class extends Error{status;code;field;hint;details;constructor(e,t){super(t),this.status=e}},xt=class extends Error{cause;name=`NetworkError`;constructor(e){super(`Can't reach the hub: the connection dropped. Check your network and try again.`),this.cause=e}},St;function Ct(e){St=e}async function wt(e,{method:t=`GET`,json:n,body:r,headers:i={},signal:a,keepalive:o}={}){let s={method:t,credentials:`same-origin`,headers:{...i},signal:a,keepalive:o};n===void 0?r!==void 0&&(s.body=r):(s.headers[`content-type`]=`application/json`,s.body=JSON.stringify(n));let c;try{c=await fetch(e,s)}catch(e){throw e instanceof TypeError?new xt(e):e}if(!c.ok){let e=await c.json().catch(()=>({}));c.status===401&&St?.();let t=e.error&&typeof e.error==`object`?e.error:e,n=typeof e.error==`string`?e.error:typeof t.message==`string`?t.message:``,r=new bt(c.status,n||`HTTP ${c.status}`);throw typeof t.field==`string`&&(r.field=t.field),typeof t.code==`string`&&(r.code=t.code),typeof t.hint==`string`&&(r.hint=t.hint),e.error&&typeof e.error==`object`&&(r.details=t),r}return c}var Tt=async e=>(await wt(e)).json(),Et=encodeURIComponent,Dt=e=>`/api/sessions/${Et(e)}`,Ot=e=>e instanceof Error?e.message:String(e),kt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),At=/^[A-Za-z0-9_.:@/+~-]{1,300}$/,jt=/[\p{Cc}\p{Cf}\u2028\u2029]/u,Mt={workspace:`ws`,binding:`wsb`,member:`wsm`,assignment:`asg`,supervision:`sup`,checkpoint:`chk`,sideChat:`chat`,profile:`prof`,artifact:`art`,revision:`rev`,blob:`blob`,aiJob:`job`,team:`team`,staffing:`stf`,intake:`itk`},Nt=/^[A-Za-z0-9]{16,32}$/;function Pt(e,t){if(typeof t!=`string`)return!1;let n=`${Mt[e]}_`;return t.startsWith(n)&&Nt.test(t.slice(n.length))}var Ft=/^[a-z0-9-]{2,40}$/,It=e=>typeof e==`string`&&Ft.test(e),Lt=(e,t=120)=>typeof e==`string`&&e.trim().length>0&&e.length<=t&&!jt.test(e),Rt=4e3,zt=/[\u0000-\u0009\u000b-\u001f\u007f\u2028\u2029\u200b-\u200f\u202a-\u202e\u2066-\u2069]/,Bt=(e,t=Rt)=>typeof e==`string`&&e.length<=t&&!zt.test(e);function Vt(e){if(e!==void 0){if(!Array.isArray(e)||e.length>32)return`tags must be a list of at most 32`;if(!e.every(It))return`each tag must be 2–40 lowercase letters, digits or dashes`;if(new Set(e).size!==e.length)return`tags must be unique`}}function Ht(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))return`metadata must be an object`;let t=Object.entries(e);if(t.length>32)return`metadata has more than 32 keys`;for(let[e,n]of t){if(!It(e))return`metadata key ${JSON.stringify(String(e).slice(0,50))} must be a slug`;if(!Lt(n,200))return`metadata.${e} must be 1–200 characters of text`}}var $=e=>e.signedIn,Ut=[{id:`sessions`,label:`All sessions`,icon:`home`,route:`/`,order:10,available:e=>$(e)?!0:`hidden`},{id:`concierge`,label:`Concierge`,icon:`spark`,route:`/concierge`,order:15,available:e=>$(e)&&e.concierge!==void 0&&e.concierge!==`disabled`?!0:`hidden`},{id:`artifacts`,label:`Artifacts`,icon:`file`,route:`/artifacts`,order:20,available:e=>$(e)?!0:`hidden`},{id:`teams`,label:`Teams`,icon:`team`,route:`/teams`,order:25,available:e=>$(e)?!0:`hidden`},{id:`watchtower`,label:`Watchtower`,icon:`watchtower`,route:`/watchtower`,order:30,available:e=>$(e)?!0:`hidden`},{id:`profiles`,label:`Agent profiles`,icon:`settings`,route:`/profiles`,order:40,available:e=>$(e)?!0:`hidden`}],Wt={"/birds-eye":`/watchtower`};function Gt(e,t=``,n=``){for(let[r,i]of Object.entries(Wt))if(e===r||e.startsWith(`${r}/`))return`${i}${e.slice(r.length)}${t}${n}`}function Kt(e,t){try{return e.available(t)}catch{return`hidden`}}function qt(e,t=Ut){return[...t].sort((e,t)=>e.order-t.order).flatMap(t=>{let n=Kt(t,e);return n===`hidden`?[]:[{dest:t,enabled:n===!0}]})}var Jt=(e,t)=>Kt(e,t)===!0?`ok`:`unavailable`;function Yt(e,t=Ut){for(let n of t)if(n.route!==`/`&&(e===n.route||e.startsWith(`${n.route}/`)))try{return{dest:n,rest:e.slice(n.route.length).split(`/`).filter(Boolean).map(decodeURIComponent)}}catch{return}}function Xt(e,t=Ut){return e===`/`?t.find(e=>e.route===`/`)?.id:Yt(e,t)?.dest.id}function Zt(e){return e.supported?e.permission===`denied`?{state:`blocked`,message:`Notifications are blocked for this site. Allow them in the browser's site settings, then reload.`,action:`none`,warn:!0}:e.permission==="default"?{state:`off`,message:`Notifications are off on this device.`,action:`enable`,warn:!0}:!e.worker||!e.endpoint||!e.hubSubscribed?{state:`repair`,message:`Allowed, but this device is not subscribed on this hub, so nothing will arrive (this happens after the hub moves to a new address). Enable again to fix it.`,action:`enable`,warn:!0}:{state:`on`,message:`On for this device.`,action:`disable`,warn:!1}:{state:`unsupported`,message:`This browser can't get notifications here. On iPhone, add the app to the Home Screen first (iOS 16.4+); everywhere else the hub must be on https.`,action:`none`,warn:!0}}var Qt=e=>e.supported&&e.permission===`granted`&&(!e.endpoint||!e.hubSubscribed);function $t(e){if(e.subscriptions===0)return{ok:!1,text:`This device is not subscribed; enable notifications first`};if(e.sent>0)return{ok:!0,text:e.sent===1?`Test notification sent to this device`:`Test notification sent (${e.sent} subscriptions)`};let t=e.failed[0];return t?{ok:!1,text:`Test failed: ${t.host} ${t.status===void 0?`did not answer`:`answered ${t.status}`}`}:{ok:!1,text:`Test failed`}}var en=[1,2,5,10,15,30,60],tn=[{title:`Needs you`,kinds:[{key:`question`,label:`Question`,description:`A session or subagent asks you something.`},{key:`permission`,label:`Needs permission`,description:`A tool call waits for your OK (answer from the notification).`},{key:`decision`,label:`Decision`,description:`A session asks you to decide (hub ask @me), with options and a recommendation.`},{key:`message`,label:`Message`,description:`Agent messaging needs you: a message to you, an unanswered ask, or sessions looping.`},{key:`concierge`,label:`Concierge`,description:`Your Concierge needs you or has news: its questions, permissions, decisions, messages and spoken replies.`}]},{title:`Session`,kinds:[{key:`done`,label:`All done`,description:`The session and all its subagents and scripts finished; nothing waits on you. Once per run.`},{key:`failed`,label:`Failed`,description:`The session's run failed (provider or tool error), with the reason.`},{key:`providerError`,label:`Model provider error`,description:`Quota, budget, auth or model-routing errors of the session or a subagent; once per run.`},{key:`turn`,label:`Turn finished`,description:`Every reply of the main session, also the short ones between subagents. Noisy.`},{key:`stopped`,label:`Stopped`,description:`A run stopped without you asking (OpenCode shut down, inactivity).`},{key:`retry`,label:`Retrying`,description:`The provider failed and OpenCode is retrying the request.`}]},{title:`Subagents`,kinds:[{key:`subagentDone`,label:`Subagent finished`,description:`Each subagent that finishes, by name.`},{key:`subagentFailed`,label:`Subagent failed`,description:`Each subagent that fails, with the reason.`}]},{title:`Scripts and tools`,kinds:[{key:`jobDone`,label:`Script finished`,description:`A background shell or terminal exited 0.`},{key:`jobFailed`,label:`Script failed`,description:`A background shell or terminal exited non-zero, was killed or timed out.`},{key:`longTool`,label:`Long tool finished`,description:`A tool call that ran 30 seconds or more ended.`}]},{title:`Voice`,kinds:[{key:`say`,label:`Spoken reply`,description:`Voice mode replies while no device shows the session.`},{key:`handoff`,label:`Hand-off`,description:`A session sent to this device from the terminal (ignores quiet hours).`}]},{title:`Activity digest`,kinds:[{key:`activity`,label:`Activity`,description:`One quiet, self-replacing summary per session: subagents, long tools, scripts, idle.`}]}],nn=tn.flatMap(e=>e.kinds);function rn(e){let t=nn.filter(t=>e[t.key]).map(e=>e.label);return t.length?`You'll get: ${t.join(`, `)}.`:`You'll get no notifications on this device.`}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var on=[{id:`general`,label:`General`,description:`Account, theme, text size and the Hub app`},{id:`notifications`,label:`Notifications`,description:`This device's notifications, what to notify about, quiet hours`},{id:`voice`,label:`Voice & speech`,description:`Voice mode, mic sensitivity, speech-to-text and text-to-speech`},{id:`machines`,label:`Machines & devices`,description:`Connected machines, approvals, signed-in browsers and apps`},{id:`agents`,label:`Agents & access`,description:`App tokens, acting switches, grants and agent activity`},{id:`concierge`,label:`Concierge`,description:`Your hub-managed assistant: machine, directory, model and its grant`},{id:`teams`,label:`Teams`,description:`Team isolation: what team members see`},{id:`admin`,label:`Admin`,description:`Users, all machines, approvals and the audit log`,admin:!0}],sn=e=>on.filter(t=>e||!t.admin);function cn(e){if(e!==`/settings`&&!e.startsWith(`/settings/`))return;let t=e.slice(10).split(`/`)[0]??``;if(!t)return{};try{return{section:decodeURIComponent(t)}}catch{return{section:t}}}function ln(e,t){return e===void 0?t.phone?`list`:`general`:sn(t.admin).find(t=>t.id===e)?.id}var un={account:`general`,appearance:`general`,notifications:`notifications`,voice:`voice`,speech:`voice`,machines:`machines`,devices:`machines`,agents:`agents`,admin:`admin`};function dn(e){let t=e.replace(/^#/,``);if(!t)return;let n=un[t];if(n)return`/settings/${n}#${t}`;if(on.some(e=>e.id===t))return`/settings/${t}`}var fn=[{id:`account`,section:`general`,label:`Account`,description:`Who you are signed in as; sign out of this device`,keywords:`sign out logout user email`},{id:`set-theme`,section:`general`,label:`Color theme`,description:`Light, dark or the system's theme`,keywords:`appearance light dark system mode`},{id:`set-text-size`,section:`general`,label:`Text size`,description:`How big text is on this device`,keywords:`appearance font scale zoom`},{id:`add-app`,section:`general`,label:`Add the Hub app`,description:`Link the Hub app on a phone or tablet with a QR code`,keywords:`mobile android ios install pair link`},{id:`notifications`,section:`notifications`,label:`Notifications on this device`,description:`Enable or turn off push notifications here; permission and subscription status`,keywords:`push enable subscribe permission service worker`},{id:`notify-test`,section:`notifications`,label:`Send test notification`,description:`Check that notifications reach this device`,keywords:`push try`},{id:`quiet-hours`,section:`notifications`,label:`Quiet hours`,description:`No notifications at night (hand-offs still come through)`,keywords:`do not disturb night sleep time`},{id:`set-voice-speed`,section:`voice`,label:`Voice speed`,description:`How fast replies are spoken`,keywords:`rate tts`},{id:`set-sensitivity`,section:`voice`,label:`Mic sensitivity`,description:`How sure Voice mode must be that you are speaking to it`,keywords:`microphone noise vad`},{id:`set-cues`,section:`voice`,label:`Progress cues`,description:`Tones and short acknowledgements while the agent works`,keywords:`sounds acknowledgement`},{id:`set-background`,section:`voice`,label:`Keep listening when the screen is off`,description:`Lock-screen controls and listening with the screen off`,keywords:`background lock screen`},{id:`speech`,section:`voice`,label:`Speech`,description:`Speech-to-text and text-to-speech provider, model, voice and API keys`,keywords:`stt tts transcription openrouter openai key`},{id:`machines`,section:`machines`,label:`Machines`,description:`Computers running OpenCode connected to this hub; approve or revoke them`,keywords:`computer approve enrollment revoke opencode`},{id:`devices`,section:`machines`,label:`Devices`,description:`Browsers and the Hub app signed in to your account; revoke them`,keywords:`browser phone sessions revoke sign out`},{id:`agents`,section:`agents`,label:`Acting switch`,description:`Whether sessions and apps may act for you at all`,keywords:`pause kill switch acting`},{id:`app-tokens`,section:`agents`,label:`App tokens`,description:`Tokens for MCP gateways, CLIs and other apps, with their scopes`,keywords:`api key token scopes mcp cli`},{id:`grants`,section:`agents`,label:`Grants`,description:`What sessions and apps may approve, deny, answer, prompt or stop for you`,keywords:`permissions delegate allow`},{id:`agent-activity`,section:`agents`,label:`Agent activity`,description:`What agents did for you (the agent audit)`,keywords:`audit log history`},{id:`concierge`,section:`concierge`,label:`Concierge`,description:`Turn the Concierge on or off, pick its machine and directory, restart it`,keywords:`assistant butler watch sessions`},{id:`concierge-grant`,section:`concierge`,label:`Concierge grant`,description:`What the Concierge may do for you without asking; renew or remove it`,keywords:`permissions approve deny preset`},{id:`team-isolation`,section:`teams`,label:`Team isolation`,description:`Team members see only their teams' sessions, not your other sessions`,keywords:`teams privacy hide members`}],pn=[{id:`admin`,section:`admin`,label:`Users`,description:`Everyone on this hub: roles, disable, remove`,keywords:`admin accounts people`},{id:`admin-machines`,section:`admin`,label:`All machines`,description:`Every machine connected to this hub, by owner`,keywords:`admin revoke`},{id:`admin-audit`,section:`admin`,label:`Audit log`,description:`Who changed what on this hub`,keywords:`admin history`}],mn=(e,t)=>({id:`pref-${e.key}`,section:`notifications`,label:e.label,description:e.description,keywords:`notify ${t}`});function hn(e){return[...fn,...tn.flatMap(e=>e.kinds.map(t=>mn(t,e.title))),...e?pn:[]]}var gn=e=>on.find(t=>t.id===e)?.label??e;function _n(e,t){let n=e.trim().toLowerCase();if(!n)return[];let r=n.split(/\s+/),i=e=>{let t=e.label.toLowerCase();return t.startsWith(n)?0:t.includes(n)?1:r.every(e=>t.includes(e))?2:3};return t.filter(e=>{let t=`${e.label} ${e.description} ${e.keywords??``} ${gn(e.section)}`.toLowerCase();return r.every(e=>t.includes(e))}).map((e,t)=>({e,i:t,r:i(e)})).sort((e,t)=>e.r-t.r||e.i-t.i).map(e=>e.e)}function vn(e,t){let n=e.filter(e=>e.key in t);if(!n.length)return``;let r=n.filter(e=>t[e.key]);return r.length===n.length?`All on`:r.length?`${r.length} of ${n.length} on: ${r.map(e=>e.label).join(`, `)}`:`All off`}var yn=e=>e&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)?e:`/`;function bn(e){let t=e.pathname,n=e.searchParams;if(t===`/pair`)return{name:`pair`,next:yn(n.get(`next`)),error:n.get(`error`)??``};if(t===`/approve`)return{name:`approve`,code:n.get(`code`)??``};if(t===`/new`)return{name:`new`,machine:n.get(`machine`)??void 0,dir:n.get(`dir`)??void 0,key:n.get(`key`)??void 0};if(t===`/panes`)return{name:`panes`};if(t===`/concierge`||t.startsWith(`/concierge/`))return{name:`concierge`};let r=cn(t);if(r)return{name:`settings`,...r};let i=Yt(t);if(i)return{name:`feature`,id:i.dest.id,rest:i.rest};let a=/^\/s\/([^/]+)$/.exec(t);if(a)try{return{name:`session`,id:decodeURIComponent(a[1])}}catch{return{name:`home`}}return{name:`home`}}function xn(){let e=(location.pathname===`/settings`?dn(location.hash):void 0)??Gt(location.pathname,location.search,location.hash);return e&&history.replaceState(history.state,``,e),new URL(location.href)}var[Sn,Cn]=x(xn()),wn=Sn,Tn=()=>bn(Sn()),En=0;function Dn(e,{replace:t=!1}={}){let n=new URL(e,location.origin);n.pathname+n.search+n.hash!==location.pathname+location.search+location.hash&&(history[t?`replaceState`:`pushState`]({},``,n.pathname+n.search+n.hash),t||En++),Cn(xn())}function On(e=`/`){En>0?history.back():Dn(e)}window.addEventListener(`popstate`,()=>{En=Math.max(0,En-1),Cn(xn())}),document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[href]`);if(!t||t.target||t.hasAttribute(`download`)||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=t.getAttribute(`href`)??``;!n.startsWith(`/`)||n.startsWith(`//`)||n.startsWith(`/auth/`)||n.startsWith(`/api/`)||(e.preventDefault(),Dn(n))});var kn=()=>new Set;function An(e){kn=e}var jn=e=>kn().has(e),Mn=e=>kn().has(e)?`/concierge`:`/s/${encodeURIComponent(e)}`,[Nn,Pn]=x(),Fn=Nn,In=0,Ln;function Rn(e,t=``,n){let r=++In;Pn({id:r,text:e,kind:t,action:n}),clearTimeout(Ln),Ln=setTimeout(()=>Nn()?.id===r&&Pn(void 0),n||t?8e3:4e3)}var zn=()=>Pn(void 0);function Bn(e){let t=[];return{ask(n){return new Promise(r=>{t.push({request:n,resolve:r}),t.length===1&&e(n)})},current:()=>t[0]?.request,settle(n){let r=t.shift();r&&(r.resolve(n),e(t[0]?.request))}}}function Vn(e){let t=e.trim(),n=t.indexOf(`
1
+ var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ge,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p={},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>L(o)));m=o,g=null;try{return F(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){M(N(e,t,!0,u))}function S(e,t,n){M(N(e,t,!1,u))}function C(e,t,n){l=_e;let r=N(e,t,!1,u),i=j&&le(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):M(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,M(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=p,l=null,u=!1,d=!1,f=`initialValue`in o,_=typeof i==`function`&&w(i),v=new Set,[y,b]=(o.storage||x)(o.initialValue),[S,C]=x(void 0),[ne,re]=x(void 0,{equals:!1}),[ie,E]=x(f?`ready`:`unresolved`);m&&D(()=>{for(let e of v.keys())e.decrement();v.clear(),h&&s&&h.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=p,h&&e&&u?(h.promises.delete(e),u=!1,F(()=>{h.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){F(()=>{t===void 0&&b(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),C(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function oe(){let e=j&&le(j),t=y(),n=S();if(n!==void 0&&!s)throw n;return g&&!g.user&&e&&ee(()=>{ne(),s&&(e.resolved&&h&&u?h.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function A(e=!0){if(e!==!1&&d)return;d=!1;let t=_?_():i;if(u=h&&h.running,t==null||t===!1){O(s,T(y));return}h&&s&&h.promises.delete(s);let n,r=c===p?T(()=>{try{return a(t,{value:y(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0)O(s,void 0,R(n),t);else return te(r)?(s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,R(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),F(()=>{E(f?`refreshing`:`pending`),re()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,R(e),t)))):(O(s,r,void 0,t),r)}Object.defineProperties(oe,{state:{get:()=>ie()},error:{get:()=>S()},loading:{get(){let e=ie();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return oe();let e=S();if(e&&!s)throw e;return y()}}});let se=m;return _?ee(()=>(se=m,A(!1))):A(!1),[oe,{refetch:e=>ae(se,()=>A(e)),mutate:b}]}function re(e){return F(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function E(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return g}function k(){return m}function ae(e,t){let n=m,r=g;m=e,g=null;try{return F(t,!0)}catch(e){z(e)}finally{m=n,g=r}}var[oe,A]=x(!1);function se(e){v.push.apply(v,e),e.length=0}function ce(e,t){let n=Symbol(`context`);return{id:n,Provider:Se(n),defaultValue:e}}function le(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function ue(e){let t=w(e),n=w(()=>xe(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function de(){return j||=ce()}function fe(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)M(this);else{let e=_;_=null,F(()=>I(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function M(e){if(!e.fn)return;L(e);let t=y;me(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{F(()=>{h&&(h.running=!0),g=m=e,me(e,e.tValue,t),g=m=null},!1)})}function me(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,z(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==f&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function P(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return I(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===u)M(e);else if((t?e.tState:e.state)===d){let t=_;_=null,F(()=>I(e,n[0]),!1),_=t}}}function F(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return he(n),t}catch(e){n||(v=null),_=null,z(e)}}function he(e){if(_&&=(ge(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,F(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,A(!0);return}}let n=v;v=null,n.length&&F(()=>l(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)P(e[t])}function _e(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function I(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<y)&&P(i):e===d&&I(i,t)}}}function ve(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?_.push(r):v.push(r),r.observers&&ve(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function R(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function be(e,t,n){try{for(let n of t)n(e)}catch(e){z(e,n&&n.owner||null)}}function z(e,t=m){let n=c&&t&&t.context&&t.context[c],r=R(e);if(!n)throw r;v?v.push({fn(){be(r,n,t)},state:u}):be(r,n,t)}function xe(e){if(typeof e==`function`&&!e.length)return xe(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=xe(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Se(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},ue(()=>t.children))),void 0),n}}var Ce=Symbol(`fallback`);function B(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return D(()=>B(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,y;if(u===0)s!==0&&(B(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Te(e,t,n={}){let r=[],i=[],a=[],s=[],c=0,l;return D(()=>B(a)),()=>{let u=e()||[],d=u.length;return u[o],T(()=>{if(d===0)return c!==0&&(B(a),a=[],r=[],i=[],c=0,s=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===Ce&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(i[l]=b(f));for(;l<r.length;l++)a[l]();return c=s.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=x(u[l]);return s[l]=r,t(n,l)}}}function V(e,t){return T(()=>e(t||{}))}function H(){return!0}var Ee={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:H,deleteProperty:H,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:H,deleteProperty:H}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function Ae(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Ee)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function je(t){let r,i,a=()=>{if(!i){let e=i=t();e.then(e=>{r=()=>e.default},()=>{i===e&&(i=void 0)})}return i},o=t=>{let i=e.context;if(i){let[t,o]=x();e.count||=0,e.count++,a().then(t=>{!e.done&&n(i),e.count--,o(()=>t.default),n()},t=>{!e.done&&n(i),e.count--,o(()=>()=>{throw t}),n()}),r=t}else if(!r){let[e]=ne(()=>a().then(e=>e.default));r=e,D(()=>r=void 0)}let o;return w(()=>(o=r?.())?T(()=>{if(!i||e.done)return o(t);let r=e.context;n(i);let a=o(t);return n(r),a}):``)};return o.preload=()=>a(),o}var Me=0;function Ne(){return e.context?e.getNextContextId():`cl-${Me++}`}var Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(we(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(Te(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Le(e){let t=ue(()=>e.children),n=w(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=w(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:w(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return w(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function Re(e){return e}var ze=ce();function Be(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=de(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=k();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=le(ze);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),V(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,se(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}var Ve=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),He=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ue=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),We=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ge(e,t){let n=We[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ke=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),qe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Je={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ye=e=>w(()=>e());function Xe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ze=`_$DX_DELEGATE`;function Qe(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():Y(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function G(e,t=window.document){let n=t[Ze]||(t[Ze]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function K(e,t,n){X(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){X(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){X(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function q(e,t){X(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function tt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function nt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(lt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(lt(e,i,!0),n[i]=o)}return n}function rt(e,t,n){if(!t)return n?K(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function it(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function at(e,t={},n,r){let i={};return r||S(()=>i.children=Z(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&J(t.ref,e)),S(()=>ot(e,t,n,!0,i,!0)),i}function J(e,t,n){return T(()=>e(t,n))}function Y(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Z(e,t,r,n);S(r=>Z(e,t(),r,n),r)}function ot(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ut(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Z(e,t.children);continue}let s=t[o];i[o]=ut(e,o,s,i[o],n,a,t)}}function st(t){let n,r;return!X()||!(n=e.registry.get(r=mt()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function X(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ct(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function lt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ut(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return rt(e,n,r);if(t===`classList`)return nt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ke.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(tt(e,i,n,a),a&&G([i]))}else if(t.slice(0,5)===`attr:`)K(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=He.has(t))||!i&&((u=Ge(t,e.tagName))||(c=Ve.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(X(e))return n;t===`class`||t===`className`?q(e,n):s&&!c&&!l?e[ct(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Je[t.split(`:`)[0]];r?$e(e,r,t,n):K(e,Ue[t]||t,n)}return n}function dt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Z(e,t,n,r,i){let a=X(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Q(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Z(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return S(()=>n=Z(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Q(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Xe(e,n,o):(n&&Q(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Q(e,n,r,t);Q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function mt(){return e.getNextContextId()}var ht=`http://www.w3.org/2000/svg`;function gt(e,t=!1,n=void 0){return t?document.createElementNS(ht,e):document.createElement(e,{is:n})}function _t(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=k(),o,s=!!e.context;return C(()=>{s&&(k().user=s=!1),o||=ae(a,()=>w(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=x(!1);b(n=>Y(e,()=>t()?n():o(),null)),D(()=>n(!0))}else{let i=gt(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),Y(a,o),e.appendChild(i),t.ref&&t.ref(i),D(()=>e.contains(i)&&e.removeChild(i))}},void 0,{render:!s}),r}function vt(t,n){let r=w(t);return w(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=qe.has(t),i=e.context?st():gt(t,r,T(()=>n.is));return at(i,n,r),i}})}function yt(e){let[,t]=Ae(e,[`component`]);return vt(()=>e.component,t)}var bt=class extends Error{status;code;field;hint;details;constructor(e,t){super(t),this.status=e}},xt=class extends Error{cause;name=`NetworkError`;constructor(e){super(`Can't reach the hub: the connection dropped. Check your network and try again.`),this.cause=e}},St;function Ct(e){St=e}async function wt(e,{method:t=`GET`,json:n,body:r,headers:i={},signal:a,keepalive:o}={}){let s={method:t,credentials:`same-origin`,headers:{...i},signal:a,keepalive:o};n===void 0?r!==void 0&&(s.body=r):(s.headers[`content-type`]=`application/json`,s.body=JSON.stringify(n));let c;try{c=await fetch(e,s)}catch(e){throw e instanceof TypeError?new xt(e):e}if(!c.ok){let e=await c.json().catch(()=>({}));c.status===401&&St?.();let t=e.error&&typeof e.error==`object`?e.error:e,n=typeof e.error==`string`?e.error:typeof t.message==`string`?t.message:``,r=new bt(c.status,n||`HTTP ${c.status}`);throw typeof t.field==`string`&&(r.field=t.field),typeof t.code==`string`&&(r.code=t.code),typeof t.hint==`string`&&(r.hint=t.hint),e.error&&typeof e.error==`object`&&(r.details=t),r}return c}var Tt=async e=>(await wt(e)).json(),Et=encodeURIComponent,Dt=e=>`/api/sessions/${Et(e)}`,Ot=e=>e instanceof Error?e.message:String(e),kt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),At=/^[A-Za-z0-9_.:@/+~-]{1,300}$/,jt=/[\p{Cc}\p{Cf}\u2028\u2029]/u,Mt={workspace:`ws`,binding:`wsb`,member:`wsm`,assignment:`asg`,supervision:`sup`,checkpoint:`chk`,sideChat:`chat`,profile:`prof`,artifact:`art`,revision:`rev`,blob:`blob`,aiJob:`job`,team:`team`,staffing:`stf`,intake:`itk`},Nt=/^[A-Za-z0-9]{16,32}$/;function Pt(e,t){if(typeof t!=`string`)return!1;let n=`${Mt[e]}_`;return t.startsWith(n)&&Nt.test(t.slice(n.length))}var Ft=/^[a-z0-9-]{2,40}$/,It=e=>typeof e==`string`&&Ft.test(e),Lt=(e,t=120)=>typeof e==`string`&&e.trim().length>0&&e.length<=t&&!jt.test(e),Rt=4e3,zt=/[\u0000-\u0009\u000b-\u001f\u007f\u2028\u2029\u200b-\u200f\u202a-\u202e\u2066-\u2069]/,Bt=(e,t=Rt)=>typeof e==`string`&&e.length<=t&&!zt.test(e);function Vt(e){if(e!==void 0){if(!Array.isArray(e)||e.length>32)return`tags must be a list of at most 32`;if(!e.every(It))return`each tag must be 2–40 lowercase letters, digits or dashes`;if(new Set(e).size!==e.length)return`tags must be unique`}}function Ht(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))return`metadata must be an object`;let t=Object.entries(e);if(t.length>32)return`metadata has more than 32 keys`;for(let[e,n]of t){if(!It(e))return`metadata key ${JSON.stringify(String(e).slice(0,50))} must be a slug`;if(!Lt(n,200))return`metadata.${e} must be 1–200 characters of text`}}var $=e=>e.signedIn,Ut=[{id:`sessions`,label:`All sessions`,icon:`home`,route:`/`,order:10,available:e=>$(e)?!0:`hidden`},{id:`concierge`,label:`Concierge`,icon:`spark`,route:`/concierge`,order:15,available:e=>$(e)&&e.concierge!==void 0&&e.concierge!==`disabled`?!0:`hidden`},{id:`artifacts`,label:`Artifacts`,icon:`file`,route:`/artifacts`,order:20,available:e=>$(e)?!0:`hidden`},{id:`teams`,label:`Teams`,icon:`team`,route:`/teams`,order:25,available:e=>$(e)?!0:`hidden`},{id:`watchtower`,label:`Watchtower`,icon:`watchtower`,route:`/watchtower`,order:30,available:e=>$(e)?!0:`hidden`},{id:`profiles`,label:`Agent profiles`,icon:`settings`,route:`/profiles`,order:40,available:e=>$(e)?!0:`hidden`}],Wt={"/birds-eye":`/watchtower`};function Gt(e,t=``,n=``){for(let[r,i]of Object.entries(Wt))if(e===r||e.startsWith(`${r}/`))return`${i}${e.slice(r.length)}${t}${n}`}function Kt(e,t){try{return e.available(t)}catch{return`hidden`}}function qt(e,t=Ut){return[...t].sort((e,t)=>e.order-t.order).flatMap(t=>{let n=Kt(t,e);return n===`hidden`?[]:[{dest:t,enabled:n===!0}]})}var Jt=(e,t)=>Kt(e,t)===!0?`ok`:`unavailable`;function Yt(e,t=Ut){for(let n of t)if(n.route!==`/`&&(e===n.route||e.startsWith(`${n.route}/`)))try{return{dest:n,rest:e.slice(n.route.length).split(`/`).filter(Boolean).map(decodeURIComponent)}}catch{return}}function Xt(e,t=Ut){return e===`/`?t.find(e=>e.route===`/`)?.id:Yt(e,t)?.dest.id}function Zt(e){return e.supported?e.permission===`denied`?{state:`blocked`,message:`Notifications are blocked for this site. Allow them in the browser's site settings, then reload.`,action:`none`,warn:!0}:e.permission==="default"?{state:`off`,message:`Notifications are off on this device.`,action:`enable`,warn:!0}:!e.worker||!e.endpoint||!e.hubSubscribed?{state:`repair`,message:`Allowed, but this device is not subscribed on this hub, so nothing will arrive (this happens after the hub moves to a new address). Enable again to fix it.`,action:`enable`,warn:!0}:{state:`on`,message:`On for this device.`,action:`disable`,warn:!1}:{state:`unsupported`,message:`This browser can't get notifications here. On iPhone, add the app to the Home Screen first (iOS 16.4+); everywhere else the hub must be on https.`,action:`none`,warn:!0}}var Qt=e=>e.supported&&e.permission===`granted`&&(!e.endpoint||!e.hubSubscribed);function $t(e){if(e.subscriptions===0)return{ok:!1,text:`This device is not subscribed; enable notifications first`};if(e.sent>0)return{ok:!0,text:e.sent===1?`Test notification sent to this device`:`Test notification sent (${e.sent} subscriptions)`};let t=e.failed[0];return t?{ok:!1,text:`Test failed: ${t.host} ${t.status===void 0?`did not answer`:`answered ${t.status}`}`}:{ok:!1,text:`Test failed`}}var en=[1,2,5,10,15,30,60],tn=[{title:`Needs you`,kinds:[{key:`question`,label:`Question`,description:`A session or subagent asks you something.`},{key:`permission`,label:`Needs permission`,description:`A tool call waits for your OK (answer from the notification).`},{key:`decision`,label:`Decision`,description:`A session asks you to decide (hub ask @me), with options and a recommendation.`},{key:`message`,label:`Message`,description:`Agent messaging needs you: a message to you, an unanswered ask, or sessions looping.`},{key:`concierge`,label:`Concierge`,description:`Your Concierge needs you or has news: its questions, permissions, decisions, messages and spoken replies.`}]},{title:`Session`,kinds:[{key:`done`,label:`All done`,description:`The session and all its subagents and scripts finished; nothing waits on you. Once per run.`},{key:`failed`,label:`Failed`,description:`The session's run failed (provider or tool error), with the reason.`},{key:`providerError`,label:`Model provider error`,description:`Quota, budget, auth or model-routing errors of the session or a subagent; once per run.`},{key:`turn`,label:`Turn finished`,description:`Every reply of the main session, also the short ones between subagents. Noisy.`},{key:`stopped`,label:`Stopped`,description:`A run stopped without you asking (OpenCode shut down, inactivity).`},{key:`retry`,label:`Retrying`,description:`The provider failed and OpenCode is retrying the request.`}]},{title:`Subagents`,kinds:[{key:`subagentDone`,label:`Subagent finished`,description:`Each subagent that finishes, by name.`},{key:`subagentFailed`,label:`Subagent failed`,description:`Each subagent that fails, with the reason.`}]},{title:`Scripts and tools`,kinds:[{key:`jobDone`,label:`Script finished`,description:`A background shell or terminal exited 0.`},{key:`jobFailed`,label:`Script failed`,description:`A background shell or terminal exited non-zero, was killed or timed out.`},{key:`longTool`,label:`Long tool finished`,description:`A tool call that ran 30 seconds or more ended.`}]},{title:`Voice`,kinds:[{key:`say`,label:`Spoken reply`,description:`Voice mode replies while no device shows the session.`},{key:`handoff`,label:`Hand-off`,description:`A session sent to this device from the terminal (ignores quiet hours).`}]},{title:`Activity digest`,kinds:[{key:`activity`,label:`Activity`,description:`One quiet, self-replacing summary per session: subagents, long tools, scripts, idle.`}]}],nn=tn.flatMap(e=>e.kinds);function rn(e){let t=nn.filter(t=>e[t.key]).map(e=>e.label);return t.length?`You'll get: ${t.join(`, `)}.`:`You'll get no notifications on this device.`}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var on=[{id:`general`,label:`General`,description:`Account, theme, text size and the Hub app`},{id:`notifications`,label:`Notifications`,description:`This device's notifications, what to notify about, quiet hours`},{id:`voice`,label:`Voice & speech`,description:`Voice mode, mic sensitivity, speech-to-text and text-to-speech`},{id:`machines`,label:`Machines & devices`,description:`Connected machines, approvals, signed-in browsers and apps`},{id:`agents`,label:`Agents & access`,description:`App tokens, acting switches, grants and agent activity`},{id:`concierge`,label:`Concierge`,description:`Your hub-managed assistant: machine, directory, model and its grant`},{id:`teams`,label:`Teams`,description:`Team isolation: what team members see`},{id:`admin`,label:`Admin`,description:`Users, all machines, approvals and the audit log`,admin:!0}],sn=e=>on.filter(t=>e||!t.admin);function cn(e){if(e!==`/settings`&&!e.startsWith(`/settings/`))return;let t=e.slice(10).split(`/`)[0]??``;if(!t)return{};try{return{section:decodeURIComponent(t)}}catch{return{section:t}}}function ln(e,t){return e===void 0?t.phone?`list`:`general`:sn(t.admin).find(t=>t.id===e)?.id}var un={account:`general`,appearance:`general`,notifications:`notifications`,voice:`voice`,speech:`voice`,machines:`machines`,devices:`machines`,agents:`agents`,admin:`admin`};function dn(e){let t=e.replace(/^#/,``);if(!t)return;let n=un[t];if(n)return`/settings/${n}#${t}`;if(on.some(e=>e.id===t))return`/settings/${t}`}var fn=[{id:`account`,section:`general`,label:`Account`,description:`Who you are signed in as; sign out of this device`,keywords:`sign out logout user email`},{id:`set-theme`,section:`general`,label:`Color theme`,description:`Light, dark or the system's theme`,keywords:`appearance light dark system mode`},{id:`set-text-size`,section:`general`,label:`Text size`,description:`How big text is on this device`,keywords:`appearance font scale zoom`},{id:`add-app`,section:`general`,label:`Add the Hub app`,description:`Link the Hub app on a phone or tablet with a QR code`,keywords:`mobile android ios install pair link`},{id:`notifications`,section:`notifications`,label:`Notifications on this device`,description:`Enable or turn off push notifications here; permission and subscription status`,keywords:`push enable subscribe permission service worker`},{id:`notify-test`,section:`notifications`,label:`Send test notification`,description:`Check that notifications reach this device`,keywords:`push try`},{id:`quiet-hours`,section:`notifications`,label:`Quiet hours`,description:`No notifications at night (hand-offs still come through)`,keywords:`do not disturb night sleep time`},{id:`set-voice-speed`,section:`voice`,label:`Voice speed`,description:`How fast replies are spoken`,keywords:`rate tts`},{id:`set-sensitivity`,section:`voice`,label:`Mic sensitivity`,description:`How sure Voice mode must be that you are speaking to it`,keywords:`microphone noise vad`},{id:`set-cues`,section:`voice`,label:`Progress cues`,description:`Tones and short acknowledgements while the agent works`,keywords:`sounds acknowledgement`},{id:`set-background`,section:`voice`,label:`Keep listening when the screen is off`,description:`Lock-screen controls and listening with the screen off`,keywords:`background lock screen`},{id:`recording`,section:`voice`,label:`Record voice conversations (developer)`,description:`Saves your voice segments, transcripts, replies, timing and Concierge actions on this hub, for 7 days; export or delete them`,keywords:`record debug developer training audio export delete`},{id:`speech`,section:`voice`,label:`Speech`,description:`Speech-to-text and text-to-speech provider, model, voice and API keys`,keywords:`stt tts transcription openrouter openai key`},{id:`machines`,section:`machines`,label:`Machines`,description:`Computers running OpenCode connected to this hub; approve or revoke them`,keywords:`computer approve enrollment revoke opencode`},{id:`devices`,section:`machines`,label:`Devices`,description:`Browsers and the Hub app signed in to your account; revoke them`,keywords:`browser phone sessions revoke sign out`},{id:`agents`,section:`agents`,label:`Acting switch`,description:`Whether sessions and apps may act for you at all`,keywords:`pause kill switch acting`},{id:`app-tokens`,section:`agents`,label:`App tokens`,description:`Tokens for MCP gateways, CLIs and other apps, with their scopes`,keywords:`api key token scopes mcp cli`},{id:`grants`,section:`agents`,label:`Grants`,description:`What sessions and apps may approve, deny, answer, prompt or stop for you`,keywords:`permissions delegate allow`},{id:`agent-activity`,section:`agents`,label:`Agent activity`,description:`What agents did for you (the agent audit)`,keywords:`audit log history`},{id:`concierge`,section:`concierge`,label:`Concierge`,description:`Turn the Concierge on or off, pick its machine and directory, restart it`,keywords:`assistant butler watch sessions`},{id:`concierge-grant`,section:`concierge`,label:`Concierge grant`,description:`What the Concierge may do for you without asking; renew or remove it`,keywords:`permissions approve deny preset`},{id:`team-isolation`,section:`teams`,label:`Team isolation`,description:`Team members see only their teams' sessions, not your other sessions`,keywords:`teams privacy hide members`}],pn=[{id:`admin`,section:`admin`,label:`Users`,description:`Everyone on this hub: roles, disable, remove`,keywords:`admin accounts people`},{id:`admin-machines`,section:`admin`,label:`All machines`,description:`Every machine connected to this hub, by owner`,keywords:`admin revoke`},{id:`admin-audit`,section:`admin`,label:`Audit log`,description:`Who changed what on this hub`,keywords:`admin history`}],mn=(e,t)=>({id:`pref-${e.key}`,section:`notifications`,label:e.label,description:e.description,keywords:`notify ${t}`});function hn(e){return[...fn,...tn.flatMap(e=>e.kinds.map(t=>mn(t,e.title))),...e?pn:[]]}var gn=e=>on.find(t=>t.id===e)?.label??e;function _n(e,t){let n=e.trim().toLowerCase();if(!n)return[];let r=n.split(/\s+/),i=e=>{let t=e.label.toLowerCase();return t.startsWith(n)?0:t.includes(n)?1:r.every(e=>t.includes(e))?2:3};return t.filter(e=>{let t=`${e.label} ${e.description} ${e.keywords??``} ${gn(e.section)}`.toLowerCase();return r.every(e=>t.includes(e))}).map((e,t)=>({e,i:t,r:i(e)})).sort((e,t)=>e.r-t.r||e.i-t.i).map(e=>e.e)}function vn(e,t){let n=e.filter(e=>e.key in t);if(!n.length)return``;let r=n.filter(e=>t[e.key]);return r.length===n.length?`All on`:r.length?`${r.length} of ${n.length} on: ${r.map(e=>e.label).join(`, `)}`:`All off`}var yn=e=>e&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)?e:`/`;function bn(e){let t=e.pathname,n=e.searchParams;if(t===`/pair`)return{name:`pair`,next:yn(n.get(`next`)),error:n.get(`error`)??``};if(t===`/approve`)return{name:`approve`,code:n.get(`code`)??``};if(t===`/new`)return{name:`new`,machine:n.get(`machine`)??void 0,dir:n.get(`dir`)??void 0,key:n.get(`key`)??void 0};if(t===`/panes`)return{name:`panes`};if(t===`/concierge`||t.startsWith(`/concierge/`))return{name:`concierge`};let r=cn(t);if(r)return{name:`settings`,...r};let i=Yt(t);if(i)return{name:`feature`,id:i.dest.id,rest:i.rest};let a=/^\/s\/([^/]+)$/.exec(t);if(a)try{return{name:`session`,id:decodeURIComponent(a[1])}}catch{return{name:`home`}}return{name:`home`}}function xn(){let e=(location.pathname===`/settings`?dn(location.hash):void 0)??Gt(location.pathname,location.search,location.hash);return e&&history.replaceState(history.state,``,e),new URL(location.href)}var[Sn,Cn]=x(xn()),wn=Sn,Tn=()=>bn(Sn()),En=0;function Dn(e,{replace:t=!1}={}){let n=new URL(e,location.origin);n.pathname+n.search+n.hash!==location.pathname+location.search+location.hash&&(history[t?`replaceState`:`pushState`]({},``,n.pathname+n.search+n.hash),t||En++),Cn(xn())}function On(e=`/`){En>0?history.back():Dn(e)}window.addEventListener(`popstate`,()=>{En=Math.max(0,En-1),Cn(xn())}),document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[href]`);if(!t||t.target||t.hasAttribute(`download`)||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=t.getAttribute(`href`)??``;!n.startsWith(`/`)||n.startsWith(`//`)||n.startsWith(`/auth/`)||n.startsWith(`/api/`)||(e.preventDefault(),Dn(n))});var kn=()=>new Set;function An(e){kn=e}var jn=e=>kn().has(e),Mn=e=>kn().has(e)?`/concierge`:`/s/${encodeURIComponent(e)}`,[Nn,Pn]=x(),Fn=Nn,In=0,Ln;function Rn(e,t=``,n){let r=++In;Pn({id:r,text:e,kind:t,action:n}),clearTimeout(Ln),Ln=setTimeout(()=>Nn()?.id===r&&Pn(void 0),n||t?8e3:4e3)}var zn=()=>Pn(void 0);function Bn(e){let t=[];return{ask(n){return new Promise(r=>{t.push({request:n,resolve:r}),t.length===1&&e(n)})},current:()=>t[0]?.request,settle(n){let r=t.shift();r&&(r.resolve(n),e(t[0]?.request))}}}function Vn(e){let t=e.trim(),n=t.indexOf(`
2
2
 
3
3
  `);if(n>=0)return{title:t.slice(0,n).trim(),message:t.slice(n+2).trim()};let r=/\?\s/.exec(t);return r?{title:t.slice(0,r.index+1),message:t.slice(r.index+1).trim()}:{title:t,message:``}}var Hn=e=>e.danger?`cancel`:`primary`,Un=e=>e.repeat&&(e.key===`Enter`||e.key===` `);function Wn(e,t){return Array.from(e.querySelectorAll(`dialog:modal`)).some(e=>!t||!e.contains(t))}var Gn=W(`<dialog class="dialog confirm-dialog"role=alertdialog aria-modal=true aria-labelledby=confirm-dialog-title data-confirm-dialog>`),Kn=W(`<p id=confirm-dialog-message class=confirm-message>`),qn=W(`<form method=dialog><div class=dialog-head><h2 id=confirm-dialog-title></h2></div><div class=dialog-body><div class=dialog-actions><button type=button class=btn data-confirm-cancel></button><button type=submit data-confirm-primary>`),[Jn,Yn]=x(),Xn=Bn(Yn);function Zn(e){return Xn.ask(e)}var Qn=e=>Wn(document,e??void 0);function $n(e,t,n={}){let{title:r,message:i}=Vn(e);return Zn({title:r,message:i,confirm:t,...n})}var er=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function tr(){let e,t,n,r=null;C(()=>{let i=Jn();e&&(i&&!e.open?(r=document.activeElement,e.showModal()):!i&&e.open&&(e.close(),r?.isConnected&&r.focus(),r=null),i&&queueMicrotask(()=>(Hn(i)===`cancel`?n:t)?.focus()))});let i=e=>Xn.settle(e);return(()=>{var r=Gn();r.$$keydown=t=>{if(Un(t)){t.preventDefault();return}if(t.key!==`Tab`||!e)return;let n=[...e.querySelectorAll(er)];if(!n.length)return;let r=n[0],i=n[n.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),i.focus()):!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus())},r.$$click=t=>t.target===e&&i(!1),r.addEventListener(`cancel`,e=>{e.preventDefault(),i(!1)});var a=e;return typeof a==`function`?J(a,r):e=r,Y(r,V(U,{get when(){return Jn()},children:e=>(()=>{var r=qn(),a=r.firstChild,o=a.firstChild,s=a.nextSibling,c=s.firstChild,l=c.firstChild,u=l.nextSibling;r.addEventListener(`submit`,e=>{e.preventDefault(),i(!0)}),Y(o,()=>e().title),Y(s,V(U,{get when(){return e().message},get children(){var t=Kn();return Y(t,()=>e().message),t}}),c),l.$$click=()=>i(!1);var d=n;typeof d==`function`?J(d,l):n=l,Y(l,()=>e().cancel??`Cancel`);var f=t;return typeof f==`function`?J(f,u):t=u,Y(u,()=>e().confirm),S(()=>q(u,`btn primary${e().danger?` danger`:``}`)),r})()})),S(()=>K(r,`aria-describedby`,Jn()?.message?`confirm-dialog-message`:void 0)),r})()}G([`click`,`keydown`]);var nr=W(`<svg viewBox="0 0 24 24"aria-hidden=true>`),rr=W(`<svg><path></svg>`,!1,!0,!1),ir=W(`<span class=voice-dot role=img aria-label="Voice mode on"title="Voice mode on">`),ar=W(`<span class=spinner>`),or=W(`<span role=img>`),sr=W(`<span class=status-dot>`),cr=W(`<button type=button>`),lr=W(`<button type=button aria-haspopup=menu>`),ur=W(`<div class=menu role=menu>`),dr=W(`<div class=menu-sep role=separator>`),fr=W(`<div class=menu-section>`),pr=W(`<span class=menu-hint>`),mr=W(`<kbd class=menu-key>`),hr=W(`<button type=button><span class=menu-check></span><span class=menu-label>`),gr=W(`<div class=dialog-head><h2>`),_r=W(`<div class=dialog-body>`),vr=W(`<dialog>`),yr=W(`<span class=error-badge role=img>!`),br={menu:[`M4 6h16`,`M4 12h16`,`M4 18h16`],sidebar:[`M4 5h16v14H4z`,`M9 5v14`],rail:[`M4 5h16v14H4z`,`M15 5v14`],plus:[`M12 5v14`,`M5 12h14`],file:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`],more:[`M5 12h.01`,`M12 12h.01`,`M19 12h.01`],search:[`M11 4a7 7 0 1 0 0 14a7 7 0 0 0 0-14z`,`M20 20l-4-4`],mic:[`M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z`,`M5 11a7 7 0 0 0 14 0`,`M12 18v3`],wave:[`M3 12h2`,`M7 8v8`,`M11 5v14`,`M15 8v8`,`M19 11v2`],stop:[`M7 7h10v10H7z`],send:[`M12 19V5`,`M5 12l7-7 7 7`],chevron:[`M9 6l6 6-6 6`],down:[`M6 9l6 6 6-6`],close:[`M6 6l12 12`,`M18 6L6 18`],back:[`M15 5l-7 7 7 7`],settings:[`M4 7h10M18 7h2M4 17h4M12 17h8`,`M16 5v4`,`M10 15v4`],branch:[`M6 3v12`,`M18 9a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M6 21a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M18 9a9 9 0 0 1-9 9`],server:[`M4 5h16v6H4z`,`M4 13h16v6H4z`,`M8 8h.01`,`M8 16h.01`],diff:[`M12 3v6`,`M9 6h6`,`M9 18h6`,`M5 3h14v18H5z`],pin:[`M12 17v5`,`M8 3h8l-1 6 3 3H6l3-3z`],muted:[`M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z`,`M5 11a7 7 0 0 0 14 0`,`M4 4l16 16`],home:[`M4 11l8-7 8 7`,`M6 10v10h12V10`],cloud:[`M7 18h10a4 4 0 0 0 .5-7.97A6 6 0 0 0 6.1 9.1A4.5 4.5 0 0 0 7 18z`],folder:[`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`],bell:[`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`,`M10.3 21a1.94 1.94 0 0 0 3.4 0`],watchtower:[`M6 7l6-4 6 4`,`M8 7h8v4H8z`,`M9 11l-2 10`,`M15 11l2 10`,`M8.2 15h7.6`],copy:[`M9 9h11v11H9z`,`M5 15H4V4h11v1`],fork:[`M6 3v5a6 6 0 0 0 6 6`,`M18 3v5a6 6 0 0 1-6 6v7`,`M4 5l2-2 2 2`,`M16 5l2-2 2 2`],undo:[`M9 14L4 9l5-5`,`M4 9h11a5 5 0 0 1 0 10h-3`],download:[`M12 4v11`,`M7 10l5 5 5-5`,`M5 20h14`],edit:[`M4 20h4L19 9l-4-4L4 16z`,`M13 7l4 4`],info:[`M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z`,`M12 11v5`,`M12 8h.01`],check:[`M5 12l5 5 9-10`],spark:[`M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z`,`M19 16l.7 1.8 1.8.7-1.8.7L19 21l-.7-1.8-1.8-.7 1.8-.7z`],split:[`M4 5h16v14H4z`,`M12 5v14`],expand:[`M14 4h6v6`,`M20 4l-7 7`,`M10 20H4v-6`,`M4 20l7-7`],archive:[`M4 5h16v4H4z`,`M6 9v10h12V9`,`M10 13h4`],wrap:[`M4 6h16`,`M4 12h13a3 3 0 0 1 0 6h-4`,`M15 16l-2 2 2 2`,`M4 18h5`],lock:[`M6 11h12v9H6z`,`M8 11V8a4 4 0 0 1 8 0v3`],code:[`M9 8l-4 4 4 4`,`M15 8l4 4-4 4`],image:[`M4 5h16v14H4z`,`M4 16l5-5 4 4 2-2 5 5`,`M15 9h.01`],table:[`M4 5h16v14H4z`,`M4 10h16`,`M4 15h16`,`M10 5v14`],chart:[`M4 20h16`,`M7 16v-5`,`M12 16V7`,`M17 16v-8`],grid:[`M4 4h7v7H4z`,`M13 4h7v7h-7z`,`M4 13h7v7H4z`,`M13 13h7v7h-7z`],stack:[`M4 5h16v14H4z`,`M4 12h16`],grip:[`M9 6h.01`,`M15 6h.01`,`M9 12h.01`,`M15 12h.01`,`M9 18h.01`,`M15 18h.01`],app:[`M4 5h16v14H4z`,`M4 9h16`,`M7 7h.01`,`M10 7h.01`],doc:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M9 12h6`,`M9 16h6`],team:[`M9 11a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M3 20a6 6 0 0 1 12 0`,`M16 11a2.5 2.5 0 1 0 0-5`,`M17 14.2a5 5 0 0 1 4 4.8`]};function xr(e){return(()=>{var t=nr();return Y(t,V(Fe,{get each(){return[...br[e.name]]},children:e=>(()=>{var t=rr();return K(t,`d`,e),t})()})),S(()=>K(t,`class`,`icon ${e.class??``}`)),t})()}var Sr={idle:`Idle`,working:`Running`,blocked:`Needs you`,error:`Error`};function Cr(){return ir()}function wr(e){return(()=>{var t=or();return Y(t,V(U,{get when(){return e.state===`working`},get fallback(){return sr()},get children(){return ar()}})),S(n=>{var r=`status ${e.state} ${e.class??``}`,i=Sr[e.state],a=Sr[e.state];return r!==n.e&&q(t,n.e=r),i!==n.t&&K(t,`aria-label`,n.t=i),a!==n.a&&K(t,`title`,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Tr(e){let[t,n]=Ae(e,[`icon`,`label`,`class`]);return(()=>{var e=cr();return at(e,ke({get class(){return`icon-btn ${t.class??``}`},get"aria-label"(){return t.label},get title(){return t.label}},n),!1,!0),Y(e,V(xr,{get name(){return t.icon}})),e})()}function Er(e){let[t,n]=x(!1),r,i,[a,o]=x({top:0,left:0,right:0,bottom:0}),s=()=>{let e=r.getBoundingClientRect();o({top:e.bottom+4,left:e.left,right:window.innerWidth-e.right,bottom:window.innerHeight-e.top+4})},c=()=>n(!1),l=e=>{if(!t())return;let n=e.target;!r.contains(n)&&!i?.contains(n)&&c()},u=n=>{if(t()){if(n.key===`Escape`){if(Qn(i??r))return;c(),r.focus()}else if(/^[1-9]$/.test(n.key)&&!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement)){let t=e.items().filter(e=>typeof e==`object`&&`run`in e&&!e.disabled)[Number(n.key)-1];t&&(n.preventDefault(),c(),t.run())}}};E(()=>{document.addEventListener(`mousedown`,l),document.addEventListener(`keydown`,u)}),D(()=>{document.removeEventListener(`mousedown`,l),document.removeEventListener(`keydown`,u)});let d=()=>{let t=0;return e.items().map(e=>({item:e,index:typeof e==`object`&&`run`in e&&!e.disabled?++t:0}))};return[(()=>{var i=lr();i.$$click=e=>{e.stopPropagation(),e.preventDefault(),s(),n(!t())};var a=r;return typeof a==`function`?J(a,i):r=i,Y(i,()=>e.text??V(xr,{get name(){return e.icon??`more`}})),S(n=>{var r=e.class??`icon-btn`,a=e.label,o=e.label,s=t();return r!==n.e&&q(i,n.e=r),a!==n.t&&K(i,`aria-label`,n.t=a),o!==n.a&&K(i,`title`,n.a=o),s!==n.o&&K(i,`aria-expanded`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),i})(),V(U,{get when(){return t()},get children(){return V(_t,{get children(){var t=ur(),n=i;return typeof n==`function`?J(n,t):i=t,Y(t,V(Fe,{get each(){return d()},children:({item:e,index:t})=>e===`sep`?dr():`section`in e?(()=>{var t=fr();return Y(t,()=>e.section),t})():(()=>{var n=hr(),r=n.firstChild,i=r.nextSibling;return n.$$click=t=>{t.stopPropagation(),c(),e.run()},Y(r,()=>e.checked?`✓`:``),Y(i,()=>e.label),Y(n,V(U,{get when(){return e.hint},get children(){var t=pr();return Y(t,()=>e.hint),t}}),null),Y(n,V(U,{when:t>0&&t<10,get children(){var e=mr();return Y(e,t),e}}),null),S(t=>{var r=e.checked===void 0?`menuitem`:`menuitemradio`,i=e.checked,a=`menu-item${e.danger?` danger`:``}`,o=e.disabled;return r!==t.e&&K(n,`role`,t.e=r),i!==t.t&&K(n,`aria-checked`,t.t=i),a!==t.a&&q(n,t.a=a),o!==t.o&&(n.disabled=t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),S(n=>rt(t,{...e.up?{bottom:`${a().bottom}px`}:{top:`${a().top}px`},...e.align===`left`?{left:`${a().left}px`}:{right:`${a().right}px`}},n)),t}})}})]}function Dr(e){let t;return C(()=>{let n=e.open;t&&(n&&!t.open?t.showModal():!n&&t.open&&t.close())}),(()=>{var n=vr();n.$$click=n=>n.target===t&&e.onClose(),n.addEventListener(`close`,()=>e.onClose());var r=t;return typeof r==`function`?J(r,n):t=n,Y(n,V(U,{get when(){return e.open},get children(){return[(()=>{var t=gr(),n=t.firstChild;return Y(n,()=>e.title),Y(t,V(Tr,{icon:`close`,label:`Close`,onClick:()=>e.onClose()}),null),t})(),(()=>{var t=_r();return Y(t,()=>e.children),t})()]}})),S(t=>{var r=`dialog${e.wide?` wide`:``} ${e.class??``}`,i=e.title;return r!==t.e&&q(n,t.e=r),i!==t.t&&K(n,`aria-label`,t.t=i),t},{e:void 0,t:void 0}),n})()}var[Or,kr]=x(Date.now());setInterval(()=>kr(Date.now()),3e4);var Ar=Or,[jr,Mr]=x(Date.now());setInterval(()=>Mr(Date.now()),1e3);var Nr=jr;function Pr(e){return(()=>{var t=yr();return S(n=>{var r=`Error: ${e.text}`,i=e.text;return r!==n.e&&K(t,`aria-label`,n.e=r),i!==n.t&&K(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()}function Fr(e,t=Or()){if(!e)return``;let n=Math.max(0,Math.round((t-e)/1e3));return n<45?`just now`:n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`}var Ir=e=>String(e??``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e||``,Lr={herdr:`Herdr`,tui:`TUI`,background:`Background`};G([`click`]);export{bt as $,hn as A,V as At,Ut as B,je as Bt,Dn as C,Fe as Ct,vn as D,Be as Dt,An as E,U as Et,$t as F,ne as Ft,Pt as G,T as Gt,qt as H,ie as Ht,an as I,b as It,Bt as J,Lt as K,Zt as L,x as Lt,en as M,C as Mt,tn as N,w as Nt,ln as O,Le as Ot,nn as P,S as Pt,kt as Q,rn as R,Ne as Rt,wn as S,o as St,Mn as T,Re as Tt,Jt as U,D as Ut,Xt as V,ke as Vt,Rt as W,E as Wt,Vt as X,Ht as Y,At as Z,Fn as _,at as _t,Er as a,Dt as at,On as b,J as bt,wr as c,_t as ct,Ir as d,G as dt,xt as et,Ar as f,Y as ft,Qn as g,it as gt,$n as h,K as ht,Tr as i,Tt as it,sn as j,ee as jt,_n as k,re as kt,Cr as l,tt as lt,tr as m,Qe as mt,Pr as n,Et as nt,Lr as o,Ct as ot,Nr as p,Ye as pt,It as q,xr as r,Ot as rt,Sr as s,yt as st,Dr as t,wt as tt,Fr as u,q as ut,zn as v,rt as vt,Tn as w,Ie as wt,jn as x,i as xt,Rn as y,W as yt,Qt as z,O as zt};
@@ -11,28 +11,17 @@
11
11
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
12
12
  <meta name="apple-mobile-web-app-title" content="Hub" />
13
13
  <title>Hub</title>
14
- <script>
15
- // Color theme before first paint. System is represented by no override.
16
- try {
17
- var t = localStorage.getItem("hub.theme")
18
- if (t === "light" || t === "dark") document.documentElement.dataset.theme = t
19
- } catch (e) {}
20
- // Text size before the first paint (web/src/core/font-scale.ts, key "hub.fontScale", 0.8–1.8).
21
- try {
22
- var s = parseFloat(localStorage.getItem("hub.fontScale"))
23
- if (s >= 0.8 && s <= 1.8) document.documentElement.style.setProperty("--font-scale", String(s))
24
- } catch (e) {}
25
- </script>
14
+ <script src="/theme-boot.js"></script>
26
15
  <link rel="manifest" href="/manifest.webmanifest" />
27
16
  <link rel="icon" href="/favicon.ico" sizes="16x16 32x32 48x48" />
28
17
  <link rel="icon" href="/icon.svg" type="image/svg+xml" />
29
18
  <link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192" />
30
19
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
31
- <script type="module" crossorigin src="/assets/index-g4V9mfSr.js"></script>
32
- <link rel="modulepreload" crossorigin href="/assets/ui-Dh1-78Cl.js">
33
- <link rel="modulepreload" crossorigin href="/assets/pane-layout-DWXfDU-1.js">
20
+ <script type="module" crossorigin src="/assets/index-DifgVuKS.js"></script>
21
+ <link rel="modulepreload" crossorigin href="/assets/ui-Qo2Pd9-O.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/pane-layout-Csk-vPNe.js">
34
23
  <link rel="modulepreload" crossorigin href="/assets/plural-Bspvoqfq.js">
35
- <link rel="stylesheet" crossorigin href="/assets/index-BabrNDB3.css">
24
+ <link rel="stylesheet" crossorigin href="/assets/index-DVSkeAvn.css">
36
25
  </head>
37
26
  <body>
38
27
  <div id="root"></div>
@@ -0,0 +1,12 @@
1
+ // Runs before the first paint (a classic, blocking script in index.html's <head>): an external file, not inline,
2
+ // so the console's Content-Security-Policy (src/central/csp.ts) needs no 'unsafe-inline' or hash.
3
+ // Color theme. System is represented by no override.
4
+ try {
5
+ var t = localStorage.getItem("hub.theme")
6
+ if (t === "light" || t === "dark") document.documentElement.dataset.theme = t
7
+ } catch (e) {}
8
+ // Text size (web/src/core/font-scale.ts, key "hub.fontScale", 0.8–1.8).
9
+ try {
10
+ var s = parseFloat(localStorage.getItem("hub.fontScale"))
11
+ if (s >= 0.8 && s <= 1.8) document.documentElement.style.setProperty("--font-scale", String(s))
12
+ } catch (e) {}
@@ -1 +0,0 @@
1
- import{At as e,B as t,C as n,Ct as r,Et as i,Ft as a,Ht as o,Lt as s,Mt as c,Nt as l,Pt as u,S as d,dt as f,et as p,ft as m,ht as h,i as g,lt as _,pt as v,t as y,u as b,ut as x,wt as S,y as C,yt as w}from"./ui-Dh1-78Cl.js";import{t as T}from"./plural-Bspvoqfq.js";import{C as E,D,E as O,L as k,R as A,S as j,T as M,_ as N,a as P,b as F,c as I,d as L,f as ee,g as R,h as z,i as B,l as V,m as H,n as U,o as W,p as G,r as K,s as q,u as te,v as J,w as Y,x as ne,y as X}from"./index-g4V9mfSr.js";var re=w(`<fieldset class=prof-editor style=border:0;padding:0;margin:0><label>Instructions<textarea rows=6 placeholder="Added after the session's own instructions; local instructions win where they conflict."></textarea></label><label>Preferred model (optional, provider/model)<input type=text placeholder=anthropic/claude-sonnet-4></label><h3>Skills (<!>/<!>)</h3><div><button type=button class="btn small">Add skill</button></div><h3>Commands (<!>/<!>)</h3><p class=prof-note>Templates use <code>{{param}}</code>, <code>{{arguments}}</code> and <code>{{secret:NAME}}</code> (write <code>\\{{</code> for a literal). Secrets are never entered here: the session's machine resolves them.</p><div><button type=button class="btn small">Add command`),ie=w(`<div class=prof-part role=group><div class=prof-part-head><label>Name<input type=text title="2–40 lowercase letters, digits or dashes"></label><label>Description<input type=text></label><button type=button class="btn small danger">Remove</button></div><label>Body<textarea rows=4>`),ae=w(`<div class=prof-part role=group><div class=prof-part-head><label>Name<input type=text title="2–40 lowercase letters, digits or dashes"></label><label>Description<input type=text></label><button type=button class="btn small danger">Remove</button></div><label>Template<textarea rows=3>`),oe=w(`<p class="prof-preview bad">`),se=w(`<p class=prof-preview>`);function Z(t){let n=e=>t.onChange({...t.draft,...e}),r=(e,r)=>n({skills:t.draft.skills.map((t,n)=>n===e?{...t,...r}:t)}),a=(e,r)=>n({commands:t.draft.commands.map((t,n)=>n===e?{...t,...r}:t)});return(()=>{var o=re(),s=o.firstChild,c=s.firstChild.nextSibling,l=s.nextSibling,d=l.firstChild.nextSibling,f=l.nextSibling,p=f.firstChild.nextSibling,g=p.nextSibling.nextSibling;g.nextSibling;var _=f.nextSibling,y=_.firstChild,b=_.nextSibling,x=b.firstChild.nextSibling,C=x.nextSibling.nextSibling;C.nextSibling;var w=b.nextSibling.nextSibling,T=w.firstChild;return c.$$input=e=>n({instructions:e.currentTarget.value}),d.$$input=e=>n({model:e.currentTarget.value}),m(f,()=>t.draft.skills.length,p),m(f,()=>D.skillsPerProfile,g),m(o,e(S,{get each(){return t.draft.skills},children:(e,i)=>(()=>{var a=ie(),o=a.firstChild,s=o.firstChild,c=s.firstChild.nextSibling,l=s.nextSibling,d=l.firstChild.nextSibling,f=l.nextSibling,p=o.nextSibling.firstChild.nextSibling;return h(a,`aria-label`,`Skill ${i+1}`),c.$$input=e=>r(i,{name:e.currentTarget.value}),d.$$input=e=>r(i,{description:e.currentTarget.value}),f.$$click=()=>n({skills:t.draft.skills.filter((e,t)=>t!==i)}),p.$$input=e=>r(i,{body:e.currentTarget.value}),u(t=>{var n=`Remove skill ${e().name||i+1}`,r=D.skillChars;return n!==t.e&&h(f,`aria-label`,t.e=n),r!==t.t&&h(p,`maxlength`,t.t=r),t},{e:void 0,t:void 0}),u(()=>c.value=e().name),u(()=>d.value=e().description),u(()=>p.value=e().body),a})()}),_),y.$$click=()=>n({skills:[...t.draft.skills,{name:``,description:``,body:``}]}),m(b,()=>t.draft.commands.length,x),m(b,()=>D.commandsPerProfile,C),m(o,e(S,{get each(){return t.draft.commands},children:(r,o)=>{let s=()=>H(r().template);return(()=>{var c=ae(),l=c.firstChild,d=l.firstChild,f=d.firstChild.nextSibling,p=d.nextSibling,g=p.firstChild.nextSibling,_=p.nextSibling,y=l.nextSibling.firstChild.nextSibling;return h(c,`aria-label`,`Command ${o+1}`),f.$$input=e=>a(o,{name:e.currentTarget.value}),g.$$input=e=>a(o,{description:e.currentTarget.value}),_.$$click=()=>n({commands:t.draft.commands.filter((e,t)=>t!==o)}),y.$$input=e=>a(o,{template:e.currentTarget.value}),m(c,e(i,{get when(){return r().template.trim()},get children(){return(()=>{let e=s();return`error`in e?(()=>{var t=oe();return m(t,()=>e.error),t})():(()=>{var t=se();return m(t,(()=>{var t=v(()=>!!e.params.length);return()=>t()?`Asks for: ${e.params.join(`, `)}`:`No parameters`})(),null),m(t,(()=>{var t=v(()=>!!e.secrets.length);return()=>t()?` · Secrets (names only): ${e.secrets.join(`, `)}`:``})(),null),t})()})()}}),null),u(e=>{var t=`Remove command ${r().name||o+1}`,n=D.commandChars;return t!==e.e&&h(_,`aria-label`,e.e=t),n!==e.t&&h(y,`maxlength`,e.t=n),e},{e:void 0,t:void 0}),u(()=>f.value=r().name),u(()=>g.value=r().description),u(()=>y.value=r().template),c})()}}),w),T.$$click=()=>n({commands:[...t.draft.commands,{name:``,description:``,template:``}]}),u(e=>{var n=t.disabled,r=D.instructionsChars,i=t.draft.skills.length>=D.skillsPerProfile,a=t.draft.commands.length>=D.commandsPerProfile;return n!==e.e&&(o.disabled=e.e=n),r!==e.t&&h(c,`maxlength`,e.t=r),i!==e.a&&(y.disabled=e.a=i),a!==e.o&&(T.disabled=e.o=a),e},{e:void 0,t:void 0,a:void 0,o:void 0}),u(()=>c.value=t.draft.instructions),u(()=>d.value=t.draft.model),o})()}f([`input`,`click`]);var ce=w(`<select aria-label=Tag><option value>Any tag`),le=w(`<select aria-label=Project><option value>Any project`),ue=w(`<select aria-label=Team><option value>Any team`),de=w(`<select aria-label=Harness><option value>Any harness`),fe=w(`<ul class=prof-items>`),pe=w(`<div class=prof-page><header class=topbar><h1 class=title>Agent profiles</h1><span style=flex:1></span><button type=button class="btn small primary">New profile</button></header><div><nav class=prof-list aria-label=Profiles><div class=prof-filter role=group aria-label=Show><button type=button class="btn small">Active</button><button type=button class="btn small">Archived</button></div><div class=prof-filters role=group aria-label="Filter and sort"><select aria-label=Usage><option value>Used or not</option><option value=used>Used</option><option value=unused>Unused</option></select><select aria-label=Sort><option value=name>Sort: name</option><option value=updated>Sort: recently updated</option><option value=usage>Sort: most used</option></select></div></nav><section class=prof-detail aria-label=Profile>`),Q=w(`<option>`),$=w(`<p class="error small"role=alert>`),me=w(`<p class="muted small">Loading…`),he=w(`<p class="muted small">`),ge=w(`<p class="muted small">No profile matches these filters.`),_e=w(`<div class=prof-intro><h2>Shared agent profiles</h2><p class=prof-note>Versioned instructions, skills and commands you can pin to any session from its top bar. Saving creates a new version; running sessions keep the version they are pinned to until you upgrade each one.`),ve=w(`<span class=prof-desc>`),ye=w(`<span class=prof-chips>`),be=w(`<li><a class=prof-item><strong></strong><span class=prof-sub> · v`),xe=w(`<span class=prof-tag>`),Se=w(`<span>`),Ce=w(`<form class=prof-editor novalidate><label>Name (2–40 lowercase letters, digits or dashes; can't change later)<input type=text autofocus></label><label>Title<input type=text></label><label>Description (optional)<input type=text></label><label>Tags (comma separated, optional)<input type=text></label><div class=row><button type=submit class="btn small primary">Create v1</button><button type=button class="btn small">Cancel`),we=w(`<div><a class="btn small prof-back"href=/profiles>← Profiles`),Te=w(`<p class=error role=alert>`),Ee=w(`<p class=muted>Loading…`),De=w(`<span class="prof-tag archived">archived`),Oe=w(`<div class=prof-head><h2></h2><span class=prof-tag></span><span class=prof-tag>v</span><span style=flex:1></span><button type=button class="btn small">`),ke=w(`<p class=prof-note>`),Ae=w(`<div class=prof-tabs role=tablist aria-label="Profile views"><button type=button role=tab class="btn small">Edit</button><button type=button role=tab class="btn small">History</button><button type=button role=tab class="btn small">Used by`),je=w(`<div class=row style=margin-top:10px><button type=button class="btn small primary">Save as v</button><button type=button class="btn small">Discard changes`),Me=w(`<p class=prof-note>Versions are immutable. Restoring copies an old version into a new one; nothing is rewritten.`),Ne=w(`<ul class=prof-history aria-label=Versions>`),Pe=w(`<span class=prof-tag>latest`),Fe=w(`<button type=button class="btn small">Restore as v`),Ie=w(`<pre>`),Le=w(`<li><strong>v</strong><span class="muted small"></span><span class=mono></span><span style=flex:1></span><button type=button class="btn small">View`),Re=w(`<form class=prof-editor aria-label="Edit details"novalidate><p class=prof-note>Optional details for people browsing the library (no secrets): up to 32 keys (lowercase letters, digits, dashes) and 16 projects. Versions don't change.</p><div class=row><button type=button class="btn small">Add detail</button></div><label>Projects (comma separated)<input type=text></label><div class=row><button type=submit class="btn small primary">Save details</button><button type=button class="btn small">Cancel`),ze=w(`<section class=prof-details aria-label=Details>`),Be=w(`<dt>Tags`),Ve=w(`<dd>`),He=w(`<dl class=prof-facts><dt>Latest</dt><dd>v</dd><dt>Updated</dt><dd></dd><dt>Projects</dt><dd>`),Ue=w(`<button type=button class="btn small">Edit details`),We=w(`<span class=muted>none`),Ge=w(`<dt>`),Ke=w(`<div class=prof-meta-row role=group><input type=text aria-label=Key placeholder="key (e.g. owner)"><input type=text aria-label=Value placeholder=value>`),qe=w(`<section class=prof-usage aria-label="Used by">`),Je=w(`<p class=prof-note> Upgrading a session is always explicit; a new version never reaches a running session by itself.`),Ye=w(`<h3>Sessions`),Xe=w(`<ul class=prof-uses aria-label="Pinned sessions">`),Ze=w(`<button type=button class="btn small">More sessions`),Qe=w(`<h3>Team roles`),$e=w(`<ul class=prof-uses aria-label="Team roles">`),et=w(`<h3>Launches`),tt=w(`<ul class=prof-uses aria-label=Launches>`),nt=w(`<h3>Workspaces and projects`),rt=w(`<ul class=prof-uses aria-label=Workspaces>`),it=w(`<p class=prof-note>Projects: `),at=w(`<p class=prof-note>Hidden for this sign-in: <!>.`),ot=w(`<p class=prof-note>Only part of the <!> is listed; the counts are complete.`),st=w(`<p class="muted small">No session pins this profile.`),ct=w(`<span class=prof-tag>running v`),lt=w(`<span class="prof-use older">older`),ut=w(`<a class="btn small">Open session`),dt=w(`<button type=button class="btn small primary">Upgrade to v`),ft=w(`<li><span></span><strong></strong><span class=prof-tag>v</span><span class="muted small"></span><span style=flex:1>`),pt=w(`<p class="muted small">No team role names this profile.`),mt=w(`<span class="muted small">`),ht=w(`<li><a></a><span>role <strong></strong></span><span class=prof-tag>`),gt=w(`<p class="muted small">No retained launch named this profile.`),_t=w(`<li><span class=mono></span><span class=prof-tag></span><span class=prof-tag>v</span><span class="muted small">`),vt=w(`<p class="muted small">The pinned sessions are in no workspace or project.`),yt=w(`<li><strong></strong><span class="muted small">`),bt=e=>e?`/profiles?id=${encodeURIComponent(e)}`:`/profiles`,xt=()=>t.some(e=>e.route===`/teams`);function St(t){let[o,c]=s(`active`),[d,f]=s(!1),[p,{refetch:v}]=a(o,e=>W(e).then(e=>e.items)),[y,b]=s({}),[S,C]=s(`name`),w=l(()=>ne(p()??[])),T=l(()=>Y(F(p()??[],y()),S())),D=e=>t=>b({...y(),[e]:t.currentTarget.value||void 0});return(()=>{var a=pe(),s=a.firstChild,l=s.firstChild,b=l.nextSibling.nextSibling,O=s.nextSibling,j=O.firstChild,M=j.firstChild,N=M.firstChild,P=N.nextSibling,F=M.nextSibling,I=F.firstChild,L=I.nextSibling,ee=j.nextSibling;return m(s,e(i,{get when(){return k()},get children(){return e(g,{icon:`menu`,label:`Open sidebar`,onClick:A})}}),l),b.$$click=()=>f(!0),N.$$click=()=>c(`active`),P.$$click=()=>c(`archived`),m(F,e(i,{get when(){return w().tags.length},get children(){var t=ce();return t.firstChild,_(t,`change`,D(`tag`)),m(t,e(r,{get each(){return w().tags},children:e=>(()=>{var t=Q();return t.value=e,m(t,e),t})()}),null),u(()=>t.value=y().tag??``),t}}),I),m(F,e(i,{get when(){return w().projects.length},get children(){var t=le();return t.firstChild,_(t,`change`,D(`project`)),m(t,e(r,{get each(){return w().projects},children:e=>(()=>{var t=Q();return t.value=e,m(t,e),t})()}),null),u(()=>t.value=y().project??``),t}}),I),m(F,e(i,{get when(){return w().teams.length},get children(){var t=ue();return t.firstChild,_(t,`change`,D(`team`)),m(t,e(r,{get each(){return w().teams},children:e=>(()=>{var t=Q();return t.value=e,m(t,e),t})()}),null),u(()=>t.value=y().team??``),t}}),I),m(F,e(i,{get when(){return w().harnesses.length},get children(){var t=de();return t.firstChild,_(t,`change`,D(`harness`)),m(t,e(r,{get each(){return w().harnesses},children:e=>(()=>{var t=Q();return t.value=e,m(t,e),t})()}),null),u(()=>t.value=y().harness??``),t}}),I),_(I,`change`,D(`used`)),L.addEventListener(`change`,e=>C(e.currentTarget.value)),m(j,e(i,{get when(){return!p.error},get fallback(){return(()=>{var e=$();return m(e,()=>E(p.error)),e})()},get children(){return e(i,{get when(){return p()},get fallback(){return me()},get children(){return e(i,{get when(){return p().length},get fallback(){return(()=>{var e=he();return m(e,()=>o()===`active`?`No profiles yet. Create one to share instructions, skills and commands across sessions.`:`No archived profiles.`),e})()},get children(){return e(i,{get when(){return T().length},get fallback(){return ge()},get children(){var n=fe();return m(n,e(r,{get each(){return T()},children:n=>e(Ct,{entry:n,get current(){return n.profile.id===t.id}})})),n}})}})}})}}),null),m(ee,e(i,{get when(){return t.id},keyed:!0,get fallback(){return _e()},children:t=>e(Tt,{id:t,onChanged:()=>void v()})})),m(a,e(i,{get when(){return d()},get children(){return e(wt,{onClose:()=>f(!1),onCreated:e=>{f(!1),c(`active`),v(),n(bt(e.id))}})}}),null),u(e=>{var n=`prof-body${t.id?` has-detail`:``}`,r=o()===`active`,i=o()===`archived`;return n!==e.e&&x(O,e.e=n),r!==e.t&&h(N,`aria-pressed`,e.t=r),i!==e.a&&h(P,`aria-pressed`,e.a=i),e},{e:void 0,t:void 0,a:void 0}),u(()=>I.value=y().used??``),u(()=>L.value=S()),a})()}function Ct(t){let n=()=>t.entry.profile,a=()=>t.entry.summary,o=()=>O(t.entry.usage);return(()=>{var s=be(),c=s.firstChild,l=c.firstChild,d=l.nextSibling,f=d.firstChild;return m(l,()=>n().title),m(c,e(i,{get when(){return n().description},get children(){var e=ve();return m(e,()=>n().description),e}}),d),m(d,()=>n().name,f),m(d,()=>n().latestVersion,null),m(d,e(i,{get when(){return a()},children:e=>` · ${T(e().skills,`skill`)} · ${T(e().commands,`command`)}`}),null),m(d,(()=>{var e=v(()=>!!n().updatedAt);return()=>e()?` · updated ${b(n().updatedAt)}`:``})(),null),m(c,e(i,{get when(){return n().tags.length||o().length},get children(){var t=ye();return m(t,e(r,{get each(){return n().tags},children:e=>(()=>{var t=xe();return m(t,e),t})()}),null),m(t,e(r,{get each(){return o()},children:e=>(()=>{var t=Se();return m(t,e),u(()=>x(t,`prof-use${e===`Unused`?` unused`:/older/.test(e)?` older`:``}`)),t})()}),null),t}}),null),u(e=>{var r=bt(n().id),i=t.current?`page`:void 0,a=`${n().title} (${n().name})`;return r!==e.e&&h(c,`href`,e.e=r),i!==e.t&&h(c,`aria-current`,e.t=i),a!==e.a&&h(c,`aria-label`,e.a=a),e},{e:void 0,t:void 0,a:void 0}),s})()}function wt(t){let[n,r]=s({name:``,title:``,description:``,tags:``}),[a,o]=s(X()),[c,l]=s(``),[d,f]=s(!1),h=q(),g=async e=>{e.preventDefault();let r=z(n(),a());if(!r.ok)return l(r.error);f(!0),l(``);try{let e=await K(r.body,h);C(`Created ${e.name} v1`),t.onCreated(e)}catch(e){e instanceof p||(h=q()),l(E(e))}finally{f(!1)}},v=e=>t=>r({...n(),[e]:t.currentTarget.value});return e(y,{open:!0,wide:!0,title:`New agent profile`,get onClose(){return t.onClose},class:`prof-dialog`,get children(){var r=Ce(),s=r.firstChild,l=s.firstChild.nextSibling,f=s.nextSibling,p=f.firstChild.nextSibling,h=f.nextSibling,y=h.firstChild.nextSibling,b=h.nextSibling,x=b.firstChild.nextSibling,S=b.nextSibling,C=S.firstChild,w=C.nextSibling;return r.addEventListener(`submit`,e=>void g(e)),_(l,`input`,v(`name`),!0),_(p,`input`,v(`title`),!0),_(y,`input`,v(`description`),!0),_(x,`input`,v(`tags`),!0),m(r,e(Z,{get draft(){return a()},onChange:o}),S),m(r,e(i,{get when(){return c()},get children(){var e=$();return m(e,c),e}}),S),_(w,`click`,t.onClose,!0),u(()=>C.disabled=d()),u(()=>l.value=n().name),u(()=>p.value=n().title),u(()=>y.value=n().description),u(()=>x.value=n().tags),r}})}function Tt(t){let[n,l]=s(),[d,f]=s(),[g,_]=s(X()),[y,x]=s(``),[S,w]=s(``),[T,D]=s(!1),[O,k]=s(`edit`),A=q(),j=async(e=!1)=>{x(``);try{let{profile:n}=await P(t.id),r=await B(n.id,n.latestVersion);l(n),f(r),e||_(J(r.content))}catch(e){x(E(e))}};c(o(()=>t.id,()=>void j()));let[M,{refetch:F}]=a(()=>O()===`history`?`${t.id}#${n()?.latestVersion??0}`:void 0,()=>ee(t.id).then(e=>e.items)),I=()=>!!d()&&R(g(),d().content),L=async(e,n)=>{A=q(),C(n),t.onChanged(),l(e),await j(),F()},z=async e=>{e instanceof p||(A=q()),w(E(e)),e.code===`conflict`&&(await j(!0),t.onChanged())},V=async()=>{let e=n(),t=d();if(!e||!t)return;let r=N(g());if(!r.ok)return w(r.error);if(!R(g(),t.content))return w(`Nothing changed since v${e.latestVersion}.`);D(!0),w(``);try{let t=await U(e.id,{expectedRevision:e.revision,content:r.content},A);await L(t,`Saved ${t.name} v${t.latestVersion}. Pinned sessions keep their version until you upgrade them.`)}catch(e){await z(e)}finally{D(!1)}},H=async e=>{let t=n();if(t){D(!0),w(``);try{let n=await U(t.id,{expectedRevision:t.revision,fromVersion:e},A);await L(n,`Restored v${e} as v${n.latestVersion}`)}catch(e){await z(e)}finally{D(!1)}}},W=async e=>{let r=n();if(r){D(!0),w(``);try{let n=await te(r,e);l(n),t.onChanged(),C(e?`Archived ${n.name}. Pinned sessions keep their version; it can't be pinned again until unarchived.`:`Unarchived ${n.name}`)}catch(e){await z(e)}finally{D(!1)}}},[G,K]=s(),Y=async e=>{try{let n=await B(t.id,e);K({version:e,text:JSON.stringify(n.content,null,2)})}catch(e){w(E(e))}};return(()=>{var a=we();return a.firstChild,m(a,e(i,{get when(){return!y()},get fallback(){return(()=>{var e=Te();return m(e,y),e})()},get children(){return e(i,{get when(){return n()},get fallback(){return Ee()},children:n=>[(()=>{var t=Oe(),r=t.firstChild,a=r.nextSibling,o=a.nextSibling;o.firstChild;var s=o.nextSibling,c=s.nextSibling;return m(r,()=>n().title),m(a,()=>n().name),m(o,()=>n().latestVersion,null),m(t,e(i,{get when(){return n().state===`archived`},get children(){return De()}}),s),c.$$click=()=>void W(n().state!==`archived`),m(c,()=>n().state===`archived`?`Unarchive`:`Archive`),u(()=>c.disabled=T()),t})(),e(i,{get when(){return n().description},get children(){var e=ke();return m(e,()=>n().description),e}}),e(Et,{get profile(){return n()},get latest(){return d()},onSaved:e=>{l(e),t.onChanged()},onConflict:async()=>{await j(!0),t.onChanged()}}),(()=>{var e=Ae(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;return t.$$click=()=>k(`edit`),n.$$click=()=>k(`history`),r.$$click=()=>k(`usage`),u(e=>{var i=O()===`edit`,a=O()===`history`,o=O()===`usage`;return i!==e.e&&h(t,`aria-selected`,e.e=i),a!==e.t&&h(n,`aria-selected`,e.t=a),o!==e.a&&h(r,`aria-selected`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),e})(),e(i,{get when(){return S()},get children(){var e=$();return m(e,S),e}}),e(i,{get when(){return O()===`edit`},get children(){return[(()=>{var e=ke();return m(e,(()=>{var e=v(()=>n().state===`archived`);return()=>e()?`Unarchive to edit or pin this profile.`:`Saving creates v${n().latestVersion+1}. Sessions pinned to an earlier version keep it until you upgrade each one.`})()),e})(),e(Z,{get draft(){return g()},onChange:_,get disabled(){return n().state===`archived`||T()}}),(()=>{var e=je(),t=e.firstChild;t.firstChild;var r=t.nextSibling;return t.$$click=()=>void V(),m(t,()=>n().latestVersion+1,null),r.$$click=()=>(_(J(d().content)),w(``)),u(e=>{var i=T()||n().state===`archived`||!I(),a=T()||!I();return i!==e.e&&(t.disabled=e.e=i),a!==e.t&&(r.disabled=e.t=a),e},{e:void 0,t:void 0}),e})()]}}),e(i,{get when(){return O()===`usage`},get children(){return e(Ot,{get profile(){return n()},get onChanged(){return t.onChanged}})}}),e(i,{get when(){return O()===`history`},get children(){return[Me(),e(i,{get when(){return v(()=>!M.error)()&&M()},get fallback(){return(()=>{var e=he();return m(e,(()=>{var e=v(()=>!!M.error);return()=>e()?E(M.error):`Loading…`})()),e})()},get children(){var t=Ne();return m(t,e(r,{get each(){return M()},children:t=>(()=>{var r=Le(),a=r.firstChild;a.firstChild;var o=a.nextSibling,s=o.nextSibling,c=s.nextSibling.nextSibling;return m(a,()=>t.version,null),m(r,e(i,{get when(){return t.version===n().latestVersion},get children(){return Pe()}}),o),m(o,()=>b(t.createdAt)),m(s,()=>t.digest.slice(0,12)),c.$$click=()=>void Y(t.version),m(r,e(i,{get when(){return v(()=>t.version!==n().latestVersion)()&&n().state!==`archived`},get children(){var e=Fe();return e.firstChild,e.$$click=()=>void H(t.version),m(e,()=>n().latestVersion+1,null),u(()=>e.disabled=T()),e}}),null),m(r,e(i,{get when(){return G()?.version===t.version},get children(){var e=Ie();return m(e,()=>G().text),u(()=>h(e,`aria-label`,`Version ${t.version} content`)),e}}),null),u(()=>h(s,`title`,t.digest)),r})()})),t}})]}})]})}}),null),a})()}function Et(t){let[n,a]=s(!1),[o,c]=s([]),[l,d]=s(``),[f,p]=s(``),[_,y]=s(!1),x=()=>Object.entries(t.profile.metadata),S=()=>{c([...x().map(([e,t])=>({key:e,value:t})),{key:``,value:``}]),d(t.profile.projects.join(`, `)),p(``),a(!0)},w=(e,t,n)=>c(o().map((r,i)=>i===e?{...r,[t]:n}:r)),D=async e=>{e.preventDefault();let n=j(o(),l());if(!n.ok)return p(n.error);y(!0),p(``);try{let e=await L(t.profile,n.patch);a(!1),C(`Saved the details of ${e.name}`),t.onSaved(e)}catch(e){p(E(e)),e.code===`conflict`&&await t.onConflict()}finally{y(!1)}},O=()=>t.latest?.content;return(()=>{var s=ze();return m(s,e(i,{get when(){return n()},get fallback(){return[(()=>{var n=He(),a=n.firstChild.nextSibling;a.firstChild;var o=a.nextSibling.nextSibling,s=o.nextSibling,c=s.nextSibling;return m(a,()=>t.profile.latestVersion,null),m(a,e(i,{get when(){return O()},children:e=>` · ${e().instructions?`instructions · `:``}${T(e().skills.length,`skill`)} · ${T(e().commands.length,`command`)}${e().model?` · ${e().model}`:``}`}),null),m(o,(()=>{var e=v(()=>!!t.profile.updatedAt);return()=>e()?b(t.profile.updatedAt):`—`})()),m(n,e(i,{get when(){return t.profile.tags.length},get children(){return[Be(),(()=>{var e=Ve();return m(e,()=>t.profile.tags.join(`, `)),e})()]}}),s),m(c,(()=>{var e=v(()=>!!t.profile.projects.length);return()=>e()?t.profile.projects.join(`, `):We()})()),m(n,e(r,{get each(){return x()},children:([e,t])=>[(()=>{var t=Ge();return m(t,e),t})(),(()=>{var e=Ve();return m(e,t),e})()]}),null),n})(),(()=>{var e=Ue();return e.$$click=S,e})()]},get children(){var t=Re(),n=t.firstChild.nextSibling,s=n.firstChild,p=n.nextSibling,v=p.firstChild.nextSibling,y=p.nextSibling,b=y.firstChild,x=b.nextSibling;return t.addEventListener(`submit`,e=>void D(e)),m(t,e(r,{get each(){return o()},children:(t,n)=>(()=>{var r=Ke(),i=r.firstChild,a=i.nextSibling;return i.$$input=e=>w(n(),`key`,e.currentTarget.value),a.$$input=e=>w(n(),`value`,e.currentTarget.value),m(r,e(g,{icon:`close`,get label(){return`Remove detail ${n()+1}`},type:`button`,onClick:()=>c(o().filter((e,t)=>t!==n()))}),null),u(()=>h(r,`aria-label`,`Detail ${n()+1}`)),u(()=>i.value=t.key),u(()=>a.value=t.value),r})()}),n),s.$$click=()=>c([...o(),{key:``,value:``}]),v.$$input=e=>d(e.currentTarget.value),m(t,e(i,{get when(){return f()},get children(){var e=$();return m(e,f),e}}),y),x.$$click=()=>a(!1),u(()=>b.disabled=_()),u(()=>v.value=l()),t}})),s})()}var Dt={sessions:`sessions (needs sessions:read)`,teams:`team roles (needs teams:read)`,launches:`launches (needs sessions:launch)`,workspaces:`workspaces (needs workspaces:read)`};function Ot(t){let[n,{refetch:l}]=a(()=>t.profile.id+`#`+t.profile.latestVersion,()=>V(t.profile.id)),[d,f]=s([]),[p,g]=s(),[_,y]=s();c(o(n,e=>(f([]),g(e?.cursor))));let S=()=>[...n()?.sessions??[],...d()],w=async()=>{let e=p();if(e)try{let n=await V(t.profile.id,e);f([...d(),...n.sessions]),g(n.cursor)}catch(e){C(E(e))}},D=async(e,n)=>{y(e);try{await I(e,{profileID:t.profile.id,version:t.profile.latestVersion,expectedRevision:n}),C(`Asked ${e} to run v${t.profile.latestVersion}; it confirms on its next turn.`),t.onChanged(),l()}catch(e){C(E(e)),l()}finally{y(void 0)}},O=()=>{let e=n()?.counts;return e?[e.sessions===void 0?``:`${T(e.sessions,`session`)}${e.olderVersion?` (${e.olderVersion} on older versions)`:``}`,e.teamRoles===void 0?``:T(e.teamRoles,`team role`),e.launches===void 0?``:T(e.launches,`launch`),e.workspaces===void 0?``:T(e.workspaces,`workspace`)].filter(Boolean).join(` · `):``};return(()=>{var a=qe();return m(a,e(i,{get when(){return!n.error},get fallback(){return(()=>{var e=$();return m(e,()=>E(n.error)),e})()},get children(){return e(i,{get when(){return n()},get fallback(){return me()},children:n=>[(()=>{var e=Je(),t=e.firstChild;return m(e,(()=>{var e=v(()=>!!O());return()=>e()?`${O()}.`:`Nothing you can see uses this profile.`})(),t),e})(),e(i,{get when(){return!n().hidden.includes(`sessions`)},get children(){return[Ye(),e(i,{get when(){return S().length},get fallback(){return st()},get children(){return[(()=>{var n=Xe();return m(n,e(r,{get each(){return S()},children:n=>(()=>{var r=ft(),a=r.firstChild,o=a.nextSibling,s=o.nextSibling;s.firstChild;var c=s.nextSibling;return c.nextSibling,m(o,(()=>{var e=v(()=>!!n.name);return()=>e()?`@${n.name}`:n.title??n.sessionID})()),m(s,()=>n.version,null),m(r,e(i,{get when(){return v(()=>n.running!==void 0)()&&n.running!==n.version},get children(){var e=ct();return e.firstChild,m(e,()=>n.running,null),e}}),c),m(r,e(i,{get when(){return n.olderVersion},get children(){return lt()}}),c),m(c,()=>[n.ack?G[n.ack]+(n.offline?` (offline)`:``):``,n.harness??``,n.machineID??``,n.project??``,n.known?``:`session gone`].filter(Boolean).join(` · `)),m(r,e(i,{get when(){return n.known},get children(){var e=ut();return u(()=>h(e,`href`,`/s/${encodeURIComponent(n.sessionID)}`)),e}}),null),m(r,e(i,{get when(){return v(()=>!!n.olderVersion)()&&t.profile.state===`active`},get children(){var e=dt();return e.firstChild,e.$$click=()=>void D(n.sessionID,n.revision),m(e,()=>t.profile.latestVersion,null),u(()=>e.disabled=_()===n.sessionID),e}}),null),u(e=>{var t=`prof-dot${n.online?` on`:``}`,r=n.online?`online`:`offline`;return t!==e.e&&x(a,e.e=t),r!==e.t&&h(a,`title`,e.t=r),e},{e:void 0,t:void 0}),r})()})),n})(),e(i,{get when(){return p()},get children(){var e=Ze();return e.$$click=()=>void w(),e}})]}})]}}),e(i,{get when(){return!n().hidden.includes(`teams`)},get children(){return[Qe(),e(i,{get when(){return n().teamRoles.length},get fallback(){return pt()},get children(){var t=$e();return m(t,e(r,{get each(){return n().teamRoles},children:t=>(()=>{var n=ht(),r=n.firstChild,a=r.nextSibling,o=a.firstChild.nextSibling,s=a.nextSibling;return m(r,()=>t.teamTitle),m(o,()=>t.label??t.role),m(s,(()=>{var e=v(()=>t.version!==void 0);return()=>e()?`v${t.version}`:`latest`})()),m(n,e(i,{get when(){return t.staffed!==void 0},get children(){var e=mt();return m(e,()=>T(t.staffed,`staffed seat`)),e}}),null),u(()=>h(r,`href`,M(t.teamID,xt()))),n})()})),t}})]}}),e(i,{get when(){return!n().hidden.includes(`launches`)},get children(){return[et(),e(i,{get when(){return n().launches.length},get fallback(){return gt()},get children(){var t=tt();return m(t,e(r,{get each(){return n().launches},children:t=>(()=>{var n=_t(),r=n.firstChild,a=r.nextSibling,o=a.nextSibling;o.firstChild;var s=o.nextSibling;return m(r,()=>t.id),m(a,()=>t.state,null),m(a,(()=>{var e=v(()=>!!t.outcome);return()=>e()?` (${t.outcome})`:``})(),null),m(o,()=>t.version,null),m(s,()=>b(t.updated)),m(n,e(i,{get when(){return t.sessionID},get children(){var e=ut();return u(()=>h(e,`href`,`/s/${encodeURIComponent(t.sessionID)}`)),e}}),null),n})()})),t}})]}}),e(i,{get when(){return!n().hidden.includes(`workspaces`)},get children(){return[nt(),e(i,{get when(){return n().workspaces.length||n().projects.length},get fallback(){return vt()},get children(){return[(()=>{var t=rt();return m(t,e(r,{get each(){return n().workspaces},children:e=>(()=>{var t=yt(),n=t.firstChild,r=n.nextSibling;return m(n,()=>e.title??e.workspaceID),m(r,()=>T(e.sessions,`pinned session`)),t})()})),t})(),e(i,{get when(){return n().projects.length},get children(){var e=it();return e.firstChild,m(e,()=>n().projects.join(`, `),null),e}})]}})]}}),e(i,{get when(){return n().hidden.length},get children(){var e=at(),t=e.firstChild.nextSibling;return t.nextSibling,m(e,()=>n().hidden.map(e=>Dt[e]??e).join(`, `),t),e}}),e(i,{get when(){return n().truncated.length},get children(){var e=ot(),t=e.firstChild.nextSibling;return t.nextSibling,m(e,()=>n().truncated.join(`, `),t),e}})]})}})),a})()}f([`click`,`input`]);function kt(){return e(St,{get id(){return d().searchParams.get(`id`)??void 0}})}export{kt as default};