@debugkit/dashboard 0.8.0 → 0.10.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.
Files changed (79) hide show
  1. package/dist/client/assets/_authed-3se5Egqg.js +1 -0
  2. package/dist/client/assets/_authed-BfFWbTOO.js +1 -0
  3. package/dist/client/assets/app-code-BKWbvUMR.js +1 -0
  4. package/dist/client/assets/closed-issues-Cl-8l4oR.js +1 -0
  5. package/dist/client/assets/{copy-button-ORgLIh59.js → copy-button-BwRd5q7l.js} +1 -1
  6. package/dist/client/assets/customers-Cf-R8BOg.js +1 -0
  7. package/dist/client/assets/empty-state-njgr1sWu.js +7 -0
  8. package/dist/client/assets/endpoints-BMqAUNyE.js +1 -0
  9. package/dist/client/assets/events._eventId-CVRZJ-bU.js +2 -0
  10. package/dist/client/assets/exchange-view-DVwSLcXF.js +2 -0
  11. package/dist/client/assets/index-DEnCDILF.js +10 -0
  12. package/dist/client/assets/{invite._token-CxXek2SP.js → invite._token-CKAfd5iB.js} +1 -1
  13. package/dist/client/assets/issues._fingerprint-Cm72LNM_.js +55 -0
  14. package/dist/client/assets/login-BTxOhEbN.js +1 -0
  15. package/dist/client/assets/request-panel-DmtFRF8Z.js +1 -0
  16. package/dist/client/assets/services._service-CU1a45f3.js +1 -0
  17. package/dist/client/assets/{sessions._sessionId-3wNImMqM.js → sessions._sessionId-LRo3QNQP.js} +1 -1
  18. package/dist/client/assets/settings-Ctzvl2LL.js +1 -0
  19. package/dist/client/assets/src-BiKxgjA_.js +3 -0
  20. package/dist/client/assets/styles-Tcq0pvWj.css +2 -0
  21. package/dist/client/assets/{team-Bud2-07A.js → team-xlrjhEGp.js} +1 -1
  22. package/dist/client/assets/{timeline-BSDhQPpY.js → timeline-WXE49N62.js} +1 -1
  23. package/dist/client/assets/ui-DRjjeSWy.js +1 -0
  24. package/dist/client/assets/version-banner-BYe4PVzv.js +1 -0
  25. package/dist/server/assets/_authed-Bn-IktVS.js +120 -0
  26. package/dist/server/assets/_authed-RXh7GpoE.js +252 -0
  27. package/dist/server/assets/_tanstack-start-manifest_v-C4dQ3MxD.js +122 -0
  28. package/dist/server/assets/app-code-BQL_FcSx.js +212 -0
  29. package/dist/server/assets/app-name-BcbY1BZN.js +11 -0
  30. package/dist/server/assets/closed-issues-o9U80FXv.js +45 -0
  31. package/dist/server/assets/config-Bp8m0B8q.js +57 -0
  32. package/dist/server/assets/{customers-CvSLt_xV.js → customers-CD84Bz4P.js} +11 -6
  33. package/dist/server/assets/{demo-BRTkdmQJ.js → demo-D-o8m75S.js} +225 -8
  34. package/dist/server/assets/{dynamodb-B0V3ZO20.js → dynamodb-CcH0cp7R.js} +55 -2
  35. package/dist/server/assets/empty-state-wz34oAi8.js +163 -0
  36. package/dist/server/assets/endpoints-8N389Poe.js +248 -0
  37. package/dist/server/assets/{endpoints-mPQXpH8C.js → endpoints-C0Cxc_-x.js} +38 -36
  38. package/dist/server/assets/{events._eventId-pkQBQ9sL.js → events._eventId-BOHkNO5W.js} +90 -351
  39. package/dist/server/assets/exchange-view-DzoSBt_R.js +112 -0
  40. package/dist/server/assets/{firestore-Jd-LeWZI.js → firestore-DyvYMiz3.js} +13 -2
  41. package/dist/server/assets/{fns-Di0vMpkQ.js → fns-BcVGbSID.js} +22 -7
  42. package/dist/server/assets/fns-DE03YExD.js +831 -0
  43. package/dist/server/assets/{invite._token-LwWF5YxP.js → invite._token-DhlACkIe.js} +3 -3
  44. package/dist/server/assets/{issues._fingerprint-DAA0QCuA.js → issues._fingerprint-BBd-_Nn5.js} +400 -28
  45. package/dist/server/assets/{login-DqjCU4DJ.js → login-CbfdHJvg.js} +3 -3
  46. package/dist/server/assets/{memory-aqsrtEUn.js → memory-CZBUh1Zc.js} +129 -5
  47. package/dist/server/assets/{errors-C2KEDL7l.js → queries-wha4cZbw.js} +1442 -129
  48. package/dist/server/assets/request-panel-DpCSwl2q.js +162 -0
  49. package/dist/server/assets/{router-C0Dauj2C.js → router-BXkzR89j.js} +197 -91
  50. package/dist/server/assets/services._service-DWjFFGON.js +309 -0
  51. package/dist/server/assets/{sessions._sessionId-D7JPV0M4.js → sessions._sessionId-DDspiPTe.js} +2 -2
  52. package/dist/server/assets/{settings-Drjd64d7.js → settings-DCLIaZ_p.js} +201 -24
  53. package/dist/server/assets/{src-C4fNgijW.js → src-B2GKPQyN.js} +1 -1
  54. package/dist/server/assets/{team-D7iXYnSE.js → team-jd_TmWP4.js} +3 -3
  55. package/dist/server/assets/ui-C3pl0edn.js +302 -0
  56. package/dist/server/assets/version-banner-BX34ijG5.js +106 -0
  57. package/dist/server/assets/versions-YI_zK1ql.js +58 -0
  58. package/dist/server/assets/warm-C3GbXP1_.js +16 -0
  59. package/dist/server/server.js +40 -28
  60. package/package.json +4 -4
  61. package/dist/client/assets/_authed-CNObwuZh.js +0 -7
  62. package/dist/client/assets/_authed-CuP-He8G.js +0 -1
  63. package/dist/client/assets/charts-CUvev8lV.js +0 -55
  64. package/dist/client/assets/customers-DTMEprFQ.js +0 -1
  65. package/dist/client/assets/endpoints-lMSO2CdM.js +0 -1
  66. package/dist/client/assets/events._eventId-bWag-i8J.js +0 -3
  67. package/dist/client/assets/index-BNpacHyi.js +0 -10
  68. package/dist/client/assets/issues._fingerprint-BQr85TVY.js +0 -1
  69. package/dist/client/assets/login-Dlk3GyyC.js +0 -1
  70. package/dist/client/assets/settings-CzbEYB7k.js +0 -1
  71. package/dist/client/assets/src-Dq5mIUf0.js +0 -3
  72. package/dist/client/assets/styles-DPsgRH7g.css +0 -2
  73. package/dist/client/assets/ui-CEv2y56s.js +0 -1
  74. package/dist/server/assets/_authed-DkkRwdZl.js +0 -87
  75. package/dist/server/assets/_authed-DsB8kjZB.js +0 -902
  76. package/dist/server/assets/_tanstack-start-manifest_v-D1_ErrJK.js +0 -97
  77. package/dist/server/assets/charts-DzTVqJ8z.js +0 -238
  78. package/dist/server/assets/fns-B3PHbFwV.js +0 -1295
  79. package/dist/server/assets/ui-B_XHlLUQ.js +0 -193
