@continuous-excellence/ze-great-dashboard-client 0.31.68 → 0.31.70

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "index.html": {
3
- "file": "assets/index-DCeHlLVd.js",
3
+ "file": "assets/index-QSjn7LZh.js",
4
4
  "name": "index",
5
5
  "src": "index.html",
6
6
  "isEntry": true,
@@ -0,0 +1,3 @@
1
+ import{z as e}from"zod";import{Component as t,StrictMode as n,createRef as r,useCallback as i,useEffect as a,useId as o,useMemo as s,useRef as c,useState as l,useSyncExternalStore as u}from"react";import{createRoot as d}from"react-dom/client";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{ErrorResponse as h,User as g,UserManager as _,WebStorageStateStore as v}from"oidc-client-ts";import{AuthProvider as y,hasAuthParams as b,useAuth as x}from"react-oidc-context";import{createPortal as S}from"react-dom";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var C=e.enum([`warning`,`blocked`]),w=e.object({assetPath:e.string().min(1),assetPathId:e.string().regex(/^sha256:[a-f0-9]{64}$/),proxyPath:e.string().min(1),board:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1),audience:e.string().min(1)}).optional(),security:C.optional()}),ee=w.pick({assetPath:!0,assetPathId:!0}).extend({serverVersion:e.string().min(1)});function te(t=globalThis.window?.env){let n=w.safeParse(t);if(!n.success)throw Error(`window.env is missing or invalid \u2014 the server did not inject usable configuration.
2
+ ${e.prettifyError(n.error)}`);return n.data}var T=/^([1-9][0-9]*)(ms|s|m|h)$/,E={ms:1,s:1e3,m:6e4,h:36e5};function ne(e){let t=T.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*E[r]}e.string().regex(/^[1-9][0-9]*(?:ms|s|m|h)$/,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand();var D=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),re=e.object({kind:D,message:e.string()}),O=e.discriminatedUnion(`state`,[e.object({panelId:e.string().min(1),state:e.literal(`ok`),observedAt:e.iso.datetime(),link:e.url().nullable(),signal:e.unknown()}),e.object({panelId:e.string().min(1),state:e.literal(`error`),observedAt:e.iso.datetime(),link:e.url().nullable(),error:re})]),ie=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),ae=e.discriminatedUnion(`status`,[e.object({type:e.literal(`test-count`),status:e.literal(`reported`),total:e.number().int().nonnegative(),run:e.object({id:e.string().min(1),attempt:e.number().int().positive(),updatedAt:e.iso.datetime()}).optional(),passed:e.number().int().nonnegative().optional(),failed:e.number().int().nonnegative().optional(),skipped:e.number().int().nonnegative().optional()}),e.object({type:e.literal(`test-count`),status:e.literal(`pending`)}),e.object({type:e.literal(`test-count`),status:e.literal(`not-reported`)})]),oe=e.discriminatedUnion(`state`,[e.object({state:e.literal(`ok`),observedAt:e.iso.datetime(),signal:ae}),e.object({state:e.literal(`error`),observedAt:e.iso.datetime(),error:re})]),k=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`warning`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),testResults:oe.optional(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional(),runStartedAt:e.iso.datetime().optional(),sourceRunId:e.string().min(1).optional(),activity:ie.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),se={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function ce(e){return se[e]}var le=e.object({label:e.string().min(1),status:k.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ue=e.object({type:e.literal(`pull-request-health`),status:k.shape.status,summary:e.string().min(1),workflows:e.array(le),pullRequests:e.array(le),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),de=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),fe=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(de),truncated:e.boolean().optional()}),pe=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:le}),me=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:le}),he=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),ge=12,_e=12;function ve(e){let t=e.flatMap(e=>!e.position||ye(e.position)||be(e.position)?[]:[{panelId:e.id,kind:`out-of-bounds`,position:e.position,conflictsWith:[]}]),n=new Map;for(let r=0;r<e.length;r++){let i=e[r];if(i?.position&&!ye(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||ye(r.position)||!xe(i.position,r.position))continue;let o=`${r.id}\0overlap`,s=n.get(o);if(s)s.conflictsWith.push(i.id);else{let e={panelId:r.id,kind:`overlap`,position:r.position,conflictsWith:[i.id]};n.set(o,e),t.push(e)}}}return{issues:t}}function ye(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function be(e){return!ye(e)&&e.x+e.w<=ge&&e.y+e.h<=_e}function xe(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}var Se={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function Ce(e,t){let n=(e,t)=>ne(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,Se.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,Se.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,Se.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,Se.runningCompletionWindowMillis)}}var we=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`],Te=e.strictObject({oidc:e.literal(!0),policy:e.discriminatedUnion(`mode`,[e.strictObject({mode:e.literal(`authenticated`)}),e.strictObject({mode:e.literal(`subjects`)}),e.strictObject({mode:e.literal(`claim`),claim:e.string().min(1),match:e.enum([`any`,`all`])})])}),Ee=e.object({id:e.string().min(1),attempt:e.number().int().positive(),updatedAt:e.iso.datetime(),total:e.number().int().nonnegative()}),De=e.object({inspectedAt:e.iso.datetime(),inspectedRuns:e.number().int().min(0).max(8),complete:e.boolean(),samples:e.array(Ee).max(8),retryAt:e.iso.datetime().optional()});function Oe(e,t){if(!e)return;let n=/^\d+$/.test(e)?t+Number(e)*1e3:Date.parse(e);return Number.isFinite(n)&&n>t?n:void 0}var A={board:`_board_12472_1`,header:`_header_12472_11`,attentionRail:`_attentionRail_12472_18`,attentionGlyph:`_attentionGlyph_12472_43`,"attention-beacon":`_attention-beacon_12472_46`,"attention-alarm":`_attention-alarm_12472_51`,"attention-steady":`_attention-steady_12472_59`,title:`_title_12472_81`,grid:`_grid_12472_87`,footerTools:`_footerTools_12472_97`,layoutWarning:`_layoutWarning_12472_102`,layoutWarningButton:`_layoutWarningButton_12472_105`,layoutWarningDialog:`_layoutWarningDialog_12472_123`,layoutWarningHeading:`_layoutWarningHeading_12472_136`,layoutWarningClose:`_layoutWarningClose_12472_154`,layoutWarningDownloads:`_layoutWarningDownloads_12472_162`,layoutWarningNote:`_layoutWarningNote_12472_181`,footer:`_footer_12472_97`};function ke(e){return e.board?.attention?e.board.panels.flatMap(t=>{if(!t.attention)return[];let n=t.label??t.id;if(t.type===`http-value`&&t.facts)return t.facts.flatMap(r=>{let i=e.factSignals[t.id]?.[r.id],a=Ae(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=je(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function Ae(e){if(e?.failure)return`Updates unavailable — ${e.failure}`;if(e?.updateHealth)return`Updates unavailable — ${e.updateHealth.message}`;if(e?.envelope)return e.envelope.state===`error`?e.envelope.error.message:he.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function je(e,t,n){if(n)return`Updates unavailable — ${n.message}`;if(t){if(t.state===`error`)return t.error.message;if(e===`pipeline-status`){let e=k.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=ue.safeParse(t.signal);if(!e.success)return`Invalid signal`;if(e.data.status===`failed`)return e.data.summary;let n=e.data.incompleteObservations?.[0];return n?`${n.label}: ${n.message}`:void 0}if(e===`http-value`)return he.safeParse(t.signal).success?void 0:`Invalid value`}}var j={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function Me({log:e,updateActivity:t}){let[n,r]=l(!1);u(e.subscribe,e.snapshot,e.snapshot);let i=e.count(),a=e.githubConsistencyIncidentCount(),o=e.summary();return m(`section`,{className:j.diagnostics,children:[m(`button`,{className:j.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&m(`div`,{className:j.area,children:[m(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),m(`p`,{children:[o.retained.eventCount,` retained browser-local events across`,` `,o.retained.sessionCount,` session`,o.retained.sessionCount===1?``:`s`,o.retained.firstEventAt&&o.retained.lastEventAt?` (${Ne(o.retained.firstEventAt,o.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),o.retained.evidenceMayBeIncomplete&&m(`p`,{className:j.warning,role:`alert`,children:[`Earlier evidence was pruned: `,o.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,o.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),m(`p`,{children:[`Update failures: `,o.failures.clientUpdate,`; board fetch failures:`,` `,o.failures.boardFetch,`.`]}),e.githubConsistencyIncidentCount()>0&&m(`p`,{className:j.warning,role:`alert`,children:[`GitHub API consistency incidents: `,e.githubConsistencyIncidentCount(),`. A response older than the last accepted run was rejected; download diagnostics to report it.`]}),o.panels.length>0&&p(`div`,{className:j.panels,children:o.panels.map(e=>m(`p`,{children:[p(`strong`,{children:e.panelId}),` — `,e.requests,` requests`,Object.keys(e.httpStatuses).length?`; HTTP ${Object.entries(e.httpStatuses).map(([e,t])=>`${e}×${t}`).join(`, `)}`:``,`; parse/network failures `,e.parseFailures,`/`,e.networkFailures,`; visible changes `,e.visibleStateChanges,`; latest`,` `,e.latestRendered?`${e.latestRendered.state}${e.latestRendered.status?`/${e.latestRendered.status}`:``}`:`not rendered`,`.`,e.latestFailedObservation&&m(f,{children:[` `,`Failure: `,e.latestFailedObservation.reason,`. Support reference:`,` `,p(`code`,{children:e.latestFailedObservation.supportReference??`not provided`}),`.`]})]},e.panelId))}),m(`div`,{className:j.actions,children:[p(`button`,{className:j.button,type:`button`,onClick:()=>{let n=new Blob([JSON.stringify(e.export(t?{updateActivity:t()}:{}),null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,i.click(),URL.revokeObjectURL(r)},children:`Download`}),p(`button`,{className:j.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function Ne(e,t){return e===t?e:`${e} to ${t}`}function Pe(){try{return window.localStorage}catch{return}}function Fe(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Ie(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Le(e,t){try{e?.removeItem(t)}catch{}}function Re(e,t,n=0){let r=new Map,i=new Set,a=0,o=0;for(let t of e){if(i.add(t.sessionId),t.kind===`client-update-failure`&&a++,(t.kind===`board-fetch-failure`||t.kind===`board-fetch-parse-failure`)&&o++,!(`panelId`in t))continue;let e=r.get(t.panelId)??{panelId:t.panelId,requests:0,httpStatuses:{},parseFailures:0,networkFailures:0,visibleStateChanges:0};if(t.kind===`panel-fetch-start`&&e.requests++,t.kind===`panel-fetch-response`){if(t.status!==void 0){let n=String(t.status);e.httpStatuses[n]=(e.httpStatuses[n]??0)+1}t.failure&&(e.latestFailedObservation=t.failure)}t.kind===`panel-fetch-parse-failure`&&e.parseFailures++,t.kind===`panel-fetch-failure`&&e.networkFailures++,t.kind===`panel-rendered`&&(e.visibleStateChanges++,e.latestRendered=t.rendered),r.set(t.panelId,e)}let s=e.map(e=>e.at).sort(),c=t.eventsPrunedByAge+t.eventsPrunedByCount;return{githubConsistencyIncidents:n,retained:{eventCount:e.length,firstEventAt:s[0],lastEventAt:s.at(-1),sessionCount:i.size,retention:t,evidenceMayBeIncomplete:c>0},failures:{clientUpdate:a,boardFetch:o},panels:[...r.values()].sort((e,t)=>e.panelId.localeCompare(t.panelId))}}var ze=`0.31.70`,Be=`ze-great-dashboard.diagnostics.v2`,Ve=`ze-great-dashboard.diagnostics.v1`,He=2e3,Ue=6048e5,We=[`session-start`,`auth-session`,`client-update-check`,`client-update-response`,`client-update-failure`,`client-update-detected`,`board-fetch-start`,`board-fetch-response`,`board-fetch-parse-failure`,`board-fetch-failure`,`layout-analyzed`,`panel-fetch-start`,`panel-fetch-response`,`panel-fetch-parse-failure`,`panel-fetch-failure`,`panel-rendered`,`test-history-repair`],Ge=class{env;storage;now;events=[];retention=Je();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=Pe(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Le(this.storage,Ve),this.events=this.read(),this.record({kind:`session-start`})}recordGithubConsistencyIncident(e){this.incidents.push({...e,at:this.now().toISOString(),board:this.env.board}),this.persist(),this.revision++,this.notify()}githubConsistencyIncidentCount=()=>this.incidents.length;record(e){let t=Xe([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:ze,clientAssetPath:this.env.assetPath,clientAssetPathId:this.env.assetPathId}],this.now(),this.retention);this.events=t.events,this.retention=t.retention,this.persist(),this.revision++,this.notify()}count=()=>this.events.length;clientVersion=()=>ze;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Re(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=Je(),Le(this.storage,Be),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:ze,assetPath:this.env.assetPath,assetPathId:this.env.assetPathId,board:this.env.board,sessionId:this.sessionId},events:this.events,githubConsistencyIncidents:this.incidents,summary:this.summary(),...e});read(){let e=Fe(this.storage,Be);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(Ze))return Le(this.storage,Be),[];let t=Xe(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Ye(e.retention));return this.retention=t.retention,this.incidents=Ke(e.githubConsistencyIncidents),t.events}persist(){Ie(this.storage,Be,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function Ke(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.at==`string`&&typeof t.board==`string`&&typeof t.panelId==`string`&&typeof t.endpoint==`string`&&!!t.accepted&&!!t.regressed&&!!t.response}):[]}function qe(e){let t=Object.fromEntries([[`cacheControl`,`cache-control`],[`etag`,`etag`],[`lastModified`,`last-modified`],[`date`,`date`],[`age`,`age`]].flatMap(([t,n])=>{let r=e.get(n);return r?[[t,r]]:[]}));return Object.keys(t).length?t:void 0}function Je(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Ye(e){if(!e||typeof e!=`object`)return Je();let t=e;return{eventsPrunedByAge:typeof t.eventsPrunedByAge==`number`&&t.eventsPrunedByAge>=0?t.eventsPrunedByAge:0,eventsPrunedByCount:typeof t.eventsPrunedByCount==`number`&&t.eventsPrunedByCount>=0?t.eventsPrunedByCount:0}}function Xe(e,t,n){let r=t.valueOf()-Ue,i=e.filter(e=>Number.isFinite(new Date(e.at).valueOf())&&new Date(e.at).valueOf()>=r),a=e.length-i.length,o=Math.max(0,i.length-He);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function Ze(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.schemaVersion===void 0||t.schemaVersion===2)&&typeof t.at==`string`&&Number.isFinite(new Date(t.at).valueOf())&&typeof t.sessionId==`string`&&typeof t.board==`string`&&We.includes(t.kind)}function M(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,ze),a.set(`X-Dashboard-Client-Origin`,globalThis.window.location.origin),a.set(`X-Dashboard-Client-Asset-Id`,e.assetPathId),i.accessToken&&a.set(`authorization`,`Bearer ${i.accessToken}`),r(t,{...n,headers:a}).then(e=>((e.status===401||e.status===403)&&i.onAuthenticationFailure?.(e.status),e))}function Qe({board:e,layout:t,env:n,auth:r}){let[i,o]=l(!1),s=`layout-warning-${e}`;a(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let c=`${n.proxyPath}/boards/${encodeURIComponent(e)}`;return m(`div`,{className:A.layoutWarning,"data-layout-warning":!0,children:[m(`button`,{className:A.layoutWarningButton,type:`button`,"aria-label":`Layout warnings (${t.issues.length})`,"aria-expanded":i,"aria-controls":s,onClick:()=>o(!i),children:[p(`span`,{"aria-hidden":`true`,children:`⚠`}),p(`span`,{children:t.issues.length})]}),i&&m(`aside`,{className:A.layoutWarningDialog,id:s,role:`dialog`,"aria-labelledby":`${s}-title`,"aria-modal":`false`,children:[m(`div`,{className:A.layoutWarningHeading,children:[p(`strong`,{id:`${s}-title`,children:`Layout warnings`}),p(`button`,{className:A.layoutWarningClose,type:`button`,"aria-label":`Close layout warnings`,onClick:()=>o(!1),children:`×`})]}),m(`p`,{children:[t.issues.length,` layout issue`,t.issues.length===1?``:`s`,` detected against the intended 12×12 space. The live board is unchanged: explicit overlaps remain overlapped and overflow continues in implicit rows.`]}),p(`ul`,{children:t.issues.map(e=>m(`li`,{children:[p(`strong`,{children:e.panelId}),`: `,e.kind,` at (`,e.position.x,`,`,` `,e.position.y,`), `,e.position.w,`×`,e.position.h,e.conflictsWith.length?`; overlaps ${e.conflictsWith.join(`, `)}`:``]},`${e.panelId}-${e.kind}`))}),m(`div`,{className:A.layoutWarningDownloads,children:[p(`button`,{type:`button`,onClick:()=>void $e(n,`${c}/rendered`,r),children:`Download legal rendered layout`}),p(`button`,{type:`button`,onClick:()=>void $e(n,`${c}/authored`,r),children:`Download authored layout`})]}),p(`p`,{className:A.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}async function $e(e,t,n){let r=await M(e,t,void 0,globalThis.fetch,n);if(!r.ok)throw Error(`Layout download returned ${r.status}`);let i=document.createElement(`a`);i.href=URL.createObjectURL(await r.blob()),i.download=r.headers.get(`content-disposition`)?.match(/filename="([^"]+)"/)?.[1]??`layout.yaml`,i.click(),URL.revokeObjectURL(i.href)}var et={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},tt=class{values=new Map;async set(e,t){this.values.set(e,t)}async get(e){return this.values.get(e)??null}async remove(e){let t=this.values.get(e)??null;return this.values.delete(e),t}async getAllKeys(){return[...this.values.keys()]}};function nt(e){let t=new _({authority:e.issuer,client_id:e.clientId,redirect_uri:`${window.location.origin}/`,post_logout_redirect_uri:`${window.location.origin}/`,response_type:`code`,scope:`openid profile offline_access`,resource:e.audience,extraQueryParams:{audience:e.audience},userStore:new tt,stateStore:new v({store:window.sessionStorage}),automaticSilentRenew:!0,maxSilentRenewTimeoutRetries:1}),n=rt(window);return n&&t.storeUser(new g({access_token:n.accessToken,expires_at:n.expiresAt,scope:n.scope,token_type:n.tokenType,profile:{iss:e.issuer,aud:e.clientId,exp:n.expiresAt,iat:n.expiresAt-1,sub:`playwright-token-bootstrap`}})),t}function rt(e=window){let t=e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__;if(delete e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__,t&&typeof t.accessToken==`string`&&t.accessToken&&Number.isSafeInteger(t.expiresAt)&&typeof t.scope==`string`&&typeof t.tokenType==`string`)return t}function it({env:e,auth:t,children:n}){let r=s(()=>nt(t),[t]),[a,o]=l(),c=s(()=>a?{...e,board:a}:e,[e,a]),u=s(()=>new Ge(c),[c]),d=i(e=>{let t=typeof e==`string`&&e?e:void 0,n=t?`/boards/${encodeURIComponent(t)}`:window.location.pathname;window.history.replaceState({},document.title,n),o(t)},[]);return p(y,{userManager:r,onSigninCallback:e=>d(e?.state),children:p(at,{env:c,diagnostics:u,diagnosticsControl:p(Me,{log:u}),completeCallback:d,children:(e,t)=>n(e,t,c,u)})})}function at({env:e,diagnostics:t,diagnosticsControl:n,completeCallback:r,children:o}){let s=x(),[u,d]=l(!1),[g]=l(b),[_,v]=l(),y=c(!1),S=c(void 0),C=c(void 0),w=`dashboard.signed-out:${e.auth?.issuer}:${e.auth?.clientId}`,ee=i(()=>d(!0),[]),{events:te,user:T,error:E,signinRedirect:ne}=s,D=!!T&&(T===_||T.expired),re=window.location.pathname.startsWith(`/boards/`)?e.board:void 0;a(()=>{s.isAuthenticated||d(!1)},[s.isAuthenticated]),a(()=>{if(T?.expires_at)return te.addAccessTokenExpired(()=>v(T))},[te,T]),a(()=>{T&&!T.expired&&T!==C.current&&(C.current=T,t.record({kind:`auth-session`,outcome:`ready`,hasRefreshToken:!!T.refresh_token}))},[t,T]),a(()=>{if(!E||E===S.current)return;S.current=E;let e=E.innerError;t.record({kind:`auth-session`,outcome:`failed`,phase:E.source===`renewSilent`?`renewal`:E.source===`signinCallback`?`callback`:`navigation`,reason:ot(e)}),E.source===`signinCallback`&&b()&&r(e instanceof h?e.state:void 0)},[r,t,E]);let O=!y.current&&!s.isLoading&&!s.activeNavigator&&!u&&(!g||s.isAuthenticated)&&(!s.isAuthenticated||D&&E?.source===`renewSilent`)&&!window.sessionStorage.getItem(w);return a(()=>{O&&!y.current&&(y.current=!0,t.record({kind:`auth-session`,outcome:`restoring`,trigger:D?`expiry`:`startup`}),ne({prompt:`none`,redirectMethod:`replace`,state:re}))},[t,D,re,O,ne]),O||s.isLoading||s.isAuthenticated&&D&&!E?p(`main`,{className:et.auth,"aria-live":`polite`,children:O||y.current||D?`Restoring session…`:`Signing in…`}):u?m(`main`,{className:et.auth,children:[p(`h1`,{children:`Access denied`}),p(`p`,{children:`Your authenticated identity is not permitted to view this dashboard.`}),n]}):!s.isAuthenticated||D||!T?.access_token?m(`main`,{className:et.auth,children:[p(`h1`,{children:e.board}),p(`p`,{children:`Sign in to view the dashboard.`}),p(`button`,{type:`button`,onClick:()=>{window.sessionStorage.removeItem(w),t.record({kind:`auth-session`,outcome:`sign-in-selected`}),ne({state:re})},children:`Sign in`}),n]}):m(f,{children:[p(`button`,{className:et.signout,type:`button`,onClick:()=>{window.sessionStorage.setItem(w,`1`),t.record({kind:`auth-session`,outcome:`sign-out-selected`}),s.signoutRedirect()},children:`Sign out`}),o(T.access_token,ee)]})}function ot(e){if(e instanceof h)switch(e.error){case`login_required`:case`interaction_required`:case`consent_required`:case`account_selection_required`:case`invalid_grant`:return e.error}return e instanceof Error&&e.name===`ErrorTimeout`?`timeout`:`other`}var N={panel:`_panel_1n078_1`,attentionActive:`_attentionActive_1n078_22`,content:`_content_1n078_26`,evidence:`_evidence_1n078_38`,sourceAction:`_sourceAction_1n078_42`,details:`_details_1n078_46`,statusBand:`_statusBand_1n078_54`,error:`_error_1n078_80`,wide:`_wide_1n078_83`,"density-comfortable":`_density-comfortable_1n078_86`,"density-compact":`_density-compact_1n078_93`,label:`_label_1n078_103`,typeGlyph:`_typeGlyph_1n078_114`,identityText:`_identityText_1n078_117`,hint:`_hint_1n078_123`,branch:`_branch_1n078_129`,observed:`_observed_1n078_133`,meta:`_meta_1n078_139`,metaValue:`_metaValue_1n078_142`,compactValue:`_compactValue_1n078_146`,warning:`_warning_1n078_149`,serious:`_serious_1n078_152`,status:`_status_1n078_54`,statusGlyph:`_statusGlyph_1n078_160`,compactOnlyStatus:`_compactOnlyStatus_1n078_163`,passed:`_passed_1n078_169`,failed:`_failed_1n078_172`,running:`_running_1n078_176`,cancelled:`_cancelled_1n078_179`,unknown:`_unknown_1n078_180`,shallow:`_shallow_1n078_213`,"density-auto":`_density-auto_1n078_214`,fullValue:`_fullValue_1n078_372`,statusText:`_statusText_1n078_467`};function st({label:e,hint:t,wide:n=!1}){return m(`section`,{className:`${N.panel} ${n?N.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[p(`h2`,{className:N.label,children:e}),p(`p`,{className:N.hint,children:t})]})}function ct(e){switch(e){case`unauthorized`:return{label:`Access denied`,emphasis:`serious`};case`not-found`:return{label:`Source not found`,emphasis:`serious`};case`unreachable`:case`upstream-error`:return{label:`Source unavailable`,emphasis:`serious`};case`no-runs`:return{label:`No workflow runs`,emphasis:`warning`}}}var P={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`},lt=`(prefers-reduced-motion: reduce)`,ut=class extends t{root=r();animations=new Set;preference;componentDidMount(){this.preference=window.matchMedia?.(lt),this.preference?.addEventListener(`change`,this.onPreferenceChange)}getSnapshotBeforeUpdate(e){return e.layoutKey===void 0||e.layoutKey===this.props.layoutKey?null:this.props.layoutKey!==void 0&&!this.preference?.matches?this.positions():new Map}componentDidUpdate(e,t,n){if(n&&(this.cancelAnimations(),n.size&&!this.preference?.matches))for(let[e,t]of this.positions()){let r=n.get(e);if(r?.element!==t.element)continue;let i=r.x-t.x,a=r.y-t.y;if(Math.abs(i)<.5&&Math.abs(a)<.5)continue;let o=t.element.animate?.([{translate:`${i}px ${a}px`},{translate:`0px 0px`}],{duration:200,easing:`ease-out`});o&&(this.animations.add(o),o.onfinish=()=>this.animations.delete(o))}}componentWillUnmount(){this.preference?.removeEventListener(`change`,this.onPreferenceChange),this.cancelAnimations()}positions(){let e=new Map,t=this.root.current?.querySelectorAll(`[data-panel-motion]`);for(let n of t??[]){let t=n.dataset.panelMotion;if(!t||n.closest(`[data-panel]`)!==this.root.current)continue;let{x:r,y:i,width:a,height:o}=n.getBoundingClientRect();a&&o&&getComputedStyle(n).visibility===`visible`&&e.set(t,{element:n,x:r,y:i})}return e}onPreferenceChange=e=>{e.matches&&this.cancelAnimations()};cancelAnimations(){for(let e of this.animations)e.cancel();this.animations.clear()}render(){return this.props.children(this.root)}};function dt(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}var ft={passed:{glyph:`✓`,label:`Passed`},failed:{glyph:`✕`,label:`Failed`},warning:{glyph:`⚠`,label:`Warning`},running:{glyph:`↻`,label:`Running`},cancelled:{glyph:`⊘`,label:`Cancelled`},unknown:{glyph:`?`,label:`Unknown`}};function pt(e){return Z(e)?.symbol}function F({children:e,className:t,title:n}){return p(`p`,{className:`${N.hint} ${t??``}`,title:n,children:e})}function I({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s,motionId:c}){return m(`p`,{className:`${N.hint} ${a?N.observed:``} ${o?N[o]:``} ${N.meta} ${s??``}`,"data-panel-meta":!0,"data-panel-motion":c,children:[p(`span`,{"aria-hidden":`true`,children:e}),` `,m(`span`,{className:`screen-reader-only`,children:[t,`: `]}),m(`span`,{className:N.metaValue,title:i,children:[p(`span`,{className:N.fullValue,children:n}),r&&p(`span`,{className:N.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function L({children:e,className:t,priority:n=`secondary`,anchor:r}){return p(`div`,{className:`${N.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function R({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1,motionId:a}){return m(`p`,{className:`${N.status} ${e?N[e]:``} ${t?N[t]:``} ${i?N.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&p(`span`,{className:N.statusGlyph,"aria-hidden":`true`,"data-panel-motion":a,children:n}),n&&r&&` `,p(`span`,{className:`screen-reader-only`,children:r})]})}function mt({children:e,emphasis:t}){return p(`p`,{className:`${N.status} ${t?N[t]:``}`,children:e})}function z({panel:e,envelope:t,sourceLink:n,busy:r,attentionActive:i=!1,error:a=!1,field:o,layout:s,layoutMotionKey:c,children:l}){let u=e.density??`auto`,d=e.position,f=pt(e.type),h=d!==void 0&&d.h<=2,g=d!==void 0&&d.h<=3;return p(ut,{layoutKey:c,children:_=>m(`section`,{ref:_,className:`${N.panel} ${N[`density-${u}`]} ${h?N.shallow:``} ${g?N.short:``} ${a?N.error:``} ${i?N.attentionActive:``}`,id:`panel-${e.id}`,style:dt(e),"aria-busy":r===!0?!0:t||r===!1?void 0:!0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":d?`${d.x},${d.y},${d.w},${d.h}`:void 0,"data-density":u,"data-shallow":h,"data-short":g,"data-error":a||void 0,"data-panel-type":e.type,"data-attention-active":i||void 0,children:[o,p(ht,{panelId:e.id,link:t?.link??n,motionId:c===void 0?void 0:`source`}),m(`div`,{className:`${N.content} ${s===`status-band`?N.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":s,children:[m(`h2`,{className:N.label,"data-panel-anchor":`identity`,"data-panel-motion":c===void 0?void 0:`title`,children:[f&&p(`span`,{className:N.typeGlyph,"aria-hidden":`true`,title:f.label,"data-panel-type-glyph":!0,children:f.glyph}),p(`span`,{className:N.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),l]})]})})}function ht({panelId:e,link:t,motionId:n}){return t?m(`a`,{className:N.sourceAction,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,"data-panel-action":`source`,"data-panel-link":!0,"data-panel-motion":n,children:[p(`span`,{"aria-hidden":`true`,children:`↗`}),p(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function B({value:e,label:t=`Observed`}){return p(yt,{value:e,label:t})}function gt({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r,motionId:i}){return n&&r?p(yt,{value:r,label:`Started`,motionId:i}):p(yt,{value:e??t,label:e?`Last update`:`Observed`,motionId:i})}function _t({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return m(f,{children:[p(I,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),p(yt,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function vt({value:e}){return p(yt,{value:e,label:`Last confirmed`})}function yt({value:e,label:t,motionId:n}){let r=new Date(e),i=r.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),a=Date.now()-r.getTime(),o=`${t} ${bt(a)}`;return p(I,{glyph:`◷`,label:t,value:o,compact:{kind:`short-value`,value:xt(a)},title:`${t} at ${i}`,observed:!0,motionId:n})}function bt(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function xt(e){if(e<6e4)return`now`;let t=Math.floor(e/6e4);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function St({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return p(Ct,{panel:e,attentionActive:n,facts:i});if(!t)return p(z,{panel:e,attentionActive:n,children:p(L,{children:p(F,{children:`Loading…`})})});if(t.state===`error`){let r=ct(t.error.kind);return p(z,{panel:e,envelope:t,attentionActive:n,error:!0,children:m(L,{children:[p(R,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),p(F,{children:t.error.message})]})})}let a=he.safeParse(t.signal);return a.success?p(z,{panel:e,envelope:t,attentionActive:n,children:m(L,{className:P.fact,children:[p(R,{glyph:`✓`,label:`Value read`,compactOnly:!0}),p(mt,{children:String(a.data.value)}),p(B,{value:t.observedAt}),r&&p(_t,{health:r})]})}):p(z,{panel:e,envelope:t,attentionActive:n,error:!0,children:p(L,{children:p(R,{glyph:`⚠`,label:`Invalid value`})})})}function Ct({panel:e,attentionActive:t,facts:n}){return e.facts?p(z,{panel:e,attentionActive:t,children:p(L,{children:p(`div`,{className:P.facts,"data-http-value-facts":!0,children:e.facts.map(e=>p(wt,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function wt({label:e,observation:t}){let n=t?.envelope;if(!n)return m(`section`,{className:P.factCell,"data-http-value-fact":!0,children:[p(`h3`,{children:e}),p(mt,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&p(_t,{health:t.updateHealth})]});if(n.state===`error`){let t=ct(n.error.kind);return m(`section`,{className:P.factCell,"data-http-value-fact":!0,"data-error":!0,children:[p(Tt,{label:e,link:n.link}),p(`h3`,{children:e}),p(R,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),p(F,{children:n.error.message}),p(B,{value:n.observedAt})]})}let r=he.safeParse(n.signal);return r.success?m(`section`,{className:P.factCell,"data-http-value-fact":!0,children:[p(Tt,{label:e,link:n.link}),p(`h3`,{children:e}),p(mt,{children:String(r.data.value)}),p(B,{value:n.observedAt})]}):m(`section`,{className:P.factCell,"data-http-value-fact":!0,"data-error":!0,children:[p(Tt,{label:e,link:n.link}),p(`h3`,{children:e}),p(R,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),p(B,{value:n.observedAt})]})}function Tt({label:e,link:t}){return t?m(`a`,{className:P.factSource,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,children:[p(`span`,{"aria-hidden":`true`,children:`↗`}),p(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}var Et={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},Dt={field:`_field_1x3vm_1`,grid:`_grid_1x3vm_10`,piece:`_piece_1x3vm_14`,cell:`_cell_1x3vm_34`,clearingCell:`_clearingCell_1x3vm_38`,"clear-cell":`_clear-cell_1x3vm_1`},Ot=.85,kt=[[{x:0,y:0},{x:1,y:0}],[{x:0,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:2,y:0}],[{x:0,y:0},{x:0,y:1},{x:1,y:1}]];function At(e,t){return e>t?`horizontal`:`vertical`}function jt(e,t=e===`horizontal`?12:3,n=e===`horizontal`?3:12){let r=Math.max(1,t*.8),i=Math.max(1,n*.8),a=Math.max(24,Math.min(42,Math.min(r,i)/4)),o=Math.max(3,Math.min(24,Math.round(r/a))),s=Math.max(3,Math.min(16,Math.round(i/a)));return e===`horizontal`?{columns:Math.max(o,s),rows:s}:{columns:o,rows:Math.max(s,o)}}function Mt(e,t,n){let r=Math.max(...e.map(e=>e.x)),i=Math.max(...e.map(e=>e.y));return r<t&&i<n}function Nt(e,t){return e.cells.some(n=>t.cells.some(r=>e.x+n.x===t.x+r.x&&e.y+n.y===t.y+r.y))}function Pt(e,t,n){let r=kt.filter(e=>Mt(e,t,n));return r[Ut(e,r.length)]??[{x:0,y:0}]}function Ft(e,t,n,r,i,a=0,o=!1){let s=Math.max(...e.map(e=>e.x))+1,c=Math.max(...e.map(e=>e.y))+1,l=[];for(let a=0;a<=r-c;a++)for(let c=0;c<=n-s;c++){let s={id:-1,bornAt:0,cells:e,x:c,y:a,phase:`settled`};if(i.some(e=>Nt(s,e))||!Ht(e,t,n,r,s,i))continue;let u=t===`vertical`?e.filter(e=>a+e.y===r-1||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x&&t.y+n.y===a+e.y+1))).length:e.filter(e=>c+e.x===0||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x-1&&t.y+n.y===a+e.y))).length;o&&u<Vt(e,t)||l.push({x:c,y:a,support:u})}l.sort((e,n)=>n.support-e.support||(t===`vertical`?n.y-e.y||e.x-n.x:e.x-n.x||e.y-n.y));let u=l[0]?.support,d=l.filter(e=>e.support===u),f=d[Ut(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function It(e,t,n,r,i,a){let o=kt.flatMap((o,s)=>{if(!Mt(o,t,n))return[];let c=Ft(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[Ut(i,o.length)]}function Lt(e,t,n){return Math.ceil(e*t*Ot*Math.min(1,Math.max(0,n)))}function Rt(e){return e.reduce((e,t)=>e+t.cells.length,0)}function zt(e,t,n,r,i){let a=e===`vertical`?n-1:0,o=new Set(r.flatMap(t=>t.cells.filter(n=>e===`vertical`?t.y+n.y===a:t.x+n.x===a).map(n=>e===`vertical`?t.x+n.x:t.y+n.y))),s=e===`vertical`?t:n,c=o.size===s;if(!c&&!i||o.size===0)return;let l=[];return{shapes:r.flatMap(t=>{let n=t.cells.filter(n=>{let r=e===`vertical`?t.y+n.y===a:t.x+n.x===a;return r&&l.push({x:t.x+n.x,y:t.y+n.y}),!r});return n.length===0?[]:[{...t,cells:n,y:e===`vertical`?t.y+1:t.y,x:e===`horizontal`?t.x-1:t.x}]}),cleared:l,complete:c}}function Bt(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=Pt(i,t,n),c=Ft(s,e,t,n,a,i+1);if(!c)break;a.push({id:o,bornAt:0,cells:s,x:c.x,y:c.y,phase:`settled`})}return a}function Vt(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Ht(e,t,n,r,i,a){let o=Math.max(...e.map(e=>e.x))+1,s=Math.max(...e.map(e=>e.y))+1;if(t===`vertical`){for(let e=0;e<=i.y;e+=1)if(a.some(t=>Nt({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>Nt({...i,x:e},t)))return!1;return i.x+o<=n}function Ut(e,t){if(t<=1)return 0;let n=Math.sin(e*12.9898+78.233)*43758.5453;return Math.floor((n-Math.floor(n))*t)}var Wt=1250;function Gt(){return{settled:[],active:[],nextPieceAt:Wt,recycleUntil:0,nextId:0,recycling:!1,clearingCells:[]}}function Kt(e,t){if(t.elapsed<e.recycleUntil)return e;let n=e.settled,r=e.active,i=e.nextPieceAt,a=e.recycleUntil,o=e.nextId,s=e.recycling,c=e.clearingCells;if(s&&(s=!1,c=[]),t.elapsed>=i&&r.length===0){let a=Lt(t.columns,t.rows,t.progress);if(t.progress<1&&Rt(n)>=a)return{...e,recycling:s,clearingCells:c};let l=It(t.direction,t.columns,t.rows,n,t.seed+o*17+1,!t.overdue);if(!l&&(t.progress>=1||t.estimatedDurationMs===void 0)){let r=zt(t.direction,t.columns,t.rows,n,!0);if(r)return{...e,settled:r.shapes,recycleUntil:t.elapsed+500,nextPieceAt:t.elapsed+500,recycling:!0,clearingCells:r.cleared}}if(l){let e=Math.max(...l.shape.map(e=>e.y))+1;r=[{id:o,bornAt:t.elapsed,cells:l.shape,x:t.direction===`horizontal`?t.columns-Math.max(...l.shape.map(e=>e.x))-.5:l.destination.x,y:t.direction===`vertical`?-e+.5:l.destination.y,targetX:l.destination.x,targetY:l.destination.y,phase:`entry`}],o+=1,i+=Jt(t.estimatedDurationMs,t.columns,t.rows)}}let l=[];for(let e of r){let r=t.elapsed-e.bornAt,i=Math.min(1,Math.max(0,(r-250)/850));if(i>=1&&e.targetX!==void 0&&e.targetY!==void 0){n=[...n,{...e,x:e.targetX,y:e.targetY,phase:`settled`}];continue}let a=t.direction===`horizontal`?t.columns-Math.max(...e.cells.map(e=>e.x))-1:e.targetX??e.x,o=t.direction===`vertical`?0:e.targetY??e.y,s=Math.min(1,Math.max(0,r/1100));l.push({...e,x:t.direction===`horizontal`?a+((e.targetX??a)-a)*i:a,y:t.direction===`vertical`?o+((e.targetY??o)-o)*i:o,phase:r<250?`entry`:s<.35?`align`:`travel`})}return{settled:n,active:l,nextPieceAt:i,recycleUntil:a,nextId:o,recycling:s,clearingCells:c}}function qt(e){return[...e.settled,...e.active]}function Jt(e,t,n){let r=Math.ceil(t*n*.85);return e===void 0||r<=0?Wt:Math.max(400,e/Math.max(1,Math.ceil(r/3)))}var Yt=50;function Xt({progress:e,estimatedDurationMs:t,overdue:n,seed:r=0}){let i=c(null),[o,s]=l({...jt(`vertical`),direction:`vertical`}),[u,d]=l(!1),[f,h]=l(Gt),g=c(o),_=c(void 0),v=c(e),y=c(r),b=c(Gt()),x=c(Date.now());a(()=>{v.current=e,y.current=r},[e,r]),a(()=>{let e=i.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;let n=_.current??At(t.width,t.height);_.current=n;let r={...jt(n,t.width,t.height),direction:n};g.current=r,s(r)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),a(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>d(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),a(()=>{if(b.current=Gt(),x.current=Date.now(),u){let e=Bt(o.direction,o.columns,o.rows,y.current,Math.max(1,Math.floor(v.current*6)));h({...Gt(),settled:e})}else h(b.current)},[o,u]),a(()=>{if(u)return;let e=window.setInterval(()=>{let e=Kt(b.current,{elapsed:Date.now()-x.current,...g.current,progress:v.current,estimatedDurationMs:t,overdue:n,seed:y.current});b.current=e,h(e)},Yt);return()=>window.clearInterval(e)},[t,n,u]);let S=qt(f);return p(`div`,{ref:i,className:Dt.field,"data-running-part":`falling-shapes-field`,"data-overdue":n||void 0,"data-direction":o.direction,"data-recycling":f.recycling||void 0,style:{"--shape-columns":o.columns,"--shape-rows":o.rows},children:m(`div`,{className:Dt.grid,children:[f.clearingCells.map(e=>p(`span`,{className:Dt.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),S.map(e=>p(`div`,{className:Dt.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>p(`span`,{className:Dt.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}var V={scene:`_scene_1u5dz_1`,ground:`_ground_1u5dz_6`,groundGlow:`_groundGlow_1u5dz_12`,groundTerrain:`_groundTerrain_1u5dz_25`,groundTerrainOverdrive:`_groundTerrainOverdrive_1u5dz_26`,"ground-stream":`_ground-stream_1u5dz_1`,groundRunway:`_groundRunway_1u5dz_48`,"runway-stream":`_runway-stream_1u5dz_1`,cloudLayer:`_cloudLayer_1u5dz_62`,cloudLayerFar:`_cloudLayerFar_1u5dz_67`,cloudLayerNear:`_cloudLayerNear_1u5dz_70`,plane:`_plane_1u5dz_73`,aircraft:`_aircraft_1u5dz_83`,windows:`_windows_1u5dz_90`,"holding-pattern":`_holding-pattern_1u5dz_1`,cloud:`_cloud_1u5dz_62`,"cloud-stream":`_cloud-stream_1u5dz_1`,cloudOne:`_cloudOne_1u5dz_129`,cloudTwo:`_cloudTwo_1u5dz_135`,cloudThree:`_cloudThree_1u5dz_141`,cloudFour:`_cloudFour_1u5dz_147`,cloudFive:`_cloudFive_1u5dz_153`,cloudSix:`_cloudSix_1u5dz_159`,cloudSeven:`_cloudSeven_1u5dz_165`,cloudEight:`_cloudEight_1u5dz_171`,"rough-air":`_rough-air_1u5dz_1`},Zt={x:8,y:74},Qt={x:22,y:74},$t={x:38,y:30},en={x:65,y:30},tn={x:88,y:48};function nn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function rn(e,t,n,r,i){let a=1-i;return{x:a**3*e.x+3*a**2*i*t.x+3*a*i**2*n.x+i**3*r.x,y:a**3*e.y+3*a**2*i*t.y+3*a*i**2*n.y+i**3*r.y}}function an(e,t,n,r,i=0){return{worldX:e.x,worldY:e.y,cameraX:t.x,cameraY:t.y,x:e.x-t.x,y:e.y-t.y,pitch:n,groundOffsetY:i,stage:r}}function on(e){return{x:e.x-50,y:e.y-50}}function sn(e,t){if(t){let e={x:50,y:30};return an(e,on(e),0,`holding`,20)}let n=Math.min(1,Math.max(0,e));if(n<.18)return an(nn(Zt,Qt,n/.18),{x:0,y:0},0,`rollout`);if(n<.35){let e=(n-.18)/.17,t=rn(Qt,{x:28,y:74},{x:32,y:30},$t,e),r=e*e*(3-2*e),i=on(t);return an(t,{x:i.x*r,y:i.y*r},-7,`climb`,20*r)}if(n<.7){let e=nn($t,en,(n-.35)/.35);return an(e,on(e),0,`cruise`,20)}let r=(n-.7)/.3,i=rn(en,{x:72,y:30},{x:80,y:47},tn,r),a=r*r*(3-2*r);return an(i,on(i),4,`approach`,20*(1-a))}function cn({progress:e,indeterminate:t}){let n=sn(e,t),r={"--flight-x":`${n.x}%`,"--flight-y":`${n.y}%`,"--flight-camera-x":`${n.cameraX}%`,"--flight-camera-y":`${n.cameraY}%`,"--flight-ground-x":`${-n.cameraX}%`,"--flight-ground-y":`${-n.cameraY+n.groundOffsetY}%`,"--flight-cloud-x":`${-n.cameraX*.45}%`,"--flight-cloud-y":`${-n.cameraY*.32}%`,"--flight-pitch":`${n.pitch}deg`};return m(`span`,{className:V.scene,"data-running-part":`flight-path`,"data-flight-stage":n.stage,style:r,children:[m(`span`,{className:V.ground,"data-running-part":`flight-ground`,children:[p(`span`,{className:V.groundGlow}),p(`span`,{className:V.groundTerrain,"data-running-part":`flight-ground-terrain`}),p(`span`,{className:V.groundTerrainOverdrive,"data-running-part":`flight-ground-overdrive`}),p(`span`,{className:V.groundRunway,"data-running-part":`flight-ground-runway`})]}),m(`span`,{className:`${V.cloudLayer} ${V.cloudLayerFar}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`far`,children:[p(`span`,{className:`${V.cloud} ${V.cloudOne}`,"data-running-part":`flight-cloud`}),p(`span`,{className:`${V.cloud} ${V.cloudTwo}`,"data-running-part":`flight-cloud`}),p(`span`,{className:`${V.cloud} ${V.cloudThree}`,"data-running-part":`flight-cloud`}),p(`span`,{className:`${V.cloud} ${V.cloudFour}`,"data-running-part":`flight-cloud`})]}),p(`span`,{className:V.plane,"data-running-part":`flight-plane`,children:m(`svg`,{className:V.aircraft,viewBox:`0 0 72 40`,"aria-hidden":`true`,children:[p(`path`,{"data-running-part":`flight-fuselage`,d:`M3 21c5-4 12-6 23-6h27c8 0 13 2 16 5-3 3-8 5-16 5H26C15 25 8 24 3 21Z`}),p(`path`,{"data-running-part":`flight-wing`,d:`m33 23 17 11h-12L23 24Z`}),p(`path`,{"data-running-part":`flight-tail`,d:`m13 17 5-11h7l-1 11Z`}),p(`path`,{className:V.windows,d:`M25 18h4v2h-4zm7 0h4v2h-4zm7 0h4v2h-4z`})]})}),m(`span`,{className:`${V.cloudLayer} ${V.cloudLayerNear}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`near`,children:[p(`span`,{className:`${V.cloud} ${V.cloudFive}`,"data-running-part":`flight-cloud`}),p(`span`,{className:`${V.cloud} ${V.cloudSix}`,"data-running-part":`flight-cloud`}),p(`span`,{className:`${V.cloud} ${V.cloudSeven}`,"data-running-part":`flight-cloud`}),p(`span`,{className:`${V.cloud} ${V.cloudEight}`,"data-running-part":`flight-cloud`})]})]})}var H={frontier:`_frontier_xpzp3_1`,now:`_now_xpzp3_12`,routes:`_routes_xpzp3_20`,route:`_route_xpzp3_20`,trail:`_trail_xpzp3_41`,packet:`_packet_xpzp3_42`,"packet-stall":`_packet-stall_xpzp3_1`,"trail-backup":`_trail-backup_xpzp3_1`};function ln(){return m(f,{children:[p(`span`,{className:H.frontier,"data-running-part":`frontier`}),p(`span`,{className:H.now,"data-running-part":`transit-now`}),p(`span`,{className:H.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>p(`span`,{className:H.route},e))}),p(`span`,{className:H.trail,"data-running-part":`transit-trail`}),p(`span`,{className:H.packet,"data-running-part":`transit-packet`})]})}var un={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},dn={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function fn(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=hn((n-(r===`full`?1030:530))/(r===`full`?1620:620),0,1),a=r===`full`?500+1e3*i:0,o=r===`arrival`?0:180+70*i,s=r===`arrival`?Math.min(900,n):350+550*i,c=e*.95,l=c-o;return{mode:r,bodyStart:e*.75-Math.min(2500,t),bodyEnd:e*.75,headStart:l-s-a,hopStart:l-s,land:l,settleEnd:l+(o?120+60*i:0),end:c}}function pn(e,t,n){return n===t?Number(e>=n):hn((e-t)/(n-t),0,1)}function mn(e){return e*e*(3-2*e)}function hn(e,t,n){return Math.max(t,Math.min(n,e))}var gn=25,_n=.5,vn=.95;function yn(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:bn(e),flakes:[],cells:[],toppled:!1}}function bn(e){return{columns:Zn(Math.round(e.width/4),48,180),rows:Zn(Math.round(e.height/4),28,100)}}function xn(e,t,n){return n?`overdue`:t===void 0||fn(t).mode===`snowfall`?`snowing`:e>=vn?`complete`:e>=_n?`assembling`:`drift`}function Sn(e,t){let n=W(e+41)<.5?-1:1,r=n*(.72+W(e+43)*.45),i=Math.sin(t/1600+W(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+W(e+53)*Math.PI*2))**7*(3.2+W(e+59)*1.8);return r+i+a}function Cn(e){let t=bn(e);return Math.round(t.columns*t.rows*.18)}function wn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*vn/Cn(t);if(n)return i/2;let a=fn(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function Tn(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=bn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Xn(e):yn(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+gn;e<=l;e+=gn)c=On(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function En(e){return e.filter(e=>e.owner===`snowman`).length}function Dn(e){return e.cells.map(t=>{let n=t.owner===`body`?e.body:t.owner===`head`?e.head:void 0,r=n&&t.localX!==void 0&&t.localY!==void 0?{...t,x:n.x+t.localX*Math.cos(n.angle)-t.localY*Math.sin(n.angle),y:n.y+t.localX*Math.sin(n.angle)+t.localY*Math.cos(n.angle)}:t;return e.toppling&&r.owner!==`ground`?Yn(r,e.toppling):r})}function On(e,t,n,r,i,a,o){let s=xn(n,r,i),c=wn(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:W(a+e.id*17)*e.grid.columns,y:-1-W(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;kn(e,n,r,i);let l=Hn(e),u=Sn(a,t)*(gn/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*gn/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=Nn(e,n);if(r){Pn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=Wn(n,l,e.grid,u,a);if(!i){f.push({...n,x:Zn(n.x,0,e.grid.columns-1)});continue}let o=l.get(U(i.x,i.y+1));e.cells.push({id:t.id,x:i.x,y:i.y,owner:o===`body`||o===`head`||o===`snowman`?`snowman`:`ground`}),l.set(U(i.x,i.y),e.cells.at(-1)?.owner??`ground`)}e.flakes=f,r!==void 0&&s!==`drift`&&s!==`snowing`&&jn(e),Ln(e),Un(e,a,t),Un(e,a,t+gn/2);let p=e.body;return p?.locked&&(p.supportY??=Gn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&En(e.cells)>=60&&qn(e,t),Jn(e,t),e}function kn(e,t,n,r){if(n===void 0)return;let i=fn(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=mn(pn(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:Gn(e,t,2,s-1),radius:2,angle:0,locked:!1}}let l=e.body;if(l&&!l.locked){l.radius=Math.max(l.radius,Kn(e,`body`,2));let t=o*(.14+.38*c);An(l,t,Gn(e,t,l.radius,s-1)),l.locked=a>=i.bodyEnd}if(a>=i.headStart&&!e.head){let t=o*(i.mode===`full`?.88:.66);e.head={kind:`head`,x:t,y:Gn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},jn(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,Kn(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*mn(pn(a,i.headStart,i.hopStart)));An(u,t,Gn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=pn(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*mn(e),u.y=u.launch.y+(t-u.launch.y)*mn(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=pn(a,i.land,i.settleEnd);u.y+=Math.sin(Math.PI*e)*.45}u.locked=a>=i.settleEnd}}if(u&&a>=i.land){let t=pn(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-mn(t))*-.22}}}function An(e,t,n){let r=Qn(e.y,n,.16),i=t-e.x;e.angle+=Math.sign(i)*Math.hypot(i,r-e.y)/Math.max(e.radius,1),e.x=t,e.y=r}function jn(e){let t=Dn(e),n=new Map(e.cells.map(e=>[e.id,e])),r=new Set(t.filter(e=>e.owner===`ground`).map(e=>U(Math.round(e.x),Math.round(e.y)))),i=new Set(t.filter(e=>e.owner===`ground`).filter(e=>!r.has(U(Math.round(e.x),Math.round(e.y)-1))).map(e=>e.id));for(let r of[e.body,e.head]){if(!r||r.locked)continue;let a=r.kind,o=r.radius+.75;for(let a of t){if(!Mn(e,r))break;if(a.owner!==`ground`)continue;let t=a.x-r.x,s=a.y-r.y,c=Math.hypot(t,s);if(!i.has(a.id)||c>o||s<-r.radius*.2)continue;let l=n.get(a.id);l&&Pn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,Kn(e,a,r.kind===`body`?2:1.7))}}function Mn(e,t){if(t.kind===`body`||!e.body)return!0;let n=e.body.radius*.72,r=Math.max(12,Math.round(Math.PI*(Math.max(0,n-1.7)/.6)**2));return e.cells.filter(e=>e.owner===`head`).length<r}function Nn(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>Mn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function Pn(e,t,n,r,i){let a=Math.cos(-t.angle),o=Math.sin(-t.angle),s=r*a-i*o;i=r*o+i*a,r=s;let c=e.cells.find(e=>e.id===n),l=In(e,t,n),u=Fn(e,t,r,i,n),d={id:n,x:t.x+u.x,y:t.y+u.y,owner:t.kind,localX:u.x,localY:u.y,targetLocalX:l.x,targetLocalY:l.y};c?Object.assign(c,d):e.cells.push(d),t.radius=Math.max(t.radius,Kn(e,t.kind,t.kind===`body`?2:1.7)),Rn(e,t)}function Fn(e,t,n,r,i){let a=e.cells.filter(e=>e.id!==i&&e.owner===t.kind),o=(e,t)=>a.every(n=>Math.hypot((n.localX??0)-e,(n.localY??0)-t)>=.75);if(o(n,r))return{x:n,y:r};for(let e=.75;;e+=.75)for(let i=0;i<32;i++){let a=i*Math.PI/16,s=n+Math.cos(a)*e,c=r+Math.sin(a)*e;if((Math.hypot(s,c)<=t.radius+.75||e>t.radius*2)&&o(s,c))return t.radius=Math.max(t.radius,Math.hypot(s,c)-.5),{x:s,y:c}}}function In(e,t,n){let r=e.cells.filter(e=>e.owner===t.kind&&e.targetLocalX!==void 0&&e.targetLocalY!==void 0),i=(e,t,n=.72)=>r.every(r=>Math.hypot((r.targetLocalX??0)-e,(r.targetLocalY??0)-t)>=n);for(let e=0;e<64;e+=1){let r=W(n*31+e*17)*Math.PI*2,a=Math.sqrt(W(n*37+e*19))*Math.max(.4,t.radius-.35),o=Math.cos(r)*a,s=Math.sin(r)*a;if(i(o,s))return{x:o,y:s}}for(let e=.4;e<=t.radius-.35;e+=.5){let t=Math.max(6,Math.round(2*Math.PI*e/.72));for(let r=0;r<t;r++){let a=r*Math.PI*2/t+W(n*13),o=Math.cos(a)*e,s=Math.sin(a)*e;if(i(o,s,.6))return{x:o,y:s}}}return{x:0,y:0}}function Ln(e){for(let t of e.cells){if(t.packed||t.localX===void 0||t.localY===void 0||t.targetLocalX===void 0||t.targetLocalY===void 0)continue;let e=Qn(t.localX,t.targetLocalX,.25),n=Qn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Rn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=zn(t.radius,n.length);n.sort((e,t)=>e.id-t.id);for(let[e,t]of n.entries()){let n=r[e];if(!n)break;t.targetLocalX=n.x,t.targetLocalY=n.y,t.packed=!1}}function zn(e,t){let n=Math.max(.2,e-.1),r=[],i=.9,a=i*Math.sqrt(3)/2;for(let e=-Math.ceil(n/a);e<=Math.ceil(n/a);e+=1){let t=e*a,o=e&1?i/2:0;for(let e=-Math.ceil(n/i);e<=Math.ceil(n/i);e+=1){let a=e*i+o;Math.hypot(a,t)<=n&&r.push({x:a,y:t})}}r.sort((e,t)=>Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y));let o=[];for(let e of r)if(o.every(t=>Math.hypot(t.x-e.x,t.y-e.y)>=.82)&&o.push(e),o.length===t)break;return o}function Bn(e){if(e.hat)return e.toppling?{...Yn(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function Vn(e,t,n){let r=Xn(t),i=(e,t)=>e+(t-e)*Zn(n,0,1);for(let t of[`body`,`head`]){let n=e[t],a=r[t];n&&a&&(a.x=i(n.x,a.x),a.y=i(n.y,a.y),a.angle=i(n.angle,a.angle))}let a=new Map(e.flakes.map(e=>[e.id,e]));for(let e of r.flakes){let t=a.get(e.id);t&&(e.x=i(t.x,e.x),e.y=i(t.y,e.y))}return r.toppling&&e.toppling&&(r.toppling.angle=i(e.toppling.angle,r.toppling.angle)),r.hat&&e.hat&&(r.hat={x:i(e.hat.x,r.hat.x),y:i(e.hat.y,r.hat.y),angle:i(e.hat.angle,r.hat.angle)}),r}function Hn(e){let t=new Map;for(let n of Dn(e))t.set(U(Math.round(n.x),Math.round(n.y)),n.owner);return t}function Un(e,t,n){let r=Hn(e),i=e.cells.filter(e=>e.owner===`ground`).sort((e,t)=>t.y-e.y||e.x-t.x);for(let a of i){let i=U(a.x,a.y+1);if(a.y<e.grid.rows-1&&!r.has(i)){r.delete(U(a.x,a.y)),a.y+=1,r.set(U(a.x,a.y),a.owner);continue}let o=W(t+a.id*29+n)<.5?-1:1;for(let t of[o,-o]){let n=a.x+t;if(!(n<0||n>=e.grid.columns||a.y>=e.grid.rows-1||r.has(U(n,a.y))||r.has(U(n,a.y+1)))){r.delete(U(a.x,a.y)),a.x=n,a.y+=1,r.set(U(a.x,a.y),a.owner);break}}}}function Wn(e,t,n,r,i){let a=Math.round(e.x),o=Math.round(e.y);if(o<0)return;if(o>=n.rows-1)return{x:a,y:n.rows-1};if(!t.has(U(a,o+1)))return;let s=r>=0?1:-1,c=W(i+e.id*71+o)>.5?s:-s;for(let e of[c,-c]){let r=a+e;if(r>=0&&r<n.columns&&!t.has(U(r,o+1))&&!t.has(U(r,o)))return{x:r,y:o+1}}return t.has(U(a,o))?{x:a,y:Math.max(0,o-1)}:{x:a,y:o}}function Gn(e,t,n,r){let i=Dn(e).filter(e=>e.owner===`ground`&&Math.abs(e.x-t)<=n);return(i.length?Math.min(...i.map(e=>e.y)):r)-n}function Kn(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function qn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Jn(e,t){let n=e.toppling;if(!n)return;let r=Zn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function Yn(e,t){let n=Math.cos(t.angle),r=Math.sin(t.angle),i=e.x-t.pivotX,a=e.y-t.pivotY;return{...e,x:t.pivotX+i*n-a*r,y:t.pivotY+i*r+a*n}}function Xn(e){return{...e,grid:{...e.grid},hat:e.hat&&{...e.hat},flakes:e.flakes.map(e=>({...e})),cells:e.cells.map(e=>({...e})),body:e.body&&{...e.body},head:e.head&&{...e.head},toppling:e.toppling&&{...e.toppling}}}function U(e,t){return`${e}:${t}`}function Zn(e,t,n){return Math.max(t,Math.min(n,e))}function Qn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function W(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function $n(e,t,n){if(!e)return;let r=e.getContext(`2d`);if(!r)return;let i=window.devicePixelRatio||1,a=Math.max(1,Math.round(n.width)),o=Math.max(1,Math.round(n.height));(e.width!==a*i||e.height!==o*i)&&(e.width=a*i,e.height=o*i,e.style.width=`${a}px`,e.style.height=`${o}px`),r.setTransform(i,0,0,i,0,0),r.clearRect(0,0,a,o);let s=a/t.grid.columns,c=o/t.grid.rows;r.fillStyle=`rgba(244, 241, 223, 0.52)`;for(let e of Dn(t))er(r,(e.x+.5)*s,(e.y+.5)*c,s,c);r.fillStyle=`rgba(244, 241, 223, 0.76)`;for(let e of t.flakes)er(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=Bn(t);if(l&&t.head){let e=t.head.radius;r.save(),r.translate(l.x*s,l.y*c),r.scale(s,c),r.rotate(l.angle),r.fillStyle=`rgba(27, 31, 24, 0.78)`,r.fillRect(-e*.65,-2,e*1.3,2),r.fillRect(-e,-.3,e*2,.45),r.restore()}}function er(e,t,n,r,i){e.beginPath(),e.arc(t,n,Math.max(.8,Math.min(r,i)*.42),0,Math.PI*2),e.fill()}function tr({progress:e,estimatedDurationMs:t,overdue:n,seed:r=0}){let i=c(null),o=c(null),[s,u]=l({width:360,height:180}),[d,f]=l(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=c(e),h=c(n),g=c({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:yn()});a(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),a(()=>{h.current=n},[n]),a(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>f(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),a(()=>{let e=i.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&u({width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),a(()=>{if(d)return;g.current.simulation=yn(s);let e=0,n=()=>{let a=g.current,c=t===void 0?Date.now()-a.startedAt:a.progress*t+(Date.now()-a.progressAt),l={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:r,dimensions:s},u=Tn(a.simulation,{...l,elapsed:c});a.simulation=u;let f=Vn(u,Tn(u,{...l,elapsed:u.lastElapsed+25}),(c-u.lastElapsed)/25);$n(o.current,f,s);let p=i.current;p&&(p.dataset.snowCellCount=String(u.cells.length),p.dataset.snowDensity=u.grid.columns<65?`compact`:`full`,u.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),d||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[s,t,d,r]),a(()=>{if(!d)return;let a=Tn(yn(s),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:r,dimensions:s});$n(o.current,a,s),i.current&&(i.current.dataset.snowCellCount=String(a.cells.length),a.toppled?i.current.dataset.snowmanToppled=`true`:delete i.current.dataset.snowmanToppled)},[s,t,n,e,d,r]);let _=xn(e,t,n);return p(`div`,{ref:i,className:dn.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":d||void 0,children:p(`canvas`,{ref:o,className:dn.canvas,"data-running-part":`snowman-canvas`})})}var G={haze:`_haze_1uy2p_1`,pressure:`_pressure_1uy2p_17`,band:`_band_1uy2p_20`,bandOne:`_bandOne_1uy2p_33`,bandTwo:`_bandTwo_1uy2p_36`,bandThree:`_bandThree_1uy2p_40`,drift:`_drift_1uy2p_45`,driftOne:`_driftOne_1uy2p_54`,driftTwo:`_driftTwo_1uy2p_58`,driftThree:`_driftThree_1uy2p_67`,driftFour:`_driftFour_1uy2p_76`,driftFive:`_driftFive_1uy2p_85`,"storm-band":`_storm-band_1uy2p_1`};function nr(){return m(f,{children:[p(`span`,{className:G.haze,"data-running-part":`weather-haze`}),p(`span`,{className:G.pressure,"data-running-part":`weather-pressure`}),p(`span`,{className:`${G.band} ${G.bandOne}`}),p(`span`,{className:`${G.band} ${G.bandTwo}`}),p(`span`,{className:`${G.band} ${G.bandThree}`}),p(`span`,{className:`${G.drift} ${G.driftOne}`}),p(`span`,{className:`${G.drift} ${G.driftTwo}`}),p(`span`,{className:`${G.drift} ${G.driftThree}`}),p(`span`,{className:`${G.drift} ${G.driftFour}`}),p(`span`,{className:`${G.drift} ${G.driftFive}`})]})}var rr={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function ir({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return p(`span`,{className:`${rr.anchor} ${e??``}`,"data-running-part":r,children:p(`span`,{className:`${rr.body} ${t??``}`,"data-running-part":i,style:a})})}var K={frontier:`_frontier_1dg7b_1`,flare:`_flare_1dg7b_12`,lanes:`_lanes_1dg7b_15`,lane:`_lane_1dg7b_15`,markerAnchor:`_markerAnchor_1dg7b_31`,markerBody:`_markerBody_1dg7b_35`,"bloom-flare":`_bloom-flare_1dg7b_1`};function ar(){return m(f,{children:[p(`span`,{className:K.frontier,"data-running-part":`frontier`}),p(`span`,{className:K.flare,"data-running-part":`bloom-flare`}),p(`span`,{className:K.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>p(`span`,{className:K.lane,"data-running-part":`bloom-lane`,children:p(ir,{anchorClassName:K.markerAnchor,bodyClassName:K.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function or(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`].includes(e)}function sr({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return m(`div`,{className:`${un.field} ${r?un.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-overdue":r||void 0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&p(ar,{}),e===`release-transit`&&p(ln,{}),e===`status-weather`&&p(nr,{}),e===`falling-shapes`&&p(Xt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&p(tr,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`flight-path`&&p(cn,{progress:t,indeterminate:i})]})}var cr=20;function lr(e,t){let n=ur(!!e),r=e?new Date(e).valueOf():NaN,i=Number.isFinite(r)?Math.max(0,n-r):void 0,a=i!==void 0&&t!==void 0;return{elapsedMs:i,estimatedDurationMs:t,hasEstimate:a,overdue:a&&i>t,progress:a?Math.min(i/t,1):0}}function ur(e){let[t,n]=l(()=>Date.now());return a(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),cr);return()=>window.clearInterval(t)},[e]),t}function dr(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${pr(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${pr(t)}`}${n?` · Over estimate`:``}`}function fr(e,t,n){let r=e===void 0?`—`:mr(e),i=t===void 0?`?`:`~${mr(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function pr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function mr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${r}:${String(i).padStart(2,`0`)}`;return n>0?`${n}:${a.padStart(5,`0`)}`:a}function hr({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return m(`p`,{className:`${un.timing} ${n?un.timingOverdue:``}`,children:[p(`span`,{className:`screen-reader-only`,children:dr(e,t,n)}),p(`span`,{"aria-hidden":`true`,children:fr(e,t,n)})]})}var q={progress:`_progress_1ti2m_1`,visual:`_visual_1ti2m_8`,timing:`_timing_1ti2m_12`,overdue:`_overdue_1ti2m_17`,readout:`_readout_1ti2m_23`,radial:`_radial_1ti2m_31`,sweep:`_sweep_1ti2m_1`,"alarm-ring":`_alarm-ring_1ti2m_1`,radialCore:`_radialCore_1ti2m_58`,"reactor-breathe":`_reactor-breathe_1ti2m_1`,runway:`_runway_1ti2m_70`,"barrier-pulse":`_barrier-pulse_1ti2m_1`,spark:`_spark_1ti2m_114`,sparkTwo:`_sparkTwo_1ti2m_128`,orbit:`_orbit_1ti2m_135`,orbitCore:`_orbitCore_1ti2m_151`,particle:`_particle_1ti2m_163`,particleTwo:`_particleTwo_1ti2m_174`,"gravity-well":`_gravity-well_1ti2m_1`,indeterminate:`_indeterminate_1ti2m_191`,shift:`_shift_1ti2m_1`,signalField:`_signalField_1ti2m_199`,rail:`_rail_1ti2m_217`,lead:`_lead_1ti2m_223`,pulse:`_pulse_1ti2m_233`,pulseTwo:`_pulseTwo_1ti2m_244`,tracks:`_tracks_1ti2m_247`,sparkWide:`_sparkWide_1ti2m_1`,track:`_track_1ti2m_247`,markerAnchor:`_markerAnchor_1ti2m_382`,markerBody:`_markerBody_1ti2m_386`,"endpoint-pulse":`_endpoint-pulse_1ti2m_1`,short:`_short_1ti2m_424`};function gr({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=dr(n,r,a),l={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},u=e===`signal-field`?q.signalField:q[e];return m(`div`,{className:`${q.progress} ${u} ${a?q.overdue:``} ${i?``:q.indeterminate}`,style:l,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[m(`div`,{className:q.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&p(`span`,{className:q.radialCore}),e===`runway`&&m(f,{children:[p(`span`,{className:q.spark,"data-running-part":`runway-spark`}),p(`span`,{className:`${q.spark} ${q.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&m(f,{children:[p(`span`,{className:q.orbitCore}),p(`span`,{className:q.particle}),p(`span`,{className:`${q.particle} ${q.particleTwo}`})]}),e===`signal-field`&&m(f,{children:[p(`span`,{className:q.rail}),p(`span`,{className:q.lead}),p(`span`,{className:q.pulse}),p(`span`,{className:`${q.pulse} ${q.pulseTwo}`}),p(`span`,{className:q.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>p(`span`,{className:q.track,"data-running-part":`signal-track`,children:p(ir,{anchorClassName:q.markerAnchor,bodyClassName:q.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),p(`p`,{className:`${q.timing} ${s?q.readout:``}`,children:s?m(f,{children:[p(`span`,{className:`screen-reader-only`,children:c}),p(`span`,{"aria-hidden":`true`,children:fr(n,r,a)})]}):c})]})}function _r(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function vr(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var yr=2e4,br=15e3,xr=3e5,Sr=1.25,Cr=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`];function wr({panel:e}){let t=Dr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=Tr(e.demo_run_duration,yr),i=Tr(e.demo_review_duration,xr),a=n?Math.ceil(i*Sr):r,o=Math.floor(t/a),s=n??Cr[o%Cr.length]??`radial`,c=o*a;return p(Er,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:br})}function Tr(e,t){return e?ne(e)??t:t}function Er({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=lr(new Date(n).toISOString(),r),a=or(t);return p(z,{panel:e,field:a?p(sr,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:vr(e.id)},`${t}-${n}`):void 0,children:m(L,{children:[p(R,{status:`running`,glyph:`↻`,label:`Running`}),m(`p`,{className:Et.variant,children:[p(`span`,{className:Et.variantPrefix,children:`Demo treatment · `}),t]}),a?p(hr,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):p(gr,{animation:t,timing:i})]})})}function Dr(){let[e,t]=l(()=>Date.now());return a(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var J={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function Or(e,t=`Passed`){let n=ft[e];return e===`passed`?{...n,label:t}:n}function kr(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}var Ar={summary:`_summary_1su3w_1`,delta:`_delta_1su3w_15`,emphasized:`_emphasized_1su3w_22`,sparkline:`_sparkline_1su3w_28`,explanation:`_explanation_1su3w_42`};function jr({direction:e,children:t}){let[n,r]=l(!1),[i,s]=l(!1),[u,d]=l({left:0,top:0}),h=c(null),g=c(null),_=o(),v=()=>{let e=h.current?.getBoundingClientRect();e&&d({left:Math.max(8,Math.min(e.left,window.innerWidth-328)),top:Math.max(8,Math.min(e.bottom,window.innerHeight-180))}),r(!0)};if(a(()=>{e||(r(!1),s(!1))},[e]),a(()=>{if(!n)return;let e=e=>{e.target instanceof Node&&!h.current?.contains(e.target)&&!g.current?.contains(e.target)&&(r(!1),s(!1))},t=e=>{e.key===`Escape`&&(r(!1),s(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),!e)return p(f,{children:t});let y=e.totals.map((e,t,n)=>`${n.length===1?48:t*48/(n.length-1)},${16-e/Math.max(1,...n)*14}`).join(` `);return m(f,{children:[m(`button`,{ref:h,type:`button`,className:Ar.summary,"aria-describedby":n?_:void 0,"aria-expanded":n,onMouseEnter:v,onMouseLeave:e=>{!i&&!(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget))&&r(!1)},onFocus:v,onBlur:()=>{r(!1),s(!1)},onClick:()=>{i?(s(!1),r(!1)):(s(!0),v())},children:[t,e.mode!==`quiet`&&m(`span`,{className:`${Ar.delta} ${e.emphasized?Ar.emphasized:``}`,"aria-hidden":`true`,children:[e.symbol,` `,e.delta>0?`+`:e.delta<0?`−`:``,Math.abs(e.delta).toLocaleString()]}),e.totals.length>1&&p(`svg`,{className:Ar.sparkline,viewBox:`0 0 48 18`,"aria-hidden":`true`,children:p(`polyline`,{points:y})})]}),n&&S(p(`span`,{ref:g,id:_,role:`tooltip`,className:Ar.explanation,style:{...u,maxHeight:Math.max(40,window.innerHeight-u.top-8)},onMouseLeave:e=>{!i&&!(e.relatedTarget instanceof Node&&h.current?.contains(e.relatedTarget))&&r(!1)},children:e.explanation}),document.body)]})}function Mr({envelope:e,direction:t,motionId:n}){if(e.state===`error`)return p(I,{glyph:`⚠`,label:`Tests`,motionId:n,value:`Test results unavailable: ${e.error.message}`});let r=e.signal;return r.status===`reported`?p(I,{glyph:`≡`,label:`Tests`,motionId:n,value:p(Nr,{tests:r,direction:t})}):p(I,{glyph:`≡`,label:`Tests`,motionId:n,value:r.status===`pending`?`Tests pending`:`No test results published`})}function Nr({tests:e,direction:t}){let n=e.total>0&&e.passed===e.total;return m(jr,{direction:t,children:[n?m(`span`,{className:N.passed,children:[`✓ `,e.total.toLocaleString()]}):`${e.total.toLocaleString()} tests`,!!e.failed&&m(`span`,{className:N.failed,children:[` · ✕ `,e.failed.toLocaleString()]}),!!e.skipped&&m(`span`,{className:N.warning,children:[` · ↷ `,e.skipped.toLocaleString()]})]})}function Pr(e){return e.state===`error`?{state:e.state,kind:e.error.kind,message:e.error.message}:{state:e.state,...Fr(e.signal)}}function Fr(e){if(e.status!==`reported`)return e;let{run:t,...n}=e;return n}function Ir({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,testDirection:a}){if(!t&&i)return p(Lr,{panel:e,rejected:i});if(!t)return p(z,{panel:e,attentionActive:n,children:p(L,{children:p(F,{children:`Loading…`})})});if(t.state===`error`){let r=ct(t.error.kind);return m(z,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[p(`div`,{"data-panel-anchor":`status`,children:p(R,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),p(L,{anchor:`evidence`,children:p(F,{children:t.error.message})})]})}let o=k.safeParse(t.signal);return o.success?p(Rr,{panel:e,envelope:t,signal:o.data,testDirection:a,updateHealth:r,attentionActive:n}):m(z,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[p(`div`,{"data-panel-anchor":`status`,children:p(R,{glyph:`⚠`,label:`Invalid signal`})}),p(L,{anchor:`evidence`,children:p(F,{children:`The received pipeline status could not be read.`})})]})}function Lr({panel:e,rejected:t}){let n=Or(t.status);return m(z,{panel:e,sourceLink:t.link,busy:!1,layout:`status-band`,children:[p(`div`,{"data-panel-anchor":`status`,children:p(R,{status:t.status,glyph:n.glyph,label:n.label})}),m(L,{className:J.details,anchor:`evidence`,children:[m(F,{children:[t.github?`GitHub`:`The source`,` returned an older result; checking again`,t.github&&m(f,{children:[` · `,p(`a`,{href:`https://github.com/orgs/community/discussions/206725`,target:`_blank`,rel:`noopener noreferrer`,children:`GitHub API report`})]})]}),p(vt,{value:t.sourceUpdatedAt})]})]})}function Rr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i,testDirection:a}){let o=Or(n.status),[s,u]=l(()=>n.status===`running`?zr():void 0),d=c(n.status);if(n.status!==d.current){let t=d.current===`running`;d.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&u(e=>zr(e))}let f=e.running_animation??s??`off`,h=n.status===`running`&&f!==`off`,g=lr(n.runStartedAt,n.estimatedDurationMs),_=h&&or(f),v=h&&_r(f);return m(z,{panel:e,envelope:t,attentionActive:i,layoutMotionKey:n.status,layout:_||v?void 0:`status-band`,field:_?p(sr,{animation:f,progress:g.progress,estimatedDurationMs:g.estimatedDurationMs,overdue:g.overdue,indeterminate:!g.hasEstimate,seed:vr(e.id)}):void 0,children:[p(`div`,{"data-panel-anchor":`status`,children:p(R,{status:n.status,glyph:o.glyph,label:o.label,motionId:`status`})}),m(L,{className:J.details,anchor:`evidence`,children:[n.status===`running`&&p(I,{glyph:`⚙`,label:`Activity`,value:kr(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${kr(n.activity)}`,className:J.activity}),n.testResults&&p(Mr,{envelope:n.testResults,direction:a,motionId:`tests`}),n.branch&&p(I,{glyph:`⎇`,label:`Branch`,motionId:`branch`,value:p(`span`,{className:J.branch,children:n.branch}),compact:{kind:`short-value`,value:p(`span`,{className:J.branch,children:n.branch})},title:`Branch: ${n.branch}`}),_&&p(hr,{elapsedMs:g.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:g.overdue}),v&&p(gr,{animation:f,timing:g}),n.status!==`running`&&n.durationMs!==void 0&&p(I,{glyph:`◷`,label:`Duration`,value:`Took ${Br(n.durationMs)}`,compact:{kind:`short-value`,value:Br(n.durationMs)},title:`Duration: Took ${Br(n.durationMs)}`,className:J.duration}),p(gt,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt,motionId:`age`}),r&&p(_t,{health:r})]})]})}function zr(e){let t=we.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function Br(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function Vr(e){let t={state:e.state,link:e.link};if(e.state===`error`)return t;let n=k.safeParse(e.signal);return{...t,status:n.success?n.data.status:void 0,...n.success&&n.data.testResults?{tests:Pr(n.data.testResults)}:{}}}var Y={compactFacts:`_compactFacts_f62xm_1`,incomplete:`_incomplete_f62xm_8`,compactFact:`_compactFact_f62xm_1`,failedItem:`_failedItem_f62xm_19`,evidence:`_evidence_f62xm_27`,freshness:`_freshness_f62xm_28`,statusAnchor:`_statusAnchor_f62xm_36`,fullSummary:`_fullSummary_f62xm_44`};function X(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function Hr(e){let t=[...e.workflows,...e.pullRequests].find(e=>e.status===`failed`||e.status===`warning`);return t?{workflow:X(e.workflows.length,`workflow`),pullRequests:X(e.pullRequests.length,`open PR`),primary:`${t.label} ${t.status}`,secondary:`${X(e.workflows.length,`workflow`)} · ${X(e.pullRequests.length,`open PR`)}`,primaryDetail:t.detail,primaryKind:t.status===`warning`?`warning`:`failed`,title:`${e.summary} — ${t.label}: ${t.detail}`}:{workflow:X(e.workflows.length,`workflow`),pullRequests:X(e.pullRequests.length,`open PR`),primary:X(e.workflows.length,`workflow`),secondary:X(e.pullRequests.length,`open PR`),title:e.summary}}function Ur({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return p(z,{panel:e,attentionActive:n,children:p(L,{children:p(F,{children:`Loading…`})})});if(t.state===`error`){let r=ct(t.error.kind);return m(z,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[p(`div`,{"data-panel-anchor":`status`,children:p(R,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),p(L,{anchor:`evidence`,children:p(F,{children:t.error.message})})]})}let i=ue.safeParse(t.signal);if(!i.success)return m(z,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[p(`div`,{"data-panel-anchor":`status`,children:p(R,{glyph:`⚠`,label:`Invalid signal`})}),p(L,{anchor:`evidence`,children:p(F,{children:`The received pull-request health status could not be read.`})})]});let a=Or(i.data.status,`Healthy`),o=Hr(i.data);return m(z,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[p(`div`,{className:Y.statusAnchor,"data-panel-anchor":`status`,children:p(R,{status:i.data.status,glyph:a.glyph,label:a.label})}),m(`div`,{className:Y.evidence,"data-panel-anchor":`evidence`,"data-panel-evidence-priority":`secondary`,children:[p(F,{className:Y.fullSummary,title:i.data.summary,children:i.data.summary}),m(`div`,{className:Y.compactFacts,title:o.title,"data-compact-facts":!0,children:[o.primaryDetail&&m(`p`,{className:Y.failedItem,title:o.primaryDetail,children:[p(`span`,{"aria-hidden":`true`,children:`⚠`}),` `,m(`span`,{className:`screen-reader-only`,children:[o.primaryKind===`warning`?`Warning`:`Failed`,` item:`,` `]}),o.primary,m(`span`,{className:`screen-reader-only`,children:[`. Detail: `,o.primaryDetail]})]}),p(I,{glyph:`⚙`,label:`Update workflows`,value:o.workflow,compact:{kind:`short-value`,value:i.data.workflows.length},title:`Update workflows: ${o.workflow}`,className:Y.compactFact}),p(I,{glyph:`⎇`,label:`Open update pull requests`,value:o.pullRequests,compact:{kind:`short-value`,value:i.data.pullRequests.length},title:`Open update pull requests: ${o.pullRequests}`,className:Y.compactFact})]}),m(`div`,{className:Y.freshness,children:[p(B,{value:t.observedAt,label:`Observed (oldest evidence)`}),i.data.newestObservedAt&&m(`span`,{className:`screen-reader-only`,children:[`Newest evidence observed `,i.data.newestObservedAt,`.`]}),r&&p(_t,{health:r})]}),i.data.incompleteObservations&&p(`div`,{role:`status`,children:m(F,{className:Y.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}function Wr(e){let t={state:e.state,link:e.link};if(e.state===`error`)return t;let n=ue.safeParse(e.signal);return{...t,status:n.success?n.data.status:void 0}}function Gr({panel:e,envelope:t,attentionActive:n,updateHealth:r,testDirection:i}){if(!t)return p(z,{panel:e,attentionActive:n,children:p(L,{children:p(F,{children:`Loading…`})})});if(t.state===`error`){let r=ct(t.error.kind);return p(z,{panel:e,envelope:t,attentionActive:n,error:!0,children:m(L,{children:[p(R,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),p(F,{children:t.error.message})]})})}let a=ae.safeParse(t.signal);if(!a.success)return p(z,{panel:e,envelope:t,attentionActive:n,error:!0,children:p(L,{children:p(R,{glyph:`⚠`,label:`Invalid test result`})})});let o=a.data;return o.status===`pending`?p(Kr,{panel:e,envelope:t,attentionActive:n,label:`Pending`,hint:`The selected workflow run is still in progress.`}):o.status===`not-reported`?p(Kr,{panel:e,envelope:t,attentionActive:n,label:`No test results published`,hint:`This completed workflow did not publish the configured test summary.`}):p(z,{panel:e,envelope:t,attentionActive:n,children:m(L,{children:[p(R,{glyph:`✓`,label:`Test results reported`,compactOnly:!0}),p(mt,{children:p(Nr,{tests:o,direction:i})}),p(B,{value:t.observedAt}),r&&p(_t,{health:r})]})})}function Kr({panel:e,envelope:t,attentionActive:n,label:r,hint:i}){return p(z,{panel:e,envelope:t,attentionActive:n,children:m(L,{children:[p(R,{glyph:`◌`,label:r}),p(F,{children:i}),p(B,{value:t.observedAt})]})})}function qr(e){let t=oe.safeParse(e);return{state:e.state,link:e.link,...t.success?{tests:Pr(t.data)}:{}}}function Jr(e){let t=typeof e==`object`&&e?e.update_workflows:void 0;return Array.isArray(t)?t.flatMap(e=>typeof e==`object`&&e&&typeof e.workflow==`string`?[{workflow:e.workflow}]:[]):[]}var Yr={kind:`single`,initialPaths:(e,t)=>[t]},Xr=e=>({state:e.state,link:e.link}),Zr=new Map(Object.entries({"pipeline-status":{testHistory:!0,symbol:{glyph:`▣`,label:`Pipeline status`},Renderer:Ir,polling:Yr,projectDiagnostic:Vr},"pull-request-health":{symbol:{glyph:`⌘`,label:`Pull request health`},Renderer:Ur,polling:{kind:`pull-request-health`,initialPaths:(e,t)=>[`${t}/pull-requests`,...Jr(e).map(({workflow:e})=>`${t}/update-workflow/${encodeURIComponent(e)}`)]},projectDiagnostic:Wr},"http-value":{symbol:{glyph:`◌`,label:`HTTP value`},Renderer:St,polling:{kind:`facts`,initialPaths:(e,t)=>e.facts?e.facts.map(e=>`${t}/facts/${encodeURIComponent(e.id)}`):[t]},projectDiagnostic:Xr},"test-count":{testHistory:!0,symbol:{glyph:`≡`,label:`Test count`},Renderer:Gr,polling:Yr,projectDiagnostic:qr},"pipeline-animation-demo":{symbol:{glyph:`✦`,label:`Pipeline animation demo`},Renderer:wr,polling:{kind:`local`},projectDiagnostic:Xr}}));function Z(e){return Zr.get(e)}function Qr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a,testDirection:o}){let s=Z(e.type)?.Renderer;return s?p(s,{panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a,testDirection:o}):p(st,{label:e.type,hint:`Not wired yet`,wide:!0})}var $r={control:`_control_giazw_1`,backdrop:`_backdrop_giazw_5`,dialog:`_dialog_giazw_15`};function ei({env:e,auth:t}){let[n,r]=l(!1),[i,o]=l(`idle`),[s,u]=l(),d=c(null),h=c(null),g=c(null),_=c(!1);a(()=>{if(!n){_.current&&d.current?.focus(),_.current=!1;return}_.current=!0;let e=()=>r(!1),t=t=>{t.key===`Escape`&&e()},i=e=>{if(e.key!==`Tab`)return;let t=[...h.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=h.current;return a?.addEventListener(`keydown`,i),window.addEventListener(`keydown`,t),g.current?.focus(),()=>{a?.removeEventListener(`keydown`,i),window.removeEventListener(`keydown`,t)}},[n]);async function v(){r(!0),o(`loading`),u(void 0);try{let n=await M(e,`${e.proxyPath}/boards/${encodeURIComponent(e.board)}/security`,void 0,globalThis.fetch,t);if(!n.ok)throw Error(`Security details returned ${n.status}`);let r=Te.safeParse(await n.json());if(!r.success)throw Error(`Security details were malformed`);u(r.data),o(`idle`)}catch{o(`error`)}}return m(f,{children:[p(`button`,{ref:d,className:$r.control,type:`button`,"aria-expanded":n,"aria-controls":`security-details-dialog`,onClick:()=>void v(),children:`Security`}),n&&p(`div`,{className:$r.backdrop,role:`presentation`,children:m(`section`,{ref:h,className:$r.dialog,id:`security-details-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`security-title`,children:[p(`h2`,{id:`security-title`,children:`Security details`}),i===`loading`&&p(`p`,{"aria-live":`polite`,children:`Loading security details…`}),i===`error`&&p(`p`,{role:`alert`,children:`Security details are unavailable.`}),s&&p(ti,{details:s}),p(`button`,{ref:g,type:`button`,onClick:()=>r(!1),children:`Close`})]})})]})}function ti({details:e}){return e.policy.mode===`claim`?m(`p`,{children:[`OIDC is enabled. Access uses the `,p(`code`,{children:e.policy.claim}),` claim with a`,` `,p(`strong`,{children:e.policy.match}),` match policy.`]}):e.policy.mode===`authenticated`?p(`p`,{children:`OIDC is enabled. Any verified API access token with a subject may view this board.`}):p(`p`,{children:`OIDC is enabled. Access is limited to a server-held subject policy.`})}var ni={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},ri=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function ii({mode:e}){return e===`blocked`?m(`main`,{className:ni.blocked,role:`alert`,children:[p(`h1`,{children:`⚠ Authentication configuration required`}),p(`p`,{children:`This dashboard is blocked because authentication is required but has not been configured.`}),p(`p`,{children:`No dashboard data was loaded.`}),m(`p`,{children:[p(`a`,{href:ri,children:`Read the authentication setup guide`}),`.`]})]}):m(`aside`,{className:ni.notice,role:`alert`,"aria-label":`Unauthenticated deployment warning`,children:[p(`span`,{"aria-hidden":`true`,children:`⚠`}),m(`span`,{children:[p(`strong`,{children:`This deployment has no authentication.`}),` If this is reachable on a public network and reveals important information, take it down now. Configure the board’s`,` `,p(`code`,{children:`auth`}),` block and `,p(`code`,{children:`security: required`}),`, or set`,` `,p(`code`,{children:`security: unsecured`}),` to explicitly acknowledge intentional public access.`,` `,p(`a`,{href:ri,children:`Read the authentication setup guide`}),`.`]})]})}var Q={trigger:`_trigger_g9eon_1`,close:`_close_g9eon_2`,dialog:`_dialog_g9eon_11`,dialogHeader:`_dialogHeader_g9eon_22`,note:`_note_g9eon_32`,empty:`_empty_g9eon_33`,body:`_body_g9eon_43`,legend:`_legend_g9eon_48`,axis:`_axis_g9eon_57`,lanes:`_lanes_g9eon_64`,lane:`_lane_g9eon_64`,laneLabel:`_laneLabel_g9eon_75`,track:`_track_g9eon_78`,observed:`_observed_g9eon_85`,expected:`_expected_g9eon_86`},ai=6e5;function oi({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-ai,o=t.filter(e=>e.kind===`panel-fetch-start`&&Number.isFinite(Date.parse(e.at))&&Date.parse(e.at)>=a&&Date.parse(e.at)<=i),s=e.map(e=>{let t=new Map;for(let n of o){if(n.panelId!==e.panelId)continue;let r=t.get(n.path)??[];r.push(n.at),t.set(n.path,r)}return{...e,observed:[...t.entries()].map(([e,t])=>({path:e,starts:t})),hasRetainedEvidence:t.size>0}});return{capturedAt:r.toISOString(),window:{from:new Date(a).toISOString(),to:r.toISOString()},schedules:e,lanes:s,evidenceMayBeIncomplete:n.eventsPrunedByAge>0||n.eventsPrunedByCount>0}}function si(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-ai))/ai*100))}function ci(e,t){return`${e.label}, panel ${e.panelId}; ${li(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?ui(e.nextDueAt,t):`awaiting first request`}; ${e.observed.length?`${e.observed.length} observed proxy path${e.observed.length===1?``:`s`}`:`no retained requests in the last 10 minutes`}`}function li(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function ui(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${di(-n)}`:`Next poll in ${di(n)}`}function di(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function fi({board:e,schedules:t,log:n}){let[r,i]=l(()=>new Date),[o,d]=l(!1),h=c(null),g=c(null),_=c(null),v=c(!1);u(n.subscribe,n.snapshot,n.snapshot),a(()=>{if(!o)return;let e=window.setInterval(()=>i(new Date),1e3);return()=>window.clearInterval(e)},[o]);let y=s(()=>oi({schedules:t,...n.retainedEvidence(),now:r}),[n,r,t]);return a(()=>{if(!o){v.current&&h.current?.focus(),v.current=!1;return}v.current=!0;let e=()=>d(!1),t=window.setTimeout(e,6e4),n=()=>{window.clearTimeout(t),t=window.setTimeout(e,6e4)},r=t=>{t.key===`Escape`&&e()},i=e=>{if(e.key!==`Tab`)return;let t=[...g.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=g.current;return a?.addEventListener(`pointerdown`,n),a?.addEventListener(`keydown`,n),a?.addEventListener(`focusin`,n),a?.addEventListener(`keydown`,i),window.addEventListener(`keydown`,r),_.current?.focus(),()=>{window.clearTimeout(t),a?.removeEventListener(`pointerdown`,n),a?.removeEventListener(`keydown`,n),a?.removeEventListener(`focusin`,n),a?.removeEventListener(`keydown`,i),window.removeEventListener(`keydown`,r)}},[o]),m(f,{children:[p(`button`,{ref:h,className:Q.trigger,type:`button`,"aria-expanded":o,"aria-controls":`update-activity-dialog`,onClick:()=>{i(new Date),d(!0)},children:`Update activity`}),o&&m(`section`,{ref:g,className:Q.dialog,"data-update-activity":!0,id:`update-activity-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`update-activity-title`,children:[m(`div`,{className:Q.dialogHeader,children:[m(`div`,{children:[p(`h2`,{id:`update-activity-title`,children:`Update activity`}),p(`p`,{children:`Browser-local proxy reads from the last 10 minutes. Panels schedule independently.`})]}),p(`button`,{ref:_,className:Q.close,type:`button`,onClick:()=>d(!1),children:`Close`})]}),m(`div`,{className:Q.body,children:[p(`span`,{className:Q.legend,children:`● observed · ◇ expected`}),e&&y.lanes.length===0&&p(`p`,{className:Q.empty,children:`No visible polling panels are configured.`}),y.lanes.length>0&&m(f,{children:[m(`div`,{className:Q.axis,"aria-hidden":`true`,children:[p(`span`,{children:`10m ago`}),p(`span`,{children:`now`})]}),p(`div`,{className:Q.lanes,children:y.lanes.map(e=>m(`div`,{className:Q.lane,"data-update-activity-lane":!0,children:[p(`span`,{className:Q.laneLabel,children:e.label}),m(`span`,{className:Q.track,role:`img`,"aria-label":ci(e,r),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>p(`i`,{className:Q.observed,style:{left:`${si(t,r)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&p(`i`,{className:Q.expected,style:{left:`${si(e.nextDueAt,r)}%`},title:`Expected next poll`})]})]},e.panelId))})]}),y.evidenceMayBeIncomplete&&p(`p`,{className:Q.note,children:`Older browser evidence was pruned, so an empty lane only means no retained request in this window.`}),p(`p`,{className:Q.note,children:`Observed markers are requests this browser started; the outlined marker is the current expected next poll, not an observed request.`})]})]})]})}function pi({env:e,diagnostics:t,auth:n}){let[r,i]=l(),[o,s]=l();return a(()=>{let r=!1;i(void 0),s(void 0);let a=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return t.record({kind:`board-fetch-start`,path:a}),M(e,a,void 0,globalThis.fetch,n).then(async e=>{if(t.record({kind:`board-fetch-response`,path:a,status:e.status,cache:qe(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw t.record({kind:`board-fetch-parse-failure`,path:a,message:mi(e)}),new hi(e)}}).then(n=>{if(r)return;i(n),s(e.board);let o=Array.isArray(n.panels)?n.panels:[];t.record({kind:`board-fetch-response`,path:a,boardSummary:{panelCount:o.length,panelIds:o.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}).catch(n=>{n instanceof hi||t.record({kind:`board-fetch-failure`,path:a,message:mi(n)}),r||(i({panels:[]}),s(e.board))}),()=>{r=!0}},[n,t,e]),{board:r,loadedBoardName:o}}function mi(e){return e instanceof Error?e.message:String(e)}var hi=class extends Error{constructor(e){super(mi(e))}},gi=6e4,_i=1e4,vi=()=>globalThis.window.location.reload();function yi({env:e,diagnostics:t,fetcher:n,reload:r=vi,auth:i}){a(()=>{let a=!1,o=!1,s,c=`${e.proxyPath}/client`,l=async()=>{if(a||o)return;o=!0;let u=new AbortController;s=u;let d=globalThis.setTimeout(()=>u.abort(),_i);t.record({kind:`client-update-check`,path:c});try{let o=await M(e,c,{cache:`no-store`,signal:u.signal},n??globalThis.fetch,i);if(!o.ok)throw Error(`Client identity returned ${o.status}`);let s=ee.safeParse(await o.json());if(!s.success)throw Error(`Client identity response was invalid`);if(a)return;t.record({kind:`client-update-response`,path:c,serverVersion:s.data.serverVersion,assetPathIdMatches:s.data.assetPathId===e.assetPathId}),s.data.assetPath!==e.assetPath&&(t.record({kind:`client-update-detected`,path:c,current:{assetPath:e.assetPath},next:s.data}),r())}catch(e){!a&&!(e instanceof DOMException&&e.name===`AbortError`)&&t.record({kind:`client-update-failure`,path:c,message:e instanceof Error?e.message:String(e)})}finally{globalThis.clearTimeout(d),o=!1,s===u&&(s=void 0),a||globalThis.setTimeout(()=>void l(),gi)}};return l(),()=>{a=!0,s?.abort()}},[i,t,e,n,r])}function bi(e,t){return Z(e.type)?.projectDiagnostic(t)??{state:t.state,link:t.link}}function xi(e){let t=Object.entries(e).map(([e,t])=>t?.envelope?{id:e,state:t.envelope.state,link:t.envelope.link}:{id:e,state:`unavailable`,link:null});return{state:t.some(e=>e.state===`ok`)?`ok`:`error`,link:null,facts:t}}function Si(e){if(e.state!==`ok`)return;let t=k.safeParse(e.signal);if(t.success){if(t.data.status===`running`||t.data.testResults?.state!==`ok`)return;let e=t.data.testResults.signal;return e.status===`reported`?e:void 0}let n=ae.safeParse(e.signal);return n.success&&n.data.status===`reported`?n.data:void 0}function Ci(e,t){let n=Math.abs(t-e);return n>=20&&(e===0||n/e>=.2)}function wi(e){let t=e.slice(-8).map(e=>e.total),n=t.at(-1);if(n===void 0)return;let r=t.at(-2),i=`quiet`,a=r??n,o=Math.min(2,t.length);if(r!==void 0&&n===0&&r>0)i=`zero`;else if(r!==void 0&&Ci(r,n))i=`jump`;else{for(let e=t.length-3;e>=1;e--){let n=t[e-1],r=t[e];if(n!==void 0&&r!==void 0&&Ci(n,r)&&t.slice(e+1).every(e=>Math.abs(e-r)<=Math.max(2,r*.02))){i=`holding`,a=n,o=t.length-e+1;break}}if(i===`quiet`){let e=t.slice(1).map((e,n)=>e-(t[n]??e)).filter(e=>e!==0),s=n-(t[0]??n);e.length>=3&&Math.abs(s)>=5&&e.every(e=>Math.sign(e)===Math.sign(s))?(i=`trend`,a=t[0]??n,o=t.length):r!==void 0&&n!==r&&(i=`change`)}}let s=n-a,c=i===`quiet`?``:i===`zero`?`⚠ ↓`:i===`holding`?`→`:i===`trend`?s>0?`↗`:`↘`:s>0?`↑`:`↓`,l=a>0?` (${s>0?`+`:``}${(s/a*100).toFixed(1)}%)`:``,u={zero:`Reported zero tests; previously ${a.toLocaleString()}.`,jump:`Large jump: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,holding:`Holding a new level: ${n.toLocaleString()} tests, previously ${a.toLocaleString()}${l}.`,trend:`Sustained ${s>0?`increase`:`decrease`}: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,change:`Latest change: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,quiet:`No clear count change. Latest: ${n.toLocaleString()} tests.`};return{mode:i,symbol:c,delta:s,emphasized:i===`zero`||i===`jump`,totals:t,explanation:`${u[i]} Comparison: ${o} retained run reading${o===1?``:`s`}. History: ${t.join(` → `)}. Source readings retained by this browser are included; this is not complete CI history or a measure of test quality.`}}function Ti(e){if(e)return{mode:e.mode,delta:e.delta,totals:e.totals}}var Ei=36e5,Di=24*Ei,$={retentionMillis:14*Di,retainedReadings:32,refreshMillis:Di,gapMillis:Ei,minimumAttemptMillis:Ei,retryDelaysMillis:[Ei,6*Ei,Di]},Oi={failures:0,gapPending:!1};function ki(e){return JSON.stringify([e.id,e.attempt])}function Ai(e,t){return Date.parse(e.updatedAt)-Date.parse(t.updatedAt)||e.id.localeCompare(t.id,`en`,{numeric:!0})||e.attempt-t.attempt}function ji(e,t,n){let r=new Map(e.map(e=>[ki(e),e]));for(let e of t){let t=r.get(ki(e));(!t||Date.parse(e.updatedAt)>=Date.parse(t.updatedAt))&&r.set(ki(e),e)}return[...r.values()].filter(e=>Date.parse(e.updatedAt)>=n-$.retentionMillis).sort(Ai).slice(-$.retainedReadings)}function Mi(e,t,n=!1){let r=e.findIndex(e=>ki(e)===ki(t));if(r<0)return;let i=wi([...e.slice(0,r),t]);return i&&n?{...i,explanation:`${i.explanation} Recent source-history inspection was incomplete.`}:i}function Ni(e=Oi,t){return{...e,lastConfirmedAt:t,gapPending:e.gapPending||e.lastConfirmedAt!==void 0&&t-e.lastConfirmedAt>=$.gapMillis}}function Pi(e=Oi,t,n){return n>=(e.nextAttemptAt??0)&&(e.lastCompleteAt===void 0||n-e.lastCompleteAt>=$.refreshMillis||e.gapPending||e.hadSamples===!0&&!t)}function Fi(e=Oi,t){return{...e,lastAttemptAt:t,nextAttemptAt:t+$.minimumAttemptMillis}}function Ii(e=Oi,t,n,r,i=0){let a={...e,hadSamples:n,partial:!t?.complete||t.samples.length<t.inspectedRuns};if(t?.complete)return{...a,lastCompleteAt:r,failures:0,gapPending:!1,nextAttemptAt:r+$.minimumAttemptMillis};let o=e.failures+1,s=$.retryDelaysMillis[Math.min(o-1,$.retryDelaysMillis.length-1)]??$.refreshMillis;return{...a,failures:o,nextAttemptAt:Math.max(r+s,i,t?.retryAt?Date.parse(t.retryAt):0)}}var Li=`ze-great-dashboard.panel-memory.v1`,Ri=1,zi=12096e5,Bi=class{now;histories;storage;constructor(e=Pe(),t=()=>new Date){this.now=t,this.storage=e,this.histories=this.read(),this.pruneAll()}latest(e){return this.history(e).latest}rememberLatest(e,t){this.history(e).latest=t,this.persist()}recordRun(e,t,n=!1){let r=this.history(e);n&&(r.durations[Vi(t)]=t);let i=r.latestCompleted;(!i||Hi(t.sourceUpdatedAt,i.sourceUpdatedAt))&&(r.latestCompleted=t),this.pruneHistory(r),this.persist()}recordSuccessfulRun(e,t){this.recordRun(e,t,!0)}recordCompletedRun(e,t){this.recordRun(e,t)}medianDuration(e){let t=this.history(e);this.pruneHistory(t);let n=Object.values(t.durations).map(({durationMs:e})=>e).sort((e,t)=>e-t);if(n.length===0)return;let r=Math.floor(n.length/2);if(n.length%2==1)return n[r];let i=n[r-1],a=n[r];return i===void 0||a===void 0?void 0:Math.floor((i+a)/2)}resolveEstimatedDuration(e){let t=this.medianDuration(e);if(t!==void 0)return t;let n=this.history(e);return this.pruneHistory(n),n.latestCompleted?.durationMs}observeTests(e,t,n){let r=Si(n);if(!r?.run)return;let i=this.testHistory(e,t),a={...r.run,total:r.total};return i.tests=ji(i.tests??[],[a],this.now().valueOf()),i.repair&&={...i.repair,hadSamples:!!i.tests.length},this.persist(),Mi(i.tests,a,i.repair?.partial)}testDirection(e,t,n){let r=Si(n);if(!r?.run)return;let i=this.testHistory(e,t);return this.pruneHistory(i),Mi(i.tests??[],{...r.run,total:r.total},i.repair?.partial)}confirmTestPoll(e,t){let n=this.testHistory(e,t);n.repair=Ni(n.repair,this.now().valueOf()),this.persist()}testRepairDue(e,t){let n=this.testHistory(e,t);return this.pruneHistory(n),Pi(n.repair,!!n.tests?.length,this.now().valueOf())}beginTestRepair(e,t){let n=this.testHistory(e,t);n.repair=Fi(n.repair,this.now().valueOf()),this.persist()}finishTestRepair(e,t,n,r){let i=this.testHistory(e,t),a=this.now().valueOf();i.tests=ji(i.tests??[],n?.samples??[],a),i.repair=Ii(i.repair,n,!!i.tests.length,a,r),this.persist()}testHistory(e,t){return this.history({...Wi(e,t),testArtifact:JSON.stringify(t.test_results??null)})}history(e){let t=Gi(e),n=this.histories[t];if(n)return n;let r={durations:{}};return this.histories[t]=r,r}pruneAll(){for(let e of Object.values(this.histories))this.pruneHistory(e);this.persist()}pruneHistory(e){let t=this.now().valueOf()-zi;e.tests&&=ji(e.tests,[],this.now().valueOf());for(let[n,r]of Object.entries(e.durations)){let i=Ui(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?Ui(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=Fe(this.storage,Li);return e?.schemaVersion!==Ri||!e.histories?{}:Ki(e.histories)?e.histories:{}}persist(){Ie(this.storage,Li,{schemaVersion:Ri,histories:this.histories})}};function Vi(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function Hi(e,t){let n=Ui(e),r=Ui(t);return n!==void 0&&(r===void 0||n>=r)}function Ui(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Wi(e,t){return{board:e,panelId:t.id,source:t.source??``,workflow:typeof t.pipeline==`string`||typeof t.pipeline==`number`?String(t.pipeline):``,branch:t.branch??``}}function Gi(e){let t=[e.board,e.panelId,e.source,e.workflow,e.branch];return e.testArtifact!==void 0&&t.push(e.testArtifact),JSON.stringify(t)}function Ki(e){return Yi(e)?Object.values(e).every(qi):!1}function qi(e){if(!Yi(e)||!Yi(e.durations)||!Object.values(e.durations).every(Ji))return!1;if(e.repair!==void 0){if(!Yi(e.repair)||!Number.isInteger(e.repair.failures)||Number(e.repair.failures)<0||typeof e.repair.gapPending!=`boolean`)return!1;for(let t of[`lastConfirmedAt`,`lastCompleteAt`,`lastAttemptAt`,`nextAttemptAt`]){let n=e.repair[t];if(n!==void 0&&(typeof n!=`number`||!Number.isFinite(n)||n<0))return!1}if(e.repair.partial!==void 0&&typeof e.repair.partial!=`boolean`||e.repair.hadSamples!==void 0&&typeof e.repair.hadSamples!=`boolean`)return!1}return e.tests!==void 0&&(!Array.isArray(e.tests)||!e.tests.every(e=>Yi(e)&&typeof e.id==`string`&&e.id.length>0&&Number.isInteger(e.attempt)&&Number(e.attempt)>0&&typeof e.updatedAt==`string`&&Number.isFinite(Date.parse(e.updatedAt))&&Number.isInteger(e.total)&&Number(e.total)>=0))?!1:e.latestCompleted===void 0||Ji(e.latestCompleted)}function Ji(e){return Yi(e)?(typeof e.link==`string`||e.link===null)&&(e.sourceRunId===void 0||typeof e.sourceRunId==`string`)&&typeof e.durationMs==`number`&&Number.isInteger(e.durationMs)&&e.durationMs>=0&&typeof e.sourceUpdatedAt==`string`&&Ui(e.sourceUpdatedAt)!==void 0:!1}function Yi(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function Xi(e){e.diagnostics.record({kind:`panel-fetch-start`,panelId:e.panelId,path:e.path});try{let t=await e.fetcher(e.path,{signal:e.signal}),n={kind:`panel-fetch-response`,panelId:e.panelId,path:e.path,status:t.status,cache:qe(t.headers)};if(t.status===304){e.diagnostics.record(n);let t=e.cache.get(e.path);return t?{envelope:t}:{error:`Source returned not modified before an initial observation.`}}let r=O.safeParse(await t.json());if(!r.success)return e.diagnostics.record(n),e.diagnostics.record({kind:`panel-fetch-parse-failure`,panelId:e.panelId,path:e.path,message:`Response was not a valid signal envelope.`}),{error:`Response was not a valid signal envelope.`};let i=r.data;return e.diagnostics.record({...n,envelope:i,...i.state===`error`?{failure:Zi(i,t)}:{}}),i.state===`ok`&&e.cache.set(e.path,i),{envelope:i}}catch(t){return e.signal?.aborted||e.diagnostics.record({kind:`panel-fetch-failure`,panelId:e.panelId,path:e.path,message:Qi(t)}),{error:Qi(t)}}}function Zi(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Qi(e){return e instanceof Error?e.message:String(e)}function $i(e){return e.reconciliation.kind===`rejected`&&e.accepted?{envelope:e.current,rejected:{status:e.accepted.status,sourceUpdatedAt:e.accepted.sourceUpdatedAt,link:e.accepted.link,github:na(e.reconciliation.envelope.link)}}:{envelope:e.reconciliation.envelope}}function ea(e){let t=ta(e.envelope);if(!t)return{kind:`not-pipeline`,envelope:e.envelope};if(e.accepted&&t.sourceUpdatedAt&&Date.parse(t.sourceUpdatedAt)<Date.parse(e.accepted.sourceUpdatedAt))return e.envelope.state!==`ok`||!t.sourceUpdatedAt?{kind:`not-pipeline`,envelope:e.envelope}:{kind:`rejected`,envelope:e.envelope,signal:{...t,sourceUpdatedAt:t.sourceUpdatedAt}};let n=t.sourceUpdatedAt?{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:e.envelope.link}:void 0,r=t.status!==`running`&&t.durationMs!==void 0&&t.sourceUpdatedAt&&Number.isFinite(Date.parse(t.sourceUpdatedAt))?{link:e.envelope.link,...t.sourceRunId?{sourceRunId:t.sourceRunId}:{},durationMs:t.durationMs,sourceUpdatedAt:t.sourceUpdatedAt}:void 0;return{kind:`accepted`,envelope:t.status===`running`&&e.estimatedDurationMs!==void 0&&e.envelope.state===`ok`?{...e.envelope,signal:{...t,estimatedDurationMs:e.estimatedDurationMs}}:e.envelope,signal:t,accepted:n,durationSample:r}}function ta(e){if(e.state!==`ok`)return;let t=k.safeParse(e.signal);return t.success?t.data:void 0}function na(e){if(!e)return!1;try{return new URL(e).hostname===`github.com`}catch{return!1}}function ra(e){return e.panels.flatMap(e=>{if(ye(e.position))return[];let t=Z(e.type)?.polling;return t&&t.kind!==`local`?[{panel:e,polling:t}]:[]})}function ia(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function aa(e,t,{panel:n,polling:r}){let i=ia(t,n.id),a=r.initialPaths(n,i);return{panelId:n.id,label:n.label??n.id,settings:Ce(e,n),cadence:`normal`,inFlight:!1,knownPaths:a}}function oa(e,t,n){let r=sa(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=ca(r);return i===void 0?{delayMillis:n.runningRefreshMillis,cadence:`running`}:t<i?{delayMillis:Math.min(n.runningRefreshMillis,i-t),cadence:`running`}:t<i+n.runningCompletionWindowMillis?{delayMillis:n.runningCompletionRefreshMillis,cadence:`completion-window`}:{delayMillis:n.runningRefreshMillis,cadence:`running`}}function sa(e){if(e?.state!==`ok`)return;let t=k.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function ca(e){if(!e.runStartedAt||e.estimatedDurationMs===void 0)return;let t=Date.parse(e.runStartedAt);return Number.isFinite(t)?t+e.estimatedDurationMs:void 0}function la(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=da(n.envelope,`pull-request-workflow`);if(r)return r.item;let i=n.error??`No usable observation is available.`;return t.push({label:`Update workflow ${e}`,message:i}),{label:e,status:`unknown`,detail:`Update workflow ${e} · Unavailable: ${i}`,link:null}}),r=fa(e.candidates.envelope);if(!r){let r=e.candidates.error??`No usable observation is available.`;return t.push({label:`Open update PR candidates`,message:r}),n.every(e=>e.status===`unknown`)?void 0:ua(e,n,[],t,pa(e.workflows.map(({observation:e})=>e)))}return r.truncated&&t.push({label:`Open update PR candidates`,message:`The first 100 candidates were observed; additional open update PRs may exist.`}),ua(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=da(r?.envelope,`pull-request-build`);if(i)return{...i.item,label:`PR #${n.number}`,detail:i.item.detail,link:n.link};let a=r?.error??`No usable observation is available.`;return t.push({label:`PR #${n.number}`,message:a}),{label:`PR #${n.number}`,status:`unknown`,detail:`${n.branch} · Unavailable: ${a}`,link:n.link}}),t,pa([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function ua(e,t,n,r,i){let a=ma([...t,...n].map(e=>e.status)),o=[...t,...n].find(e=>e.status===a),s=a!==`passed`&&o?`${o.label}: ${o.detail}`:n.length===0?`${t.length} update workflow${t.length===1?``:`s`} · No open update PRs`:`${t.length} update workflow${t.length===1?``:`s`} · ${n.length} open update PR${n.length===1?``:`s`}`,c=i.sort();return{panelId:e.panelId,state:`ok`,observedAt:c[0]??new Date().toISOString(),link:e.link,signal:{type:`pull-request-health`,status:a,summary:s,workflows:t,pullRequests:n,...r.length?{incompleteObservations:r}:{},...c.length>1?{newestObservedAt:c.at(-1)}:{}}}}function da(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?pe:me).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function fa(e){if(e?.state!==`ok`)return;let t=fe.safeParse(e.signal);return t.success?t.data:void 0}function pa(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function ma(e){return e.reduce((e,t)=>ce(t)>ce(e)?t:e,`passed`)}var ha=class{options;pending=new Map;activePolls=new Set;healthy=new Set;controller;disposed=!1;constructor(e){this.options=e}currentStarted(e){this.activePolls.add(e)}currentSettled(e,t,n,r){this.disposed||(this.activePolls.delete(e.id),r||this.pending.delete(e.id),n?this.healthy.add(e.id):this.healthy.delete(e.id),n&&r&&(this.options.memory.confirmTestPoll(this.options.board,e),this.options.memory.testRepairDue(this.options.board,e)&&this.pending.set(e.id,{panel:e,path:`${t}/test-history`})),this.drain())}dispose(){this.disposed=!0,this.pending.clear(),this.controller?.abort()}drain(){if(!(this.disposed||this.controller||this.activePolls.size||!(this.options.visible?.()??document.visibilityState===`visible`))){for(let[e,t]of this.pending)if(this.pending.delete(e),this.healthy.has(e)&&this.options.memory.testRepairDue(this.options.board,t.panel)){this.controller=new AbortController,this.run(t,this.controller);return}}}async run({panel:e,path:t},n){let{board:r,memory:i,diagnostics:a}=this.options;i.beginTestRepair(r,e);let o,s;try{let e=await this.options.fetcher(t,{signal:n.signal});s=Oe(e.headers.get(`retry-after`),Date.now()),e.ok&&(o=De.parse(await e.json()))}catch{}!this.disposed&&!n.signal.aborted&&(i.finishTestRepair(r,e,o,s),a.record({kind:`test-history-repair`,panelId:e.id,path:t,outcome:o?.complete?`complete`:o?`partial`:`failed`,inspectedRuns:o?.inspectedRuns??0,samples:o?.samples.length??0}),this.options.onMerged(e)),this.controller=void 0,this.drain()}};function ga({board:e,env:t,diagnostics:n,memory:r,auth:i}){let[o,s]=l({}),u=c({}),[d,f]=l({}),[p,m]=l({}),[h,g]=l({}),[_,v]=l([]),[y,b]=l({}),x=c({}),S=c({}),C=c(null);return C.current||=r??new Bi,a(()=>{if(x.current={},S.current={},f({}),s({}),u.current={},m({}),g({}),v([]),b({}),!e)return;let r=!1,a=C.current;if(!a)return;let o=new Map,c=(e,r)=>{JSON.stringify(o.get(e.id))!==JSON.stringify(r)&&(o.set(e.id,r),n.record({kind:`panel-rendered`,panelId:e.id,path:ia(t,e.id),rendered:r}))},l=(e,n)=>{if(r)return;let i=Z(e.type)?.testHistory?a.testDirection(t.board,e,n):void 0,o=Ti(i);c(e,{...bi(e,n),...o?{testDirection:o}:{}}),u.current={...u.current,[e.id]:i},s(u.current),x.current={...x.current,[e.id]:n},f(x.current)},d=(e,t)=>{r||(c(e,xi(t)),S.current={...S.current,[e.id]:t},g(S.current))},p=new ha({board:t.board,memory:a,diagnostics:n,fetcher:(e,n)=>M(t,e,n,globalThis.fetch,i),onMerged:e=>{let t=x.current[e.id];t&&l(e,t)}}),h=new Set,_=new Set,y=ra(e),w=y.map(n=>aa(e,t,n)),ee=new Map(w.map(e=>[e.panelId,e]));v(w);let te=(e,t)=>{r||v(n=>n.map(n=>n.panelId===e?{...n,...t}:n))};for(let{panel:e,polling:a}of y){let o=!1,s=C.current;if(!s)return;let c=ee.get(e.id);if(!c)continue;let{settings:u}=c,f=ia(t,e.id),g,v,y=()=>{v=new Date().toISOString(),r||m(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},S=t=>{let n=v;if(r||!n)return;let i=ya(t);m(t=>{let r=t[e.id];return{...t,[e.id]:{consecutiveFailures:(r?.consecutiveFailures??0)+1,message:i,lastConfirmedAt:n}}})},w=async t=>{if(r||o)return;o=!0;let i=new AbortController,a={signal:i.signal,healthy:!1,historySupported:!1};_.add(i),p.currentStarted(e.id),te(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0});try{await t(a)}catch(t){!r&&!a.signal.aborted&&(S(t),t instanceof ba||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:f,message:ya(t)}))}finally{if(o=!1,_.delete(i),!r&&!a.signal.aborted){let n=oa(g,Date.now(),u);te(e.id,{inFlight:!1,cadence:n.cadence,nextDueAt:new Date(Date.now()+n.delayMillis).toISOString()});let r=window.setTimeout(()=>{h.delete(r),w(t)},n.delayMillis);h.add(r)}p.currentSettled(e,f,a.healthy,a.historySupported)}};switch(a.kind){case`facts`:{if(!e.facts)break;let r=e.facts,a=new Map;w(async({signal:o})=>{let s=await Promise.all(r.map(async r=>{let s=await Xi({diagnostics:n,panelId:e.id,path:`${f}/facts/${encodeURIComponent(r.id)}`,signal:o,cache:a,fetcher:(e,n)=>M(t,e,n,globalThis.fetch,i)});return[r.id,s.error?{failure:s.error}:s]}));o.aborted||d(e,Object.fromEntries(s))});continue}case`pull-request-health`:{let a=Jr(e),o=new Map;w(async({signal:s})=>{let c=async r=>{let a=await Xi({diagnostics:n,panelId:e.id,path:r,signal:s,cache:o,fetcher:(e,n)=>M(t,e,n,globalThis.fetch,i)});return a.envelope?.state===`error`?{error:a.envelope.error.message}:a},[u,...d]=await Promise.all([c(`${f}/pull-requests`),...a.map(({workflow:e})=>c(`${f}/update-workflow/${encodeURIComponent(e)}`))]);if(r||s.aborted)return;let p=u.envelope?.state===`ok`&&va(u.envelope.signal)?u.envelope.signal.pullRequests:[],m=await Promise.all(p.map(async e=>[e.branch,await c(`${f}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)]));if(r||s.aborted)return;let h=la({panelId:e.id,link:u.envelope?.link??null,workflows:a.map(({workflow:e},t)=>({workflow:e,observation:d[t]??{error:`Missing workflow result.`}})),candidates:u,builds:new Map(m)});h?(g=h,y(),l(e,h)):S(`No usable pull-request observations.`)});continue}}w(async a=>{n.record({kind:`panel-fetch-start`,panelId:e.id,path:f});let o=await M(t,f,{signal:a.signal},globalThis.fetch,i);a.historySupported=Z(e.type)?.testHistory===!0&&o.headers.get(`X-Dashboard-Test-History`)===`supported`;let c={kind:`panel-fetch-response`,panelId:e.id,path:f,status:o.status,cache:qe(o.headers)};if(o.status===304){a.healthy=g?.state===`ok`,n.record(c),y();return}let u;try{let t=xa(await o.json());if(!t){n.record(c),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:f,message:`Response was not a valid signal envelope.`}),S(`Response was not a valid signal envelope.`);return}u=t,n.record({...c,envelope:u,...u.state===`error`?{failure:_a(u,o)}:{}}),a.healthy=u.state===`ok`,y()}catch(t){throw n.record(c),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:f,message:ya(t)}),new ba(t)}if(r||a.signal.aborted)return;let d={status:o.status,cache:c.cache};if(e.type===`pipeline-status`){let i=Wi(t.board,e),a=s.latest(i),o=ea({envelope:u,accepted:a,estimatedDurationMs:s.resolveEstimatedDuration(i)}),c=$i({current:x.current[e.id],reconciliation:o,accepted:a});if(o.kind===`rejected`&&a){let t=o.signal;n.recordGithubConsistencyIncident({panelId:e.id,endpoint:f,identity:{source:i.source,workflow:i.workflow,branch:i.branch},accepted:a,regressed:{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:u.link},response:{httpStatus:d.status,date:d.cache?.date,etag:d.cache?.etag,cacheControl:d.cache?.cacheControl}}),r||b(t=>({...t,[e.id]:c.rejected}));return}if(o.kind===`accepted`&&(u=o.envelope,!r&&c.rejected===void 0&&b(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n}),o.accepted&&s.rememberLatest(i,o.accepted),o.durationSample)){let e={link:o.durationSample.link,...o.durationSample.sourceRunId?{sourceRunId:o.durationSample.sourceRunId}:{},durationMs:o.durationSample.durationMs,sourceUpdatedAt:o.durationSample.sourceUpdatedAt};s.recordRun(i,e,o.signal.status===`passed`)}}g=u,Z(e.type)?.testHistory&&s.observeTests(t.board,e,u),l(e,u)})}return()=>{r=!0,p.dispose();for(let e of _)e.abort();for(let e of h)window.clearTimeout(e)}},[i,e,n,t]),{signals:d,updateHealth:p,factSignals:h,schedules:_,rejectedPipelines:y,testDirections:o}}function _a(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function va(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function ya(e){return e instanceof Error?e.message:String(e)}var ba=class extends Error{constructor(e){super(ya(e))}};function xa(e){let t=O.safeParse(e);return t.success?t.data:void 0}function Sa({env:e}){return e.security===`blocked`?p(ii,{mode:`blocked`}):e.auth?p(it,{env:e,auth:e.auth,children:(e,t,n,r)=>p(Ca,{env:n,accessToken:e,onDenied:t,diagnosticLog:r})}):p(Ca,{env:e})}function Ca({env:e,accessToken:t,onDenied:n,diagnosticLog:r}){let i=c(null);i.current||=r??new Ge(e);let o=r??i.current,l=s(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);yi({env:e,diagnostics:o,auth:l});let{board:u,loadedBoardName:d}=pi({env:e,diagnostics:o,auth:l}),{signals:f,updateHealth:h,factSignals:g,schedules:_,rejectedPipelines:v,testDirections:y}=ga({board:d===e.board?u:void 0,env:e,diagnostics:o,auth:l}),b=s(()=>u?ve(u.panels):void 0,[u]),x=s(()=>ke({board:u,signals:f,updateHealth:h,factSignals:g}),[u,g,f,h]),S=x.length?u?.attention?.treatment:void 0,C=new Set(x.map(e=>e.panelId));return a(()=>{b&&b.issues.length!==0&&o.record({kind:`layout-analyzed`,issueCount:b.issues.length,affectedPanelIds:b.issues.map(e=>e.panelId)})},[o,b]),m(`div`,{className:`${A.board} ${S?A[`attention-${S}`]:``}`,"data-attention-treatment":S,"data-attention-active":x.length||void 0,children:[m(`header`,{className:A.header,children:[p(`h1`,{className:A.title,children:e.board}),e.security===`warning`&&p(ii,{mode:`warning`}),x.length>0&&m(`aside`,{className:A.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[p(`span`,{className:A.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),p(`ul`,{children:x.map(e=>p(`li`,{children:m(`a`,{href:`#panel-${e.panelId}`,children:[p(`strong`,{children:e.label}),`: `,e.reason]})},`${e.panelId}-${e.factId??`panel`}-${e.reason}`))})]})]}),m(`main`,{className:A.grid,children:[!u&&p(st,{label:`board`,hint:`Loading configuration…`,wide:!0}),u?.panels.filter(e=>!ye(e.position)).map(e=>p(Qr,{panel:e,envelope:f[e.id],attentionActive:C.has(e.id),updateHealth:h[e.id],rejectedPipeline:v[e.id],facts:g[e.id],testDirection:y[e.id]},e.id))]}),m(`footer`,{className:A.footer,"data-board-footer":!0,children:[p(`span`,{children:`Signals are read live from their configured authorities.`}),m(`div`,{className:A.footerTools,children:[l&&p(ei,{env:e,auth:l}),b&&b.issues.length>0&&p(Qe,{board:e.board,layout:b,env:e,auth:l}),p(Me,{log:o,updateActivity:()=>{let e=o.retainedEvidence(),t=oi({schedules:_,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),p(fi,{board:u,schedules:_,log:o})]})]})]})}var wa={error:`_error_yx1g9_1`};function Ta({message:e}){return m(`div`,{className:wa.error,role:`alert`,children:[p(`h1`,{children:`⚠️ Dashboard misconfigured`}),p(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),p(`pre`,{children:e})]})}var Ea=document.getElementById(`root`);if(!Ea)throw Error(`No #root element in the document — the template is not the one we expect.`);var Da=d(Ea);try{Da.render(p(n,{children:p(Sa,{env:te()})}))}catch(e){Da.render(p(Ta,{message:e instanceof Error?e.message:String(e)}))}
3
+ //# sourceMappingURL=index-QSjn7LZh.js.map