@obzerver/server 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
File without changes
package/dist/seed.d.ts CHANGED
@@ -5,8 +5,12 @@ export interface GenerateOptions {
5
5
  rpm?: number;
6
6
  now?: number;
7
7
  onProgress?: (fraction: number) => void;
8
+ /** When shop-api 1.5.0 shipped. Live top-ups pass the seed's, so the release doesn't move. */
9
+ release?: number;
10
+ /** Also generate the staging copy of shop-api (default true). */
11
+ staging?: boolean;
8
12
  }
9
- export declare function generate(ingest: Ingest, { hours, rpm, now, onProgress }?: GenerateOptions): Promise<{
13
+ export declare function generate(ingest: Ingest, { hours, rpm, now, onProgress, release: releaseAt, staging: withStaging }?: GenerateOptions): Promise<{
10
14
  requests: number;
11
15
  release: number;
12
16
  }>;
package/dist/seed.js CHANGED
@@ -123,9 +123,9 @@ const traffic = (ts) => {
123
123
  const h = d.getUTCHours() + d.getUTCMinutes() / 60;
124
124
  return 0.35 + 0.65 * Math.max(0, Math.sin(((h - 5) / 24) * 2 * Math.PI)) ** 1.2;
125
125
  };
126
- export async function generate(ingest, { hours = 24, rpm = 40, now = Date.now(), onProgress } = {}) {
126
+ export async function generate(ingest, { hours = 24, rpm = 40, now = Date.now(), onProgress, release: releaseAt, staging: withStaging = true } = {}) {
127
127
  const start = now - hours * 3600e3;
128
- const release = now - Math.min(6, hours / 3) * 3600e3; // shop-api 1.5.0 ships here
128
+ const release = releaseAt ?? now - Math.min(6, hours / 3) * 3600e3; // shop-api 1.5.0 ships here
129
129
  const batches = new Map();
130
130
  const batchFor = (service, version, instance) => {
131
131
  const k = `${service}|${version}|${instance}`;
@@ -463,10 +463,12 @@ export async function generate(ingest, { hours = 24, rpm = 40, now = Date.now(),
463
463
  if ((m - start) % (30 * 60000) === 0) {
464
464
  flush();
465
465
  onProgress?.((m - start) / (now - start));
466
- await new Promise((r) => setImmediate(r));
466
+ await new Promise((r) => setTimeout(r, 0));
467
467
  }
468
468
  }
469
469
  flush();
470
+ if (!withStaging)
471
+ return { requests: count, release };
470
472
  // A small staging copy of shop-api, so the demo has a second environment to switch to.
471
473
  const stagingFrom = release; // same version as production, from the release on (versions are ordered by first sighting)
472
474
  const staging = () => ({ sdk: { name: '@obzerver/node', version: VERSION }, service: { id: 'shop-api', version: '1.5.0', instance: 'shop-api-staging:1', environment: 'staging', node: 'v22.11.0', frameworks: ['express@5', 'pg', 'ioredis'] }, traces: [], errors: [], logs: [], runtime: [], metrics: [] });
package/dist/seed.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"seed.js","sourceRoot":"","sources":["../src/seed.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,yDAAyD;AACzD,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzE,IAAI,IAAI,GAAG,EAAE,CAAC;AACd,MAAM,GAAG,GAAG,GAAW,EAAE,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC,OAAO,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAC3G,MAAM,IAAI,GAAG,CAAI,GAAiB,EAAK,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9E,MAAM,IAAI,GAAG,CAAC,MAAc,EAAE,MAAM,GAAG,GAA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,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,EAAE;gBAChF,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBACtE,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE;aAC5C;SACF,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAyB,kDAAkD,EAAE,EAAE,CAAE,CAAC;QACrG,MAAM,QAAQ,GAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAyC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAE,CAAC,EAAE,CAAC;QAC7H,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,8CAA8C,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,yDAAyD,EAAE,CAAC,CAAC;QAC3M,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,2EAA2E,EAAE,CAAC,CAAC;IAC1I,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obzerver/server",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Obzerver collector, API, alerting, MCP server and dashboard",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@fastify/static": "^8.1.0",
33
- "@obzerver/node": "^0.13.0",
33
+ "@obzerver/node": "^0.14.0",
34
34
  "fastify": "^5.2.0",
35
35
  "nodemailer": "^7.0.13"
36
36
  },
@@ -111,4 +111,4 @@ $1`).trim().split(`
111
111
  `);return(0,F.jsx)(`div`,{className:`code !whitespace-pre-wrap`,children:t.map((e,t)=>{let n=/^(SELECT|FROM|WHERE|AND|OR|ORDER BY|GROUP BY|HAVING|LIMIT|OFFSET|INSERT INTO|VALUES|UPDATE|SET|DELETE FROM|LEFT JOIN|RIGHT JOIN|INNER JOIN|JOIN|ON|RETURNING|UNION)\b(.*)$/.exec(e),r=n?n[1]:``,i=n?n[2]:e,a=[`AND`,`OR`,`ON`].includes(r)?` `:``;return(0,F.jsxs)(`div`,{children:[a,r&&(0,F.jsx)(`span`,{style:{color:`#ff6b9d`},children:r}),i.split(/(\?)/).map((e,t)=>e===`?`?(0,F.jsx)(`span`,{className:`px-[3px] rounded`,style:{background:`rgba(201,133,0,.25)`,color:`#ffc85a`},children:`?`},t):(0,F.jsx)(v.Fragment,{children:e},t))]},t)})})}function Wz(e){let t=new Map;for(let n of e){let e=n.parentId??null;t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let e of t.values())e.sort((e,t)=>e.start-t.start);let n=[],r=(e,i)=>{for(let a of t.get(e)||[])n.push({s:a,depth:i,hasKids:(t.get(a.id)||[]).length>0}),r(a.id,i+1)};return r(null,0),n}function Gz({spans:e,logs:t=[],highlightSelf:n=!0}){let r=(0,v.useMemo)(()=>Wz(e),[e]),i=Math.max(1,...e.map(e=>e.start+e.duration)),[a,o]=(0,v.useState)(new Set),[s,c]=(0,v.useState)(null),l=new Set(e.map(e=>e.service).filter(Boolean)).size>1,u=Math.max(...e.filter(e=>!e.root).map(e=>e.self),0),d=new Set,f=r.filter(({s:e})=>e.parentId&&(d.has(e.parentId)||a.has(e.parentId))?(d.add(e.id),!1):!0),p=[0,.25,.5,.75,1],m=[...new Set(e.map(e=>e.kind))].filter(e=>Vz[e]);return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-[11.5px] text-ink2 mb-2 px-1`,children:[m.map(e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-sm`,style:{background:Vz[e].color}}),Vz[e].label]},e)),(0,F.jsx)(`span`,{className:`ml-auto text-mute`,children:`Bar = total time · bright segment = self time`})]}),(0,F.jsxs)(`div`,{className:`grid text-[12px]`,style:{gridTemplateColumns:`minmax(260px, 38%) 1fr 72px 72px`},children:[(0,F.jsx)(`div`,{className:`text-mute text-[10.5px] uppercase tracking-wider px-2 py-1.5 border-b border-line`,children:`Span`}),(0,F.jsxs)(`div`,{className:`relative border-b border-line`,children:[p.map(e=>(0,F.jsx)(`span`,{className:`absolute top-1.5 text-[10px] text-mute -translate-x-1/2`,style:{left:`${e*100}%`,transform:e===1?`translateX(-100%)`:e===0?`none`:void 0},children:B(i*e)},e)),t.map((e,t)=>(0,F.jsx)(`span`,{title:`${e.level.toUpperCase()} ${e.message}`,className:`absolute bottom-0 w-[2px] h-2 rounded`,style:{left:`${Math.min(100,Math.max(0,(e.offset??0)/i)*100)}%`,background:e.level===`error`?`#d03b3b`:e.level===`warn`?`#fab219`:`#82829a`}},t))]}),(0,F.jsx)(`div`,{className:`text-mute text-[10.5px] uppercase tracking-wider px-2 py-1.5 border-b border-line text-right`,children:`Total`}),(0,F.jsx)(`div`,{className:`text-mute text-[10.5px] uppercase tracking-wider px-2 py-1.5 border-b border-line text-right`,children:`Self`}),f.map(({s:e,depth:t,hasKids:r})=>{let d=Vz[e.kind]||Vz.function,f=e.start/i*100,m=Math.max(.3,e.duration/i*100),h=e.duration?Math.max(0,Math.min(1,e.self/e.duration)):0,g=n&&!e.root&&e.self===u&&u>0,_=s===e.id;return(0,F.jsxs)(v.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-[5px] border-b border-[#1c1c25] cursor-pointer min-w-0 ${_?`bg-[#1a1a24]`:`hover:bg-[#16161e]`}`,style:{paddingLeft:8+t*14},onClick:()=>c(_?null:e.id),children:[r?(0,F.jsx)(`button`,{className:`text-mute hover:text-ink shrink-0`,onClick:t=>{t.stopPropagation();let n=new Set(a);n.has(e.id)?n.delete(e.id):n.add(e.id),o(n)},children:a.has(e.id)?(0,F.jsx)(Er,{size:13}):(0,F.jsx)(wr,{size:13})}):(0,F.jsx)(`span`,{className:`w-[13px] shrink-0`}),(0,F.jsx)(d.Icon,{size:12,style:{color:d.color},className:`shrink-0`}),(0,F.jsx)(`span`,{className:`truncate ${e.kind===`db`?`mono text-[11.5px]`:``}`,title:e.name,children:e.name}),e.count&&e.count>1&&(0,F.jsxs)(`span`,{className:`pill !text-[10px] !py-0`,style:{color:`#ffc85a`,borderColor:`#5a4512`},children:[`×`,e.count]}),l&&e.root&&e.service&&(0,F.jsx)(`span`,{className:`pill !text-[10px] !py-0`,children:e.service}),e.error&&(0,F.jsx)(zi,{size:12,className:`shrink-0`,style:{color:`#ff7070`}}),g&&(0,F.jsx)(`span`,{className:`pill !text-[10px] !py-0`,style:{color:`#ffb38a`,borderColor:`#5a3322`},children:`most self time`})]}),(0,F.jsxs)(`div`,{className:`relative border-b border-[#1c1c25] cursor-pointer`,onClick:()=>c(_?null:e.id),children:[p.slice(1,-1).map(e=>(0,F.jsx)(`span`,{className:`absolute top-0 bottom-0 w-px bg-[#1c1c26]`,style:{left:`${e*100}%`}},e)),(0,F.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2 h-[12px] rounded-[3px] overflow-hidden flex`,style:{left:`${f}%`,width:`${m}%`,background:`color-mix(in srgb, ${d.color} 32%, transparent)`,outline:e.error?`1.5px solid #ff5a5a`:void 0},children:(0,F.jsx)(`div`,{className:`h-full ml-auto`,style:{width:`${h*100}%`,background:d.color}})})]}),(0,F.jsx)(`div`,{className:`num px-2 py-[5px] border-b border-[#1c1c25] tabular-nums`,children:B(e.duration)}),(0,F.jsx)(`div`,{className:`num px-2 py-[5px] border-b border-[#1c1c25] tabular-nums`,style:{color:g?`#ffb38a`:`var(--color-ink2)`},children:B(e.self)}),_&&(0,F.jsx)(`div`,{className:`col-span-4 bg-[#111118] border-b border-line px-4 py-3`,style:{paddingLeft:24+t*14},children:(0,F.jsx)(Kz,{s:e})})]},e.id)})]})]})}function Kz({s:e}){let t=e.attrs||{},n=Object.entries(t).filter(([e])=>![`statement`,`system`,`url`,`collapsed`,`totalMs`].includes(e));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5 text-[12px]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-1 text-ink2`,children:[(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Kind`}),` `,Vz[e.kind]?.label||e.kind]}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Starts at`}),` +`,B(e.start)]}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Total`}),` `,B(e.duration)]}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Self`}),` `,B(e.self)]}),e.count&&e.count>1&&(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Repeated`}),` `,e.count,`× (collapsed; `,B(t.totalMs),` combined)`]}),t.system&&(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`System`}),` `,t.system]}),e.service&&(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Service`}),` `,e.service]})]}),e.error&&(0,F.jsxs)(`div`,{className:`text-[#ff9b9b] flex items-center gap-1.5`,children:[(0,F.jsx)(zi,{size:13}),e.error]}),t.statement&&t.system!==`redis`&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`Statement (values removed before sending)`}),(0,F.jsx)(Ra,{text:t.statement,className:`btn h-6 text-[11px]`})]}),(0,F.jsx)(Uz,{text:t.statement})]}),t.url&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`URL`}),` `,(0,F.jsxs)(`span`,{className:`mono`,children:[t.method,` `,t.url]}),t.status&&(0,F.jsx)(`span`,{className:`ml-2 mono`,style:{color:t.status>=500?`#ff7070`:`#5fd38a`},children:t.status})]}),n.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n.map(([e,t])=>(0,F.jsxs)(`span`,{className:`pill mono !text-[11px]`,children:[(0,F.jsx)(`span`,{className:`text-mute`,children:e}),`\xA0`,typeof t==`object`?JSON.stringify(t):String(t)]},e))})]})}function qz(){let{kind:e=`http`,service:t=``,name:n=``}=yt(),r=I(),i=L(),a=ht(),[o,s]=(0,v.useState)(`recent`),[c,l]=(0,v.useState)(`all`),[u,d]=(0,v.useState)(0),{data:f,error:p}=P(`/api/operation${r.q({kind:e,name:n,service:t,sort:o,filter:c,limit:50,offset:u*50})}`,[r.tick]),m=e===`job`;if(p)return(0,F.jsx)(W,{error:p});if(!f)return(0,F.jsx)(U,{});let h=f.stats,g=KR(f.series.points,f.band),_=qR(f.band),y=(r.meta?.versions||[]).filter(e=>e.service===t&&e.first>r.from&&e.first<r.to).map(e=>({t:e.first,label:e.version})),b=[..._?[_.p95]:[],{key:`p95`,label:`p95`,color:zR[1],type:`line`},{key:`avg`,label:`Average`,color:zR[0],type:`line`},{key:`p50`,label:`Median`,color:zR[2],type:`line`,dashed:!0}],x=[{key:`count`,label:m?`Runs`:`Calls`,color:zR[0],type:`area`},{key:`failed`,label:`Failed`,color:BR.crit,type:`line`},..._?[_.calls]:[]],S=Math.max(1,...f.breakdown.map(e=>e.avgSelf)),C=Object.entries(f.statuses).sort((e,t)=>t[1]-e[1]);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(Nn,{to:i(m?`/jobs`:`/requests`),className:`text-mute hover:text-ink text-[12px] inline-flex items-center gap-1 -mb-2`,children:[(0,F.jsx)(Tr,{size:13}),m?`Jobs`:`Requests`]}),(0,F.jsx)(ja,{title:(0,F.jsx)(La,{name:n}),sub:(0,F.jsxs)(`span`,{children:[t,` · `,m?`background job`:`HTTP route`]})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 @3xl:grid-cols-6 gap-3`,children:[(0,F.jsx)(Na,{label:m?`Runs`:`Calls`,value:V(h.calls),sub:`${V(h.rpm)} per min`,spark:g.map(e=>e.count)}),(0,F.jsx)(Na,{label:`Failure rate`,value:ya(h.failureRate),sub:`${V(h.failed)} failed`,color:h.failureRate>1?`#ff8a8a`:void 0}),(0,F.jsx)(Na,{label:`Average`,value:B(h.avg)}),(0,F.jsx)(Na,{label:`p50`,value:B(h.p50)}),(0,F.jsx)(Na,{label:`p95`,value:B(h.p95),sub:`p99 ${B(h.p99)}`}),(0,F.jsx)(Na,{label:`Max`,value:B(h.max)})]}),f.fromHistory&&(0,F.jsx)(Rz,{note:f.fromHistory.note}),(0,F.jsx)(Jz,{usual:f.usual,current:h,windowMin:(r.to-r.from)/6e4}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-2 gap-3`,children:[(0,F.jsx)(WR,{title:m?`Runs`:`Throughput`,series:x,children:(0,F.jsx)(UR,{data:g,series:x,fmt:e=>V(e),markers:y})}),(0,F.jsx)(WR,{title:`Latency`,sub:`is it constant or spiky? did it start at a deploy?`,series:b,children:(0,F.jsx)(UR,{data:g,series:b,fmt:e=>B(e),markers:y})})]}),m&&(0,F.jsx)(WR,{title:`Queue wait`,sub:`time from enqueue to start`,series:[{key:`queueWaitP95`,label:`p95`,color:zR[6]},{key:`queueWaitAvg`,label:`Average`,color:zR[0]}],children:(0,F.jsx)(UR,{data:g,height:140,series:[{key:`queueWaitP95`,label:`p95`,color:zR[6],type:`line`},{key:`queueWaitAvg`,label:`Average`,color:zR[0],type:`line`}],fmt:e=>B(e)})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-3`,children:[(0,F.jsx)(H,{title:`Where the time goes`,sub:`own time per span, averaged per execution`,pad:!1,className:`@5xl:col-span-2`,children:(0,F.jsx)(Ba,{rows:f.breakdown,empty:(0,F.jsx)(Ma,{title:`No span detail yet`,children:`Spans are kept for sampled, failed and slow executions.`}),cols:[{key:`n`,label:`Span`,render:e=>{let t=Vz[e.kind]||Vz.function;return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2 min-w-0`,children:[(0,F.jsx)(t.Icon,{size:12,style:{color:t.color}}),(0,F.jsx)(`span`,{className:`truncate ${e.kind===`db`?`mono text-[11.5px]`:``}`,children:e.name})]})}},{key:`k`,label:`Kind`,render:e=>(0,F.jsx)(`span`,{className:`text-mute`,children:Vz[e.kind]?.label||e.kind})},{key:`per`,label:`Calls / exec`,num:!0,render:e=>(0,F.jsx)(`span`,{style:{color:e.perExec>=10?BR.serious:void 0},children:V(e.perExec)})},{key:`self`,label:`Self / exec`,num:!0,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[B(e.avgSelf),(0,F.jsx)(Va,{value:e.avgSelf,max:S,color:zR[1],w:60})]})}]})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(H,{title:`Latency distribution`,children:(0,F.jsx)(GR,{data:f.histogram,highlight:e=>h.p95!=null&&e.le>=h.p95})}),(0,F.jsx)(H,{title:m?`Outcomes`:`Status codes`,children:(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:C.map(([e,t])=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(Fa,{status:e===`none`?null:Number(e)}),(0,F.jsx)(`span`,{className:`tabular-nums text-ink2`,children:V(t)})]},e))})})]})]}),f.errors.length>0&&(0,F.jsx)(H,{title:`Errors on this operation`,pad:!1,children:(0,F.jsx)(Ba,{rows:f.errors,onRow:e=>a(i(`/errors/${e.fingerprint}`)),cols:[{key:`c`,label:`Error`,render:e=>(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`font-medium`,style:{color:e.handled?`var(--color-ink)`:`#ff9b9b`},children:e.class}),` `,(0,F.jsx)(`span`,{className:`text-mute`,children:e.message})]})},{key:`h`,label:`Type`,render:e=>e.handled?(0,F.jsx)(G,{kind:`neutral`,children:`handled`}):(0,F.jsx)(G,{kind:`crit`,children:`unhandled`})},{key:`n`,label:`Count`,num:!0,render:e=>V(e.n)}]})}),(0,F.jsx)(H,{pad:!1,title:`Executions`,sub:`${V(f.total)} matching`,right:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(za,{value:c,onChange:e=>{l(e),d(0)},options:[{id:`all`,label:`All`},{id:`failed`,label:`Failed`},{id:`slow`,label:`≥ p95`}]}),(0,F.jsx)(za,{value:o,onChange:e=>{s(e),d(0)},options:[{id:`recent`,label:`Recent`},{id:`slowest`,label:`Slowest`}]})]}),children:(0,F.jsxs)(`div`,{className:`pt-2`,children:[(0,F.jsx)(Ba,{rows:f.executions,onRow:e=>a(i(`/executions/${e.id}`)),empty:(0,F.jsx)(Ma,{title:`No executions match`}),cols:[{key:`ts`,label:`Time`,render:e=>(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[Sa(e.ts,r.rangeMs>864e5),(0,F.jsx)(`span`,{className:`text-mute ml-2 text-[11px]`,children:xa(e.ts)})]})},{key:`st`,label:`Status`,render:e=>(0,F.jsx)(Fa,{status:e.status})},{key:`d`,label:`Duration`,num:!0,render:e=>(0,F.jsx)(`span`,{style:{color:h.p95&&e.duration>=h.p95?`#ffb38a`:void 0},children:B(e.duration)})},...m?[{key:`qw`,label:`Queue wait`,num:!0,render:e=>B(e.queue_wait)},{key:`at`,label:`Attempt`,num:!0,render:e=>e.attempt??`—`}]:[],{key:`u`,label:`User`,render:e=>e.user_id?(0,F.jsx)(Nn,{className:`link`,onClick:e=>e.stopPropagation(),to:i(`/users/${Ta(e.user_id)}`),children:e.user_id}):(0,F.jsx)(`span`,{className:`text-mute`,children:`—`})},{key:`v`,label:`Release`,render:e=>(0,F.jsx)(`span`,{className:`mono text-[11.5px] text-ink2`,children:e.version||`—`})},{key:`err`,label:`Error`,render:e=>e.error_class?(0,F.jsxs)(`span`,{className:`truncate inline-block max-w-[320px] align-middle`,children:[(0,F.jsx)(`span`,{className:`text-[#ff9b9b]`,children:e.error_class}),` `,(0,F.jsx)(`span`,{className:`text-mute`,children:e.error_message})]}):(0,F.jsx)(`span`,{className:`text-mute`,children:`—`})}]}),f.total>50&&(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-3 py-2 border-t border-line text-mute`,children:[(0,F.jsxs)(`span`,{children:[u*50+1,`–`,Math.min(f.total,(u+1)*50),` of `,V(f.total)]}),(0,F.jsx)(`button`,{className:`btn h-7`,disabled:u===0,onClick:()=>d(u-1),children:`Prev`}),(0,F.jsx)(`button`,{className:`btn h-7`,disabled:(u+1)*50>=f.total,onClick:()=>d(u+1),children:`Next`})]})]})})]})}function Jz({usual:e,current:t,windowMin:n}){let r=e?.thisHour,i=e?.last4Weeks;if(!r?.basis&&!i)return null;let a=(e,t)=>e==null||!t?null:e>t.high?`above`:e<t.low?`below`:null,o=n<=120&&t.calls>=20,s=o?a(t.p95,r?.p95):null,c=o?a(t.failureRate,r?.failureRate):null;return(0,F.jsxs)(`div`,{className:`card px-4 py-2.5 flex flex-wrap items-center gap-x-6 gap-y-1.5 text-[12.5px]`,children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(Kr,{size:14,className:`text-brand`}),(0,F.jsx)(`b`,{className:`font-medium`,children:`Usual`})]}),r?.basis?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`text-ink2`,children:[`this hour: p95 `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:B(r.p95?.expected)}),` `,(0,F.jsxs)(`span`,{className:`text-mute`,children:[`(normal `,B(r.p95?.low),`–`,B(r.p95?.high),`)`]})]}),(0,F.jsxs)(`span`,{className:`text-ink2`,children:[`failures `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:ya(r.failureRate?.expected??0)})]}),(0,F.jsxs)(`span`,{className:`text-ink2`,children:[(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:V(Math.round(r.callsPerHour?.expected??0))}),` calls/hour`]}),(s||c)&&(0,F.jsx)(G,{kind:`serious`,children:[s&&`p95 ${s} normal`,c&&`failures ${c} normal`].filter(Boolean).join(` · `)})]}):(0,F.jsx)(`span`,{className:`text-mute`,children:r?.description}),i&&(0,F.jsxs)(`span`,{className:`text-ink2`,children:[`last `,Math.round(i.days),` days: p50 `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:B(i.p50)}),` · p95 `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:B(i.p95)}),i.lastWeekVsBeforeP95Pct!=null&&Math.abs(i.lastWeekVsBeforeP95Pct)>=10&&(0,F.jsxs)(`span`,{className:`text-mute`,children:[` · last week p95 `,i.lastWeekVsBeforeP95Pct>0?`+`:``,i.lastWeekVsBeforeP95Pct,`%`]})]}),r?.basis&&(0,F.jsx)(`span`,{className:`text-mute ml-auto text-[11.5px]`,children:r.description})]})}function Yz({frames:e,stack:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),o=n?e:e.filter(e=>e.inApp),s=o.length?o:e.slice(0,5);return i&&t?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsx)(`button`,{className:`btn h-6 text-[11px]`,onClick:()=>a(!1),children:`Frames`})}),(0,F.jsx)(`div`,{className:`code text-[11.5px]`,children:t})]}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[11.5px] text-mute cursor-pointer`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),` show library frames`]}),t&&(0,F.jsx)(`button`,{className:`btn h-6 text-[11px]`,onClick:()=>a(!0),children:`Raw`})]}),s.map((e,t)=>(0,F.jsx)(Xz,{f:e,open:t===0&&!!e.context},t)),!s.length&&(0,F.jsx)(`div`,{className:`text-mute`,children:`No stack frames captured.`})]})}function Xz({f:e,open:t}){let[n,r]=(0,v.useState)(t);return(0,F.jsxs)(`div`,{className:`rounded-lg border ${e.inApp?`border-line2`:`border-line opacity-70`} overflow-hidden`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-center gap-2 px-3 py-1.5 text-left bg-[#15151d] hover:bg-[#191922]`,onClick:()=>r(!n),disabled:!e.context,children:[e.context?n?(0,F.jsx)(wr,{size:13}):(0,F.jsx)(Er,{size:13}):(0,F.jsx)(`span`,{className:`w-[13px]`}),(0,F.jsx)(`span`,{className:`mono text-[12px] font-medium`,children:e.fn}),(0,F.jsxs)(`span`,{className:`mono text-[11.5px] text-mute truncate`,children:[e.rel,`:`,e.line,`:`,e.col]}),e.inApp&&(0,F.jsx)(`span`,{className:`pill !text-[10px] !py-0 ml-auto`,children:`in app`})]}),n&&e.context&&(0,F.jsx)(`div`,{className:`mono text-[12px] bg-[#0b0b0f] py-1.5 overflow-x-auto`,children:e.context.lines.map((t,n)=>{let r=e.context.start+n,i=r===e.line;return(0,F.jsxs)(`div`,{className:`flex whitespace-pre`,style:i?{background:`rgba(208,59,59,.16)`,boxShadow:`inset 2px 0 0 #d03b3b`}:void 0,children:[(0,F.jsx)(`span`,{className:`w-12 text-right pr-3 text-mute select-none shrink-0`,children:r}),(0,F.jsx)(`span`,{style:{color:i?`#ffd0d0`:`#c9c9d6`},children:t||` `})]},n)})})]})}var Zz={error:BR.crit,fatal:BR.crit,warn:BR.warn,info:`#5aa2f0`,debug:`#82829a`,trace:`#82829a`};function Qz({l:e,offset:t,showService:n}){let r=L();return(0,F.jsxs)(`div`,{className:`flex gap-3 px-3.5 py-[5px] border-b border-[#1b1b23] hover:bg-[#16161e] text-[12px] items-start`,style:e.level===`error`||e.level===`fatal`?{background:`rgba(208,59,59,.05)`}:void 0,children:[(0,F.jsx)(`span`,{className:`mono text-mute shrink-0 text-[11.5px] tabular-nums`,children:t==null?Sa(e.ts):`+${B(Math.max(0,t))}`}),(0,F.jsx)(`span`,{className:`mono shrink-0 w-[42px] text-[11px] font-semibold uppercase`,style:{color:Zz[e.level]||`#aaa`},children:e.level}),n&&(0,F.jsx)(`span`,{className:`text-ink2 shrink-0 w-[92px] truncate`,children:e.service}),e.logger&&(0,F.jsxs)(`span`,{className:`text-mute shrink-0 max-w-[120px] truncate`,children:[`[`,e.logger,`]`]}),(0,F.jsxs)(`span`,{className:`mono text-[12px] flex-1 min-w-0 whitespace-pre-wrap break-words text-[#d8d8e2]`,children:[e.message,e.attrs&&(0,F.jsxs)(`span`,{className:`text-mute`,children:[` `,JSON.stringify(e.attrs)]})]}),e.executionId&&t==null&&(0,F.jsx)(Nn,{to:r(`/executions/${e.executionId}`),className:`link shrink-0 text-[11.5px]`,children:`trace →`})]})}function $z(){let e=I(),[t,n]=zn(),[r,i]=(0,v.useState)(t.get(`q`)||``),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)([]),d=e.q({q:t.get(`q`)||``,level:a.join(`,`),traceId:t.get(`traceId`)||``,limit:300}),{data:f,error:p}=P(`/api/logs${d}`,[e.tick]),m=(0,v.useRef)(0);(0,v.useEffect)(()=>{u([])},[d]),(0,v.useEffect)(()=>{f?.logs?.length&&(m.current=f.logs[0].ts)},[f]),(0,v.useEffect)(()=>{if(!s)return;let n=setInterval(async()=>{let n=await N(`/api/logs?from=${m.current+1||Date.now()-1e4}&to=${Date.now()}&q=${encodeURIComponent(t.get(`q`)||``)}&level=${a.join(`,`)}${e.service?`&service=${e.service}`:``}&limit=200`);n.logs.length&&(m.current=n.logs[0].ts,u(e=>[...n.logs,...e].slice(0,1e3)))},2e3);return()=>clearInterval(n)},[s,a,t,e.service]);let h=[...l,...f?.logs||[]],g=[{key:`error`,label:`Error`,color:BR.crit,type:`bar`,stack:`l`},{key:`warn`,label:`Warn`,color:BR.warn,type:`bar`,stack:`l`},{key:`info`,label:`Info`,color:`#3987e5`,type:`bar`,stack:`l`},{key:`debug`,label:`Debug`,color:`#4a4a5c`,type:`bar`,stack:`l`}],_=e=>o(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Ci,{size:18,className:`text-brand`}),title:`Logs`,sub:`Every line is tied to the request or job that wrote it.`}),f&&(0,F.jsx)(WR,{title:`Volume by level`,series:g,children:(0,F.jsx)(UR,{data:f.series,series:g,height:120,fmt:e=>V(e)})}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsxs)(`form`,{className:`flex items-center gap-2`,onSubmit:e=>{e.preventDefault();let i=new URLSearchParams(t);r?i.set(`q`,r):i.delete(`q`),n(i,{replace:!0})},children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(wi,{size:13,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-mute`}),(0,F.jsx)(`input`,{className:`input pl-8 w-[320px] h-7`,placeholder:`Search messages… (Enter)`,value:r,onChange:e=>i(e.target.value)})]}),(0,F.jsx)(`div`,{className:`seg`,children:[`error`,`warn`,`info`,`debug`].map(e=>(0,F.jsxs)(`button`,{type:`button`,className:a.includes(e)?`on`:``,onClick:()=>_(e),children:[(0,F.jsx)(`span`,{style:{color:Zz[e]},children:`●`}),` `,e]},e))}),t.get(`traceId`)&&(0,F.jsxs)(`span`,{className:`pill`,children:[`trace `,t.get(`traceId`).slice(0,8),`… `,(0,F.jsx)(`button`,{type:`button`,onClick:()=>{let e=new URLSearchParams(t);e.delete(`traceId`),n(e)},children:`✕`})]})]}),right:(0,F.jsxs)(`button`,{className:`btn h-7 ${s?`btn-primary`:``}`,onClick:()=>c(!s),children:[(0,F.jsx)(_i,{size:13}),s?`Tailing…`:`Live tail`]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:p?(0,F.jsx)(W,{error:p}):f?h.length===0?(0,F.jsx)(Ma,{title:`No logs in this window`,children:`Logs are forwarded from console, pino and obzerver.log() (forwardLogs is on by default).`}):(0,F.jsx)(`div`,{className:`max-h-[calc(100vh-380px)] min-h-[300px] overflow-auto`,children:h.map(e=>(0,F.jsx)(Qz,{l:e,showService:!0},e.id))}):(0,F.jsx)(U,{})})})]})}function eB(){let{id:e}=yt(),t=L(),n=ht(),{data:r,error:i}=P(`/api/executions/${e}`,[e]),[a,o]=(0,v.useState)(!1);if(i)return(0,F.jsx)(W,{error:i});if(!r)return(0,F.jsx)(U,{});let s=r.execution,c=r.baseline,l=r.errors.find(e=>!e.handled)||r.errors[0],u=s.ts,d=Math.min(...r.waterfall.spans.filter(e=>e.executionId===s.id).map(e=>e.start)),f=r.logs.map(e=>({...e,offset:e.ts-u+(Number.isFinite(d)?d:0)})),p=r.host,m=p&&p.baseline&&(p.cpu>p.baseline.cpu*1.5&&p.cpu>40||p.elP99>p.baseline.elP99*2&&p.elP99>50);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(Nn,{to:t(Pz(s.kind,s.service,s.name)),className:`text-mute hover:text-ink text-[12px] -mb-2`,children:[`← `,s.name]}),(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(`h1`,{className:`text-[19px] font-semibold tracking-tight`,children:(0,F.jsx)(La,{name:s.name})}),(0,F.jsx)(Fa,{status:s.status}),s.failed?(0,F.jsx)(G,{kind:`crit`,children:`failed`}):s.status>=400?(0,F.jsx)(G,{kind:`warn`,children:`client error`}):(0,F.jsx)(G,{kind:`good`,children:`ok`})]}),(0,F.jsxs)(`div`,{className:`text-ink2 mt-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:Sa(s.ts,!0)}),(0,F.jsx)(`span`,{className:`font-medium text-ink`,children:B(s.duration)}),(0,F.jsxs)(`span`,{children:[s.service,s.version&&(0,F.jsxs)(`span`,{className:`mono text-mute`,children:[`@`,s.version]})]}),s.path&&s.kind===`http`&&(0,F.jsxs)(`span`,{className:`mono text-mute`,children:[s.method,` `,s.path]}),s.userId&&(0,F.jsx)(Nn,{className:`link`,to:t(`/users/${Ta(s.userId)}`),children:s.userId}),(0,F.jsxs)(`span`,{className:`mono text-mute text-[11.5px]`,children:[`trace `,s.traceId]})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,F.jsx)(Ra,{text:s.traceId,label:`Trace id`}),r.worthInvestigating&&(0,F.jsx)(Ra,{className:`btn btn-primary`,label:`Copy agent prompt`,text:async()=>(await N(`/api/executions/${s.id}/prompt`)).prompt}),r.issue?(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>n(t(`/issues/${r.issue.id}`)),children:[(0,F.jsx)(zr,{size:13}),`Issue #`,r.issue.id]}):(s.failed||l)&&(0,F.jsxs)(`button`,{className:`btn`,disabled:a,onClick:async()=>{o(!0);try{let e=await N(`/api/issues`,{method:`POST`,json:{title:l?`${l.class}: ${l.message.slice(0,100)}`:`${s.name} ${s.failed?`failed`:`slow`} (${B(s.duration)})`,severity:s.failed?`high`:`medium`,service:s.service,sourceType:l?`error`:`execution`,sourceRef:l?l.fingerprint:String(s.id),description:`From execution #${s.id} (trace ${s.traceId}) at ${new Date(s.ts).toISOString()}.`}});n(t(`/issues/${e.id}`))}finally{o(!1)}},children:[(0,F.jsx)(Nr,{size:13}),`Create issue`]})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @3xl:grid-cols-3 gap-3`,children:[(0,F.jsx)(H,{title:`Compared with this route`,children:c.samples?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(`div`,{className:`text-[15px]`,children:c.slowerThanPct>=50?(0,F.jsxs)(F.Fragment,{children:[`Slower than `,(0,F.jsxs)(`b`,{style:{color:c.slowerThanPct>=95?`#ffb38a`:void 0},children:[c.slowerThanPct,`%`]}),` of calls`]}):(0,F.jsxs)(F.Fragment,{children:[`Faster than `,(0,F.jsxs)(`b`,{children:[100-c.slowerThanPct,`%`]}),` of calls`]})}),(0,F.jsx)(Ha,{items:[[`Route average`,B(c.avg)],[`Route p95`,B(c.p95)],[`Samples`,`${c.samples} in the surrounding 24h`],...r.usual?.p95?[[`Usual at this hour`,(0,F.jsxs)(`span`,{children:[`p95 `,B(r.usual.p95.expected),` `,(0,F.jsxs)(`span`,{className:`text-mute`,children:[`(normal up to `,B(r.usual.p95.high),`)`]}),r.usual.vsUsualP95>=2&&(0,F.jsxs)(`b`,{style:{color:`#ffb38a`},children:[` · `,r.usual.vsUsualP95,`× usual`]})]},`u`)]]:[]]}),r.usual&&(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[`Usual = `,r.usual.description,`.`]})]}):(0,F.jsx)(`span`,{className:`text-mute`,children:`Not enough history.`})}),(0,F.jsx)(H,{title:`Host at the time`,right:m?(0,F.jsx)(G,{kind:`serious`,children:`under pressure`}):p?(0,F.jsx)(G,{kind:`good`,children:`normal`}):null,children:p?(0,F.jsx)(Ha,{items:[[`Instance`,(0,F.jsx)(`span`,{className:`mono text-[11.5px]`,children:s.instance})],[`CPU`,(0,F.jsxs)(F.Fragment,{children:[p.cpu?.toFixed(0),`% `,(0,F.jsxs)(`span`,{className:`text-mute`,children:[`(hour avg `,p.baseline?.cpu?.toFixed(0),`%)`]})]})],[`Event loop p99`,(0,F.jsxs)(F.Fragment,{children:[B(p.elP99),` `,(0,F.jsxs)(`span`,{className:`text-mute`,children:[`(avg `,B(p.baseline?.elP99),`)`]})]})],[`Memory`,ba(p.rss)]]}):(0,F.jsx)(`span`,{className:`text-mute`,children:`No runtime sample near this execution.`})}),(0,F.jsx)(H,{title:`Request`,children:(0,F.jsx)(Ha,{items:[[`Kind`,s.kind===`job`?`Job${s.queue?` · queue ${s.queue}`:``}`:`HTTP`],...s.kind===`job`?[[`Queue wait`,B(s.queueWait)],[`Attempt`,s.attempt??1]]:[],[`Services in trace`,r.waterfall.services.join(`, `)],[`Spans`,s.sampled?String(r.waterfall.spans.length):`not sampled`],...s.tags?Object.entries(s.tags).map(([e,t])=>[e,String(t)]):[]]})})]}),l&&(0,F.jsxs)(H,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(zi,{size:14,style:{color:`#ff7070`}}),(0,F.jsx)(`span`,{className:`text-[#ff9b9b]`,children:l.class})]}),sub:l.handled?`handled`:`unhandled`,right:(0,F.jsx)(Nn,{className:`btn h-7`,to:t(`/errors/${l.fingerprint}`),children:`Error group`}),children:[(0,F.jsx)(`div`,{className:`mb-3 text-[13px]`,children:l.message}),(0,F.jsx)(Yz,{frames:l.frames,stack:l.stack})]}),(0,F.jsx)(H,{title:`Waterfall`,sub:r.waterfall.services.length>1?`distributed across ${r.waterfall.services.length} services`:void 0,pad:!0,children:s.sampled||r.waterfall.services.length>1?(0,F.jsx)(Gz,{spans:r.waterfall.spans,logs:f}):(0,F.jsx)(Ma,{title:`Span detail not kept`,icon:(0,F.jsx)(Hr,{size:20}),children:`This execution was not sampled. Failed, slow and sampled executions keep their full waterfall (tracesSampleRate).`})}),r.waterfall.executions.length>1&&(0,F.jsx)(H,{title:`Executions in this trace`,pad:!1,children:(0,F.jsx)(`div`,{className:`flex flex-col`,children:r.waterfall.executions.map(e=>(0,F.jsxs)(Nn,{to:t(`/executions/${e.id}`),className:`flex items-center gap-3 px-3.5 py-2 border-b border-[#1d1d26] last:border-0 hover:bg-[#181821] ${e.id===s.id?`bg-[#16161f]`:``}`,children:[(0,F.jsx)(`span`,{className:`w-28 text-ink2`,children:e.service}),(0,F.jsx)(La,{name:e.name}),(0,F.jsx)(`span`,{className:`ml-auto`,children:(0,F.jsx)(Fa,{status:e.status})}),(0,F.jsx)(`span`,{className:`w-20 text-right tabular-nums`,children:B(e.duration)})]},e.id))})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-3`,children:[(0,F.jsx)(H,{title:`Logs`,sub:`${r.logs.length} line${r.logs.length===1?``:`s`} written during this trace`,pad:!1,className:s.capture?`@5xl:col-span-2`:`@5xl:col-span-3`,children:r.logs.length?(0,F.jsx)(`div`,{className:`max-h-[360px] overflow-auto`,children:f.map(e=>(0,F.jsx)(Qz,{l:e,offset:e.offset},e.id))}):(0,F.jsx)(Ma,{title:`No logs for this trace`,children:`Logs written with console, pino (obzerver.pino()) or obzerver.log() inside the request are correlated automatically.`})}),s.capture&&(0,F.jsx)(H,{title:`Captured request`,sub:`kept because the request was ${s.capture.reason}`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[s.capture.headers&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute text-[11px] uppercase tracking-wider mb-1`,children:`Request headers`}),(0,F.jsx)(`div`,{className:`code text-[11.5px]`,children:Object.entries(s.capture.headers).map(([e,t])=>`${e}: ${t}`).join(`
112
112
  `)})]}),s.capture.query&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute text-[11px] uppercase tracking-wider mb-1`,children:`Query`}),(0,F.jsx)(`div`,{className:`code text-[11.5px]`,children:s.capture.query})]}),s.capture.body&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute text-[11px] uppercase tracking-wider mb-1`,children:`Request body`}),(0,F.jsx)(`div`,{className:`code text-[11.5px] !whitespace-pre-wrap`,children:tB(s.capture.body)})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11px] flex items-center gap-1`,children:[(0,F.jsx)(gr,{size:11}),`Redacted inside your process before sending.`]})]})})]})]})}function tB(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function nB(){let e=I(),t=L(),n=ht(),[r,i]=zn(),[a,o]=(0,v.useState)(r.get(`q`)||``),[s,c]=(0,v.useState)(`all`),{data:l,error:u}=P(`/api/traces${e.q({q:r.get(`q`)||``,failed:s===`failed`?`1`:``,minDuration:s===`slow`?1e3:``,limit:200})}`,[e.tick,s]),d=(l||[]).filter(e=>s!==`distributed`||e.parts>1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Ur,{size:18,className:`text-brand`}),title:`Traces`,sub:`Recent requests and jobs. Distributed traces follow the traceparent header across services.`}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsxs)(`form`,{className:`flex items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=new URLSearchParams(r);a?t.set(`q`,a):t.delete(`q`),i(t,{replace:!0})},children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(wi,{size:13,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-mute`}),(0,F.jsx)(`input`,{className:`input pl-8 w-[360px] h-7`,placeholder:`Trace id, route, path, user id or error text`,value:a,onChange:e=>o(e.target.value)})]}),(0,F.jsx)(za,{value:s,onChange:c,options:[{id:`all`,label:`All`},{id:`failed`,label:`Failed`},{id:`slow`,label:`> 1s`},{id:`distributed`,label:`Multi-service`}]})]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:u?(0,F.jsx)(W,{error:u}):l?(0,F.jsx)(Ba,{rows:d,onRow:e=>n(t(`/executions/${e.id}`)),empty:(0,F.jsx)(Ma,{title:`No traces match`}),cols:[{key:`t`,label:`Time`,render:e=>(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[Sa(e.ts),` `,(0,F.jsx)(`span`,{className:`text-mute text-[11px] ml-1`,children:xa(e.ts)})]})},{key:`n`,label:`Operation`,render:e=>(0,F.jsx)(La,{name:e.name})},{key:`s`,label:`Application`,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.service})},{key:`p`,label:`Apps`,num:!0,render:e=>e.parts>1?(0,F.jsx)(`span`,{className:`pill`,style:{color:`#9cc4ff`},children:e.parts}):(0,F.jsx)(`span`,{className:`text-mute`,children:`1`})},{key:`st`,label:`Status`,render:e=>(0,F.jsx)(Fa,{status:e.status})},{key:`d`,label:`Duration`,num:!0,render:e=>B(e.duration)},{key:`u`,label:`User`,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.user_id||`—`})},{key:`id`,label:`Trace id`,render:e=>(0,F.jsxs)(`span`,{className:`mono text-mute text-[11px]`,children:[e.trace_id.slice(0,16),`…`]})}]}):(0,F.jsx)(U,{})})})]})}function rB(){let e=I(),t=L(),n=ht(),[r,i]=(0,v.useState)(`0`),[a,o]=(0,v.useState)(``),{data:s,error:c}=P(`/api/errors${e.q({handled:r,status:a})}`,[e.tick]);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(yr,{size:18,className:`text-brand`}),title:`Errors`,sub:`Grouped into defects by class and stack shape. Unhandled = 5xx or a thrown job/process error; a 4xx from your own code is your API working.`}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(za,{value:r,onChange:i,options:[{id:`0`,label:`Unhandled`},{id:`1`,label:`Handled`},{id:`all`,label:`All`}]}),(0,F.jsx)(za,{value:a,onChange:o,options:[{id:``,label:`Any status`},{id:`open`,label:`Open`},{id:`resolved`,label:`Resolved`},{id:`ignored`,label:`Ignored`}]})]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:c?(0,F.jsx)(W,{error:c}):s?(0,F.jsx)(Ba,{rows:s,initialSort:`count`,onRow:e=>n(t(`/errors/${e.fingerprint}`)),rowKey:e=>e.fingerprint,empty:(0,F.jsx)(Ma,{title:`No errors in this window`,icon:(0,F.jsx)(`span`,{className:`text-[18px]`,children:`✓`}),children:`Nothing matched these filters.`}),cols:[{key:`e`,label:`Error`,sort:e=>e.class,render:e=>(0,F.jsxs)(`div`,{className:`min-w-0 max-w-[560px]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium`,style:{color:e.handled?`var(--color-ink)`:`#ff9b9b`},children:e.class}),e.isNew&&(0,F.jsx)(G,{kind:`serious`,children:`new`}),e.status!==`open`&&(0,F.jsx)(G,{kind:e.status===`resolved`?`good`:`neutral`,children:e.status})]}),(0,F.jsx)(`div`,{className:`text-mute truncate text-[12px]`,children:e.message})]})},{key:`op`,label:`Where`,render:e=>(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`truncate max-w-[220px]`,children:e.operation?(0,F.jsx)(La,{name:e.operation}):`—`}),(0,F.jsx)(`div`,{className:`text-mute text-[11px]`,children:e.service})]})},{key:`trend`,label:`Trend`,render:e=>(0,F.jsx)(Pa,{data:e.spark,color:e.handled?`#82829a`:BR.crit,w:80,h:20})},{key:`count`,label:`Events`,num:!0,sort:e=>e.count,render:e=>V(e.count)},{key:`users`,label:`Users`,num:!0,sort:e=>e.users,render:e=>V(e.users)},{key:`rel`,label:`Introduced`,render:e=>(0,F.jsx)(`span`,{className:`mono text-[11.5px] text-ink2`,children:e.firstVersion||`—`})},{key:`first`,label:`First seen`,num:!0,sort:e=>e.firstSeen,render:e=>(0,F.jsx)(`span`,{className:`text-mute`,children:xa(e.firstSeen)})},{key:`last`,label:`Last seen`,num:!0,sort:e=>e.lastSeen,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:xa(e.lastSeen)})}]}):(0,F.jsx)(U,{})})})]})}var iB=e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZoneName:`short`});function aB(){let e=I(),t=L(),n=ht(),[r,i]=zn(),[a,o]=(0,v.useState)(`open`),{data:s,error:c,reload:l}=P(`/api/secrets${e.q({status:a})}`,[e.tick,a]),u=r.get(`fp`),d=P(u?`/api/secrets/${u}`:null,[u,e.tick]),f=e=>i(t=>{let n=new URLSearchParams(t);return e?n.set(`fp`,e):n.delete(`fp`),n},{replace:!0}),p=async(e,t)=>{await N(`/api/secrets/${e}`,{method:`POST`,json:{status:t}}),l(),d.reload()};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Oi,{size:18,style:{color:`#ff6b6b`}}),title:`Secrets in logs`,sub:`Passwords, tokens, API keys, private keys and card numbers that reached a log line or an error message. They are redacted before storage (the value is never kept); each row is a place in your code that logs one.`}),s&&s.open>0&&(0,F.jsxs)(`div`,{className:`rounded-xl border px-4 py-3 flex items-start gap-3`,style:{borderColor:`#6b2330`,background:`rgba(208,59,59,.10)`},children:[(0,F.jsx)(Oi,{size:18,className:`shrink-0 mt-0.5`,style:{color:`#ff6b6b`}}),(0,F.jsxs)(`div`,{className:`text-[13px] leading-relaxed`,children:[(0,F.jsxs)(`b`,{style:{color:`#ffb0b0`},children:[s.open,` place`,s.open===1?``:`s`,` in your code log`,s.open===1?`s`:``,` secrets.`]}),` `,(0,F.jsx)(`span`,{className:`text-ink2`,children:`Fix the log line, then mark it resolved. If a secret may have been exposed before it was redacted (other log sinks, stdout, a log shipper), rotate it.`})]})]}),u&&(0,F.jsx)(H,{title:d.data?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,F.jsx)(`span`,{style:{color:`#ff9b9b`},children:d.data.label}),(0,F.jsxs)(`span`,{className:`text-mute font-normal`,children:[`in `,d.data.source===`error`?`an error message`:`logs`]})]}):`Leak`,right:(0,F.jsx)(`button`,{className:`btn btn-ghost h-6`,onClick:()=>f(null),children:`Close`}),children:d.error?(0,F.jsx)(W,{error:d.error}):d.data?(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 text-[12.5px]`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 @lg:grid-cols-4 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute`,children:`Where`}),(0,F.jsx)(`div`,{className:`font-medium`,children:d.data.service}),(0,F.jsx)(`div`,{className:`text-ink2`,children:d.data.operation?(0,F.jsx)(La,{name:d.data.operation}):`outside a request or job`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute`,children:`Logger`}),(0,F.jsx)(`div`,{className:`font-medium mono`,children:d.data.logger||`—`}),(0,F.jsx)(`div`,{className:`text-mute`,children:d.data.detectedBy===`sdk`?`Redacted by the SDK, in the process`:`Redacted by the server, before storage`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute`,children:`Seen`}),(0,F.jsxs)(`div`,{className:`font-medium`,children:[V(d.data.count),` times`]}),(0,F.jsxs)(`div`,{className:`text-ink2`,children:[`first `,(0,F.jsx)(Ga,{tip:iB(d.data.firstSeen),children:xa(d.data.firstSeen)}),d.data.firstVersion?` in ${d.data.firstVersion}`:``,` · last `,(0,F.jsx)(Ga,{tip:iB(d.data.lastSeen),children:xa(d.data.lastSeen)})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[(0,F.jsx)(`div`,{className:`text-mute`,children:`Status`}),(0,F.jsxs)(`div`,{className:`flex gap-1.5`,children:[d.data.status!==`resolved`&&(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>p(d.data.fingerprint,`resolved`),children:[(0,F.jsx)(ki,{size:13}),`Mark fixed`]}),d.data.status===`open`&&(0,F.jsx)(`button`,{className:`btn btn-ghost h-7`,onClick:()=>p(d.data.fingerprint,`ignored`),children:`Ignore`}),d.data.status!==`open`&&(0,F.jsx)(`button`,{className:`btn btn-ghost h-7`,onClick:()=>p(d.data.fingerprint,`open`),children:`Reopen`}),d.data.issueId&&(0,F.jsxs)(`button`,{className:`btn btn-ghost h-7`,onClick:()=>n(t(`/issues/${d.data.issueId}`)),children:[(0,F.jsx)(zr,{size:12}),`Issue #`,d.data.issueId]})]})]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute mb-1`,children:`Example, as stored`}),(0,F.jsx)(`pre`,{className:`mono text-[12px] whitespace-pre-wrap break-all rounded-md border border-line px-3 py-2`,style:{background:`#101016`},children:oB(d.data.sample||``)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute mb-1`,children:`Recent occurrences`}),(0,F.jsx)(Ba,{rows:d.data.findings,rowKey:e=>`${e.ts}${e.traceId}`,onRow:e=>e.traceId&&n(t(`/traces/${e.traceId}`)),cols:[{key:`t`,label:`Time`,render:e=>(0,F.jsx)(Ga,{tip:iB(e.ts),children:Sa(e.ts,!0)})},{key:`v`,label:`Version`,render:e=>(0,F.jsx)(`span`,{className:`mono`,children:e.version||`—`})},{key:`i`,label:`Instance`,render:e=>(0,F.jsx)(`span`,{className:`mono text-ink2`,children:e.instance||`—`})},{key:`c`,label:`Count`,num:!0,render:e=>V(e.count)},{key:`s`,label:`Text (redacted)`,render:e=>(0,F.jsx)(`span`,{className:`mono text-[11.5px] text-ink2 truncate inline-block max-w-[520px] align-bottom`,children:oB(e.sample||``)})},{key:`tr`,label:`Trace`,render:e=>e.traceId?(0,F.jsxs)(`span`,{className:`mono text-[11.5px]`,style:{color:`#ff9cc0`},children:[e.traceId.slice(0,8),`…`]}):(0,F.jsx)(`span`,{className:`text-mute`,children:`—`})}]})]})]}):(0,F.jsx)(U,{})}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsx)(za,{value:a,onChange:o,options:[{id:`open`,label:`To fix`},{id:`resolved`,label:`Fixed`},{id:`ignored`,label:`Ignored`},{id:``,label:`All`}]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:c?(0,F.jsx)(W,{error:c}):s?(0,F.jsx)(Ba,{rows:s.groups,initialSort:`last`,rowKey:e=>e.fingerprint,onRow:e=>f(e.fingerprint),empty:(0,F.jsx)(Ma,{title:a===`open`?`No secrets in your logs`:`Nothing here`,icon:(0,F.jsx)(ki,{size:20,className:`text-[#3fb68b]`}),children:`The SDK redacts passwords, tokens, keys and card numbers before logs leave your process, and the server checks again on arrival. Anything that gets through shows up here with a critical alert.`}),cols:[{key:`r`,label:`What leaked`,sort:e=>e.label,render:e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium`,style:{color:e.status===`open`?`#ff9b9b`:void 0},children:e.label}),e.status!==`open`&&(0,F.jsx)(G,{kind:e.status===`resolved`?`good`:`neutral`,children:e.status===`resolved`?`fixed`:e.status})]})},{key:`s`,label:`In`,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.source===`error`?`error message`:`log line`})},{key:`w`,label:`Where`,sort:e=>`${e.service} ${e.operation}`,render:e=>(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{children:e.service}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[e.operation?(0,F.jsx)(La,{name:e.operation}):`outside a request or job`,e.logger?` · ${e.logger}`:``]})]})},{key:`ex`,label:`Example (redacted)`,render:e=>(0,F.jsx)(`span`,{className:`mono text-[11.5px] text-ink2 truncate inline-block max-w-[380px] align-bottom`,children:oB(e.sample||``)})},{key:`win`,label:`In window`,num:!0,sort:e=>e.inWindow,render:e=>V(e.inWindow)},{key:`c`,label:`Total`,num:!0,sort:e=>e.count,render:e=>V(e.count)},{key:`first`,label:`First seen`,sort:e=>e.firstSeen,render:e=>(0,F.jsxs)(`span`,{className:`text-ink2`,children:[(0,F.jsx)(Ga,{tip:iB(e.firstSeen),children:xa(e.firstSeen)}),e.firstVersion?(0,F.jsxs)(`span`,{className:`text-mute`,children:[` · `,e.firstVersion]}):``]})},{key:`last`,label:`Last seen`,sort:e=>e.lastSeen,render:e=>(0,F.jsx)(Ga,{tip:iB(e.lastSeen),className:`text-ink2`,children:xa(e.lastSeen)})}]}):(0,F.jsx)(U,{})})})]})}function oB(e){let t=e.split(`[REDACTED]`);return t.map((e,n)=>(0,F.jsxs)(`span`,{children:[e,n<t.length-1&&(0,F.jsx)(`span`,{className:`rounded px-1 mx-px`,style:{background:`rgba(208,59,59,.22)`,color:`#ff9b9b`},children:`[REDACTED]`})]},n))}function sB(){let{fp:e=``}=yt(),t=I(),n=L(),r=ht(),{data:i,error:a,reload:o}=P(`/api/errors/${e}${t.q()}`,[t.tick]);if(a)return(0,F.jsx)(W,{error:a});if(!i)return(0,F.jsx)(U,{});let s=i.group,c=async t=>{await N(`/api/errors/${e}`,{method:`PATCH`,json:{status:t}}),o()};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(Nn,{to:n(`/errors`),className:`text-mute hover:text-ink text-[12px] -mb-2`,children:`← Errors`}),(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsx)(`h1`,{className:`text-[19px] font-semibold tracking-tight`,style:{color:s.handled?void 0:`#ff9b9b`},children:s.class}),s.handled?(0,F.jsx)(G,{kind:`neutral`,children:`handled`}):(0,F.jsx)(G,{kind:`crit`,children:`unhandled`}),(0,F.jsx)(G,{kind:s.status===`resolved`?`good`:s.status===`ignored`?`neutral`:`warn`,children:s.status})]}),(0,F.jsx)(`div`,{className:`mt-1.5 text-[13.5px]`,children:s.message}),(0,F.jsxs)(`div`,{className:`text-mute mt-1 text-[12px]`,children:[s.service,` · `,s.operation?(0,F.jsx)(La,{name:s.operation}):`no operation`,` · fingerprint `,(0,F.jsx)(`span`,{className:`mono`,children:s.fingerprint})]})]}),(0,F.jsxs)(`div`,{className:`flex gap-2 shrink-0`,children:[i.issues[0]?(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>r(n(`/issues/${i.issues[0].id}`)),children:[`Issue #`,i.issues[0].id]}):(0,F.jsxs)(`button`,{className:`btn`,onClick:async()=>{let t=await N(`/api/issues`,{method:`POST`,json:{title:`${s.class}: ${String(s.message).slice(0,110)}`,severity:s.handled?`low`:`high`,service:s.service,sourceType:`error`,sourceRef:e,description:`Error group first seen ${new Date(s.firstSeen).toISOString()}${s.firstVersion?` in ${s.firstVersion}`:``}.`}});r(n(`/issues/${t.id}`))},children:[(0,F.jsx)(Nr,{size:13}),`Create issue`]}),s.status===`open`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>c(`resolved`),children:[(0,F.jsx)(Ar,{size:13}),`Resolve`]}),(0,F.jsxs)(`button`,{className:`btn btn-ghost`,onClick:()=>c(`ignored`),children:[(0,F.jsx)(Br,{size:13}),`Ignore`]})]}):(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>c(`open`),children:[(0,F.jsx)(bi,{size:13}),`Reopen`]})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 @3xl:grid-cols-5 gap-3`,children:[(0,F.jsx)(Na,{label:`In this window`,value:V(i.windowCount)}),(0,F.jsx)(Na,{label:`All time`,value:V(s.count)}),(0,F.jsx)(Na,{label:`Users affected`,value:V(i.users.length)}),(0,F.jsx)(Na,{label:`First seen`,value:(0,F.jsx)(`span`,{className:`text-[16px]`,children:xa(s.firstSeen)}),sub:s.firstVersion?`in release ${s.firstVersion}`:void 0}),(0,F.jsx)(Na,{label:`Last seen`,value:(0,F.jsx)(`span`,{className:`text-[16px]`,children:xa(s.lastSeen)})})]}),(0,F.jsx)(WR,{title:`Occurrences`,children:(0,F.jsx)(UR,{data:i.series.points,series:[{key:`count`,label:`Occurrences`,color:s.handled?`#82829a`:BR.crit,type:`bar`}],height:130,fmt:e=>V(e)})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-3`,children:[(0,F.jsx)(H,{title:`Latest stack trace`,sub:i.latest?Sa(i.latest.ts,!0):void 0,className:`@5xl:col-span-2`,children:i.latest?(0,F.jsx)(Yz,{frames:i.latest.frames,stack:i.latest.stack}):(0,F.jsx)(Ma,{title:`No occurrence stored`})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(H,{title:`Releases`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.versions,cols:[{key:`v`,label:`Version`,render:e=>(0,F.jsx)(`span`,{className:`mono`,children:e.version||`—`})},{key:`n`,label:`Events`,num:!0,render:e=>V(e.n)},{key:`l`,label:`Last`,num:!0,render:e=>(0,F.jsx)(`span`,{className:`text-mute`,children:xa(e.last)})}]})}),(0,F.jsx)(H,{title:`Operations`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.operations,empty:(0,F.jsx)(Ma,{title:`—`}),cols:[{key:`o`,label:`Where`,render:e=>e.operation?(0,F.jsx)(La,{name:e.operation}):`—`},{key:`n`,label:`Events`,num:!0,render:e=>V(e.n)}]})}),i.users.length>0&&(0,F.jsx)(H,{title:`Affected users`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.users,maxHeight:220,onRow:e=>r(n(`/users/${Ta(e.user_id)}`)),cols:[{key:`u`,label:`User`,render:e=>e.user_id},{key:`n`,label:`Events`,num:!0,render:e=>V(e.n)}]})})]})]}),(0,F.jsx)(H,{title:`Occurrences`,sub:`most recent 50`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.occurrences,onRow:e=>e.execution_id&&r(n(`/executions/${e.execution_id}`)),cols:[{key:`t`,label:`Time`,render:e=>Sa(e.ts,!0)},{key:`v`,label:`Release`,render:e=>(0,F.jsx)(`span`,{className:`mono text-[11.5px]`,children:e.version||`—`})},{key:`i`,label:`Instance`,render:e=>(0,F.jsx)(`span`,{className:`mono text-[11.5px] text-ink2`,children:e.instance})},{key:`u`,label:`User`,render:e=>e.user_id||`—`},{key:`s`,label:`Status`,render:e=>e.http_status??`—`},{key:`m`,label:`Message`,render:e=>(0,F.jsx)(`span`,{className:`text-mute truncate inline-block max-w-[380px] align-middle`,children:e.message})},{key:`x`,label:``,render:e=>e.execution_id?(0,F.jsx)(`span`,{className:`link`,children:`trace →`}):null}]})})]})}var cB=[[`requests`,`Requests`],[`jobs`,`Job runs`],[`errors`,`Errors`],[`logs`,`Log entries`],[`spans`,`Method spans`]],lB=e=>new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,timeZone:`UTC`}),uB=e=>`$${e.toLocaleString(void 0,{maximumFractionDigits:e<10?2:0})}`,dB=e=>e.overage===`none`?`Nothing to pass`:e.overage===`reduce`?`Less detail, then refused at 2×`:`Overage, within spend controls`;function fB(){let e=I(),{data:t,error:n,reload:r}=P(`/api/usage`,[e.tick]),[i,a]=(0,v.useState)(null),o=async t=>{a(null);try{await N(`/api/usage`,{method:`PUT`,json:t}),await r(),e.refresh()}catch(e){a(e.message)}},s=async t=>{a(null);try{await N(`/api/usage/${t}`,{method:`POST`}),await r(),e.refresh()}catch(e){a(e.message)}};if(n)return(0,F.jsx)(W,{error:n});if(!t)return(0,F.jsx)(U,{});let c=t,l=Xi[c.state];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Hr,{size:18,className:`text-brand`}),title:`Usage`,sub:(0,F.jsxs)(F.Fragment,{children:[`Observability Events in `,new Date(c.resetsAt-1).toLocaleDateString(void 0,{month:`long`,year:`numeric`,timeZone:`UTC`}),`, across every project. Resets `,lB(c.resetsAt),` 00:00 UTC.`]}),right:(0,F.jsx)(G,{kind:l.tone,children:l.label})}),i&&(0,F.jsx)(`div`,{className:`card px-3.5 py-2.5 text-[12.5px]`,style:{borderColor:`#5a2a2a`,color:`#f2a0a0`},children:i}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-4 items-start`,children:[(0,F.jsxs)(H,{title:`This month`,className:`@5xl:col-span-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`text-[30px] font-semibold tracking-tight tabular-nums`,children:qi(c.used)}),(0,F.jsx)(`span`,{className:`text-ink2 text-[14px]`,children:c.included?(0,F.jsxs)(F.Fragment,{children:[`of `,qi(c.included),` events`,c.pct!=null&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(`b`,{className:`text-ink`,children:Ji(c.pct)})]})]}):`events (no allowance on Self-hosted)`})]}),c.included?(0,F.jsx)(`div`,{className:`mt-3 mb-1`,children:(0,F.jsx)(Qi,{used:c.used,included:c.included,thresholds:c.settings.thresholds})}):null,(0,F.jsxs)(`div`,{className:`text-[12.5px] text-ink2 mt-2.5 flex flex-wrap gap-x-4 gap-y-1`,children:[(0,F.jsxs)(`span`,{children:[`Today `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:qi(c.today)})]}),(0,F.jsxs)(`span`,{children:[`Projected by month end `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:qi(c.projected)}),c.included&&c.projected>c.included?(0,F.jsxs)(`span`,{style:{color:`#fab219`},children:[` (`,qi(c.projected-c.included),` over)`]}):null]}),c.overage>0&&(0,F.jsxs)(`span`,{children:[`Overage `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:qi(c.overage)}),c.settings.overageRate?(0,F.jsxs)(F.Fragment,{children:[` ≈ `,uB(c.overage/1e6*c.settings.overageRate)]}):null]}),c.unbilled>0&&(0,F.jsxs)(`span`,{title:`Server errors and failed jobs collected while overage was paused`,children:[`Unbilled `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:qi(c.unbilled)})]}),c.dropped>0&&(0,F.jsxs)(`span`,{title:`Events the plan didn't keep`,children:[`Not kept `,(0,F.jsx)(`b`,{className:`text-ink tabular-nums`,children:qi(c.dropped)})]})]}),c.reason&&(0,F.jsx)(`div`,{className:`mt-3 text-[12.5px] rounded-lg px-3 py-2 bg-[rgba(250,178,25,.08)] border border-[rgba(250,178,25,.25)]`,children:c.reason}),c.plan.id===`self-hosted`&&(0,F.jsx)(`div`,{className:`mt-3 text-[12.5px] text-mute`,children:`Self-hosted keeps everything. Events are still counted, so you can see what a plan would use.`}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 @lg:grid-cols-5 gap-2 mt-4`,children:cB.map(([e,t])=>(0,F.jsxs)(`div`,{className:`rounded-lg bg-[#14141b] border border-line px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-mute`,children:t}),(0,F.jsx)(`div`,{className:`text-[15px] font-semibold tabular-nums`,children:qi(c.kinds[e])})]},e))})]}),(0,F.jsx)(H,{title:`Plan`,right:(0,F.jsx)(`span`,{className:`text-[12px] text-mute`,children:c.plan.name}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 text-[13px]`,children:[(0,F.jsx)(pB,{label:`Included events`,value:c.plan.included==null?`No limit`:`${qi(c.plan.included)} / month`}),(0,F.jsx)(pB,{label:`Retention`,value:c.plan.retentionDays==null?`Your setting (OBZERVER_RETENTION_DAYS)`:`${c.plan.retentionDays} days`}),c.limits.spanTreeDays&&(0,F.jsxs)(`div`,{className:`text-[11.5px] text-mute -mt-1`,children:[`Fast, successful executions keep their span tree for `,c.limits.spanTreeDays,` days; slow or failed ones keep it for the whole window.`]}),(0,F.jsx)(pB,{label:`Logs & alerts`,value:(0,F.jsx)(mB,{on:c.plan.features.logs&&c.plan.features.alerts})}),(0,F.jsx)(pB,{label:`SLOs`,value:(0,F.jsx)(mB,{on:c.plan.features.slos})}),(0,F.jsx)(pB,{label:`Past the allowance`,value:dB(c.plan)})]})})]}),(0,F.jsx)(H,{title:`Events per day`,sub:`UTC days, this month`,children:(0,F.jsx)(`div`,{style:{height:180},children:(0,F.jsx)(Vm,{width:`100%`,height:`100%`,children:(0,F.jsxs)(LR,{data:c.daily,margin:{top:6,right:6,bottom:0,left:-6},barCategoryGap:3,children:[(0,F.jsx)(QP,{vertical:!1}),(0,F.jsx)(XI,{dataKey:`day`,tickLine:!1,axisLine:{stroke:`#2a2a35`},tickFormatter:e=>String(Number(e.slice(8))),interval:`preserveStartEnd`}),(0,F.jsx)(pL,{tickLine:!1,axisLine:!1,tickFormatter:e=>qi(e),width:44}),c.limits.dailyPace&&(0,F.jsx)(lN,{y:c.limits.dailyPace,stroke:`#fab219`,strokeDasharray:`4 3`,label:{value:`Pace ${qi(c.limits.dailyPace)}/day`,position:`insideTopRight`,fill:`#fab219`,fontSize:10.5}}),(0,F.jsx)(Sm,{cursor:{fill:`rgba(255,255,255,.04)`},isAnimationActive:!1,content:({active:e,payload:t})=>e&&t?.length?(0,F.jsxs)(`div`,{className:`rounded-lg border border-line2 px-3 py-1.5 text-[12px]`,style:{background:`rgba(20,20,27,.97)`},children:[(0,F.jsx)(`div`,{className:`text-mute`,children:lB(Date.parse(t[0].payload.day))}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`b`,{children:t[0].value.toLocaleString()}),` events`]}),t[0].payload.unbilled>0&&(0,F.jsxs)(`div`,{className:`text-ink2`,children:[t[0].payload.unbilled.toLocaleString(),` unbilled`]}),t[0].payload.dropped>0&&(0,F.jsxs)(`div`,{className:`text-ink2`,children:[t[0].payload.dropped.toLocaleString(),` not kept`]})]}):null}),(0,F.jsx)(Jj,{dataKey:`events`,fill:zR[0],radius:[4,4,0,0],isAnimationActive:!1})]})})})}),(0,F.jsx)(hB,{report:c,onSave:o}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-2 gap-4 items-start`,children:[(0,F.jsx)(gB,{report:c,onSave:o,onPost:s}),(0,F.jsx)(vB,{report:c,onSave:o})]}),(0,F.jsx)(yB,{report:c}),(0,F.jsx)(SB,{}),(0,F.jsx)(H,{title:`What counts`,right:(0,F.jsx)(Jr,{size:14,className:`text-mute`}),children:(0,F.jsxs)(`div`,{className:`text-[12.8px] text-ink2 leading-relaxed flex flex-col gap-2 max-w-[860px]`,children:[(0,F.jsx)(`p`,{children:`One Observability Event per request, background job run, error, log entry or trace span your apps report. Events add up: a request that ran through three of your own methods, wrote two log lines and raised one error is seven events.`}),(0,F.jsx)(`p`,{children:`Database-query and outbound-HTTP spans don't count: they are detail about a method span that is already counted. Runtime samples (CPU, memory, event loop) and custom metrics don't count either.`}),(0,F.jsxs)(`p`,{children:[`To send fewer events, ignore noisy routes in the SDK (`,(0,F.jsx)(`span`,{className:`mono`,children:`ignore`}),` in `,(0,F.jsx)(`span`,{className:`mono`,children:`init()`}),`) and keep log levels at `,(0,F.jsx)(`span`,{className:`mono`,children:`info`}),` or above in production.`]})]})})]})}function pB({label:e,value:t}){return(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`span`,{className:`text-ink2`,children:e}),(0,F.jsx)(`span`,{className:`text-right`,children:t})]})}function mB({on:e}){return e?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,style:{color:`#3ccf7a`},children:[(0,F.jsx)(Cr,{size:14}),`Included`]}):(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-mute`,children:[(0,F.jsx)(ni,{size:13}),`Not included`]})}function hB({report:e,onSave:t}){let[n,r]=(0,v.useState)({included:String(e.settings.enterprise.included),retentionDays:String(e.settings.enterprise.retentionDays)}),i=e.plan.id;return(0,F.jsxs)(H,{title:`Plans`,sub:`Choose the plan this server enforces`,pad:!1,children:[(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(`table`,{className:`w-full text-[12.8px]`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{className:`text-mute text-[11.5px] text-left`,children:[`Plan`,`Included events / month`,`Retention`,`Logs & alerts`,`SLOs`,`Past the allowance`,``].map(e=>(0,F.jsx)(`th`,{className:`font-medium px-3.5 py-2 border-b border-line`,children:e},e))})}),(0,F.jsx)(`tbody`,{children:e.plans.map(e=>{let a=e.id===i,o=e.id===`enterprise`;return(0,F.jsxs)(`tr`,{className:a?`bg-[rgba(255,61,127,.06)]`:``,children:[(0,F.jsxs)(`td`,{className:`px-3.5 py-2.5 border-b border-line font-medium`,children:[e.name,a&&(0,F.jsx)(`span`,{className:`ml-2 text-[10.5px] font-semibold text-brand`,children:`CURRENT`})]}),(0,F.jsx)(`td`,{className:`px-3.5 py-2.5 border-b border-line tabular-nums`,children:o?(0,F.jsx)(`input`,{className:`input h-7 w-[120px]`,"aria-label":`Enterprise included events`,value:n.included,onChange:e=>r({...n,included:e.target.value})}):e.included==null?`No limit`:qi(e.included)}),(0,F.jsx)(`td`,{className:`px-3.5 py-2.5 border-b border-line tabular-nums`,children:o?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`input`,{className:`input h-7 w-[70px]`,"aria-label":`Enterprise retention days`,value:n.retentionDays,onChange:e=>r({...n,retentionDays:e.target.value})}),`days`]}):e.retentionDays==null?`Your setting`:`${e.retentionDays} days`}),(0,F.jsx)(`td`,{className:`px-3.5 py-2.5 border-b border-line`,children:(0,F.jsx)(mB,{on:e.features.logs})}),(0,F.jsx)(`td`,{className:`px-3.5 py-2.5 border-b border-line`,children:(0,F.jsx)(mB,{on:e.features.slos})}),(0,F.jsx)(`td`,{className:`px-3.5 py-2.5 border-b border-line text-ink2`,children:dB(e)}),(0,F.jsx)(`td`,{className:`px-3.5 py-2.5 border-b border-line text-right`,children:o?(0,F.jsx)(`button`,{className:`btn h-7`,onClick:()=>t({plan:`enterprise`,enterprise:{included:Number(n.included),retentionDays:Number(n.retentionDays)}}),children:a?`Save`:`Choose`}):!a&&(0,F.jsx)(`button`,{className:`btn h-7`,onClick:()=>t({plan:e.id}),children:`Choose`})})]},e.id)})})]})}),(0,F.jsx)(`div`,{className:`px-3.5 py-2.5 text-[11.5px] text-mute`,children:`Choosing a plan applies its allowance, retention and features to every project on this server. Retention takes effect at the next hourly clean-up.`})]})}function gB({report:e,onSave:t,onPost:n}){let r=e.settings,[i,a]=(0,v.useState)(r.budget==null?``:String(r.budget)),[o,s]=(0,v.useState)(r.overageRate==null?``:String(r.overageRate));if((0,v.useEffect)(()=>{a(r.budget==null?``:String(r.budget)),s(r.overageRate==null?``:String(r.overageRate))},[r.budget,r.overageRate]),e.plan.overage===`none`)return(0,F.jsx)(H,{title:`Spend controls`,children:(0,F.jsx)(`div`,{className:`text-[12.8px] text-ink2`,children:`Self-hosted has no allowance, so there is nothing to control. Choose a plan above to meter against one.`})});if(e.plan.overage===`reduce`){let t=e.plan.included??0;return(0,F.jsxs)(H,{title:`Past the Free allowance`,children:[(0,F.jsxs)(`ol`,{className:`flex flex-col gap-2.5 text-[12.8px]`,children:[(0,F.jsx)(_B,{n:1,on:e.state===`paced`,title:`Paced day: past ${qi(e.limits.dailyPace)} events in one UTC day`,children:`Most trace waterfalls pause until 00:00 UTC.`}),(0,F.jsx)(_B,{n:2,on:e.state===`reduced`,title:`Past ${qi(t)} this month`,children:`Charts stay live, but most traces arrive without spans.`}),(0,F.jsx)(_B,{n:3,on:e.state===`refused`,title:`At ${qi(e.limits.refuseAt)}`,children:`New telemetry is refused with a 429 until the 1st, and dropped, not queued.`})]}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute mt-3`,children:`While paced or reduced, server errors, failed jobs and anything slower than 1 second keep full traces.`})]})}let c=e.state===`paused`,l=e.spikeProtection.limit==null?``:r.overageRate?`${uB(50)} of overage (${qi(e.spikeProtection.limit)} events)`:`${qi(e.spikeProtection.limit)} overage events (half the allowance; set a price to use $50)`;return(0,F.jsx)(H,{title:`Spend controls`,right:c?(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>n(`resume`),children:[(0,F.jsx)(fi,{size:13}),`Resume overage`]}):(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>n(`pause`),children:[(0,F.jsx)(ui,{size:13}),`Pause overage`]}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 text-[12.8px]`,children:[(0,F.jsxs)(`label`,{className:`flex items-start gap-3 cursor-pointer`,children:[(0,F.jsx)(`input`,{type:`checkbox`,className:`mt-0.5`,checked:e.spikeProtection.on,onChange:e=>t({spikeProtection:e.target.checked})}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`font-medium flex items-center gap-1.5`,children:[(0,F.jsx)(ki,{size:14,className:`text-mute`}),`Spike protection`]}),(0,F.jsxs)(`div`,{className:`text-ink2 mt-0.5`,children:[`Pauses overage when a surge would push this month's overage to `,l,` at the current pace.`,e.spikeProtection.resumed?` Off until the 1st: you resumed overage this month.`:``]})]})]}),(0,F.jsx)(K,{label:`Monthly overage budget (events beyond the allowance)`,hint:`Empty: no budget. 0: collect nothing beyond the included events.`,children:(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(`input`,{className:`input h-8 w-[180px]`,inputMode:`numeric`,placeholder:`No budget`,value:i,onChange:e=>a(e.target.value)}),(0,F.jsx)(`button`,{className:`btn h-8`,onClick:()=>t({budget:i.trim()===``?null:Number(i)}),children:`Save`})]})}),(0,F.jsx)(K,{label:`Price per million overage events (optional, USD)`,hint:`Shows overage as money and sizes spike protection at $50.`,children:(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(`input`,{className:`input h-8 w-[120px]`,inputMode:`decimal`,placeholder:`—`,value:o,onChange:e=>s(e.target.value)}),(0,F.jsx)(`button`,{className:`btn h-8`,onClick:()=>t({overageRate:o.trim()===``?null:Number(o)}),children:`Save`})]})}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:`While overage is paused, server errors, failed jobs, runtime and custom metrics continue unbilled. Other events beyond the allowance are dropped until the 1st, or until you resume, change the budget or upgrade.`})]})})}function _B({n:e,on:t,title:n,children:r}){return(0,F.jsxs)(`li`,{className:`flex gap-3 rounded-lg px-3 py-2 border ${t?`border-[rgba(250,178,25,.45)] bg-[rgba(250,178,25,.07)]`:`border-line`}`,children:[(0,F.jsx)(`span`,{className:`w-5 h-5 rounded-full grid place-items-center text-[11px] font-semibold bg-[#1d1d27] shrink-0`,children:e}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`font-medium`,children:[n,t&&(0,F.jsx)(`span`,{className:`ml-2 text-[10.5px] font-semibold`,style:{color:`#fab219`},children:`NOW`})]}),(0,F.jsx)(`div`,{className:`text-ink2 mt-0.5`,children:r})]})]})}function vB({report:e,onSave:t}){let n=e.settings,[r,i]=(0,v.useState)(n.thresholds.join(`, `)),[a,o]=(0,v.useState)(n.notify),s=P(`/api/settings`);(0,v.useEffect)(()=>{i(n.thresholds.join(`, `)),o(n.notify)},[n.thresholds.join(`,`),n.notify]);let c=!!s.data?.email?.configured;return(0,F.jsx)(H,{title:`Quota notifications`,right:(0,F.jsx)(hr,{size:14,className:`text-mute`}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 text-[12.8px]`,children:[(0,F.jsx)(K,{label:`Thresholds, % of the allowance (up to five)`,hint:`For example 50, 80, 100. Each one emails once a month.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,value:r,onChange:e=>i(e.target.value),placeholder:`50, 80, 100`,disabled:e.plan.included==null})}),(0,F.jsx)(K,{label:`Email to`,hint:c?`Comma-separated.`:`Email isn’t set up on this server yet (Settings → Email), so notifications only show here.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,value:a,onChange:e=>o(e.target.value),placeholder:`you@example.com`,disabled:e.plan.included==null})}),(0,F.jsx)(`button`,{className:`btn btn-primary h-8 self-start`,disabled:e.plan.included==null,onClick:()=>t({thresholds:r.split(/[\s,%]+/).filter(Boolean).map(Number),notify:a}),children:`Save notifications`}),e.plan.included==null?(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:`Self-hosted has no allowance to notify about.`}):e.notified.length>0&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:`This month`}),e.notified.map(e=>(0,F.jsxs)(`div`,{className:`flex justify-between`,children:[(0,F.jsxs)(`span`,{children:[`Passed `,e.pct,`%`]}),(0,F.jsxs)(`span`,{className:`text-ink2`,children:[lB(e.ts),` · `,qi(e.used),` events`]})]},e.pct))]})]})})}function yB({report:e}){let t=e.byProject.flatMap(e=>e.apps.map(t=>({...t,project:e.name,key:`${e.slug}/${t.service}/${t.env??``}`}))),n=Math.max(1,...t.map(e=>e.billed)),r=(e,t)=>({key:e,label:t,num:!0,sort:t=>t[e],render:t=>qi(t[e])}),i=[...e.byProject.length>1?[{key:`project`,label:`Project`,sort:e=>e.project,render:e=>e.project}]:[],{key:`app`,label:`App`,sort:e=>e.service,render:e=>(0,F.jsx)(`span`,{className:`font-medium`,children:e.service})},{key:`env`,label:`Environment`,sort:e=>e.env??``,render:e=>e.env??(0,F.jsx)(`span`,{className:`text-mute`,children:`—`})},{key:`billed`,label:`Events`,num:!0,sort:e=>e.billed,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2 justify-end`,children:[(0,F.jsx)(Va,{value:e.billed,max:n}),qi(e.billed)]})},r(`requests`,`Requests`),r(`jobs`,`Jobs`),r(`errors`,`Errors`),r(`logs`,`Logs`),r(`spans`,`Spans`)];return(0,F.jsx)(H,{title:`By project and app`,sub:`This month`,pad:!1,children:(0,F.jsx)(Ba,{rows:t,cols:i,initialSort:`billed`,rowKey:e=>e.key,empty:(0,F.jsx)(`div`,{className:`px-3.5 py-4 text-mute text-[12.5px]`,children:`No events yet this month.`})})})}var bB=e=>e==null?null:`$${e<1?e.toFixed(e<.01?4:2):e.toFixed(2)}`,xB=e=>e==null?``:String(e);function SB(){let e=I(),{data:t,error:n,reload:r}=P(`/api/ai/usage`,[e.tick]),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{if(!t)return;let e=t.limits;a({perQuestion:xB(e.perQuestion),perHour:xB(e.perHour),historyTurns:xB(e.historyTurns),budgetUnit:e.budgetUnit,daily:xB(e.daily),monthly:xB(e.monthly),priceIn:xB(e.prices.input),priceOut:xB(e.prices.output),thresholds:e.thresholds.join(`, `),notify:e.notify})},[t]),n)return(0,F.jsx)(W,{error:n});if(!t)return null;let u=t,d=u.limits,f=e=>t=>{l(!1),a({...i,[e]:t.target.value})},p=async()=>{s(null);try{await N(`/api/ai/usage`,{method:`PUT`,json:{perQuestion:i.perQuestion,perHour:i.perHour||0,historyTurns:i.historyTurns,budgetUnit:i.budgetUnit,daily:i.daily.trim()||null,monthly:i.monthly.trim()||null,prices:{input:i.priceIn.trim()||null,output:i.priceOut.trim()||null},thresholds:i.thresholds.split(/[\s,%]+/).filter(Boolean).map(Number),notify:i.notify}}),await r(),e.reloadMeta(),l(!0)}catch(e){s(e.message)}},m=d.budgetUnit===`usd`,h=e=>m?bB(e):`${qi(e)} tokens`,g=(e,t)=>(0,F.jsxs)(`div`,{className:`rounded-lg bg-[#14141b] border border-line px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-mute`,children:e}),(0,F.jsxs)(`div`,{className:`text-[15px] font-semibold tabular-nums`,children:[qi(t.tokens),` `,(0,F.jsx)(`span`,{className:`text-[11.5px] font-normal text-ink2`,children:`tokens`})]}),(0,F.jsxs)(`div`,{className:`text-[11.5px] text-ink2 tabular-nums`,children:[t.questions,` question`,t.questions===1?``:`s`,t.cost==null?``:` · ${bB(t.cost)}`]})]});return(0,F.jsx)(H,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(Ni,{size:14,className:`text-brand`}),`Ask Obzeri`]}),sub:`Tokens on your own model key. Questions over MCP use the client's model and cost nothing here.`,right:u.blocked?(0,F.jsx)(G,{kind:`serious`,children:`Paused`}):null,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u.blocked&&(0,F.jsx)(`div`,{className:`text-[12.5px] rounded-lg px-3 py-2 bg-[rgba(250,178,25,.08)] border border-[rgba(250,178,25,.25)]`,children:u.blocked.error}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @lg:grid-cols-3 gap-2`,children:[g(`This month`,u.month),g(`Today`,u.today),(0,F.jsxs)(`div`,{className:`rounded-lg bg-[#14141b] border border-line px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`text-[11px] text-mute`,children:`Per question, on average`}),(0,F.jsx)(`div`,{className:`text-[15px] font-semibold tabular-nums`,children:u.perQuestion==null?`—`:(0,F.jsxs)(F.Fragment,{children:[qi(u.perQuestion),` `,(0,F.jsx)(`span`,{className:`text-[11.5px] font-normal text-ink2`,children:`tokens`})]})}),(0,F.jsxs)(`div`,{className:`text-[11.5px] text-ink2`,children:[`Capped at `,qi(d.perQuestion)]})]})]}),(d.monthly!=null||d.daily!=null)&&(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @3xl:grid-cols-2 gap-4`,children:[d.monthly!=null&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:`Monthly budget`}),(0,F.jsxs)(`span`,{className:`text-ink2 tabular-nums`,children:[h(u.spent.month),` of `,h(d.monthly)]})]}),(0,F.jsx)(Qi,{used:u.spent.month,included:d.monthly,thresholds:d.thresholds,height:8})]}),d.daily!=null&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:`Daily budget`}),(0,F.jsxs)(`span`,{className:`text-ink2 tabular-nums`,children:[h(u.spent.today),` of `,h(d.daily)]})]}),(0,F.jsx)(Qi,{used:u.spent.today,included:d.daily,height:8})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @3xl:grid-cols-3 gap-x-4 gap-y-3 text-[12.8px]`,children:[(0,F.jsx)(K,{label:`Tokens per question`,hint:`Past this, Obzeri answers with what it has.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`numeric`,value:i.perQuestion??``,onChange:f(`perQuestion`)})}),(0,F.jsx)(K,{label:`Questions per hour, per browser`,hint:`0 turns the limit off.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`numeric`,value:i.perHour??``,onChange:f(`perHour`)})}),(0,F.jsx)(K,{label:`Earlier messages sent with a question`,hint:`Each one is sent again on every step.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`numeric`,value:i.historyTurns??``,onChange:f(`historyTurns`)})}),(0,F.jsx)(K,{label:`Budgets in`,children:(0,F.jsxs)(`select`,{className:`input h-8 w-full`,value:i.budgetUnit??`tokens`,onChange:f(`budgetUnit`),children:[(0,F.jsx)(`option`,{value:`tokens`,children:`Tokens`}),(0,F.jsx)(`option`,{value:`usd`,children:`Dollars (needs prices)`})]})}),(0,F.jsx)(K,{label:`Daily budget${i.budgetUnit===`usd`?` ($)`:``}`,hint:`Empty: none. Resets 00:00 UTC.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`decimal`,placeholder:`No limit`,value:i.daily??``,onChange:f(`daily`)})}),(0,F.jsx)(K,{label:`Monthly budget${i.budgetUnit===`usd`?` ($)`:``}`,hint:`Empty: none. Resets on the 1st.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`decimal`,placeholder:`No limit`,value:i.monthly??``,onChange:f(`monthly`)})}),(0,F.jsx)(K,{label:`Price per million input tokens ($)`,hint:`From your provider's price list for this model.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`decimal`,placeholder:`—`,value:i.priceIn??``,onChange:f(`priceIn`)})}),(0,F.jsx)(K,{label:`Price per million output tokens ($)`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,inputMode:`decimal`,placeholder:`—`,value:i.priceOut??``,onChange:f(`priceOut`)})}),(0,F.jsx)(`div`,{}),(0,F.jsx)(K,{label:`Notify at, % of the monthly budget (up to five)`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,placeholder:`50, 80, 100`,value:i.thresholds??``,onChange:f(`thresholds`)})}),(0,F.jsx)(K,{label:`Email to`,hint:`Needs email set up in Integrations → Email.`,children:(0,F.jsx)(`input`,{className:`input h-8 w-full`,placeholder:`you@example.com`,value:i.notify??``,onChange:f(`notify`)})}),(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,F.jsx)(`button`,{className:`btn btn-primary h-8`,onClick:p,children:`Save limits`}),c&&(0,F.jsx)(`span`,{className:`text-[12px]`,style:{color:`#3ccf7a`},children:`Saved`})]})]}),o&&(0,F.jsx)(`div`,{className:`text-[12.5px]`,style:{color:`#f2a0a0`},children:o}),(u.byModel.length>0||u.byProject.length>1)&&(0,F.jsx)(`div`,{className:`grid grid-cols-1 @3xl:grid-cols-2 gap-4 text-[12.5px]`,children:[[`By model`,u.byModel],[`By project`,u.byProject]].filter(([,e])=>e.length>0).map(([e,t])=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute mb-1`,children:e}),t.map(e=>(0,F.jsxs)(`div`,{className:`flex justify-between py-1 border-b border-line last:border-0`,children:[(0,F.jsx)(`span`,{className:`mono text-[12px]`,children:e.name}),(0,F.jsxs)(`span`,{className:`text-ink2 tabular-nums`,children:[qi(e.tokens),` tokens · `,e.questions,` q`,e.cost==null?``:` · ${bB(e.cost)}`]})]},e.name))]},e))})]})})}function CB(){let e=I(),[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(`all`),{data:a,error:o}=P(`/api/functions${e.q()}`,[e.tick]),s=(a||[]).filter(e=>(r===`all`||e.kind===r)&&(!t||e.name.toLowerCase().includes(t.toLowerCase()))),c=Math.max(1,...s.map(e=>e.share));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(vr,{size:18,className:`text-brand`}),title:`Services`,sub:`Time per service class method, route handler and middleware. Own time excludes awaited work (queries, HTTP calls, nested methods), so the top of this list is where your own code spends time.`}),(0,F.jsx)(wB,{}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(wi,{size:13,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-mute`}),(0,F.jsx)(`input`,{className:`input pl-8 w-[260px] h-7`,placeholder:`Filter by name`,value:t,onChange:e=>n(e.target.value)})]}),(0,F.jsx)(za,{value:r,onChange:i,options:[{id:`all`,label:`All`},{id:`function`,label:`Class methods`},{id:`handler`,label:`Handlers`},{id:`middleware`,label:`Middleware`},{id:`custom`,label:`Custom spans`}]})]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:o?(0,F.jsx)(W,{error:o}):a?(0,F.jsx)(Ba,{rows:s,initialSort:`self`,rowKey:e=>e.service+e.name+e.kind,empty:(0,F.jsxs)(Ma,{title:`No timed code yet`,children:[`Handlers and middleware are timed automatically, and so are classes exported from `,(0,F.jsx)(`span`,{className:`mono`,children:`*.service.ts`}),` and `,(0,F.jsx)(`span`,{className:`mono`,children:`*.repository.ts`}),` files. For other files, set `,(0,F.jsx)(`span`,{className:`mono`,children:`autoInstrument`}),` globs or call `,(0,F.jsx)(`span`,{className:`mono`,children:`instrument(MyClass)`}),`.`]}),cols:[{key:`n`,label:`Name`,sort:e=>e.name,render:e=>{let t=Vz[e.kind]||Vz.function;return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,F.jsx)(t.Icon,{size:12,style:{color:t.color}}),(0,F.jsx)(`span`,{className:`mono text-[12px]`,children:e.name})]})}},{key:`k`,label:`Kind`,sort:e=>e.kind,render:e=>(0,F.jsx)(`span`,{className:`text-mute`,children:e.kind===`function`?`Class method`:Vz[e.kind]?.label})},{key:`s`,label:`Application`,sort:e=>e.service,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`text-ink2`,children:e.service}),(0,F.jsx)(eo,{app:e.service,web:!0})]})},{key:`calls`,label:`Calls`,num:!0,sort:e=>e.calls,render:e=>V(e.calls)},{key:`avgSelf`,label:`Avg own`,num:!0,sort:e=>e.avgSelf,render:e=>B(e.avgSelf)},{key:`avgTotal`,label:`Avg total`,num:!0,sort:e=>e.avgTotal,render:e=>B(e.avgTotal)},{key:`self`,label:`Own time`,num:!0,sort:e=>e.self,render:e=>B(e.self)},{key:`total`,label:`Total time`,num:!0,sort:e=>e.total,render:e=>B(e.total)},{key:`share`,label:`Share of own time`,num:!0,sort:e=>e.share,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[ya(e.share,1),(0,F.jsx)(Va,{value:e.share,max:c,color:zR[4],w:70})]})},{key:`err`,label:`Errors`,num:!0,sort:e=>e.errors,render:e=>e.errors?(0,F.jsx)(`span`,{style:{color:`#ff8a8a`},children:V(e.errors)}):(0,F.jsx)(`span`,{className:`text-mute`,children:`0`})}]}):(0,F.jsx)(U,{})})})]})}function wB(){let e=I(),t=e.meta?.environments??[],n=(e.meta?.services??[]).filter(t=>!e.service||t.id===e.service).filter(n=>!e.env||t.find(t=>t.id===e.env)?.services.includes(n.id));return n.length?(0,F.jsx)(`div`,{className:`grid grid-cols-1 @3xl:grid-cols-2 @6xl:grid-cols-3 gap-3`,children:n.map(e=>{let n=Date.now()-e.lastSeen<9e5,r=t.filter(t=>t.services.includes(e.id)).map(e=>e.id);return(0,F.jsxs)(`div`,{className:`card px-4 py-3 flex flex-col gap-2 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:n?`#3ccf7a`:`#5c5c70`},title:n?`Reporting`:`Last heard ${xa(e.lastSeen)}`}),(0,F.jsx)(`span`,{className:`font-medium text-[13.5px] truncate`,children:e.id}),(0,F.jsx)(`span`,{className:`flex-1`}),(0,F.jsx)(`span`,{className:`text-[11.5px] text-mute shrink-0`,children:n?`reporting`:xa(e.lastSeen)})]}),(0,F.jsx)($a,{frameworks:e.frameworks}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute truncate`,children:[e.node?`Node ${e.node.replace(/^v/,``)}`:null,`${e.instances.length} instance${e.instances.length===1?``:`s`}`,r.length?r.join(`, `):e.environment].filter(Boolean).join(` · `)})]},e.id)})}):null}function TB(){let[e,t]=zn(),n=ht(),{data:r,error:i,reload:a}=P(`/api/projects`),[o,s]=(0,v.useState)(e.get(`new`)===`1`),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),f=e.get(`project`)||`default`,p=()=>{if(s(!1),e.get(`new`)){let n=new URLSearchParams(e);n.delete(`new`),t(n,{replace:!0})}};return i?(0,F.jsx)(W,{error:i}):r?(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Vr,{size:18,className:`text-brand`}),title:`Projects`,sub:`Each project has its own apps, ingest keys, alerts, SLOs, issues, status pages, integrations and MCP token. Nothing is shared between projects.`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>s(!0),children:[(0,F.jsx)(hi,{size:14}),`New project`]})}),(0,F.jsx)(H,{pad:!1,children:(0,F.jsx)(Ba,{rows:r,cols:[{key:`n`,label:`Project`,render:e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e.name}),e.isDefault&&(0,F.jsx)(`span`,{className:`pill`,children:`default`}),e.slug===f&&(0,F.jsx)(G,{kind:`good`,children:`current`})]})},{key:`s`,label:`Slug`,render:e=>(0,F.jsx)(`span`,{className:`mono text-ink2`,children:e.slug})},{key:`a`,label:`Apps`,num:!0,render:e=>e.apps},{key:`l`,label:`Last data`,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.lastSeen?xa(e.lastSeen):`—`})},{key:`x`,label:``,render:t=>(0,F.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[t.slug!==f&&(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>n(_a(t.slug,`/`,e)),children:[`Open`,(0,F.jsx)(fr,{size:12})]}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Rename`,onClick:()=>d(t),children:(0,F.jsx)(di,{size:13})}),!t.isDefault&&(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2 text-[#ff8a8a]`,title:`Delete`,onClick:async()=>{window.prompt(`Delete "${t.name}" and all of its data (apps, alerts, issues, status pages, keys)? This cannot be undone.\n\nType the slug "${t.slug}" to confirm.`)===t.slug&&(await N(`/api/projects/${t.slug}`,{method:`DELETE`}),t.slug===f?n(_a(`default`,`/projects`,e)):a())},children:(0,F.jsx)(Ii,{size:13})})]})}]})}),o&&(0,F.jsx)(EB,{onClose:p,onCreated:e=>{p(),l(e),a()}}),c&&(0,F.jsx)(DB,{project:c,onClose:()=>l(null),onOpen:()=>{l(null),n(_a(c.slug,`/settings`,e))}}),u&&(0,F.jsx)(OB,{project:u,onClose:()=>d(null),onSaved:()=>{d(null),a()}})]}):(0,F.jsx)(U,{})}function EB({onClose:e,onCreated:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``);return(0,F.jsx)(Ua,{open:!0,title:`New project`,onClose:e,children:(0,F.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:async e=>{e.preventDefault();try{t(await N(`/api/projects`,{method:`POST`,json:{name:n}}))}catch(e){a(e.message)}},children:[(0,F.jsx)(K,{label:`Name`,hint:`a product, a client or a team`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,value:n,onChange:e=>r(e.target.value),placeholder:`Acme Shop`})}),i&&(0,F.jsx)(`div`,{className:`text-[12.5px] text-[#ff8a8a]`,children:i}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(`button`,{type:`button`,className:`btn`,onClick:e,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,disabled:!n.trim(),children:`Create`})]})]})})}function DB({project:e,onClose:t,onOpen:n}){let r=`OBZERVER_KEY=${e.ingestKey} OBZERVER_ENDPOINT=${window.location.origin} \\\n node --import @obzerver/node/register server.js`;return(0,F.jsx)(Ua,{open:!0,title:`"${e.name}" is ready`,onClose:t,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 text-[13px]`,children:[(0,F.jsx)(`div`,{className:`text-ink2`,children:`Apps that send data with this project's ingest key show up only here.`}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsx)(`span`,{className:`text-ink2 text-[12px]`,children:`Ingest key`}),(0,F.jsx)(Ra,{text:e.ingestKey,className:`btn h-6 text-[11px]`})]}),(0,F.jsx)(`div`,{className:`code`,children:e.ingestKey})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,F.jsx)(`span`,{className:`text-ink2 text-[12px]`,children:`Start an app with it`}),(0,F.jsx)(Ra,{text:r,className:`btn h-6 text-[11px]`})]}),(0,F.jsx)(`div`,{className:`code`,children:r})]}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:t,children:`Stay here`}),(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:n,children:[`Open project setup`,(0,F.jsx)(fr,{size:13})]})]})]})})}function OB({project:e,onClose:t,onSaved:n}){let[r,i]=(0,v.useState)(e.name),[a,o]=(0,v.useState)(``);return(0,F.jsx)(Ua,{open:!0,title:`Rename project`,onClose:t,children:(0,F.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:async t=>{t.preventDefault();try{await N(`/api/projects/${e.slug}`,{method:`PATCH`,json:{name:r}}),n()}catch(e){o(e.message)}},children:[(0,F.jsx)(K,{label:`Name`,hint:(0,F.jsxs)(F.Fragment,{children:[`the slug `,(0,F.jsx)(`span`,{className:`mono`,children:e.slug}),` stays, so links and keys keep working`]}),children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,value:r,onChange:e=>i(e.target.value)})}),a&&(0,F.jsx)(`div`,{className:`text-[12.5px] text-[#ff8a8a]`,children:a}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(`button`,{type:`button`,className:`btn`,onClick:t,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,disabled:!r.trim(),children:`Save`})]})]})})}function kB(){let e=I(),[t,n]=(0,v.useState)(`db`),[r,i]=(0,v.useState)(null),a=P(t===`db`?`/api/queries${e.q()}`:null,[e.tick,t]),o=P(t===`http`?`/api/outbound${e.q()}`:null,[e.tick,t]);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Rr,{size:18,className:`text-brand`}),title:`Queries & dependencies`,sub:`Statements from pg, mysql2 and ioredis with literal values stripped in-process, plus outbound HTTP calls (http, https, fetch).`,right:(0,F.jsx)(za,{value:t,onChange:n,options:[{id:`db`,label:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(Rr,{size:12}),`Database`]})},{id:`http`,label:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(Wr,{size:12}),`Outbound HTTP`]})}]})}),t===`db`?(0,F.jsx)(H,{pad:!1,children:a.error?(0,F.jsx)(W,{error:a.error}):a.data?(0,F.jsx)(Ba,{rows:a.data,initialSort:`total`,rowKey:e=>e.service+e.statement,onRow:e=>i(r===e.service+e.statement?null:e.service+e.statement),empty:(0,F.jsx)(Ma,{title:`No queries recorded`,children:`pg, mysql2 and ioredis are instrumented automatically when installed.`}),cols:[{key:`st`,label:`Statement`,render:e=>(0,F.jsxs)(`div`,{className:`max-w-[640px]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`mono text-[12px] truncate`,children:e.statement}),e.nPlusOne&&(0,F.jsx)(G,{kind:`serious`,children:`N+1 suspect`})]}),r===e.service+e.statement&&(0,F.jsxs)(`div`,{className:`mt-2`,onClick:e=>e.stopPropagation(),children:[(0,F.jsx)(`div`,{className:`flex justify-end mb-1`,children:(0,F.jsx)(Ra,{text:e.statement,className:`btn h-6 text-[11px]`})}),(0,F.jsx)(Uz,{text:e.statement})]})]})},{key:`sys`,label:`System`,sort:e=>e.system,render:e=>(0,F.jsx)(`span`,{className:`pill`,children:e.system})},{key:`svc`,label:`Application`,sort:e=>e.service,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.service})},{key:`calls`,label:`Calls`,num:!0,sort:e=>e.calls,render:e=>V(e.calls)},{key:`per`,label:`Per request`,num:!0,sort:e=>e.perRequest,render:e=>(0,F.jsxs)(`span`,{title:`max ${e.maxPerRequest} in one request`,style:{color:e.nPlusOne?`#ffb38a`:void 0},children:[V(e.perRequest),` `,(0,F.jsxs)(`span`,{className:`text-mute text-[11px]`,children:[`max `,e.maxPerRequest]})]})},{key:`avg`,label:`Avg`,num:!0,sort:e=>e.avg,render:e=>B(e.avg)},{key:`p95`,label:`p95`,num:!0,sort:e=>e.p95,render:e=>B(e.p95)},{key:`total`,label:`Total time`,num:!0,sort:e=>e.total,render:e=>B(e.total)}]}):(0,F.jsx)(U,{})}):(0,F.jsx)(H,{pad:!1,children:o.error?(0,F.jsx)(W,{error:o.error}):o.data?(0,F.jsx)(Ba,{rows:o.data,initialSort:`calls`,empty:(0,F.jsx)(Ma,{title:`No outbound calls recorded`}),cols:[{key:`h`,label:`Host`,sort:e=>e.host,render:e=>(0,F.jsx)(`span`,{className:`mono`,children:e.host})},{key:`s`,label:`Called from`,sort:e=>e.service,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.service})},{key:`calls`,label:`Calls`,num:!0,sort:e=>e.calls,render:e=>V(e.calls)},{key:`err`,label:`Failures`,num:!0,sort:e=>e.errors,render:e=>e.errors?(0,F.jsxs)(`span`,{style:{color:`#ff8a8a`},children:[V(e.errors),` (`,ya(e.errors/e.calls*100),`)`]}):(0,F.jsx)(`span`,{className:`text-mute`,children:`0`})},{key:`avg`,label:`Avg`,num:!0,sort:e=>e.avg,render:e=>B(e.avg)},{key:`p95`,label:`p95`,num:!0,sort:e=>e.p95,render:e=>B(e.p95)}]}):(0,F.jsx)(U,{})})]})}function AB(){let e=I(),t=L(),n=ht(),[r,i]=(0,v.useState)(`user`),[a,o]=(0,v.useState)(``),{data:s,error:c}=P(`/api/users${e.q({groupBy:r===`customer`?`customer`:``})}`,[e.tick,r]),l=(s||[]).filter(e=>!a||(e.userId||e.customer).toLowerCase().includes(a.toLowerCase()));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Vi,{size:18,className:`text-brand`}),title:`Users`,sub:(0,F.jsxs)(F.Fragment,{children:[`Who is affected. Users come from `,(0,F.jsx)(`span`,{className:`mono`,children:`req.user.id`}),`, the `,(0,F.jsx)(`span`,{className:`mono`,children:`http.getUserId`}),` option or `,(0,F.jsx)(`span`,{className:`mono`,children:`obzerver.setUser()`}),`.`]})}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(wi,{size:13,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-mute`}),(0,F.jsx)(`input`,{className:`input pl-8 w-[260px] h-7`,placeholder:`Filter`,value:a,onChange:e=>o(e.target.value)})]}),(0,F.jsx)(za,{value:r,onChange:i,options:[{id:`user`,label:`By user`},{id:`customer`,label:`By customer (email domain)`}]})]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:c?(0,F.jsx)(W,{error:c}):s?r===`user`?(0,F.jsx)(Ba,{rows:l,initialSort:`calls`,onRow:e=>n(t(`/users/${Ta(e.userId)}`)),rowKey:e=>e.userId,empty:(0,F.jsx)(Ma,{title:`No identified users`,children:`Set http.getUserId in the SDK options, or populate req.user.`}),cols:[{key:`u`,label:`User`,sort:e=>e.userId,render:e=>(0,F.jsx)(`span`,{className:`font-medium`,children:e.userId})},{key:`c`,label:`Calls`,num:!0,sort:e=>e.calls,render:e=>V(e.calls)},{key:`o`,label:`Operations`,num:!0,sort:e=>e.operations,render:e=>V(e.operations)},{key:`f`,label:`Failure rate`,num:!0,sort:e=>e.failureRate,render:e=>(0,F.jsxs)(`span`,{style:{color:e.failureRate>2?`#ff8a8a`:e.failureRate>0?`var(--color-ink2)`:`var(--color-mute)`},children:[ya(e.failureRate),` `,(0,F.jsxs)(`span`,{className:`text-mute text-[11px]`,children:[`(`,e.failed,`)`]})]})},{key:`a`,label:`Avg latency`,num:!0,sort:e=>e.avg,render:e=>B(e.avg)},{key:`l`,label:`Last seen`,num:!0,sort:e=>e.lastSeen,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:xa(e.lastSeen)})}]}):(0,F.jsx)(Ba,{rows:l,initialSort:`calls`,rowKey:e=>e.customer,cols:[{key:`c`,label:`Customer`,sort:e=>e.customer,render:e=>(0,F.jsx)(`span`,{className:`font-medium`,children:e.customer})},{key:`u`,label:`Users`,num:!0,sort:e=>e.users,render:e=>V(e.users)},{key:`n`,label:`Calls`,num:!0,sort:e=>e.calls,render:e=>V(e.calls)},{key:`f`,label:`Failure rate`,num:!0,sort:e=>e.failureRate,render:e=>(0,F.jsxs)(`span`,{style:{color:e.failureRate>2?`#ff8a8a`:void 0},children:[ya(e.failureRate),` `,(0,F.jsxs)(`span`,{className:`text-mute text-[11px]`,children:[`(`,e.failed,`)`]})]})},{key:`l`,label:`Last seen`,num:!0,sort:e=>e.lastSeen,render:e=>xa(e.lastSeen)}]}):(0,F.jsx)(U,{})})})]})}function jB(){let{id:e=``}=yt(),t=I(),n=L(),r=ht(),{data:i,error:a}=P(`/api/users/${encodeURIComponent(e)}${t.q()}`,[t.tick]);if(a)return(0,F.jsx)(W,{error:a});if(!i)return(0,F.jsx)(U,{});let o=i.actions.filter(e=>e.failed).length,s=[];for(let e of i.actions){let t=s[s.length-1];t&&t[t.length-1].ts-e.ts<18e5?t.push(e):s.push([e])}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(Nn,{to:n(`/users`),className:`text-mute hover:text-ink text-[12px] -mb-2`,children:`← Users`}),(0,F.jsx)(ja,{title:e,sub:e.includes(`@`)?`customer ${e.split(`@`)[1]}`:void 0}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 @3xl:grid-cols-4 gap-3`,children:[(0,F.jsx)(Na,{label:`Actions in window`,value:V(i.actions.length)}),(0,F.jsx)(Na,{label:`Failed`,value:V(o),color:o?`#ff8a8a`:void 0}),(0,F.jsx)(Na,{label:`Sessions`,value:V(s.length)}),(0,F.jsx)(Na,{label:`Distinct errors`,value:V(i.errors.length)})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-3`,children:[(0,F.jsx)(H,{title:`Activity replay`,sub:`newest first, grouped into sessions`,pad:!1,className:`@5xl:col-span-2`,children:s.length===0?(0,F.jsx)(Ma,{title:`No activity in this window`}):(0,F.jsx)(`div`,{className:`max-h-[560px] overflow-auto`,children:s.map((e,t)=>(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`px-3.5 py-1.5 text-[11px] uppercase tracking-wider text-mute bg-[#111118] border-b border-line sticky top-0`,children:[`Session · `,Sa(e[e.length-1].ts,!0),` → `,Sa(e[0].ts),` · `,e.length,` actions`]}),e.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 px-3.5 py-1.5 border-b border-[#1b1b23] hover:bg-[#16161e] cursor-pointer`,onClick:()=>r(n(`/executions/${e.id}`)),children:[(0,F.jsx)(`span`,{className:`mono text-mute text-[11.5px] w-16`,children:Sa(e.ts)}),(0,F.jsxs)(`span`,{className:`flex-1 min-w-0`,children:[(0,F.jsx)(La,{name:e.name}),e.error_message&&(0,F.jsx)(`span`,{className:`text-[#ff9b9b] text-[12px] ml-2 truncate`,children:e.error_message})]}),(0,F.jsx)(Fa,{status:e.status}),(0,F.jsx)(`span`,{className:`w-16 text-right tabular-nums`,children:B(e.duration)})]},e.id))]},t))})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(H,{title:`Actions`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.operations,cols:[{key:`n`,label:`Operation`,render:e=>(0,F.jsx)(La,{name:e.name})},{key:`c`,label:`Calls`,num:!0,render:e=>V(e.calls)},{key:`f`,label:`Failed`,num:!0,render:e=>e.failed?(0,F.jsx)(`span`,{style:{color:`#ff8a8a`},children:e.failed}):(0,F.jsx)(`span`,{className:`text-mute`,children:`0`})}]})}),(0,F.jsx)(H,{title:`Common paths`,sub:`action → next action`,pad:!1,children:i.paths.length?i.paths.map(e=>(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 px-3.5 py-1.5 border-b border-[#1b1b23] text-[12px]`,children:[(0,F.jsx)(`span`,{className:`mono truncate`,children:e.path}),(0,F.jsx)(`span`,{className:`tabular-nums text-ink2`,children:e.n})]},e.path)):(0,F.jsx)(Ma,{title:`Not enough actions`})}),i.errors.length>0&&(0,F.jsx)(H,{title:`Errors hit`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.errors,onRow:e=>r(n(`/errors/${e.fingerprint}`)),cols:[{key:`c`,label:`Error`,render:e=>(0,F.jsx)(`span`,{className:`text-[#ff9b9b]`,children:e.class})},{key:`n`,label:`Count`,num:!0,render:e=>e.n}]})})]})]})]})}var MB=e=>new Date(e).toLocaleString(`en-US`,{month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),NB=e=>String(e).padStart(2,`0`),PB=(e,t)=>{let n=new Date(e),r=`${NB(n.getHours())}:${NB(n.getMinutes())}`,i=`${NB(n.getMonth()+1)}/${NB(n.getDate())}`;return t<=72e6?r:t<=2592e5?`${i} ${r}`:i},FB=({color:e})=>(0,F.jsx)(`span`,{className:`inline-block w-[2px] h-[11px] rounded-full align-[-1px]`,style:{background:e}});function IB({title:e,sub:t,children:n}){return(0,F.jsxs)(`section`,{className:`flex flex-col gap-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2.5 px-0.5`,children:[(0,F.jsx)(`h2`,{className:`text-[15px] font-medium tracking-tight`,children:e}),(0,F.jsx)(`span`,{className:`mono text-[10.5px] uppercase tracking-[.12em] text-mute`,children:t})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-2 gap-3`,children:n})]})}function LB({now:e,prev:t,unit:n,badWhen:r=`up`}){if(e==null||t==null||n===`pct`&&!t)return null;let i=n===`pp`?e-t:(e-t)/t*100,a=Math.abs(i)<(n===`pp`?.05:.5),o=i>0,s=!a&&(o?r===`up`:r===`down`),c=a?ai:o?Ri:Li,l=n===`pp`?`${o?`+`:`−`}${Math.abs(i).toFixed(2)}pp`:`${o?`+`:`−`}${Math.abs(i).toFixed(0)}%`;return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-ink2`,title:`Average over this window compared with the window of the same length before it`,children:[(0,F.jsx)(c,{size:13,style:{color:a?`var(--color-mute)`:s?`#f0506e`:`#3fb68b`}}),a?`no change`:l,` since last period`]})}function RB({value:e,color:t,fmt:n}){return e==null?null:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[12px] text-ink2`,children:[(0,F.jsx)(FB,{color:t}),`AVG`,(0,F.jsx)(`span`,{className:`mono text-[11.5px] font-semibold px-1.5 py-[2px] rounded`,style:{background:`#2a2a33`,color:`#e8e8ef`},children:n(e)})]})}function zB({title:e,trend:t,right:n,children:r}){return(0,F.jsxs)(`div`,{className:`rounded-xl border border-line overflow-hidden`,style:{background:`linear-gradient(180deg, #17171d 0%, #121217 100%)`},children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-5 h-[52px] border-b border-line`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[14px] whitespace-nowrap`,children:e}),t]}),(0,F.jsx)(`div`,{className:`flex items-center gap-4 shrink-0`,children:n})]}),(0,F.jsx)(`div`,{className:`px-3 pt-4 pb-2`,children:r})]})}var BB=({series:e})=>(0,F.jsx)(F.Fragment,{children:e.map(e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-ink2`,children:[(0,F.jsx)(FB,{color:e.color}),e.label]},e.key))});function VB({active:e,payload:t,label:n,series:r,fmt:i,pinned:a,hint:o,extra:s}){if(!e||!t?.length)return null;let c=t[0].payload;return(0,F.jsxs)(`div`,{className:`mono rounded-md border border-[#2c2c36] px-3 py-2.5 text-[11.5px] shadow-2xl`,style:{background:`rgba(17,17,22,.97)`,minWidth:200},children:[r.filter(e=>c[e.key]!=null).map(e=>{let t=a?.[e.key],n=t!=null&&c[e.key]!=null?c[e.key]-t:null;return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 py-[2px]`,children:[(0,F.jsx)(FB,{color:e.color}),(0,F.jsxs)(`span`,{className:`font-semibold text-ink`,children:[e.label,`: `,i(c[e.key],e.key)]}),n!=null&&(0,F.jsxs)(`span`,{className:`text-mute`,children:[`(`,n>=0?`+`:`−`,i(Math.abs(n),e.key),` vs pin)`]})]},e.key)}),s?.(c),(0,F.jsx)(`div`,{className:`text-ink2 mt-1.5`,children:MB(n)}),(0,F.jsx)(`div`,{className:`text-mute mt-2 pt-2 border-t border-[#24242c]`,children:a?`Pinned ${MB(a.t)} · shift+click to unpin`:o})]})}function HB({data:e,series:t,fmt:n,yFmt:r,height:i=240,yMax:a,onInspect:o,gcKey:s,extra:c,releases:l=[]}){let u=(0,v.useRef)(!1),[d,f]=(0,v.useState)(null);if(!e.length)return(0,F.jsx)(`div`,{className:`flex items-center justify-center text-mute text-[12px]`,style:{height:i},children:`No samples in this window`});let p=s?Math.max(1,...e.map(e=>e[s]||0)):1,m=t.some(e=>e.kind===`bar`),h=e.length>1?e[e.length-1].t-e[0].t:36e5,g=e.length>1?e[1].t-e[0].t:h,_=l.filter(t=>t.t>=e[0].t&&t.t<=e[e.length-1].t+g).map(t=>({...t,at:e.reduce((e,n)=>n.t<=t.t&&n.t>e?n.t:e,e[0].t)})),y=e=>_.filter(t=>t.at===e),b=o?`Click to see what ran here · shift+click to pin and compare`:`Shift+click to pin and compare`;return(0,F.jsx)(`div`,{className:`relative select-none`,onMouseDownCapture:e=>{u.current=e.shiftKey},children:(0,F.jsx)(`div`,{style:{height:i},children:(0,F.jsx)(Vm,{width:`100%`,height:`100%`,children:(0,F.jsxs)(RR,{data:e,margin:{top:8,right:44,bottom:0,left:0},barGap:2,barCategoryGap:`30%`,onClick:t=>{if(!t||t.activeLabel==null)return;let n=e.find(e=>e.t===t.activeLabel);u.current?f(e=>e&&e.t===t.activeLabel?null:n):o?.(t.activeLabel)},style:{cursor:o?`pointer`:`default`},children:[(0,F.jsx)(`defs`,{children:t.filter(e=>e.kind===`area`||e.kind===`bar`).map(e=>(0,F.jsxs)(`linearGradient`,{id:`g-${e.key}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:e.kind===`bar`?1:.42}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:e.kind===`bar`?.35:.02})]},e.key))}),(0,F.jsx)(QP,{vertical:!1,stroke:`#ffffff`,strokeOpacity:.045,strokeDasharray:`2 6`}),(0,F.jsx)(XI,{dataKey:`t`,type:m?`category`:`number`,domain:[`dataMin`,`dataMax`],scale:m?`auto`:`time`,tickFormatter:e=>PB(e,h),tick:{fill:`#6f6f7d`,fontSize:10.5,fontFamily:`var(--font-mono)`},tickLine:!1,axisLine:{stroke:`#2a2a35`},minTickGap:44,tickMargin:6}),(0,F.jsx)(pL,{yAxisId:`v`,width:64,tickLine:!1,axisLine:!1,tickCount:5,tick:{fill:`#6f6f7d`,fontSize:10.5,fontFamily:`var(--font-mono)`},tickFormatter:e=>(r??n)(e),domain:[0,a??`auto`],allowDecimals:!0}),s&&(0,F.jsx)(pL,{yAxisId:`gc`,hide:!0,domain:[0,p*6]}),(0,F.jsx)(Sm,{content:(0,F.jsx)(VB,{series:t,fmt:n,pinned:d,hint:b,extra:e=>(0,F.jsxs)(F.Fragment,{children:[y(e.t).map(e=>(0,F.jsxs)(`div`,{className:`py-[2px]`,style:{color:`#ff6b9d`},children:[`Release `,e.version,` deployed `,new Date(e.t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1})]},e.version)),c?.(e)]})}),cursor:{stroke:`#ffffff`,strokeOpacity:.18,strokeDasharray:`3 3`},isAnimationActive:!1}),s&&(0,F.jsx)(Jj,{yAxisId:`gc`,dataKey:s,fill:`#8a8a98`,fillOpacity:.55,barSize:1.5,isAnimationActive:!1}),t.map(e=>e.kind===`bar`?(0,F.jsx)(Jj,{yAxisId:`v`,dataKey:e.key,fill:`url(#g-${e.key})`,barSize:3,radius:[2,2,0,0],isAnimationActive:!1},e.key):e.kind===`area`?(0,F.jsx)(YF,{yAxisId:`v`,type:`monotone`,dataKey:e.key,stroke:e.color,strokeWidth:1.6,fill:`url(#g-${e.key})`,dot:!1,activeDot:{r:4,fill:e.color,stroke:`#121217`,strokeWidth:2},isAnimationActive:!1,connectNulls:!0},e.key):(0,F.jsx)(EF,{yAxisId:`v`,type:`monotone`,dataKey:e.key,stroke:e.color,strokeOpacity:e.faint?.55:1,strokeWidth:e.faint?1.3:1.6,dot:!1,activeDot:{r:4,fill:e.color,stroke:`#121217`,strokeWidth:2},isAnimationActive:!1,connectNulls:!0},e.key)),_.map(e=>(0,F.jsx)(lN,{yAxisId:`v`,x:e.at,stroke:`#ff6b9d`,strokeDasharray:`3 3`,strokeOpacity:.85,label:{value:e.version,position:`insideTopLeft`,fill:`#ff6b9d`,fontSize:10.5,fontFamily:`var(--font-mono)`}},`${e.version}${e.t}`)),d&&(0,F.jsx)(lN,{yAxisId:`v`,x:d.t,stroke:`#ff9cc0`,strokeDasharray:`4 3`,strokeOpacity:.8})]})})})})}var UB={heapUsed:`#f0506e`,heapTotal:`#b0344d`,rss:`#7c7c8a`,memUtil:`#3fa58a`,cpuUtil:`#e5484d`,user:`#e5484d`,system:`#f59bb0`,elP99:`#f0506e`,elP50:`#7c7c8a`,elu:`#9085e9`},WB=e=>e>=1024?`${(e/1024).toFixed(2)} GB`:`${e.toFixed(2)} MB`,GB=e=>`${e.toFixed(2)}%`,KB=e=>`${e<10&&e%1?e.toFixed(1):Math.round(e)}%`,qB=e=>e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`,JB=`Utilization needs @obzerver/node 0.8.2 or later, which reports the V8 heap limit, the container limits and CPU time.`;function YB(){let e=I(),t=L(),n=ht(),r=P(`/api/runtime${e.q()}`,[e.tick]),i=[...new Set((r.data||[]).map(e=>e.service))],[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),l=a&&i.includes(a)?a:e.service||i[0]||``,u=P(l?`/api/runtime/view${e.q({service:l,instance:s})}`:null,[e.tick,l,s]),[d,f]=(0,v.useState)(null);if((0,v.useEffect)(()=>{f(null),c(``)},[l]),(0,v.useEffect)(()=>{let e=u.data?.points;!e?.length||d&&!d.auto||b(e.reduce((e,t)=>(t.elP99??0)>(e.elP99??0)?t:e,e[0]).t,!0)},[u.data]),r.error)return(0,F.jsx)(W,{error:r.error});if(!r.data)return(0,F.jsx)(U,{});let p=u.data,m=p?.points||[],h=p?.summary,g=p?.prev,_=m.some(e=>e.memUtil!=null||e.cpuUtil!=null),y=(r.data||[]).filter(e=>e.service===l).map(e=>e.instance);async function b(e,t=!1){let n=u.data?.bucketMs||6e4,r=await N(`/api/runtime/spike?service=${encodeURIComponent(l)}${s?`&instance=${encodeURIComponent(s)}`:``}&ts=${e}&windowMs=${Math.max(6e4,n/2)}`);f({ts:e,rows:r,auto:t}),t||document.getElementById(`what-ran`)?.scrollIntoView({behavior:`smooth`,block:`start`})}let x=e=>{b(e)},S=(e.meta?.versions||[]).filter(t=>t.service===l&&t.first>=e.from&&t.first<=e.to).map(e=>({t:e.first,version:e.version})),C=p?.byInstance||[],w=e=>zR[Math.max(0,C.findIndex(t=>t.instance===e))%zR.length],T=!s&&C.length>1,E=e=>{let t=new Map;return C.forEach((n,r)=>{for(let i of n.points)t.has(i.t)||t.set(i.t,{t:i.t}),t.get(i.t)[`i${r}`]=i[e]}),[...t.values()].sort((e,t)=>e.t-t.t)},D=C.map((e,t)=>({key:`i${t}`,label:e.instance,color:zR[t%zR.length],kind:`line`})),O=[{key:`heapUsed`,label:`Heap Used`,color:UB.heapUsed,kind:`line`},{key:`heapTotal`,label:`Heap Total`,color:UB.heapTotal,kind:`line`},{key:`rss`,label:`RSS`,color:UB.rss,kind:`line`,faint:!0}],k=[{key:`cpuUser`,label:`User`,color:UB.user,kind:`bar`},{key:`cpuSystem`,label:`System`,color:UB.system,kind:`bar`}],A=[{key:`elP99`,label:`p99`,color:UB.elP99,kind:`line`},{key:`elP50`,label:`p50`,color:UB.elP50,kind:`line`,faint:!0}],j=!s&&y.length>1;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Lr,{size:18,className:`text-brand`}),title:`Profiler`,sub:`Memory, CPU and event-loop health for each app, sampled every 15 seconds.${j?` Across ${y.length} instances, memory and CPU time add up, while utilization and loop delay follow the busiest instance.`:``}`,right:i.length>0&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`select`,{className:`select`,value:l,onChange:e=>o(e.target.value),"aria-label":`Application`,children:i.map(e=>(0,F.jsx)(`option`,{children:e},e))}),y.length>1&&(0,F.jsxs)(`select`,{className:`select`,value:s,onChange:e=>c(e.target.value),"aria-label":`Instance`,children:[(0,F.jsxs)(`option`,{value:``,children:[`All instances (`,y.length,`)`]}),y.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})]})}),i.length?u.error?(0,F.jsx)(W,{error:u.error}):p?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(H,{title:`Instances`,sub:`latest sample · click one to focus on it`,pad:!1,children:(0,F.jsx)(Ba,{rows:p.instances,onRow:e=>c(e.instance===s?``:e.instance),cols:[{key:`i`,label:`Instance`,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-sm shrink-0`,style:{background:w(e.instance)}}),(0,F.jsx)(`span`,{className:`mono`,style:{color:e.instance===s?`#ff9cc0`:void 0},children:e.instance}),e.instance===s&&(0,F.jsx)(`span`,{className:`pill !h-5 !text-[10.5px]`,children:`focused`})]})},{key:`cu`,label:`CPU util`,num:!0,render:e=>e.cpuUtil==null?`—`:ya(e.cpuUtil,1)},{key:`cl`,label:`CPUs`,num:!0,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.cpuLimit?`${V(e.cpuLimit)} (quota)`:e.cores??`—`})},{key:`rss`,label:`RSS`,num:!0,render:e=>WB(e.rss)},{key:`heap`,label:`Heap used / total`,num:!0,render:e=>`${V(e.heapUsed)} / ${V(e.heapTotal)} MB`},{key:`mu`,label:`Mem util`,num:!0,render:e=>e.memUtil==null?`—`:(0,F.jsx)(`span`,{title:e.memBasis===`container`?`RSS of the container limit`:`Heap of the V8 limit`,children:ya(e.memUtil,1)})},{key:`lim`,label:`Limits`,num:!0,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:[e.heapLimitMb&&`heap ${WB(e.heapLimitMb)}`,e.memLimitMb&&`container ${WB(e.memLimitMb)}`].filter(Boolean).join(` · `)||`—`})},{key:`el`,label:`Loop p99`,num:!0,render:e=>B(e.elP99)},{key:`inf`,label:`In-flight`,num:!0,render:e=>V(e.inflight)},{key:`h`,label:`Handles`,num:!0,render:e=>V(e.handles)}]})}),(0,F.jsx)(`div`,{id:`what-ran`,className:`scroll-mt-4`,children:d?(0,F.jsx)(H,{title:`Running around ${Sa(d.ts,!0)}`,sub:d.auto?`the worst event-loop delay in this window · click any point on a chart to look at another moment`:`the moment you clicked · operations ranked by how far they moved from their own baseline`,pad:!1,children:(0,F.jsx)(Ba,{rows:d.rows,onRow:e=>n(t(Pz(`http`,l,e.name))),empty:(0,F.jsx)(Ma,{title:`Nothing ran in that window`}),cols:[{key:`n`,label:`Operation`,render:e=>(0,F.jsx)(La,{name:e.name})},{key:`c`,label:`Calls`,num:!0,render:e=>V(e.calls)},{key:`a`,label:`Avg`,num:!0,render:e=>B(e.avg)},{key:`b`,label:`Baseline avg`,num:!0,render:e=>B(e.baselineAvg)},{key:`lx`,label:`Latency ×`,num:!0,render:e=>(0,F.jsx)(`span`,{style:{color:e.latencyX>=2?`#ffb38a`:void 0},children:e.latencyX?`${e.latencyX}×`:`—`})},{key:`vx`,label:`Volume ×`,num:!0,render:e=>(0,F.jsx)(`span`,{style:{color:e.volumeX>=2?`#ffb38a`:void 0},children:e.volumeX?`${e.volumeX}×`:`—`})}]})}):(0,F.jsx)(H,{title:`Running around…`,sub:`click any point on a chart to see which operations ran then`,children:(0,F.jsx)(`span`,{className:`text-mute text-[12px]`,children:`Loading…`})})}),(0,F.jsxs)(IB,{title:`Memory`,sub:`heap and resident size over time, with garbage collection`,children:[(0,F.jsx)(zB,{title:`Memory`,trend:(0,F.jsx)(LB,{now:h?.heapUsed,prev:g?.heapUsed,unit:`pct`}),right:(0,F.jsx)(BB,{series:[...O,{key:`gc`,label:`GC pauses`,color:`#8a8a98`,kind:`bar`}]}),children:(0,F.jsx)(HB,{releases:S,data:m,series:O,fmt:e=>WB(e),yFmt:qB,gcKey:`gcMs`,onInspect:x,extra:e=>e.gcCount?(0,F.jsxs)(`div`,{className:`text-mute py-[2px]`,children:[`GC: `,e.gcCount,` pauses · `,B(e.gcMs)]}):null})}),(0,F.jsx)(zB,{title:`Memory utilization`,trend:(0,F.jsx)(LB,{now:h?.memUtil,prev:g?.memUtil,unit:`pp`}),right:(0,F.jsxs)(F.Fragment,{children:[T&&(0,F.jsx)(BB,{series:D}),(0,F.jsx)(RB,{value:h?.memUtil,color:UB.memUtil,fmt:GB})]}),children:_?(0,F.jsx)(HB,{releases:S,data:T?E(`memUtil`):m,series:T?D:[{key:`memUtil`,label:`Utilization`,color:UB.memUtil,kind:`area`}],fmt:GB,yFmt:KB,extra:e=>e.memBasis&&(0,F.jsx)(`div`,{className:`text-mute py-[2px]`,children:e.memBasis===`container`?`RSS of the container memory limit`:`Heap used of the V8 heap limit`})}):(0,F.jsx)(XB,{})})]}),(0,F.jsxs)(IB,{title:`CPU`,sub:`share of the available CPU, and where the time goes`,children:[(0,F.jsx)(zB,{title:`CPU utilization`,trend:(0,F.jsx)(LB,{now:h?.cpuUtil,prev:g?.cpuUtil,unit:`pp`}),right:(0,F.jsxs)(F.Fragment,{children:[T&&(0,F.jsx)(BB,{series:D}),(0,F.jsx)(RB,{value:h?.cpuUtil,color:UB.cpuUtil,fmt:GB})]}),children:_?(0,F.jsx)(HB,{releases:S,data:T?E(`cpuUtil`):m,series:T?D:[{key:`cpuUtil`,label:`Utilization`,color:UB.cpuUtil,kind:`area`}],fmt:GB,yFmt:KB,onInspect:x}):(0,F.jsx)(XB,{})}),(0,F.jsx)(zB,{title:`CPU`,trend:(0,F.jsx)(LB,{now:h?.cpuTime,prev:g?.cpuTime,unit:`pct`}),right:(0,F.jsx)(BB,{series:k}),children:m.some(e=>e.cpuUser!=null)?(0,F.jsx)(HB,{releases:S,data:m,series:k,fmt:e=>`${e.toFixed(2)}ms`,yFmt:e=>`${Math.round(e)}ms`,onInspect:x,extra:()=>(0,F.jsx)(`div`,{className:`text-mute py-[2px]`,children:`CPU time per second of wall clock`})}):(0,F.jsx)(XB,{})})]}),(0,F.jsxs)(IB,{title:`Event loop`,sub:`queueing delay and how busy the loop is`,children:[(0,F.jsx)(zB,{title:T?`Event loop delay p99`:`Event loop delay`,trend:(0,F.jsx)(LB,{now:h?.elP99,prev:g?.elP99,unit:`pct`}),right:(0,F.jsx)(BB,{series:T?D:A}),children:(0,F.jsx)(HB,{releases:S,data:T?E(`elP99`):m,series:T?D:A,fmt:e=>B(e),yFmt:e=>`${Math.round(e)}ms`,onInspect:x})}),(0,F.jsx)(zB,{title:`Event loop utilization`,trend:(0,F.jsx)(LB,{now:h?.elu,prev:g?.elu,unit:`pp`}),right:(0,F.jsxs)(F.Fragment,{children:[T&&(0,F.jsx)(BB,{series:D}),(0,F.jsx)(RB,{value:h?.elu,color:UB.elu,fmt:GB})]}),children:(0,F.jsx)(HB,{releases:S,data:T?E(`elu`):m,series:T?D:[{key:`elu`,label:`Utilization`,color:UB.elu,kind:`area`}],fmt:GB,yFmt:KB})})]})]}):(0,F.jsx)(U,{}):(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No runtime samples in this window`,children:`The SDK samples every 15s by default (runtimeMetricsInterval).`})})]})}function XB(){return(0,F.jsx)(`div`,{className:`h-[220px] flex items-center justify-center text-center text-mute text-[12px] px-8`,children:JB})}function ZB(){let e=I(),t=P(`/api/metrics${e.q()}`,[e.tick]),n=[...new Set((t.data||[]).map(e=>e.name))],[r,i]=(0,v.useState)(``),a=r&&n.includes(r)?r:n[0]||``,o=P(a?`/api/metrics/${encodeURIComponent(a)}${e.q()}`:null,[e.tick,a]);if(t.error)return(0,F.jsx)(W,{error:t.error});if(!t.data)return(0,F.jsx)(U,{});let s=t.data.filter(e=>e.name===a),c=[],l=[];if(o.data){let e=new Map,t=o.data.series.length>8;o.data.series.slice(0,8).forEach((t,n)=>{for(let r of t.points)e.has(r.t)||e.set(r.t,{t:r.t}),e.get(r.t)[`s${n}`]=r.value}),c=[...e.values()].sort((e,t)=>e.t-t.t),l=o.data.series.slice(0,8).map((e,t)=>({key:`s${t}`,label:Object.entries(e.labels).map(([e,t])=>`${e}=${t}`).join(`, `)||a,color:zR[t],type:e.type===`counter`?`bar`:`line`,stack:e.type===`counter`?`c`:void 0})),t&&l.push()}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Hr,{size:18,className:`text-brand`}),title:`Custom metrics`,sub:(0,F.jsxs)(F.Fragment,{children:[`Counters, gauges and summaries your code reports: `,(0,F.jsxs)(`span`,{className:`mono`,children:[`obzerver.metrics.counter('orders_created', `,`{`,` channel `,`}`,`).inc()`]})]})}),n.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No custom metrics yet`,children:`Report business numbers with obzerver.metrics.counter / gauge / summary. They are aggregated in-process and flushed every 10s.`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-[240px_1fr] gap-3`,children:[(0,F.jsx)(H,{pad:!1,title:`Metrics`,children:(0,F.jsx)(`div`,{className:`py-1.5`,children:n.map(e=>{let n=t.data.find(t=>t.name===e).type;return(0,F.jsxs)(`button`,{onClick:()=>i(e),className:`w-full text-left px-3.5 py-2 flex items-center justify-between gap-2 ${e===a?`bg-[#1d1d27]`:`hover:bg-[#16161e]`}`,children:[(0,F.jsx)(`span`,{className:`mono text-[12px] truncate`,children:e}),(0,F.jsx)(`span`,{className:`pill !text-[10px]`,children:n})]},e)})})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(WR,{title:(0,F.jsx)(`span`,{className:`mono`,children:a}),sub:s[0]?.type===`counter`?`sum per bucket`:s[0]?.type===`gauge`?`last value per bucket`:`average per bucket`,series:l,children:o.data?(0,F.jsx)(UR,{data:c,series:l,height:260,fmt:e=>V(e)}):(0,F.jsx)(U,{})}),(0,F.jsx)(H,{title:`Series`,pad:!1,children:(0,F.jsxs)(`table`,{className:`tbl`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Labels`}),(0,F.jsx)(`th`,{children:`Application`}),(0,F.jsx)(`th`,{className:`num`,children:`Points`}),(0,F.jsx)(`th`,{className:`num`,children:`Average`})]})}),(0,F.jsx)(`tbody`,{children:s.map((e,t)=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`mono text-[12px]`,children:Object.entries(e.labels).map(([e,t])=>`${e}=${t}`).join(`, `)||`—`}),(0,F.jsx)(`td`,{className:`text-ink2`,children:e.service}),(0,F.jsx)(`td`,{className:`num`,children:V(e.points)}),(0,F.jsx)(`td`,{className:`num`,children:V(e.avg)})]},t))})]})})]})]})]})}var QB={regression:{kind:`crit`,label:`Regression`},changed:{kind:`warn`,label:`Changed`},clean:{kind:`good`,label:`Clean`},not_enough_data:{kind:`neutral`,label:`Not enough data`},baseline:{kind:`neutral`,label:`Baseline`}},$B=e=>e?new Date(e).toLocaleString(void 0,{weekday:`short`,year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZoneName:`short`}):``;function eV(){let e=I(),{data:t,error:n}=P(`/api/releases${e.q()}`,[e.tick]),[r]=zn(),[i,a]=(0,v.useState)(r.get(`version`)?{service:r.get(`service`)||``,version:r.get(`version`)}:null);if(n)return(0,F.jsx)(W,{error:n});if(!t)return(0,F.jsx)(U,{});let o=i||(t[0]?{service:t[0].service,version:t[0].version}:null);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(yi,{size:18,className:`text-brand`}),title:`Releases`,sub:(0,F.jsxs)(F.Fragment,{children:[`Each `,(0,F.jsx)(`span`,{className:`mono`,children:`serviceVersion`}),` compared with the one before it: 5xx rate, latency, new error groups, memory and CPU, and what changed in the code path.`]})}),t.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No releases yet`,children:`Set serviceVersion (or OBZERVER_VERSION / GIT_SHA) so every request is tagged with the release that served it.`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-[minmax(380px,40%)_1fr] gap-3 items-start`,children:[(0,F.jsx)(H,{pad:!1,children:(0,F.jsx)(Ba,{rows:t,rowKey:e=>e.service+e.version,onRow:e=>a({service:e.service,version:e.version}),cols:[{key:`v`,label:`Release`,render:e=>(0,F.jsxs)(`div`,{className:o&&o.service===e.service&&o.version===e.version?`text-brand2`:``,children:[(0,F.jsx)(`div`,{className:`mono font-medium`,children:e.version}),(0,F.jsx)(`div`,{className:`text-mute text-[11px]`,children:e.service})]})},{key:`verdict`,label:`Verdict`,render:e=>(0,F.jsx)(G,{kind:QB[e.verdict]?.kind||`neutral`,children:QB[e.verdict]?.label||e.verdict})},{key:`f`,label:`Deployed`,num:!0,render:e=>(0,F.jsx)(Ga,{tip:$B(e.first),className:`text-ink2`,children:xa(e.first)})},{key:`n`,label:`Requests`,num:!0,render:e=>V(e.requests)}]})}),o&&(0,F.jsx)(tV,{service:o.service,version:o.version})]})]})}function tV({service:e,version:t}){let n=L(),r=ht(),{data:i,error:a}=P(`/api/releases/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,[e,t]);if(a)return(0,F.jsx)(W,{error:a});if(!i)return(0,F.jsx)(U,{});let o=QB[i.verdict]||QB.baseline,s=i.previousStats,c=i.stats,l=e=>e===`query`?(0,F.jsx)(Rr,{size:12,style:{color:`#d95926`}}):e===`outbound`?(0,F.jsx)(Wr,{size:12,style:{color:`#e66767`}}):(0,F.jsx)(_r,{size:12,style:{color:`#d55181`}}),u=e=>({new:`New`,gone:`Gone`,more_frequent:`${e.multiplier}× more often`,less_frequent:`${e.multiplier}× as often`,slower:`${e.multiplier}× slower`})[e.change];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(H,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`span`,{className:`mono`,children:[e,`@`,t]}),(0,F.jsx)(G,{kind:o.kind,children:o.label})]}),sub:i.previous?`vs ${i.previous}`:void 0,children:[(0,F.jsx)(`div`,{className:`text-[13px] leading-relaxed`,children:i.summary}),s&&(0,F.jsxs)(`table`,{className:`tbl mt-3`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{}),(0,F.jsx)(`th`,{className:`num`,children:i.previous}),(0,F.jsx)(`th`,{className:`num`,children:t})]})}),(0,F.jsxs)(`tbody`,{children:[(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`Requests`}),(0,F.jsx)(`td`,{className:`num`,children:V(s.requests)}),(0,F.jsx)(`td`,{className:`num`,children:V(c.requests)})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`5xx rate`}),(0,F.jsx)(`td`,{className:`num`,children:ya(s.errorRate)}),(0,F.jsx)(`td`,{className:`num`,style:{color:c.errorRate>s.errorRate*1.5&&c.errorRate>.3?`#ff8a8a`:void 0},children:ya(c.errorRate)})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`p95`}),(0,F.jsx)(`td`,{className:`num`,children:B(s.p95)}),(0,F.jsx)(`td`,{className:`num`,style:{color:c.p95>s.p95*1.3?`#ffb38a`:void 0},children:B(c.p95)})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`Average`}),(0,F.jsx)(`td`,{className:`num`,children:B(s.avg)}),(0,F.jsx)(`td`,{className:`num`,children:B(c.avg)})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`Served from`}),(0,F.jsx)(`td`,{className:`num text-[11.5px]`,children:(0,F.jsx)(Ga,{tip:$B(s.first),children:Sa(s.first,!0)})}),(0,F.jsx)(`td`,{className:`num text-[11.5px]`,children:(0,F.jsx)(Ga,{tip:$B(c.first),children:Sa(c.first,!0)})})]}),(i.runtime||i.previousRuntime)&&(()=>{let e=i.previousRuntime||{},t=i.runtime||{},n=(e,t,n,r)=>e!=null&&t!=null&&t>e*n&&t-e>r,r=e=>e==null?`—`:`${e>0?`+`:``}${e.toFixed(1)} MB/h`,a=i.evidence?.some(e=>e.type===`memory_leak`);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`tr`,{children:(0,F.jsx)(`td`,{colSpan:3,className:`!pt-4 text-[10.5px] uppercase tracking-[.08em] text-mute`,children:`Runtime, per instance`})}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`Heap used`}),(0,F.jsx)(`td`,{className:`num`,children:e.heapUsed==null?`—`:`${V(e.heapUsed)} MB`}),(0,F.jsx)(`td`,{className:`num`,style:{color:n(e.heapUsed,t.heapUsed,1.3,20)?`#ffb38a`:void 0},children:t.heapUsed==null?`—`:`${V(t.heapUsed)} MB`})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,title:`Least-squares slope of heap used over the time each version served`,children:`Heap growth`}),(0,F.jsx)(`td`,{className:`num`,children:r(e.heapGrowth)}),(0,F.jsx)(`td`,{className:`num`,style:{color:a?`#ff8a8a`:void 0},children:r(t.heapGrowth)})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`RSS`}),(0,F.jsx)(`td`,{className:`num`,children:e.rss==null?`—`:`${V(e.rss)} MB`}),(0,F.jsx)(`td`,{className:`num`,children:t.rss==null?`—`:`${V(t.rss)} MB`})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:t.cpuUtil==null?`CPU`:`CPU utilization`}),(0,F.jsx)(`td`,{className:`num`,children:ya(e.cpuUtil??e.cpu)}),(0,F.jsx)(`td`,{className:`num`,style:{color:n(e.cpuUtil??e.cpu,t.cpuUtil??t.cpu,1.3,5)?`#ffb38a`:void 0},children:ya(t.cpuUtil??t.cpu)})]}),(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`text-mute`,children:`Event loop p99`}),(0,F.jsx)(`td`,{className:`num`,children:B(e.elP99)}),(0,F.jsx)(`td`,{className:`num`,style:{color:n(e.elP99,t.elP99,1.5,10)?`#ffb38a`:void 0},children:B(t.elP99)})]})]})})()]})]})]}),(i.evidence?.length>0||i.newErrors?.length>0)&&(0,F.jsxs)(H,{title:`Evidence`,children:[(0,F.jsx)(`ul`,{className:`flex flex-col gap-1.5 list-disc pl-4`,children:i.evidence.map((e,t)=>(0,F.jsx)(`li`,{children:e.text},t))}),i.newErrors.length>0&&(0,F.jsx)(`div`,{className:`mt-3 flex flex-col`,children:i.newErrors.map(e=>(0,F.jsxs)(`button`,{className:`text-left flex items-center gap-2 py-1.5 border-b border-[#1d1d26] last:border-0 hover:text-white`,onClick:()=>r(n(`/errors/${e.fingerprint}`)),children:[(0,F.jsx)(G,{kind:`serious`,children:`new`}),(0,F.jsx)(`span`,{className:`text-[#ff9b9b]`,children:e.class}),(0,F.jsx)(`span`,{className:`text-mute truncate`,children:e.message}),(0,F.jsx)(`span`,{className:`ml-auto tabular-nums`,children:V(e.count)})]},e.fingerprint))})]}),(0,F.jsx)(H,{title:`What changed in the code`,sub:`queries, outbound calls and methods per request, beyond noise`,pad:!1,children:(0,F.jsx)(Ba,{rows:i.changes||[],empty:(0,F.jsx)(Ma,{title:`No call-pattern changes detected`}),cols:[{key:`t`,label:`Call`,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2 min-w-0`,children:[l(e.type),(0,F.jsx)(`span`,{className:`mono text-[11.5px] truncate max-w-[420px]`,children:e.label})]})},{key:`c`,label:`Change`,render:e=>(0,F.jsx)(G,{kind:e.change===`gone`||e.change===`less_frequent`?`neutral`:e.change===`new`?`warn`:`serious`,children:u(e)})},{key:`p`,label:`Per request now`,num:!0,render:e=>e.perRequest==null?e.selfMs==null?`—`:`${B(e.selfMs)} self`:V(e.perRequest)}]})})]})}var nV=980,rV=160,iV=46;function aV(e){return e>5?`#d03b3b`:e>1?`#e07a7a`:`#199e70`}function oV(){let e=I(),t=L(),n=ht(),{data:r,error:i}=P(`/api/map${e.q()}`,[e.tick]),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=(0,v.useMemo)(()=>{if(!r)return null;let e=r.nodes,t=r.edges,n=e.filter(e=>e.type===`service`||e.type===`queue`),i=e.filter(e=>e.type===`database`||e.type===`external`),a=new Map;for(let e of n)a.set(e.id,e.type===`queue`?0:1);for(let e=0;e<n.length;e++)for(let e of t){if(!a.has(e.from)||!a.has(e.to))continue;let t=a.get(e.from)+1;a.get(e.to)<t&&a.set(e.to,t)}let o=[...new Set(a.values())].sort((e,t)=>e-t).map(e=>n.filter(t=>a.get(t.id)===e)),s=e=>o.length===1?nV/2:110+e*760/(o.length-1),c=new Map,l=0;o.forEach((e,t)=>e.forEach((e,n)=>{c.set(e.id,{x:s(t),y:60+n*90}),l=Math.max(l,60+n*90)}));let u=l+150,d=new Map;for(let e of i){let n=t.filter(t=>t.to===e.id).sort((e,t)=>t.calls-e.calls)[0],r=n?n.from:`none`;d.has(r)||d.set(r,[]),d.get(r).push(e)}let f=[...d.entries()].sort((e,t)=>(c.get(e[0])?.x??0)-(c.get(t[0])?.x??0)).flatMap(([,e])=>e);return f.forEach((e,t)=>{let n=Math.floor(t/5),r=Math.min(5,f.length-n*5),i=t%5,a=r*180;c.set(e.id,{x:(nV-a)/2+i*180+rV/2,y:u+n*80})}),{nodes:e,edges:t,pos:c,height:Math.max(...[...c.values()].map(e=>e.y),100)+70}},[r]);if(i)return(0,F.jsx)(W,{error:i});if(!r||!l)return(0,F.jsx)(U,{});let u=a||s,d=e=>!u||e===u||l.edges.some(t=>t.from===u&&t.to===e||t.to===u&&t.from===e),f=s?l.nodes.find(e=>e.id===s):null,p=Math.max(1,...l.edges.map(e=>e.calls)),m=e=>e===`service`?Ei:e===`database`?Rr:e===`queue`?qr:Wr;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(ci,{size:18,className:`text-brand`}),title:`Service map`,sub:`Drawn from real traffic: applications and queues left to right in call order, their databases and external hosts below. Line weight is volume; red means errors.`}),l.nodes.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`Nothing to draw yet`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-[1fr_300px] gap-3 items-start`,children:[(0,F.jsxs)(H,{pad:!1,children:[(0,F.jsxs)(`div`,{className:`flex gap-4 px-4 pt-3 text-[11.5px] text-ink2`,children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-4 h-[3px] rounded`,style:{background:`#199e70`}}),`healthy`]}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-4 h-[3px] rounded`,style:{background:`#e07a7a`}}),`> 1% errors`]}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-4 h-[3px] rounded`,style:{background:`#d03b3b`}}),`> 5% errors`]}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-4 border-t-2 border-dashed`,style:{borderColor:`#7a7a90`}}),`service → service (shared trace ids)`]})]}),(0,F.jsxs)(`svg`,{viewBox:`0 0 ${nV} ${l.height}`,className:`w-full`,style:{minHeight:360},onClick:()=>c(null),children:[l.edges.map(e=>{let t=l.pos.get(e.from),n=l.pos.get(e.to);if(!t||!n)return null;let r=n.y>t.y+40,i=r?t.x:t.x+rV/2,a=r?t.y+iV/2:t.y,o=r?n.x:n.x-rV/2,s=r?n.y-iV/2:n.y,c=r?`M${i},${a} C${i},${(a+s)/2} ${o},${(a+s)/2} ${o},${s}`:`M${i},${a} C${(i+o)/2},${a} ${(i+o)/2},${s} ${o},${s}`,d=1.2+4.5*Math.sqrt(e.calls/p),f=!u||e.from===u||e.to===u,m=aV(e.errorRate),h=e.from.startsWith(`svc:`)&&e.to.startsWith(`svc:`);return(0,F.jsxs)(`g`,{opacity:f?1:.12,children:[(0,F.jsx)(`path`,{d:c,fill:`none`,stroke:m,strokeOpacity:.55,strokeWidth:d,strokeDasharray:h?`8 6`:void 0}),(0,F.jsx)(`path`,{d:c,fill:`none`,stroke:`#ffffff`,strokeOpacity:.55,strokeWidth:Math.max(1,d/2.5),strokeLinecap:`round`,className:`flow`,style:{strokeDasharray:`1 23`,animationDuration:`${Math.max(.5,3-2.5*(e.calls/p))}s`}}),(0,F.jsxs)(`text`,{x:(i+o)/2,y:(a+s)/2-6,textAnchor:`middle`,fontSize:`11`,fill:`#9a9aab`,paintOrder:`stroke`,stroke:`#13131a`,strokeWidth:4,children:[V(e.calls),e.errorRate>0?` · ${ya(e.errorRate,1)}`:``]})]},e.from+e.to)}),l.nodes.map(e=>{let t=l.pos.get(e.id);if(!t)return null;let n=m(e.type),r=aV(e.errorRate),i=s===e.id;return(0,F.jsxs)(`g`,{transform:`translate(${t.x-rV/2},${t.y-iV/2})`,opacity:d(e.id)?1:.25,style:{cursor:`pointer`},onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(null),onClick:t=>{t.stopPropagation(),c(e.id)},children:[(0,F.jsx)(`rect`,{width:rV,height:iV,rx:10,fill:`#16161e`,stroke:i?`#ff3d7f`:e.type===`service`?r:`#33333f`,strokeWidth:i?2:1.4}),(0,F.jsx)(`foreignObject`,{x:10,y:14,width:18,height:18,children:(0,F.jsx)(n,{size:16,color:e.type===`service`?`#ececf1`:`#9a9aab`})}),(0,F.jsx)(`text`,{x:34,y:20,fontSize:`13`,fontWeight:`600`,fill:`#ececf1`,children:e.label.length>18?`${e.label.slice(0,17)}…`:e.label}),(0,F.jsx)(`text`,{x:34,y:36,fontSize:`11`,fill:`#82829a`,children:e.type===`service`?`${V(e.calls)} req · ${B(e.avg)}`:e.type===`queue`?`queue · ${V(e.calls)} jobs`:`${e.type===`database`?`database`:`external`} · ${V(e.calls)}`})]},e.id)})]})]}),(0,F.jsx)(H,{title:f?f.label:`Details`,sub:f?.type,children:f?(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(Ha,{items:[[`Calls`,V(f.calls)],[`Errors`,`${V(f.errors)} (${ya(f.errorRate)})`],...f.avg==null?[]:[[`Avg`,B(f.avg)]]]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute text-[11px] uppercase tracking-wider mb-1`,children:`Callers`}),l.edges.filter(e=>e.to===f.id).map(e=>(0,F.jsxs)(`div`,{className:`flex justify-between text-[12px] py-0.5`,children:[(0,F.jsx)(`span`,{children:l.nodes.find(t=>t.id===e.from)?.label}),(0,F.jsxs)(`span`,{className:`tabular-nums text-ink2`,children:[V(e.calls),` · `,B(e.avg)]})]},e.from)),!l.edges.some(e=>e.to===f.id)&&(0,F.jsx)(`div`,{className:`text-mute text-[12px]`,children:`—`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-mute text-[11px] uppercase tracking-wider mb-1`,children:`Calls out to`}),l.edges.filter(e=>e.from===f.id).map(e=>(0,F.jsxs)(`div`,{className:`flex justify-between text-[12px] py-0.5`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:l.nodes.find(t=>t.id===e.to)?.label}),(0,F.jsxs)(`span`,{className:`tabular-nums text-ink2`,children:[V(e.calls),` · `,B(e.avg)]})]},e.to)),!l.edges.some(e=>e.from===f.id)&&(0,F.jsx)(`div`,{className:`text-mute text-[12px]`,children:`—`})]}),f.type===`service`&&(0,F.jsx)(`button`,{className:`btn`,onClick:()=>n(t(`/requests?service=${encodeURIComponent(f.label)}`)),children:`View requests`}),f.type===`database`&&(0,F.jsx)(`button`,{className:`btn`,onClick:()=>n(t(`/queries`)),children:`View statements`})]}):(0,F.jsx)(`div`,{className:`text-mute text-[12.5px]`,children:`Hover a node to isolate its connections; click it for numbers.`})})]})]})}var sV={error_rate:[{key:`mode`,label:`Mode`,type:`select`,options:[`threshold`,`anomaly`]},{key:`threshold`,label:`Threshold (%) / anomaly floor`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`},{key:`minRequests`,label:`Minimum requests`,type:`number`}],p95_latency:[{key:`mode`,label:`Mode`,type:`select`,options:[`threshold`,`anomaly`]},{key:`threshold`,label:`Threshold (ms)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`},{key:`minRequests`,label:`Minimum requests`,type:`number`}],avg_latency:[{key:`threshold`,label:`Threshold (ms)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`},{key:`minRequests`,label:`Minimum requests`,type:`number`}],throughput:[{key:`op`,label:`Fire when`,type:`select`,options:[`<`,`>`]},{key:`threshold`,label:`Requests per minute`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}],job_failure_rate:[{key:`threshold`,label:`Threshold (%)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`},{key:`minRequests`,label:`Minimum runs`,type:`number`}],job_queue_wait:[{key:`threshold`,label:`p95 queue wait (ms)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}],silence:[{key:`windowMin`,label:`Silence tolerance (minutes)`,type:`number`,hint:`Never fires for a scope that has never reported.`}],job_silence:[{key:`windowMin`,label:`Silence tolerance (minutes)`,type:`number`}],log_pattern:[{key:`pattern`,label:`Message contains`,type:`text`},{key:`levels`,label:`Levels`,type:`levels`},{key:`logger`,label:`Logger / context`,type:`text`},{key:`threshold`,label:`Fire above N lines`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}],new_error_group:[],secret_leak:[],event_loop_delay:[{key:`threshold`,label:`p99 delay (ms)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}],memory:[{key:`threshold`,label:`RSS (MB)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}],cpu:[{key:`threshold`,label:`CPU (%)`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}],custom_metric:[{key:`metric`,label:`Metric name`,type:`text`},{key:`agg`,label:`Aggregation`,type:`select`,options:[`sum`,`avg`,`max`,`min`]},{key:`op`,label:`Fire when`,type:`select`,options:[`>`,`<`]},{key:`threshold`,label:`Threshold`,type:`number`},{key:`windowMin`,label:`Window (minutes)`,type:`number`}]},cV=new Set([`error_rate`,`p95_latency`,`avg_latency`,`throughput`,`job_failure_rate`,`job_queue_wait`,`silence`,`job_silence`]);function lV(){let e=I(),t=L(),[n]=zn(),r=P(`/api/alerts`,[e.tick]),i=P(`/api/alerts/events${n.get(`rule`)?`?rule=${n.get(`rule`)}`:``}`,[e.tick]),[a,o]=(0,v.useState)(null);if((0,v.useEffect)(()=>{N(`/api/alerts/events/read`,{method:`POST`}).then(()=>e.refresh()).catch(()=>{})},[]),r.error)return(0,F.jsx)(W,{error:r.error});if(!r.data)return(0,F.jsx)(U,{});let s=r.data.types,c=e=>s[e]?.unit||``,l=()=>{r.reload(),i.reload()};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(hr,{size:18,className:`text-brand`}),title:`Alerts`,sub:`Thresholds or anomaly detection against the metric's recent baseline. Evaluated every 30 seconds.`,right:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{className:`btn`,onClick:async()=>{await N(`/api/alerts/evaluate`,{method:`POST`}),l()},children:[(0,F.jsx)(fi,{size:13}),`Evaluate now`]}),(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>o({name:``,type:`error_rate`,params:{mode:`threshold`,threshold:5,windowMin:10,minRequests:20},channels:[{type:`inapp`}],enabled:!0,create_issue:!1}),children:[(0,F.jsx)(hi,{size:14}),`New rule`]})]})}),(0,F.jsx)(H,{pad:!1,title:`Rules`,children:(0,F.jsx)(Ba,{rows:r.data.rules,rowKey:e=>e.id,cols:[{key:`s`,label:`State`,render:e=>e.enabled?e.state===`firing`?(0,F.jsx)(G,{kind:`crit`,children:`firing`}):(0,F.jsx)(G,{kind:`good`,children:`ok`}):(0,F.jsx)(G,{kind:`neutral`,children:`disabled`})},{key:`n`,label:`Rule`,render:e=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.name}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[s[e.type]?.family,` · `,s[e.type]?.label,e.params.mode===`anomaly`?` · anomaly`:e.params.threshold!=null&&e.type!==`silence`?` ${e.params.op||`>`} ${e.params.threshold}${c(e.type)}`:``,e.params.windowMin?` over ${e.params.windowMin}m`:``,e.params.service?` · ${e.params.service}`:``,e.params.route?` ${e.params.route}`:``]})]})},{key:`v`,label:`Current`,num:!0,render:e=>e.type===`new_error_group`||e.type===`secret_leak`?(0,F.jsx)(`span`,{className:`text-mute`,children:`event`}):e.last_value==null?`—`:`${V(Math.round(e.last_value*100)/100)}${c(e.type)?` ${c(e.type)}`:``}`},{key:`c`,label:`Channels`,render:e=>(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[e.channels.map((e,t)=>(0,F.jsx)(`span`,{className:`pill`,children:e.type},t)),e.create_issue&&(0,F.jsx)(`span`,{className:`pill`,children:`issue`})]})},{key:`ch`,label:`Last change`,num:!0,render:e=>(0,F.jsx)(`span`,{className:`text-mute`,children:xa(e.last_change)})},{key:`a`,label:``,render:e=>(0,F.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Send test notification`,onClick:async()=>{dV((await N(`/api/alerts/${e.id}/test`,{method:`POST`})).deliveries)},children:(0,F.jsx)(Ti,{size:13})}),e.type===`slo_burn`?(0,F.jsx)(Nn,{className:`btn btn-ghost h-7 px-2 text-[11.5px]`,to:t(`/slos?id=${e.params.sloId}`),title:`Managed by its SLO`,children:`Edit SLO`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Edit`,onClick:()=>o(e),children:(0,F.jsx)(di,{size:13})}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Delete`,onClick:async()=>{fV(e.name)&&(await N(`/api/alerts/${e.id}`,{method:`DELETE`}),l())},children:(0,F.jsx)(Ii,{size:13})})]})]})}]})}),(0,F.jsx)(H,{pad:!1,title:`History`,sub:`state transitions with per-channel delivery`,children:i.data?(0,F.jsx)(Ba,{rows:i.data,empty:(0,F.jsx)(Ma,{title:`No alert events yet`}),maxHeight:480,cols:[{key:`t`,label:`Time`,render:e=>(0,F.jsx)(`span`,{className:`tabular-nums`,children:Sa(e.ts,!0)})},{key:`s`,label:`State`,render:e=>e.state===`firing`?(0,F.jsx)(G,{kind:`crit`,children:`firing`}):e.state===`resolved`?(0,F.jsx)(G,{kind:`good`,children:`resolved`}):(0,F.jsx)(G,{kind:`neutral`,children:e.state})},{key:`r`,label:`Rule`,render:e=>(0,F.jsx)(`span`,{className:`font-medium`,children:e.rule})},{key:`m`,label:`Message`,render:e=>(0,F.jsx)(`span`,{className:`text-ink2`,children:e.message})},{key:`d`,label:`Delivery`,render:e=>(0,F.jsx)(`div`,{className:`flex gap-1`,children:e.deliveries.map((e,t)=>(0,F.jsxs)(`span`,{className:`pill`,style:{color:e.ok?`#5fd38a`:`#ff8a8a`},title:e.error||String(e.status||``),children:[e.type,` `,e.ok?`✓`:`✕`]},t))})}]}):(0,F.jsx)(U,{})}),a&&(0,F.jsx)(pV,{rule:a,types:s,onClose:()=>o(null),onSaved:()=>{o(null),l()}})]})}function uV({value:e,onChange:t}){let{data:n}=P(`/api/settings`),r=L();return(0,F.jsx)(K,{label:`Email to`,hint:n&&!n.email.configured?(0,F.jsxs)(`span`,{children:[`Email is not configured yet. `,(0,F.jsx)(Nn,{className:`link`,to:r(`/integrations/email`),children:`Set up SMTP in Integrations`}),` first.`]}):`Comma-separated addresses`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`oncall@company.com, ops@company.com`,value:e,onChange:e=>t(e.target.value)})})}function dV(e){let t=e.length?e.map(e=>`${e.type}: ${e.ok?`delivered`:`failed ${e.error||e.status||``}`}`).join(`
113
113
  `):`No external channels configured (in-app only).`;window.alert(t)}function fV(e){return window.confirm(`Delete rule "${e}"?`)}function pV({rule:e,types:t,onClose:n,onSaved:r}){let i=I(),[a,o]=(0,v.useState)(JSON.parse(JSON.stringify(e))),[s,c]=(0,v.useState)(``),l=(e,t)=>o({...a,params:{...a.params,[e]:t}}),u=a.channels.find(e=>e.type===`webhook`)?.url||``,d=a.channels.find(e=>e.type===`slack`)?.url||``,f=a.channels.find(e=>e.type===`email`)?.to||``,p=e=>{let t=a.channels.filter(e=>e.type!==`email`);o({...a,channels:e.trim()?[...t,{type:`email`,to:e}]:t})},m=(e,t)=>{let n=a.channels.filter(t=>t.type!==e);o({...a,channels:t?[...n,{type:e,url:t}]:n})},h=a.params.mute||{};return(0,F.jsxs)(Ua,{open:!0,onClose:n,title:a.id?`Edit alert rule`:`New alert rule`,wide:!0,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Name`,children:(0,F.jsx)(`input`,{className:`input`,value:a.name,placeholder:t[a.type]?.label,onChange:e=>o({...a,name:e.target.value})})}),(0,F.jsx)(K,{label:`Type`,children:(0,F.jsx)(`select`,{className:`select`,value:a.type,onChange:e=>o({...a,type:e.target.value,params:{windowMin:10}}),children:Object.entries(t).filter(([e])=>e!==`slo_burn`).map(([e,t])=>(0,F.jsxs)(`option`,{value:e,children:[t.family,` — `,t.label]},e))})}),cV.has(a.type)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(K,{label:`Application (optional)`,children:(0,F.jsxs)(`select`,{className:`select`,value:a.params.service||``,onChange:e=>l(`service`,e.target.value||void 0),children:[(0,F.jsx)(`option`,{value:``,children:`All applications`}),i.meta?.services.map(e=>(0,F.jsx)(`option`,{children:e.id},e.id))]})}),(0,F.jsx)(K,{label:`Route / job (optional)`,hint:`e.g. "POST /checkout"`,children:(0,F.jsx)(`input`,{className:`input`,value:a.params.route||``,onChange:e=>l(`route`,e.target.value||void 0)})})]}),(sV[a.type]||[]).map(e=>(0,F.jsx)(K,{label:e.label,hint:e.hint,children:e.type===`select`?(0,F.jsx)(`select`,{className:`select`,value:a.params[e.key]??e.options[0],onChange:t=>l(e.key,t.target.value),children:e.options.map(e=>(0,F.jsx)(`option`,{children:e},e))}):e.type===`levels`?(0,F.jsx)(`div`,{className:`flex gap-2 h-[30px] items-center`,children:[`error`,`warn`,`info`,`debug`].map(e=>(0,F.jsxs)(`label`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:(a.params.levels||[]).includes(e),onChange:t=>l(`levels`,t.target.checked?[...a.params.levels||[],e]:(a.params.levels||[]).filter(t=>t!==e))}),e]},e))}):(0,F.jsx)(`input`,{className:`input`,type:e.type===`number`?`number`:`text`,value:a.params[e.key]??``,onChange:t=>l(e.key,e.type===`number`?t.target.value===``?void 0:Number(t.target.value):t.target.value)})},e.key))]}),(0,F.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-line grid grid-cols-2 gap-3`,children:[(0,F.jsx)(`div`,{className:`col-span-2 text-[12px] font-semibold`,children:`Notify`}),(0,F.jsx)(K,{label:`Slack incoming webhook URL`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`https://hooks.slack.com/services/…`,value:d,onChange:e=>m(`slack`,e.target.value)})}),(0,F.jsx)(K,{label:`Generic webhook URL`,hint:`POSTs JSON { rule, state, value, message, link }`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`https://…`,value:u,onChange:e=>m(`webhook`,e.target.value)})}),(0,F.jsx)(`div`,{className:`col-span-2`,children:(0,F.jsx)(uV,{value:f,onChange:e=>p(e)})}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:a.create_issue,onChange:e=>o({...a,create_issue:e.target.checked})}),`Open an issue when it fires`]}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:a.enabled,onChange:e=>o({...a,enabled:e.target.checked})}),`Enabled`]}),(0,F.jsxs)(`div`,{className:`col-span-2 flex items-center gap-2 text-[12.5px] flex-wrap`,children:[(0,F.jsx)(`span`,{className:`text-ink2`,children:`Mute daily (UTC) from`}),(0,F.jsx)(`input`,{className:`input w-16`,type:`number`,min:0,max:23,value:h.from??``,onChange:e=>l(`mute`,{...h,from:e.target.value===``?void 0:Number(e.target.value)})}),(0,F.jsx)(`span`,{className:`text-ink2`,children:`to`}),(0,F.jsx)(`input`,{className:`input w-16`,type:`number`,min:0,max:24,value:h.to??``,onChange:e=>l(`mute`,{...h,to:e.target.value===``?void 0:Number(e.target.value)})}),(0,F.jsx)(`span`,{className:`text-mute`,children:`hours (leave empty for no mute)`})]})]}),s&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] mt-3`,children:s}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:n,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:async()=>{try{let e={...a,channels:a.channels.some(e=>e.type===`inapp`)?a.channels:[{type:`inapp`},...a.channels]};a.id?await N(`/api/alerts/${a.id}`,{method:`PUT`,json:e}):await N(`/api/alerts`,{method:`POST`,json:e}),r()}catch(e){c(e.message)}},children:`Save rule`})]})]})}var mV={open:{kind:`crit`,label:`Open`},in_progress:{kind:`warn`,label:`In progress`},verifying:{kind:`serious`,label:`Verifying`},unverified:{kind:`neutral`,label:`Unverified`},resolved:{kind:`good`,label:`Resolved`},closed:{kind:`good`,label:`Closed`}},hV={critical:`#d03b3b`,high:`#ec835a`,medium:`#fab219`,low:`#82829a`};function gV(){let e=I(),t=L(),n=ht(),[r,i]=(0,v.useState)(`active`),[a,o]=(0,v.useState)(!1),{data:s,error:c}=P(`/api/issues`,[e.tick]);if(c)return(0,F.jsx)(W,{error:c});if(!s)return(0,F.jsx)(U,{});let l=s.filter(e=>r===`all`||(r===`active`?![`closed`,`resolved`].includes(e.status):[`closed`,`resolved`].includes(e.status)));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Mr,{size:18,className:`text-brand`}),title:`Issues`,sub:`Track what needs fixing. Issues linked to an error or route verify themselves against the next release and close or reopen automatically.`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>o(!0),children:[(0,F.jsx)(hi,{size:14}),`New issue`]})}),(0,F.jsx)(H,{pad:!1,title:(0,F.jsx)(za,{value:r,onChange:i,options:[{id:`active`,label:`Active`},{id:`done`,label:`Done`},{id:`all`,label:`All`}]}),children:(0,F.jsx)(`div`,{className:`pt-2`,children:(0,F.jsx)(Ba,{rows:l,onRow:e=>n(t(`/issues/${e.id}`)),empty:(0,F.jsx)(Ma,{title:`No issues`,children:`Create one from an error group, a failed execution, or let an alert open it.`}),cols:[{key:`id`,label:`#`,render:e=>(0,F.jsxs)(`span`,{className:`text-mute`,children:[`#`,e.id]}),width:50},{key:`t`,label:`Title`,render:e=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.title}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[e.service||`no service`,e.sourceType?` · from ${e.sourceType}`:``]})]})},{key:`s`,label:`Status`,render:e=>(0,F.jsx)(G,{kind:mV[e.status]?.kind||`neutral`,children:mV[e.status]?.label||e.status})},{key:`sev`,label:`Severity`,render:e=>(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 capitalize`,children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{background:hV[e.severity]}}),e.severity]})},{key:`tk`,label:`Ticket`,render:e=>e.ticket?(0,F.jsx)(tz,{ticket:e.ticket}):(0,F.jsx)(`span`,{className:`text-mute`,children:`—`})},{key:`o`,label:`Owner`,render:e=>e.owner||(0,F.jsx)(`span`,{className:`text-mute`,children:`unassigned`})},{key:`d`,label:`Due`,render:e=>e.due?(0,F.jsx)(`span`,{style:{color:e.due<Date.now()&&![`closed`,`resolved`].includes(e.status)?`#ff8a8a`:void 0},children:Sa(e.due,!0).split(` `).slice(0,2).join(` `)}):(0,F.jsx)(`span`,{className:`text-mute`,children:`—`})},{key:`u`,label:`Updated`,num:!0,render:e=>(0,F.jsx)(`span`,{className:`text-mute`,children:xa(e.updated)})}]})})}),a&&(0,F.jsx)(_V,{onClose:()=>o(!1),onCreated:e=>n(t(`/issues/${e}`))})]})}function _V({onClose:e,onCreated:t}){let n=I(),[r,i]=(0,v.useState)({title:``,severity:`medium`,owner:``,description:``,service:``,sourceType:``,sourceRef:``}),{settings:a,connected:o}=$R(),[s,c]=(0,v.useState)(null),l=s??(a?.autoCreate||``),[u,d]=(0,v.useState)(``);return(0,F.jsx)(Ua,{open:!0,onClose:e,title:`New issue`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(K,{label:`Title`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,value:r.title,onChange:e=>i({...r,title:e.target.value})})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Severity`,children:(0,F.jsx)(`select`,{className:`select`,value:r.severity,onChange:e=>i({...r,severity:e.target.value}),children:Object.keys(hV).map(e=>(0,F.jsx)(`option`,{children:e},e))})}),(0,F.jsx)(K,{label:`Owner`,children:(0,F.jsx)(`input`,{className:`input`,value:r.owner,onChange:e=>i({...r,owner:e.target.value})})}),(0,F.jsx)(K,{label:`Application`,children:(0,F.jsxs)(`select`,{className:`select`,value:r.service,onChange:e=>i({...r,service:e.target.value}),children:[(0,F.jsx)(`option`,{value:``,children:`—`}),n.meta?.services.map(e=>(0,F.jsx)(`option`,{children:e.id},e.id))]})}),(0,F.jsx)(K,{label:`Measurable route (optional)`,hint:`e.g. "POST /checkout" enables auto-verification`,children:(0,F.jsx)(`input`,{className:`input`,value:r.sourceRef,onChange:e=>i({...r,sourceRef:e.target.value,sourceType:e.target.value?`operation`:``})})})]}),(0,F.jsx)(K,{label:`Description`,children:(0,F.jsx)(`textarea`,{className:`input`,rows:4,value:r.description,onChange:e=>i({...r,description:e.target.value})})}),o.length>0&&(0,F.jsx)(K,{label:`Also create a ticket in`,children:(0,F.jsxs)(`select`,{className:`select w-56`,value:l,onChange:e=>c(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Don't create a ticket`}),o.map(e=>(0,F.jsx)(`option`,{value:e,children:QR[e]},e))]})}),u&&(0,F.jsx)(`div`,{className:`text-[12.5px] text-[#ff8a8a]`,children:u}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:e,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,disabled:!r.title,onClick:async()=>{let e=await N(`/api/issues`,{method:`POST`,json:{...r,tracker:l||void 0}});e.ticketError&&window.alert(`Issue #${e.id} was created, but the ticket was not: ${e.ticketError}`),t(e.id)},children:`Create`})]})]})})}var vV={fixed:{kind:`good`,label:`Fixed`},not_fixed:{kind:`crit`,label:`Not fixed`},too_early:{kind:`warn`,label:`Too early to tell`},not_enough_data:{kind:`neutral`,label:`Not enough data`}};function yV(){let{id:e}=yt(),t=I(),n=L(),r=ht(),{data:i,error:a,reload:o}=P(`/api/issues/${e}`,[e,t.tick]),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(``),{connected:p}=$R(),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(!1),y=async e=>{_(!0),h(null);try{h({ok:!0,text:await e()}),o()}catch(e){h({ok:!1,text:e.message})}finally{_(!1)}};if(a)return(0,F.jsx)(W,{error:a});if(!i)return(0,F.jsx)(U,{});let b=async n=>{await N(`/api/issues/${e}`,{method:`PATCH`,json:n}),o(),t.refresh()},x=i.incident,S=(t.meta?.versions||[]).filter(e=>!i.service||e.service===i.service).map(e=>e.version),C=[`Issue #${i.id}: ${i.title}`,`Status: ${i.status} · Severity: ${i.severity}${i.owner?` · Owner: ${i.owner}`:``}`,x?`Error: ${x.error}\nOperation: ${x.operation}\nStarted: ${new Date(x.start).toISOString()}${x.end?`\nEnded: ${new Date(x.end).toISOString()}`:``}\nIntroduced in: ${x.introducedIn||`unknown`}${i.fixVersion?`\nFixed in: ${i.fixVersion}`:``}\nOccurrences: ${x.occurrences}\nAffected users: ${x.users.length}${x.customers.length?`\nCustomers: ${x.customers.join(`, `)}`:``}`:``,`Timeline:`,...i.timeline.map(e=>`- ${new Date(e.ts).toISOString()} ${e.text}`)].filter(Boolean).join(`
114
- `),w=i.sourceType===`error`?`/errors/${i.sourceRef}`:i.sourceType===`execution`?`/executions/${i.sourceRef}`:i.sourceType===`alert`?`/alerts`:null;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(Nn,{to:n(`/issues`),className:`text-mute hover:text-ink text-[12px] -mb-2`,children:`← Issues`}),(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsxs)(`span`,{className:`text-mute text-[19px]`,children:[`#`,i.id]}),(0,F.jsx)(`h1`,{className:`text-[19px] font-semibold tracking-tight`,children:i.title})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,F.jsx)(G,{kind:mV[i.status]?.kind||`neutral`,children:mV[i.status]?.label||i.status}),(0,F.jsxs)(`span`,{className:`text-mute text-[12px]`,children:[`opened `,xa(i.created),i.sourceType?` from ${i.sourceType}`:``]}),w&&(0,F.jsx)(`button`,{className:`link text-[12px]`,onClick:()=>r(n(w)),children:`view source →`})]})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(Ra,{text:C,label:`Copy summary`}),[`open`,`in_progress`,`unverified`].includes(i.status)&&(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>b({status:`resolved`}),children:`Mark resolved`}),[`resolved`,`closed`,`verifying`].includes(i.status)&&(0,F.jsx)(`button`,{className:`btn`,onClick:()=>b({status:`open`}),children:`Reopen`})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`@5xl:col-span-2 flex flex-col gap-3`,children:[i.description&&(0,F.jsx)(H,{title:`Description`,children:(0,F.jsx)(`div`,{className:`whitespace-pre-wrap text-[13px]`,children:i.description})}),x&&(0,F.jsx)(H,{title:`Incident record`,children:(0,F.jsx)(Ha,{items:[[`Error`,(0,F.jsx)(`span`,{className:`text-[#ff9b9b]`,children:x.error})],[`Operation`,(0,F.jsx)(`span`,{className:`mono`,children:x.operation})],[`Started`,Sa(x.start,!0)],[`Ended`,x.end?Sa(x.end,!0):`ongoing`],[`Last seen`,xa(x.lastSeen)],[`Introduced in`,(0,F.jsx)(`span`,{className:`mono`,children:x.introducedIn||`—`})],[`Fixed in`,(0,F.jsx)(`span`,{className:`mono`,children:i.fixVersion||`—`})],[`Occurrences`,x.occurrences],[`Users affected`,x.users.length],[`Customers`,x.customers.join(`, `)||`—`]]})}),(0,F.jsxs)(H,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,F.jsx)(ki,{size:14}),`Did a release fix this?`]}),children:[(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,F.jsx)(K,{label:`Release`,children:(0,F.jsxs)(`select`,{className:`select w-48`,value:d,onChange:e=>f(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:i.fixVersion?`Fix version (${i.fixVersion})`:`Since resolution`}),[...new Set(S)].map(e=>(0,F.jsx)(`option`,{children:e},e))]})}),(0,F.jsx)(`button`,{className:`btn`,onClick:async()=>u(await N(`/api/issues/${e}/verify${d?`?version=${encodeURIComponent(d)}`:``}`)),children:`Check`}),d&&d!==i.fixVersion&&(0,F.jsx)(`button`,{className:`btn btn-ghost`,onClick:()=>b({fixVersion:d}),children:`Set as fix version`})]}),l&&(0,F.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(G,{kind:vV[l.verdict]?.kind||`neutral`,children:vV[l.verdict]?.label||l.verdict}),(0,F.jsx)(`span`,{className:`text-ink2`,children:l.reason})]}),l.newErrorGroupsInRelease>0&&(0,F.jsxs)(`div`,{className:`text-mute text-[12px]`,children:[`Note: `,l.newErrorGroupsInRelease,` new error group(s) appeared in that release.`]})]}),(0,F.jsx)(`div`,{className:`text-mute text-[11.5px] mt-3`,children:`Marking an issue with a measurable scope as resolved moves it to Verifying: it closes on its own once the fix holds, reopens if the failure returns, and becomes Unverified after 7 days without a conclusion.`})]}),(0,F.jsxs)(H,{title:`Timeline`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:[...i.timeline].reverse().map((e,t)=>(0,F.jsxs)(`div`,{className:`flex gap-3 text-[12.5px]`,children:[(0,F.jsx)(`span`,{className:`text-mute w-[130px] shrink-0 tabular-nums`,children:Sa(e.ts,!0)}),(0,F.jsx)(`span`,{children:e.text})]},t))}),(0,F.jsxs)(`form`,{className:`flex gap-2 mt-3`,onSubmit:e=>{e.preventDefault(),s&&(b({comment:s}),c(``))},children:[(0,F.jsx)(`input`,{className:`input flex-1`,placeholder:`Add a comment`,value:s,onChange:e=>c(e.target.value)}),(0,F.jsx)(`button`,{className:`btn`,children:`Comment`})]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(H,{title:`Ticket`,sub:i.ticket?`kept in step with this issue`:p.length?`track the work where your team works`:void 0,children:[i.ticket?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,F.jsx)(`div`,{children:(0,F.jsx)(tz,{ticket:i.ticket})}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[i.ticket.syncedAt?`Checked ${xa(i.ticket.syncedAt)}. `:``,`Closing it starts verification here; the result is posted on the ticket.`]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsxs)(`button`,{className:`btn h-7`,disabled:g,onClick:()=>y(async()=>(await N(`/api/issues/${e}/ticket/sync`,{method:`POST`}),`Synced.`)),children:[(0,F.jsx)(vi,{size:12}),`Sync now`]}),(0,F.jsxs)(`button`,{className:`btn btn-ghost h-7`,disabled:g,onClick:()=>y(async()=>window.confirm(`Unlink the ticket? It is not deleted.`)?(await N(`/api/issues/${e}/ticket`,{method:`DELETE`}),`Unlinked.`):`Kept.`),children:[(0,F.jsx)(Bi,{size:12}),`Unlink`]})]})]}):p.length?(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:p.map(t=>(0,F.jsxs)(`button`,{className:`btn`,disabled:g,onClick:()=>y(async()=>{let n=await N(`/api/issues/${e}/ticket`,{method:`POST`,json:{provider:t}});return`Created ${QR[t]} ${n.key}.`}),children:[`Create in `,QR[t]]},t))}):(0,F.jsxs)(`div`,{className:`text-mute text-[12.5px]`,children:[`Connect GitHub or Linear in `,(0,F.jsx)(`button`,{className:`link`,onClick:()=>r(n(`/integrations`)),children:`Integrations`}),` to open tickets from issues.`]}),m&&(0,F.jsx)(`div`,{className:`text-[12px] mt-2`,style:{color:m.ok?`#5fd38a`:`#ff8a8a`},children:m.text})]}),(0,F.jsx)(H,{title:`Details`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(K,{label:`Status`,children:(0,F.jsx)(`select`,{className:`select`,value:i.status,onChange:e=>b({status:e.target.value}),children:Object.entries(mV).map(([e,t])=>(0,F.jsx)(`option`,{value:e,children:t.label},e))})}),(0,F.jsx)(K,{label:`Severity`,children:(0,F.jsx)(`select`,{className:`select`,value:i.severity,onChange:e=>b({severity:e.target.value}),children:Object.keys(hV).map(e=>(0,F.jsx)(`option`,{children:e},e))})}),(0,F.jsx)(K,{label:`Owner`,children:(0,F.jsx)(`input`,{className:`input`,defaultValue:i.owner||``,onBlur:e=>e.target.value!==(i.owner||``)&&b({owner:e.target.value}),placeholder:`name or email`})}),(0,F.jsx)(K,{label:`Due date`,children:(0,F.jsx)(`input`,{className:`input`,type:`date`,defaultValue:i.due?new Date(i.due).toISOString().slice(0,10):``,onChange:e=>b({due:e.target.value?new Date(e.target.value).getTime():null})})}),(0,F.jsx)(Ha,{items:[[`Application`,i.service||`—`],[`Created`,Sa(i.created,!0)],[`Updated`,xa(i.updated)]]}),(0,F.jsx)(`button`,{className:`btn btn-ghost justify-center text-[#ff8a8a]`,onClick:async()=>{window.confirm(`Delete this issue?`)&&(await N(`/api/issues/${e}`,{method:`DELETE`}),r(n(`/issues`)))},children:`Delete issue`})]})})]})]})]})}var bV={healthy:{kind:`good`,label:`Healthy`},at_risk:{kind:`warn`,label:`At risk`},burning:{kind:`serious`,label:`Burning`},exhausted:{kind:`crit`,label:`Budget exhausted`},no_data:{kind:`neutral`,label:`No data`}},xV=e=>e==null?`#55556a`:e<=0?BR.crit:e<.25?BR.serious:e<.5?BR.warn:BR.good,SV=(e,t)=>e==null?void 0:e>t?`#ff8a8a`:e>1?`#ffc85a`:void 0,CV=e=>`${e.service||`all applications`}${e.operation?` · ${e.operation}`:``}${e.kind===`job`?` (jobs)`:``}`,wV=e=>`${e.kind===`job`?`runs succeed`:`requests succeed (non-5xx)`}${e.latencyMs?` and finish within ${e.latencyMs}ms`:``}`;function TV({value:e}){let t=e==null?0:Math.max(0,Math.min(1,e))*100;return(0,F.jsx)(`div`,{className:`h-1.5 rounded-full bg-[#24242e] overflow-hidden`,title:e==null?`no data`:`${(e*100).toFixed(1)}% budget left`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${t}%`,background:xV(e)}})})}function EV(){let e=I(),[t,n]=zn(),{data:r,error:i,reload:a}=P(`/api/slos`,[e.tick]),[o,s]=(0,v.useState)(null),c=Number(t.get(`id`))||r?.[0]?.slo.id||null,l=e=>{let r=new URLSearchParams(t);r.set(`id`,String(e)),n(r,{replace:!0})};return i?(0,F.jsx)(W,{error:i}):r?(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Fi,{size:18,className:`text-brand`}),title:`SLOs`,sub:`Service level objectives on real traffic: the share of good requests or job runs over a rolling window, the error budget left, and burn-rate alerts that fire before the budget runs out.`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>s({target:99.5,windowDays:7,kind:`http`,channels:[{type:`inapp`}]}),children:[(0,F.jsx)(hi,{size:14}),`New SLO`]})}),r.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No SLOs yet`,icon:(0,F.jsx)(Fi,{size:22}),children:`An SLO says how reliable something must be, e.g. 99.5% of checkout requests succeed over 7 days. Obzerver tracks the error budget and alerts on fast and slow burn.`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-[360px_1fr] gap-3 items-start`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,F.jsxs)(`button`,{onClick:()=>l(e.slo.id),className:`card text-left px-3.5 py-3 flex flex-col gap-2 ${c===e.slo.id?`!border-[#5a2340]`:`hover:border-line2`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium truncate`,children:e.slo.name}),(0,F.jsx)(G,{kind:bV[e.state].kind,children:bV[e.state].label})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px] truncate`,children:[CV(e.slo),` · `,e.slo.target,`% over `,e.slo.windowDays,`d`]}),(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`text-[18px] font-semibold tabular-nums`,children:e.sli==null?`—`:`${e.sli}%`}),(0,F.jsx)(`span`,{className:`text-[11.5px] tabular-nums`,style:{color:xV(e.budgetRemaining)},children:e.budgetRemaining==null?`no data`:`${(e.budgetRemaining*100).toFixed(1)}% budget left`})]}),(0,F.jsx)(TV,{value:e.budgetRemaining})]},e.slo.id))}),c&&(0,F.jsx)(DV,{id:c,onEdit:e=>s(e),onDeleted:()=>{let e=new URLSearchParams(t);e.delete(`id`),n(e),a()}})]}),o&&(0,F.jsx)(kV,{slo:o,onClose:()=>s(null),onSaved:e=>{s(null),a(),l(e)}})]}):(0,F.jsx)(U,{})}function DV({id:e,onEdit:t,onDeleted:n}){let r=I(),i=L(),{data:a,error:o}=P(`/api/slos/${e}`,[e,r.tick]);if(o)return(0,F.jsx)(W,{error:o});if(!a)return(0,F.jsx)(U,{});let s=a.slo,c=a.history.points,l=[[`5 minutes`,a.burn.m5,14.4],[`30 minutes`,a.burn.m30,6],[`1 hour`,a.burn.h1,14.4],[`6 hours`,a.burn.h6,6],[`1 day`,a.burn.d1,1]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 min-w-0`,children:[(0,F.jsx)(H,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s.name,(0,F.jsx)(G,{kind:bV[a.state].kind,children:bV[a.state].label})]}),right:(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>t(s),children:[(0,F.jsx)(di,{size:13}),`Edit`]}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Delete`,onClick:async()=>{window.confirm(`Delete SLO "${s.name}" and its burn alerts?`)&&(await N(`/api/slos/${s.id}`,{method:`DELETE`}),n())},children:(0,F.jsx)(Ii,{size:13})})]}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[s.description&&(0,F.jsx)(`div`,{className:`text-ink2`,children:s.description}),(0,F.jsxs)(`div`,{className:`text-[13px]`,children:[(0,F.jsxs)(`b`,{children:[s.target,`%`]}),` of `,s.operation?(0,F.jsx)(La,{name:s.operation}):(0,F.jsx)(`span`,{children:s.kind===`job`?`job runs`:`requests`}),` in `,(0,F.jsx)(`b`,{children:s.service||`all applications`}),` `,wV(s),`, over a rolling `,(0,F.jsxs)(`b`,{children:[s.windowDays,`-day`]}),` window.`]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 @3xl:grid-cols-4 gap-3`,children:[(0,F.jsx)(OV,{label:`Achieved`,value:a.sli==null?`—`:`${a.sli}%`,sub:`target ${s.target}%`,color:a.sli!=null&&a.sli<s.target?`#ff8a8a`:void 0}),(0,F.jsx)(OV,{label:`Error budget left`,value:a.budgetRemaining==null?`—`:`${(a.budgetRemaining*100).toFixed(1)}%`,color:xV(a.budgetRemaining),sub:(0,F.jsx)(TV,{value:a.budgetRemaining})}),(0,F.jsx)(OV,{label:`Bad events left`,value:a.budgetEventsLeft==null?`—`:V(Math.max(0,a.budgetEventsLeft)),sub:`${V(a.bad)} bad of ${V(a.total)}`}),(0,F.jsx)(OV,{label:`Burn rate (1h)`,value:a.burn.h1==null?`—`:`${a.burn.h1}×`,sub:`1× spends the budget exactly by window end`,color:SV(a.burn.h1,14.4)})]}),a.partialWindow&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-[#ffc85a]`,children:[(0,F.jsx)(zi,{size:13}),a.dataSince?`Data only goes back to ${Sa(a.dataSince,!0)}`:`No data yet`,`, so this window is partial.`,s.windowDays>a.retentionDays&&` Retention is ${a.retentionDays} days; raise OBZERVER_RETENTION_DAYS to cover the full ${s.windowDays}-day window.`]})]})}),(0,F.jsx)(WR,{title:`Error budget burn-down`,sub:`share of the window's budget still unspent`,children:(0,F.jsx)(UR,{data:c,series:[{key:`budget`,label:`Budget left`,color:zR[0],type:`area`}],height:190,fmt:e=>`${e.toFixed(1)}%`,refLines:[{y:0,label:`exhausted`,color:BR.crit}],zoom:!1})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @7xl:grid-cols-2 gap-3`,children:[(0,F.jsx)(WR,{title:`SLI per bucket`,sub:`good share per ${a.history.bucketMs>=864e5?`day`:a.history.bucketMs>=36e5?`${a.history.bucketMs/36e5}h`:`30m`}`,children:(0,F.jsx)(UR,{data:c,series:[{key:`sli`,label:`SLI`,color:zR[2],type:`line`}],height:170,fmt:e=>`${e.toFixed(2)}%`,refLines:[{y:s.target,label:`target ${s.target}%`,color:`#ff6b9d`}],yDomain:[`auto`,100],zoom:!1})}),(0,F.jsx)(H,{title:`Burn rates`,sub:`multiples of the sustainable rate`,children:(0,F.jsxs)(`table`,{className:`tbl`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Lookback`}),(0,F.jsx)(`th`,{className:`num`,children:`Burn rate`}),(0,F.jsx)(`th`,{className:`num`,children:`Error rate`})]})}),(0,F.jsx)(`tbody`,{children:l.map(([e,t,n])=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:e}),(0,F.jsx)(`td`,{className:`num`,style:{color:SV(t,n)},children:t==null?`—`:`${t}×`}),(0,F.jsx)(`td`,{className:`num text-ink2`,children:t==null?`—`:ya(t*(100-s.target))})]},e))})]})})]}),(0,F.jsxs)(H,{title:`Burn-rate alerts`,sub:`created and kept in step with this SLO`,pad:!1,children:[(0,F.jsx)(Ba,{rows:a.rules,cols:[{key:`s`,label:`State`,render:e=>e.state===`firing`?(0,F.jsx)(G,{kind:`crit`,children:`firing`}):(0,F.jsx)(G,{kind:`good`,children:`ok`})},{key:`n`,label:`Rule`,render:e=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{children:e.params.speed===`fast`?`Fast burn`:`Slow burn`}),(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:e.params.speed===`fast`?`over 14.4× on both the last 1h and 5m (about 2% of a 30-day budget in an hour)`:`over 6× on both the last 6h and 30m (about 5% of a 30-day budget in 6 hours)`})]})},{key:`v`,label:`Current`,num:!0,render:e=>e.last_value==null?`—`:`${e.last_value.toFixed(1)}×`},{key:`c`,label:`Notifies`,render:()=>(0,F.jsx)(`div`,{className:`flex gap-1`,children:s.channels.map((e,t)=>(0,F.jsx)(`span`,{className:`pill`,children:e.type},t))})}]}),a.events.length>0&&(0,F.jsx)(`div`,{className:`border-t border-line`,children:a.events.slice(0,8).map(e=>(0,F.jsxs)(`div`,{className:`flex gap-3 px-3.5 py-2 border-b border-[#1d1d26] last:border-0 text-[12px]`,children:[(0,F.jsx)(`span`,{className:`text-mute w-32 shrink-0`,children:xa(e.ts)}),e.state===`firing`?(0,F.jsx)(G,{kind:`crit`,children:`firing`}):(0,F.jsx)(G,{kind:`good`,children:e.state}),(0,F.jsx)(`span`,{className:`text-ink2 truncate`,children:e.message})]},e.id))}),(0,F.jsxs)(`div`,{className:`px-3.5 py-2 border-t border-line text-[11.5px] text-mute`,children:[`Delivery history is on `,(0,F.jsx)(Nn,{className:`link`,to:i(`/alerts`),children:`Alerts`}),`.`]})]})]})}function OV({label:e,value:t,sub:n,color:r}){return(0,F.jsxs)(`div`,{className:`rounded-lg border border-line px-3 py-2.5 flex flex-col gap-1`,children:[(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:e}),(0,F.jsx)(`div`,{className:`text-[20px] font-semibold tabular-nums leading-none`,style:r?{color:r}:void 0,children:t}),n&&(0,F.jsx)(`div`,{className:`text-mute text-[11px]`,children:n})]})}function kV({slo:e,onClose:t,onSaved:n}){let r=I(),[i,a]=(0,v.useState)({...e,channels:e.channels??[{type:`inapp`}]}),[o,s]=(0,v.useState)(``),c=P(`/api/operations?range=604800000&kind=${i.kind||`http`}${i.service?`&service=${encodeURIComponent(i.service)}`:``}`,[i.kind,i.service]),l=e=>i.channels?.find(t=>t.type===e),u=(e,t)=>{let n=(i.channels||[]).filter(t=>t.type!==e);a({...i,channels:t?[...n,{type:e,...t}]:n})};(0,v.useEffect)(()=>s(``),[i]);let d=async()=>{try{let e={...i,channels:[{type:`inapp`},...(i.channels||[]).filter(e=>e.type!==`inapp`)]};n((i.id?await N(`/api/slos/${i.id}`,{method:`PUT`,json:e}):await N(`/api/slos`,{method:`POST`,json:e})).id)}catch(e){s(e.message)}},f=i.target?100-i.target:null;return(0,F.jsxs)(Ua,{open:!0,onClose:t,title:i.id?`Edit SLO`:`New SLO`,wide:!0,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Name`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,placeholder:`Checkout availability`,value:i.name||``,onChange:e=>a({...i,name:e.target.value})})}),(0,F.jsx)(K,{label:`Measures`,children:(0,F.jsx)(za,{value:i.kind||`http`,onChange:e=>a({...i,kind:e,operation:null}),options:[{id:`http`,label:`HTTP requests`},{id:`job`,label:`Job runs`}]})}),(0,F.jsx)(K,{label:`Application`,children:(0,F.jsxs)(`select`,{className:`select`,value:i.service||``,onChange:e=>a({...i,service:e.target.value||null,operation:null}),children:[(0,F.jsx)(`option`,{value:``,children:`All applications`}),r.meta?.services.map(e=>(0,F.jsx)(`option`,{children:e.id},e.id))]})}),(0,F.jsxs)(K,{label:i.kind===`job`?`Job (optional)`:`Route (optional)`,hint:`leave empty to cover everything in the application`,children:[(0,F.jsx)(`input`,{className:`input mono`,list:`slo-ops`,placeholder:i.kind===`job`?`send-email`:`POST /checkout`,value:i.operation||``,onChange:e=>a({...i,operation:e.target.value||null})}),(0,F.jsx)(`datalist`,{id:`slo-ops`,children:[...new Set((c.data||[]).map(e=>e.name))].map(e=>(0,F.jsx)(`option`,{value:e},e))})]}),(0,F.jsx)(K,{label:`Target (% good)`,hint:f==null?void 0:`allows ${f.toFixed(3).replace(/0+$/,``).replace(/\.$/,``)}% bad events`,children:(0,F.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,F.jsx)(`input`,{className:`input w-28`,type:`number`,step:`0.01`,min:`1`,max:`99.999`,value:i.target??``,onChange:e=>a({...i,target:e.target.value===``?void 0:Number(e.target.value)})}),[99,99.5,99.9,99.95].map(e=>(0,F.jsx)(`button`,{type:`button`,className:`btn h-7 px-2 ${i.target===e?`btn-primary`:``}`,onClick:()=>a({...i,target:e}),children:e},e))]})}),(0,F.jsx)(K,{label:`Window`,children:(0,F.jsx)(za,{value:String(i.windowDays??7),onChange:e=>a({...i,windowDays:Number(e)}),options:[`1`,`7`,`14`,`28`,`30`].map(e=>({id:e,label:`${e}d`}))})}),(0,F.jsx)(K,{label:`Latency threshold (optional)`,hint:`if set, a successful event slower than this also counts as bad`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`input`,{className:`input w-32`,type:`number`,min:`1`,placeholder:`e.g. 800`,value:i.latencyMs??``,onChange:e=>a({...i,latencyMs:e.target.value===``?null:Number(e.target.value)})}),(0,F.jsx)(`span`,{className:`text-mute`,children:`ms`})]})}),(0,F.jsx)(K,{label:`Description (optional)`,children:(0,F.jsx)(`input`,{className:`input`,value:i.description||``,onChange:e=>a({...i,description:e.target.value||null})})})]}),(0,F.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-line grid grid-cols-2 gap-3`,children:[(0,F.jsx)(`div`,{className:`col-span-2 text-[12px] font-semibold`,children:`Burn-rate alerts notify`}),(0,F.jsx)(K,{label:`Slack incoming webhook URL`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`https://hooks.slack.com/services/…`,value:l(`slack`)?.url||``,onChange:e=>u(`slack`,e.target.value?{url:e.target.value}:null)})}),(0,F.jsx)(K,{label:`Generic webhook URL`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`https://…`,value:l(`webhook`)?.url||``,onChange:e=>u(`webhook`,e.target.value?{url:e.target.value}:null)})}),(0,F.jsx)(`div`,{className:`col-span-2`,children:(0,F.jsx)(uV,{value:l(`email`)?.to||``,onChange:e=>u(`email`,e.trim()?{to:e}:null)})})]}),o&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] mt-3`,children:o}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:t,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:d,children:`Save SLO`})]})]})}var AV={operational:{label:`Operational`,color:`#0ca30c`,kind:`good`},degraded:{label:`Degraded`,color:`#e6a100`,kind:`warn`},partial_outage:{label:`Partial outage`,color:`#ec835a`,kind:`serious`},major_outage:{label:`Major outage`,color:`#d03b3b`,kind:`crit`},no_data:{label:`No data`,color:`#3a3a48`,kind:`neutral`}},jV=[`investigating`,`identified`,`monitoring`,`resolved`],MV=e=>e[0].toUpperCase()+e.slice(1).replace(`_`,` `);function NV(){let e=I(),[t,n]=zn(),{data:r,error:i,reload:a}=P(`/api/status-pages`,[e.tick]),[o,s]=(0,v.useState)(null);if(i)return(0,F.jsx)(W,{error:i});if(!r)return(0,F.jsx)(U,{});let c=Number(t.get(`id`))||r[0]?.id||null,l=e=>{let r=new URLSearchParams(t);r.set(`id`,String(e)),n(r,{replace:!0})};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(_i,{size:18,className:`text-brand`}),title:`Status pages`,sub:`Public pages for your customers. Each component's status comes from its live traffic, and incidents can be posted by hand or opened automatically during an outage.`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>s({autoIncidents:!0,published:!0,components:[]}),children:[(0,F.jsx)(hi,{size:14}),`New status page`]})}),r.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No status pages yet`,icon:(0,F.jsx)(_i,{size:22}),children:`Create a page, map components like "Checkout" or "API" to your applications and routes, and share the public link.`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-[300px_1fr] gap-3 items-start`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,F.jsxs)(`button`,{onClick:()=>l(e.id),className:`card text-left px-3.5 py-3 flex flex-col gap-1.5 ${c===e.id?`!border-[#5a2340]`:`hover:border-line2`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium truncate`,children:e.title}),(0,F.jsx)(G,{kind:AV[e.overall].kind,children:AV[e.overall].label})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px] mono`,children:[`/status/`,e.slug,!e.published&&` · unpublished`]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[e.components.length,` component`,e.components.length===1?``:`s`,e.activeIncidents?` · ${e.activeIncidents} active incident${e.activeIncidents>1?`s`:``}`:``]})]},e.id))}),c&&(0,F.jsx)(PV,{id:c,onEdit:s,onDeleted:()=>{let e=new URLSearchParams(t);e.delete(`id`),n(e),a()},onChanged:a})]}),o&&(0,F.jsx)(LV,{page:o,onClose:()=>s(null),onSaved:e=>{s(null),a(),l(e)}})]})}function PV({id:e,onEdit:t,onDeleted:n,onChanged:r}){let i=I(),{data:a,error:o,reload:s}=P(`/api/status-pages/${e}`,[e,i.tick]),[c,l]=(0,v.useState)(null);if(o)return(0,F.jsx)(W,{error:o});if(!a)return(0,F.jsx)(U,{});let u=a.page,d=`${window.location.origin}/status/${u.slug}`,f=()=>{s(),r()},p=a.incidents.filter(e=>e.status!==`resolved`),m=a.incidents.filter(e=>e.status===`resolved`),h=e=>u.components.find(t=>t.id===e)?.name||`removed component`;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 min-w-0`,children:[(0,F.jsxs)(H,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[u.title,(0,F.jsx)(G,{kind:AV[a.overall].kind,children:AV[a.overall].label})]}),right:(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[(0,F.jsxs)(`a`,{className:`btn h-7`,href:`/status/${u.slug}`,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(zr,{size:13}),`Open public page`]}),(0,F.jsx)(Ra,{text:d,label:`Copy link`,className:`btn h-7`}),(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>t(u),children:[(0,F.jsx)(di,{size:13}),`Edit`]}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Delete`,onClick:async()=>{window.confirm(`Delete status page "${u.title}" and its incidents?`)&&(await N(`/api/status-pages/${u.id}`,{method:`DELETE`}),n())},children:(0,F.jsx)(Ii,{size:13})})]}),children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-1 text-[12.5px] text-ink2`,children:[(0,F.jsxs)(`span`,{children:[u.published?`Public at `:`Unpublished · `,(0,F.jsx)(`span`,{className:`mono`,children:d})]}),(0,F.jsxs)(`span`,{children:[`Automatic incidents: `,(0,F.jsx)(`b`,{children:u.autoIncidents?`on`:`off`})]})]}),u.description&&(0,F.jsx)(`div`,{className:`text-ink2 mt-2`,children:u.description})]}),(0,F.jsx)(H,{title:`Components`,sub:`status from the last 10 minutes of traffic; bars show the last 90 days`,pad:!1,children:a.components.length===0?(0,F.jsx)(Ma,{title:`No components`,children:`Edit the page to map components to applications and routes.`}):a.components.map(e=>(0,F.jsxs)(`div`,{className:`px-3.5 py-3 border-b border-[#1d1d26] last:border-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.name}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px] mono truncate`,children:[e.service,e.operation?` · ${e.operation}`:``,e.latencyMs?` · degraded above p95 ${e.latencyMs}ms`:``]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4 shrink-0 text-[12px]`,children:[(0,F.jsx)(`span`,{className:`text-mute tabular-nums`,children:e.live.requests?`${e.live.requests} req · ${ya(e.live.errorRate)} 5xx · p95 ${B(e.live.p95)}`:`no recent traffic`}),(0,F.jsx)(G,{kind:AV[e.status].kind,children:AV[e.status].label})]})]}),(0,F.jsx)(`div`,{className:`flex gap-[2px] h-6 mt-2`,children:e.days.map(e=>(0,F.jsx)(`span`,{className:`flex-1 rounded-[2px]`,style:{background:AV[e.status].color},title:`${new Date(e.day).toISOString().slice(0,10)}: ${AV[e.status].label}${e.requests?` · ${e.requests} req, ${ya(e.errorRate)} errors`:``}`},e.day))}),(0,F.jsxs)(`div`,{className:`flex justify-between text-mute text-[11px] mt-1`,children:[(0,F.jsx)(`span`,{children:`90 days ago`}),(0,F.jsx)(`span`,{children:e.uptime==null?``:`${e.uptime}% uptime`}),(0,F.jsx)(`span`,{children:`today`})]})]},e.id))}),(0,F.jsx)(H,{title:`Incidents`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary h-7`,disabled:!u.components.length,onClick:()=>l({impact:`minor`,status:`investigating`,components:[]}),children:[(0,F.jsx)(ii,{size:13}),`Post incident`]}),pad:!1,children:a.incidents.length===0?(0,F.jsx)(Ma,{title:`No incidents`,children:`Post one when something is wrong, or let automatic incidents handle outages.`}):(0,F.jsx)(`div`,{children:[...p,...m.slice(0,10)].map(e=>(0,F.jsx)(FV,{inc:e,name:h,onChanged:f},e.id))})}),c&&(0,F.jsx)(IV,{page:u,inc:c,onClose:()=>l(null),onSaved:()=>{l(null),f()}})]})}function FV({inc:e,name:t,onChanged:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(e.status===`resolved`?`resolved`:e.status),s=e.status!==`resolved`,c=async()=>{await N(`/api/incidents/${e.id}`,{method:`PATCH`,json:{status:a,message:r}}),i(``),n()},l=e.impact===`critical`?`crit`:e.impact===`major`?`serious`:`warn`;return(0,F.jsxs)(`div`,{className:`px-3.5 py-3 border-b border-[#1d1d26] last:border-0 flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,F.jsx)(`span`,{className:`font-medium truncate`,children:e.title}),(0,F.jsx)(G,{kind:s?l:`good`,children:s?`${e.impact} · ${e.status}`:`resolved`}),e.auto&&(0,F.jsx)(`span`,{className:`pill`,children:`automatic`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 text-mute text-[11.5px]`,children:[Sa(e.created,!0),e.resolvedAt&&` → ${Sa(e.resolvedAt,!0)}`,(0,F.jsx)(`button`,{className:`btn btn-ghost h-6 px-1.5`,title:`Delete`,onClick:async()=>{window.confirm(`Delete this incident? It disappears from the public page.`)&&(await N(`/api/incidents/${e.id}`,{method:`DELETE`}),n())},children:(0,F.jsx)(Wi,{size:12})})]})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[`Affects: `,e.components.map(t).join(`, `)||`—`]}),(0,F.jsx)(`div`,{className:`flex flex-col gap-1 border-l border-line2 pl-3`,children:[...e.updates].reverse().map((e,t)=>(0,F.jsxs)(`div`,{className:`text-[12.5px]`,children:[(0,F.jsx)(`b`,{className:`capitalize`,children:e.status}),` `,(0,F.jsxs)(`span`,{className:`text-ink2`,children:[`— `,e.text]}),` `,(0,F.jsx)(`span`,{className:`text-mute text-[11px]`,children:xa(e.ts)})]},t))}),s&&(0,F.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,F.jsx)(`select`,{className:`select`,value:a,onChange:e=>o(e.target.value),children:jV.map(e=>(0,F.jsx)(`option`,{value:e,children:MV(e)},e))}),(0,F.jsx)(`input`,{className:`input flex-1`,placeholder:a===`resolved`?`What fixed it (optional)`:`Post an update for customers`,value:r,onChange:e=>i(e.target.value)}),(0,F.jsx)(`button`,{className:`btn`,disabled:!r&&a===e.status,onClick:c,children:a===`resolved`?`Resolve`:`Post update`})]})]})}function IV({page:e,inc:t,onClose:n,onSaved:r}){let[i,a]=(0,v.useState)({title:t.title||``,impact:t.impact||`minor`,status:t.status||`investigating`,components:t.components||[],message:``}),[o,s]=(0,v.useState)(``),c=e=>a({...i,components:i.components.includes(e)?i.components.filter(t=>t!==e):[...i.components,e]});return(0,F.jsx)(Ua,{open:!0,onClose:n,title:`Post incident`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(K,{label:`Title`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,placeholder:`Checkout errors for some customers`,value:i.title,onChange:e=>a({...i,title:e.target.value})})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Impact`,hint:`minor = degraded, major = partial outage, critical = major outage`,children:(0,F.jsx)(za,{value:i.impact,onChange:e=>a({...i,impact:e}),options:[{id:`minor`,label:`Minor`},{id:`major`,label:`Major`},{id:`critical`,label:`Critical`}]})}),(0,F.jsx)(K,{label:`Status`,children:(0,F.jsx)(`select`,{className:`select`,value:i.status,onChange:e=>a({...i,status:e.target.value}),children:jV.filter(e=>e!==`resolved`).map(e=>(0,F.jsx)(`option`,{value:e,children:MV(e)},e))})})]}),(0,F.jsx)(K,{label:`Affected components`,children:(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.components.map(e=>(0,F.jsxs)(`label`,{className:`pill cursor-pointer !py-1 ${i.components.includes(e.id)?`!border-[#ff3d7f] !text-white`:``}`,children:[(0,F.jsx)(`input`,{type:`checkbox`,className:`hidden`,checked:i.components.includes(e.id),onChange:()=>c(e.id)}),e.name]},e.id))})}),(0,F.jsx)(K,{label:`First update (shown publicly)`,children:(0,F.jsx)(`textarea`,{className:`input`,rows:3,placeholder:`We are investigating elevated error rates on checkout.`,value:i.message,onChange:e=>a({...i,message:e.target.value})})}),o&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a]`,children:o}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:n,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,disabled:!i.title||!i.components.length,onClick:async()=>{try{await N(`/api/status-pages/${e.id}/incidents`,{method:`POST`,json:i}),r()}catch(e){s(e.message)}},children:`Post incident`})]})]})})}function LV({page:e,onClose:t,onSaved:n}){let r=I(),[i,a]=(0,v.useState)({...e,components:e.components??[]}),[o,s]=(0,v.useState)(``),c=i.components||[],l=(e,t)=>a({...i,components:c.map((n,r)=>r===e?{...n,...t}:n)});return(0,F.jsxs)(Ua,{open:!0,onClose:t,title:i.id?`Edit status page`:`New status page`,wide:!0,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Title`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,placeholder:`Acme Status`,value:i.title||``,onChange:e=>a({...i,title:e.target.value})})}),(0,F.jsx)(K,{label:`URL slug`,hint:`public at /status/${i.slug||(i.title||``).toLowerCase().replace(/[^\w]+/g,`-`)||`…`}`,children:(0,F.jsx)(`input`,{className:`input mono`,placeholder:`from the title`,value:i.slug||``,onChange:e=>a({...i,slug:e.target.value})})}),(0,F.jsx)(`div`,{className:`col-span-2`,children:(0,F.jsx)(K,{label:`Description (optional)`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`Live status of Acme's APIs and checkout`,value:i.description||``,onChange:e=>a({...i,description:e.target.value||null})})})}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i.published!==!1,onChange:e=>a({...i,published:e.target.checked})}),`Published (anyone with the link can view it)`]}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i.autoIncidents!==!1,onChange:e=>a({...i,autoIncidents:e.target.checked})}),`Open and resolve incidents automatically on outages`]})]}),(0,F.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-line flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-[12px] font-semibold`,children:`Components`}),(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>a({...i,components:[...c,{id:``,name:``,service:r.meta?.services[0]?.id||``,operation:null,latencyMs:null}]}),children:[(0,F.jsx)(hi,{size:13}),`Add component`]})]}),(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:`Customers only see the component name and its status. The application and route stay private.`}),c.length===0&&(0,F.jsx)(`div`,{className:`text-mute text-[12.5px] py-2`,children:`No components yet.`}),c.map((e,t)=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[1.2fr_1fr_1.2fr_110px_auto] gap-2 items-center`,children:[(0,F.jsx)(`input`,{className:`input`,placeholder:`Name, e.g. Checkout`,value:e.name,onChange:e=>l(t,{name:e.target.value})}),(0,F.jsxs)(`select`,{className:`select`,value:e.service,onChange:e=>l(t,{service:e.target.value}),children:[(0,F.jsx)(`option`,{value:``,children:`Application…`}),r.meta?.services.map(e=>(0,F.jsx)(`option`,{children:e.id},e.id))]}),(0,F.jsx)(`input`,{className:`input mono`,placeholder:`Route (optional)`,value:e.operation||``,onChange:e=>l(t,{operation:e.target.value||null})}),(0,F.jsx)(`input`,{className:`input`,type:`number`,placeholder:`p95 ms`,title:`Degraded when p95 is above this (optional)`,value:e.latencyMs??``,onChange:e=>l(t,{latencyMs:e.target.value===``?null:Number(e.target.value)})}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,onClick:()=>a({...i,components:c.filter((e,n)=>n!==t)}),children:(0,F.jsx)(Ii,{size:13})})]},t))]}),o&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] mt-3`,children:o}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:t,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:async()=>{try{n((i.id?await N(`/api/status-pages/${i.id}`,{method:`PUT`,json:i}):await N(`/api/status-pages`,{method:`POST`,json:i})).id)}catch(e){s(e.message)}},children:`Save page`})]})]})}var RV={good:Ar,warn:kr,bad:li,neutral:jr};function zV(e){if(!e)return``;let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.round(t/6e4);if(n<60)return`${n} minute${n===1?``:`s`} ago`;let r=Math.round(t/36e5);if(r<24)return`${r} hour${r===1?``:`s`} ago`;let i=Math.round(t/864e5);return i===1?`yesterday`:`${i} days ago`}function BV({n:e,title:t,right:n,children:r,className:i=``}){return(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-3.5 ${i}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsx)(`h2`,{className:`text-[16px] font-semibold tracking-tight`,children:t}),e!=null&&e>0&&(0,F.jsx)(`span`,{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full bg-[#22222d] text-ink2`,children:e}),(0,F.jsx)(`div`,{className:`flex-1`}),n]}),r]})}function VV({question:e,label:t=`Ask Obzeri`,className:n=`btn btn-ghost h-7 px-2 text-[12px]`}){return(0,F.jsxs)(`button`,{className:n,title:`Ask Obzeri: ${e}`,onClick:t=>{t.stopPropagation(),ir(e)},children:[(0,F.jsx)(Ni,{size:13,className:`text-brand`}),t]})}function HV({title:e,children:t}){return(0,F.jsxs)(`div`,{className:`tone-good rounded-xl px-4 py-5 flex items-center gap-3`,style:{background:`var(--tone-bg)`},children:[(0,F.jsx)(Ar,{size:22,style:{color:`var(--tone)`},className:`shrink-0`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium text-[14px]`,children:e}),t&&(0,F.jsx)(`div`,{className:`text-ink2 text-[12.5px] mt-0.5`,children:t})]})]})}var UV={"15m":`the last 15 minutes`,"1h":`the last hour`,"6h":`the last 6 hours`,"24h":`the last 24 hours`,"7d":`the last 7 days`,"30d":`the last 30 days`,custom:`the selected time`},WV={healthy:{tone:`good`,Icon:Ar},attention:{tone:`warn`,Icon:kr},broken:{tone:`bad`,Icon:li},idle:{tone:`neutral`,Icon:si},no_data:{tone:`neutral`,Icon:si}},GV={secret:Oi,silent:gi,error:yr,endpoint:Si,jobs:Ui,alert:hr,release:yi,new_errors:yr,traffic:Ri,speed:Hr,failures:lr};function KV(){let e=I(),{data:t,error:n}=P(`/api/simple${e.q()}`,[e.tick]);return n?(0,F.jsx)(W,{error:n}):t?t.health===`no_data`?(0,F.jsx)(Lz,{simple:!0}):(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsx)(qV,{d:t}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-5 gap-5 items-start`,children:[(0,F.jsxs)(`div`,{className:`@4xl:col-span-3 flex flex-col gap-5`,children:[(0,F.jsx)(ZV,{items:t.broke}),(0,F.jsx)(QV,{items:t.changed,basis:t.usualBasis})]}),(0,F.jsxs)(`div`,{className:`@4xl:col-span-2 flex flex-col gap-5`,children:[(0,F.jsx)(eH,{items:t.todo}),(0,F.jsx)(nH,{suggestions:t.suggestions})]})]})]}):(0,F.jsx)(U,{})}function qV({d:e}){let t=I(),n=WV[e.health];return(0,F.jsxs)(`section`,{className:`card tone-${n.tone} p-6 grid grid-cols-1 @4xl:grid-cols-[1fr_420px] gap-6`,style:{borderColor:`var(--tone-line)`,background:`linear-gradient(135deg, var(--tone-bg), transparent 55%), var(--color-panel)`},children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-[11.5px] uppercase tracking-wider font-semibold text-mute`,children:`Is my app healthy?`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(`div`,{className:`w-14 h-14 rounded-full flex items-center justify-center shrink-0 ${e.health===`healthy`?`health-orb`:``}`,style:{background:`var(--tone-bg)`,border:`1px solid var(--tone-line)`},children:(0,F.jsx)(n.Icon,{size:28,style:{color:`var(--tone)`}})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`h1`,{className:`text-[26px] font-semibold tracking-tight leading-tight`,children:e.headline}),(0,F.jsx)(`p`,{className:`text-ink2 text-[14px] mt-1 leading-relaxed`,children:e.summary})]})]}),(0,F.jsx)(YV,{points:e.timeline,bucketMs:e.bucketMs,label:UV[t.range]||`this period`})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 @2xl:@max-4xl:grid-cols-4 gap-3 content-start`,children:e.vitals.map(e=>(0,F.jsx)(JV,{v:e},e.id))})]})}function JV({v:e}){let t=RV[e.tone];return(0,F.jsxs)(`div`,{className:`tone-${e.tone} rounded-xl border border-line bg-[#111118] px-3.5 py-3 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12px] text-ink2 font-medium`,children:[(0,F.jsx)(t,{size:13,style:{color:`var(--tone)`}}),e.label]}),(0,F.jsx)(`div`,{className:`text-[22px] font-semibold tracking-tight mt-1 tabular-nums`,style:{color:e.tone===`bad`||e.tone===`warn`?`var(--tone)`:void 0},children:e.value}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute leading-snug mt-0.5`,children:e.note}),e.usual&&(0,F.jsx)(`div`,{className:`text-[11.5px] text-ink2 mt-1`,children:e.usual})]})}function YV({points:e,bucketMs:t,label:n}){if(!e.length)return null;let r=Math.max(1,...e.map(e=>e.count)),i=e=>e.count?e.failed/e.count>=.05?`#e05252`:e.failed/e.count>=.01?`#e8a92a`:`#36b56a`:`#2a2a35`,a=e.length*t;return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`flex items-end gap-[2px] h-[54px]`,children:e.map(e=>(0,F.jsx)(`div`,{className:`flex-1 rounded-[3px] min-w-[2px] hover:opacity-80`,style:{height:`${Math.max(8,e.count/r*100)}%`,background:i(e)},title:`${Sa(e.t,a>864e5)} · ${V(e.count)} requests${e.failed?` · ${V(e.failed)} failed`:``}`},e.t))}),(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-x-4 gap-y-1 text-[11px] text-mute mt-1.5`,children:[(0,F.jsx)(`span`,{className:`whitespace-nowrap`,children:n.charAt(0).toUpperCase()+n.slice(1)}),(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 whitespace-nowrap`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`i`,{className:`w-2 h-2 rounded-sm inline-block bg-[#36b56a]`}),`fine`]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`i`,{className:`w-2 h-2 rounded-sm inline-block bg-[#e8a92a]`}),`some failures`]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`i`,{className:`w-2 h-2 rounded-sm inline-block bg-[#e05252]`}),`many failures`]}),(0,F.jsx)(`span`,{children:`now`})]})]})]})}function XV({f:e,timeline:t}){let n=ht(),r=L(),i=GV[e.kind]||yr;return(0,F.jsxs)(`div`,{className:`tone-${e.tone} group flex items-start gap-3 rounded-xl px-3.5 py-3 border border-transparent ${e.link?`cursor-pointer hover:bg-[#181821] hover:border-line`:``}`,onClick:()=>e.link&&n(r(e.link)),children:[(0,F.jsx)(`div`,{className:`${t?`w-8 h-8`:`w-9 h-9`} rounded-lg flex items-center justify-center shrink-0`,style:{background:`var(--tone-bg)`},children:(0,F.jsx)(i,{size:t?15:17,style:{color:`var(--tone)`}})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[13.5px]`,children:e.title}),e.isNew&&(0,F.jsx)(`span`,{className:`text-[10.5px] font-semibold px-1.5 py-px rounded-full`,style:{color:`var(--tone)`,background:`var(--tone-bg)`},children:`NEW`})]}),(0,F.jsx)(`div`,{className:`text-ink2 text-[12.5px] mt-0.5 leading-relaxed break-words`,children:e.detail}),e.ts&&(0,F.jsx)(`div`,{className:`text-mute text-[11.5px] mt-1`,children:t?zV(e.ts):`last seen ${zV(e.ts)}`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 opacity-70 group-hover:opacity-100`,children:[e.ask&&(0,F.jsx)(VV,{question:e.ask,label:`Ask`}),e.link&&(0,F.jsx)(Er,{size:16,className:`text-mute`})]})]})}function ZV({items:e}){let[t,n]=(0,v.useState)(!1),r=t?e:e.slice(0,5);return(0,F.jsx)(BV,{title:`What broke?`,n:e.length,children:e.length===0?(0,F.jsx)(HV,{title:`Nothing is broken`,children:`No crashes, failing pages, leaks or firing alerts in this period.`}):(0,F.jsxs)(`div`,{className:`flex flex-col -mx-1.5`,children:[r.map(e=>(0,F.jsx)(XV,{f:e},e.id)),e.length>5&&(0,F.jsx)(`button`,{className:`btn btn-ghost self-start ml-1.5 mt-1`,onClick:()=>n(!t),children:t?`Show less`:`Show ${e.length-5} more`})]})})}function QV({items:e,basis:t}){return(0,F.jsx)(BV,{title:`What changed?`,n:e.length,right:t?(0,F.jsxs)(`span`,{className:`text-[11.5px] text-mute`,title:`Compared with ${t}`,children:[`vs a normal `,t.includes(`week`)?`week`:`day`]}):null,children:e.length===0?(0,F.jsxs)(`div`,{className:`text-ink2 text-[13px] px-1`,children:[`Nothing new: no deploys, no new kinds of errors, and traffic and speed look `,t?`like they usually do at this time`:`steady`,`.`]}):(0,F.jsx)(`div`,{className:`flex flex-col -mx-1.5`,children:e.map(e=>(0,F.jsx)(XV,{f:e,timeline:!0},e.id))})})}var $V={now:{label:`Do now`,tone:`bad`},soon:{label:`Soon`,tone:`warn`},later:{label:`When you can`,tone:`neutral`}};function eH({items:e}){let[t,n]=(0,v.useState)(e[0]?.id??null);return(0,F.jsx)(BV,{title:`What should I do?`,n:e.length,children:e.length===0?(0,F.jsx)(HV,{title:`Nothing to do right now`,children:`Go build something. We will tell you when that changes.`}):(0,F.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,r)=>(0,F.jsx)(tH,{t:e,n:r+1,open:t===e.id,onToggle:()=>n(t===e.id?null:e.id)},e.id))})})}function tH({t:e,n:t,open:n,onToggle:r}){let i=ht(),a=L(),o=$V[e.urgency];return(0,F.jsxs)(`li`,{className:`tone-${o.tone} rounded-xl border bg-[#111118] ${n?`border-line2`:`border-line`}`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-start gap-3 px-3.5 py-3 text-left`,onClick:r,"aria-expanded":n,children:[(0,F.jsx)(`span`,{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-semibold shrink-0 mt-px`,style:{background:`var(--tone-bg)`,color:`var(--tone)`},children:t}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[13.5px]`,children:e.title}),(0,F.jsx)(`span`,{className:`text-[10.5px] font-semibold uppercase tracking-wide`,style:{color:`var(--tone)`},children:o.label})]}),!n&&(0,F.jsx)(`span`,{className:`block text-mute text-[12px] truncate mt-0.5`,children:e.why})]}),n?(0,F.jsx)(wr,{size:15,className:`text-mute mt-1`}):(0,F.jsx)(Er,{size:15,className:`text-mute mt-1`})]}),n&&(0,F.jsxs)(`div`,{className:`px-3.5 pb-3.5 pl-[50px] flex flex-col gap-3`,children:[(0,F.jsx)(`div`,{className:`text-ink2 text-[12.5px] leading-relaxed`,children:e.why}),e.steps.length>0&&(0,F.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.steps.map((e,t)=>(0,F.jsxs)(`li`,{className:`flex gap-2 text-[12.5px]`,children:[(0,F.jsxs)(`span`,{className:`text-mute tabular-nums`,children:[t+1,`.`]}),(0,F.jsx)(`span`,{children:e})]},t))}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.executionId&&(0,F.jsx)(Ra,{className:`btn btn-primary h-8`,label:`Copy fix prompt`,text:async()=>(await N(`/api/executions/${e.executionId}/prompt`)).prompt}),e.link&&(0,F.jsxs)(`button`,{className:`btn h-8 ${e.executionId?``:`btn-primary`}`,onClick:()=>i(a(e.link)),children:[e.linkLabel||`Open`,(0,F.jsx)(Er,{size:13})]}),e.ask&&(0,F.jsx)(VV,{question:e.ask,className:`btn h-8`})]}),e.executionId&&(0,F.jsxs)(`div`,{className:`text-[11.5px] text-mute flex items-center gap-1.5`,children:[(0,F.jsx)(Hi,{size:12}),`The prompt has the error, the code around it and what happened, ready for Cursor, Claude Code or Copilot.`]})]})]})}function nH({suggestions:e}){let[t,n]=(0,v.useState)(``);return(0,F.jsxs)(BV,{title:`Ask Obzeri`,children:[(0,F.jsxs)(`form`,{className:`relative`,onSubmit:e=>{e.preventDefault(),t.trim()&&(ir(t.trim()),n(``))},children:[(0,F.jsx)(Ni,{size:15,className:`absolute left-3 top-1/2 -translate-y-1/2 text-brand`}),(0,F.jsx)(`input`,{dir:`auto`,className:`input w-full h-11 pl-9 pr-11 text-[13.5px] rounded-xl`,placeholder:`Ask anything about your app…`,value:t,onChange:e=>n(e.target.value)}),(0,F.jsx)(`button`,{className:`absolute right-1.5 top-1/2 -translate-y-1/2 btn btn-primary h-8 w-8 !p-0 justify-center rounded-lg`,disabled:!t.trim(),title:`Ask`,children:(0,F.jsx)(pr,{size:15})})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,F.jsx)(`button`,{className:`text-left rounded-full border border-line hover:border-line2 hover:bg-panel2 px-3 py-1.5 text-[12px] text-ink2 hover:text-ink max-w-full truncate`,title:e,onClick:()=>ir(e),children:e},e))}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:`Plain answers from your app's own data, in any language.`})]})}function rH(){let e=I(),{data:t,error:n,setData:r}=P(`/api/simple/alerts`,[e.tick]);if((0,v.useEffect)(()=>{N(`/api/alerts/events/read`,{method:`POST`}).then(()=>e.refresh()).catch(()=>{})},[]),n)return(0,F.jsx)(W,{error:n});if(!t)return(0,F.jsx)(U,{});let i=async e=>r(await N(`/api/simple/alerts`,{method:`PUT`,json:e}));return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(hr,{size:22,className:`text-brand`}),`Alerts`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Hear about problems before your users tell you.`})]}),(0,F.jsx)(iH,{firing:t.firing}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-5 gap-5 items-start`,children:[(0,F.jsxs)(`div`,{className:`@4xl:col-span-3 flex flex-col gap-5`,children:[(0,F.jsx)(BV,{title:`Tell me when…`,children:(0,F.jsx)(`div`,{className:`flex flex-col divide-y divide-[#1f1f29]`,children:t.presets.map(e=>(0,F.jsx)(oH,{p:e,onChange:t=>i({presets:{[e.id]:t}})},e.id))})}),(0,F.jsx)(cH,{events:t.events})]}),(0,F.jsx)(`div`,{className:`@4xl:col-span-2`,children:(0,F.jsx)(sH,{data:t,onSave:e=>i({channels:e})})})]})]})}function iH({firing:e}){let t=I(),n=ht(),r=L(),i=rr(),a=t.meta?.openSecrets||0;return!e.length&&!a?(0,F.jsx)(HV,{title:`All quiet right now`,children:`No alert is firing. The switches below decide what wakes you up.`}):(0,F.jsxs)(`section`,{className:`card tone-bad p-5 flex flex-col gap-2`,style:{borderColor:`var(--tone-line)`,background:`linear-gradient(135deg, var(--tone-bg), transparent 60%), var(--color-panel)`},children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 font-semibold text-[15px]`,children:[(0,F.jsx)(mr,{size:17,style:{color:`var(--tone)`}}),`Happening right now`]}),a>0&&(0,F.jsxs)(`button`,{className:`flex items-center gap-3 text-left rounded-lg px-2 py-2 hover:bg-[#1c1c25]`,onClick:()=>n(r(`/secrets`)),children:[(0,F.jsx)(Oi,{size:16,style:{color:`var(--tone)`}}),(0,F.jsxs)(`span`,{className:`flex-1 text-[13.5px]`,children:[a===1?`A secret is`:`${a} secrets are`,` being written to your logs`]}),(0,F.jsx)(Er,{size:15,className:`text-mute`})]}),e.map(e=>(0,F.jsxs)(`button`,{className:`flex items-center gap-3 text-left rounded-lg px-2 py-2 hover:bg-[#1c1c25]`,onClick:()=>i(`/alerts?rule=${e.id}`),children:[(0,F.jsx)(hr,{size:16,style:{color:`var(--tone)`}}),(0,F.jsx)(`span`,{className:`flex-1 text-[13.5px]`,children:e.name}),e.since&&(0,F.jsxs)(`span`,{className:`text-mute text-[12px]`,children:[`since `,zV(e.since)]}),(0,F.jsx)(Er,{size:15,className:`text-mute`})]},e.id))]})}function aH({on:e,onChange:t,label:n}){return(0,F.jsx)(`button`,{role:`switch`,"aria-checked":e,"aria-label":n,onClick:()=>t(!e),className:`relative w-[42px] h-[24px] rounded-full shrink-0 transition-colors`,style:{background:e?`linear-gradient(120deg, #ff3d7f, #a855f7)`:`#2c2c38`},children:(0,F.jsx)(`span`,{className:`absolute top-[3px] w-[18px] h-[18px] rounded-full bg-white shadow transition-[left]`,style:{left:e?21:3}})})}function oH({p:e,onChange:t}){let[n,r]=(0,v.useState)(!1);return(0,F.jsxs)(`div`,{className:`flex items-center gap-4 py-3.5`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[14px]`,children:e.label}),e.firing&&(0,F.jsx)(`span`,{className:`tone-bad text-[10.5px] font-semibold px-1.5 py-px rounded-full`,style:{color:`var(--tone)`,background:`var(--tone-bg)`},children:`FIRING`})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[12.5px] mt-0.5`,children:[e.description,e.lastFired?` · last time ${zV(e.lastFired)}`:``]})]}),(0,F.jsx)(aH,{on:e.enabled,label:e.label,onChange:async e=>{r(!0);try{await t(e)}finally{r(!1)}}}),n&&(0,F.jsx)(`span`,{className:`sr-only`,children:`saving`})]})}function sH({data:e,onSave:t}){let n=rr(),[r,i]=(0,v.useState)(e.channels.email),[a,o]=(0,v.useState)(e.channels.slack),[s,c]=(0,v.useState)(null),l=r!==e.channels.email||a!==e.channels.slack,u=!!(e.channels.email||e.channels.slack);return(0,F.jsxs)(BV,{title:`Where should we tell you?`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 text-[13px]`,children:[(0,F.jsx)(oi,{size:16,className:`text-mute`}),(0,F.jsx)(`span`,{className:`flex-1`,children:`In this dashboard`}),(0,F.jsx)(`span`,{className:`text-mute text-[12px]`,children:`always on`})]}),(0,F.jsxs)(`form`,{className:`flex flex-col gap-3.5`,onSubmit:async e=>{e.preventDefault();try{await t({email:r,slack:a}),c({ok:!0,text:`Saved.`})}catch(e){c({ok:!1,text:e.message})}},children:[(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,F.jsx)(ri,{size:15,className:`text-mute`}),`Email`]}),(0,F.jsx)(`input`,{className:`input h-9`,type:`text`,placeholder:`you@example.com`,value:r,onChange:e=>i(e.target.value),disabled:!e.emailReady&&!r}),!e.emailReady&&(0,F.jsxs)(`span`,{className:`text-[11.5px] text-mute`,children:[`Email needs a mail server first. `,(0,F.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>n(`/integrations/email`),children:`Set one up`})]})]}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,F.jsx)(Ai,{size:15,className:`text-mute`}),`Slack`]}),(0,F.jsx)(`input`,{className:`input h-9`,type:`url`,placeholder:`https://hooks.slack.com/services/…`,value:a,onChange:e=>o(e.target.value)}),(0,F.jsxs)(`a`,{className:`text-[11.5px] link inline-flex items-center gap-1 self-start`,href:`https://api.slack.com/messaging/webhooks`,target:`_blank`,rel:`noreferrer`,children:[`How to get a Slack webhook`,(0,F.jsx)(zr,{size:11})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`button`,{className:`btn btn-primary h-9`,disabled:!l,children:`Save`}),(0,F.jsxs)(`button`,{type:`button`,className:`btn h-9`,disabled:!u||l,title:l?`Save first`:void 0,onClick:async()=>{c(null);try{let e=(await N(`/api/simple/alerts/test`,{method:`POST`})).deliveries.filter(e=>e.type!==`inapp`&&!e.ok);c(e.length?{ok:!1,text:`Could not reach ${e.map(e=>`${e.type}${e.error?` (${e.error})`:``}`).join(`, `)}`}:{ok:!0,text:`Test sent. Check your inbox or Slack.`})}catch(e){c({ok:!1,text:e.message})}},children:[(0,F.jsx)(Ti,{size:13}),`Send a test`]})]}),s&&(0,F.jsxs)(`div`,{className:`text-[12.5px] flex items-center gap-1.5 ${s.ok?`text-[#5ad17a]`:`text-[#ff8a8a]`}`,children:[s.ok&&(0,F.jsx)(Ar,{size:13}),s.text]})]}),(0,F.jsxs)(`div`,{className:`text-[11.5px] text-mute border-t border-line pt-3`,children:[`Webhooks, Discord, per-route rules and quiet hours are in `,(0,F.jsx)(`button`,{className:`link`,onClick:()=>n(`/alerts`),children:`Advanced → Alerts`}),`.`]})]})}function cH({events:e}){let[t,n]=(0,v.useState)(!1),r=t?e:e.slice(0,8);return(0,F.jsx)(BV,{title:`Recent alerts`,n:e.length,children:e.length===0?(0,F.jsx)(`div`,{className:`text-ink2 text-[13px]`,children:`Nothing has fired yet.`}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[r.map(e=>{let t=e.state===`firing`?`bad`:`good`;return(0,F.jsxs)(`div`,{className:`tone-${t} flex items-start gap-3 px-1 py-2`,children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full mt-[7px] shrink-0`,style:{background:`var(--tone)`}}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`text-[13px]`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e.rule}),` `,(0,F.jsxs)(`span`,{className:`text-mute`,children:[`· `,e.state===`firing`?`went off`:`back to normal`,` `,zV(e.ts)]})]}),(0,F.jsx)(`div`,{className:`text-ink2 text-[12px] mt-0.5 break-words`,children:e.message})]})]},e.id)}),e.length>8&&(0,F.jsx)(`button`,{className:`btn btn-ghost self-start`,onClick:()=>n(!t),children:t?`Show less`:`Show ${e.length-8} more`})]})})}function lH(){let e=I(),t=rr(),n=P(`/api/overview${e.q()}`,[e.tick]),r=P(`/api/runtime${e.q()}`,[e.tick]),i=P(`/api/metrics${e.q()}`,[e.tick]);if(n.error)return(0,F.jsx)(W,{error:n.error});if(!n.data)return(0,F.jsx)(U,{});let a=n.data,o=a.kpis,s=o.usual&&o.usual.requests>=50?o.usual:null,c=KR(a.series.points,a.band),l=qR(a.band),u=UV[e.range]||`this period`,d=[{key:`count`,label:`Requests`,color:zR[0],type:`bar`},...l?[{...l.calls,label:`Usual`}]:[]],f=[...l?[{...l.p95,label:`Normal range`}]:[],{key:`p95`,label:`Slowest 5%`,color:zR[1],type:`line`},{key:`avg`,label:`Average`,color:zR[2],type:`line`}],p=[{key:`s5xx`,label:`Failed (server errors)`,color:BR.crit,type:`bar`,stack:`e`},{key:`s4xx`,label:`Rejected (bad requests)`,color:BR.warn,type:`bar`,stack:`e`}],m=new Map;for(let e of r.data||[])for(let t of e.points){let e=m.get(t.t)||{t:t.t,cpu:null,mem:null};t.cpuUtil!=null&&(e.cpu=Math.max(e.cpu??0,t.cpuUtil)),t.memUtil!=null&&(e.mem=Math.max(e.mem??0,t.memUtil)),m.set(t.t,e)}let h=[...m.values()].sort((e,t)=>e.t-t.t),g=h[h.length-1],_=[{key:`cpu`,label:`CPU`,color:zR[0],type:`line`},{key:`mem`,label:`Memory`,color:zR[6],type:`line`}],v=Math.max(g?.cpu??0,g?.mem??0),y=s?.requests?o.requests/s.requests:null,b=s?.p95&&o.p95?o.p95/s.p95:null,x=o.requests>=20&&o.failureRate>=5?`bad`:o.failureRate>=1&&o.failed>=3?`warn`:`good`,S=[...new Set((i.data||[]).map(e=>e.name))];return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(Sr,{size:22,className:`text-brand`}),`Metrics`]}),(0,F.jsxs)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:[`How your app did over `,u,s?`, next to what is normal for this time`:``,`.`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-2 gap-5`,children:[(0,F.jsx)(uH,{title:`Traffic`,what:`How many requests your app handled.`,value:V(o.requests),unit:`requests`,status:y==null?{tone:`neutral`,text:o.rpm?`About ${V(o.rpm)} a minute`:`No requests yet`}:y>=1.5?{tone:`neutral`,text:`${y.toFixed(1)}× busier than usual`}:y<=.67?{tone:`warn`,text:`${Math.round((1-y)*100)}% quieter than usual`}:{tone:`good`,text:`About as busy as usual`},series:d,children:(0,F.jsx)(UR,{data:c,series:d,height:190,zoom:!1,fmt:e=>V(e)})}),(0,F.jsx)(uH,{title:`Speed`,what:`How long requests take. Lower is better; the slowest 5% is what unhappy users feel.`,value:B(o.p95),unit:`slowest 5%`,status:o.p95==null?{tone:`neutral`,text:`Nothing to time yet`}:b!=null&&b>=1.4?{tone:`warn`,text:`Slower than usual (normally ${B(s.p95)})`}:o.p95>=1500?{tone:`warn`,text:`On the slow side`}:{tone:`good`,text:s?.p95?`Normal (usually ${B(s.p95)})`:`Fast`},series:f,children:(0,F.jsx)(UR,{data:c,series:f,height:190,zoom:!1,fmt:e=>B(e),yFmt:e=>e>=1e3?`${+(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`})}),(0,F.jsx)(uH,{title:`Errors`,what:`Requests that failed because of your server (red), and requests your app rejected, like a wrong password or a missing page (yellow).`,value:ya(o.failureRate),unit:`failed`,status:{tone:x,text:o.failed?`${V(o.failed)} failed, ${V(o.clientErrors)} rejected`:`No server errors`},series:p,children:(0,F.jsx)(UR,{data:c,series:p,height:190,zoom:!1,fmt:e=>V(e)})}),(0,F.jsx)(uH,{title:`Server load`,what:`How much of its CPU and memory your app uses. Near 100% it slows down or restarts.`,value:g?`${Math.round(v)}%`:`—`,unit:`busiest`,status:g?v>=90?{tone:`bad`,text:`Close to the limit`}:v>=75?{tone:`warn`,text:`Busy`}:{tone:`good`,text:`Plenty of room`}:{tone:`neutral`,text:`No server stats yet`},series:_,children:r.data?(0,F.jsx)(UR,{data:h,series:_,height:190,zoom:!1,fmt:e=>`${Math.round(e)}%`,yDomain:[0,`auto`]}):(0,F.jsx)(U,{})})]}),S.length>0&&(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-[16px] font-semibold`,children:`Your own numbers`}),(0,F.jsx)(`span`,{className:`text-mute text-[12.5px]`,children:`counters and gauges your code reports`})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 @lg:grid-cols-3 @5xl:grid-cols-4 gap-3`,children:S.slice(0,12).map(e=>{let n=(i.data||[]).filter(t=>t.name===e),r=n.reduce((e,t)=>e+(t.type===`counter`?t.count??0:0),0);return(0,F.jsxs)(`button`,{className:`text-left rounded-xl border border-line hover:border-line2 bg-[#111118] px-3.5 py-3 group`,onClick:()=>t(`/metrics`),children:[(0,F.jsx)(`div`,{className:`mono text-[11.5px] text-ink2 truncate`,children:e}),(0,F.jsx)(`div`,{className:`text-[20px] font-semibold mt-1 tabular-nums`,children:n[0]?.type===`counter`?V(r):V(n[0]?.avg)}),(0,F.jsxs)(`div`,{className:`text-[11px] text-mute flex items-center gap-1`,children:[n[0]?.type===`counter`?`total`:`average`,(0,F.jsx)(Er,{size:11,className:`opacity-0 group-hover:opacity-100`})]})]},e)})})]})]})}function uH({title:e,what:t,value:n,unit:r,status:i,series:a,children:o}){let s=RV[i.tone];return(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-3 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`text-[16px] font-semibold`,children:e}),(0,F.jsx)(`p`,{className:`text-mute text-[12.5px] mt-0.5 leading-snug`,children:t})]}),(0,F.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,F.jsx)(`div`,{className:`text-[24px] font-semibold tabular-nums leading-tight`,children:n}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:r})]})]}),(0,F.jsxs)(`div`,{className:`tone-${i.tone} flex items-center gap-1.5 text-[12.5px] font-medium`,style:{color:`var(--tone)`},children:[(0,F.jsx)(s,{size:14}),i.text]}),o,(0,F.jsx)(HR,{series:a})]})}var dH=[{id:`all`,label:`Everything`,levels:``},{id:`problems`,label:`Problems only`,levels:`warn,error,fatal`},{id:`errors`,label:`Errors only`,levels:`error,fatal`}],fH={fatal:{word:`Error`,color:`#ff7a7a`,bg:`rgba(208,59,59,.14)`},error:{word:`Error`,color:`#ff7a7a`,bg:`rgba(208,59,59,.14)`},warn:{word:`Warning`,color:`#f5c04e`,bg:`rgba(250,178,25,.12)`},info:{word:`Info`,color:`#7fb2f0`,bg:`rgba(57,135,229,.12)`},debug:{word:`Debug`,color:`#9a9ab0`,bg:`rgba(130,130,154,.12)`},trace:{word:`Debug`,color:`#9a9ab0`,bg:`rgba(130,130,154,.12)`}};function pH(){let e=I(),[t,n]=zn(),[r,i]=(0,v.useState)(t.get(`q`)||``),a=dH.find(e=>e.id===t.get(`show`))??dH[0],{data:o,error:s}=P(`/api/logs${e.q({q:t.get(`q`)||``,level:a.levels,limit:300})}`,[e.tick]),c=(e,t)=>{let r=new URLSearchParams(window.location.search);t?r.set(e,t):r.delete(e),n(r,{replace:!0})},l={all:0,error:0,warn:0};for(let e of o?.series||[]){for(let t of[`error`,`fatal`,`warn`,`info`,`debug`,`trace`])l.all+=e[t]||0;l.error+=(e.error||0)+(e.fatal||0),l.warn+=e.warn||0}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(Ci,{size:22,className:`text-brand`}),`Logs`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Everything your app printed, newest first. Each line knows which request wrote it.`})]}),(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsxs)(`form`,{className:`relative flex-1 min-w-[240px]`,onSubmit:e=>{e.preventDefault(),c(`q`,r.trim())},children:[(0,F.jsx)(wi,{size:15,className:`absolute left-3 top-1/2 -translate-y-1/2 text-mute`}),(0,F.jsx)(`input`,{className:`input w-full h-10 pl-9 pr-9 text-[13.5px] rounded-xl`,placeholder:`Search your logs, then press Enter`,value:r,onChange:e=>i(e.target.value)}),t.get(`q`)&&(0,F.jsx)(`button`,{type:`button`,className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-mute hover:text-ink`,title:`Clear`,onClick:()=>{i(``),c(`q`,``)},children:(0,F.jsx)(Wi,{size:15})})]}),(0,F.jsx)(`div`,{className:`seg seg-lg`,children:dH.map(e=>(0,F.jsx)(`button`,{className:a.id===e.id?`on`:``,onClick:()=>c(`show`,e.id===`all`?``:e.id),children:e.label},e.id))})]}),o&&(0,F.jsxs)(`div`,{className:`text-[12.5px] text-ink2`,children:[V(l.all),` line`,l.all===1?``:`s`,` in `,UV[e.range]||`this period`,l.error>0&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsxs)(`span`,{className:`text-[#ff8a8a]`,children:[V(l.error),` error`,l.error===1?``:`s`]})]}),l.warn>0&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsxs)(`span`,{className:`text-[#f5c04e]`,children:[V(l.warn),` warning`,l.warn===1?``:`s`]})]}),t.get(`q`)&&(0,F.jsxs)(F.Fragment,{children:[` · matching “`,t.get(`q`),`”`]})]}),s?(0,F.jsx)(W,{error:s}):o?o.logs.length===0?(0,F.jsx)(`div`,{className:`text-center text-ink2 py-12 text-[13.5px]`,children:t.get(`q`)||a.levels?`Nothing matches. Try another word or show everything.`:`No logs in this period. console.log and pino output shows up here automatically.`}):(0,F.jsx)(`div`,{className:`flex flex-col -mx-2`,children:o.logs.map(e=>(0,F.jsx)(mH,{l:e},e.id))}):(0,F.jsx)(U,{})]})]})}function mH({l:e}){let[t,n]=(0,v.useState)(!1),r=ht(),i=L(),a=fH[e.level]||fH.info;return(0,F.jsxs)(`div`,{className:`rounded-lg ${t?`bg-[#16161e]`:`hover:bg-[#15151c]`}`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-start gap-3 px-2 py-2 text-left`,onClick:()=>n(!t),children:[(0,F.jsx)(`span`,{className:`text-mute text-[12px] tabular-nums shrink-0 w-[62px] pt-px`,title:zV(e.ts),children:Sa(e.ts)}),(0,F.jsx)(`span`,{className:`text-[11px] font-semibold px-2 py-0.5 rounded-md shrink-0 w-[64px] text-center`,style:{color:a.color,background:a.bg},children:a.word}),(0,F.jsx)(`span`,{className:`mono text-[12.5px] flex-1 min-w-0 text-[#dcdce6] ${t?`whitespace-pre-wrap break-words`:`truncate`}`,children:e.message}),(0,F.jsx)(`span`,{className:`text-mute text-[12px] shrink-0 max-w-[110px] truncate`,children:e.service}),(0,F.jsx)(Er,{size:14,className:`text-mute shrink-0 mt-0.5 transition-transform ${t?`rotate-90`:``}`})]}),t&&(0,F.jsxs)(`div`,{className:`px-2 pb-3 pl-[150px] flex flex-col gap-2.5`,children:[(0,F.jsxs)(`div`,{className:`text-[12px] text-mute`,children:[Sa(e.ts,!0),` · `,zV(e.ts),e.logger?` · ${e.logger}`:``,e.instance?` · ${e.instance}`:``]}),e.attrs&&(0,F.jsx)(`pre`,{className:`code !text-[11.5px] !py-2 max-h-[240px] overflow-auto`,children:JSON.stringify(e.attrs,null,2)}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[e.executionId&&(0,F.jsxs)(`button`,{className:`btn h-8`,onClick:()=>r(i(`/executions/${e.executionId}`)),children:[`See the request that wrote it`,(0,F.jsx)(Er,{size:13})]}),(0,F.jsx)(VV,{className:`btn h-8`,label:`Ask Obzeri about this`,question:`What does this ${e.level} log from ${e.service} mean, and do I need to do anything? "${String(e.message).slice(0,300)}"`})]})]})]})}function hH(){let e=I(),t=ht(),n=L(),r=rr(),i=P(`/api/settings`),a=P(`/api/settings/ai`);if(i.error)return(0,F.jsx)(W,{error:i.error});if(!i.data)return(0,F.jsx)(U,{});let o=i.data,s=e.meta?.services||[];return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(Di,{size:22,className:`text-brand`}),`Settings`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Connect your app, choose how the dashboard looks, and turn on the assistant.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-5 gap-5 items-start`,children:[(0,F.jsxs)(`div`,{className:`@4xl:col-span-3 flex flex-col gap-5`,children:[(0,F.jsx)(BV,{title:`Your apps`,n:s.length,children:s.length===0?(0,F.jsx)(`div`,{className:`text-ink2 text-[13px]`,children:`No app has reported yet. Follow the steps below.`}):(0,F.jsx)(`div`,{className:`flex flex-col divide-y divide-[#1f1f29]`,children:s.map(t=>{let n=Date.now()-t.lastSeen<9e5,r=(e.meta?.versions||[]).filter(e=>e.service===t.id);return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,F.jsx)(vr,{size:17,className:`text-mute shrink-0`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`font-medium text-[14px]`,children:t.id}),(0,F.jsx)($a,{frameworks:t.frameworks,className:`mt-1`}),(0,F.jsx)(`div`,{className:`text-mute text-[12px] mt-1`,children:[r.length?`version ${r[r.length-1].version}`:null,t.instances.length>1?`${t.instances.length} instances`:null].filter(Boolean).join(` · `)||`Node.js`})]}),(0,F.jsxs)(`span`,{className:`tone-${n?`good`:`neutral`} text-[12px] font-medium flex items-center gap-1.5`,style:{color:`var(--tone)`},children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full ${n?`live-dot`:``}`,style:{background:`var(--tone)`}}),n?`Reporting`:`Last heard ${zV(t.lastSeen)}`]})]},t.id)})})}),(0,F.jsx)(Mz,{initial:`zero`,title:`Connect an app`})]}),(0,F.jsxs)(`div`,{className:`@4xl:col-span-2 flex flex-col gap-5`,children:[(0,F.jsx)(gH,{}),(0,F.jsx)(_H,{}),(0,F.jsx)(BV,{title:`Ask Obzeri`,children:a.data?a.data.configured?(0,F.jsxs)(`div`,{className:`tone-good flex items-center gap-2 text-[13px]`,children:[(0,F.jsx)(Ar,{size:16,style:{color:`var(--tone)`}}),`Ready, using `,(0,F.jsx)(`b`,{children:a.data.model})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`text-ink2 text-[13px] leading-relaxed`,children:`Ask questions about your app in plain words. Needs an AI model: Claude, any OpenAI-compatible API, or a local one through Ollama.`}),(0,F.jsxs)(`button`,{className:`btn btn-primary h-9 self-start`,onClick:()=>t(n(`/integrations/ai`)),children:[(0,F.jsx)(Ni,{size:14}),`Set up Ask Obzeri`]})]}):(0,F.jsx)(U,{})}),(0,F.jsxs)(BV,{title:`Privacy & data`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-[13px]`,children:[(0,F.jsx)(ni,{size:15,className:`text-mute mt-0.5`}),(0,F.jsx)(`div`,{children:o.passwordProtected?`The dashboard is password protected.`:(0,F.jsxs)(F.Fragment,{children:[`No password: anyone who can reach this address can open the dashboard. Set `,(0,F.jsx)(`span`,{className:`mono`,children:`OBZERVER_PASSWORD`}),` to lock it.`]})})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-[13px]`,children:[(0,F.jsx)(Pr,{size:15,className:`text-mute mt-0.5`}),(0,F.jsxs)(`div`,{children:[`Details are kept for `,o.retentionDays,` days`,o.history?`, daily summaries for ${o.history.days} days`:``,`. Passwords and keys found in logs are hidden before saving.`]})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-[13px]`,children:[(0,F.jsx)(ji,{size:15,className:`text-mute mt-0.5`}),(0,F.jsxs)(`div`,{children:[`Your app keys are stored as hashes and shown only once. Create, rotate or limit them to one environment in `,(0,F.jsx)(`button`,{className:`link`,onClick:()=>r(`/settings`),children:`Advanced → Settings`}),`.`]})]})]}),(0,F.jsxs)(`button`,{className:`card p-4 text-left flex items-center gap-3 hover:border-line2 group`,onClick:()=>r(`/settings`),children:[(0,F.jsx)(ji,{size:17,className:`text-mute`}),(0,F.jsxs)(`div`,{className:`flex-1`,children:[(0,F.jsx)(`div`,{className:`font-medium text-[13.5px]`,children:`All settings`}),(0,F.jsx)(`div`,{className:`text-mute text-[12px]`,children:`Ingest keys, projects, email, MCP, ticket trackers, history`})]}),(0,F.jsx)(Er,{size:15,className:`text-mute group-hover:translate-x-0.5 transition-transform`})]})]})]})]})}function gH(){let e=I(),t=ht(),n=L(),r=e.meta?.usage;if(!r)return null;let i={unlimited:`No monthly limit: everything your apps send is kept.`,ok:`${qi(r.included==null?null:Math.max(0,r.included-r.used))} events left this month.`,paced:`You sent a lot today, so most step-by-step timings pause until midnight (UTC). Errors and slow requests still keep theirs.`,reduced:`You used this month's events. Charts stay live, but most requests arrive without step-by-step timings.`,refused:`You used twice this month's events, so new data is turned away until the 1st.`,overage:`Past this month's events: extra ones are collected within your spending limits.`,paused:`Extra events are paused. Server errors and failed jobs are still collected.`};return(0,F.jsxs)(BV,{title:`Your plan`,right:(0,F.jsx)(`span`,{className:`text-[12px] text-mute`,children:r.name}),children:[r.included!=null&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between text-[13px]`,children:[(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`b`,{className:`text-[16px]`,children:qi(r.used)}),` of `,qi(r.included),` events used`]}),(0,F.jsx)(`span`,{className:`text-mute`,children:Ji(r.pct)})]}),(0,F.jsx)(Qi,{used:r.used,included:r.included})]}),(0,F.jsx)(`div`,{className:`text-[13px] leading-relaxed tone-${Xi[r.state].tone}`,children:i[r.state]}),(0,F.jsx)(`div`,{className:`text-[12px] text-mute leading-snug`,children:`An event is one request, background job, error, log line or step inside your code. Database calls are free.`}),(0,F.jsx)(`button`,{className:`btn h-9 self-start`,onClick:()=>t(n(`/usage`)),children:`Usage & plans`})]})}function _H(){let{mode:e,setMode:t}=nr(),n=(n,r,i,a)=>(0,F.jsxs)(`button`,{className:`text-left rounded-xl border px-3.5 py-3 flex gap-3 ${e===n?`border-brand bg-[rgba(255,61,127,.06)]`:`border-line hover:border-line2`}`,onClick:()=>t(n),"aria-pressed":e===n,children:[(0,F.jsx)(r,{size:18,className:e===n?`text-brand mt-0.5`:`text-mute mt-0.5`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium text-[13.5px]`,children:i}),(0,F.jsx)(`div`,{className:`text-mute text-[12px] mt-0.5 leading-snug`,children:a})]})]});return(0,F.jsxs)(BV,{title:`Dashboard mode`,children:[n(`simple`,Mi,`Simple`,`Is my app healthy, what broke, what changed, what to do. Plain words, no jargon.`),n(`advanced`,ji,`Advanced`,`Every request, trace, query, release and runtime detail, for digging deep.`),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:`Saved in this browser. Switch any time from the top bar.`})]})}var vH=e=>`${e.service}@${e.version}`;function yH(){let e=I(),[t]=zn(),{data:n,error:r}=P(`/api/simple/releases${e.q()}`,[e.tick]),i=t.get(`release`)||(t.get(`service`)&&t.get(`version`)?`${t.get(`service`)}@${t.get(`version`)}`:null);if(r)return(0,F.jsx)(W,{error:r});if(!n)return(0,F.jsx)(U,{});let a=n.filter(e=>e.latest),o=n.filter(e=>!e.latest);return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(yi,{size:22,className:`text-brand`}),`Releases`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Every deploy, and whether it made your app better or worse than the one before.`})]}),n.length===0?(0,F.jsx)(EH,{}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-5`,children:a.map(e=>(0,F.jsx)(CH,{r:e,focus:i===vH(e)},vH(e)))}),o.length>0&&(0,F.jsx)(BV,{title:`Earlier deploys`,n:o.length,children:(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:o.map(e=>(0,F.jsx)(wH,{r:e,focus:i===vH(e)},vH(e)))})})]})]})}function bH({r:e}){return(0,F.jsxs)(Ga,{tip:`Deployed ${Sa(e.first,!0)} · last request ${Sa(e.last,!0)}`,children:[`deployed `,zV(e.first)]})}function xH({r:e,big:t}){let n=RV[e.tone];return(0,F.jsxs)(`span`,{className:`tone-${e.tone} inline-flex items-center gap-1.5 font-semibold rounded-full ${t?`text-[12.5px] px-2.5 py-1`:`text-[11.5px] px-2 py-0.5`}`,style:{color:`var(--tone)`,background:`var(--tone-bg)`},children:[(0,F.jsx)(n,{size:t?14:12}),e.label]})}function SH(e){let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{e&&setTimeout(()=>t.current?.scrollIntoView({block:`start`,behavior:`smooth`}),100)},[e]),t}function CH({r:e,focus:t}){let n=SH(t);return(0,F.jsxs)(`section`,{ref:n,className:`card tone-${e.tone} p-6 flex flex-col gap-5 scroll-mt-4`,style:{borderColor:e.tone===`bad`||e.tone===`warn`||t?`var(--tone-line)`:void 0,background:e.tone===`bad`||e.tone===`warn`?`linear-gradient(135deg, var(--tone-bg), transparent 50%), var(--color-panel)`:void 0},children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4 flex-wrap`,children:[(0,F.jsx)(`div`,{className:`w-12 h-12 rounded-xl flex items-center justify-center shrink-0`,style:{background:`var(--tone-bg)`,border:`1px solid var(--tone-line)`},children:(0,F.jsx)(yi,{size:22,style:{color:`var(--tone)`}})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`text-[11.5px] uppercase tracking-wider font-semibold text-mute`,children:[`Latest deploy of `,e.service]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap mt-0.5`,children:[(0,F.jsxs)(`h2`,{className:`text-[22px] font-semibold tracking-tight`,children:[e.service,` `,(0,F.jsx)(`span`,{className:`font-mono text-[19px]`,children:e.version})]}),(0,F.jsx)(xH,{r:e,big:!0})]}),(0,F.jsx)(`div`,{className:`text-ink2 text-[14px] mt-1.5 leading-relaxed`,children:e.summary}),(0,F.jsxs)(`div`,{className:`text-mute text-[12px] mt-1`,children:[(0,F.jsx)(bH,{r:e}),` · `,V(e.requests),` requests since`,e.previous?(0,F.jsxs)(F.Fragment,{children:[` · compared with `,(0,F.jsx)(`span`,{className:`mono`,children:e.previous})]}):null]})]}),(0,F.jsx)(`div`,{className:`flex gap-2 shrink-0`,children:(0,F.jsx)(VV,{question:e.ask,className:`btn h-9`})})]}),(0,F.jsx)(TH,{r:e})]})}function wH({r:e,focus:t}){let[n,r]=(0,v.useState)(t),i=SH(t);return(0,F.jsxs)(`div`,{ref:i,className:`rounded-xl border bg-[#111118] scroll-mt-4 ${n?`border-line2`:`border-line`}`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-center gap-3 px-4 py-3 text-left flex-wrap`,onClick:()=>r(!n),"aria-expanded":n,children:[(0,F.jsxs)(`span`,{className:`font-medium text-[14px] min-w-[150px]`,children:[e.service,` `,(0,F.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.version})]}),(0,F.jsx)(xH,{r:e}),(0,F.jsx)(`span`,{className:`text-mute text-[12.5px] flex-1 min-w-[200px] truncate`,children:e.summary}),(0,F.jsx)(`span`,{className:`text-mute text-[12px] shrink-0`,children:zV(e.first)}),n?(0,F.jsx)(wr,{size:15,className:`text-mute`}):(0,F.jsx)(Er,{size:15,className:`text-mute`})]}),n&&(0,F.jsxs)(`div`,{className:`px-4 pb-4 flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`text-mute text-[12px]`,children:[(0,F.jsx)(bH,{r:e}),` · `,V(e.requests),` requests`]}),(0,F.jsx)(TH,{r:e}),(0,F.jsx)(`div`,{children:(0,F.jsx)(VV,{question:e.ask,className:`btn h-8`})})]})]})}function TH({r:e}){let t=ht(),n=L(),r=rr(),i=e.newErrors.length>0||e.codeChanges.length>0;return!e.compare.length&&!i&&!e.advice?e.verdict===`baseline`?null:(0,F.jsx)(`div`,{className:`text-ink2 text-[13px]`,children:`Not enough traffic on this version yet to compare. Check back after a few hundred requests.`}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.advice&&(0,F.jsxs)(`div`,{className:`tone-${e.tone} rounded-xl px-4 py-3.5 flex gap-3`,style:{background:`var(--tone-bg)`,border:`1px solid var(--tone-line)`},children:[(0,F.jsx)(Qr,{size:17,style:{color:`var(--tone)`},className:`shrink-0 mt-0.5`}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-semibold text-[13.5px]`,children:`What to do`}),(0,F.jsx)(`ol`,{className:`mt-1.5 flex flex-col gap-1`,children:e.advice.map((e,t)=>(0,F.jsxs)(`li`,{className:`text-[13px] flex gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-mute tabular-nums`,children:[t+1,`.`]}),e]},t))})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 ${i&&e.compare.length?`@4xl:grid-cols-2`:``} gap-4`,children:[e.compare.length>0&&(0,F.jsxs)(`div`,{className:`rounded-xl border border-line overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_20px_auto] gap-x-3 items-center px-4 py-2 text-[11px] uppercase tracking-wider text-mute border-b border-line bg-[#111118]`,children:[(0,F.jsx)(`span`,{children:`Before vs after`}),(0,F.jsx)(`span`,{className:`mono normal-case tracking-normal text-right`,children:e.previous}),(0,F.jsx)(`span`,{}),(0,F.jsx)(`span`,{className:`mono normal-case tracking-normal`,children:e.version})]}),e.compare.map(e=>(0,F.jsxs)(`div`,{className:`tone-${e.tone} grid grid-cols-[1fr_auto_20px_auto] gap-x-3 items-center px-4 py-2.5 border-b border-[#1d1d26] last:border-0`,children:[(0,F.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.hint?(0,F.jsx)(Ga,{tip:e.hint,children:e.label}):e.label}),(0,F.jsx)(`span`,{className:`text-[13px] tabular-nums text-mute text-right`,children:e.before}),(0,F.jsx)(fr,{size:13,className:`text-mute`}),(0,F.jsx)(`span`,{className:`text-[13.5px] tabular-nums font-semibold min-w-[70px]`,style:{color:e.tone===`neutral`?void 0:`var(--tone)`},children:e.after})]},e.label))]}),i&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.newErrors.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`text-[12.5px] font-semibold flex items-center gap-1.5 mb-1.5`,children:[(0,F.jsx)(yr,{size:14,className:`text-[#ff8a8a]`}),`New errors in this version`]}),(0,F.jsx)(`div`,{className:`flex flex-col`,children:e.newErrors.map(e=>(0,F.jsxs)(`button`,{className:`text-left rounded-lg px-2.5 py-2 -mx-2.5 hover:bg-[#181821] flex items-center gap-3 group`,onClick:()=>t(n(`/errors/${e.fingerprint}`)),children:[(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`text-[13px] font-medium text-[#ff9b9b]`,children:e.class}),(0,F.jsx)(`span`,{className:`block text-mute text-[12px] truncate`,children:e.message})]}),(0,F.jsxs)(`span`,{className:`text-[12px] text-ink2 tabular-nums`,children:[V(e.count),`×`]}),(0,F.jsx)(Er,{size:14,className:`text-mute`})]},e.fingerprint))})]}),e.codeChanges.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`text-[12.5px] font-semibold flex items-center gap-1.5 mb-1.5`,children:[(0,F.jsx)(Fr,{size:14,className:`text-mute`}),`What changed in the code`]}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.codeChanges.map(e=>(0,F.jsxs)(`li`,{className:`text-[13px] text-ink2 flex gap-2`,children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`•`}),e]},e))})]})]})]}),(0,F.jsx)(`div`,{children:(0,F.jsxs)(`button`,{className:`btn btn-ghost h-8 px-2 text-[12.5px]`,onClick:()=>r(`/releases?service=${encodeURIComponent(e.service)}&version=${encodeURIComponent(e.version)}`),children:[(0,F.jsx)(ji,{size:13}),`Full comparison in Advanced`]})})]})}function EH(){let e=`OBZERVER_VERSION=$(git rev-parse --short HEAD)`;return(0,F.jsxs)(BV,{title:`Tag your deploys to see them here`,children:[(0,F.jsxs)(`div`,{className:`text-ink2 text-[13.5px] leading-relaxed`,children:[`Obzerver compares each version of your app with the one before: did errors go up, did it get slower, does it leak memory. Most CI and hosting providers (GitHub Actions, GitLab, Vercel, Render, Railway, Netlify, Heroku…) and a `,(0,F.jsx)(`span`,{className:`mono`,children:`.git`}),` folder are detected automatically. Otherwise, set a version when you deploy:`]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`code flex-1`,children:e}),(0,F.jsx)(Ra,{text:e,className:`btn h-9`})]})]})}function DH({simple:e,advanced:t}){let{mode:n}=nr();return(0,F.jsx)(F.Fragment,{children:n===`simple`?e:t})}function OH(){let{traceId:e}=yt(),[t,n]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{N(`/api/traces/${e}`).then(e=>n(e.execution.id)).catch(()=>n(null))},[e]),t===void 0?(0,F.jsx)(U,{}):t===null?(0,F.jsxs)(`div`,{className:`text-mute py-10 text-center`,children:[`Trace `,e,` not found.`]}):(0,F.jsx)(Vt,{to:`/executions/${t}${window.location.search}`,replace:!0})}function kH({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``);return(0,F.jsxs)(`div`,{className:`h-full overflow-y-auto flex flex-col items-center justify-center gap-10 px-6 py-10`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-6 text-center`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-[18px] max-[480px]:scale-[0.72]`,children:[(0,F.jsx)(lo,{size:88}),(0,F.jsx)(fo,{size:64})]}),(0,F.jsx)(`p`,{className:`m-0 text-[15px] text-[#a3a3b8]`,children:`Know your app is healthy. Zero-config observability for Express and Fastify.`})]}),(0,F.jsxs)(`form`,{className:`card p-5 w-full max-w-[340px] flex flex-col gap-3`,onSubmit:async n=>{n.preventDefault();try{await N(`/api/auth/login`,{method:`POST`,json:{password:t}}),e()}catch(e){i(e.message||`Wrong password`)}},children:[(0,F.jsx)(`label`,{className:`text-[12.5px] text-ink2`,htmlFor:`obz-password`,children:`Dashboard password`}),(0,F.jsx)(`input`,{id:`obz-password`,type:`password`,autoFocus:!0,className:`input h-9`,placeholder:`Password`,value:t,onChange:e=>n(e.target.value)}),r&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] text-[12px]`,children:r}),(0,F.jsx)(`button`,{className:`btn btn-primary justify-center h-9`,children:`Sign in`})]})]})}function AH({children:e}){let[t]=zn();return(0,F.jsx)(v.Fragment,{children:e},t.get(`project`)||`default`)}function jH(){let[e,t]=(0,v.useState)(`loading`),n=()=>N(`/api/auth`).then(e=>t(e.ok?`ok`:`login`)).catch(()=>t(`ok`));return(0,v.useEffect)(()=>{n();let e=()=>t(`login`);return window.addEventListener(`obz:unauthorized`,e),()=>window.removeEventListener(`obz:unauthorized`,e)},[]),e===`loading`?(0,F.jsx)(U,{}):e===`login`?(0,F.jsx)(kH,{onDone:()=>t(`ok`)}):(0,F.jsx)(Mn,{children:(0,F.jsx)(AH,{children:(0,F.jsx)(Zn,{children:(0,F.jsx)(tr,{children:(0,F.jsx)(Gt,{children:(0,F.jsxs)(Ut,{element:(0,F.jsx)(po,{}),children:[(0,F.jsx)(Ut,{index:!0,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(KV,{}),advanced:(0,F.jsx)(Fz,{})})}),(0,F.jsx)(Ut,{path:`requests`,element:(0,F.jsx)(zz,{kind:`http`})}),(0,F.jsx)(Ut,{path:`jobs`,element:(0,F.jsx)(zz,{kind:`job`})}),(0,F.jsx)(Ut,{path:`operations/:kind/:service/:name`,element:(0,F.jsx)(qz,{})}),(0,F.jsx)(Ut,{path:`executions/:id`,element:(0,F.jsx)(eB,{})}),(0,F.jsx)(Ut,{path:`traces`,element:(0,F.jsx)(nB,{})}),(0,F.jsx)(Ut,{path:`traces/:traceId`,element:(0,F.jsx)(OH,{})}),(0,F.jsx)(Ut,{path:`map`,element:(0,F.jsx)(oV,{})}),(0,F.jsx)(Ut,{path:`errors`,element:(0,F.jsx)(rB,{})}),(0,F.jsx)(Ut,{path:`secrets`,element:(0,F.jsx)(aB,{})}),(0,F.jsx)(Ut,{path:`errors/:fp`,element:(0,F.jsx)(sB,{})}),(0,F.jsx)(Ut,{path:`logs`,element:(0,F.jsx)(Yi,{feature:`logs`,children:(0,F.jsx)(DH,{simple:(0,F.jsx)(pH,{}),advanced:(0,F.jsx)($z,{})})})}),(0,F.jsx)(Ut,{path:`services`,element:(0,F.jsx)(CB,{})}),(0,F.jsx)(Ut,{path:`integrations`,element:(0,F.jsx)(xz,{})}),(0,F.jsx)(Ut,{path:`projects`,element:(0,F.jsx)(TB,{})}),(0,F.jsx)(Ut,{path:`integrations/:id`,element:(0,F.jsx)(xz,{})}),(0,F.jsx)(Ut,{path:`functions`,element:(0,F.jsx)(Vt,{to:`/services${window.location.search}`,replace:!0})}),(0,F.jsx)(Ut,{path:`queries`,element:(0,F.jsx)(kB,{})}),(0,F.jsx)(Ut,{path:`users`,element:(0,F.jsx)(AB,{})}),(0,F.jsx)(Ut,{path:`users/:id`,element:(0,F.jsx)(jB,{})}),(0,F.jsx)(Ut,{path:`profiler`,element:(0,F.jsx)(YB,{})}),(0,F.jsx)(Ut,{path:`metrics`,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(lH,{}),advanced:(0,F.jsx)(ZB,{})})}),(0,F.jsx)(Ut,{path:`releases`,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(yH,{}),advanced:(0,F.jsx)(eV,{})})}),(0,F.jsx)(Ut,{path:`alerts`,element:(0,F.jsx)(Yi,{feature:`alerts`,children:(0,F.jsx)(DH,{simple:(0,F.jsx)(rH,{}),advanced:(0,F.jsx)(lV,{})})})}),(0,F.jsx)(Ut,{path:`slos`,element:(0,F.jsx)(Yi,{feature:`slos`,children:(0,F.jsx)(EV,{})})}),(0,F.jsx)(Ut,{path:`usage`,element:(0,F.jsx)(fB,{})}),(0,F.jsx)(Ut,{path:`status-pages`,element:(0,F.jsx)(NV,{})}),(0,F.jsx)(Ut,{path:`issues`,element:(0,F.jsx)(gV,{})}),(0,F.jsx)(Ut,{path:`issues/:id`,element:(0,F.jsx)(yV,{})}),(0,F.jsx)(Ut,{path:`settings`,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(hH,{}),advanced:(0,F.jsx)(Nz,{})})}),(0,F.jsx)(Ut,{path:`*`,element:(0,F.jsx)(`div`,{className:`text-mute py-10 text-center`,children:`Not found`})})]})})})})})})}(0,Gn.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(v.StrictMode,{children:(0,F.jsx)(jH,{})}));
114
+ `),w=i.sourceType===`error`?`/errors/${i.sourceRef}`:i.sourceType===`execution`?`/executions/${i.sourceRef}`:i.sourceType===`alert`?`/alerts`:null;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(Nn,{to:n(`/issues`),className:`text-mute hover:text-ink text-[12px] -mb-2`,children:`← Issues`}),(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsxs)(`span`,{className:`text-mute text-[19px]`,children:[`#`,i.id]}),(0,F.jsx)(`h1`,{className:`text-[19px] font-semibold tracking-tight`,children:i.title})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,F.jsx)(G,{kind:mV[i.status]?.kind||`neutral`,children:mV[i.status]?.label||i.status}),(0,F.jsxs)(`span`,{className:`text-mute text-[12px]`,children:[`opened `,xa(i.created),i.sourceType?` from ${i.sourceType}`:``]}),w&&(0,F.jsx)(`button`,{className:`link text-[12px]`,onClick:()=>r(n(w)),children:`view source →`})]})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(Ra,{text:C,label:`Copy summary`}),[`open`,`in_progress`,`unverified`].includes(i.status)&&(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>b({status:`resolved`}),children:`Mark resolved`}),[`resolved`,`closed`,`verifying`].includes(i.status)&&(0,F.jsx)(`button`,{className:`btn`,onClick:()=>b({status:`open`}),children:`Reopen`})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-3 gap-3`,children:[(0,F.jsxs)(`div`,{className:`@5xl:col-span-2 flex flex-col gap-3`,children:[i.description&&(0,F.jsx)(H,{title:`Description`,children:(0,F.jsx)(`div`,{className:`whitespace-pre-wrap text-[13px]`,children:i.description})}),x&&(0,F.jsx)(H,{title:`Incident record`,children:(0,F.jsx)(Ha,{items:[[`Error`,(0,F.jsx)(`span`,{className:`text-[#ff9b9b]`,children:x.error})],[`Operation`,(0,F.jsx)(`span`,{className:`mono`,children:x.operation})],[`Started`,Sa(x.start,!0)],[`Ended`,x.end?Sa(x.end,!0):`ongoing`],[`Last seen`,xa(x.lastSeen)],[`Introduced in`,(0,F.jsx)(`span`,{className:`mono`,children:x.introducedIn||`—`})],[`Fixed in`,(0,F.jsx)(`span`,{className:`mono`,children:i.fixVersion||`—`})],[`Occurrences`,x.occurrences],[`Users affected`,x.users.length],[`Customers`,x.customers.join(`, `)||`—`]]})}),(0,F.jsxs)(H,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,F.jsx)(ki,{size:14}),`Did a release fix this?`]}),children:[(0,F.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,F.jsx)(K,{label:`Release`,children:(0,F.jsxs)(`select`,{className:`select w-48`,value:d,onChange:e=>f(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:i.fixVersion?`Fix version (${i.fixVersion})`:`Since resolution`}),[...new Set(S)].map(e=>(0,F.jsx)(`option`,{children:e},e))]})}),(0,F.jsx)(`button`,{className:`btn`,onClick:async()=>u(await N(`/api/issues/${e}/verify${d?`?version=${encodeURIComponent(d)}`:``}`)),children:`Check`}),d&&d!==i.fixVersion&&(0,F.jsx)(`button`,{className:`btn btn-ghost`,onClick:()=>b({fixVersion:d}),children:`Set as fix version`})]}),l&&(0,F.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(G,{kind:vV[l.verdict]?.kind||`neutral`,children:vV[l.verdict]?.label||l.verdict}),(0,F.jsx)(`span`,{className:`text-ink2`,children:l.reason})]}),l.newErrorGroupsInRelease>0&&(0,F.jsxs)(`div`,{className:`text-mute text-[12px]`,children:[`Note: `,l.newErrorGroupsInRelease,` new error group(s) appeared in that release.`]})]}),(0,F.jsx)(`div`,{className:`text-mute text-[11.5px] mt-3`,children:`Marking an issue with a measurable scope as resolved moves it to Verifying: it closes on its own once the fix holds, reopens if the failure returns, and becomes Unverified after 7 days without a conclusion.`})]}),(0,F.jsxs)(H,{title:`Timeline`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:[...i.timeline].reverse().map((e,t)=>(0,F.jsxs)(`div`,{className:`flex gap-3 text-[12.5px]`,children:[(0,F.jsx)(`span`,{className:`text-mute w-[130px] shrink-0 tabular-nums`,children:Sa(e.ts,!0)}),(0,F.jsx)(`span`,{children:e.text})]},t))}),(0,F.jsxs)(`form`,{className:`flex gap-2 mt-3`,onSubmit:e=>{e.preventDefault(),s&&(b({comment:s}),c(``))},children:[(0,F.jsx)(`input`,{className:`input flex-1`,placeholder:`Add a comment`,value:s,onChange:e=>c(e.target.value)}),(0,F.jsx)(`button`,{className:`btn`,children:`Comment`})]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(H,{title:`Ticket`,sub:i.ticket?`kept in step with this issue`:p.length?`track the work where your team works`:void 0,children:[i.ticket?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,F.jsx)(`div`,{children:(0,F.jsx)(tz,{ticket:i.ticket})}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[i.ticket.syncedAt?`Checked ${xa(i.ticket.syncedAt)}. `:``,`Closing it starts verification here; the result is posted on the ticket.`]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsxs)(`button`,{className:`btn h-7`,disabled:g,onClick:()=>y(async()=>(await N(`/api/issues/${e}/ticket/sync`,{method:`POST`}),`Synced.`)),children:[(0,F.jsx)(vi,{size:12}),`Sync now`]}),(0,F.jsxs)(`button`,{className:`btn btn-ghost h-7`,disabled:g,onClick:()=>y(async()=>window.confirm(`Unlink the ticket? It is not deleted.`)?(await N(`/api/issues/${e}/ticket`,{method:`DELETE`}),`Unlinked.`):`Kept.`),children:[(0,F.jsx)(Bi,{size:12}),`Unlink`]})]})]}):p.length?(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:p.map(t=>(0,F.jsxs)(`button`,{className:`btn`,disabled:g,onClick:()=>y(async()=>{let n=await N(`/api/issues/${e}/ticket`,{method:`POST`,json:{provider:t}});return`Created ${QR[t]} ${n.key}.`}),children:[`Create in `,QR[t]]},t))}):(0,F.jsxs)(`div`,{className:`text-mute text-[12.5px]`,children:[`Connect GitHub or Linear in `,(0,F.jsx)(`button`,{className:`link`,onClick:()=>r(n(`/integrations`)),children:`Integrations`}),` to open tickets from issues.`]}),m&&(0,F.jsx)(`div`,{className:`text-[12px] mt-2`,style:{color:m.ok?`#5fd38a`:`#ff8a8a`},children:m.text})]}),(0,F.jsx)(H,{title:`Details`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(K,{label:`Status`,children:(0,F.jsx)(`select`,{className:`select`,value:i.status,onChange:e=>b({status:e.target.value}),children:Object.entries(mV).map(([e,t])=>(0,F.jsx)(`option`,{value:e,children:t.label},e))})}),(0,F.jsx)(K,{label:`Severity`,children:(0,F.jsx)(`select`,{className:`select`,value:i.severity,onChange:e=>b({severity:e.target.value}),children:Object.keys(hV).map(e=>(0,F.jsx)(`option`,{children:e},e))})}),(0,F.jsx)(K,{label:`Owner`,children:(0,F.jsx)(`input`,{className:`input`,defaultValue:i.owner||``,onBlur:e=>e.target.value!==(i.owner||``)&&b({owner:e.target.value}),placeholder:`name or email`})}),(0,F.jsx)(K,{label:`Due date`,children:(0,F.jsx)(`input`,{className:`input`,type:`date`,defaultValue:i.due?new Date(i.due).toISOString().slice(0,10):``,onChange:e=>b({due:e.target.value?new Date(e.target.value).getTime():null})})}),(0,F.jsx)(Ha,{items:[[`Application`,i.service||`—`],[`Created`,Sa(i.created,!0)],[`Updated`,xa(i.updated)]]}),(0,F.jsx)(`button`,{className:`btn btn-ghost justify-center text-[#ff8a8a]`,onClick:async()=>{window.confirm(`Delete this issue?`)&&(await N(`/api/issues/${e}`,{method:`DELETE`}),r(n(`/issues`)))},children:`Delete issue`})]})})]})]})]})}var bV={healthy:{kind:`good`,label:`Healthy`},at_risk:{kind:`warn`,label:`At risk`},burning:{kind:`serious`,label:`Burning`},exhausted:{kind:`crit`,label:`Budget exhausted`},no_data:{kind:`neutral`,label:`No data`}},xV=e=>e==null?`#55556a`:e<=0?BR.crit:e<.25?BR.serious:e<.5?BR.warn:BR.good,SV=(e,t)=>e==null?void 0:e>t?`#ff8a8a`:e>1?`#ffc85a`:void 0,CV=e=>`${e.service||`all applications`}${e.operation?` · ${e.operation}`:``}${e.kind===`job`?` (jobs)`:``}`,wV=e=>`${e.kind===`job`?`runs succeed`:`requests succeed (non-5xx)`}${e.latencyMs?` and finish within ${e.latencyMs}ms`:``}`;function TV({value:e}){let t=e==null?0:Math.max(0,Math.min(1,e))*100;return(0,F.jsx)(`div`,{className:`h-1.5 rounded-full bg-[#24242e] overflow-hidden`,title:e==null?`no data`:`${(e*100).toFixed(1)}% budget left`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${t}%`,background:xV(e)}})})}function EV(){let e=I(),[t,n]=zn(),{data:r,error:i,reload:a}=P(`/api/slos`,[e.tick]),[o,s]=(0,v.useState)(null),c=Number(t.get(`id`))||r?.[0]?.slo.id||null,l=e=>{let r=new URLSearchParams(t);r.set(`id`,String(e)),n(r,{replace:!0})};return i?(0,F.jsx)(W,{error:i}):r?(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(Fi,{size:18,className:`text-brand`}),title:`SLOs`,sub:`Service level objectives on real traffic: the share of good requests or job runs over a rolling window, the error budget left, and burn-rate alerts that fire before the budget runs out.`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>s({target:99.5,windowDays:7,kind:`http`,channels:[{type:`inapp`}]}),children:[(0,F.jsx)(hi,{size:14}),`New SLO`]})}),r.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No SLOs yet`,icon:(0,F.jsx)(Fi,{size:22}),children:`An SLO says how reliable something must be, e.g. 99.5% of checkout requests succeed over 7 days. Obzerver tracks the error budget and alerts on fast and slow burn.`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-[360px_1fr] gap-3 items-start`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,F.jsxs)(`button`,{onClick:()=>l(e.slo.id),className:`card text-left px-3.5 py-3 flex flex-col gap-2 ${c===e.slo.id?`!border-[#5a2340]`:`hover:border-line2`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium truncate`,children:e.slo.name}),(0,F.jsx)(G,{kind:bV[e.state].kind,children:bV[e.state].label})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px] truncate`,children:[CV(e.slo),` · `,e.slo.target,`% over `,e.slo.windowDays,`d`]}),(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`text-[18px] font-semibold tabular-nums`,children:e.sli==null?`—`:`${e.sli}%`}),(0,F.jsx)(`span`,{className:`text-[11.5px] tabular-nums`,style:{color:xV(e.budgetRemaining)},children:e.budgetRemaining==null?`no data`:`${(e.budgetRemaining*100).toFixed(1)}% budget left`})]}),(0,F.jsx)(TV,{value:e.budgetRemaining})]},e.slo.id))}),c&&(0,F.jsx)(DV,{id:c,onEdit:e=>s(e),onDeleted:()=>{let e=new URLSearchParams(t);e.delete(`id`),n(e),a()}})]}),o&&(0,F.jsx)(kV,{slo:o,onClose:()=>s(null),onSaved:e=>{s(null),a(),l(e)}})]}):(0,F.jsx)(U,{})}function DV({id:e,onEdit:t,onDeleted:n}){let r=I(),i=L(),{data:a,error:o}=P(`/api/slos/${e}`,[e,r.tick]);if(o)return(0,F.jsx)(W,{error:o});if(!a)return(0,F.jsx)(U,{});let s=a.slo,c=a.history.points,l=[[`5 minutes`,a.burn.m5,14.4],[`30 minutes`,a.burn.m30,6],[`1 hour`,a.burn.h1,14.4],[`6 hours`,a.burn.h6,6],[`1 day`,a.burn.d1,1]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 min-w-0`,children:[(0,F.jsx)(H,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s.name,(0,F.jsx)(G,{kind:bV[a.state].kind,children:bV[a.state].label})]}),right:(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>t(s),children:[(0,F.jsx)(di,{size:13}),`Edit`]}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Delete`,onClick:async()=>{window.confirm(`Delete SLO "${s.name}" and its burn alerts?`)&&(await N(`/api/slos/${s.id}`,{method:`DELETE`}),n())},children:(0,F.jsx)(Ii,{size:13})})]}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[s.description&&(0,F.jsx)(`div`,{className:`text-ink2`,children:s.description}),(0,F.jsxs)(`div`,{className:`text-[13px]`,children:[(0,F.jsxs)(`b`,{children:[s.target,`%`]}),` of `,s.operation?(0,F.jsx)(La,{name:s.operation}):(0,F.jsx)(`span`,{children:s.kind===`job`?`job runs`:`requests`}),` in `,(0,F.jsx)(`b`,{children:s.service||`all applications`}),` `,wV(s),`, over a rolling `,(0,F.jsxs)(`b`,{children:[s.windowDays,`-day`]}),` window.`]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 @3xl:grid-cols-4 gap-3`,children:[(0,F.jsx)(OV,{label:`Achieved`,value:a.sli==null?`—`:`${a.sli}%`,sub:`target ${s.target}%`,color:a.sli!=null&&a.sli<s.target?`#ff8a8a`:void 0}),(0,F.jsx)(OV,{label:`Error budget left`,value:a.budgetRemaining==null?`—`:`${(a.budgetRemaining*100).toFixed(1)}%`,color:xV(a.budgetRemaining),sub:(0,F.jsx)(TV,{value:a.budgetRemaining})}),(0,F.jsx)(OV,{label:`Bad events left`,value:a.budgetEventsLeft==null?`—`:V(Math.max(0,a.budgetEventsLeft)),sub:`${V(a.bad)} bad of ${V(a.total)}`}),(0,F.jsx)(OV,{label:`Burn rate (1h)`,value:a.burn.h1==null?`—`:`${a.burn.h1}×`,sub:`1× spends the budget exactly by window end`,color:SV(a.burn.h1,14.4)})]}),a.partialWindow&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-[#ffc85a]`,children:[(0,F.jsx)(zi,{size:13}),a.dataSince?`Data only goes back to ${Sa(a.dataSince,!0)}`:`No data yet`,`, so this window is partial.`,s.windowDays>a.retentionDays&&` Retention is ${a.retentionDays} days; raise OBZERVER_RETENTION_DAYS to cover the full ${s.windowDays}-day window.`]})]})}),(0,F.jsx)(WR,{title:`Error budget burn-down`,sub:`share of the window's budget still unspent`,children:(0,F.jsx)(UR,{data:c,series:[{key:`budget`,label:`Budget left`,color:zR[0],type:`area`}],height:190,fmt:e=>`${e.toFixed(1)}%`,refLines:[{y:0,label:`exhausted`,color:BR.crit}],zoom:!1})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @7xl:grid-cols-2 gap-3`,children:[(0,F.jsx)(WR,{title:`SLI per bucket`,sub:`good share per ${a.history.bucketMs>=864e5?`day`:a.history.bucketMs>=36e5?`${a.history.bucketMs/36e5}h`:`30m`}`,children:(0,F.jsx)(UR,{data:c,series:[{key:`sli`,label:`SLI`,color:zR[2],type:`line`}],height:170,fmt:e=>`${e.toFixed(2)}%`,refLines:[{y:s.target,label:`target ${s.target}%`,color:`#ff6b9d`}],yDomain:[`auto`,100],zoom:!1})}),(0,F.jsx)(H,{title:`Burn rates`,sub:`multiples of the sustainable rate`,children:(0,F.jsxs)(`table`,{className:`tbl`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Lookback`}),(0,F.jsx)(`th`,{className:`num`,children:`Burn rate`}),(0,F.jsx)(`th`,{className:`num`,children:`Error rate`})]})}),(0,F.jsx)(`tbody`,{children:l.map(([e,t,n])=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:e}),(0,F.jsx)(`td`,{className:`num`,style:{color:SV(t,n)},children:t==null?`—`:`${t}×`}),(0,F.jsx)(`td`,{className:`num text-ink2`,children:t==null?`—`:ya(t*(100-s.target))})]},e))})]})})]}),(0,F.jsxs)(H,{title:`Burn-rate alerts`,sub:`created and kept in step with this SLO`,pad:!1,children:[(0,F.jsx)(Ba,{rows:a.rules,cols:[{key:`s`,label:`State`,render:e=>e.state===`firing`?(0,F.jsx)(G,{kind:`crit`,children:`firing`}):(0,F.jsx)(G,{kind:`good`,children:`ok`})},{key:`n`,label:`Rule`,render:e=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{children:e.params.speed===`fast`?`Fast burn`:`Slow burn`}),(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:e.params.speed===`fast`?`over 14.4× on both the last 1h and 5m (about 2% of a 30-day budget in an hour)`:`over 6× on both the last 6h and 30m (about 5% of a 30-day budget in 6 hours)`})]})},{key:`v`,label:`Current`,num:!0,render:e=>e.last_value==null?`—`:`${e.last_value.toFixed(1)}×`},{key:`c`,label:`Notifies`,render:()=>(0,F.jsx)(`div`,{className:`flex gap-1`,children:s.channels.map((e,t)=>(0,F.jsx)(`span`,{className:`pill`,children:e.type},t))})}]}),a.events.length>0&&(0,F.jsx)(`div`,{className:`border-t border-line`,children:a.events.slice(0,8).map(e=>(0,F.jsxs)(`div`,{className:`flex gap-3 px-3.5 py-2 border-b border-[#1d1d26] last:border-0 text-[12px]`,children:[(0,F.jsx)(`span`,{className:`text-mute w-32 shrink-0`,children:xa(e.ts)}),e.state===`firing`?(0,F.jsx)(G,{kind:`crit`,children:`firing`}):(0,F.jsx)(G,{kind:`good`,children:e.state}),(0,F.jsx)(`span`,{className:`text-ink2 truncate`,children:e.message})]},e.id))}),(0,F.jsxs)(`div`,{className:`px-3.5 py-2 border-t border-line text-[11.5px] text-mute`,children:[`Delivery history is on `,(0,F.jsx)(Nn,{className:`link`,to:i(`/alerts`),children:`Alerts`}),`.`]})]})]})}function OV({label:e,value:t,sub:n,color:r}){return(0,F.jsxs)(`div`,{className:`rounded-lg border border-line px-3 py-2.5 flex flex-col gap-1`,children:[(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:e}),(0,F.jsx)(`div`,{className:`text-[20px] font-semibold tabular-nums leading-none`,style:r?{color:r}:void 0,children:t}),n&&(0,F.jsx)(`div`,{className:`text-mute text-[11px]`,children:n})]})}function kV({slo:e,onClose:t,onSaved:n}){let r=I(),[i,a]=(0,v.useState)({...e,channels:e.channels??[{type:`inapp`}]}),[o,s]=(0,v.useState)(``),c=P(`/api/operations?range=604800000&kind=${i.kind||`http`}${i.service?`&service=${encodeURIComponent(i.service)}`:``}`,[i.kind,i.service]),l=e=>i.channels?.find(t=>t.type===e),u=(e,t)=>{let n=(i.channels||[]).filter(t=>t.type!==e);a({...i,channels:t?[...n,{type:e,...t}]:n})};(0,v.useEffect)(()=>s(``),[i]);let d=async()=>{try{let e={...i,channels:[{type:`inapp`},...(i.channels||[]).filter(e=>e.type!==`inapp`)]};n((i.id?await N(`/api/slos/${i.id}`,{method:`PUT`,json:e}):await N(`/api/slos`,{method:`POST`,json:e})).id)}catch(e){s(e.message)}},f=i.target?100-i.target:null;return(0,F.jsxs)(Ua,{open:!0,onClose:t,title:i.id?`Edit SLO`:`New SLO`,wide:!0,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Name`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,placeholder:`Checkout availability`,value:i.name||``,onChange:e=>a({...i,name:e.target.value})})}),(0,F.jsx)(K,{label:`Measures`,children:(0,F.jsx)(za,{value:i.kind||`http`,onChange:e=>a({...i,kind:e,operation:null}),options:[{id:`http`,label:`HTTP requests`},{id:`job`,label:`Job runs`}]})}),(0,F.jsx)(K,{label:`Application`,children:(0,F.jsxs)(`select`,{className:`select`,value:i.service||``,onChange:e=>a({...i,service:e.target.value||null,operation:null}),children:[(0,F.jsx)(`option`,{value:``,children:`All applications`}),r.meta?.services.map(e=>(0,F.jsx)(`option`,{children:e.id},e.id))]})}),(0,F.jsxs)(K,{label:i.kind===`job`?`Job (optional)`:`Route (optional)`,hint:`leave empty to cover everything in the application`,children:[(0,F.jsx)(`input`,{className:`input mono`,list:`slo-ops`,placeholder:i.kind===`job`?`send-email`:`POST /checkout`,value:i.operation||``,onChange:e=>a({...i,operation:e.target.value||null})}),(0,F.jsx)(`datalist`,{id:`slo-ops`,children:[...new Set((c.data||[]).map(e=>e.name))].map(e=>(0,F.jsx)(`option`,{value:e},e))})]}),(0,F.jsx)(K,{label:`Target (% good)`,hint:f==null?void 0:`allows ${f.toFixed(3).replace(/0+$/,``).replace(/\.$/,``)}% bad events`,children:(0,F.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,F.jsx)(`input`,{className:`input w-28`,type:`number`,step:`0.01`,min:`1`,max:`99.999`,value:i.target??``,onChange:e=>a({...i,target:e.target.value===``?void 0:Number(e.target.value)})}),[99,99.5,99.9,99.95].map(e=>(0,F.jsx)(`button`,{type:`button`,className:`btn h-7 px-2 ${i.target===e?`btn-primary`:``}`,onClick:()=>a({...i,target:e}),children:e},e))]})}),(0,F.jsx)(K,{label:`Window`,children:(0,F.jsx)(za,{value:String(i.windowDays??7),onChange:e=>a({...i,windowDays:Number(e)}),options:[`1`,`7`,`14`,`28`,`30`].map(e=>({id:e,label:`${e}d`}))})}),(0,F.jsx)(K,{label:`Latency threshold (optional)`,hint:`if set, a successful event slower than this also counts as bad`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`input`,{className:`input w-32`,type:`number`,min:`1`,placeholder:`e.g. 800`,value:i.latencyMs??``,onChange:e=>a({...i,latencyMs:e.target.value===``?null:Number(e.target.value)})}),(0,F.jsx)(`span`,{className:`text-mute`,children:`ms`})]})}),(0,F.jsx)(K,{label:`Description (optional)`,children:(0,F.jsx)(`input`,{className:`input`,value:i.description||``,onChange:e=>a({...i,description:e.target.value||null})})})]}),(0,F.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-line grid grid-cols-2 gap-3`,children:[(0,F.jsx)(`div`,{className:`col-span-2 text-[12px] font-semibold`,children:`Burn-rate alerts notify`}),(0,F.jsx)(K,{label:`Slack incoming webhook URL`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`https://hooks.slack.com/services/…`,value:l(`slack`)?.url||``,onChange:e=>u(`slack`,e.target.value?{url:e.target.value}:null)})}),(0,F.jsx)(K,{label:`Generic webhook URL`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`https://…`,value:l(`webhook`)?.url||``,onChange:e=>u(`webhook`,e.target.value?{url:e.target.value}:null)})}),(0,F.jsx)(`div`,{className:`col-span-2`,children:(0,F.jsx)(uV,{value:l(`email`)?.to||``,onChange:e=>u(`email`,e.trim()?{to:e}:null)})})]}),o&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] mt-3`,children:o}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:t,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:d,children:`Save SLO`})]})]})}var AV={operational:{label:`Operational`,color:`#0ca30c`,kind:`good`},degraded:{label:`Degraded`,color:`#e6a100`,kind:`warn`},partial_outage:{label:`Partial outage`,color:`#ec835a`,kind:`serious`},major_outage:{label:`Major outage`,color:`#d03b3b`,kind:`crit`},no_data:{label:`No data`,color:`#3a3a48`,kind:`neutral`}},jV=[`investigating`,`identified`,`monitoring`,`resolved`],MV=e=>e[0].toUpperCase()+e.slice(1).replace(`_`,` `);function NV(){let e=I(),[t,n]=zn(),{data:r,error:i,reload:a}=P(`/api/status-pages`,[e.tick]),[o,s]=(0,v.useState)(null);if(i)return(0,F.jsx)(W,{error:i});if(!r)return(0,F.jsx)(U,{});let c=Number(t.get(`id`))||r[0]?.id||null,l=e=>{let r=new URLSearchParams(t);r.set(`id`,String(e)),n(r,{replace:!0})};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(ja,{icon:(0,F.jsx)(_i,{size:18,className:`text-brand`}),title:`Status pages`,sub:`Public pages for your customers. Each component's status comes from its live traffic, and incidents can be posted by hand or opened automatically during an outage.`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>s({autoIncidents:!0,published:!0,components:[]}),children:[(0,F.jsx)(hi,{size:14}),`New status page`]})}),r.length===0?(0,F.jsx)(H,{children:(0,F.jsx)(Ma,{title:`No status pages yet`,icon:(0,F.jsx)(_i,{size:22}),children:`Create a page, map components like "Checkout" or "API" to your applications and routes, and share the public link.`})}):(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @5xl:grid-cols-[300px_1fr] gap-3 items-start`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,F.jsxs)(`button`,{onClick:()=>l(e.id),className:`card text-left px-3.5 py-3 flex flex-col gap-1.5 ${c===e.id?`!border-[#5a2340]`:`hover:border-line2`}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium truncate`,children:e.title}),(0,F.jsx)(G,{kind:AV[e.overall].kind,children:AV[e.overall].label})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px] mono`,children:[`/status/`,e.slug,!e.published&&` · unpublished`]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[e.components.length,` component`,e.components.length===1?``:`s`,e.activeIncidents?` · ${e.activeIncidents} active incident${e.activeIncidents>1?`s`:``}`:``]})]},e.id))}),c&&(0,F.jsx)(PV,{id:c,onEdit:s,onDeleted:()=>{let e=new URLSearchParams(t);e.delete(`id`),n(e),a()},onChanged:a})]}),o&&(0,F.jsx)(LV,{page:o,onClose:()=>s(null),onSaved:e=>{s(null),a(),l(e)}})]})}function PV({id:e,onEdit:t,onDeleted:n,onChanged:r}){let i=I(),{data:a,error:o,reload:s}=P(`/api/status-pages/${e}`,[e,i.tick]),[c,l]=(0,v.useState)(null);if(o)return(0,F.jsx)(W,{error:o});if(!a)return(0,F.jsx)(U,{});let u=a.page,d=`${window.location.origin}/status/${u.slug}`,f=()=>{s(),r()},p=a.incidents.filter(e=>e.status!==`resolved`),m=a.incidents.filter(e=>e.status===`resolved`),h=e=>u.components.find(t=>t.id===e)?.name||`removed component`;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 min-w-0`,children:[(0,F.jsxs)(H,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[u.title,(0,F.jsx)(G,{kind:AV[a.overall].kind,children:AV[a.overall].label})]}),right:(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[(0,F.jsxs)(`a`,{className:`btn h-7`,href:`/status/${u.slug}`,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(zr,{size:13}),`Open public page`]}),(0,F.jsx)(Ra,{text:d,label:`Copy link`,className:`btn h-7`}),(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>t(u),children:[(0,F.jsx)(di,{size:13}),`Edit`]}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,title:`Delete`,onClick:async()=>{window.confirm(`Delete status page "${u.title}" and its incidents?`)&&(await N(`/api/status-pages/${u.id}`,{method:`DELETE`}),n())},children:(0,F.jsx)(Ii,{size:13})})]}),children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-1 text-[12.5px] text-ink2`,children:[(0,F.jsxs)(`span`,{children:[u.published?`Public at `:`Unpublished · `,(0,F.jsx)(`span`,{className:`mono`,children:d})]}),(0,F.jsxs)(`span`,{children:[`Automatic incidents: `,(0,F.jsx)(`b`,{children:u.autoIncidents?`on`:`off`})]})]}),u.description&&(0,F.jsx)(`div`,{className:`text-ink2 mt-2`,children:u.description})]}),(0,F.jsx)(H,{title:`Components`,sub:`status from the last 10 minutes of traffic; bars show the last 90 days`,pad:!1,children:a.components.length===0?(0,F.jsx)(Ma,{title:`No components`,children:`Edit the page to map components to applications and routes.`}):a.components.map(e=>(0,F.jsxs)(`div`,{className:`px-3.5 py-3 border-b border-[#1d1d26] last:border-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.name}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px] mono truncate`,children:[e.service,e.operation?` · ${e.operation}`:``,e.latencyMs?` · degraded above p95 ${e.latencyMs}ms`:``]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4 shrink-0 text-[12px]`,children:[(0,F.jsx)(`span`,{className:`text-mute tabular-nums`,children:e.live.requests?`${e.live.requests} req · ${ya(e.live.errorRate)} 5xx · p95 ${B(e.live.p95)}`:`no recent traffic`}),(0,F.jsx)(G,{kind:AV[e.status].kind,children:AV[e.status].label})]})]}),(0,F.jsx)(`div`,{className:`flex gap-[2px] h-6 mt-2`,children:e.days.map(e=>(0,F.jsx)(`span`,{className:`flex-1 rounded-[2px]`,style:{background:AV[e.status].color},title:`${new Date(e.day).toISOString().slice(0,10)}: ${AV[e.status].label}${e.requests?` · ${e.requests} req, ${ya(e.errorRate)} errors`:``}`},e.day))}),(0,F.jsxs)(`div`,{className:`flex justify-between text-mute text-[11px] mt-1`,children:[(0,F.jsx)(`span`,{children:`90 days ago`}),(0,F.jsx)(`span`,{children:e.uptime==null?``:`${e.uptime}% uptime`}),(0,F.jsx)(`span`,{children:`today`})]})]},e.id))}),(0,F.jsx)(H,{title:`Incidents`,right:(0,F.jsxs)(`button`,{className:`btn btn-primary h-7`,disabled:!u.components.length,onClick:()=>l({impact:`minor`,status:`investigating`,components:[]}),children:[(0,F.jsx)(ii,{size:13}),`Post incident`]}),pad:!1,children:a.incidents.length===0?(0,F.jsx)(Ma,{title:`No incidents`,children:`Post one when something is wrong, or let automatic incidents handle outages.`}):(0,F.jsx)(`div`,{children:[...p,...m.slice(0,10)].map(e=>(0,F.jsx)(FV,{inc:e,name:h,onChanged:f},e.id))})}),c&&(0,F.jsx)(IV,{page:u,inc:c,onClose:()=>l(null),onSaved:()=>{l(null),f()}})]})}function FV({inc:e,name:t,onChanged:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(e.status===`resolved`?`resolved`:e.status),s=e.status!==`resolved`,c=async()=>{await N(`/api/incidents/${e.id}`,{method:`PATCH`,json:{status:a,message:r}}),i(``),n()},l=e.impact===`critical`?`crit`:e.impact===`major`?`serious`:`warn`;return(0,F.jsxs)(`div`,{className:`px-3.5 py-3 border-b border-[#1d1d26] last:border-0 flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,F.jsx)(`span`,{className:`font-medium truncate`,children:e.title}),(0,F.jsx)(G,{kind:s?l:`good`,children:s?`${e.impact} · ${e.status}`:`resolved`}),e.auto&&(0,F.jsx)(`span`,{className:`pill`,children:`automatic`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 text-mute text-[11.5px]`,children:[Sa(e.created,!0),e.resolvedAt&&` → ${Sa(e.resolvedAt,!0)}`,(0,F.jsx)(`button`,{className:`btn btn-ghost h-6 px-1.5`,title:`Delete`,onClick:async()=>{window.confirm(`Delete this incident? It disappears from the public page.`)&&(await N(`/api/incidents/${e.id}`,{method:`DELETE`}),n())},children:(0,F.jsx)(Wi,{size:12})})]})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[11.5px]`,children:[`Affects: `,e.components.map(t).join(`, `)||`—`]}),(0,F.jsx)(`div`,{className:`flex flex-col gap-1 border-l border-line2 pl-3`,children:[...e.updates].reverse().map((e,t)=>(0,F.jsxs)(`div`,{className:`text-[12.5px]`,children:[(0,F.jsx)(`b`,{className:`capitalize`,children:e.status}),` `,(0,F.jsxs)(`span`,{className:`text-ink2`,children:[`— `,e.text]}),` `,(0,F.jsx)(`span`,{className:`text-mute text-[11px]`,children:xa(e.ts)})]},t))}),s&&(0,F.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,F.jsx)(`select`,{className:`select`,value:a,onChange:e=>o(e.target.value),children:jV.map(e=>(0,F.jsx)(`option`,{value:e,children:MV(e)},e))}),(0,F.jsx)(`input`,{className:`input flex-1`,placeholder:a===`resolved`?`What fixed it (optional)`:`Post an update for customers`,value:r,onChange:e=>i(e.target.value)}),(0,F.jsx)(`button`,{className:`btn`,disabled:!r&&a===e.status,onClick:c,children:a===`resolved`?`Resolve`:`Post update`})]})]})}function IV({page:e,inc:t,onClose:n,onSaved:r}){let[i,a]=(0,v.useState)({title:t.title||``,impact:t.impact||`minor`,status:t.status||`investigating`,components:t.components||[],message:``}),[o,s]=(0,v.useState)(``),c=e=>a({...i,components:i.components.includes(e)?i.components.filter(t=>t!==e):[...i.components,e]});return(0,F.jsx)(Ua,{open:!0,onClose:n,title:`Post incident`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(K,{label:`Title`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,placeholder:`Checkout errors for some customers`,value:i.title,onChange:e=>a({...i,title:e.target.value})})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Impact`,hint:`minor = degraded, major = partial outage, critical = major outage`,children:(0,F.jsx)(za,{value:i.impact,onChange:e=>a({...i,impact:e}),options:[{id:`minor`,label:`Minor`},{id:`major`,label:`Major`},{id:`critical`,label:`Critical`}]})}),(0,F.jsx)(K,{label:`Status`,children:(0,F.jsx)(`select`,{className:`select`,value:i.status,onChange:e=>a({...i,status:e.target.value}),children:jV.filter(e=>e!==`resolved`).map(e=>(0,F.jsx)(`option`,{value:e,children:MV(e)},e))})})]}),(0,F.jsx)(K,{label:`Affected components`,children:(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.components.map(e=>(0,F.jsxs)(`label`,{className:`pill cursor-pointer !py-1 ${i.components.includes(e.id)?`!border-[#ff3d7f] !text-white`:``}`,children:[(0,F.jsx)(`input`,{type:`checkbox`,className:`hidden`,checked:i.components.includes(e.id),onChange:()=>c(e.id)}),e.name]},e.id))})}),(0,F.jsx)(K,{label:`First update (shown publicly)`,children:(0,F.jsx)(`textarea`,{className:`input`,rows:3,placeholder:`We are investigating elevated error rates on checkout.`,value:i.message,onChange:e=>a({...i,message:e.target.value})})}),o&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a]`,children:o}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:n,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,disabled:!i.title||!i.components.length,onClick:async()=>{try{await N(`/api/status-pages/${e.id}/incidents`,{method:`POST`,json:i}),r()}catch(e){s(e.message)}},children:`Post incident`})]})]})})}function LV({page:e,onClose:t,onSaved:n}){let r=I(),[i,a]=(0,v.useState)({...e,components:e.components??[]}),[o,s]=(0,v.useState)(``),c=i.components||[],l=(e,t)=>a({...i,components:c.map((n,r)=>r===e?{...n,...t}:n)});return(0,F.jsxs)(Ua,{open:!0,onClose:t,title:i.id?`Edit status page`:`New status page`,wide:!0,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(K,{label:`Title`,children:(0,F.jsx)(`input`,{className:`input`,autoFocus:!0,placeholder:`Acme Status`,value:i.title||``,onChange:e=>a({...i,title:e.target.value})})}),(0,F.jsx)(K,{label:`URL slug`,hint:`public at /status/${i.slug||(i.title||``).toLowerCase().replace(/[^\w]+/g,`-`)||`…`}`,children:(0,F.jsx)(`input`,{className:`input mono`,placeholder:`from the title`,value:i.slug||``,onChange:e=>a({...i,slug:e.target.value})})}),(0,F.jsx)(`div`,{className:`col-span-2`,children:(0,F.jsx)(K,{label:`Description (optional)`,children:(0,F.jsx)(`input`,{className:`input`,placeholder:`Live status of Acme's APIs and checkout`,value:i.description||``,onChange:e=>a({...i,description:e.target.value||null})})})}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i.published!==!1,onChange:e=>a({...i,published:e.target.checked})}),`Published (anyone with the link can view it)`]}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i.autoIncidents!==!1,onChange:e=>a({...i,autoIncidents:e.target.checked})}),`Open and resolve incidents automatically on outages`]})]}),(0,F.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-line flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-[12px] font-semibold`,children:`Components`}),(0,F.jsxs)(`button`,{className:`btn h-7`,onClick:()=>a({...i,components:[...c,{id:``,name:``,service:r.meta?.services[0]?.id||``,operation:null,latencyMs:null}]}),children:[(0,F.jsx)(hi,{size:13}),`Add component`]})]}),(0,F.jsx)(`div`,{className:`text-mute text-[11.5px]`,children:`Customers only see the component name and its status. The application and route stay private.`}),c.length===0&&(0,F.jsx)(`div`,{className:`text-mute text-[12.5px] py-2`,children:`No components yet.`}),c.map((e,t)=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[1.2fr_1fr_1.2fr_110px_auto] gap-2 items-center`,children:[(0,F.jsx)(`input`,{className:`input`,placeholder:`Name, e.g. Checkout`,value:e.name,onChange:e=>l(t,{name:e.target.value})}),(0,F.jsxs)(`select`,{className:`select`,value:e.service,onChange:e=>l(t,{service:e.target.value}),children:[(0,F.jsx)(`option`,{value:``,children:`Application…`}),r.meta?.services.map(e=>(0,F.jsx)(`option`,{children:e.id},e.id))]}),(0,F.jsx)(`input`,{className:`input mono`,placeholder:`Route (optional)`,value:e.operation||``,onChange:e=>l(t,{operation:e.target.value||null})}),(0,F.jsx)(`input`,{className:`input`,type:`number`,placeholder:`p95 ms`,title:`Degraded when p95 is above this (optional)`,value:e.latencyMs??``,onChange:e=>l(t,{latencyMs:e.target.value===``?null:Number(e.target.value)})}),(0,F.jsx)(`button`,{className:`btn btn-ghost h-7 px-2`,onClick:()=>a({...i,components:c.filter((e,n)=>n!==t)}),children:(0,F.jsx)(Ii,{size:13})})]},t))]}),o&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] mt-3`,children:o}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:t,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn btn-primary`,onClick:async()=>{try{n((i.id?await N(`/api/status-pages/${i.id}`,{method:`PUT`,json:i}):await N(`/api/status-pages`,{method:`POST`,json:i})).id)}catch(e){s(e.message)}},children:`Save page`})]})]})}var RV={good:Ar,warn:kr,bad:li,neutral:jr};function zV(e){if(!e)return``;let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.round(t/6e4);if(n<60)return`${n} minute${n===1?``:`s`} ago`;let r=Math.round(t/36e5);if(r<24)return`${r} hour${r===1?``:`s`} ago`;let i=Math.round(t/864e5);return i===1?`yesterday`:`${i} days ago`}function BV({n:e,title:t,right:n,children:r,className:i=``}){return(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-3.5 ${i}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsx)(`h2`,{className:`text-[16px] font-semibold tracking-tight`,children:t}),e!=null&&e>0&&(0,F.jsx)(`span`,{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full bg-[#22222d] text-ink2`,children:e}),(0,F.jsx)(`div`,{className:`flex-1`}),n]}),r]})}function VV({question:e,label:t=`Ask Obzeri`,className:n=`btn btn-ghost h-7 px-2 text-[12px]`}){return(0,F.jsxs)(`button`,{className:n,title:`Ask Obzeri: ${e}`,onClick:t=>{t.stopPropagation(),ir(e)},children:[(0,F.jsx)(Ni,{size:13,className:`text-brand`}),t]})}function HV({title:e,children:t}){return(0,F.jsxs)(`div`,{className:`tone-good rounded-xl px-4 py-5 flex items-center gap-3`,style:{background:`var(--tone-bg)`},children:[(0,F.jsx)(Ar,{size:22,style:{color:`var(--tone)`},className:`shrink-0`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium text-[14px]`,children:e}),t&&(0,F.jsx)(`div`,{className:`text-ink2 text-[12.5px] mt-0.5`,children:t})]})]})}var UV={"15m":`the last 15 minutes`,"1h":`the last hour`,"6h":`the last 6 hours`,"24h":`the last 24 hours`,"7d":`the last 7 days`,"30d":`the last 30 days`,custom:`the selected time`},WV={healthy:{tone:`good`,Icon:Ar},attention:{tone:`warn`,Icon:kr},broken:{tone:`bad`,Icon:li},idle:{tone:`neutral`,Icon:si},no_data:{tone:`neutral`,Icon:si}},GV={secret:Oi,silent:gi,error:yr,endpoint:Si,jobs:Ui,alert:hr,release:yi,new_errors:yr,traffic:Ri,speed:Hr,failures:lr};function KV(){let e=I(),{data:t,error:n}=P(`/api/simple${e.q()}`,[e.tick]);return n?(0,F.jsx)(W,{error:n}):t?t.health===`no_data`?(0,F.jsx)(Lz,{simple:!0}):(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsx)(qV,{d:t}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-5 gap-5 items-start`,children:[(0,F.jsxs)(`div`,{className:`@4xl:col-span-3 flex flex-col gap-5`,children:[(0,F.jsx)(ZV,{items:t.broke}),(0,F.jsx)(QV,{items:t.changed,basis:t.usualBasis})]}),(0,F.jsxs)(`div`,{className:`@4xl:col-span-2 flex flex-col gap-5`,children:[(0,F.jsx)(eH,{items:t.todo}),(0,F.jsx)(nH,{suggestions:t.suggestions})]})]})]}):(0,F.jsx)(U,{})}function qV({d:e}){let t=I(),n=WV[e.health];return(0,F.jsxs)(`section`,{className:`card tone-${n.tone} p-6 grid grid-cols-1 @4xl:grid-cols-[1fr_420px] gap-6`,style:{borderColor:`var(--tone-line)`,background:`linear-gradient(135deg, var(--tone-bg), transparent 55%), var(--color-panel)`},children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-[11.5px] uppercase tracking-wider font-semibold text-mute`,children:`Is my app healthy?`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(`div`,{className:`w-14 h-14 rounded-full flex items-center justify-center shrink-0 ${e.health===`healthy`?`health-orb`:``}`,style:{background:`var(--tone-bg)`,border:`1px solid var(--tone-line)`},children:(0,F.jsx)(n.Icon,{size:28,style:{color:`var(--tone)`}})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`h1`,{className:`text-[26px] font-semibold tracking-tight leading-tight`,children:e.headline}),(0,F.jsx)(`p`,{className:`text-ink2 text-[14px] mt-1 leading-relaxed`,children:e.summary})]})]}),(0,F.jsx)(YV,{points:e.timeline,bucketMs:e.bucketMs,label:UV[t.range]||`this period`})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 @2xl:@max-4xl:grid-cols-4 gap-3 content-start`,children:e.vitals.map(e=>(0,F.jsx)(JV,{v:e},e.id))})]})}function JV({v:e}){let t=RV[e.tone];return(0,F.jsxs)(`div`,{className:`tone-${e.tone} rounded-xl border border-line bg-[#111118] px-3.5 py-3 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12px] text-ink2 font-medium`,children:[(0,F.jsx)(t,{size:13,style:{color:`var(--tone)`}}),e.label]}),(0,F.jsx)(`div`,{className:`text-[22px] font-semibold tracking-tight mt-1 tabular-nums`,style:{color:e.tone===`bad`||e.tone===`warn`?`var(--tone)`:void 0},children:e.value}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute leading-snug mt-0.5`,children:e.note}),e.usual&&(0,F.jsx)(`div`,{className:`text-[11.5px] text-ink2 mt-1`,children:e.usual})]})}function YV({points:e,bucketMs:t,label:n}){if(!e.length)return null;let r=Math.max(1,...e.map(e=>e.count)),i=e=>e.count?e.failed/e.count>=.05?`#e05252`:e.failed/e.count>=.01?`#e8a92a`:`#36b56a`:`#2a2a35`,a=e.length*t;return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`flex items-end gap-[2px] h-[54px]`,children:e.map(e=>(0,F.jsx)(`div`,{className:`flex-1 rounded-[3px] min-w-[2px] hover:opacity-80`,style:{height:`${Math.max(8,e.count/r*100)}%`,background:i(e)},title:`${Sa(e.t,a>864e5)} · ${V(e.count)} requests${e.failed?` · ${V(e.failed)} failed`:``}`},e.t))}),(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-x-4 gap-y-1 text-[11px] text-mute mt-1.5`,children:[(0,F.jsx)(`span`,{className:`whitespace-nowrap`,children:n.charAt(0).toUpperCase()+n.slice(1)}),(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 whitespace-nowrap`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`i`,{className:`w-2 h-2 rounded-sm inline-block bg-[#36b56a]`}),`fine`]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`i`,{className:`w-2 h-2 rounded-sm inline-block bg-[#e8a92a]`}),`some failures`]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`i`,{className:`w-2 h-2 rounded-sm inline-block bg-[#e05252]`}),`many failures`]}),(0,F.jsx)(`span`,{children:`now`})]})]})]})}function XV({f:e,timeline:t}){let n=ht(),r=L(),i=GV[e.kind]||yr;return(0,F.jsxs)(`div`,{className:`tone-${e.tone} group flex items-start gap-3 rounded-xl px-3.5 py-3 border border-transparent ${e.link?`cursor-pointer hover:bg-[#181821] hover:border-line`:``}`,onClick:()=>e.link&&n(r(e.link)),children:[(0,F.jsx)(`div`,{className:`${t?`w-8 h-8`:`w-9 h-9`} rounded-lg flex items-center justify-center shrink-0`,style:{background:`var(--tone-bg)`},children:(0,F.jsx)(i,{size:t?15:17,style:{color:`var(--tone)`}})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[13.5px]`,children:e.title}),e.isNew&&(0,F.jsx)(`span`,{className:`text-[10.5px] font-semibold px-1.5 py-px rounded-full`,style:{color:`var(--tone)`,background:`var(--tone-bg)`},children:`NEW`})]}),(0,F.jsx)(`div`,{className:`text-ink2 text-[12.5px] mt-0.5 leading-relaxed break-words`,children:e.detail}),e.ts&&(0,F.jsx)(`div`,{className:`text-mute text-[11.5px] mt-1`,children:t?zV(e.ts):`last seen ${zV(e.ts)}`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 opacity-70 group-hover:opacity-100`,children:[e.ask&&(0,F.jsx)(VV,{question:e.ask,label:`Ask`}),e.link&&(0,F.jsx)(Er,{size:16,className:`text-mute`})]})]})}function ZV({items:e}){let[t,n]=(0,v.useState)(!1),r=t?e:e.slice(0,5);return(0,F.jsx)(BV,{title:`What broke?`,n:e.length,children:e.length===0?(0,F.jsx)(HV,{title:`Nothing is broken`,children:`No crashes, failing pages, leaks or firing alerts in this period.`}):(0,F.jsxs)(`div`,{className:`flex flex-col -mx-1.5`,children:[r.map(e=>(0,F.jsx)(XV,{f:e},e.id)),e.length>5&&(0,F.jsx)(`button`,{className:`btn btn-ghost self-start ml-1.5 mt-1`,onClick:()=>n(!t),children:t?`Show less`:`Show ${e.length-5} more`})]})})}function QV({items:e,basis:t}){return(0,F.jsx)(BV,{title:`What changed?`,n:e.length,right:t?(0,F.jsxs)(`span`,{className:`text-[11.5px] text-mute`,title:`Compared with ${t}`,children:[`vs a normal `,t.includes(`week`)?`week`:`day`]}):null,children:e.length===0?(0,F.jsxs)(`div`,{className:`text-ink2 text-[13px] px-1`,children:[`Nothing new: no deploys, no new kinds of errors, and traffic and speed look `,t?`like they usually do at this time`:`steady`,`.`]}):(0,F.jsx)(`div`,{className:`flex flex-col -mx-1.5`,children:e.map(e=>(0,F.jsx)(XV,{f:e,timeline:!0},e.id))})})}var $V={now:{label:`Do now`,tone:`bad`},soon:{label:`Soon`,tone:`warn`},later:{label:`When you can`,tone:`neutral`}};function eH({items:e}){let[t,n]=(0,v.useState)(e[0]?.id??null);return(0,F.jsx)(BV,{title:`What should I do?`,n:e.length,children:e.length===0?(0,F.jsx)(HV,{title:`Nothing to do right now`,children:`Go build something. We will tell you when that changes.`}):(0,F.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,r)=>(0,F.jsx)(tH,{t:e,n:r+1,open:t===e.id,onToggle:()=>n(t===e.id?null:e.id)},e.id))})})}function tH({t:e,n:t,open:n,onToggle:r}){let i=ht(),a=L(),o=$V[e.urgency];return(0,F.jsxs)(`li`,{className:`tone-${o.tone} rounded-xl border bg-[#111118] ${n?`border-line2`:`border-line`}`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-start gap-3 px-3.5 py-3 text-left`,onClick:r,"aria-expanded":n,children:[(0,F.jsx)(`span`,{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-semibold shrink-0 mt-px`,style:{background:`var(--tone-bg)`,color:`var(--tone)`},children:t}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[13.5px]`,children:e.title}),(0,F.jsx)(`span`,{className:`text-[10.5px] font-semibold uppercase tracking-wide`,style:{color:`var(--tone)`},children:o.label})]}),!n&&(0,F.jsx)(`span`,{className:`block text-mute text-[12px] truncate mt-0.5`,children:e.why})]}),n?(0,F.jsx)(wr,{size:15,className:`text-mute mt-1`}):(0,F.jsx)(Er,{size:15,className:`text-mute mt-1`})]}),n&&(0,F.jsxs)(`div`,{className:`px-3.5 pb-3.5 pl-[50px] flex flex-col gap-3`,children:[(0,F.jsx)(`div`,{className:`text-ink2 text-[12.5px] leading-relaxed`,children:e.why}),e.steps.length>0&&(0,F.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.steps.map((e,t)=>(0,F.jsxs)(`li`,{className:`flex gap-2 text-[12.5px]`,children:[(0,F.jsxs)(`span`,{className:`text-mute tabular-nums`,children:[t+1,`.`]}),(0,F.jsx)(`span`,{children:e})]},t))}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.executionId&&(0,F.jsx)(Ra,{className:`btn btn-primary h-8`,label:`Copy fix prompt`,text:async()=>(await N(`/api/executions/${e.executionId}/prompt`)).prompt}),e.link&&(0,F.jsxs)(`button`,{className:`btn h-8 ${e.executionId?``:`btn-primary`}`,onClick:()=>i(a(e.link)),children:[e.linkLabel||`Open`,(0,F.jsx)(Er,{size:13})]}),e.ask&&(0,F.jsx)(VV,{question:e.ask,className:`btn h-8`})]}),e.executionId&&(0,F.jsxs)(`div`,{className:`text-[11.5px] text-mute flex items-center gap-1.5`,children:[(0,F.jsx)(Hi,{size:12}),`The prompt has the error, the code around it and what happened, ready for Cursor, Claude Code or Copilot.`]})]})]})}function nH({suggestions:e}){let[t,n]=(0,v.useState)(``);return(0,F.jsxs)(BV,{title:`Ask Obzeri`,children:[(0,F.jsxs)(`form`,{className:`relative`,onSubmit:e=>{e.preventDefault(),t.trim()&&(ir(t.trim()),n(``))},children:[(0,F.jsx)(Ni,{size:15,className:`absolute left-3 top-1/2 -translate-y-1/2 text-brand`}),(0,F.jsx)(`input`,{dir:`auto`,className:`input w-full h-11 pl-9 pr-11 text-[13.5px] rounded-xl`,placeholder:`Ask anything about your app…`,value:t,onChange:e=>n(e.target.value)}),(0,F.jsx)(`button`,{className:`absolute right-1.5 top-1/2 -translate-y-1/2 btn btn-primary h-8 w-8 !p-0 justify-center rounded-lg`,disabled:!t.trim(),title:`Ask`,children:(0,F.jsx)(pr,{size:15})})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,F.jsx)(`button`,{className:`text-left rounded-full border border-line hover:border-line2 hover:bg-panel2 px-3 py-1.5 text-[12px] text-ink2 hover:text-ink max-w-full truncate`,title:e,onClick:()=>ir(e),children:e},e))}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:`Plain answers from your app's own data, in any language.`})]})}function rH(){let e=I(),{data:t,error:n,setData:r}=P(`/api/simple/alerts`,[e.tick]);if((0,v.useEffect)(()=>{N(`/api/alerts/events/read`,{method:`POST`}).then(()=>e.refresh()).catch(()=>{})},[]),n)return(0,F.jsx)(W,{error:n});if(!t)return(0,F.jsx)(U,{});let i=async e=>r(await N(`/api/simple/alerts`,{method:`PUT`,json:e}));return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(hr,{size:22,className:`text-brand`}),`Alerts`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Hear about problems before your users tell you.`})]}),(0,F.jsx)(iH,{firing:t.firing}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-5 gap-5 items-start`,children:[(0,F.jsxs)(`div`,{className:`@4xl:col-span-3 flex flex-col gap-5`,children:[(0,F.jsx)(BV,{title:`Tell me when…`,children:(0,F.jsx)(`div`,{className:`flex flex-col divide-y divide-[#1f1f29]`,children:t.presets.map(e=>(0,F.jsx)(oH,{p:e,onChange:t=>i({presets:{[e.id]:t}})},e.id))})}),(0,F.jsx)(cH,{events:t.events})]}),(0,F.jsx)(`div`,{className:`@4xl:col-span-2`,children:(0,F.jsx)(sH,{data:t,onSave:e=>i({channels:e})})})]})]})}function iH({firing:e}){let t=I(),n=ht(),r=L(),i=rr(),a=t.meta?.openSecrets||0;return!e.length&&!a?(0,F.jsx)(HV,{title:`All quiet right now`,children:`No alert is firing. The switches below decide what wakes you up.`}):(0,F.jsxs)(`section`,{className:`card tone-bad p-5 flex flex-col gap-2`,style:{borderColor:`var(--tone-line)`,background:`linear-gradient(135deg, var(--tone-bg), transparent 60%), var(--color-panel)`},children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 font-semibold text-[15px]`,children:[(0,F.jsx)(mr,{size:17,style:{color:`var(--tone)`}}),`Happening right now`]}),a>0&&(0,F.jsxs)(`button`,{className:`flex items-center gap-3 text-left rounded-lg px-2 py-2 hover:bg-[#1c1c25]`,onClick:()=>n(r(`/secrets`)),children:[(0,F.jsx)(Oi,{size:16,style:{color:`var(--tone)`}}),(0,F.jsxs)(`span`,{className:`flex-1 text-[13.5px]`,children:[a===1?`A secret is`:`${a} secrets are`,` being written to your logs`]}),(0,F.jsx)(Er,{size:15,className:`text-mute`})]}),e.map(e=>(0,F.jsxs)(`button`,{className:`flex items-center gap-3 text-left rounded-lg px-2 py-2 hover:bg-[#1c1c25]`,onClick:()=>i(`/alerts?rule=${e.id}`),children:[(0,F.jsx)(hr,{size:16,style:{color:`var(--tone)`}}),(0,F.jsx)(`span`,{className:`flex-1 text-[13.5px]`,children:e.name}),e.since&&(0,F.jsxs)(`span`,{className:`text-mute text-[12px]`,children:[`since `,zV(e.since)]}),(0,F.jsx)(Er,{size:15,className:`text-mute`})]},e.id))]})}function aH({on:e,onChange:t,label:n}){return(0,F.jsx)(`button`,{role:`switch`,"aria-checked":e,"aria-label":n,onClick:()=>t(!e),className:`relative w-[42px] h-[24px] rounded-full shrink-0 transition-colors`,style:{background:e?`linear-gradient(120deg, #ff3d7f, #a855f7)`:`#2c2c38`},children:(0,F.jsx)(`span`,{className:`absolute top-[3px] w-[18px] h-[18px] rounded-full bg-white shadow transition-[left]`,style:{left:e?21:3}})})}function oH({p:e,onChange:t}){let[n,r]=(0,v.useState)(!1);return(0,F.jsxs)(`div`,{className:`flex items-center gap-4 py-3.5`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[14px]`,children:e.label}),e.firing&&(0,F.jsx)(`span`,{className:`tone-bad text-[10.5px] font-semibold px-1.5 py-px rounded-full`,style:{color:`var(--tone)`,background:`var(--tone-bg)`},children:`FIRING`})]}),(0,F.jsxs)(`div`,{className:`text-mute text-[12.5px] mt-0.5`,children:[e.description,e.lastFired?` · last time ${zV(e.lastFired)}`:``]})]}),(0,F.jsx)(aH,{on:e.enabled,label:e.label,onChange:async e=>{r(!0);try{await t(e)}finally{r(!1)}}}),n&&(0,F.jsx)(`span`,{className:`sr-only`,children:`saving`})]})}function sH({data:e,onSave:t}){let n=rr(),[r,i]=(0,v.useState)(e.channels.email),[a,o]=(0,v.useState)(e.channels.slack),[s,c]=(0,v.useState)(null),l=r!==e.channels.email||a!==e.channels.slack,u=!!(e.channels.email||e.channels.slack);return(0,F.jsxs)(BV,{title:`Where should we tell you?`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 text-[13px]`,children:[(0,F.jsx)(oi,{size:16,className:`text-mute`}),(0,F.jsx)(`span`,{className:`flex-1`,children:`In this dashboard`}),(0,F.jsx)(`span`,{className:`text-mute text-[12px]`,children:`always on`})]}),(0,F.jsxs)(`form`,{className:`flex flex-col gap-3.5`,onSubmit:async e=>{e.preventDefault();try{await t({email:r,slack:a}),c({ok:!0,text:`Saved.`})}catch(e){c({ok:!1,text:e.message})}},children:[(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,F.jsx)(ri,{size:15,className:`text-mute`}),`Email`]}),(0,F.jsx)(`input`,{className:`input h-9`,type:`text`,placeholder:`you@example.com`,value:r,onChange:e=>i(e.target.value),disabled:!e.emailReady&&!r}),!e.emailReady&&(0,F.jsxs)(`span`,{className:`text-[11.5px] text-mute`,children:[`Email needs a mail server first. `,(0,F.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>n(`/integrations/email`),children:`Set one up`})]})]}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,F.jsx)(Ai,{size:15,className:`text-mute`}),`Slack`]}),(0,F.jsx)(`input`,{className:`input h-9`,type:`url`,placeholder:`https://hooks.slack.com/services/…`,value:a,onChange:e=>o(e.target.value)}),(0,F.jsxs)(`a`,{className:`text-[11.5px] link inline-flex items-center gap-1 self-start`,href:`https://api.slack.com/messaging/webhooks`,target:`_blank`,rel:`noreferrer`,children:[`How to get a Slack webhook`,(0,F.jsx)(zr,{size:11})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`button`,{className:`btn btn-primary h-9`,disabled:!l,children:`Save`}),(0,F.jsxs)(`button`,{type:`button`,className:`btn h-9`,disabled:!u||l,title:l?`Save first`:void 0,onClick:async()=>{c(null);try{let e=(await N(`/api/simple/alerts/test`,{method:`POST`})).deliveries.filter(e=>e.type!==`inapp`&&!e.ok);c(e.length?{ok:!1,text:`Could not reach ${e.map(e=>`${e.type}${e.error?` (${e.error})`:``}`).join(`, `)}`}:{ok:!0,text:`Test sent. Check your inbox or Slack.`})}catch(e){c({ok:!1,text:e.message})}},children:[(0,F.jsx)(Ti,{size:13}),`Send a test`]})]}),s&&(0,F.jsxs)(`div`,{className:`text-[12.5px] flex items-center gap-1.5 ${s.ok?`text-[#5ad17a]`:`text-[#ff8a8a]`}`,children:[s.ok&&(0,F.jsx)(Ar,{size:13}),s.text]})]}),(0,F.jsxs)(`div`,{className:`text-[11.5px] text-mute border-t border-line pt-3`,children:[`Webhooks, Discord, per-route rules and quiet hours are in `,(0,F.jsx)(`button`,{className:`link`,onClick:()=>n(`/alerts`),children:`Advanced → Alerts`}),`.`]})]})}function cH({events:e}){let[t,n]=(0,v.useState)(!1),r=t?e:e.slice(0,8);return(0,F.jsx)(BV,{title:`Recent alerts`,n:e.length,children:e.length===0?(0,F.jsx)(`div`,{className:`text-ink2 text-[13px]`,children:`Nothing has fired yet.`}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[r.map(e=>{let t=e.state===`firing`?`bad`:`good`;return(0,F.jsxs)(`div`,{className:`tone-${t} flex items-start gap-3 px-1 py-2`,children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full mt-[7px] shrink-0`,style:{background:`var(--tone)`}}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`text-[13px]`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e.rule}),` `,(0,F.jsxs)(`span`,{className:`text-mute`,children:[`· `,e.state===`firing`?`went off`:`back to normal`,` `,zV(e.ts)]})]}),(0,F.jsx)(`div`,{className:`text-ink2 text-[12px] mt-0.5 break-words`,children:e.message})]})]},e.id)}),e.length>8&&(0,F.jsx)(`button`,{className:`btn btn-ghost self-start`,onClick:()=>n(!t),children:t?`Show less`:`Show ${e.length-8} more`})]})})}function lH(){let e=I(),t=rr(),n=P(`/api/overview${e.q()}`,[e.tick]),r=P(`/api/runtime${e.q()}`,[e.tick]),i=P(`/api/metrics${e.q()}`,[e.tick]);if(n.error)return(0,F.jsx)(W,{error:n.error});if(!n.data)return(0,F.jsx)(U,{});let a=n.data,o=a.kpis,s=o.usual&&o.usual.requests>=50?o.usual:null,c=KR(a.series.points,a.band),l=qR(a.band),u=UV[e.range]||`this period`,d=[{key:`count`,label:`Requests`,color:zR[0],type:`bar`},...l?[{...l.calls,label:`Usual`}]:[]],f=[...l?[{...l.p95,label:`Normal range`}]:[],{key:`p95`,label:`Slowest 5%`,color:zR[1],type:`line`},{key:`avg`,label:`Average`,color:zR[2],type:`line`}],p=[{key:`s5xx`,label:`Failed (server errors)`,color:BR.crit,type:`bar`,stack:`e`},{key:`s4xx`,label:`Rejected (bad requests)`,color:BR.warn,type:`bar`,stack:`e`}],m=new Map;for(let e of r.data||[])for(let t of e.points){let e=m.get(t.t)||{t:t.t,cpu:null,mem:null};t.cpuUtil!=null&&(e.cpu=Math.max(e.cpu??0,t.cpuUtil)),t.memUtil!=null&&(e.mem=Math.max(e.mem??0,t.memUtil)),m.set(t.t,e)}let h=[...m.values()].sort((e,t)=>e.t-t.t),g=h[h.length-1],_=[{key:`cpu`,label:`CPU`,color:zR[0],type:`line`},{key:`mem`,label:`Memory`,color:zR[6],type:`line`}],v=Math.max(g?.cpu??0,g?.mem??0),y=s?.requests?o.requests/s.requests:null,b=s?.p95&&o.p95?o.p95/s.p95:null,x=o.requests>=20&&o.failureRate>=5?`bad`:o.failureRate>=1&&o.failed>=3?`warn`:`good`,S=[...new Set((i.data||[]).map(e=>e.name))];return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(Sr,{size:22,className:`text-brand`}),`Metrics`]}),(0,F.jsxs)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:[`How your app did over `,u,s?`, next to what is normal for this time`:``,`.`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-2 gap-5`,children:[(0,F.jsx)(uH,{title:`Traffic`,what:`How many requests your app handled.`,value:V(o.requests),unit:`requests`,status:y==null?{tone:`neutral`,text:o.rpm?`About ${V(o.rpm)} a minute`:`No requests yet`}:y>=1.5?{tone:`neutral`,text:`${y.toFixed(1)}× busier than usual`}:y<=.67?{tone:`warn`,text:`${Math.round((1-y)*100)}% quieter than usual`}:{tone:`good`,text:`About as busy as usual`},series:d,children:(0,F.jsx)(UR,{data:c,series:d,height:190,zoom:!1,fmt:e=>V(e)})}),(0,F.jsx)(uH,{title:`Speed`,what:`How long requests take. Lower is better; the slowest 5% is what unhappy users feel.`,value:B(o.p95),unit:`slowest 5%`,status:o.p95==null?{tone:`neutral`,text:`Nothing to time yet`}:b!=null&&b>=1.4?{tone:`warn`,text:`Slower than usual (normally ${B(s.p95)})`}:o.p95>=1500?{tone:`warn`,text:`On the slow side`}:{tone:`good`,text:s?.p95?`Normal (usually ${B(s.p95)})`:`Fast`},series:f,children:(0,F.jsx)(UR,{data:c,series:f,height:190,zoom:!1,fmt:e=>B(e),yFmt:e=>e>=1e3?`${+(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`})}),(0,F.jsx)(uH,{title:`Errors`,what:`Requests that failed because of your server (red), and requests your app rejected, like a wrong password or a missing page (yellow).`,value:ya(o.failureRate),unit:`failed`,status:{tone:x,text:o.failed?`${V(o.failed)} failed, ${V(o.clientErrors)} rejected`:`No server errors`},series:p,children:(0,F.jsx)(UR,{data:c,series:p,height:190,zoom:!1,fmt:e=>V(e)})}),(0,F.jsx)(uH,{title:`Server load`,what:`How much of its CPU and memory your app uses. Near 100% it slows down or restarts.`,value:g?`${Math.round(v)}%`:`—`,unit:`busiest`,status:g?v>=90?{tone:`bad`,text:`Close to the limit`}:v>=75?{tone:`warn`,text:`Busy`}:{tone:`good`,text:`Plenty of room`}:{tone:`neutral`,text:`No server stats yet`},series:_,children:r.data?(0,F.jsx)(UR,{data:h,series:_,height:190,zoom:!1,fmt:e=>`${Math.round(e)}%`,yDomain:[0,`auto`]}):(0,F.jsx)(U,{})})]}),S.length>0&&(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-[16px] font-semibold`,children:`Your own numbers`}),(0,F.jsx)(`span`,{className:`text-mute text-[12.5px]`,children:`counters and gauges your code reports`})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 @lg:grid-cols-3 @5xl:grid-cols-4 gap-3`,children:S.slice(0,12).map(e=>{let n=(i.data||[]).filter(t=>t.name===e),r=n.reduce((e,t)=>e+(t.type===`counter`?t.count??0:0),0);return(0,F.jsxs)(`button`,{className:`text-left rounded-xl border border-line hover:border-line2 bg-[#111118] px-3.5 py-3 group`,onClick:()=>t(`/metrics`),children:[(0,F.jsx)(`div`,{className:`mono text-[11.5px] text-ink2 truncate`,children:e}),(0,F.jsx)(`div`,{className:`text-[20px] font-semibold mt-1 tabular-nums`,children:n[0]?.type===`counter`?V(r):V(n[0]?.avg)}),(0,F.jsxs)(`div`,{className:`text-[11px] text-mute flex items-center gap-1`,children:[n[0]?.type===`counter`?`total`:`average`,(0,F.jsx)(Er,{size:11,className:`opacity-0 group-hover:opacity-100`})]})]},e)})})]})]})}function uH({title:e,what:t,value:n,unit:r,status:i,series:a,children:o}){let s=RV[i.tone];return(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-3 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`text-[16px] font-semibold`,children:e}),(0,F.jsx)(`p`,{className:`text-mute text-[12.5px] mt-0.5 leading-snug`,children:t})]}),(0,F.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,F.jsx)(`div`,{className:`text-[24px] font-semibold tabular-nums leading-tight`,children:n}),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:r})]})]}),(0,F.jsxs)(`div`,{className:`tone-${i.tone} flex items-center gap-1.5 text-[12.5px] font-medium`,style:{color:`var(--tone)`},children:[(0,F.jsx)(s,{size:14}),i.text]}),o,(0,F.jsx)(HR,{series:a})]})}var dH=[{id:`all`,label:`Everything`,levels:``},{id:`problems`,label:`Problems only`,levels:`warn,error,fatal`},{id:`errors`,label:`Errors only`,levels:`error,fatal`}],fH={fatal:{word:`Error`,color:`#ff7a7a`,bg:`rgba(208,59,59,.14)`},error:{word:`Error`,color:`#ff7a7a`,bg:`rgba(208,59,59,.14)`},warn:{word:`Warning`,color:`#f5c04e`,bg:`rgba(250,178,25,.12)`},info:{word:`Info`,color:`#7fb2f0`,bg:`rgba(57,135,229,.12)`},debug:{word:`Debug`,color:`#9a9ab0`,bg:`rgba(130,130,154,.12)`},trace:{word:`Debug`,color:`#9a9ab0`,bg:`rgba(130,130,154,.12)`}};function pH(){let e=I(),[t,n]=zn(),[r,i]=(0,v.useState)(t.get(`q`)||``),a=dH.find(e=>e.id===t.get(`show`))??dH[0],{data:o,error:s}=P(`/api/logs${e.q({q:t.get(`q`)||``,level:a.levels,limit:300})}`,[e.tick]),c=(e,t)=>{let r=new URLSearchParams(window.location.search);t?r.set(e,t):r.delete(e),n(r,{replace:!0})},l={all:0,error:0,warn:0};for(let e of o?.series||[]){for(let t of[`error`,`fatal`,`warn`,`info`,`debug`,`trace`])l.all+=e[t]||0;l.error+=(e.error||0)+(e.fatal||0),l.warn+=e.warn||0}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(Ci,{size:22,className:`text-brand`}),`Logs`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Everything your app printed, newest first. Each line knows which request wrote it.`})]}),(0,F.jsxs)(`section`,{className:`card p-5 flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsxs)(`form`,{className:`relative flex-1 min-w-[240px]`,onSubmit:e=>{e.preventDefault(),c(`q`,r.trim())},children:[(0,F.jsx)(wi,{size:15,className:`absolute left-3 top-1/2 -translate-y-1/2 text-mute`}),(0,F.jsx)(`input`,{className:`input w-full h-10 pl-9 pr-9 text-[13.5px] rounded-xl`,placeholder:`Search your logs, then press Enter`,value:r,onChange:e=>i(e.target.value)}),t.get(`q`)&&(0,F.jsx)(`button`,{type:`button`,className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-mute hover:text-ink`,title:`Clear`,onClick:()=>{i(``),c(`q`,``)},children:(0,F.jsx)(Wi,{size:15})})]}),(0,F.jsx)(`div`,{className:`seg seg-lg`,children:dH.map(e=>(0,F.jsx)(`button`,{className:a.id===e.id?`on`:``,onClick:()=>c(`show`,e.id===`all`?``:e.id),children:e.label},e.id))})]}),o&&(0,F.jsxs)(`div`,{className:`text-[12.5px] text-ink2`,children:[V(l.all),` line`,l.all===1?``:`s`,` in `,UV[e.range]||`this period`,l.error>0&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsxs)(`span`,{className:`text-[#ff8a8a]`,children:[V(l.error),` error`,l.error===1?``:`s`]})]}),l.warn>0&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsxs)(`span`,{className:`text-[#f5c04e]`,children:[V(l.warn),` warning`,l.warn===1?``:`s`]})]}),t.get(`q`)&&(0,F.jsxs)(F.Fragment,{children:[` · matching “`,t.get(`q`),`”`]})]}),s?(0,F.jsx)(W,{error:s}):o?o.logs.length===0?(0,F.jsx)(`div`,{className:`text-center text-ink2 py-12 text-[13.5px]`,children:t.get(`q`)||a.levels?`Nothing matches. Try another word or show everything.`:`No logs in this period. console.log and pino output shows up here automatically.`}):(0,F.jsx)(`div`,{className:`flex flex-col -mx-2`,children:o.logs.map(e=>(0,F.jsx)(mH,{l:e},e.id))}):(0,F.jsx)(U,{})]})]})}function mH({l:e}){let[t,n]=(0,v.useState)(!1),r=ht(),i=L(),a=fH[e.level]||fH.info;return(0,F.jsxs)(`div`,{className:`rounded-lg ${t?`bg-[#16161e]`:`hover:bg-[#15151c]`}`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-start gap-3 px-2 py-2 text-left`,onClick:()=>n(!t),children:[(0,F.jsx)(`span`,{className:`text-mute text-[12px] tabular-nums shrink-0 w-[62px] pt-px`,title:zV(e.ts),children:Sa(e.ts)}),(0,F.jsx)(`span`,{className:`text-[11px] font-semibold px-2 py-0.5 rounded-md shrink-0 w-[64px] text-center`,style:{color:a.color,background:a.bg},children:a.word}),(0,F.jsx)(`span`,{className:`mono text-[12.5px] flex-1 min-w-0 text-[#dcdce6] ${t?`whitespace-pre-wrap break-words`:`truncate`}`,children:e.message}),(0,F.jsx)(`span`,{className:`text-mute text-[12px] shrink-0 max-w-[110px] truncate`,children:e.service}),(0,F.jsx)(Er,{size:14,className:`text-mute shrink-0 mt-0.5 transition-transform ${t?`rotate-90`:``}`})]}),t&&(0,F.jsxs)(`div`,{className:`px-2 pb-3 pl-[150px] flex flex-col gap-2.5`,children:[(0,F.jsxs)(`div`,{className:`text-[12px] text-mute`,children:[Sa(e.ts,!0),` · `,zV(e.ts),e.logger?` · ${e.logger}`:``,e.instance?` · ${e.instance}`:``]}),e.attrs&&(0,F.jsx)(`pre`,{className:`code !text-[11.5px] !py-2 max-h-[240px] overflow-auto`,children:JSON.stringify(e.attrs,null,2)}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[e.executionId&&(0,F.jsxs)(`button`,{className:`btn h-8`,onClick:()=>r(i(`/executions/${e.executionId}`)),children:[`See the request that wrote it`,(0,F.jsx)(Er,{size:13})]}),(0,F.jsx)(VV,{className:`btn h-8`,label:`Ask Obzeri about this`,question:`What does this ${e.level} log from ${e.service} mean, and do I need to do anything? "${String(e.message).slice(0,300)}"`})]})]})]})}function hH(){let e=I(),t=ht(),n=L(),r=rr(),i=P(`/api/settings`),a=P(`/api/settings/ai`);if(i.error)return(0,F.jsx)(W,{error:i.error});if(!i.data)return(0,F.jsx)(U,{});let o=i.data,s=e.meta?.services||[];return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(Di,{size:22,className:`text-brand`}),`Settings`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Connect your app, choose how the dashboard looks, and turn on the assistant.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 @4xl:grid-cols-5 gap-5 items-start`,children:[(0,F.jsxs)(`div`,{className:`@4xl:col-span-3 flex flex-col gap-5`,children:[(0,F.jsx)(BV,{title:`Your apps`,n:s.length,children:s.length===0?(0,F.jsx)(`div`,{className:`text-ink2 text-[13px]`,children:`No app has reported yet. Follow the steps below.`}):(0,F.jsx)(`div`,{className:`flex flex-col divide-y divide-[#1f1f29]`,children:s.map(t=>{let n=Date.now()-t.lastSeen<9e5,r=(e.meta?.versions||[]).filter(e=>e.service===t.id);return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,F.jsx)(vr,{size:17,className:`text-mute shrink-0`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`font-medium text-[14px]`,children:t.id}),(0,F.jsx)($a,{frameworks:t.frameworks,className:`mt-1`}),(0,F.jsx)(`div`,{className:`text-mute text-[12px] mt-1`,children:[r.length?`version ${r[r.length-1].version}`:null,t.instances.length>1?`${t.instances.length} instances`:null].filter(Boolean).join(` · `)||`Node.js`})]}),(0,F.jsxs)(`span`,{className:`tone-${n?`good`:`neutral`} text-[12px] font-medium flex items-center gap-1.5`,style:{color:`var(--tone)`},children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full ${n?`live-dot`:``}`,style:{background:`var(--tone)`}}),n?`Reporting`:`Last heard ${zV(t.lastSeen)}`]})]},t.id)})})}),(0,F.jsx)(Mz,{initial:`zero`,title:`Connect an app`})]}),(0,F.jsxs)(`div`,{className:`@4xl:col-span-2 flex flex-col gap-5`,children:[(0,F.jsx)(gH,{}),(0,F.jsx)(_H,{}),(0,F.jsx)(BV,{title:`Ask Obzeri`,children:a.data?a.data.configured?(0,F.jsxs)(`div`,{className:`tone-good flex items-center gap-2 text-[13px]`,children:[(0,F.jsx)(Ar,{size:16,style:{color:`var(--tone)`}}),`Ready, using `,(0,F.jsx)(`b`,{children:a.data.model})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`text-ink2 text-[13px] leading-relaxed`,children:`Ask questions about your app in plain words. Needs an AI model: Claude, any OpenAI-compatible API, or a local one through Ollama.`}),(0,F.jsxs)(`button`,{className:`btn btn-primary h-9 self-start`,onClick:()=>t(n(`/integrations/ai`)),children:[(0,F.jsx)(Ni,{size:14}),`Set up Ask Obzeri`]})]}):(0,F.jsx)(U,{})}),(0,F.jsxs)(BV,{title:`Privacy & data`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-[13px]`,children:[(0,F.jsx)(ni,{size:15,className:`text-mute mt-0.5`}),(0,F.jsx)(`div`,{children:o.passwordProtected?`The dashboard is password protected.`:(0,F.jsxs)(F.Fragment,{children:[`No password: anyone who can reach this address can open the dashboard. Set `,(0,F.jsx)(`span`,{className:`mono`,children:`OBZERVER_PASSWORD`}),` to lock it.`]})})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-[13px]`,children:[(0,F.jsx)(Pr,{size:15,className:`text-mute mt-0.5`}),(0,F.jsxs)(`div`,{children:[`Details are kept for `,o.retentionDays,` days`,o.history?`, daily summaries for ${o.history.days} days`:``,`. Passwords and keys found in logs are hidden before saving.`]})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-[13px]`,children:[(0,F.jsx)(ji,{size:15,className:`text-mute mt-0.5`}),(0,F.jsxs)(`div`,{children:[`Your app keys are stored as hashes and shown only once. Create, rotate or limit them to one environment in `,(0,F.jsx)(`button`,{className:`link`,onClick:()=>r(`/settings`),children:`Advanced → Settings`}),`.`]})]})]}),(0,F.jsxs)(`button`,{className:`card p-4 text-left flex items-center gap-3 hover:border-line2 group`,onClick:()=>r(`/settings`),children:[(0,F.jsx)(ji,{size:17,className:`text-mute`}),(0,F.jsxs)(`div`,{className:`flex-1`,children:[(0,F.jsx)(`div`,{className:`font-medium text-[13.5px]`,children:`All settings`}),(0,F.jsx)(`div`,{className:`text-mute text-[12px]`,children:`Ingest keys, projects, email, MCP, ticket trackers, history`})]}),(0,F.jsx)(Er,{size:15,className:`text-mute group-hover:translate-x-0.5 transition-transform`})]})]})]})]})}function gH(){let e=I(),t=ht(),n=L(),r=e.meta?.usage;if(!r)return null;let i={unlimited:`No monthly limit: everything your apps send is kept.`,ok:`${qi(r.included==null?null:Math.max(0,r.included-r.used))} events left this month.`,paced:`You sent a lot today, so most step-by-step timings pause until midnight (UTC). Errors and slow requests still keep theirs.`,reduced:`You used this month's events. Charts stay live, but most requests arrive without step-by-step timings.`,refused:`You used twice this month's events, so new data is turned away until the 1st.`,overage:`Past this month's events: extra ones are collected within your spending limits.`,paused:`Extra events are paused. Server errors and failed jobs are still collected.`};return(0,F.jsxs)(BV,{title:`Your plan`,right:(0,F.jsx)(`span`,{className:`text-[12px] text-mute`,children:r.name}),children:[r.included!=null&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between text-[13px]`,children:[(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`b`,{className:`text-[16px]`,children:qi(r.used)}),` of `,qi(r.included),` events used`]}),(0,F.jsx)(`span`,{className:`text-mute`,children:Ji(r.pct)})]}),(0,F.jsx)(Qi,{used:r.used,included:r.included})]}),(0,F.jsx)(`div`,{className:`text-[13px] leading-relaxed tone-${Xi[r.state].tone}`,children:i[r.state]}),(0,F.jsx)(`div`,{className:`text-[12px] text-mute leading-snug`,children:`An event is one request, background job, error, log line or step inside your code. Database calls are free.`}),(0,F.jsx)(`button`,{className:`btn h-9 self-start`,onClick:()=>t(n(`/usage`)),children:`Usage & plans`})]})}function _H(){let{mode:e,setMode:t}=nr(),n=(n,r,i,a)=>(0,F.jsxs)(`button`,{className:`text-left rounded-xl border px-3.5 py-3 flex gap-3 ${e===n?`border-brand bg-[rgba(255,61,127,.06)]`:`border-line hover:border-line2`}`,onClick:()=>t(n),"aria-pressed":e===n,children:[(0,F.jsx)(r,{size:18,className:e===n?`text-brand mt-0.5`:`text-mute mt-0.5`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium text-[13.5px]`,children:i}),(0,F.jsx)(`div`,{className:`text-mute text-[12px] mt-0.5 leading-snug`,children:a})]})]});return(0,F.jsxs)(BV,{title:`Dashboard mode`,children:[n(`simple`,Mi,`Simple`,`Is my app healthy, what broke, what changed, what to do. Plain words, no jargon.`),n(`advanced`,ji,`Advanced`,`Every request, trace, query, release and runtime detail, for digging deep.`),(0,F.jsx)(`div`,{className:`text-[11.5px] text-mute`,children:`Saved in this browser. Switch any time from the top bar.`})]})}var vH=e=>`${e.service}@${e.version}`;function yH(){let e=I(),[t]=zn(),{data:n,error:r}=P(`/api/simple/releases${e.q()}`,[e.tick]),i=t.get(`release`)||(t.get(`service`)&&t.get(`version`)?`${t.get(`service`)}@${t.get(`version`)}`:null);if(r)return(0,F.jsx)(W,{error:r});if(!n)return(0,F.jsx)(U,{});let a=n.filter(e=>e.latest),o=n.filter(e=>!e.latest);return(0,F.jsxs)(`div`,{className:`@container flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`text-[24px] font-semibold tracking-tight flex items-center gap-2.5`,children:[(0,F.jsx)(yi,{size:22,className:`text-brand`}),`Releases`]}),(0,F.jsx)(`p`,{className:`text-ink2 mt-1 text-[14px]`,children:`Every deploy, and whether it made your app better or worse than the one before.`})]}),n.length===0?(0,F.jsx)(EH,{}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-5`,children:a.map(e=>(0,F.jsx)(CH,{r:e,focus:i===vH(e)},vH(e)))}),o.length>0&&(0,F.jsx)(BV,{title:`Earlier deploys`,n:o.length,children:(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:o.map(e=>(0,F.jsx)(wH,{r:e,focus:i===vH(e)},vH(e)))})})]})]})}function bH({r:e}){return(0,F.jsxs)(Ga,{tip:`Deployed ${Sa(e.first,!0)} · last request ${Sa(e.last,!0)}`,children:[`deployed `,zV(e.first)]})}function xH({r:e,big:t}){let n=RV[e.tone];return(0,F.jsxs)(`span`,{className:`tone-${e.tone} inline-flex items-center gap-1.5 font-semibold rounded-full ${t?`text-[12.5px] px-2.5 py-1`:`text-[11.5px] px-2 py-0.5`}`,style:{color:`var(--tone)`,background:`var(--tone-bg)`},children:[(0,F.jsx)(n,{size:t?14:12}),e.label]})}function SH(e){let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{e&&setTimeout(()=>t.current?.scrollIntoView({block:`start`,behavior:`smooth`}),100)},[e]),t}function CH({r:e,focus:t}){let n=SH(t);return(0,F.jsxs)(`section`,{ref:n,className:`card tone-${e.tone} p-6 flex flex-col gap-5 scroll-mt-4`,style:{borderColor:e.tone===`bad`||e.tone===`warn`||t?`var(--tone-line)`:void 0,background:e.tone===`bad`||e.tone===`warn`?`linear-gradient(135deg, var(--tone-bg), transparent 50%), var(--color-panel)`:void 0},children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4 flex-wrap`,children:[(0,F.jsx)(`div`,{className:`w-12 h-12 rounded-xl flex items-center justify-center shrink-0`,style:{background:`var(--tone-bg)`,border:`1px solid var(--tone-line)`},children:(0,F.jsx)(yi,{size:22,style:{color:`var(--tone)`}})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`text-[11.5px] uppercase tracking-wider font-semibold text-mute`,children:[`Latest deploy of `,e.service]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap mt-0.5`,children:[(0,F.jsxs)(`h2`,{className:`text-[22px] font-semibold tracking-tight`,children:[e.service,` `,(0,F.jsx)(`span`,{className:`font-mono text-[19px]`,children:e.version})]}),(0,F.jsx)(xH,{r:e,big:!0})]}),(0,F.jsx)(`div`,{className:`text-ink2 text-[14px] mt-1.5 leading-relaxed`,children:e.summary}),(0,F.jsxs)(`div`,{className:`text-mute text-[12px] mt-1`,children:[(0,F.jsx)(bH,{r:e}),` · `,V(e.requests),` requests since`,e.previous?(0,F.jsxs)(F.Fragment,{children:[` · compared with `,(0,F.jsx)(`span`,{className:`mono`,children:e.previous})]}):null]})]}),(0,F.jsx)(`div`,{className:`flex gap-2 shrink-0`,children:(0,F.jsx)(VV,{question:e.ask,className:`btn h-9`})})]}),(0,F.jsx)(TH,{r:e})]})}function wH({r:e,focus:t}){let[n,r]=(0,v.useState)(t),i=SH(t);return(0,F.jsxs)(`div`,{ref:i,className:`rounded-xl border bg-[#111118] scroll-mt-4 ${n?`border-line2`:`border-line`}`,children:[(0,F.jsxs)(`button`,{className:`w-full flex items-center gap-3 px-4 py-3 text-left flex-wrap`,onClick:()=>r(!n),"aria-expanded":n,children:[(0,F.jsxs)(`span`,{className:`font-medium text-[14px] min-w-[150px]`,children:[e.service,` `,(0,F.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.version})]}),(0,F.jsx)(xH,{r:e}),(0,F.jsx)(`span`,{className:`text-mute text-[12.5px] flex-1 min-w-[200px] truncate`,children:e.summary}),(0,F.jsx)(`span`,{className:`text-mute text-[12px] shrink-0`,children:zV(e.first)}),n?(0,F.jsx)(wr,{size:15,className:`text-mute`}):(0,F.jsx)(Er,{size:15,className:`text-mute`})]}),n&&(0,F.jsxs)(`div`,{className:`px-4 pb-4 flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`text-mute text-[12px]`,children:[(0,F.jsx)(bH,{r:e}),` · `,V(e.requests),` requests`]}),(0,F.jsx)(TH,{r:e}),(0,F.jsx)(`div`,{children:(0,F.jsx)(VV,{question:e.ask,className:`btn h-8`})})]})]})}function TH({r:e}){let t=ht(),n=L(),r=rr(),i=e.newErrors.length>0||e.codeChanges.length>0;return!e.compare.length&&!i&&!e.advice?e.verdict===`baseline`?null:(0,F.jsx)(`div`,{className:`text-ink2 text-[13px]`,children:`Not enough traffic on this version yet to compare. Check back after a few hundred requests.`}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.advice&&(0,F.jsxs)(`div`,{className:`tone-${e.tone} rounded-xl px-4 py-3.5 flex gap-3`,style:{background:`var(--tone-bg)`,border:`1px solid var(--tone-line)`},children:[(0,F.jsx)(Qr,{size:17,style:{color:`var(--tone)`},className:`shrink-0 mt-0.5`}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-semibold text-[13.5px]`,children:`What to do`}),(0,F.jsx)(`ol`,{className:`mt-1.5 flex flex-col gap-1`,children:e.advice.map((e,t)=>(0,F.jsxs)(`li`,{className:`text-[13px] flex gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-mute tabular-nums`,children:[t+1,`.`]}),e]},t))})]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 ${i&&e.compare.length?`@4xl:grid-cols-2`:``} gap-4`,children:[e.compare.length>0&&(0,F.jsxs)(`div`,{className:`rounded-xl border border-line overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_20px_auto] gap-x-3 items-center px-4 py-2 text-[11px] uppercase tracking-wider text-mute border-b border-line bg-[#111118]`,children:[(0,F.jsx)(`span`,{children:`Before vs after`}),(0,F.jsx)(`span`,{className:`mono normal-case tracking-normal text-right`,children:e.previous}),(0,F.jsx)(`span`,{}),(0,F.jsx)(`span`,{className:`mono normal-case tracking-normal`,children:e.version})]}),e.compare.map(e=>(0,F.jsxs)(`div`,{className:`tone-${e.tone} grid grid-cols-[1fr_auto_20px_auto] gap-x-3 items-center px-4 py-2.5 border-b border-[#1d1d26] last:border-0`,children:[(0,F.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.hint?(0,F.jsx)(Ga,{tip:e.hint,children:e.label}):e.label}),(0,F.jsx)(`span`,{className:`text-[13px] tabular-nums text-mute text-right`,children:e.before}),(0,F.jsx)(fr,{size:13,className:`text-mute`}),(0,F.jsx)(`span`,{className:`text-[13.5px] tabular-nums font-semibold min-w-[70px]`,style:{color:e.tone===`neutral`?void 0:`var(--tone)`},children:e.after})]},e.label))]}),i&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.newErrors.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`text-[12.5px] font-semibold flex items-center gap-1.5 mb-1.5`,children:[(0,F.jsx)(yr,{size:14,className:`text-[#ff8a8a]`}),`New errors in this version`]}),(0,F.jsx)(`div`,{className:`flex flex-col`,children:e.newErrors.map(e=>(0,F.jsxs)(`button`,{className:`text-left rounded-lg px-2.5 py-2 -mx-2.5 hover:bg-[#181821] flex items-center gap-3 group`,onClick:()=>t(n(`/errors/${e.fingerprint}`)),children:[(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`text-[13px] font-medium text-[#ff9b9b]`,children:e.class}),(0,F.jsx)(`span`,{className:`block text-mute text-[12px] truncate`,children:e.message})]}),(0,F.jsxs)(`span`,{className:`text-[12px] text-ink2 tabular-nums`,children:[V(e.count),`×`]}),(0,F.jsx)(Er,{size:14,className:`text-mute`})]},e.fingerprint))})]}),e.codeChanges.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`text-[12.5px] font-semibold flex items-center gap-1.5 mb-1.5`,children:[(0,F.jsx)(Fr,{size:14,className:`text-mute`}),`What changed in the code`]}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.codeChanges.map(e=>(0,F.jsxs)(`li`,{className:`text-[13px] text-ink2 flex gap-2`,children:[(0,F.jsx)(`span`,{className:`text-mute`,children:`•`}),e]},e))})]})]})]}),(0,F.jsx)(`div`,{children:(0,F.jsxs)(`button`,{className:`btn btn-ghost h-8 px-2 text-[12.5px]`,onClick:()=>r(`/releases?service=${encodeURIComponent(e.service)}&version=${encodeURIComponent(e.version)}`),children:[(0,F.jsx)(ji,{size:13}),`Full comparison in Advanced`]})})]})}function EH(){let e=`OBZERVER_VERSION=$(git rev-parse --short HEAD)`;return(0,F.jsxs)(BV,{title:`Tag your deploys to see them here`,children:[(0,F.jsxs)(`div`,{className:`text-ink2 text-[13.5px] leading-relaxed`,children:[`Obzerver compares each version of your app with the one before: did errors go up, did it get slower, does it leak memory. Most CI and hosting providers (GitHub Actions, GitLab, Vercel, Render, Railway, Netlify, Heroku…) and a `,(0,F.jsx)(`span`,{className:`mono`,children:`.git`}),` folder are detected automatically. Otherwise, set a version when you deploy:`]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`code flex-1`,children:e}),(0,F.jsx)(Ra,{text:e,className:`btn h-9`})]})]})}function DH({simple:e,advanced:t}){let{mode:n}=nr();return(0,F.jsx)(F.Fragment,{children:n===`simple`?e:t})}function OH(){let{traceId:e}=yt(),[t,n]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{N(`/api/traces/${e}`).then(e=>n(e.execution.id)).catch(()=>n(null))},[e]),t===void 0?(0,F.jsx)(U,{}):t===null?(0,F.jsxs)(`div`,{className:`text-mute py-10 text-center`,children:[`Trace `,e,` not found.`]}):(0,F.jsx)(Vt,{to:`/executions/${t}${window.location.search}`,replace:!0})}function kH({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``);return(0,F.jsxs)(`div`,{className:`h-full overflow-y-auto flex flex-col items-center justify-center gap-10 px-6 py-10`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-6 text-center`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-[18px] max-[480px]:scale-[0.72]`,children:[(0,F.jsx)(lo,{size:88}),(0,F.jsx)(fo,{size:64})]}),(0,F.jsx)(`p`,{className:`m-0 text-[15px] text-[#a3a3b8]`,children:`Know your app is healthy. Zero-config observability for Express and Fastify.`})]}),(0,F.jsxs)(`form`,{className:`card p-5 w-full max-w-[340px] flex flex-col gap-3`,onSubmit:async n=>{n.preventDefault();try{await N(`/api/auth/login`,{method:`POST`,json:{password:t}}),e()}catch(e){i(e.message||`Wrong password`)}},children:[(0,F.jsx)(`label`,{className:`text-[12.5px] text-ink2`,htmlFor:`obz-password`,children:`Dashboard password`}),(0,F.jsx)(`input`,{id:`obz-password`,type:`password`,autoFocus:!0,className:`input h-9`,placeholder:`Password`,value:t,onChange:e=>n(e.target.value)}),r&&(0,F.jsx)(`div`,{className:`text-[#ff8a8a] text-[12px]`,children:r}),(0,F.jsx)(`button`,{className:`btn btn-primary justify-center h-9`,children:`Sign in`})]})]})}function AH({children:e}){let[t]=zn();return(0,F.jsx)(v.Fragment,{children:e},t.get(`project`)||`default`)}function jH(){let[e,t]=(0,v.useState)(`loading`),n=()=>N(`/api/auth`).then(e=>t(e.ok?`ok`:`login`)).catch(()=>t(`ok`));return(0,v.useEffect)(()=>{n();let e=()=>t(`login`);return window.addEventListener(`obz:unauthorized`,e),()=>window.removeEventListener(`obz:unauthorized`,e)},[]),e===`loading`?(0,F.jsx)(U,{}):e===`login`?(0,F.jsx)(kH,{onDone:()=>t(`ok`)}):(0,F.jsx)(Mn,{basename:`/`.replace(/\/$/,``)||void 0,children:(0,F.jsx)(AH,{children:(0,F.jsx)(Zn,{children:(0,F.jsx)(tr,{children:(0,F.jsx)(Gt,{children:(0,F.jsxs)(Ut,{element:(0,F.jsx)(po,{}),children:[(0,F.jsx)(Ut,{index:!0,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(KV,{}),advanced:(0,F.jsx)(Fz,{})})}),(0,F.jsx)(Ut,{path:`requests`,element:(0,F.jsx)(zz,{kind:`http`})}),(0,F.jsx)(Ut,{path:`jobs`,element:(0,F.jsx)(zz,{kind:`job`})}),(0,F.jsx)(Ut,{path:`operations/:kind/:service/:name`,element:(0,F.jsx)(qz,{})}),(0,F.jsx)(Ut,{path:`executions/:id`,element:(0,F.jsx)(eB,{})}),(0,F.jsx)(Ut,{path:`traces`,element:(0,F.jsx)(nB,{})}),(0,F.jsx)(Ut,{path:`traces/:traceId`,element:(0,F.jsx)(OH,{})}),(0,F.jsx)(Ut,{path:`map`,element:(0,F.jsx)(oV,{})}),(0,F.jsx)(Ut,{path:`errors`,element:(0,F.jsx)(rB,{})}),(0,F.jsx)(Ut,{path:`secrets`,element:(0,F.jsx)(aB,{})}),(0,F.jsx)(Ut,{path:`errors/:fp`,element:(0,F.jsx)(sB,{})}),(0,F.jsx)(Ut,{path:`logs`,element:(0,F.jsx)(Yi,{feature:`logs`,children:(0,F.jsx)(DH,{simple:(0,F.jsx)(pH,{}),advanced:(0,F.jsx)($z,{})})})}),(0,F.jsx)(Ut,{path:`services`,element:(0,F.jsx)(CB,{})}),(0,F.jsx)(Ut,{path:`integrations`,element:(0,F.jsx)(xz,{})}),(0,F.jsx)(Ut,{path:`projects`,element:(0,F.jsx)(TB,{})}),(0,F.jsx)(Ut,{path:`integrations/:id`,element:(0,F.jsx)(xz,{})}),(0,F.jsx)(Ut,{path:`functions`,element:(0,F.jsx)(Vt,{to:`/services${window.location.search}`,replace:!0})}),(0,F.jsx)(Ut,{path:`queries`,element:(0,F.jsx)(kB,{})}),(0,F.jsx)(Ut,{path:`users`,element:(0,F.jsx)(AB,{})}),(0,F.jsx)(Ut,{path:`users/:id`,element:(0,F.jsx)(jB,{})}),(0,F.jsx)(Ut,{path:`profiler`,element:(0,F.jsx)(YB,{})}),(0,F.jsx)(Ut,{path:`metrics`,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(lH,{}),advanced:(0,F.jsx)(ZB,{})})}),(0,F.jsx)(Ut,{path:`releases`,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(yH,{}),advanced:(0,F.jsx)(eV,{})})}),(0,F.jsx)(Ut,{path:`alerts`,element:(0,F.jsx)(Yi,{feature:`alerts`,children:(0,F.jsx)(DH,{simple:(0,F.jsx)(rH,{}),advanced:(0,F.jsx)(lV,{})})})}),(0,F.jsx)(Ut,{path:`slos`,element:(0,F.jsx)(Yi,{feature:`slos`,children:(0,F.jsx)(EV,{})})}),(0,F.jsx)(Ut,{path:`usage`,element:(0,F.jsx)(fB,{})}),(0,F.jsx)(Ut,{path:`status-pages`,element:(0,F.jsx)(NV,{})}),(0,F.jsx)(Ut,{path:`issues`,element:(0,F.jsx)(gV,{})}),(0,F.jsx)(Ut,{path:`issues/:id`,element:(0,F.jsx)(yV,{})}),(0,F.jsx)(Ut,{path:`settings`,element:(0,F.jsx)(DH,{simple:(0,F.jsx)(hH,{}),advanced:(0,F.jsx)(Nz,{})})}),(0,F.jsx)(Ut,{path:`*`,element:(0,F.jsx)(`div`,{className:`text-mute py-10 text-center`,children:`Not found`})})]})})})})})})}(0,Gn.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(v.StrictMode,{children:(0,F.jsx)(jH,{})}));
package/public/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta name="theme-color" content="#0c0c11" />
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><linearGradient id='t' x1='0' y1='0' x2='32' y2='32' gradientUnits='userSpaceOnUse'><stop offset='0' stop-color='%23ff3d7f'/><stop offset='1' stop-color='%23a855f7'/></linearGradient></defs><rect width='32' height='32' rx='8' fill='url(%23t)'/><path d='M3.5 16 H7 L10 10 H22 L10 22 H22 L25 16 H28.5' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>" />
8
8
  <title>Obzerver</title>
9
- <script type="module" crossorigin src="/assets/index-CZpRU9i3.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-XA6fr8QX.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-BzoQW7Fz.css">
11
11
  </head>
12
12
  <body>