@@ -0,0 +1 @@
1
+ import{B as e,q as t,z as n}from"./src-BiKxgjA_.js";import{t as r}from"./copy-button-BwRd5q7l.js";import{t as i}from"./empty-state-njgr1sWu.js";import{C as a,d as o,f as s,w as c,y as l}from"./index-DEnCDILF.js";import{a as u,f as d,h as f,m as p,t as m}from"./ui-DRjjeSWy.js";var h=t(),g=Object.keys(s).sort((e,t)=>s[t]-s[e]);function _(){let t=o.useLoaderData(),s=o.useSearch(),l=e({from:o.fullPath});if(!t)return(0,h.jsx)(i,{});let{range:u,tiles:d,counts:p}=t,_={app:t.app,range:s.range,from:s.from,to:s.to},x=Date.parse(t.generatedAt),S=s.level?d.filter(e=>e.level===s.level):d,C=S.filter(e=>e.level!==`healthy`),w=S.filter(e=>e.level===`healthy`);return(0,h.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:[`Health · `,u.label]}),(0,h.jsxs)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:[`How `,f(t.app,t.names[t.app]),` is doing`]})]}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(a,{value:u,today:t.generatedAt.slice(0,10),onChange:e=>l({search:t=>({...t,...e})})},`${u.preset}${u.from}${u.to}`),t.apps.length>1&&(0,h.jsx)(`select`,{"aria-label":`App`,value:t.app,onChange:e=>l({search:t=>({...t,app:e.target.value})}),className:`rounded-md border border-line bg-panel px-2 py-1.5 text-sm`,children:(0,h.jsx)(m,{apps:t.apps,names:t.names})})]})]}),(0,h.jsx)(c,{rangeFrom:u.from,retention:t.retention}),(0,h.jsxs)(`section`,{"aria-label":`In short`,className:`flex flex-col gap-3 rounded-xl border border-line bg-panel p-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,h.jsx)(`p`,{className:`text-base leading-relaxed`,children:t.answer}),(0,h.jsx)(`span`,{className:`shrink-0 whitespace-nowrap`,children:(0,h.jsx)(r,{text:t.answer,label:`Copy for the client`,ariaLabel:`Copy this summary for the client`})})]}),(0,h.jsxs)(`div`,{role:`group`,"aria-label":`Show one level`,className:`flex flex-wrap gap-2`,children:[g.map(e=>(0,h.jsx)(y,{level:e,count:p[e],on:s.level===e},e)),s.level&&(0,h.jsx)(n,{to:`/`,search:e=>({...e,level:void 0}),className:`rounded-full px-3 py-1 text-sm text-accent hover:underline`,children:`Show all`})]}),C.length>0&&(0,h.jsx)(`ul`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":`Problems, worst first`,children:C.map(e=>(0,h.jsx)(`li`,{className:e.level===`critical`?`sm:col-span-2`:``,children:(0,h.jsx)(v,{tile:e,keep:_,now:x})},`${e.kind}${e.key}`))}),w.length>0&&(0,h.jsxs)(`section`,{"aria-label":`Healthy`,children:[(0,h.jsx)(`h2`,{className:`mb-2 text-sm font-semibold text-muted`,children:`Healthy`}),(0,h.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-3 lg:grid-cols-5`,children:w.map(e=>(0,h.jsx)(`li`,{children:(0,h.jsx)(v,{tile:e,keep:_,now:x})},`${e.kind}${e.key}`))})]}),!S.length&&(0,h.jsxs)(`p`,{className:`text-sm text-muted`,children:[`Nothing at this level in `,u.label,`.`]}),(0,h.jsx)(b,{folded:t.folded,keep:_}),(0,h.jsx)(`p`,{className:`text-sm`,children:(0,h.jsx)(n,{to:`/endpoints`,search:_,className:`text-accent hover:underline`,children:`Every endpoint, with timings →`})})]})}function v({tile:e,keep:t,now:n}){let r=e.kind===`app`?{to:`/app-code`,search:t}:{to:`/services/$service`,params:{service:e.key},search:t};return(0,h.jsx)(u,{level:e.level,name:e.name,side:e.sideLabel,outage:e.outage,headline:e.headline,measure:e.measure,live:e.live,lastFailure:e.lastFailure,link:r,big:e.level===`critical`,now:n})}function y({level:e,count:t,on:r}){return t?(0,h.jsxs)(n,{to:`/`,search:t=>({...t,level:r?void 0:e}),"aria-current":r?`true`:void 0,className:`tabular rounded-full border px-3 py-1 text-sm font-semibold hover:brightness-110 ${p(e,`surface`)} ${r?`ring-2 ring-accent ring-offset-2 ring-offset-bg`:``}`,children:[t,` `,d(e)]}):(0,h.jsxs)(`span`,{className:`tabular rounded-full border border-line px-3 py-1 text-sm text-muted`,children:[`0 `,d(e)]})}function b({folded:e,keep:t}){let{tests:r,offline:i}=e;if(!r&&!i)return null;let a=[i&&(0,h.jsxs)(n,{to:`/issues/$fingerprint`,params:{fingerprint:i.fingerprint},search:{...t,app:t.app??``},className:`text-accent hover:underline`,children:[`Offline phones: `,l(i.bursts,`time`),i.capped?` (at least)`:``,` on `,l(i.phones,`phone`),`, `,l(i.failures,`call`),` never sent →`]},`offline`),r>0&&(0,h.jsxs)(n,{to:`/app-code`,search:{...t,tests:!0},hash:`test-errors`,className:`text-accent hover:underline`,children:[`Test errors: `,r,` →`]},`tests`)].filter(Boolean);return(0,h.jsxs)(`p`,{className:`text-sm text-muted`,children:[(0,h.jsx)(`span`,{className:`font-semibold`,children:`Folded away: `}),a.map((e,t)=>(0,h.jsxs)(`span`,{children:[t>0&&` · `,e]},t))]})}export{_ as component};
@@ -0,0 +1 @@
1
+ import{D as e,G as t,H as n,O as r,V as i,q as a,z as o}from"./src-BiKxgjA_.js";import{D as s,E as c}from"./index-DEnCDILF.js";import{l}from"./ui-DRjjeSWy.js";import{n as u}from"./version-banner-BYe4PVzv.js";function d(e){let r=t({warn:e?.router===void 0}),a=e?.router||r;return n(a.stores.__store,i(e,a))}var f=a(),p=/^\/(app-code|services\/|issues\/)/;function m({to:e,children:t}){let n=d({select:e=>e.location.pathname}),r=e===`/`?n===`/`||p.test(n):n===e||n.startsWith(`${e}/`);return(0,f.jsx)(o,{to:e,search:e=>({app:e.app,range:e.range,from:e.from,to:e.to}),"aria-current":r?`page`:void 0,className:`rounded-md border-b-2 px-2.5 py-1.5 hover:bg-panel-2 hover:text-ink ${r?`border-accent bg-panel-2 font-semibold text-ink`:`border-transparent text-muted`}`,children:t})}function h(){let{user:n}=c.useRouteContext(),i=t(),a=d({select:e=>e.status===`pending`});return(0,f.jsxs)(`div`,{className:`min-h-screen`,children:[(0,f.jsx)(`div`,{role:`progressbar`,"aria-label":`Loading`,"aria-hidden":!a,className:`fixed inset-x-0 top-0 z-50 h-0.5 overflow-hidden ${a?``:`invisible`}`,children:(0,f.jsx)(`div`,{className:`loading-bar h-full w-1/3 bg-accent`})}),(0,f.jsx)(`header`,{className:`sticky top-0 z-10 border-b border-line bg-bg/90 backdrop-blur`,children:(0,f.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 py-3 sm:px-6`,children:[(0,f.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-5 gap-y-2`,children:[(0,f.jsx)(o,{to:`/`,search:{},className:`shrink-0`,children:(0,f.jsx)(l,{})}),(0,f.jsxs)(`nav`,{className:`flex flex-wrap items-center gap-1 text-sm`,"aria-label":`Main`,children:[(0,f.jsx)(m,{to:`/`,children:`Health`}),(0,f.jsx)(m,{to:`/endpoints`,children:`Endpoints`}),(0,f.jsx)(m,{to:`/customers`,children:`Customers`}),(0,f.jsx)(m,{to:`/settings`,children:`Settings`}),(0,f.jsx)(m,{to:`/team`,children:`Team`})]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,f.jsxs)(`span`,{className:`hidden text-muted sm:inline`,children:[n.email,` · `,n.role]}),(0,f.jsx)(`button`,{type:`button`,title:`Pages show data up to 2 minutes old while newer data loads. Refresh reads everything now.`,className:`rounded-md border border-line px-2.5 py-1 hover:bg-panel-2`,onClick:async()=>{await r(),await i.invalidate()},children:`Refresh`}),(0,f.jsx)(`button`,{className:`rounded-md border border-line px-2.5 py-1 hover:bg-panel-2`,onClick:async()=>{await e(),await i.invalidate(),await i.navigate({to:`/login`})},children:`Sign out`})]})]})}),(0,f.jsx)(u,{}),(0,f.jsx)(s,{})]})}export{h as component};
@@ -0,0 +1 @@
1
+ import{B as e,q as t,z as n}from"./src-BiKxgjA_.js";import{t as r}from"./empty-state-njgr1sWu.js";import{C as i,u as a,w as o,y as s}from"./index-DEnCDILF.js";import{t as c}from"./closed-issues-Cl-8l4oR.js";import{c as l,f as u,m as d,o as f,p}from"./ui-DRjjeSWy.js";var m=t();function h(){let t=a.useLoaderData(),f=a.useSearch(),p=e({from:a.fullPath});if(!t)return(0,m.jsx)(r,{});let{range:h,tile:v,open:y,closed:b}=t,x={app:t.app,range:f.range,from:f.from,to:f.to},S=Date.parse(t.generatedAt);return(0,m.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,m.jsxs)(`nav`,{"aria-label":`Breadcrumb`,className:`text-sm text-muted`,children:[(0,m.jsx)(n,{to:`/`,search:x,className:`hover:text-ink hover:underline`,children:`Health`}),(0,m.jsx)(`span`,{"aria-hidden":!0,children:` › `}),(0,m.jsx)(`span`,{className:`text-ink`,"aria-current":`page`,children:`App code`})]}),(0,m.jsx)(i,{value:h,today:t.generatedAt.slice(0,10),onChange:e=>p({search:t=>({...t,...e})})},`${h.preset}${h.from}${h.to}`)]}),(0,m.jsx)(o,{rangeFrom:h.from,retention:t.retention}),(0,m.jsxs)(`header`,{children:[(0,m.jsxs)(`p`,{className:`text-xs font-bold uppercase tracking-wide`,children:[(0,m.jsx)(`span`,{className:d(v.level,`text`),children:u(v.level)}),v.live&&(0,m.jsx)(`span`,{className:`ml-2 normal-case ${d(v.level,`text`)}`,children:`· Still happening`})]}),(0,m.jsx)(`h1`,{className:`mt-1 text-2xl font-semibold tracking-tight`,children:`App code`}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`Crashes and code errors in the app itself, in `,h.label,`, worst first. Failed calls are on their service's page.`]})]}),f.tests&&(0,m.jsx)(_,{issues:t.tests,keep:x,now:S}),y.length?(0,m.jsx)(`ol`,{className:`space-y-3`,"aria-label":`Open crashes and code errors, worst first`,children:y.map(e=>(0,m.jsx)(`li`,{children:(0,m.jsx)(l,{level:e.severity,aside:s(e.countRange,`time`),children:(0,m.jsx)(g,{issue:e,keep:x,now:S})})},e.fingerprint))}):(0,m.jsxs)(`p`,{className:`rounded-lg border border-level-healthy-edge bg-level-healthy-bg px-3 py-2 text-sm text-level-healthy-fg`,children:[`No open crashes or code errors in `,h.label,`.`]}),(0,m.jsx)(c,{issues:b,keep:x,now:S})]})}function g({issue:e,keep:t,now:r}){let i=[e.firstVersion,e.lastVersion].filter((e,t,n)=>e&&n.indexOf(e)===t);return(0,m.jsxs)(n,{to:`/issues/$fingerprint`,params:{fingerprint:e.fingerprint},search:{...t,app:t.app??``},className:`group -m-1 flex flex-wrap items-center justify-between gap-2 rounded-lg p-1 hover:bg-panel-2 focus-visible:outline-2 focus-visible:outline-accent`,children:[(0,m.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,m.jsx)(`span`,{className:`font-medium`,children:e.title}),e.culprit&&(0,m.jsx)(`span`,{className:`block font-mono text-xs text-muted`,children:e.culprit}),(0,m.jsxs)(`span`,{className:`tabular block text-xs text-muted`,children:[s(e.countRange,`time`),e.users?` · ${s(e.users,`customer`)}`:``,i.length?` · app ${i.join(`–`)}`:``,` · last `,p(e.lastSeen,r)]}),(0,m.jsx)(f,{issue:e})]}),(0,m.jsx)(`span`,{className:`shrink-0 text-xs font-semibold text-accent group-hover:underline`,children:`Cause and fix →`})]})}function _({issues:e,keep:t,now:r}){return(0,m.jsxs)(`section`,{id:`test-errors`,"aria-labelledby":`tests-h`,className:`rounded-xl border border-line bg-panel p-4`,children:[(0,m.jsxs)(`h2`,{id:`tests-h`,className:`text-sm font-semibold`,children:[`Test errors (`,e.length,`)`]}),(0,m.jsx)(`p`,{className:`mt-0.5 text-sm text-muted`,children:`Why they're folded away: the app made them on purpose to check deBug works (tagged test=true), so they never count toward any box, total, rate or alert.`}),e.length?(0,m.jsx)(`ul`,{className:`mt-3 space-y-1.5 text-sm`,children:e.map(e=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(n,{to:`/issues/$fingerprint`,params:{fingerprint:e.fingerprint},search:{...t,app:t.app??``},className:`flex flex-wrap justify-between gap-2 rounded px-1 py-0.5 hover:bg-panel-2`,children:[(0,m.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title}),(0,m.jsxs)(`span`,{className:`shrink-0 text-xs text-muted`,children:[s(e.countRange,`time`),` · last `,p(e.lastSeen,r)]})]})},e.fingerprint))}):(0,m.jsx)(`p`,{className:`mt-3 text-sm text-muted`,children:`None in this period.`})]})}export{h as component};
@@ -0,0 +1 @@
1
+ import{q as e,z as t}from"./src-BiKxgjA_.js";import{p as n}from"./ui-DRjjeSWy.js";var r=e();function i({issues:e,keep:i,now:a}){return e.length?(0,r.jsxs)(`details`,{className:`rounded-xl border border-line bg-panel p-4 text-sm`,children:[(0,r.jsxs)(`summary`,{className:`cursor-pointer font-semibold text-muted hover:text-ink`,children:[`Resolved or ignored (`,e.length,`)`]}),(0,r.jsx)(`ul`,{className:`mt-3 space-y-1.5`,children:e.map(e=>(0,r.jsx)(`li`,{children:(0,r.jsxs)(t,{to:`/issues/$fingerprint`,params:{fingerprint:e.fingerprint},search:{...i,app:i.app??``},className:`flex flex-wrap justify-between gap-2 rounded px-1 py-0.5 hover:bg-panel-2`,children:[(0,r.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title}),(0,r.jsxs)(`span`,{className:`shrink-0 text-xs text-muted`,children:[e.status===`resolved`?`Resolved${e.resolvedIn?` in ${e.resolvedIn}`:``}`:`Ignored`,` · last `,n(e.lastSeen,a)]})]})},e.fingerprint))})]}):null}export{i as t};
@@ -1 +1 @@
1
- import{B as e,lt as t,ot as n}from"./src-Dq5mIUf0.js";var r=t(n(),1);async function i(e,t=document,n=navigator){try{return await n.clipboard.writeText(e),!0}catch{let n=t.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.opacity=`0`,t.body.appendChild(n),n.select();try{return t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}}var a=e();function o({text:e,label:t,ariaLabel:n}){let[o,s]=(0,r.useState)(`idle`),c=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>()=>clearTimeout(c.current),[]),(0,a.jsx)(`button`,{type:`button`,"aria-label":o===`idle`?n:void 0,className:`rounded-md border border-line px-2 py-1 text-xs text-muted hover:bg-panel-2`,onClick:()=>{i(e).then(e=>{s(e?`copied`:`failed`),clearTimeout(c.current),c.current=setTimeout(()=>s(`idle`),2500)})},children:(0,a.jsx)(`span`,{"aria-live":`polite`,children:o===`copied`?`Copied`:o===`failed`?`Couldn't copy`:t})})}export{o as t};
1
+ import{gt as e,pt as t,q as n}from"./src-BiKxgjA_.js";var r=e(t(),1);async function i(e,t=document,n=navigator){try{return await n.clipboard.writeText(e),!0}catch{let n=t.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.opacity=`0`,t.body.appendChild(n),n.select();try{return t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}}var a=n();function o({text:e,label:t,ariaLabel:n}){let[o,s]=(0,r.useState)(`idle`),c=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>()=>clearTimeout(c.current),[]),(0,a.jsx)(`button`,{type:`button`,"aria-label":o===`idle`?n:void 0,className:`rounded-md border border-line px-2 py-1 text-xs text-muted hover:bg-panel-2`,onClick:()=>{i(e).then(e=>{s(e?`copied`:`failed`),clearTimeout(c.current),c.current=setTimeout(()=>s(`idle`),2500)})},children:(0,a.jsx)(`span`,{"aria-live":`polite`,children:o===`copied`?`Copied`:o===`failed`?`Couldn't copy`:t})})}export{o as t};
@@ -0,0 +1 @@
1
+ import{B as e,gt as t,pt as n,q as r,z as i}from"./src-BiKxgjA_.js";import{a,i as o,r as s}from"./timeline-WXE49N62.js";import{h as c,n as l,p as u,t as d}from"./ui-DRjjeSWy.js";import{l as f}from"./index-DEnCDILF.js";var p=t(n()),m=r();function h(e,t){if(!e)return`No errors`;let n=`${e} error${e===1?``:`s`}`;return t===e?`${n}, ${e===1?`caught`:`all caught`}`:t?`${n}, ${t} caught`:n}var g={id:`customer number`,anonymousId:`install id`};function _(){let{apps:t,app:n,store:r,lookup:_,missingIndex:v,names:y}=f.useLoaderData(),b=f.useSearch(),x=e({from:f.fullPath}),[S,C]=(0,p.useState)(b.q??``);(0,p.useEffect)(()=>C(b.q??``),[b.q]);let w=n?c(n,y[n]):t.length>1?`any app`:t[0]&&c(t[0],y[t[0]]);return(0,m.jsxs)(`main`,{className:`mx-auto max-w-5xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Find a customer`}),(0,m.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`A customer number in any format (0841234567, 27841234567, +27 84 123 4567) or an install id. Their sessions are listed newest first.`})]}),(0,m.jsxs)(`form`,{role:`search`,className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),x({search:e=>({...e,q:S.trim()||void 0})})},children:[(0,m.jsx)(`input`,{type:`search`,"aria-label":`Customer number or install id`,value:S,onChange:e=>C(e.target.value),placeholder:`Customer number or install id`,autoFocus:!0,className:`min-w-0 flex-1 rounded-md border border-line bg-panel px-3 py-2 font-mono text-sm text-ink sm:max-w-md`}),t.length>1&&(0,m.jsxs)(`select`,{"aria-label":`App`,value:n??``,onChange:e=>x({search:t=>({...t,app:e.target.value||void 0})}),className:`rounded-md border border-line bg-panel px-2 py-2 text-sm`,children:[(0,m.jsx)(`option`,{value:``,children:`All apps`}),(0,m.jsx)(d,{apps:t,names:y})]}),(0,m.jsx)(`button`,{type:`submit`,className:`rounded-md bg-accent px-3 py-2 text-sm font-medium text-white hover:opacity-90`,children:`Find`})]}),v&&(0,m.jsx)(`p`,{className:`text-sm text-muted`,children:`Firestore needs deBug's new indexes on events (user.id, ts) and (user.anonymousId, ts). Deploy them with: firebase deploy --only firestore:indexes, using deBug's firestore.indexes.json. They take a few minutes to build.`}),!t.length&&(0,m.jsx)(`p`,{className:`text-sm text-muted`,children:`No apps have sent events yet.`}),_&&(_.sessions.length===0?(0,m.jsxs)(`p`,{className:`text-sm text-muted`,children:[`No sessions found for `,(0,m.jsx)(`span`,{className:`font-mono text-ink`,children:_.query}),` in `,w,`. Events are kept for the retention period only, and a customer number is only known once the app sets it.`,r===`dynamodb`&&` On DynamoDB, only events stored since deBug started keeping them by customer can be found.`]}):(0,m.jsxs)(l,{title:`${_.sessions.length} session${_.sessions.length===1?``:`s`}`,subtitle:`Matched by ${_.matched.map(e=>g[e]).join(` and `)}. Only sessions with a stored error or flow event are listed.`,children:[(0,m.jsx)(`ul`,{className:`divide-y divide-line`,children:_.sessions.map(e=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(i,{to:`/sessions/$sessionId`,params:{sessionId:e.sessionId},search:{app:e.app},className:`grid grid-cols-[1fr_auto] items-center gap-x-4 gap-y-1 px-1 py-2.5 hover:bg-panel-2 sm:grid-cols-[11rem_6.5rem_1fr_auto]`,children:[(0,m.jsxs)(`span`,{className:`text-sm`,title:`First stored event ${e.start}, last ${e.end}`,children:[o(e.end),(0,m.jsx)(`span`,{className:`block text-xs text-muted`,children:u(e.end)})]}),(0,m.jsx)(`span`,{className:`justify-self-end sm:justify-self-start`,children:(0,m.jsx)(s,{outcome:e.outcome})}),(0,m.jsxs)(`span`,{className:`min-w-0 text-sm`,children:[(0,m.jsx)(`span`,{className:`text-muted`,children:`App `}),a([e.context.app.version,e.context.app.build&&`(${e.context.app.build})`])??`—`,(0,m.jsx)(`span`,{className:`text-muted`,children:` · `}),a([e.context.device.brand,e.context.device.model])??a([e.context.os.name,e.context.os.version])??`—`,!n&&t.length>1&&(0,m.jsxs)(`span`,{className:`text-muted`,children:[` · `,c(e.app,y[e.app])]}),e.user.id&&e.user.id!==_.query&&(0,m.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted`,children:e.user.id})]}),(0,m.jsxs)(`span`,{className:`text-xs text-muted sm:text-right`,children:[h(e.errors,e.handled),e.failedFlows>0&&(0,m.jsxs)(`span`,{className:`block font-medium text-sev-high`,children:[e.failedFlows,` failed flow`,e.failedFlows===1?``:`s`]})]})]})},e.sessionId))}),_.truncated&&(0,m.jsx)(`p`,{className:`mt-3 text-xs text-muted`,children:`This customer has more stored events than one lookup reads: older sessions are left out, and the oldest one listed may be only partly read.`})]}))]})}export{_ as component};
@@ -0,0 +1,7 @@
1
+ import{G as e,gt as t,pt as n,q as r}from"./src-BiKxgjA_.js";var i=t(n(),1),a=r(),o=[{title:`A health wall`,when:`after the first request`,detail:`Every service the app calls, and the app's own code, as a box in red, orange, yellow, grey or green, worst first. Click one for what's failing, how often, and why.`},{title:`A written summary`,when:`after the first error`,detail:`How many errors in the last 24 hours, the worst part of the app, the top issue and the release that's struggling, in plain sentences.`},{title:`Incidents`,when:`when several errors share a cause`,detail:`Issues that failed together for the same reason, like every request failing right after the app reopens, shown as one problem with the issues inside it.`},{title:`Issues by severity`,when:`after the first error`,detail:`Errors grouped by cause. Severity comes from how often each happened in the last 24 hours. Open one for the stack trace and the steps that led to it.`},{title:`Release health`,when:`as soon as the app starts`,detail:`Every app launch is a session. You'll see the share of sessions per version that ran without a crash or an unhandled error.`},{title:`Failing endpoints`,when:`after the first failed request`,detail:`Requests that timed out, failed or returned 5xx, captured from fetch and XHR without any code from you.`},{title:`Where the app is failing`,when:`once you tag flows`,detail:`Errors by flow, like auth.login or checkout.payment. Wrap a step in deBug.track() and each flow also gets a failure rate.`},{title:`Breakdowns`,when:`after the first error`,detail:`Errors split by OS, app version and device model, so you can see who is affected.`}];function s(){let t=e();return(0,i.useEffect)(()=>{let e=setInterval(()=>void t.invalidate(),5e3);return()=>clearInterval(e)},[t]),(0,a.jsxs)(`main`,{className:`mx-auto max-w-4xl space-y-6 px-4 py-10 sm:px-6`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:`Connected · waiting for the first event`}),(0,a.jsx)(`h1`,{className:`mt-1 text-2xl font-semibold tracking-tight`,children:`Your dashboard is ready, and empty for now.`}),(0,a.jsxs)(`p`,{className:`mt-2 max-w-2xl text-sm text-muted`,children:[`Nothing has arrived yet. Run your app with the SDK initialised, or send a test event with `,(0,a.jsx)(`code`,{children:`npx debugkit test`}),` (or `,(0,a.jsx)(`code`,{children:`npx @debugkit/cli test`}),`). This page fills in on its own.`]})]}),(0,a.jsxs)(`section`,{"aria-labelledby":`see-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,a.jsx)(`h2`,{id:`see-h`,className:`text-sm font-semibold`,children:`What you'll see here`}),(0,a.jsx)(`ul`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:o.map(e=>(0,a.jsxs)(`li`,{className:`rounded-lg border border-line p-3`,children:[(0,a.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,a.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,a.jsx)(`span`,{className:`text-[11px] uppercase tracking-wide text-muted`,children:e.when})]}),(0,a.jsx)(`p`,{className:`mt-1 text-sm text-ink/80`,children:e.detail})]},e.title))})]}),(0,a.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,a.jsxs)(`section`,{"aria-labelledby":`auto-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,a.jsx)(`h2`,{id:`auto-h`,className:`text-sm font-semibold`,children:`Recorded automatically`}),(0,a.jsxs)(`p`,{className:`mt-1 text-xs text-muted`,children:[`Once `,(0,a.jsx)(`code`,{children:`init()`}),` runs, with no other code.`]}),(0,a.jsxs)(`ul`,{className:`mt-3 list-disc space-y-1 pl-5 text-sm`,children:[(0,a.jsx)(`li`,{children:`Crashes and unhandled promise rejections`}),(0,a.jsx)(`li`,{children:`Failed, timed-out and 5xx requests, with the code that made them`}),(0,a.jsx)(`li`,{children:`Sessions, for crash-free rates per release`}),(0,a.jsx)(`li`,{children:`Screens visited, buttons clicked, console warnings, app backgrounded or offline`}),(0,a.jsx)(`li`,{children:`Device, OS, app version and network on every event`})]})]}),(0,a.jsxs)(`section`,{"aria-labelledby":`manual-h`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,a.jsx)(`h2`,{id:`manual-h`,className:`text-sm font-semibold`,children:`What you add`}),(0,a.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Only what the app can't know on its own.`}),(0,a.jsx)(`pre`,{className:`mt-3 overflow-x-auto rounded-md bg-panel-2 p-3 text-xs leading-relaxed`,children:`// in a try/catch you already have
2
+ catch (err) {
3
+ deBug.error(err, { flow: "checkout.payment", step: "charge" });
4
+ }
5
+
6
+ // success or failure of a step, plus the error
7
+ await deBug.track("auth.login", "submit_otp", () => verifyOtp(code));`})]})]})]})}export{s as t};
@@ -0,0 +1 @@
1
+ import{B as e,q as t,z as n}from"./src-BiKxgjA_.js";import{C as r,b as i,c as a,p as o,w as s}from"./index-DEnCDILF.js";import{a as c,i as l}from"./timeline-WXE49N62.js";import{a as u,n as d,p as f,t as p}from"./ui-DRjjeSWy.js";var m=t(),h={failing:`Most failures`,slow:`Slowest`,busy:`Busiest`};function g(){let t=a.useLoaderData(),i=a.useSearch(),{sort:o=`failing`}=i,c=e({from:a.fullPath});if(!t)return(0,m.jsx)(`main`,{className:`mx-auto max-w-3xl px-4 py-10 sm:px-6`,children:(0,m.jsx)(`h1`,{className:`text-xl font-semibold`,children:`No apps have sent events yet`})});let{range:l,services:u,selected:f}=t,g=y(t.endpoints,o);return(0,m.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Endpoints`}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`Which backend services and calls fail or are slow in `,l.label,`.`]})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsx)(r,{value:l,today:t.generatedAt.slice(0,10),onChange:e=>c({search:t=>({...t,...e})})},`${l.preset}${l.from}${l.to}`),t.apps.length>1&&(0,m.jsx)(`select`,{"aria-label":`App`,value:t.app,onChange:e=>c({search:t=>({...t,app:e.target.value,endpoint:void 0})}),className:`rounded-md border border-line bg-panel px-2 py-1.5 text-sm`,children:(0,m.jsx)(p,{apps:t.apps,names:t.names})})]})]}),(0,m.jsx)(s,{rangeFrom:l.from,retention:t.retention}),f&&(0,m.jsx)(_,{app:t.app,row:f.endpoint,failures:f.failures}),t.missing&&(0,m.jsxs)(`p`,{className:`rounded-lg border border-line bg-panel-2 px-3 py-2 text-sm text-muted`,children:[(0,m.jsx)(`span`,{className:`font-mono text-ink`,children:t.missing}),` had no calls or failures in `,l.label,`.`]}),g.length===0?(0,m.jsxs)(`p`,{className:`text-sm text-muted`,children:[`No API calls recorded in `,l.label,`. Calls are counted when the SDK's network capture is on, and failures when they're stored as errors.`]}):(0,m.jsxs)(m.Fragment,{children:[u.length>0&&(0,m.jsx)(v,{rows:u,endpoints:t.endpoints,keep:{app:t.app,range:i.range,from:i.from,to:i.to},now:Date.parse(t.generatedAt)}),(0,m.jsxs)(d,{title:`${g.length} endpoint${g.length===1?``:`s`}`,subtitle:`Calls, failure rate and timings count every call the SDK saw. Statuses and backend codes count the stored failures, which the SDK samples.`,right:(0,m.jsx)(`span`,{className:`flex gap-1 text-xs`,role:`group`,"aria-label":`Sort endpoints`,children:Object.keys(h).map(e=>(0,m.jsx)(n,{to:`/endpoints`,search:t=>({...t,sort:e===`failing`?void 0:e}),"aria-pressed":o===e,className:`whitespace-nowrap rounded-md border px-2 py-1 ${o===e?`border-ink text-ink`:`border-line text-muted hover:text-ink`}`,children:h[e]},e))}),children:[(0,m.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,m.jsxs)(`table`,{className:`tabular w-full min-w-[720px] text-left text-sm`,children:[(0,m.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,m.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`Endpoint`}),(0,m.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Calls`}),(0,m.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Failed`}),(0,m.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`p50`}),(0,m.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`p95`}),(0,m.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Statuses`}),(0,m.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Backend codes`})]})}),(0,m.jsx)(`tbody`,{children:g.map(e=>(0,m.jsxs)(`tr`,{className:`border-b border-line last:border-0 ${f?.endpoint.endpoint===e.endpoint?`bg-panel-2`:``}`,children:[(0,m.jsx)(`td`,{className:`max-w-[320px] px-4 py-2 sm:px-2`,children:(0,m.jsx)(n,{to:`/endpoints`,search:t=>({...t,endpoint:e.endpoint}),className:`block hover:underline`,title:e.endpoint,children:(0,m.jsx)(S,{row:e})})}),(0,m.jsx)(`td`,{className:`px-2 py-2 text-right text-muted`,children:b(e.calls)}),(0,m.jsx)(`td`,{className:`px-2 py-2 text-right ${e.failureRate!==null&&e.failureRate>=.05?`font-semibold text-sev-critical`:`text-muted`}`,children:e.failureRate===null?e.failures?`${e.failures} stored`:`—`:w(e.failureRate)}),(0,m.jsx)(`td`,{className:`px-2 py-2 text-right`,children:T(e.p50)}),(0,m.jsx)(`td`,{className:`px-2 py-2 text-right font-semibold ${e.p95!==null&&e.p95>=3e3?`text-sev-high`:``}`,children:T(e.p95)}),(0,m.jsx)(`td`,{className:`px-2 py-2`,children:(0,m.jsx)(C,{items:e.statuses})}),(0,m.jsx)(`td`,{className:`px-2 py-2`,children:(0,m.jsx)(C,{items:e.backendCodes})})]},e.endpoint))})]})}),(0,m.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`Failed: calls the SDK counted as failed (status 400 and above on mobile). p50/p95: half / 95% of calls finished within this time. "—": the SDK sent no request timings for that endpoint.`}),t.truncated&&(0,m.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`There were more stored failures than one page reads: statuses, backend codes and failure lists may be undercounted. Pick a shorter period for exact ones.`})]})]})]})}function _({app:e,row:t,failures:r}){return(0,m.jsxs)(d,{title:c([t.service,t.method,t.path])??t.endpoint,subtitle:`${t.failures} stored failure${t.failures===1?``:`s`} in this period${t.lastFailure?`, the last ${f(t.lastFailure)}`:``}. Newest first.`,children:[(0,m.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-x-6 gap-y-1 text-sm`,children:[(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`text-muted`,children:`Calls `}),b(t.calls)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`text-muted`,children:`Failure rate `}),x(t.failureRate)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`text-muted`,children:`p50 `}),T(t.p50)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`text-muted`,children:`p95 `}),T(t.p95)]}),(0,m.jsx)(n,{to:`/endpoints`,search:e=>({...e,endpoint:void 0}),className:`ml-auto text-xs text-muted hover:text-ink hover:underline`,children:`Close`})]}),r.length===0?(0,m.jsx)(`p`,{className:`text-sm text-muted`,children:`No stored failures for this endpoint in this period.`}):(0,m.jsx)(`ul`,{className:`divide-y divide-line`,children:r.map(t=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(n,{to:`/events/$eventId`,params:{eventId:t.eventId},search:{app:e,issue:t.fingerprint},className:`grid grid-cols-[1fr_auto] gap-x-4 gap-y-0.5 px-1 py-2 text-sm hover:bg-panel-2 sm:grid-cols-[11rem_5rem_1fr_auto]`,children:[(0,m.jsx)(`span`,{title:t.ts,children:l(t.ts)}),(0,m.jsx)(`span`,{className:`justify-self-end font-semibold text-sev-critical sm:justify-self-start`,children:t.status}),(0,m.jsx)(`span`,{className:`min-w-0 break-words text-muted`,children:c([t.backendCode&&`code ${t.backendCode}`,t.backendTitle&&`"${t.backendTitle}"`,t.errorKind,t.traceId&&`trace ${t.traceId.slice(0,8)}…`],` · `)??`No backend detail`}),(0,m.jsxs)(`span`,{className:`font-mono text-xs text-muted sm:text-right`,children:[t.userId??``,t.durationMs===void 0?``:` · ${t.durationMs} ms`]})]})},t.eventId))})]})}function v({rows:e,endpoints:t,keep:n,now:r}){let a=e.map(e=>i(e,t,r)).sort(o);return(0,m.jsxs)(d,{title:`By service`,subtitle:`Coloured by how each is doing, worst first. Click one for what's failing, how often, and why.`,children:[(0,m.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-3`,children:a.map(e=>(0,m.jsx)(`li`,{children:(0,m.jsx)(u,{level:e.level,name:e.name,headline:e.headline,measure:e.measure,live:e.live,lastFailure:e.lastFailure,link:{to:`/services/$service`,params:{service:e.key},search:n},now:r})},e.key))}),e.some(e=>!e.service)&&(0,m.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`Name hosts in Settings, or set the SDK's network.baseUrls, to group unnamed ones.`})]})}function y(e,t){if(t===`failing`)return e;let n=t===`slow`?e=>e.p95===null?-1:Number.isFinite(e.p95)?e.p95:1e9:e=>e.calls??-1;return[...e].sort((e,t)=>n(t)-n(e))}var b=e=>e===null?`—`:e.toLocaleString(),x=e=>e===null?`—`:w(e);function S({row:e}){return(0,m.jsxs)(`span`,{className:`break-words`,children:[e.service&&(0,m.jsxs)(`span`,{className:`font-medium`,children:[e.service,` `]}),(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:c([e.method,e.path])})]})}function C({items:e}){return e.length?(0,m.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,3).map(e=>(0,m.jsxs)(`span`,{className:`rounded bg-panel-2 px-1.5 py-0.5 font-mono text-[11px]`,children:[e.key,(0,m.jsxs)(`span`,{className:`text-muted`,children:[` ×`,e.count]})]},e.key)),e.length>3&&(0,m.jsxs)(`span`,{className:`text-[11px] text-muted`,children:[`+`,e.length-3]})]}):(0,m.jsx)(`span`,{className:`text-muted`,children:`—`})}function w(e){return`${(e*100).toFixed(+(e<.1))}%`}function T(e){return e===null?`—`:Number.isFinite(e)?e>=1e3?`≤ ${(e/1e3).toFixed(e%1e3?1:0)} s`:`≤ ${e} ms`:`> 10 s`}export{g as component};
@@ -0,0 +1,2 @@
1
+ import{gt as e,pt as t,q as n,z as r}from"./src-BiKxgjA_.js";import{t as i}from"./copy-button-BwRd5q7l.js";import{a,i as o,n as s,o as c,t as l}from"./timeline-WXE49N62.js";import{i as u,n as d}from"./ui-DRjjeSWy.js";import{t as f}from"./request-panel-DmtFRF8Z.js";import{i as p}from"./index-DEnCDILF.js";var m=e(t());function h(e){if(/^[+\d\s\-()]+$/.test(e)){let t=e.replace(/\D/g,``),n=/^27\d{9}$/.test(t)?`0${t.slice(2)}`:t;if(n.length>=8)return`${n.slice(0,3)}•••${n.slice(-4)}`}return/^\d{5,}$/.test(e)?`•••${e.slice(-3)}`:e.length>8?`${e.slice(0,3)}•••${e.slice(-3)}`:e}function g(e){return e.replace(/\+?\d[\d \-]{6,}\d/g,e=>h(e))}function _(e,t){let n=t=>new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1,timeZone:t,timeZoneName:`short`}).format(new Date(e));try{return n(t??`UTC`)}catch{return n(`UTC`)}}function v(e){if(e.category!==`navigation`)return;let t=e.message.split(/\s*(?:→|->)\s*/).filter(Boolean);if(t.length)return t.length>1?{from:t[t.length-2],to:t[t.length-1]}:{to:t[0]}}function y(e){let t=[];for(let n of e){let e=v(n);e&&(e.from&&!t.length&&t.push(e.from),t[t.length-1]!==e.to&&t.push(e.to))}return t}function b(e){if(e.category!==`ui`)return;let t=e.data?.label;return typeof t==`string`&&t?t:/^tapped\s+["“]?(.+?)["”]?$/i.exec(e.message)?.[1]}function x(e){let t=e.data?.shown;if(typeof t==`string`&&t)return t;if(e.category===`ui`||e.category===`log`)return/^(?:showed|shown|alert|toast)\b\s*:?\s+["“]?(.+?)["”]?$/i.exec(e.message)?.[1]}var S=e=>`"${e}"`;function C(e){let t=e.service?`The ${e.service} service`:`The backend (${[e.method,e.path].filter(Boolean).join(` `)})`,n=e.traceId?` (trace ${e.traceId.slice(0,4)}…)`:``;if(e.outcome===`sessionExpired`)return`${t} said their session had expired${e.status?` (${e.status})`:``}${n}.`;if(e.status===void 0){let r=e.outcome&&e.outcome!==`answered`?e.outcome:e.errorKind;return`${t} didn't answer${r?` (${r})`:``}${n}.`}let r=e.backendTitle?` ${S(e.backendTitle)}`:``,i=e.backendCode?`, code ${e.backendCode}`:``;return`${t} answered ${e.status}${r}${i}${n}.`}function w(e,t){let n=[],r=[e.context.os.name&&D(e.context.os.name),e.context.os.version].filter(Boolean).join(` `),i=e.user.id?`Customer ${h(e.user.id)}`:`A signed-out customer`,a=e.context.app.version?`app ${e.context.app.version}`:void 0;n.push(`${t(e.ts)} · ${i}${r||a?` on ${[r,a].filter(Boolean).join(`, `)}`:``}.`);let o=y(e.timeline).slice(-5),s=e.timeline.map(e=>e.category===`navigation`).lastIndexOf(!0),c=e.timeline.slice(s+1).reverse().map(b).find(Boolean),l=[o.length>1?`Went ${o.join(` → `)}`:o.length?`Was on ${o[0]}`:void 0,c&&`tapped ${S(c)}`].filter(Boolean).join(`, `);l&&n.push(`${E(l)}.`),e.request?n.push(C(e.request)):n.push(`The app ${e.handled?`reported`:`hit`} an error: ${g(`${e.error.name}: ${e.error.message}`)}.`);let u=e.after??[],d=e.timeline.map(e=>!!e.api?.failed).lastIndexOf(!0),f=[...e.timeline.slice(d>=0?d+1:e.timeline.length),...u.slice(0,3)].map(x).find(Boolean),p=u.map(v).find(Boolean),m=p&&o.includes(p.to)?`went back to ${p.to}`:p?`went to ${p.to}`:void 0;return(f||m)&&n.push(`${f?`They saw ${S(f)}${m?` and ${m}`:``}`:`They ${m}`}.`),{sentences:n,screens:o,saw:f}}function T(e,t,n){return[e.sentences.join(` `),``,`Event: ${t}`,...n?[`Trace: ${n}`]:[]].join(`
2
+ `)}var E=e=>e.charAt(0).toUpperCase()+e.slice(1),D=e=>e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1),O=n();function k(){let e=p.useLoaderData(),{range:t,from:n,to:i,view:s}=p.useSearch(),c={app:e.app,range:t,from:n,to:i},l=t=>({to:`/events/$eventId`,params:{eventId:t},search:{...c,issue:e.issue.fingerprint,view:s}}),m=s===`support`,h=`rounded-md border border-line px-2 py-1 text-xs hover:bg-panel-2`;return(0,O.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-sm`,children:[(0,O.jsxs)(r,{to:`/issues/$fingerprint`,params:{fingerprint:e.issue.fingerprint},search:c,className:`text-muted hover:text-ink`,children:[`← `,e.issue.title]}),(0,O.jsxs)(`nav`,{"aria-label":`Other occurrences`,className:`flex gap-2`,children:[e.newer?(0,O.jsx)(r,{...l(e.newer),className:h,children:`← Newer`}):null,e.older?(0,O.jsx)(r,{...l(e.older),className:h,children:`Older →`}):null]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:[`Occurrence · `,o(e.ts),` · `,e.handled?`caught by the app`:`uncaught`,e.flow?` · ${e.flow}${e.step?` · ${e.step}`:``}`:``]}),(0,O.jsxs)(`h1`,{className:`mt-1 break-words text-xl font-semibold tracking-tight`,children:[e.error.name,`: `,e.error.message]})]}),(0,O.jsx)(M,{d:e}),(0,O.jsx)(A,{d:e,support:m,search:{...c,issue:e.issue.fingerprint,view:s}}),m?(0,O.jsx)(d,{title:`What they did`,subtitle:`Screens, taps and failed calls before the error, and after it when the session went on.`,children:(0,O.jsx)(N,{items:e.timeline.filter(j),after:e.after.filter(j),errorTs:e.ts,errorText:`The error`})}):(0,O.jsxs)(O.Fragment,{children:[e.request&&(0,O.jsx)(d,{title:`The call that failed`,subtitle:`What the app sent and what the server answered.`,children:(0,O.jsx)(f,{call:e.request,exchange:e.exchange})}),(0,O.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-5`,children:[(0,O.jsx)(`div`,{className:`min-w-0 lg:col-span-3`,children:(0,O.jsx)(d,{title:`Timeline`,subtitle:`What happened before the error, in order. Times are from the device, relative to the error.`,children:(0,O.jsx)(N,{items:e.timeline,errorTs:e.ts,errorText:`${e.error.name}: ${e.error.message}`})})}),(0,O.jsx)(`div`,{className:`min-w-0 space-y-5 lg:col-span-2`,children:(0,O.jsxs)(d,{title:`Device and app`,children:[(0,O.jsx)(u,{rows:[[`OS`,a([e.context.os.name,e.context.os.version])],[`Device`,a([e.context.device.brand,e.context.device.model])],[`App`,a([e.context.app.version,e.context.app.build&&`(${e.context.app.build})`])],[`Update`,e.context.app.update],[`Environment`,e.context.app.environment],[`Runtime`,a([e.context.runtime.name,e.context.runtime.version,e.context.runtime.engine])],[`Network`,a([e.context.network?.type,e.context.network?.effectiveType])],[`Locale`,a([e.context.locale,e.context.timezone],` · `)]]}),(0,O.jsx)(`h3`,{className:`mb-2 mt-4 text-xs font-medium text-muted`,children:`Tags`}),e.tags.length?(0,O.jsx)(u,{mono:!0,rows:e.tags.map(e=>[e.key,e.value])}):(0,O.jsx)(`p`,{className:`text-sm text-muted`,children:`No tags on this event.`})]})})]}),(0,O.jsx)(d,{title:`Stack trace`,subtitle:`The app's own code first, then libraries and the runtime.`,children:e.frames.length?(0,O.jsx)(`ol`,{className:`space-y-1 font-mono text-xs`,children:e.frames.map((e,t)=>(0,O.jsxs)(`li`,{className:`rounded px-2 py-1 ${e.inApp?`bg-accent-soft text-ink`:`text-muted`}`,children:[(0,O.jsx)(`span`,{className:`font-semibold`,children:e.fn??`<anonymous>`}),` `,(0,O.jsxs)(`span`,{className:`break-all`,children:[e.file,`:`,e.line,`:`,e.col]}),!e.inApp&&(0,O.jsx)(`span`,{className:`ml-2 text-[10px] uppercase tracking-wide`,children:`library`})]},t))}):(0,O.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap text-xs text-muted`,children:e.stack??`No stack trace captured.`})})]})]})}function A({d:e,support:t,search:n}){let a=w(e,t=>_(t,e.context.timezone)),[o,s]=(0,m.useState)(``);(0,m.useEffect)(()=>s(window.location.origin),[]);let c=`${o}/events/${encodeURIComponent(e.id)}?app=${encodeURIComponent(e.app)}&issue=${encodeURIComponent(e.issue.fingerprint)}${t?`&view=support`:``}`,l=e=>`rounded-md px-2.5 py-1 text-xs ${e?`bg-panel-2 font-medium text-ink`:`text-muted hover:text-ink`}`;return(0,O.jsxs)(`section`,{"aria-label":`Support summary`,className:`rounded-xl border border-line bg-panel p-4 sm:p-5`,children:[(0,O.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,O.jsx)(`h2`,{className:`text-sm font-semibold`,children:`What happened`}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`flex rounded-md border border-line p-0.5`,role:`group`,"aria-label":`View`,children:[(0,O.jsx)(r,{to:`/events/$eventId`,params:{eventId:e.id},search:{...n,view:`support`},replace:!0,"aria-pressed":t,className:l(t),children:`Support`}),(0,O.jsx)(r,{to:`/events/$eventId`,params:{eventId:e.id},search:{...n,view:void 0},replace:!0,"aria-pressed":!t,className:l(!t),children:`Developer`})]}),(0,O.jsx)(i,{text:T(a,c,e.request?.traceId),label:`Copy for ticket`,ariaLabel:`Copy the summary, event link and trace id for a ticket`})]})]}),(0,O.jsx)(`p`,{className:`text-[15px] leading-relaxed`,suppressHydrationWarning:!0,children:a.sentences.join(` `)}),t&&(a.screens.length>0||a.saw)&&(0,O.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[minmax(6rem,auto)_1fr] gap-x-4 gap-y-1 text-sm`,children:[a.screens.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`dt`,{className:`text-muted`,children:`Screens`}),(0,O.jsx)(`dd`,{className:`min-w-0 break-words`,children:a.screens.join(` → `)})]}),a.saw&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`dt`,{className:`text-muted`,children:`They saw`}),(0,O.jsxs)(`dd`,{className:`min-w-0 break-words`,children:[`"`,a.saw,`"`]})]})]})]})}function j(e){return e.category===`navigation`||e.category===`ui`||!!e.api?.failed||!!x(e)}function M({d:e}){let t=e.user.id;return(0,O.jsxs)(`section`,{"aria-label":`Customer and session`,className:`flex flex-wrap items-center gap-x-6 gap-y-2 rounded-xl border border-line bg-panel px-4 py-3 text-sm`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`span`,{className:`text-muted`,children:`Customer `}),t?(0,O.jsx)(`span`,{className:`break-all font-mono`,children:t}):(0,O.jsx)(`span`,{className:`text-muted`,children:`not signed in`}),t&&(0,O.jsx)(`span`,{className:`ml-2`,children:(0,O.jsx)(i,{text:t,label:`Copy`,ariaLabel:`Copy customer id`})})]}),e.user.anonymousId&&(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`span`,{className:`text-muted`,children:`Install `}),(0,O.jsx)(`span`,{className:`break-all font-mono text-xs`,children:e.user.anonymousId})]}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`span`,{className:`text-muted`,children:`Session `}),(0,O.jsx)(`span`,{className:`break-all font-mono text-xs`,children:e.sessionId}),(0,O.jsx)(`span`,{className:`ml-2`,children:(0,O.jsx)(i,{text:e.sessionId,label:`Copy`,ariaLabel:`Copy session id`})})]}),(0,O.jsx)(r,{to:`/sessions/$sessionId`,params:{sessionId:e.sessionId},search:{app:e.app},className:`text-accent hover:underline`,children:`Whole session →`})]})}function N({items:e,after:t=[],errorTs:n,errorText:r}){if(!e.length&&!t.length)return(0,O.jsx)(`p`,{className:`text-sm text-muted`,children:`No breadcrumbs. The SDK records screens, taps and requests on its own once it's set up; see the README.`});let i=(e,t)=>(0,O.jsxs)(`li`,{className:`grid grid-cols-[4.5rem_1.25rem_1fr] gap-2 rounded-md px-2 py-1.5 text-sm ${e.failed?`bg-sev-critical/10`:e.level===`warning`?`bg-sev-medium/10`:``}`,children:[(0,O.jsx)(`span`,{className:`tabular pt-0.5 text-right text-xs text-muted`,title:e.ts,children:c(e.ts,n)}),(0,O.jsx)(`span`,{"aria-hidden":!0,className:`pt-0.5 text-center ${e.failed?`text-sev-critical`:`text-muted`}`,children:s[e.category]}),(0,O.jsx)(`div`,{className:`min-w-0`,children:(0,O.jsx)(l,{item:e})})]},t);return(0,O.jsxs)(`ol`,{className:`space-y-2`,children:[e.map((e,t)=>i(e,`b${t}`)),(0,O.jsxs)(`li`,{className:`grid grid-cols-[4.5rem_1.25rem_1fr] gap-2 rounded-md bg-sev-critical/15 px-2 py-1.5 text-sm font-medium text-sev-critical`,children:[(0,O.jsx)(`span`,{className:`tabular pt-0.5 text-right text-xs`,children:`0 s`}),(0,O.jsx)(`span`,{"aria-hidden":!0,className:`pt-0.5 text-center`,children:`✕`}),(0,O.jsx)(`span`,{className:`break-words`,children:r})]}),t.map((e,t)=>i(e,`a${t}`))]})}export{k as component};
@@ -0,0 +1,2 @@
1
+ var e=/^\[binary(?: ([\d.]+ ?[KMG]?B))?(?:, ([^\]]+))?\]$/i,t=/…\[truncated(?:, ([\d.]+ ?[KMG]?B) total)?\]$/;function n(e){return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function r(e){let n=t.exec(e);return n?{text:e.slice(0,n.index),cut:!0,total:n[1]}:{text:e,cut:!1}}function i(t){let i=t.body;if(i===void 0)return;let a=e.exec(i.trim());if(a){let e=a[1]??(t.bodySize===void 0?void 0:n(t.bodySize));return{text:``,raw:``,json:!1,cut:!1,binary:!0,note:`Binary${e?`, ${e}`:``}${a[2]?` (${a[2]})`:``}: not captured.`}}let o=r(i),s=o.cut||!!t.truncated,c=o.total??(t.bodySize===void 0?void 0:`${t.bodySize.toLocaleString(`en`)} characters`),l=s?`Cut after ${o.text.length.toLocaleString(`en`)} characters${c?` of ${c}`:``}: the rest wasn't captured.`:void 0,u={raw:o.text,cut:s,binary:!1,note:l};if(!o.text.trim())return{...u,text:``,json:!1,note:l??`Empty body.`};try{return{...u,text:JSON.stringify(JSON.parse(o.text),null,2),json:!0}}catch{return{...u,text:o.text,json:!1}}}var a=e=>`'${e.replace(/'/g,`'\\''`)}'`;function o(e){let t=e.request,n=t.query===void 0?void 0:r(t.query),o=t.fullUrl??`https://HOST${t.url.startsWith(`/`)?``:`/`}${t.url}`,s=n?.text?`${o}?${n.text}`:o,c=[`curl -X ${a(t.method)} ${a(s)}`];for(let[e,n]of Object.entries(t.headers??{}))c.push(`-H ${a(`${e}: ${n}`)}`);let l=i(t);l&&!l.binary&&c.push(`--data-raw ${a(l.raw)}`);let u=[[JSON.stringify(t.headers??{}),t.body??``,t.query??``].some(e=>e.includes(`[redacted]`))&&`secrets show as [redacted]`,/\/:id(\/|$)/.test(t.url)&&`ids in the path show as :id`,!t.fullUrl&&`replace HOST`,n?.cut&&`the query was cut`,l?.cut&&`the body was cut`,l?.binary&&`the binary body wasn't captured`].filter(Boolean),d=c.join(` \\
2
+ `);return{command:u.length?`# From deBug, as captured: ${u.join(`; `)}.\n${d}`:d,complete:u.length===0}}function s(e){let t=`${e.outcome??``} ${e.errorKind??``}`;return/time/i.test(t)?`The call timed out: the server didn't answer in time.`:/never|offline|no.?connection/i.test(t)?`The call never left the phone: there was no connection.`:`No answer came back: the server couldn't be reached, or the connection dropped.`}export{s as a,r as i,o as n,n as r,i as t};