railwatch 0.6.0 → 0.6.1
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.
- checksums.yaml +4 -4
- data/AGENTS.md +42 -26
- data/CHANGELOG.md +28 -0
- data/README.md +40 -29
- data/app/jobs/railwatch/rollup_job.rb +3 -1
- data/app/models/railwatch/ingest/rollup_absorber.rb +1 -1
- data/docs/ai-and-mcp.md +9 -3
- data/docs/configuration.md +68 -27
- data/docs/embedded.md +76 -43
- data/docs/faq.md +22 -10
- data/docs/getting-started.md +116 -41
- data/docs/records.md +13 -10
- data/docs/replacing-nightwatch.md +16 -14
- data/docs/replacing-sentry.md +19 -10
- data/docs/security.md +24 -3
- data/docs/self-hosting.md +9 -1
- data/docs/testing.md +14 -4
- data/docs/troubleshooting.md +62 -23
- data/lib/generators/railwatch/install/install_generator.rb +5 -4
- data/lib/generators/railwatch/install/templates/initializer.rb.tt +2 -2
- data/lib/railwatch/version.rb +1 -1
- data/llms.txt +21 -18
- data/public/railwatch/assets/{app-layout-2xAKndVD.js → app-layout-Zc0v-hYh.js} +1 -1
- data/public/railwatch/assets/{app-wordmark-Bt6XqURo.js → app-wordmark-BA_60AVb.js} +1 -1
- data/public/railwatch/assets/{appearance-DyCfeh9o.js → appearance-CcfP9tZ7.js} +1 -1
- data/public/railwatch/assets/application-BrN3Sz94.css +1 -0
- data/public/railwatch/assets/{arrow-up-EmePsTKP.js → arrow-up-CLQ-7heQ.js} +1 -1
- data/public/railwatch/assets/{auth-layout-BuwogWMZ.js → auth-layout-C05gEBIQ.js} +1 -1
- data/public/railwatch/assets/{badge-Dv7I-ebP.js → badge-DRae8XwK.js} +1 -1
- data/public/railwatch/assets/{braces-iZ7MEfYP.js → braces-rSYydpLY.js} +1 -1
- data/public/railwatch/assets/{card-DqdEEKcJ.js → card-DPjFKfen.js} +1 -1
- data/public/railwatch/assets/{chart-C4k7Ub9W.js → chart-DWh7l8yM.js} +1 -1
- data/public/railwatch/assets/{chart-hover-2yZG3w2u.js → chart-hover-CfoZUY4J.js} +1 -1
- data/public/railwatch/assets/{chart-panel-CONkZcn9.js → chart-panel-CC49WTQL.js} +1 -1
- data/public/railwatch/assets/{checkbox-DKbThbxr.js → checkbox-DPkLUiwM.js} +1 -1
- data/public/railwatch/assets/{code-CYahYQHZ.js → code-CLmYS6FU.js} +1 -1
- data/public/railwatch/assets/{copy-block-CbJum9s8.js → copy-block-CGcXxp8J.js} +1 -1
- data/public/railwatch/assets/{copy-id-JmvLfkmx.js → copy-id-vBYHQwxg.js} +1 -1
- data/public/railwatch/assets/{cursor-load-more-C1ylbqqL.js → cursor-load-more-Ddwxe5dZ.js} +1 -1
- data/public/railwatch/assets/{data-table-CVKR2wkq.js → data-table-CzKTEE-O.js} +1 -1
- data/public/railwatch/assets/{edit-BwSEVrTG.js → edit-B1kmWkzd.js} +1 -1
- data/public/railwatch/assets/{edit-BXF5oNYA.js → edit-D9cx4pbG.js} +1 -1
- data/public/railwatch/assets/{edit-D5BRDwLT.js → edit-yv6j9p-V.js} +1 -1
- data/public/railwatch/assets/{empty-state-Bn48Gplm.js → empty-state-CW4wclK_.js} +1 -1
- data/public/railwatch/assets/{env-layout-CKLL8Ds7.js → env-layout-Kz7wks1x.js} +1 -1
- data/public/railwatch/assets/{execution-path-DWovhgLi.js → execution-path-FAuIzOXB.js} +1 -1
- data/public/railwatch/assets/{filter-bar-xcbJC93z.js → filter-bar-CJDjWFib.js} +1 -1
- data/public/railwatch/assets/{flamegraph-BNbNIuKT.js → flamegraph-EaGkP2NT.js} +1 -1
- data/public/railwatch/assets/{frames-Bk39xfJG.js → frames-zZuIaNH9.js} +1 -1
- data/public/railwatch/assets/{google-sign-in-button-B5as2ps1.js → google-sign-in-button-2_zgbgVy.js} +1 -1
- data/public/railwatch/assets/{index-XjXcV-EO.js → index-B49SWz7K.js} +1 -1
- data/public/railwatch/assets/{index-B0xgzHuN.js → index-BHlY4wKe.js} +1 -1
- data/public/railwatch/assets/{index-CiaeS-n7.js → index-BZpPtyFY.js} +1 -1
- data/public/railwatch/assets/{index-BfitxVBv.js → index-BeVK6jCL.js} +1 -1
- data/public/railwatch/assets/{index-C-EwH4lO.js → index-BfbSo01U.js} +1 -1
- data/public/railwatch/assets/{index-CrA7jBTK.js → index-BfgncAv6.js} +1 -1
- data/public/railwatch/assets/{index-D0mKj3Hg.js → index-BhNszK1k.js} +1 -1
- data/public/railwatch/assets/{index-CDXlITyG.js → index-Bu01uWvw.js} +1 -1
- data/public/railwatch/assets/{index-w_skgMmK.js → index-C1s_hK3p.js} +1 -1
- data/public/railwatch/assets/{index-Zkt4W_CM.js → index-C8Cggnbw.js} +1 -1
- data/public/railwatch/assets/{index-BDVShWMs.js → index-CBip6V4z.js} +1 -1
- data/public/railwatch/assets/{index-DeLtMWou.js → index-CMJGss5R.js} +1 -1
- data/public/railwatch/assets/{index-LKgpCzoR.js → index-CRo3yK20.js} +1 -1
- data/public/railwatch/assets/{index-gCvuyG1l.js → index-CWB_p2J8.js} +1 -1
- data/public/railwatch/assets/{index-C8JIdb3_.js → index-CWHpndGc.js} +1 -1
- data/public/railwatch/assets/{index-CBFCtJAR.js → index-Ca_S4Sc3.js} +1 -1
- data/public/railwatch/assets/{index-o1xqGvLo.js → index-CanPDDOa.js} +1 -1
- data/public/railwatch/assets/{index-Bd4YpOIO.js → index-Cie90Yat.js} +1 -1
- data/public/railwatch/assets/{index-C_hQmVTP.js → index-CiepQ_pR.js} +1 -1
- data/public/railwatch/assets/{index-BRvRkfob.js → index-Cm1uCIGN.js} +1 -1
- data/public/railwatch/assets/{index-dpG-19ZN.js → index-CzitnnSC.js} +1 -1
- data/public/railwatch/assets/{index-Vj93BTR5.js → index-DEUfClv3.js} +1 -1
- data/public/railwatch/assets/index-DJKwo-mI.js +1 -0
- data/public/railwatch/assets/{index-cTzBycCg.js → index-DK6y0YHp.js} +1 -1
- data/public/railwatch/assets/{index-B-FXAo1w.js → index-DMNPpLH9.js} +1 -1
- data/public/railwatch/assets/{index-BeQw69GM.js → index-DZO1mSfX.js} +1 -1
- data/public/railwatch/assets/{index-BVWapDeB.js → index-Db5wj3M5.js} +1 -1
- data/public/railwatch/assets/{index-DV5MdmpY.js → index-Dcy5WktB.js} +1 -1
- data/public/railwatch/assets/{index-aPCZX-pW.js → index-DvG0-7Lx.js} +1 -1
- data/public/railwatch/assets/{index-Atp1FTgX.js → index-Dvj1wuka.js} +1 -1
- data/public/railwatch/assets/{index-COd9lT84.js → index-KyZX46qX.js} +1 -1
- data/public/railwatch/assets/{index-S0NVaLj9.js → index-Ze-KP-sl.js} +1 -1
- data/public/railwatch/assets/{index-DaE-1xhx.js → index-mhRbWLBM.js} +1 -1
- data/public/railwatch/assets/{index-DdVg9LKX.js → index-x099JL5f.js} +1 -1
- data/public/railwatch/assets/{index-CcennT28.js → index-x28zb_nf.js} +1 -1
- data/public/railwatch/assets/{inertia-CqnzqPVD.js → inertia-Cuyz2ZHO.js} +2 -2
- data/public/railwatch/assets/{input-error-ByT28UdP.js → input-error-hog6gGxg.js} +1 -1
- data/public/railwatch/assets/{json-viewer-Bnu9RsJL.js → json-viewer-DH2W9HXf.js} +1 -1
- data/public/railwatch/assets/{klass-nLiBV-Az.js → klass-DHbDelLk.js} +1 -1
- data/public/railwatch/assets/{label-1nSzpSB6.js → label-DdCBgiUn.js} +1 -1
- data/public/railwatch/assets/{layout-D7lE1Doo.js → layout-Cueyl7c5.js} +1 -1
- data/public/railwatch/assets/{live-dot-UdzOfzJb.js → live-dot-BZgYTYdt.js} +1 -1
- data/public/railwatch/assets/{nav-BRCgp2w3.js → nav-BSSGObDZ.js} +1 -1
- data/public/railwatch/assets/{new-COyDKOOb.js → new-B8FSb8Bl.js} +1 -1
- data/public/railwatch/assets/{new-Cd9zPNJ8.js → new-C39_v2Ll.js} +1 -1
- data/public/railwatch/assets/{new-vjRzERL3.js → new-DVOPwaC5.js} +1 -1
- data/public/railwatch/assets/{new-C60G72DR.js → new-Dd40nvJR.js} +1 -1
- data/public/railwatch/assets/{new-DMJGKjmH.js → new-SxnYe1SE.js} +1 -1
- data/public/railwatch/assets/{new-Omvf-c9s.js → new-eP5vKD3Y.js} +1 -1
- data/public/railwatch/assets/{onboarding-gUjJQc-6.js → onboarding-CUpZl5KB.js} +1 -1
- data/public/railwatch/assets/{origin-identity-M1YUPYS0.js → origin-identity-BYt2uiuo.js} +1 -1
- data/public/railwatch/assets/{percentile-picker-BxIVblBw.js → percentile-picker-CeQgllxD.js} +1 -1
- data/public/railwatch/assets/{relative-time-DQ4kjowZ.js → relative-time-D5UbF4oO.js} +1 -1
- data/public/railwatch/assets/{release-health-Cb1tMOOO.js → release-health-uP-GF3_V.js} +1 -1
- data/public/railwatch/assets/{route-BJkoEm7r.js → route-DQAY8JEr.js} +1 -1
- data/public/railwatch/assets/{segmented-C4oWE73o.js → segmented-BeIe4uqk.js} +1 -1
- data/public/railwatch/assets/{select-ocdQJdQo.js → select-2R16457Z.js} +1 -1
- data/public/railwatch/assets/{separator-Ct2UcZ2x.js → separator-D5I0UCB5.js} +1 -1
- data/public/railwatch/assets/series-chart-gnrzhmM6.js +1 -0
- data/public/railwatch/assets/show-2BkeNRUC.js +2 -0
- data/public/railwatch/assets/{show-BLJOyLb_.js → show-B0X1hRQH.js} +1 -1
- data/public/railwatch/assets/{show-C8TkpEgm.js → show-BKUV5l5q.js} +1 -1
- data/public/railwatch/assets/{show-BAjfddEn.js → show-BQJD_CsF.js} +1 -1
- data/public/railwatch/assets/{show-C6OiJ6Hr.js → show-BhmD6Sxp.js} +1 -1
- data/public/railwatch/assets/{show-CEhPVMMT.js → show-C3KcnVo2.js} +1 -1
- data/public/railwatch/assets/{show-CX_pab9S.js → show-C95cHd06.js} +1 -1
- data/public/railwatch/assets/{show-Bsu1rvnK.js → show-CdB4uVQS.js} +1 -1
- data/public/railwatch/assets/{show-yEOrk6Pt.js → show-CoCqcVIp.js} +1 -1
- data/public/railwatch/assets/{show-DDVsv-uS.js → show-D2LqjEsU.js} +1 -1
- data/public/railwatch/assets/{show-D6lgzL6n.js → show-DNpnKyTh.js} +1 -1
- data/public/railwatch/assets/{show-eKazflRI.js → show-DOlTxbig.js} +1 -1
- data/public/railwatch/assets/{show-Dwiq-8hA.js → show-DQCkttL8.js} +1 -1
- data/public/railwatch/assets/{show-CBFBiBY2.js → show-DcxesipC.js} +1 -1
- data/public/railwatch/assets/{show-BoVyMQS6.js → show-IGJoc_X0.js} +1 -1
- data/public/railwatch/assets/{show-gtwKsTsl.js → show-YsNpqbcI.js} +1 -1
- data/public/railwatch/assets/{show-B4bwI9x2.js → show-qNV6H8SH.js} +1 -1
- data/public/railwatch/assets/{sort-header-CPM6fhXv.js → sort-header-mEJUM3Av.js} +1 -1
- data/public/railwatch/assets/{sparkline-cell-CXCxXPWt.js → sparkline-cell-Dwg7awwh.js} +1 -1
- data/public/railwatch/assets/{stat-BNEfE8X1.js → stat-ZtxGU8lE.js} +1 -1
- data/public/railwatch/assets/{status-badge-D0aylrM5.js → status-badge-CH5P-Xkj.js} +1 -1
- data/public/railwatch/assets/{tenant-path-C4aM_cO0.js → tenant-path-CQoP-BeF.js} +1 -1
- data/public/railwatch/assets/{text-link-CP4lqUi6.js → text-link-DHJ8BXx5.js} +1 -1
- data/public/railwatch/assets/{textarea-DzJo2ds4.js → textarea-BeQtQyl5.js} +1 -1
- data/public/railwatch/assets/{timeline-BNcJ9PMc.js → timeline-CaKQVu48.js} +1 -1
- data/public/railwatch/assets/{transition-BX2M1iaq.js → transition-ksDpqhKJ.js} +1 -1
- data/public/railwatch/assets/{use-clipboard-C1ApSwzA.js → use-clipboard-DNefo-ky.js} +1 -1
- data/public/railwatch/assets/{use-live-DWwLg1Nj.js → use-live-DMTuhKfB.js} +1 -1
- data/public/railwatch/manifest.json +1286 -1286
- metadata +116 -116
- data/public/railwatch/assets/application-B7h1MIhi.css +0 -1
- data/public/railwatch/assets/index-DiQ4mqT_.js +0 -1
- data/public/railwatch/assets/series-chart-D6upsrSn.js +0 -1
- data/public/railwatch/assets/show-CV-lG2b6.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,u as v,an as P,j as s,e as C,t as E,L as N,i as S}from"./inertia-
|
|
1
|
+
import{c as g,u as v,an as P,j as s,e as C,t as E,L as N,i as S}from"./inertia-Cuyz2ZHO.js";import{D as y}from"./data-table-CzKTEE-O.js";import{P as $,E as b}from"./env-layout-Kz7wks1x.js";import{I,S as R}from"./status-badge-CH5P-Xkj.js";import{C as D,b as H,c as K,a as L}from"./card-DPjFKfen.js";import{a as w,w as T,m as B}from"./format-B9SDkrWj.js";import"./chart-hover-CfoZUY4J.js";import"./empty-state-CW4wclK_.js";import"./badge-DRae8XwK.js";import"./app-wordmark-BA_60AVb.js";import"./app-layout-Zc0v-hYh.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./checkbox-DPkLUiwM.js";import"./label-DdCBgiUn.js";import"./use-live-DMTuhKfB.js";import"./segmented-BeIe4uqk.js";function xe(t){const e=g.c(31),{environment:j,window:_}=v().props,r=j.application_id,i=j.id,n=t.person?.name??t.person_ref;let o;e[0]!==r||e[1]!==i||e[2]!==_?(o=P(r,i,{window:_}),e[0]=r,e[1]=i,e[2]=_,e[3]=o):o=e[3];let a;e[4]!==o?(a={title:"Users",href:o},e[4]=o,e[5]=a):a=e[5];let l;e[6]!==n?(l={title:n,href:"#"},e[6]=n,e[7]=l):l=e[7];let c;e[8]!==a||e[9]!==l?(c=[a,l],e[8]=a,e[9]=l,e[10]=c):c=e[10];let u;e[11]!==t.person?(u=t.person?`${t.person.email??""} ${t.person.tenant?`· tenant ${t.person.tenant}`:""} · first seen ${w(t.person.first_seen_at)} · last seen ${w(t.person.last_seen_at)}`:"Not yet identified.",e[11]=t.person,e[12]=u):u=e[12];let m;e[13]!==n||e[14]!==u?(m=s.jsx($,{title:n,description:u}),e[13]=n,e[14]=u,e[15]=m):m=e[15];let d;e[16]!==t.issues?(d=t.issues.length>0&&s.jsxs(D,{children:[s.jsx(H,{children:s.jsx(K,{children:"Issues affecting this user"})}),s.jsx(L,{children:s.jsx(y,{rows:t.issues,rowKey:V,columns:[{key:"k",header:"Issue",cell:Q},{key:"t",header:"Title",cell:O},{key:"s",header:"",cell:M},{key:"n",header:"Hits",align:"right",cell:J}]})})]}),e[16]=t.issues,e[17]=d):d=e[17];let p;e[18]!==r||e[19]!==i?(p=k=>k.execution_id&&C.visit(E(r,i,k.execution_id)),e[18]=r,e[19]=i,e[20]=p):p=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=[{key:"when",header:"When",cell:F},{key:"k",header:"Kind",cell:A},{key:"n",header:"Name",cell:z},{key:"st",header:"Status",cell:W},{key:"d",header:"Duration",align:"right",cell:U},{key:"ex",header:"Exception",cell:q}],e[21]=x):x=e[21];let f;e[22]!==t.executions||e[23]!==p?(f=s.jsx(y,{rows:t.executions,rowKey:G,onRowClick:p,columns:x}),e[22]=t.executions,e[23]=p,e[24]=f):f=e[24];let h;return e[25]!==n||e[26]!==c||e[27]!==m||e[28]!==d||e[29]!==f?(h=s.jsxs(b,{title:n,crumbs:c,children:[m,d,f]}),e[25]=n,e[26]=c,e[27]=m,e[28]=d,e[29]=f,e[30]=h):h=e[30],h}function q(t){return s.jsx("span",{className:"text-destructive line-clamp-1 text-xs",children:t.exception_preview??""})}function U(t){return B(t.duration)}function W(t){return s.jsx(R,{status:t.status,outcome:t.outcome})}function z(t){return s.jsx("span",{className:"font-mono text-xs",children:t.name})}function A(t){return t.kind}function F(t){return s.jsx("span",{className:"text-xs",children:T(t.occurred_at)})}function G(t){return t.execution_id}function J(t){return t.count}function M(t){return s.jsx(I,{status:t.status})}function O(t){return s.jsx("span",{className:"line-clamp-1 text-xs",children:t.title})}function Q(t){return s.jsx(N,{className:"font-mono text-xs hover:underline",href:S(t.id),children:t.key})}function V(t){return t.id}export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as se,u as ne,af as re,j as s,L as oe,t as ie}from"./inertia-
|
|
1
|
+
import{c as se,u as ne,af as re,j as s,L as oe,t as ie}from"./inertia-Cuyz2ZHO.js";import{V as ae,D as le}from"./chart-panel-CC49WTQL.js";import{D as Z}from"./data-table-CzKTEE-O.js";import{E as ee}from"./empty-state-CW4wclK_.js";import{P as ce,E as me}from"./env-layout-Kz7wks1x.js";import{S as T,a as ue}from"./stat-ZtxGU8lE.js";import{S as de}from"./status-badge-CH5P-Xkj.js";import{C as pe,a as fe,b as xe,c as he}from"./card-DPjFKfen.js";import{c as Y,m as P,w as je}from"./format-B9SDkrWj.js";import{B as te}from"./braces-rSYydpLY.js";import"./series-chart-gnrzhmM6.js";import"./chart-hover-CfoZUY4J.js";import"./chart-DWh7l8yM.js";import"./badge-DRae8XwK.js";import"./app-wordmark-BA_60AVb.js";import"./app-layout-Zc0v-hYh.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./checkbox-DPkLUiwM.js";import"./label-DdCBgiUn.js";import"./use-live-DMTuhKfB.js";import"./segmented-BeIe4uqk.js";import"./arrow-up-CLQ-7heQ.js";function ge(t){const e=se.c(5),{attributes:i}=t;let a;e[0]!==i?(a=Object.entries(i),e[0]=i,e[1]=a):a=e[1];const r=a;if(r.length===0){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"}),e[2]=n):n=e[2],n}let o;return e[3]!==r?(o=s.jsx("span",{className:"flex flex-wrap gap-1",children:r.map(ye)}),e[3]=r,e[4]=o):o=e[4],o}function ye(t){const[e,i]=t;return s.jsxs("span",{className:"bg-muted rounded-sm px-1.5 font-mono text-[10px]",children:[e,"=",String(i)]},e)}function et(t){const e=se.c(73),{environment:i,window:a}=ne().props,r=i.application_id,o=i.id,n=t.summary.current,V=t.name??"Span";let l;e[0]!==r||e[1]!==o||e[2]!==a?(l=re(r,o,{window:a}),e[0]=r,e[1]=o,e[2]=a,e[3]=l):l=e[3];let c;e[4]!==l?(c={title:"Spans",href:l},e[4]=l,e[5]=c):c=e[5];const W=t.name??"Span";let m;e[6]!==W?(m={title:W,href:"#"},e[6]=W,e[7]=m):m=e[7];let u;e[8]!==c||e[9]!==m?(u=[c,m],e[8]=c,e[9]=m,e[10]=u):u=e[10];const q=t.name??"Span";let d;e[11]!==q?(d=s.jsx(ce,{title:s.jsx("span",{className:"font-mono",children:q}),description:"Every recording of this span in the window."}),e[11]=q,e[12]=d):d=e[12];let p;e[13]!==n.count?(p=Y(n.count),e[13]=n.count,e[14]=p):p=e[14];let f;e[15]!==n.count||e[16]!==t.summary.previous.count?(f={current:n.count,previous:t.summary.previous.count,goodDirection:"up"},e[15]=n.count,e[16]=t.summary.previous.count,e[17]=f):f=e[17];let x;e[18]!==p||e[19]!==f?(x=s.jsx(T,{label:"Recorded",value:p,delta:f,deltaCaption:"vs previous period"}),e[18]=p,e[19]=f,e[20]=x):x=e[20];let h;e[21]!==n.errors?(h=Y(n.errors),e[21]=n.errors,e[22]=h):h=e[22];const F=n.errors?"destructive":void 0;let j;e[23]!==h||e[24]!==F?(j=s.jsx(T,{label:"Failed",value:h,tone:F}),e[23]=h,e[24]=F,e[25]=j):j=e[25];const I=n.p95/1e3;let g;e[26]!==I?(g=P(I,2),e[26]=I,e[27]=g):g=e[27];const z=n.p99/1e3;let C;e[28]!==z?(C=P(z,2),e[28]=z,e[29]=C):C=e[29];const G=`p99 ${C}`;let y;e[30]!==g||e[31]!==G?(y=s.jsx(T,{label:"p95",value:g,hint:G}),e[30]=g,e[31]=G,e[32]=y):y=e[32];const J=n.max/1e3;let b;e[33]!==J?(b=P(J,2),e[33]=J,e[34]=b):b=e[34];const Q=n.avg/1e3;let D;e[35]!==Q?(D=P(Q,2),e[35]=Q,e[36]=D):D=e[36];const U=`avg ${D}`;let v;e[37]!==b||e[38]!==U?(v=s.jsx(T,{label:"Max",value:b,hint:U}),e[37]=b,e[38]=U,e[39]=v):v=e[39];let _;e[40]!==x||e[41]!==j||e[42]!==y||e[43]!==v?(_=s.jsxs(ue,{children:[x,j,y,v]}),e[40]=x,e[41]=j,e[42]=y,e[43]=v,e[44]=_):_=e[44];let S;e[45]!==t.series?(S=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(ae,{legend:"outcome",label:"Recordings",seriesLabel:"Spans",data:t.series}),s.jsx(le,{label:"Duration",data:t.series})]}),e[45]=t.series,e[46]=S):S=e[46];let R;e[47]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(xe,{children:s.jsx(he,{children:"Attributes"})}),e[47]=R):R=e[47];let L,M;e[48]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(ee,{icon:te,title:"No attributes recorded",description:"Pass a hash to Railwatch.span to tag each recording."}),M=[{key:"k",header:"Key",cell:Pe},{key:"v",header:"Most common values",cell:ke},{key:"n",header:"Spans",align:"right",cell:Ne}],e[48]=L,e[49]=M):(L=e[48],M=e[49]);let w;e[50]!==t.facets?(w=s.jsxs(pe,{children:[R,s.jsx(fe,{children:s.jsx(Z,{rows:t.facets,rowKey:Ce,empty:L,columns:M})})]}),e[50]=t.facets,e[51]=w):w=e[51];let $,A,B;e[52]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(ee,{icon:te,title:"No recordings in this window",description:"Widen the time window to see older recordings of this span."}),A={key:"when",header:"When",cell:Se},B={key:"status",header:"Status",cell:_e},e[52]=$,e[53]=A,e[54]=B):($=e[52],A=e[53],B=e[54]);let N;e[55]!==r||e[56]!==o?(N={key:"in",hideOnMobile:!0,header:"In",cell:X=>X.execution_id?s.jsx(oe,{className:"font-mono text-xs hover:underline",href:ie(r,o,X.execution_id),children:X.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},e[55]=r,e[56]=o,e[57]=N):N=e[57];let K,O;e[58]===Symbol.for("react.memo_cache_sentinel")?(K={key:"attrs",hideOnMobile:!0,header:"Attributes",cell:ve},O={key:"d",header:"Duration",align:"right",cell:be},e[58]=K,e[59]=O):(K=e[58],O=e[59]);let k;e[60]!==N?(k=[A,B,N,K,O],e[60]=N,e[61]=k):k=e[61];let E;e[62]!==t.samples||e[63]!==k?(E=s.jsx(Z,{rows:t.samples,rowKey:we,empty:$,columns:k}),e[62]=t.samples,e[63]=k,e[64]=E):E=e[64];let H;return e[65]!==V||e[66]!==_||e[67]!==S||e[68]!==w||e[69]!==E||e[70]!==u||e[71]!==d?(H=s.jsxs(me,{title:V,crumbs:u,children:[d,_,S,w,E]}),e[65]=V,e[66]=_,e[67]=S,e[68]=w,e[69]=E,e[70]=u,e[71]=d,e[72]=H):H=e[72],H}function be(t){return P(t.duration,2)}function ve(t){return s.jsx(ge,{attributes:t.attributes})}function _e(t){return s.jsx(de,{outcome:t.status})}function Se(t){return s.jsx("span",{className:"text-xs",children:je(t.occurred_at)})}function we(t){return t.id}function Ne(t){return Y(t.count)}function ke(t){return s.jsx("span",{className:"flex flex-wrap gap-1",children:t.values.map(Ee)})}function Ee(t){const[e,i]=t;return s.jsxs("span",{className:"bg-muted rounded-sm px-1.5 font-mono text-[10px]",children:[e,s.jsxs("span",{className:"text-muted-foreground",children:[" ×",i]})]},e)}function Pe(t){return s.jsx("span",{className:"font-mono text-xs",children:t.key})}function Ce(t){return t.key}export{et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,u as P,j as i,C as N,L as C}from"./inertia-
|
|
1
|
+
import{c as $,u as P,j as i,C as N,L as C}from"./inertia-Cuyz2ZHO.js";import{C as I}from"./copy-id-vBYHQwxg.js";import{E as R}from"./empty-state-CW4wclK_.js";import{P as q,E as K}from"./env-layout-Kz7wks1x.js";import{a as B,S as w}from"./stat-ZtxGU8lE.js";import{K as H}from"./status-badge-CH5P-Xkj.js";import{e as W}from"./execution-path-FAuIzOXB.js";import{c as E,m as L,s as T}from"./format-B9SDkrWj.js";import"./app-wordmark-BA_60AVb.js";import"./use-clipboard-DNefo-ky.js";import"./index-BfbSo01U.js";import"./badge-DRae8XwK.js";import"./app-layout-Zc0v-hYh.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./checkbox-DPkLUiwM.js";import"./label-DdCBgiUn.js";import"./use-live-DMTuhKfB.js";import"./segmented-BeIe4uqk.js";import"./arrow-up-CLQ-7heQ.js";const A={request:"REQ",job_attempt:"JOB",scheduled_task:"TASK",command:"CMD",outgoing_request:"HTTP"};function M(t,e,s,h=0){return t.flatMap(p=>{const r=p.execution;return[{key:r.execution_id,depth:h,kind:r.kind,label:r.name,server:r.server,offset:r.offset,duration:r.duration,href:W({applicationId:e,environmentId:s,source:r.kind,executionId:r.execution_id}),failed:T(r.status,r.outcome)==="destructive"},...r.outgoing.map(a=>({key:`o-${a.id}`,depth:h+1,kind:"outgoing_request",label:`${a.method??""} ${a.url}`.trim(),server:null,offset:a.offset,duration:a.duration??0,href:null,failed:T(a.status_code)==="destructive"})),...M(p.children,e,s,h+1)]})}function D(t){const e=$.c(33),{row:s,scale:h}=t,p=`${s.depth*.75}rem`;let r;e[0]!==p?(r={paddingLeft:p},e[0]=p,e[1]=r):r=e[1];const a=s.failed?"destructive":"muted",g=A[s.kind]??s.kind;let l;e[2]!==a||e[3]!==g?(l=i.jsx(H,{tone:a,children:g}),e[2]=a,e[3]=g,e[4]=l):l=e[4];let o;e[5]!==s.label?(o=i.jsx("span",{className:"truncate font-mono",children:s.label}),e[5]=s.label,e[6]=o):o=e[6];let n;e[7]!==s.server?(n=s.server&&i.jsx("span",{className:"text-muted-foreground hidden shrink-0 font-mono text-[10px] sm:inline",children:s.server}),e[7]=s.server,e[8]=n):n=e[8];let c;e[9]!==r||e[10]!==l||e[11]!==o||e[12]!==n?(c=i.jsxs("span",{className:"col-start-1 row-start-1 flex min-w-0 items-center gap-1.5",style:r,children:[l,o,n]}),e[9]=r,e[10]=l,e[11]=o,e[12]=n,e[13]=c):c=e[13];let d;e[14]!==s.duration?(d=L(s.duration),e[14]=s.duration,e[15]=d):d=e[15];let f;e[16]!==d?(f=i.jsx("span",{className:"col-start-2 row-start-1 text-right font-mono tabular-nums md:col-start-3",children:d}),e[16]=d,e[17]=f):f=e[17];const j=s.failed?"bg-danger":s.href?"bg-primary":"bg-ok";let b;e[18]!==j?(b=N("block h-full rounded",j),e[18]=j,e[19]=b):b=e[19];const y=`${Math.min(99,s.offset/h*100)}%`,k=`${Math.max(.5,s.duration/h*100)}%`;let m;e[20]!==y||e[21]!==k?(m={marginLeft:y,width:k},e[20]=y,e[21]=k,e[22]=m):m=e[22];let u;e[23]!==b||e[24]!==m?(u=i.jsx("span",{className:"bg-muted/30 col-span-2 col-start-1 row-start-2 h-2 rounded md:col-span-1 md:col-start-2 md:row-start-1 md:h-3",children:i.jsx("span",{className:b,style:m})}),e[23]=b,e[24]=m,e[25]=u):u=e[25];let v;e[26]!==f||e[27]!==u||e[28]!==c?(v=i.jsxs(i.Fragment,{children:[c,f,u]}),e[26]=f,e[27]=u,e[28]=c,e[29]=v):v=e[29];const x=v;let _;return e[30]!==x||e[31]!==s.href?(_=s.href?i.jsx(C,{href:s.href,className:N("grid grid-cols-[1fr_4rem] items-center gap-x-2 gap-y-1 border-b px-2 py-1.5 text-xs last:border-b-0 md:grid-cols-[minmax(0,18rem)_1fr_4rem]","hover:bg-muted/40"),children:x}):i.jsx("div",{className:N("grid grid-cols-[1fr_4rem] items-center gap-x-2 gap-y-1 border-b px-2 py-1.5 text-xs last:border-b-0 md:grid-cols-[minmax(0,18rem)_1fr_4rem]","text-muted-foreground"),children:x}),e[30]=x,e[31]=s.href,e[32]=_):_=e[32],_}function me(t){const e=$.c(38),{environment:s}=P().props,h=s.application_id,p=s.id;let r,a,g,l,o,n,c;if(e[0]!==h||e[1]!==p||e[2]!==t.duration||e[3]!==t.roots||e[4]!==t.services||e[5]!==t.span_count||e[6]!==t.trace_id){const j=M(t.roots,h,p),b=j.filter(J),y=b.filter(F).length,k=Math.max(t.duration,1);r=K,l="Trace",e[14]===Symbol.for("react.memo_cache_sentinel")?(o=[{title:"Trace",href:"#"}],e[14]=o):o=e[14],e[15]!==t.trace_id?(n=i.jsx(q,{withWindow:!1,title:i.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[i.jsx("span",{className:"truncate font-mono text-base md:text-xl",children:t.trace_id}),i.jsx(I,{value:t.trace_id,label:""})]}),description:"Every execution that shares this trace id, nested by the call that started it."}),e[15]=t.trace_id,e[16]=n):n=e[16];let m;e[17]!==t.services.length?(m=E(t.services.length),e[17]=t.services.length,e[18]=m):m=e[18];let u;e[19]!==t.services?(u=t.services.join(" · "),e[19]=t.services,e[20]=u):u=e[20];let v;e[21]!==m||e[22]!==u?(v=i.jsx(w,{label:"Services",value:m,hint:u}),e[21]=m,e[22]=u,e[23]=v):v=e[23];let x;e[24]!==t.duration?(x=L(t.duration),e[24]=t.duration,e[25]=x):x=e[25];let _;e[26]!==x?(_=i.jsx(w,{label:"Total duration",value:x}),e[26]=x,e[27]=_):_=e[27],c=i.jsxs(B,{children:[i.jsx(w,{label:"Executions",value:E(b.length),hint:`${t.span_count} spans`}),v,_,i.jsx(w,{label:"Errors",value:E(y),tone:y?"destructive":void 0})]}),a="bg-card -mx-3 overflow-hidden border-y md:mx-0 md:rounded-lg md:border",g=j.length===0?i.jsx(R,{title:"Nothing in this trace",description:"No execution reported this trace id."}):j.map(S=>i.jsx(D,{row:S,scale:k},S.key)),e[0]=h,e[1]=p,e[2]=t.duration,e[3]=t.roots,e[4]=t.services,e[5]=t.span_count,e[6]=t.trace_id,e[7]=r,e[8]=a,e[9]=g,e[10]=l,e[11]=o,e[12]=n,e[13]=c}else r=e[7],a=e[8],g=e[9],l=e[10],o=e[11],n=e[12],c=e[13];let d;e[28]!==a||e[29]!==g?(d=i.jsx("div",{className:a,children:g}),e[28]=a,e[29]=g,e[30]=d):d=e[30];let f;return e[31]!==r||e[32]!==l||e[33]!==o||e[34]!==n||e[35]!==c||e[36]!==d?(f=i.jsxs(r,{title:l,crumbs:o,children:[n,c,d]}),e[31]=r,e[32]=l,e[33]=o,e[34]=n,e[35]=c,e[36]=d,e[37]=f):f=e[37],f}function F(t){return t.failed}function J(t){return t.href!==null}export{me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Ge,u as Le,z as ze,j as s,L as Oe,i as Pe}from"./inertia-
|
|
1
|
+
import{c as Ge,u as Le,z as ze,j as s,L as Oe,i as Pe}from"./inertia-Cuyz2ZHO.js";import{D as ke}from"./data-table-CzKTEE-O.js";import{E as Se}from"./empty-state-CW4wclK_.js";import{P as Be,E as Ke}from"./env-layout-Kz7wks1x.js";import{R as Ue}from"./relative-time-D5UbF4oO.js";import{S as ae,a as Ae}from"./stat-ZtxGU8lE.js";import{I as We}from"./status-badge-CH5P-Xkj.js";import{B as Je}from"./app-wordmark-BA_60AVb.js";import{C as Ee,a as He,b as Me,c as Ie}from"./card-DPjFKfen.js";import{w as Qe,m as Te,p as ce,c as De}from"./format-B9SDkrWj.js";import{c as Ve,a as Xe}from"./source-link-B2183i2-.js";import{ReleaseHealthStrip as Ye}from"./release-health-uP-GF3_V.js";import{G as Ze,O as Fe}from"./app-layout-Zc0v-hYh.js";import"./chart-hover-CfoZUY4J.js";import"./badge-DRae8XwK.js";import"./use-live-DMTuhKfB.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./segmented-BeIe4uqk.js";import"./label-DdCBgiUn.js";import"./arrow-up-CLQ-7heQ.js";import"./checkbox-DPkLUiwM.js";function fe(t,e){if(!t)return null;const l=(e-t)/t*100;return s.jsxs("span",{className:l>10?"text-destructive":l<-10?"text-emerald-600":"text-muted-foreground",children:[l>0?"+":"",l.toFixed(0),"%"]})}function Tt(t){const e=Ge.c(132),{environment:l}=Le().props,me=l.application_id,de=l.id,r=t.compare.request,o=t.compare.job_attempt,i=l.repository_url;let z;e[0]!==t.deploy.previous_ref||e[1]!==t.deploy.repository_ref||e[2]!==i?(z=Ve(i,t.deploy.previous_ref,t.deploy.repository_ref),e[0]=t.deploy.previous_ref,e[1]=t.deploy.repository_ref,e[2]=i,e[3]=z):z=e[3];const B=z,ue=i?.includes("gitlab")?"GitLab":"GitHub",qe=t.deploy.ref;let n;e[4]!==me||e[5]!==de?(n=ze(me,de),e[4]=me,e[5]=de,e[6]=n):n=e[6];let a;e[7]!==n?(a={title:"Deploys",href:n},e[7]=n,e[8]=a):a=e[8];let c;e[9]!==t.deploy.ref?(c={title:t.deploy.ref,href:"#"},e[9]=t.deploy.ref,e[10]=c):c=e[10];let f;e[11]!==a||e[12]!==c?(f=[a,c],e[11]=a,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==t.deploy.deploy?(m=s.jsx("span",{className:"font-mono",children:t.deploy.deploy}),e[14]=t.deploy.deploy,e[15]=m):m=e[15];let K;e[16]!==t.deploy.deployed_at?(K=Qe(t.deploy.deployed_at),e[16]=t.deploy.deployed_at,e[17]=K):K=e[17];const he=`${K}${t.deploy.name?` · ${t.deploy.name}`:""}${t.deploy.url?" · ":""}`;let d;e[18]!==t.deploy.url?(d=t.deploy.url&&s.jsx("a",{className:"text-sm underline",href:t.deploy.url,target:"_blank",rel:"noreferrer",children:"Open"}),e[18]=t.deploy.url,e[19]=d):d=e[19];let u;e[20]!==m||e[21]!==he||e[22]!==d?(u=s.jsx(Be,{withWindow:!1,title:m,description:he,actions:d}),e[20]=m,e[21]=he,e[22]=d,e[23]=u):u=e[23];let h;e[24]!==t.deploy.previous_ref?(h=t.deploy.previous_ref&&s.jsxs("span",{className:"text-muted-foreground ml-2 font-mono text-xs font-normal",children:["since ",t.deploy.previous_ref.slice(0,7)]}),e[24]=t.deploy.previous_ref,e[25]=h):h=e[25];let p;e[26]!==h?(p=s.jsxs("h2",{className:"text-sm font-semibold",children:["Changes",h]}),e[26]=h,e[27]=p):p=e[27];let x;e[28]!==ue||e[29]!==B?(x=B&&s.jsx(Je,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs("a",{href:B,target:"_blank",rel:"noreferrer",children:["Compare on ",ue]})}),e[28]=ue,e[29]=B,e[30]=x):x=e[30];let y;e[31]!==p||e[32]!==x?(y=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p,x]}),e[31]=p,e[32]=x,e[33]=y):y=e[33];let U;e[34]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Se,{icon:Ze,title:"No commits recorded",description:"The post-deploy hook sends the commits in each deploy. Reinstall it with bin/rails generate railwatch:install."}),e[34]=U):U=e[34];let b;e[35]!==i?(b={key:"sha",header:"Commit",cell:Ce=>{const Re=Xe(i,Ce.sha),$e=Ce.sha.slice(0,7);return Re?s.jsx("a",{className:"font-mono text-xs hover:underline",href:Re,target:"_blank",rel:"noreferrer",children:$e}):s.jsx("span",{className:"font-mono text-xs",children:$e})}},e[35]=i,e[36]=b):b=e[36];let A,W,J;e[37]===Symbol.for("react.memo_cache_sentinel")?(A={key:"m",header:"Message",cell:ct},W={key:"a",hideOnMobile:!0,header:"Author",cell:at},J={key:"at",hideOnMobile:!0,header:"When",align:"right",cell:nt},e[37]=A,e[38]=W,e[39]=J):(A=e[37],W=e[38],J=e[39]);let j;e[40]!==b?(j=[b,A,W,J],e[40]=b,e[41]=j):j=e[41];let _;e[42]!==t.deploy.commits||e[43]!==j?(_=s.jsx(ke,{rows:t.deploy.commits,rowKey:ft,empty:U,columns:j}),e[42]=t.deploy.commits,e[43]=j,e[44]=_):_=e[44];let Q;e[45]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx("h2",{className:"text-sm font-semibold",children:"Release health"}),e[45]=Q):Q=e[45];let v;e[46]!==t.health?(v=s.jsx(Ye,{health:t.health}),e[46]=t.health,e[47]=v):v=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("h2",{className:"text-sm font-semibold",children:"Hour before vs hour after"}),e[48]=V):V=e[48];const pe=r.after.p95/1e3;let w;e[49]!==pe?(w=Te(pe),e[49]=pe,e[50]=w):w=e[50];let g;e[51]!==r.after.p95||e[52]!==r.before.p95?(g=fe(r.before.p95,r.after.p95),e[51]=r.after.p95,e[52]=r.before.p95,e[53]=g):g=e[53];let N;e[54]!==w||e[55]!==g?(N=s.jsxs(s.Fragment,{children:[w," ",g]}),e[54]=w,e[55]=g,e[56]=N):N=e[56];const xe=r.before.p95/1e3;let X;e[57]!==xe?(X=Te(xe),e[57]=xe,e[58]=X):X=e[58];const ye=`was ${X}`;let k;e[59]!==N||e[60]!==ye?(k=s.jsx(ae,{label:"Request p95",value:N,hint:ye}),e[59]=N,e[60]=ye,e[61]=k):k=e[61];let S;e[62]!==r.after.count||e[63]!==r.after.errors?(S=ce(r.after.errors,r.after.count),e[62]=r.after.count,e[63]=r.after.errors,e[64]=S):S=e[64];const be=r.before.errors/Math.max(1,r.before.count),je=r.after.errors/Math.max(1,r.after.count);let C;e[65]!==be||e[66]!==je?(C=fe(be,je),e[65]=be,e[66]=je,e[67]=C):C=e[67];let R;e[68]!==S||e[69]!==C?(R=s.jsxs(s.Fragment,{children:[S," ",C]}),e[68]=S,e[69]=C,e[70]=R):R=e[70];let Y;e[71]!==r.before.count||e[72]!==r.before.errors?(Y=ce(r.before.errors,r.before.count),e[71]=r.before.count,e[72]=r.before.errors,e[73]=Y):Y=e[73];const _e=`was ${Y}`;let $;e[74]!==R||e[75]!==_e?($=s.jsx(ae,{label:"Request error rate",value:R,hint:_e}),e[74]=R,e[75]=_e,e[76]=$):$=e[76];let E;e[77]!==r.after.count?(E=De(r.after.count),e[77]=r.after.count,e[78]=E):E=e[78];let H;e[79]!==r.after.count||e[80]!==r.before.count?(H=fe(r.before.count,r.after.count),e[79]=r.after.count,e[80]=r.before.count,e[81]=H):H=e[81];let M;e[82]!==E||e[83]!==H?(M=s.jsxs(s.Fragment,{children:[E," ",H]}),e[82]=E,e[83]=H,e[84]=M):M=e[84];let Z;e[85]!==r.before.count?(Z=De(r.before.count),e[85]=r.before.count,e[86]=Z):Z=e[86];const ve=`was ${Z}`;let I;e[87]!==M||e[88]!==ve?(I=s.jsx(ae,{label:"Requests",value:M,hint:ve}),e[87]=M,e[88]=ve,e[89]=I):I=e[89];let T;e[90]!==o.after.count||e[91]!==o.after.errors?(T=ce(o.after.errors,o.after.count),e[90]=o.after.count,e[91]=o.after.errors,e[92]=T):T=e[92];const we=o.before.errors/Math.max(1,o.before.count),ge=o.after.errors/Math.max(1,o.after.count);let D;e[93]!==we||e[94]!==ge?(D=fe(we,ge),e[93]=we,e[94]=ge,e[95]=D):D=e[95];let F;e[96]!==T||e[97]!==D?(F=s.jsxs(s.Fragment,{children:[T," ",D]}),e[96]=T,e[97]=D,e[98]=F):F=e[98];let ee;e[99]!==o.before.count||e[100]!==o.before.errors?(ee=ce(o.before.errors,o.before.count),e[99]=o.before.count,e[100]=o.before.errors,e[101]=ee):ee=e[101];const Ne=`was ${ee}`;let O;e[102]!==F||e[103]!==Ne?(O=s.jsx(ae,{label:"Job failures",value:F,hint:Ne}),e[102]=F,e[103]=Ne,e[104]=O):O=e[104];let P;e[105]!==k||e[106]!==$||e[107]!==I||e[108]!==O?(P=s.jsxs(Ae,{children:[k,$,I,O]}),e[105]=k,e[106]=$,e[107]=I,e[108]=O,e[109]=P):P=e[109];let te;e[110]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Me,{children:s.jsx(Ie,{children:"New issues after this deploy"})}),e[110]=te):te=e[110];let se,re;e[111]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(Se,{icon:Fe,title:"No new issues in the 24 hours after",description:"Issues first seen after this deploy would show here."}),re=[{key:"k",header:"Issue",cell:lt},{key:"t",header:"Title",cell:ot},{key:"s",header:"",cell:rt}],e[111]=se,e[112]=re):(se=e[111],re=e[112]);let q;e[113]!==t.new_issues?(q=s.jsxs(Ee,{children:[te,s.jsx(He,{children:s.jsx(ke,{rows:t.new_issues,rowKey:it,empty:se,columns:re})})]}),e[113]=t.new_issues,e[114]=q):q=e[114];let oe;e[115]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Me,{children:s.jsx(Ie,{children:"Resolved in this deploy"})}),e[115]=oe):oe=e[115];let le,ie;e[116]===Symbol.for("react.memo_cache_sentinel")?(le=s.jsx(Se,{icon:Fe,title:"No issues marked resolved in this deploy",description:"Issues resolved and tagged with this deploy's ref would show here."}),ie=[{key:"k",header:"Issue",cell:tt},{key:"t",header:"Title",cell:et}],e[116]=le,e[117]=ie):(le=e[116],ie=e[117]);let G;e[118]!==t.resolved_issues?(G=s.jsxs(Ee,{children:[oe,s.jsx(He,{children:s.jsx(ke,{rows:t.resolved_issues,rowKey:st,empty:le,columns:ie})})]}),e[118]=t.resolved_issues,e[119]=G):G=e[119];let L;e[120]!==q||e[121]!==G?(L=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[q,G]}),e[120]=q,e[121]=G,e[122]=L):L=e[122];let ne;return e[123]!==t.deploy.ref||e[124]!==u||e[125]!==y||e[126]!==_||e[127]!==v||e[128]!==f||e[129]!==P||e[130]!==L?(ne=s.jsxs(Ke,{title:qe,crumbs:f,children:[u,y,_,Q,v,V,P,L]}),e[123]=t.deploy.ref,e[124]=u,e[125]=y,e[126]=_,e[127]=v,e[128]=f,e[129]=P,e[130]=L,e[131]=ne):ne=e[131],ne}function et(t){return s.jsx("span",{className:"line-clamp-1 text-xs",children:t.title})}function tt(t){return s.jsx(Oe,{className:"font-mono text-xs hover:underline",href:Pe(t.id),children:t.key})}function st(t){return t.id}function rt(t){return s.jsx(We,{status:t.status})}function ot(t){return s.jsx("span",{className:"line-clamp-1 text-xs",children:t.title})}function lt(t){return s.jsx(Oe,{className:"font-mono text-xs hover:underline",href:Pe(t.id),children:t.key})}function it(t){return t.id}function nt(t){return s.jsx(Ue,{className:"text-xs",iso:t.at})}function at(t){return s.jsx("span",{className:"text-xs",children:t.author})}function ct(t){return s.jsx("span",{className:"line-clamp-1 text-xs",children:t.message})}function ft(t){return t.sha}export{Tt as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as ge,u as je,ae as _e,j as s,L as me,t as de,C as ue}from"./inertia-
|
|
1
|
+
import{c as ge,u as je,ae as _e,j as s,L as me,t as de,C as ue}from"./inertia-Cuyz2ZHO.js";import{V as be,D as ye}from"./chart-panel-CC49WTQL.js";import{M as xe}from"./code-CLmYS6FU.js";import{C as we}from"./copy-id-vBYHQwxg.js";import{D as ne}from"./data-table-CzKTEE-O.js";import{E as ve}from"./empty-state-CW4wclK_.js";import{P as Ee,E as Se}from"./env-layout-Kz7wks1x.js";import{S as X,a as Ne}from"./stat-ZtxGU8lE.js";import{C as ie,a as re,b as oe,c as ae}from"./card-DPjFKfen.js";import{c as fe,m as P,w as he}from"./format-B9SDkrWj.js";import{Q as Ce}from"./app-layout-Zc0v-hYh.js";import"./series-chart-gnrzhmM6.js";import"./chart-hover-CfoZUY4J.js";import"./chart-DWh7l8yM.js";import"./app-wordmark-BA_60AVb.js";import"./use-clipboard-DNefo-ky.js";import"./index-BfbSo01U.js";import"./badge-DRae8XwK.js";import"./use-live-DMTuhKfB.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./segmented-BeIe4uqk.js";import"./label-DdCBgiUn.js";import"./arrow-up-CLQ-7heQ.js";import"./checkbox-DPkLUiwM.js";const Le=[{test:/\bSCAN\b/i,skip:/\bUSING\s+(?:COVERING\s+)?INDEX\b/i,message:"Reads every row of the table — no index covers this filter."},{test:/\bSeq Scan\b/i,message:"Sequential scan — Postgres reads the whole table; an index on the filtered column avoids it."},{test:/\bUSING TEMP B-TREE\b/i,message:"Builds a temporary B-tree to sort — an index matching the ORDER BY removes it."},{test:/filesort/i,message:"Filesort — MySQL sorts the rows itself; an index matching the ORDER BY removes it."},{test:/\btype:\s*ALL\b/i,message:"Join type ALL — MySQL has no usable index and scans the whole table."}];function Re(t){return t.split(`
|
|
2
2
|
`).flatMap((e,o)=>Le.filter(i=>i.test.test(e)&&!i.skip?.test(e)).map(i=>({line:o+1,message:i.message})))}function ft(t){const e=ge.c(86),{environment:o,window:i}=je().props,l=o.application_id,n=o.id,r=t.summary,a=t.explain?.plan??"";let q;e[0]!==a?(q=Re(a),e[0]=a,e[1]=q):q=e[1];const Y=q;let c;e[2]!==l||e[3]!==n||e[4]!==i?(c=_e(l,n,{window:i}),e[2]=l,e[3]=n,e[4]=i,e[5]=c):c=e[5];let m;e[6]!==c?(m={title:"Queries",href:c},e[6]=c,e[7]=m):m=e[7];let I;e[8]===Symbol.for("react.memo_cache_sentinel")?(I={title:"Query",href:"#"},e[8]=I):I=e[8];let d;e[9]!==m?(d=[m,I],e[9]=m,e[10]=d):d=e[10];let u;e[11]!==t.sql?(u=t.sql?s.jsx(we,{value:t.sql,label:"Copy SQL"}):void 0,e[11]=t.sql,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx(Ee,{title:"Query",actions:u}),e[13]=u,e[14]=x):x=e[14];const J=t.sql??"No samples in this window.";let f;e[15]!==J?(f=s.jsx("pre",{className:"bg-muted/60 overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:J}),e[15]=J,e[16]=f):f=e[16];let h;e[17]!==t.roles?(h=t.roles.length>0&&s.jsx("div",{className:"text-muted-foreground font-mono text-[11px]",children:t.roles.map(Ue).join(" · ")}),e[17]=t.roles,e[18]=h):h=e[18];let p;e[19]!==r.count?(p=fe(r.count),e[19]=r.count,e[20]=p):p=e[20];let g;e[21]!==p?(g=s.jsx(X,{label:"Executions",value:p}),e[21]=p,e[22]=g):g=e[22];const z=r.avg/1e3;let j;e[23]!==z?(j=P(z,2),e[23]=z,e[24]=j):j=e[24];let _;e[25]!==j?(_=s.jsx(X,{label:"Avg",value:j}),e[25]=j,e[26]=_):_=e[26];const Z=r.p95/1e3;let b;e[27]!==Z?(b=P(Z,2),e[27]=Z,e[28]=b):b=e[28];const ee=r.p99/1e3;let M;e[29]!==ee?(M=P(ee,2),e[29]=ee,e[30]=M):M=e[30];const te=`p99 ${M}`;let y;e[31]!==b||e[32]!==te?(y=s.jsx(X,{label:"p95",value:b,hint:te}),e[31]=b,e[32]=te,e[33]=y):y=e[33];const se=r.max/1e3;let w;e[34]!==se?(w=P(se,2),e[34]=se,e[35]=w):w=e[35];let v;e[36]!==w?(v=s.jsx(X,{label:"Max",value:w}),e[36]=w,e[37]=v):v=e[37];let E;e[38]!==g||e[39]!==_||e[40]!==y||e[41]!==v?(E=s.jsxs(Ne,{children:[g,_,y,v]}),e[38]=g,e[39]=_,e[40]=y,e[41]=v,e[42]=E):E=e[42];let T;e[43]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(oe,{children:s.jsx(ae,{children:"Query plan"})}),e[43]=T):T=e[43];let S;e[44]!==l||e[45]!==n||e[46]!==t.explain||e[47]!==a||e[48]!==Y?(S=s.jsxs(ie,{children:[T,s.jsx(re,{children:t.explain?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-muted-foreground mb-2 font-mono text-[11px]",children:[he(t.explain.occurred_at)," · ",P(t.explain.duration,2),t.explain.execution_id&&s.jsxs(s.Fragment,{children:[" · ",s.jsx(me,{className:"hover:underline",href:de(l,n,t.explain.execution_id),children:t.explain.execution_id})]})]}),s.jsx("div",{className:"bg-muted/60 overflow-x-auto rounded-lg p-3 font-mono text-xs",children:a.split(`
|
|
3
3
|
`).map((Q,ce)=>{const le=Y.filter(pe=>pe.line===ce+1);return s.jsxs("div",{className:ue("py-0.5",le.length>0&&"border-warning border-l-2 pl-2"),children:[s.jsx("div",{className:ue("whitespace-pre",le.length>0&&"text-warning"),children:Q}),le.map(Oe)]},ce)})})]}):s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Enable plans for slow queries with"," ",s.jsx(xe,{children:"RAILWATCH_CAPTURE_QUERY_EXPLAIN=true"})," (threshold"," ",s.jsx(xe,{children:"RAILWATCH_EXPLAIN_THRESHOLD_MS"}),", default 100ms)"]})})]}),e[44]=l,e[45]=n,e[46]=t.explain,e[47]=a,e[48]=Y,e[49]=S):S=e[49];let N;e[50]!==t.series?(N=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(be,{legend:"outcome",label:"Executions",seriesLabel:"Executions",data:t.series}),s.jsx(ye,{label:"Duration",data:t.series})]}),e[50]=t.series,e[51]=N):N=e[51];let B;e[52]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(oe,{children:s.jsx(ae,{children:"Called from"})}),e[52]=B):B=e[52];let H,O;e[53]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(ve,{icon:Ce,title:"No source captured",description:"A backtrace location wasn't available for this query."}),O=[{key:"s",header:"Source",cell:Be},{key:"n",header:"Count",align:"right",cell:Te}],e[53]=H,e[54]=O):(H=e[53],O=e[54]);let C;e[55]!==t.sources?(C=s.jsxs(ie,{children:[B,s.jsx(re,{children:s.jsx(ne,{rows:t.sources,rowKey:He,empty:H,columns:O})})]}),e[55]=t.sources,e[56]=C):C=e[56];let U;e[57]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(oe,{children:s.jsx(ae,{children:"Executions"})}),e[57]=U):U=e[57];let W;e[58]===Symbol.for("react.memo_cache_sentinel")?(W=[{key:"c",header:"Execution",cell:Ie},{key:"n",header:"Count",align:"right",cell:qe}],e[58]=W):W=e[58];let L;e[59]!==t.callers?(L=s.jsxs(ie,{children:[U,s.jsx(re,{children:s.jsx(ne,{rows:t.callers,rowKey:Me,columns:W})})]}),e[59]=t.callers,e[60]=L):L=e[60];let R;e[61]!==C||e[62]!==L?(R=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[C,L]}),e[61]=C,e[62]=L,e[63]=R):R=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($={key:"when",header:"When",cell:Pe},e[64]=$):$=e[64];let k;e[65]!==l||e[66]!==n?(k={key:"in",header:"In",cell:Q=>Q.execution_id?s.jsx(me,{className:"font-mono text-xs hover:underline",href:de(l,n,Q.execution_id),children:Q.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},e[65]=l,e[66]=n,e[67]=k):k=e[67];let F,G,K;e[68]===Symbol.for("react.memo_cache_sentinel")?(F={key:"rows",hideOnMobile:!0,header:"Rows",align:"right",cell:De},G={key:"conn",hideOnMobile:!0,header:"DB",cell:Ae},K={key:"d",header:"Duration",align:"right",cell:ke},e[68]=F,e[69]=G,e[70]=K):(F=e[68],G=e[69],K=e[70]);let A;e[71]!==k?(A=[$,k,F,G,K],e[71]=k,e[72]=A):A=e[72];let D;e[73]!==t.samples||e[74]!==A?(D=s.jsx(ne,{rows:t.samples,rowKey:Qe,columns:A}),e[73]=t.samples,e[74]=A,e[75]=D):D=e[75];let V;return e[76]!==E||e[77]!==S||e[78]!==N||e[79]!==R||e[80]!==d||e[81]!==D||e[82]!==x||e[83]!==f||e[84]!==h?(V=s.jsxs(Se,{title:"Query",crumbs:d,children:[x,f,h,E,S,N,R,D]}),e[76]=E,e[77]=S,e[78]=N,e[79]=R,e[80]=d,e[81]=D,e[82]=x,e[83]=f,e[84]=h,e[85]=V):V=e[85],V}function ke(t){return P(t.duration,2)}function Ae(t){return t.connection}function De(t){return t.row_count??"–"}function Pe(t){return s.jsx("span",{className:"text-xs",children:he(t.occurred_at)})}function Qe(t){return t.id}function qe(t){const[,e]=t;return e}function Ie(t){const[e]=t;return s.jsx("span",{className:"font-mono text-xs",children:e})}function Me(t){const[e]=t;return e}function Te(t){const[,e]=t;return e}function Be(t){const[e]=t;return s.jsx("span",{className:"font-mono text-xs",children:e})}function He(t){const[e]=t;return e}function Oe(t){return s.jsx("div",{className:"text-warning/80 mt-0.5 text-[11px] whitespace-normal",children:t.message},t.message)}function Ue(t){const[e,o]=t;return`${e} ${fe(o)}`}export{ft as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as L,r as z,j as s,aW as B,F as $,u as V,H as J,a2 as H,aX as M,e as I,aY as W}from"./inertia-
|
|
1
|
+
import{c as L,r as z,j as s,aW as B,F as $,u as V,H as J,a2 as H,aX as M,e as I,aY as W}from"./inertia-Cuyz2ZHO.js";import{G as q}from"./google-sign-in-button-2_zgbgVy.js";import{H as E,S as U}from"./layout-Cueyl7c5.js";import{I as g}from"./input-error-hog6gGxg.js";import{B as S}from"./app-wordmark-BA_60AVb.js";import{v as K,D as Y,a as Z,s as X,w as Q,c as ee,b as se}from"./live-dot-BZgYTYdt.js";import{L as N,I as D}from"./label-DdCBgiUn.js";import{C as R}from"./copy-block-CGcXxp8J.js";import{A as te}from"./app-layout-Zc0v-hYh.js";import{K as re}from"./transition-ksDpqhKJ.js";import"./separator-D5I0UCB5.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./use-clipboard-DNefo-ky.js";import"./checkbox-DPkLUiwM.js";function ae(t){const e=L.c(22),{blockingAccounts:r,provider:a,recentlyAuthenticated:o,email:n}=t,w=z.useRef(null);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(E,{title:"Delete user",description:"Delete your login and personal settings. Shared account data stays with its remaining owners."}),e[0]=j):j=e[0];let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs("div",{className:"relative space-y-0.5 text-red-600 dark:text-red-100",children:[s.jsx("p",{className:"font-medium",children:"Warning"}),s.jsx("p",{className:"text-sm",children:"Please proceed with caution, this cannot be undone."})]}),e[1]=f):f=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{asChild:!0,children:s.jsx(S,{variant:"destructive",children:"Delete user"})}),e[2]=l):l=e[2];let y,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Y,{children:"Are you sure you want to delete your user?"}),c=s.jsx(Z,{children:"This deletes your login, sessions, and personal settings. It does not delete shared accounts or their telemetry. Transfer or delete every account you solely own first."}),e[3]=y,e[4]=c):(y=e[3],c=e[4]);let d;e[5]!==r?(d=r.length>0&&s.jsxs("div",{className:"border-destructive/30 bg-destructive/5 rounded-md border p-3 text-sm",children:["Transfer or delete these accounts first:"," ",r.map(oe).join(", "),"."]}),e[5]=r,e[6]=d):d=e[6];let i;e[7]!==a||e[8]!==o?(i=a&&!o&&s.jsx(q,{label:"Confirm with Google",reauthenticateFor:"user",separated:!1}),e[7]=a,e[8]=o,e[9]=i):i=e[9];let m,u,_;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=B(),_={preserveScroll:!0},m=()=>w.current?.focus(),e[10]=m,e[11]=u,e[12]=_):(m=e[10],u=e[11],_=e[12]);let p;e[13]!==r.length||e[14]!==n||e[15]!==a||e[16]!==o?(p=s.jsx($,{method:"delete",action:u,options:_,onError:m,resetOnSuccess:!0,className:"space-y-6",children:v=>{const{resetAndClearErrors:b,processing:k,errors:x}=v;return s.jsxs(s.Fragment,{children:[a?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"user-deletion-confirmation",children:"Enter your email to confirm"}),s.jsx(D,{id:"user-deletion-confirmation",name:"confirmation",placeholder:n,autoComplete:"off"}),s.jsx(g,{messages:x.password_challenge})]}):s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"password_challenge",className:"sr-only",children:"Password"}),s.jsx(D,{id:"password_challenge",type:"password",name:"password_challenge",ref:w,placeholder:"Password",autoComplete:"current-password"}),s.jsx(g,{messages:x.password_challenge})]}),s.jsx(g,{messages:x.account_ownership}),s.jsxs(X,{children:[s.jsx(Q,{asChild:!0,children:s.jsx(S,{variant:"secondary",onClick:()=>b(),children:"Cancel"})}),s.jsx(S,{variant:"destructive",disabled:k||r.length>0||!!a&&!o,asChild:!0,children:s.jsx("button",{type:"submit",children:"Delete user"})})]})]})}}),e[13]=r.length,e[14]=n,e[15]=a,e[16]=o,e[17]=p):p=e[17];let h;return e[18]!==p||e[19]!==d||e[20]!==i?(h=s.jsxs("div",{className:"space-y-6",children:[j,s.jsxs("div",{className:"space-y-4 rounded-lg border border-red-100 bg-red-50 p-4 dark:border-red-200/10 dark:bg-red-700/10",children:[f,s.jsxs(ee,{children:[l,s.jsxs(se,{children:[y,c,d,i,p]})]})]})]}),e[18]=p,e[19]=d,e[20]=i,e[21]=h):h=e[21],h}function oe(t){return t.name}const ne="rwp_your_token_here";function ie(t,e){const r=`Bearer ${e??ne}`;return[{id:"claude-code",label:"Claude Code",hint:"Run this in the project you want the assistant to work in.",code:`claude mcp add railwatch --transport http ${t} --header "Authorization: ${r}"`},{id:"claude-desktop",label:"Claude Desktop",hint:"claude_desktop_config.json — Claude Desktop speaks stdio, so mcp-remote bridges it to HTTP.",code:JSON.stringify({mcpServers:{railwatch:{command:"npx",args:["-y","mcp-remote",t,"--header",`Authorization: ${r}`]}}},null,2)},{id:"cursor",label:"Cursor",hint:".cursor/mcp.json in the project, or ~/.cursor/mcp.json for every project.",code:JSON.stringify({mcpServers:{railwatch:{url:t,headers:{Authorization:r}}}},null,2)},{id:"vscode",label:"VS Code",hint:".vscode/mcp.json in the workspace.",code:JSON.stringify({servers:{railwatch:{type:"http",url:t,headers:{Authorization:r}}}},null,2)},{id:"zed",label:"Zed",hint:"settings.json — also via the mcp-remote bridge.",code:JSON.stringify({context_servers:{railwatch:{source:"custom",command:"npx",args:["-y","mcp-remote",t,"--header",`Authorization: ${r}`]}}},null,2)},{id:"curl",label:"Test it with curl",hint:"Lists every tool the server exposes. If this returns JSON, the token works.",code:[`curl -sS ${t} \\`,` -H "Authorization: ${r}" \\`,' -H "Content-Type: application/json" \\',` -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'`].join(`
|
|
2
2
|
`)}]}function le(t){const e=L.c(5),{url:r,token:a}=t;let o;e[0]!==a||e[1]!==r?(o=ie(r,a).map(ce),e[0]=a,e[1]=r,e[2]=o):o=e[2];let n;return e[3]!==o?(n=s.jsx("div",{className:"space-y-4",children:o}),e[3]=o,e[4]=n):n=e[4],n}function ce(t){return s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium",children:t.label}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t.hint}),s.jsx(R,{code:t.code,className:"mt-1.5"})]},t.id)}const T=[{title:"Profile settings",href:H()}],de=[{value:"github",label:"GitHub"},{value:"gitlab",label:"GitLab"},{value:"vscode",label:"VS Code"},{value:"cursor",label:"Cursor"},{value:"zed",label:"Zed"},{value:"rubymine",label:"RubyMine"},{value:"textmate",label:"TextMate"}],me=["vscode","cursor","zed","rubymine","textmate"];function Fe(t){const e=L.c(43),{auth:r}=V().props,[a,o]=z.useState(r.user.editor);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(J,{title:T[T.length-1].title}),e[0]=n):n=e[0];let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(E,{title:"Profile information",description:"Update your name and where source links open"}),e[1]=w):w=e[1];let j,f;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=H(),f={preserveScroll:!0},e[2]=j,e[3]=f):(j=e[2],f=e[3]);let l;e[4]!==r.user.editor_root||e[5]!==r.user.name||e[6]!==a||e[7]!==t.weekly_digest?(l=s.jsxs("div",{className:"space-y-6",children:[w,s.jsx($,{method:"patch",action:j,options:f,className:"space-y-6",children:F=>{const{errors:P,processing:C,recentlySuccessful:G}=F;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"name",children:"Name"}),s.jsx(D,{id:"name",name:"name",className:"mt-1 block w-full",defaultValue:r.user.name,required:!0,autoComplete:"name",placeholder:"Full name"}),s.jsx(g,{className:"mt-2",messages:P.name})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"editor",children:"Editor"}),s.jsx("select",{id:"editor",name:"editor",value:a,onChange:O=>o(O.target.value),className:"border-input bg-background h-9 rounded-md border px-3 text-sm",children:de.map(xe)}),s.jsx(g,{className:"mt-2",messages:P.editor}),s.jsx("span",{className:"text-muted-foreground text-xs",children:"Where a file:line in a stack trace opens — the application's repository, or this machine's editor."})]}),me.includes(a)&&s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"editor_root",children:"Local checkout path"}),s.jsx(D,{id:"editor_root",name:"editor_root",className:"mt-1 block w-full",defaultValue:r.user.editor_root??"",placeholder:"/Users/you/code/widgets"}),s.jsx(g,{className:"mt-2",messages:P.editor_root})]}),s.jsxs("label",{className:"flex items-start gap-3 text-sm",children:[s.jsx("input",{type:"hidden",name:"weekly_digest",value:"0"}),s.jsx("input",{type:"checkbox",name:"weekly_digest",value:"1",defaultChecked:t.weekly_digest,className:"mt-0.5"}),s.jsxs("span",{children:[s.jsx("span",{className:"font-medium",children:"Weekly digest"}),s.jsx("span",{className:"text-muted-foreground block text-xs",children:"A Monday email with requests, p95, failures, new and resolved issues, and deploys for each account you belong to."})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(S,{disabled:C,children:"Save"}),s.jsx(re,{show:G,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:s.jsx("p",{className:"text-sm text-neutral-600",children:"Saved"})})]})]})}})]}),e[4]=r.user.editor_root,e[5]=r.user.name,e[6]=a,e[7]=t.weekly_digest,e[8]=l):l=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(E,{title:"API & MCP tokens",description:"Create independently revocable tokens with only the surfaces, actions, and applications each client needs."}),e[9]=y):y=e[9];let c;e[10]!==t.mcp_token?(c=t.mcp_token&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm",children:"Your new API & MCP token (shown once, copy it now):"}),s.jsx(R,{code:t.mcp_token})]}),e[10]=t.mcp_token,e[11]=c):c=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=M(),e[12]=d):d=e[12];let i;e[13]!==t.token_scopes||e[14]!==t.token_targets?(i=s.jsx($,{method:"post",action:d,className:"grid gap-4 rounded-md border p-4",children:F=>{const{processing:P,errors:C}=F;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"token-name",children:"Token name"}),s.jsx(D,{id:"token-name",name:"name",defaultValue:"API & MCP token",maxLength:100,required:!0}),s.jsx(g,{messages:C.name})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"token-restriction",children:"Data access"}),s.jsx("select",{id:"token-restriction",name:"restriction",className:"border-input bg-background h-9 rounded-md border px-3 text-sm",children:t.token_targets.map(pe)}),s.jsx(g,{messages:C.restriction})]}),s.jsxs("fieldset",{className:"grid gap-2",children:[s.jsx("legend",{className:"text-sm font-medium",children:"Scopes"}),s.jsx("input",{type:"hidden",name:"scopes_present",value:"1"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:t.token_scopes.map(he)}),s.jsx(g,{messages:C.scopes})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(N,{htmlFor:"token-expiry",children:"Expiry"}),s.jsxs("select",{id:"token-expiry",name:"expires_in_days",className:"border-input bg-background h-9 rounded-md border px-3 text-sm",defaultValue:"0",children:[s.jsx("option",{value:"0",children:"Never"}),s.jsx("option",{value:"7",children:"7 days"}),s.jsx("option",{value:"30",children:"30 days"}),s.jsx("option",{value:"90",children:"90 days"}),s.jsx("option",{value:"365",children:"1 year"})]}),s.jsx(g,{messages:C.expires_in_days})]}),s.jsx(S,{className:"w-fit",disabled:P,children:"Generate token"})]})}}),e[13]=t.token_scopes,e[14]=t.token_targets,e[15]=i):i=e[15];let m;e[16]!==t.api_tokens?(m=t.api_tokens.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No API tokens yet."}):t.api_tokens.map(ue),e[16]=t.api_tokens,e[17]=m):m=e[17];let u;e[18]!==m?(u=s.jsx("div",{className:"space-y-3",children:m}),e[18]=m,e[19]=u):u=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"text-sm font-medium",children:"Connect an assistant"}),e[20]=_):_=e[20];const p=t.mcp_token?"These blocks already contain the token above. Paste one into your client and restart it.":"Generate a token to get these blocks filled in — until then they carry a placeholder. The same output comes from bin/rails railwatch:mcp in your app.";let h;e[21]!==p?(h=s.jsxs("div",{children:[_,s.jsx("p",{className:"text-muted-foreground text-xs",children:p})]}),e[21]=p,e[22]=h):h=e[22];let v;e[23]!==t.mcp_token||e[24]!==t.mcp_url?(v=s.jsx(le,{url:t.mcp_url,token:t.mcp_token}),e[23]=t.mcp_token,e[24]=t.mcp_url,e[25]=v):v=e[25];let b;e[26]!==h||e[27]!==v?(b=s.jsxs("div",{className:"space-y-3 border-t pt-6",children:[h,v]}),e[26]=h,e[27]=v,e[28]=b):b=e[28];let k;e[29]!==u||e[30]!==b||e[31]!==c||e[32]!==i?(k=s.jsxs("div",{className:"space-y-6",children:[y,c,i,u,b]}),e[29]=u,e[30]=b,e[31]=c,e[32]=i,e[33]=k):k=e[33];let x;e[34]!==r.session.recently_authenticated||e[35]!==r.user.email||e[36]!==r.user.provider||e[37]!==t.deletion.blocking_accounts?(x=s.jsx(ae,{blockingAccounts:t.deletion.blocking_accounts,provider:r.user.provider,recentlyAuthenticated:r.session.recently_authenticated,email:r.user.email}),e[34]=r.session.recently_authenticated,e[35]=r.user.email,e[36]=r.user.provider,e[37]=t.deletion.blocking_accounts,e[38]=x):x=e[38];let A;return e[39]!==k||e[40]!==x||e[41]!==l?(A=s.jsxs(te,{breadcrumbs:T,children:[n,s.jsxs(U,{children:[l,k,x]})]}),e[39]=k,e[40]=x,e[41]=l,e[42]=A):A=e[42],A}function ue(t){return s.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"font-medium",children:t.name}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.scopes.join(", ")," · ",t.restriction]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.revoked_at?`Revoked ${new Date(t.revoked_at).toLocaleString()}`:t.expires_at?`Expires ${new Date(t.expires_at).toLocaleString()}`:"Never expires",t.last_used_at?` · Last used ${new Date(t.last_used_at).toLocaleString()}`:" · Never used"]})]}),!t.revoked_at&&s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(S,{type:"button",variant:"outline",size:"sm",onClick:()=>I.post(M(),{name:t.name,scopes_present:"1",scopes:t.scopes,replace_token_id:t.id}),children:"Regenerate"}),s.jsx(S,{type:"button",variant:"outline",size:"sm",onClick:()=>I.delete(W(),{data:{token_id:t.id}}),children:"Revoke"})]})]},t.id)}function he(t){return s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",name:"scopes[]",value:t,defaultChecked:!0}),t]},t)}function pe(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function xe(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,C as x,j as c}from"./inertia-
|
|
1
|
+
import{c as f,C as x,j as c}from"./inertia-Cuyz2ZHO.js";import{A as p,a as u}from"./arrow-up-CLQ-7heQ.js";function b(m){const e=f.c(10),{label:n,active:o,dir:i,onClick:a}=m,l=o&&"text-foreground font-semibold";let t;e[0]!==l?(t=x("hover:text-foreground inline-flex items-center gap-1",l),e[0]=l,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=o&&(i==="asc"?c.jsx(p,{className:"size-3"}):c.jsx(u,{className:"size-3"})),e[2]=o,e[3]=i,e[4]=s):s=e[4];let r;return e[5]!==n||e[6]!==a||e[7]!==t||e[8]!==s?(r=c.jsxs("button",{type:"button",onClick:a,className:t,children:[n,s]}),e[5]=n,e[6]=a,e[7]=t,e[8]=s,e[9]=r):r=e[9],r}export{b as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,j as i}from"./inertia-
|
|
1
|
+
import{c as a,j as i}from"./inertia-Cuyz2ZHO.js";import{S as n}from"./series-chart-gnrzhmM6.js";function m(o){const e=a.c(3),{data:r,hoverKey:s}=o;let t;return e[0]!==r||e[1]!==s?(t=i.jsx(n,{data:r,className:"h-[10px] w-8",hoverKey:s}),e[0]=r,e[1]=s,e[2]=t):t=e[2],t}export{m as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as w,j as R,C,c as k}from"./inertia-
|
|
1
|
+
import{r as w,j as R,C,c as k}from"./inertia-Cuyz2ZHO.js";import{a as M}from"./use-live-DMTuhKfB.js";import{A as D,a as I}from"./arrow-up-CLQ-7heQ.js";const O=300,T="cubic-bezier(.22, 1, .36, 1)",F=2e3,Y="inline-block h-[1.15em] overflow-hidden leading-[1.15em] align-top",$="inline-block h-[1.15em] overflow-visible leading-[1.15em] align-top text-center",U="block will-change-transform",E="block h-[1.15em] leading-[1.15em]",z="inline-block h-[1.15em] leading-[1.15em]";function N(o){const t=document.createElement("span");return t.className=o,t}function P(o){let t=o.length;for(;t>0&&!/[0-9]/.test(o[t-1]);)t--;return{digits:o.slice(0,t),suffix:o.slice(t)}}function V(o){const t=N(o?$:Y);if(o)return{separator:!0,el:t,char:null};const a=N(U),s=N(E),l=N(E);return a.append(s,l),t.append(a),{separator:!1,el:t,strip:a,top:s,bottom:l,animation:null,char:null}}function q(o,{durationMs:t,easing:a}){const s=new Map;let l="";function d(e,n){e.animation?.cancel(),e.animation=null,e.top.textContent=n,e.bottom.textContent="",e.char=n}function g(e,n,m){if(typeof e.strip.animate!="function"){d(e,n);return}e.animation?.cancel();const i=e.char??n;m>0?(e.top.textContent=i,e.bottom.textContent=n):(e.top.textContent=n,e.bottom.textContent=i);const u=m>0?[{transform:"translateY(0)"},{transform:"translateY(-50%)"}]:[{transform:"translateY(-50%)"},{transform:"translateY(0)"}],r=e.strip.animate(u,{duration:t,easing:a,fill:"forwards"});e.animation=r,e.char=n,r.onfinish=()=>{e.animation===r&&d(e,n)}}function h(e){typeof e.el.animate=="function"&&e.el.animate([{opacity:0,transform:"translateY(0.35em)"},{opacity:1,transform:"none"}],{duration:t,easing:a})}return{paint(e,n){const{digits:m,suffix:i}=P(e),u=m.split(""),r=u.map((p,c)=>({key:u.length-1-c,char:p})),x=`${r.map(p=>p.key).join(",")}|${i}`,b=l==="";if(x!==l){const p=document.createDocumentFragment(),c=new Set;for(const{key:f,char:y}of r){c.add(f);const S=!/[0-9]/.test(y);let v=s.get(f);v?.separator!==S&&(v=V(S),s.set(f,v),!b&&n!==0&&h(v)),p.append(v.el)}for(const f of[...s.keys()])c.has(f)||s.delete(f);if(o.replaceChildren(p),i){const f=N(z);f.textContent=i,o.append(f)}l=x}for(const{key:p,char:c}of r){const f=s.get(p);!f||f.char===c||(f.separator?(f.el.textContent=c,f.char=c):f.char===null||n===0?d(f,c):g(f,c,n))}},destroy(){for(const e of s.values())e.separator||e.animation?.cancel()}}}function G({value:o,format:t,className:a,durationMs:s=O,easing:l=T,minIntervalMs:d=F}){const g=w.useRef(null),h=w.useRef(null),e=w.useRef(o),n=w.useRef(null),m=w.useRef(0),i=w.useRef(void 0),u=w.useRef({format:t,durationMs:s,easing:l,minIntervalMs:d});return w.useEffect(()=>{u.current={format:t,durationMs:s,easing:l,minIntervalMs:d}}),w.useEffect(()=>{const r=g.current;if(!r)return;const{format:x,durationMs:b,easing:p}=u.current,c=q(r,{durationMs:b,easing:p});return h.current=c,c.paint(x(e.current),0),()=>{clearTimeout(i.current),i.current=void 0,n.current=null,h.current=null,c.destroy()}},[]),w.useEffect(()=>{const r=h.current;if(!r||o===e.current)return;const x=c=>{m.current=Date.now(),r.paint(u.current.format(c),c>=e.current?1:-1),e.current=c},b=Date.now()-m.current,p=u.current.minIntervalMs-b;if(p<=0){x(o);return}n.current=o,i.current??=window.setTimeout(()=>{i.current=void 0;const c=n.current;n.current=null,c!==null&&c!==e.current&&x(c)},p)},[o]),R.jsx("span",{ref:g,className:C(a)})}const A="(prefers-reduced-motion: reduce)";function Q(o){const t=window.matchMedia(A);return t.addEventListener("change",o),()=>{t.removeEventListener("change",o)}}function X(){return window.matchMedia(A).matches}function B(){return w.useSyncExternalStore(Q,X,H)}function H(){return!0}function J(o){const t=k.c(15),{current:a,previous:s,goodDirection:l,caption:d}=o;if(!s)return null;const g=(a-s)/s*100;if(g===0)return null;const h=g>0?"up":"down",e=h===l,n=h==="up"?D:I,m=e?"text-live":"text-destructive";let i;t[0]!==m?(i=C("inline-flex items-center gap-0.5 font-mono text-xs tabular-nums",m),t[0]=m,t[1]=i):i=t[1];let u;t[2]!==n?(u=R.jsx(n,{className:"size-3"}),t[2]=n,t[3]=u):u=t[3];let r;t[4]!==g?(r=Math.abs(g).toFixed(1),t[4]=g,t[5]=r):r=t[5];let x;t[6]!==i||t[7]!==u||t[8]!==r?(x=R.jsxs("span",{className:i,children:[u,r,"%"]}),t[6]=i,t[7]=u,t[8]=r,t[9]=x):x=t[9];let b;t[10]!==d?(b=d&&R.jsx("span",{className:"text-muted-foreground text-[11px]",children:d}),t[10]=d,t[11]=b):b=t[11];let p;return t[12]!==x||t[13]!==b?(p=R.jsxs(R.Fragment,{children:[x,b]}),t[12]=x,t[13]=b,t[14]=p):p=t[14],p}function K(o){const t=k.c(15),{value:a,format:s}=o,l=M(),d=B();let g;t[0]!==s||t[1]!==a?(g=s(a),t[0]=s,t[1]=a,t[2]=g):g=t[2];const h=g,e=l&&!d;let n;t[3]!==e||t[4]!==s||t[5]!==h||t[6]!==a?(n=e?R.jsx(G,{value:a,format:s}):h,t[3]=e,t[4]=s,t[5]=h,t[6]=a,t[7]=n):n=t[7];let m;t[8]!==n?(m=R.jsx("span",{"aria-hidden":"true",children:n}),t[8]=n,t[9]=m):m=t[9];let i;t[10]!==h?(i=R.jsx("span",{className:"sr-only",children:h}),t[10]=h,t[11]=i):i=t[11];let u;return t[12]!==m||t[13]!==i?(u=R.jsxs(R.Fragment,{children:[m,i]}),t[12]=m,t[13]=i,t[14]=u):u=t[14],u}function et(o){const t=k.c(28),{label:a,value:s,roll:l,hint:d,tone:g,delta:h,deltaCaption:e,card:n,className:m}=o,u=(n===void 0?!1:n)&&"bg-card rounded-lg border";let r;t[0]!==m||t[1]!==u?(r=C("flex min-w-0 flex-col gap-1 px-4 py-3",u,m),t[0]=m,t[1]=u,t[2]=r):r=t[2];let x;t[3]!==a?(x=R.jsx("div",{className:"label-caps truncate",children:a}),t[3]=a,t[4]=x):x=t[4];const b=g==="destructive"&&"text-destructive",p=g==="warning"&&"text-warning",c=g==="success"&&"text-live";let f;t[5]!==b||t[6]!==p||t[7]!==c?(f=C("text-xl font-semibold tracking-tight tabular-nums sm:text-2xl",b,p,c),t[5]=b,t[6]=p,t[7]=c,t[8]=f):f=t[8];let y;t[9]!==l||t[10]!==s?(y=l?R.jsx(K,{...l}):s,t[9]=l,t[10]=s,t[11]=y):y=t[11];let S;t[12]!==f||t[13]!==y?(S=R.jsx("div",{className:f,children:y}),t[12]=f,t[13]=y,t[14]=S):S=t[14];let v;t[15]!==h||t[16]!==e?(v=h&&R.jsx(J,{...h,caption:e}),t[15]=h,t[16]=e,t[17]=v):v=t[17];let j;t[18]!==S||t[19]!==v?(j=R.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[S,v]}),t[18]=S,t[19]=v,t[20]=j):j=t[20];let L;t[21]!==d?(L=d&&R.jsx("div",{className:"text-muted-foreground truncate font-mono text-[11px]",children:d}),t[21]=d,t[22]=L):L=t[22];let _;return t[23]!==j||t[24]!==L||t[25]!==r||t[26]!==x?(_=R.jsxs("div",{className:r,children:[x,j,L]}),t[23]=j,t[24]=L,t[25]=r,t[26]=x,t[27]=_):_=t[27],_}function nt(o){const t=k.c(5),{children:a,className:s}=o;let l;t[0]!==s?(l=C("bg-card divide-border grid grid-cols-2 divide-y overflow-hidden rounded-lg border sm:divide-x sm:divide-y-0","[&>*:nth-child(odd)]:border-r sm:[&>*:nth-child(odd)]:border-r-0","[&>*:nth-child(odd):last-child]:col-span-2 [&>*:nth-child(odd):last-child]:border-r-0 sm:[&>*:nth-child(odd):last-child]:col-span-1","sm:auto-cols-fr sm:grid-flow-col",s),t[0]=s,t[1]=l):l=t[1];let d;return t[2]!==a||t[3]!==l?(d=R.jsx("div",{className:l,children:a}),t[2]=a,t[3]=l,t[4]=d):d=t[4],d}export{et as S,nt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,C as d,j as m}from"./inertia-
|
|
1
|
+
import{c as u,C as d,j as m}from"./inertia-Cuyz2ZHO.js";import{B as g}from"./badge-DRae8XwK.js";import{s as x}from"./format-B9SDkrWj.js";const f={success:"border-live/30 bg-live/10 text-live",warning:"border-warning/40 bg-warning/10 text-warning",destructive:"border-danger/40 bg-danger/10 text-danger",muted:"border-border bg-muted text-muted-foreground"},v="rounded-sm px-1.5 font-mono text-[10px] tracking-wider uppercase";function j(c){const t=u.c(5),{status:e,outcome:i,label:o}=c,n=x(e,i),s=f[n];let r;t[0]!==s?(r=d(v,"tabular-nums",s),t[0]=s,t[1]=r):r=t[1];const a=o??i??e??"–";let l;return t[2]!==r||t[3]!==a?(l=m.jsx(g,{variant:"outline",className:r,children:a}),t[2]=r,t[3]=a,t[4]=l):l=t[4],l}function B(c){const t=u.c(5),{level:e}=c,o=f[e==="error"||e==="fatal"?"destructive":e==="warn"?"warning":e==="event"?"success":"muted"];let n;t[0]!==o?(n=d(v,o),t[0]=o,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s=m.jsx(g,{variant:"outline",className:n,children:e}),t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function N(c){const t=u.c(5),{status:e}=c,o=f[e==="open"?"destructive":e==="resolved"?"success":"muted"];let n;t[0]!==o?(n=d(v,o),t[0]=o,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s=m.jsx(g,{variant:"outline",className:n,children:e}),t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function h(c){const t=u.c(6),{children:e,tone:i,className:o}=c,s=f[i===void 0?"muted":i];let r;t[0]!==o||t[1]!==s?(r=d(v,s,o),t[0]=o,t[1]=s,t[2]=r):r=t[2];let a;return t[3]!==e||t[4]!==r?(a=m.jsx(g,{variant:"outline",className:r,children:e}),t[3]=e,t[4]=r,t[5]=a):a=t[5],a}export{N as I,h as K,B as L,j as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aA as p}from"./inertia-
|
|
1
|
+
import{aA as p}from"./inertia-Cuyz2ZHO.js";function s(n,a,r,e){const o=String(p(n,a,r,e)),[i,t]=o.split("?");return`${i.replace(/\./g,"%2E")}${t?`?${t}`:""}`}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,C as c,j as u,L as d}from"./inertia-
|
|
1
|
+
import{c as l,C as c,j as u,L as d}from"./inertia-Cuyz2ZHO.js";function m(a){const e=l.c(10);let t,o,n;e[0]!==a?({className:n,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=n):(t=e[1],o=e[2],n=e[3]);const i=n===void 0?"":n;let r;e[4]!==i?(r=c("text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",i),e[4]=i,e[5]=r):r=e[5];let s;return e[6]!==t||e[7]!==o||e[8]!==r?(s=u.jsx(d,{className:r,...o,children:t}),e[6]=t,e[7]=o,e[8]=r,e[9]=s):s=e[9],s}export{m as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,C as n,j as l}from"./inertia-
|
|
1
|
+
import{c as o,C as n,j as l}from"./inertia-Cuyz2ZHO.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=n("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=l.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,j as n,c as P,C as N}from"./inertia-CqnzqPVD.js";import{c as Te,u as ke,a as j,P as ve}from"./index-C-EwH4lO.js";import{u as Pe}from"./app-wordmark-Bt6XqURo.js";import{d as be,R as Re,A as _e,P as Oe,e as He,C as De}from"./live-dot-UdzOfzJb.js";import{P as Ie}from"./index-BDVShWMs.js";import{m as L,u as Le}from"./format-B9SDkrWj.js";var $e=Object.defineProperty,C=(a,e)=>$e(a,"name",{value:e,configurable:!0}),oe,fe="HoverCard",[ye,mt]=Te(fe,[be]),pe=be(),[Ae,te]=ye(fe),Me=C(a=>{const{__scopeHoverCard:e,children:t,open:o,defaultOpen:l,onOpenChange:r,openDelay:c=700,closeDelay:p=300}=a,u=pe(e),d=b.useRef(0),h=b.useRef(0),i=b.useRef(!1),x=b.useRef(!1),[g,m]=ke({prop:o,defaultProp:l??!1,onChange:r,caller:fe}),f=b.useCallback(()=>{clearTimeout(h.current),d.current=window.setTimeout(()=>m(!0),c)},[c,m]),y=b.useCallback(()=>{clearTimeout(d.current),!i.current&&!x.current&&(h.current=window.setTimeout(()=>m(!1),p))},[p,m]),w=b.useCallback(()=>m(!1),[m]);return b.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(h.current)},[]),n.jsx(Ae,{scope:e,open:g,onOpenChange:m,onOpen:f,onClose:y,onDismiss:w,hasSelectionRef:i,isPointerDownOnContentRef:x,children:n.jsx(Re,{...u,children:t})})},"HoverCard"),qe="HoverCardTrigger",Ue=b.forwardRef(C(function(e,t){const{__scopeHoverCard:o,...l}=e,r=te(qe,o),c=pe(o);return n.jsx(_e,{asChild:!0,...c,children:n.jsx(Ie.a,{"data-state":r.open?"open":"closed",...l,ref:t,onPointerEnter:j(e.onPointerEnter,$(r.onOpen)),onPointerLeave:j(e.onPointerLeave,$(r.onClose)),onFocus:j(e.onFocus,r.onOpen),onBlur:j(e.onBlur,r.onClose),onTouchStart:j(e.onTouchStart,p=>p.preventDefault())})})},"HoverCardTrigger")),Ne="HoverCardPortal",[Fe,ze]=ye(Ne,{forceMount:void 0}),Be=C(a=>{const{__scopeHoverCard:e,forceMount:t,children:o,container:l}=a,r=te(Ne,e);return n.jsx(Fe,{scope:e,forceMount:t,children:n.jsx(ve,{present:t||r.open,children:n.jsx(Oe,{asChild:!0,container:l,children:o})})})},"HoverCardPortal"),ce="HoverCardContent",Ge=b.forwardRef(C(function(e,t){const o=ze(ce,e.__scopeHoverCard),{forceMount:l=o.forceMount,...r}=e,c=te(ce,e.__scopeHoverCard);return n.jsx(ve,{present:l||c.open,children:n.jsx(Ve,{"data-state":c.open?"open":"closed",...r,onPointerEnter:j(e.onPointerEnter,$(c.onOpen)),onPointerLeave:j(e.onPointerLeave,$(c.onClose)),ref:t})})},"HoverCardContent")),Ve=b.forwardRef(C(function(e,t){const{__scopeHoverCard:o,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:p,...u}=e,d=te(ce,o),h=pe(o),i=b.useRef(null),x=Pe(t,i),[g,m]=b.useState(!1);return b.useEffect(()=>{if(g){const f=document.body;return oe=f.style.userSelect||f.style.webkitUserSelect,f.style.userSelect="none",f.style.webkitUserSelect="none",()=>{f.style.userSelect=oe,f.style.webkitUserSelect=oe}}},[g]),b.useEffect(()=>{if(i.current){const f=C(()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})},"handlePointerUp");return document.addEventListener("pointerup",f),()=>{document.removeEventListener("pointerup",f),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),b.useEffect(()=>{i.current&&je(i.current).forEach(y=>y.setAttribute("tabindex","-1"))}),n.jsx(He,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:j(c,f=>{f.preventDefault()}),onDismiss:d.onDismiss,children:n.jsx(De,{...h,...u,onPointerDown:j(u.onPointerDown,f=>{f.currentTarget.contains(f.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:x,style:{...u.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})},"HoverCardContentImpl"));function $(a){return e=>e.pointerType==="touch"?void 0:a()}C($,"excludeTouch");function je(a){const e=[],t=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:C(o=>o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,"acceptNode")});for(;t.nextNode();)e.push(t.currentNode);return e}C(je,"getTabbableNodes");var We=Me,Ke=Ue,Ye=Be,Je=Ge;const Ze=new Set(["SELECT","FROM","WHERE","JOIN","LEFT","INNER","ON","AND","OR","ORDER","BY","GROUP","LIMIT","OFFSET","INSERT","INTO","VALUES","UPDATE","SET","DELETE","RETURNING","AS","IN","IS","NULL","NOT","DISTINCT","COUNT","SUM","AVG","MAX","MIN","CASE","WHEN","THEN","ELSE","END"]),se=/("(?:[^"]|"")*"|`(?:[^`]|``)*`)|('(?:[^']|'')*')|(\?)|(\b\d+(?:\.\d+)?\b)|(\b[A-Za-z_][A-Za-z_0-9]*\b)/g;function Qe(a){const e=[];let t=0;se.lastIndex=0;let o;for(;o=se.exec(a);){o.index>t&&e.push({text:a.slice(t,o.index),kind:"text"});const[l,r,c,p,u]=o;r?e.push({text:l,kind:"identifier"}):c?e.push({text:l,kind:"string"}):p?e.push({text:l,kind:"placeholder"}):u?e.push({text:l,kind:"number"}):Ze.has(l.toUpperCase())?e.push({text:l,kind:"keyword"}):e.push({text:l,kind:"text"}),t=se.lastIndex}return t<a.length&&e.push({text:a.slice(t),kind:"text"}),e}const Xe={keyword:"text-primary font-semibold",string:"text-emerald-600 dark:text-emerald-400",number:"text-amber-600 dark:text-amber-400",placeholder:"text-primary font-semibold",identifier:"text-muted-foreground",text:""};function Ce(a){const e=P.c(16),{sql:t,wrap:o,inline:l,className:r}=a,c=o===void 0?!1:o,p=l===void 0?!1:l;let u,d,h,i;if(e[0]!==r||e[1]!==p||e[2]!==t||e[3]!==c){const g=Qe(t);u=p?"span":"code";const f=c?"break-words whitespace-pre-wrap":"block max-w-full truncate";e[8]!==r||e[9]!==f?(d=N("font-mono text-xs",f,r),e[8]=r,e[9]=f,e[10]=d):d=e[10],h=c?void 0:t,i=g.map(et),e[0]=r,e[1]=p,e[2]=t,e[3]=c,e[4]=u,e[5]=d,e[6]=h,e[7]=i}else u=e[4],d=e[5],h=e[6],i=e[7];let x;return e[11]!==u||e[12]!==d||e[13]!==h||e[14]!==i?(x=n.jsx(u,{className:d,title:h,children:i}),e[11]=u,e[12]=d,e[13]=h,e[14]=i,e[15]=x):x=e[15],x}function et(a,e){return n.jsx("span",{className:Xe[a.kind]||void 0,children:a.text},e)}function tt(a){const e=P.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=n.jsx(We,{"data-slot":"hover-card",...t}),e[2]=t,e[3]=o):o=e[3],o}function nt(a){const e=P.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=n.jsx(Ke,{"data-slot":"hover-card-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function rt(a){const e=P.c(12);let t,o,l,r;e[0]!==a?({className:t,align:l,sideOffset:r,...o}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=l,e[4]=r):(t=e[1],o=e[2],l=e[3],r=e[4]);const c=l===void 0?"center":l,p=r===void 0?4:r;let u;e[5]!==t?(u=N("bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),e[5]=t,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==o||e[9]!==p||e[10]!==u?(d=n.jsx(Ye,{"data-slot":"hover-card-portal",children:n.jsx(Je,{"data-slot":"hover-card-content",align:c,sideOffset:p,className:u,...o})}),e[7]=c,e[8]=o,e[9]=p,e[10]=u,e[11]=d):d=e[11],d}const xe={query:"bg-sky-500",transaction:"bg-sky-300",cache_event:"bg-violet-500",outgoing_request:"bg-orange-500",mail:"bg-pink-500",broadcast:"bg-teal-500",enqueued_job:"bg-amber-500",view_render:"bg-emerald-500",storage_op:"bg-indigo-500",exception:"bg-red-500",log:"bg-neutral-400",span:"bg-fuchsia-500",attachment:"bg-lime-500",llm_call:"bg-cyan-400"},de={query:"Query",cache_event:"Cache",outgoing_request:"Outgoing",mail:"Mail",broadcast:"Broadcast",log:"Log",exception:"Exception",view_render:"View",storage_op:"Storage",enqueued_job:"Job",transaction:"Transaction",span:"Span",attachment:"Attachment",llm_call:"LLM"},ot=["middleware_before","action","render","middleware_after","body"],ue={middleware_before:"before middleware",action:"action",render:"render",middleware_after:"after middleware",body:"body"},ae=[10,25,50,100,250,500,1e3,2500,5e3,1e4,3e4,6e4];function st(a){const e=a/8;return ae.find(t=>t>=e)??ae[ae.length-1]}function at(a,e){const t=[];for(let o=0;o<=a;o+=e)t.push(o);return t}const le="grid grid-cols-[6rem_1fr_3.5rem] items-center gap-2 md:grid-cols-[5rem_13rem_1fr_4rem]",ie="hidden md:block";function he(a){const e=P.c(32),{entry:t,showSource:o}=a;let l;e[0]!==t.detail?(l=t.detail??{},e[0]=t.detail,e[1]=l):l=e[1];const r=l,c=de[t.type]??t.type;let p;e[2]!==c?(p=n.jsx("span",{children:c}),e[2]=c,e[3]=p):p=e[3];let u;e[4]!==t.stage?(u=t.stage&&n.jsxs("span",{children:["· ",ue[t.stage]??t.stage]}),e[4]=t.stage,e[5]=u):u=e[5];let d;e[6]!==p||e[7]!==u?(d=n.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-[10px] tracking-wide uppercase",children:[p,u]}),e[6]=p,e[7]=u,e[8]=d):d=e[8];let h;e[9]!==r||e[10]!==t.label||e[11]!==t.sql||e[12]!==t.type||e[13]!==o?(h=t.type==="query"&&t.sql?n.jsx(Ce,{sql:t.sql,wrap:!0,className:"text-[11px]"}):t.type==="cache_event"?n.jsxs("div",{className:"font-mono text-xs break-all",children:[String(r.op??"")," ",n.jsx("span",{className:"font-semibold",children:String(r.key??"")})]}):t.type==="outgoing_request"?n.jsxs("div",{className:"font-mono text-xs break-all",children:[String(r.method??"")," ",String(r.url??t.label),r.status!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" → ",String(r.status)]}),o&&typeof r.body=="string"&&r.body!==""&&n.jsx("pre",{className:"bg-muted mt-1.5 max-h-48 overflow-auto rounded p-2 text-[10px] break-all whitespace-pre-wrap",children:r.body})]}):t.type==="llm_call"?n.jsxs("div",{className:"font-mono text-xs break-all",children:[String(r.tool??t.label),r.input_tokens!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",String(r.input_tokens)," in / ",String(r.output_tokens??0)," out"]}),r.cost!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",Le(Number(r.cost))]}),r.step!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",String(r.workflow??"")," / ",String(r.step)]}),r.error!=null&&n.jsx("div",{className:"text-destructive mt-1",children:String(r.error)})]}):t.type==="mail"?n.jsx("div",{className:"font-mono text-xs break-all",children:String(r.subject??t.label)}):t.type==="log"?n.jsxs("div",{className:"font-mono text-xs break-words",children:[n.jsx("span",{className:"text-muted-foreground uppercase",children:String(r.level??"")})," ",String(r.message??t.label)]}):t.type==="exception"?n.jsx("div",{className:"text-destructive font-mono text-xs break-words",children:t.label}):n.jsx("div",{className:"font-mono text-xs break-words",children:t.label}),e[9]=r,e[10]=t.label,e[11]=t.sql,e[12]=t.type,e[13]=o,e[14]=h):h=e[14];let i;e[15]!==t.offset?(i=L(t.offset),e[15]=t.offset,e[16]=i):i=e[16];let x;e[17]!==i?(x=n.jsxs("span",{children:["+",i]}),e[17]=i,e[18]=x):x=e[18];let g;e[19]!==t.duration?(g=t.duration!=null&&n.jsx("span",{children:L(t.duration)}),e[19]=t.duration,e[20]=g):g=e[20];let m;e[21]!==x||e[22]!==g?(m=n.jsxs("div",{className:"text-muted-foreground flex flex-wrap gap-x-3 text-[11px] tabular-nums",children:[x,g]}),e[21]=x,e[22]=g,e[23]=m):m=e[23];let f;e[24]!==t.source||e[25]!==o?(f=o&&t.source&&n.jsx("div",{className:"text-muted-foreground border-t pt-1 font-mono text-[11px] break-all",children:t.source}),e[24]=t.source,e[25]=o,e[26]=f):f=e[26];let y;return e[27]!==m||e[28]!==f||e[29]!==d||e[30]!==h?(y=n.jsxs("div",{className:"space-y-1.5",children:[d,h,m,f]}),e[27]=m,e[28]=f,e[29]=d,e[30]=h,e[31]=y):y=e[31],y}function ge(a){const e=P.c(7),{ticks:t,span:o}=a;let l;if(e[0]!==o||e[1]!==t){let c;e[3]!==o?(c=p=>n.jsx("div",{className:"bg-border/60 pointer-events-none absolute top-0 h-full w-px",style:{left:`${p/o*100}%`}},p),e[3]=o,e[4]=c):c=e[4],l=t.map(c),e[0]=o,e[1]=t,e[2]=l}else l=e[2];let r;return e[5]!==l?(r=n.jsx(n.Fragment,{children:l}),e[5]=l,e[6]=r):r=e[6],r}function xt(a){const e=P.c(70),{entries:t,total:o,stages:l}=a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,e[0]=r):r=e[0];const[c,p]=b.useState(r),[u,d]=b.useState(null);let h;e[1]!==t||e[2]!==o?(h=Math.max(o,...t.map(lt),1),e[1]=t,e[2]=o,e[3]=h):h=e[3];const i=h;let x,g,m,f,y,w,S,E;if(e[4]!==t||e[5]!==u||e[6]!==c||e[7]!==i||e[8]!==l){const we=st(i),k=at(i,we);let _;if(e[17]!==t){_=new Map;for(const s of t)_.set(s.type,(_.get(s.type)??0)+1);e[17]=t,e[18]=_}else _=e[18];const M=_;let q;e[19]!==c?(q=s=>!c.has(s.type),e[19]=c,e[20]=q):q=e[20];const me=t.filter(q);let U;e[21]===Symbol.for("react.memo_cache_sentinel")?(U=function(v){p(T=>{const I=new Set(T);return I.has(v)?I.delete(v):I.add(v),I})},e[21]=U):U=e[21];const Se=U;let F;e[22]!==l?(F=s=>l[s]!==void 0,e[22]=l,e[23]=F):F=e[23];let z;e[24]!==l?(z=(s,v)=>{const T=s.length>0?s[s.length-1].start+s[s.length-1].width:0;return s.push({name:v,start:T,width:l[v]}),s},e[24]=l,e[25]=z):z=e[25];const Ee=ot.filter(F).reduce(z,[]);w="space-y-2",e[26]!==M||e[27]!==c?(S=M.size>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:[...M.entries()].map(s=>{const[v,T]=s;return n.jsxs("button",{type:"button",onClick:()=>Se(v),className:N("flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors",c.has(v)?"text-muted-foreground opacity-50":"hover:bg-muted/60"),children:[n.jsx("span",{className:N("size-1.5 rounded-full",xe[v]??"bg-neutral-500")}),de[v]??v,n.jsx("span",{className:"text-muted-foreground tabular-nums",children:T})]},v)})}),e[26]=M,e[27]=c,e[28]=S):S=e[28];let B,G,V;e[29]===Symbol.for("react.memo_cache_sentinel")?(B=N(le,"px-2 text-[10px]"),G=n.jsx("div",{className:ie}),V=n.jsx("div",{}),e[29]=B,e[30]=G,e[31]=V):(B=e[29],G=e[30],V=e[31]);let W;e[32]!==i?(W=s=>n.jsx("span",{className:"text-muted-foreground absolute -translate-x-1/2 tabular-nums",style:{left:`${s/i*100}%`},children:L(s,0)},s),e[32]=i,e[33]=W):W=e[33];const ne=k.map(W);let O;e[34]!==ne?(O=n.jsx("div",{className:"relative h-4 select-none",children:ne}),e[34]=ne,e[35]=O):O=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("div",{}),e[36]=K):K=e[36],e[37]!==O?(E=n.jsxs("div",{className:B,children:[G,V,O,K]}),e[37]=O,e[38]=E):E=e[38];let Y,J,Z;e[39]===Symbol.for("react.memo_cache_sentinel")?(Y=N(le,"px-2"),J=n.jsx("div",{className:ie}),Z=n.jsx("div",{}),e[39]=Y,e[40]=J,e[41]=Z):(Y=e[39],J=e[40],Z=e[41]);let H;e[42]!==i||e[43]!==k?(H=n.jsx(ge,{ticks:k,span:i}),e[42]=i,e[43]=k,e[44]=H):H=e[44];let Q;e[45]!==i?(Q=s=>n.jsxs("div",{className:"border-background bg-primary/20 absolute top-0 flex h-full items-center overflow-hidden border-r px-1 whitespace-nowrap",style:{left:`${s.start/i*100}%`,width:`${s.width/i*100}%`},title:`${ue[s.name]??s.name} ${L(s.width)}`,children:[ue[s.name]??s.name," ",L(s.width,0)]},s.name),e[45]=i,e[46]=Q):Q=e[46];const re=Ee.map(Q);let D;e[47]!==H||e[48]!==re?(D=n.jsxs("div",{className:"bg-muted/40 relative h-5 overflow-hidden rounded text-[10px]",children:[H,re]}),e[47]=H,e[48]=re,e[49]=D):D=e[49];let X;e[50]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("div",{}),e[50]=X):X=e[50],e[51]!==D?(x=n.jsxs("div",{className:Y,children:[J,Z,D,X]}),e[51]=D,e[52]=x):x=e[52],g="max-h-[32rem] overflow-y-auto rounded-lg border",e[53]!==t.length?(m=t.length===0&&n.jsx("div",{className:"text-muted-foreground p-4 text-center text-sm",children:"No child events recorded."}),e[53]=t.length,e[54]=m):m=e[54],f=t.length>0&&me.length===0&&n.jsx("div",{className:"text-muted-foreground p-4 text-center text-sm",children:"No events match the active filters."});let ee;e[55]!==u||e[56]!==i||e[57]!==k?(ee=s=>{const v=`${s.type}-${s.id}`,T=i>0&&(s.duration??0)/i>.1,I=s.type==="exception";return n.jsxs("div",{className:"border-b last:border-b-0",style:{contentVisibility:"auto",containIntrinsicSize:"0 28px"},children:[n.jsxs(tt,{openDelay:150,children:[n.jsx(nt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:()=>d(u===v?null:v),className:N(le,"hover:bg-muted/40 w-full px-2 py-1 text-left text-xs"),children:[n.jsx("span",{className:N("text-muted-foreground truncate font-mono",ie),children:de[s.type]??s.type}),s.type==="query"&&s.sql?n.jsx(Ce,{sql:s.sql}):n.jsx("span",{className:"truncate font-mono",children:s.label}),n.jsxs("div",{className:"bg-muted/30 relative h-3 rounded",children:[n.jsx(ge,{ticks:k,span:i}),I?n.jsx("div",{className:"absolute top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 rotate-45 bg-red-500",style:{left:`${Math.min(100,s.offset/i*100)}%`}}):n.jsx("div",{className:N("absolute top-0 h-full rounded",xe[s.type]??"bg-neutral-500",T?"ring-foreground/30 opacity-100 ring-1 ring-inset":"opacity-70"),style:{left:`${Math.min(100,s.offset/i*100)}%`,width:`${Math.max(.3,(s.duration??0)/i*100)}%`}})]}),n.jsx("span",{className:N("text-muted-foreground text-right tabular-nums",T&&"text-foreground font-semibold"),children:s.duration!=null?L(s.duration):"–"})]})}),n.jsx(rt,{className:"w-80",align:"start",children:n.jsx(he,{entry:s})})]}),u===v&&n.jsx("div",{className:"bg-muted/20 border-t px-4 py-2",children:n.jsx(he,{entry:s,showSource:!0})})]},v)},e[55]=u,e[56]=i,e[57]=k,e[58]=ee):ee=e[58],y=me.map(ee),e[4]=t,e[5]=u,e[6]=c,e[7]=i,e[8]=l,e[9]=x,e[10]=g,e[11]=m,e[12]=f,e[13]=y,e[14]=w,e[15]=S,e[16]=E}else x=e[9],g=e[10],m=e[11],f=e[12],y=e[13],w=e[14],S=e[15],E=e[16];let R;e[59]!==g||e[60]!==m||e[61]!==f||e[62]!==y?(R=n.jsxs("div",{className:g,children:[m,f,y]}),e[59]=g,e[60]=m,e[61]=f,e[62]=y,e[63]=R):R=e[63];let A;return e[64]!==x||e[65]!==R||e[66]!==w||e[67]!==S||e[68]!==E?(A=n.jsxs("div",{className:w,children:[S,E,x,R]}),e[64]=x,e[65]=R,e[66]=w,e[67]=S,e[68]=E,e[69]=A):A=e[69],A}function lt(a){return a.offset+(a.duration??0)}export{Ce as S,xt as T};
|
|
1
|
+
import{r as b,j as n,c as P,C as N}from"./inertia-Cuyz2ZHO.js";import{c as Te,u as ke,a as j,P as ve}from"./index-BfbSo01U.js";import{u as Pe}from"./app-wordmark-BA_60AVb.js";import{d as be,R as Re,A as _e,P as Oe,e as He,C as De}from"./live-dot-BZgYTYdt.js";import{P as Ie}from"./index-CBip6V4z.js";import{m as L,u as Le}from"./format-B9SDkrWj.js";var $e=Object.defineProperty,C=(a,e)=>$e(a,"name",{value:e,configurable:!0}),oe,fe="HoverCard",[ye,mt]=Te(fe,[be]),pe=be(),[Ae,te]=ye(fe),Me=C(a=>{const{__scopeHoverCard:e,children:t,open:o,defaultOpen:l,onOpenChange:r,openDelay:c=700,closeDelay:p=300}=a,u=pe(e),d=b.useRef(0),h=b.useRef(0),i=b.useRef(!1),x=b.useRef(!1),[g,m]=ke({prop:o,defaultProp:l??!1,onChange:r,caller:fe}),f=b.useCallback(()=>{clearTimeout(h.current),d.current=window.setTimeout(()=>m(!0),c)},[c,m]),y=b.useCallback(()=>{clearTimeout(d.current),!i.current&&!x.current&&(h.current=window.setTimeout(()=>m(!1),p))},[p,m]),w=b.useCallback(()=>m(!1),[m]);return b.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(h.current)},[]),n.jsx(Ae,{scope:e,open:g,onOpenChange:m,onOpen:f,onClose:y,onDismiss:w,hasSelectionRef:i,isPointerDownOnContentRef:x,children:n.jsx(Re,{...u,children:t})})},"HoverCard"),qe="HoverCardTrigger",Ue=b.forwardRef(C(function(e,t){const{__scopeHoverCard:o,...l}=e,r=te(qe,o),c=pe(o);return n.jsx(_e,{asChild:!0,...c,children:n.jsx(Ie.a,{"data-state":r.open?"open":"closed",...l,ref:t,onPointerEnter:j(e.onPointerEnter,$(r.onOpen)),onPointerLeave:j(e.onPointerLeave,$(r.onClose)),onFocus:j(e.onFocus,r.onOpen),onBlur:j(e.onBlur,r.onClose),onTouchStart:j(e.onTouchStart,p=>p.preventDefault())})})},"HoverCardTrigger")),Ne="HoverCardPortal",[Fe,ze]=ye(Ne,{forceMount:void 0}),Be=C(a=>{const{__scopeHoverCard:e,forceMount:t,children:o,container:l}=a,r=te(Ne,e);return n.jsx(Fe,{scope:e,forceMount:t,children:n.jsx(ve,{present:t||r.open,children:n.jsx(Oe,{asChild:!0,container:l,children:o})})})},"HoverCardPortal"),ce="HoverCardContent",Ge=b.forwardRef(C(function(e,t){const o=ze(ce,e.__scopeHoverCard),{forceMount:l=o.forceMount,...r}=e,c=te(ce,e.__scopeHoverCard);return n.jsx(ve,{present:l||c.open,children:n.jsx(Ve,{"data-state":c.open?"open":"closed",...r,onPointerEnter:j(e.onPointerEnter,$(c.onOpen)),onPointerLeave:j(e.onPointerLeave,$(c.onClose)),ref:t})})},"HoverCardContent")),Ve=b.forwardRef(C(function(e,t){const{__scopeHoverCard:o,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:p,...u}=e,d=te(ce,o),h=pe(o),i=b.useRef(null),x=Pe(t,i),[g,m]=b.useState(!1);return b.useEffect(()=>{if(g){const f=document.body;return oe=f.style.userSelect||f.style.webkitUserSelect,f.style.userSelect="none",f.style.webkitUserSelect="none",()=>{f.style.userSelect=oe,f.style.webkitUserSelect=oe}}},[g]),b.useEffect(()=>{if(i.current){const f=C(()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})},"handlePointerUp");return document.addEventListener("pointerup",f),()=>{document.removeEventListener("pointerup",f),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),b.useEffect(()=>{i.current&&je(i.current).forEach(y=>y.setAttribute("tabindex","-1"))}),n.jsx(He,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:j(c,f=>{f.preventDefault()}),onDismiss:d.onDismiss,children:n.jsx(De,{...h,...u,onPointerDown:j(u.onPointerDown,f=>{f.currentTarget.contains(f.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:x,style:{...u.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})},"HoverCardContentImpl"));function $(a){return e=>e.pointerType==="touch"?void 0:a()}C($,"excludeTouch");function je(a){const e=[],t=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:C(o=>o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,"acceptNode")});for(;t.nextNode();)e.push(t.currentNode);return e}C(je,"getTabbableNodes");var We=Me,Ke=Ue,Ye=Be,Je=Ge;const Ze=new Set(["SELECT","FROM","WHERE","JOIN","LEFT","INNER","ON","AND","OR","ORDER","BY","GROUP","LIMIT","OFFSET","INSERT","INTO","VALUES","UPDATE","SET","DELETE","RETURNING","AS","IN","IS","NULL","NOT","DISTINCT","COUNT","SUM","AVG","MAX","MIN","CASE","WHEN","THEN","ELSE","END"]),se=/("(?:[^"]|"")*"|`(?:[^`]|``)*`)|('(?:[^']|'')*')|(\?)|(\b\d+(?:\.\d+)?\b)|(\b[A-Za-z_][A-Za-z_0-9]*\b)/g;function Qe(a){const e=[];let t=0;se.lastIndex=0;let o;for(;o=se.exec(a);){o.index>t&&e.push({text:a.slice(t,o.index),kind:"text"});const[l,r,c,p,u]=o;r?e.push({text:l,kind:"identifier"}):c?e.push({text:l,kind:"string"}):p?e.push({text:l,kind:"placeholder"}):u?e.push({text:l,kind:"number"}):Ze.has(l.toUpperCase())?e.push({text:l,kind:"keyword"}):e.push({text:l,kind:"text"}),t=se.lastIndex}return t<a.length&&e.push({text:a.slice(t),kind:"text"}),e}const Xe={keyword:"text-primary font-semibold",string:"text-emerald-600 dark:text-emerald-400",number:"text-amber-600 dark:text-amber-400",placeholder:"text-primary font-semibold",identifier:"text-muted-foreground",text:""};function Ce(a){const e=P.c(16),{sql:t,wrap:o,inline:l,className:r}=a,c=o===void 0?!1:o,p=l===void 0?!1:l;let u,d,h,i;if(e[0]!==r||e[1]!==p||e[2]!==t||e[3]!==c){const g=Qe(t);u=p?"span":"code";const f=c?"break-words whitespace-pre-wrap":"block max-w-full truncate";e[8]!==r||e[9]!==f?(d=N("font-mono text-xs",f,r),e[8]=r,e[9]=f,e[10]=d):d=e[10],h=c?void 0:t,i=g.map(et),e[0]=r,e[1]=p,e[2]=t,e[3]=c,e[4]=u,e[5]=d,e[6]=h,e[7]=i}else u=e[4],d=e[5],h=e[6],i=e[7];let x;return e[11]!==u||e[12]!==d||e[13]!==h||e[14]!==i?(x=n.jsx(u,{className:d,title:h,children:i}),e[11]=u,e[12]=d,e[13]=h,e[14]=i,e[15]=x):x=e[15],x}function et(a,e){return n.jsx("span",{className:Xe[a.kind]||void 0,children:a.text},e)}function tt(a){const e=P.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=n.jsx(We,{"data-slot":"hover-card",...t}),e[2]=t,e[3]=o):o=e[3],o}function nt(a){const e=P.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=n.jsx(Ke,{"data-slot":"hover-card-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function rt(a){const e=P.c(12);let t,o,l,r;e[0]!==a?({className:t,align:l,sideOffset:r,...o}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=l,e[4]=r):(t=e[1],o=e[2],l=e[3],r=e[4]);const c=l===void 0?"center":l,p=r===void 0?4:r;let u;e[5]!==t?(u=N("bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),e[5]=t,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==o||e[9]!==p||e[10]!==u?(d=n.jsx(Ye,{"data-slot":"hover-card-portal",children:n.jsx(Je,{"data-slot":"hover-card-content",align:c,sideOffset:p,className:u,...o})}),e[7]=c,e[8]=o,e[9]=p,e[10]=u,e[11]=d):d=e[11],d}const xe={query:"bg-sky-500",transaction:"bg-sky-300",cache_event:"bg-violet-500",outgoing_request:"bg-orange-500",mail:"bg-pink-500",broadcast:"bg-teal-500",enqueued_job:"bg-amber-500",view_render:"bg-emerald-500",storage_op:"bg-indigo-500",exception:"bg-red-500",log:"bg-neutral-400",span:"bg-fuchsia-500",attachment:"bg-lime-500",llm_call:"bg-cyan-400"},de={query:"Query",cache_event:"Cache",outgoing_request:"Outgoing",mail:"Mail",broadcast:"Broadcast",log:"Log",exception:"Exception",view_render:"View",storage_op:"Storage",enqueued_job:"Job",transaction:"Transaction",span:"Span",attachment:"Attachment",llm_call:"LLM"},ot=["middleware_before","action","render","middleware_after","body"],ue={middleware_before:"before middleware",action:"action",render:"render",middleware_after:"after middleware",body:"body"},ae=[10,25,50,100,250,500,1e3,2500,5e3,1e4,3e4,6e4];function st(a){const e=a/8;return ae.find(t=>t>=e)??ae[ae.length-1]}function at(a,e){const t=[];for(let o=0;o<=a;o+=e)t.push(o);return t}const le="grid grid-cols-[6rem_1fr_3.5rem] items-center gap-2 md:grid-cols-[5rem_13rem_1fr_4rem]",ie="hidden md:block";function he(a){const e=P.c(32),{entry:t,showSource:o}=a;let l;e[0]!==t.detail?(l=t.detail??{},e[0]=t.detail,e[1]=l):l=e[1];const r=l,c=de[t.type]??t.type;let p;e[2]!==c?(p=n.jsx("span",{children:c}),e[2]=c,e[3]=p):p=e[3];let u;e[4]!==t.stage?(u=t.stage&&n.jsxs("span",{children:["· ",ue[t.stage]??t.stage]}),e[4]=t.stage,e[5]=u):u=e[5];let d;e[6]!==p||e[7]!==u?(d=n.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-[10px] tracking-wide uppercase",children:[p,u]}),e[6]=p,e[7]=u,e[8]=d):d=e[8];let h;e[9]!==r||e[10]!==t.label||e[11]!==t.sql||e[12]!==t.type||e[13]!==o?(h=t.type==="query"&&t.sql?n.jsx(Ce,{sql:t.sql,wrap:!0,className:"text-[11px]"}):t.type==="cache_event"?n.jsxs("div",{className:"font-mono text-xs break-all",children:[String(r.op??"")," ",n.jsx("span",{className:"font-semibold",children:String(r.key??"")})]}):t.type==="outgoing_request"?n.jsxs("div",{className:"font-mono text-xs break-all",children:[String(r.method??"")," ",String(r.url??t.label),r.status!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" → ",String(r.status)]}),o&&typeof r.body=="string"&&r.body!==""&&n.jsx("pre",{className:"bg-muted mt-1.5 max-h-48 overflow-auto rounded p-2 text-[10px] break-all whitespace-pre-wrap",children:r.body})]}):t.type==="llm_call"?n.jsxs("div",{className:"font-mono text-xs break-all",children:[String(r.tool??t.label),r.input_tokens!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",String(r.input_tokens)," in / ",String(r.output_tokens??0)," out"]}),r.cost!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",Le(Number(r.cost))]}),r.step!=null&&n.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",String(r.workflow??"")," / ",String(r.step)]}),r.error!=null&&n.jsx("div",{className:"text-destructive mt-1",children:String(r.error)})]}):t.type==="mail"?n.jsx("div",{className:"font-mono text-xs break-all",children:String(r.subject??t.label)}):t.type==="log"?n.jsxs("div",{className:"font-mono text-xs break-words",children:[n.jsx("span",{className:"text-muted-foreground uppercase",children:String(r.level??"")})," ",String(r.message??t.label)]}):t.type==="exception"?n.jsx("div",{className:"text-destructive font-mono text-xs break-words",children:t.label}):n.jsx("div",{className:"font-mono text-xs break-words",children:t.label}),e[9]=r,e[10]=t.label,e[11]=t.sql,e[12]=t.type,e[13]=o,e[14]=h):h=e[14];let i;e[15]!==t.offset?(i=L(t.offset),e[15]=t.offset,e[16]=i):i=e[16];let x;e[17]!==i?(x=n.jsxs("span",{children:["+",i]}),e[17]=i,e[18]=x):x=e[18];let g;e[19]!==t.duration?(g=t.duration!=null&&n.jsx("span",{children:L(t.duration)}),e[19]=t.duration,e[20]=g):g=e[20];let m;e[21]!==x||e[22]!==g?(m=n.jsxs("div",{className:"text-muted-foreground flex flex-wrap gap-x-3 text-[11px] tabular-nums",children:[x,g]}),e[21]=x,e[22]=g,e[23]=m):m=e[23];let f;e[24]!==t.source||e[25]!==o?(f=o&&t.source&&n.jsx("div",{className:"text-muted-foreground border-t pt-1 font-mono text-[11px] break-all",children:t.source}),e[24]=t.source,e[25]=o,e[26]=f):f=e[26];let y;return e[27]!==m||e[28]!==f||e[29]!==d||e[30]!==h?(y=n.jsxs("div",{className:"space-y-1.5",children:[d,h,m,f]}),e[27]=m,e[28]=f,e[29]=d,e[30]=h,e[31]=y):y=e[31],y}function ge(a){const e=P.c(7),{ticks:t,span:o}=a;let l;if(e[0]!==o||e[1]!==t){let c;e[3]!==o?(c=p=>n.jsx("div",{className:"bg-border/60 pointer-events-none absolute top-0 h-full w-px",style:{left:`${p/o*100}%`}},p),e[3]=o,e[4]=c):c=e[4],l=t.map(c),e[0]=o,e[1]=t,e[2]=l}else l=e[2];let r;return e[5]!==l?(r=n.jsx(n.Fragment,{children:l}),e[5]=l,e[6]=r):r=e[6],r}function xt(a){const e=P.c(70),{entries:t,total:o,stages:l}=a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,e[0]=r):r=e[0];const[c,p]=b.useState(r),[u,d]=b.useState(null);let h;e[1]!==t||e[2]!==o?(h=Math.max(o,...t.map(lt),1),e[1]=t,e[2]=o,e[3]=h):h=e[3];const i=h;let x,g,m,f,y,w,S,E;if(e[4]!==t||e[5]!==u||e[6]!==c||e[7]!==i||e[8]!==l){const we=st(i),k=at(i,we);let _;if(e[17]!==t){_=new Map;for(const s of t)_.set(s.type,(_.get(s.type)??0)+1);e[17]=t,e[18]=_}else _=e[18];const M=_;let q;e[19]!==c?(q=s=>!c.has(s.type),e[19]=c,e[20]=q):q=e[20];const me=t.filter(q);let U;e[21]===Symbol.for("react.memo_cache_sentinel")?(U=function(v){p(T=>{const I=new Set(T);return I.has(v)?I.delete(v):I.add(v),I})},e[21]=U):U=e[21];const Se=U;let F;e[22]!==l?(F=s=>l[s]!==void 0,e[22]=l,e[23]=F):F=e[23];let z;e[24]!==l?(z=(s,v)=>{const T=s.length>0?s[s.length-1].start+s[s.length-1].width:0;return s.push({name:v,start:T,width:l[v]}),s},e[24]=l,e[25]=z):z=e[25];const Ee=ot.filter(F).reduce(z,[]);w="space-y-2",e[26]!==M||e[27]!==c?(S=M.size>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:[...M.entries()].map(s=>{const[v,T]=s;return n.jsxs("button",{type:"button",onClick:()=>Se(v),className:N("flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors",c.has(v)?"text-muted-foreground opacity-50":"hover:bg-muted/60"),children:[n.jsx("span",{className:N("size-1.5 rounded-full",xe[v]??"bg-neutral-500")}),de[v]??v,n.jsx("span",{className:"text-muted-foreground tabular-nums",children:T})]},v)})}),e[26]=M,e[27]=c,e[28]=S):S=e[28];let B,G,V;e[29]===Symbol.for("react.memo_cache_sentinel")?(B=N(le,"px-2 text-[10px]"),G=n.jsx("div",{className:ie}),V=n.jsx("div",{}),e[29]=B,e[30]=G,e[31]=V):(B=e[29],G=e[30],V=e[31]);let W;e[32]!==i?(W=s=>n.jsx("span",{className:"text-muted-foreground absolute -translate-x-1/2 tabular-nums",style:{left:`${s/i*100}%`},children:L(s,0)},s),e[32]=i,e[33]=W):W=e[33];const ne=k.map(W);let O;e[34]!==ne?(O=n.jsx("div",{className:"relative h-4 select-none",children:ne}),e[34]=ne,e[35]=O):O=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("div",{}),e[36]=K):K=e[36],e[37]!==O?(E=n.jsxs("div",{className:B,children:[G,V,O,K]}),e[37]=O,e[38]=E):E=e[38];let Y,J,Z;e[39]===Symbol.for("react.memo_cache_sentinel")?(Y=N(le,"px-2"),J=n.jsx("div",{className:ie}),Z=n.jsx("div",{}),e[39]=Y,e[40]=J,e[41]=Z):(Y=e[39],J=e[40],Z=e[41]);let H;e[42]!==i||e[43]!==k?(H=n.jsx(ge,{ticks:k,span:i}),e[42]=i,e[43]=k,e[44]=H):H=e[44];let Q;e[45]!==i?(Q=s=>n.jsxs("div",{className:"border-background bg-primary/20 absolute top-0 flex h-full items-center overflow-hidden border-r px-1 whitespace-nowrap",style:{left:`${s.start/i*100}%`,width:`${s.width/i*100}%`},title:`${ue[s.name]??s.name} ${L(s.width)}`,children:[ue[s.name]??s.name," ",L(s.width,0)]},s.name),e[45]=i,e[46]=Q):Q=e[46];const re=Ee.map(Q);let D;e[47]!==H||e[48]!==re?(D=n.jsxs("div",{className:"bg-muted/40 relative h-5 overflow-hidden rounded text-[10px]",children:[H,re]}),e[47]=H,e[48]=re,e[49]=D):D=e[49];let X;e[50]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("div",{}),e[50]=X):X=e[50],e[51]!==D?(x=n.jsxs("div",{className:Y,children:[J,Z,D,X]}),e[51]=D,e[52]=x):x=e[52],g="max-h-[32rem] overflow-y-auto rounded-lg border",e[53]!==t.length?(m=t.length===0&&n.jsx("div",{className:"text-muted-foreground p-4 text-center text-sm",children:"No child events recorded."}),e[53]=t.length,e[54]=m):m=e[54],f=t.length>0&&me.length===0&&n.jsx("div",{className:"text-muted-foreground p-4 text-center text-sm",children:"No events match the active filters."});let ee;e[55]!==u||e[56]!==i||e[57]!==k?(ee=s=>{const v=`${s.type}-${s.id}`,T=i>0&&(s.duration??0)/i>.1,I=s.type==="exception";return n.jsxs("div",{className:"border-b last:border-b-0",style:{contentVisibility:"auto",containIntrinsicSize:"0 28px"},children:[n.jsxs(tt,{openDelay:150,children:[n.jsx(nt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:()=>d(u===v?null:v),className:N(le,"hover:bg-muted/40 w-full px-2 py-1 text-left text-xs"),children:[n.jsx("span",{className:N("text-muted-foreground truncate font-mono",ie),children:de[s.type]??s.type}),s.type==="query"&&s.sql?n.jsx(Ce,{sql:s.sql}):n.jsx("span",{className:"truncate font-mono",children:s.label}),n.jsxs("div",{className:"bg-muted/30 relative h-3 rounded",children:[n.jsx(ge,{ticks:k,span:i}),I?n.jsx("div",{className:"absolute top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 rotate-45 bg-red-500",style:{left:`${Math.min(100,s.offset/i*100)}%`}}):n.jsx("div",{className:N("absolute top-0 h-full rounded",xe[s.type]??"bg-neutral-500",T?"ring-foreground/30 opacity-100 ring-1 ring-inset":"opacity-70"),style:{left:`${Math.min(100,s.offset/i*100)}%`,width:`${Math.max(.3,(s.duration??0)/i*100)}%`}})]}),n.jsx("span",{className:N("text-muted-foreground text-right tabular-nums",T&&"text-foreground font-semibold"),children:s.duration!=null?L(s.duration):"–"})]})}),n.jsx(rt,{className:"w-80",align:"start",children:n.jsx(he,{entry:s})})]}),u===v&&n.jsx("div",{className:"bg-muted/20 border-t px-4 py-2",children:n.jsx(he,{entry:s,showSource:!0})})]},v)},e[55]=u,e[56]=i,e[57]=k,e[58]=ee):ee=e[58],y=me.map(ee),e[4]=t,e[5]=u,e[6]=c,e[7]=i,e[8]=l,e[9]=x,e[10]=g,e[11]=m,e[12]=f,e[13]=y,e[14]=w,e[15]=S,e[16]=E}else x=e[9],g=e[10],m=e[11],f=e[12],y=e[13],w=e[14],S=e[15],E=e[16];let R;e[59]!==g||e[60]!==m||e[61]!==f||e[62]!==y?(R=n.jsxs("div",{className:g,children:[m,f,y]}),e[59]=g,e[60]=m,e[61]=f,e[62]=y,e[63]=R):R=e[63];let A;return e[64]!==x||e[65]!==R||e[66]!==w||e[67]!==S||e[68]!==E?(A=n.jsxs("div",{className:w,children:[S,E,x,R]}),e[64]=x,e[65]=R,e[66]=w,e[67]=S,e[68]=E,e[69]=A):A=e[69],A}function lt(a){return a.offset+(a.duration??0)}export{Ce as S,xt as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,aK as b,a3 as oe}from"./inertia-
|
|
1
|
+
import{r as i,aK as b,a3 as oe}from"./inertia-Cuyz2ZHO.js";var Ae=Object.defineProperty,Ne=(e,t,n)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(Ne(e,typeof t!="symbol"?t+"":t,n),n);let ke=class{constructor(){Q(this,"current",this.detect()),Q(this,"handoffState","pending"),Q(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},D=new ke;function Pe(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function q(){let e=[],t={addEventListener(n,r,l,s){return n.addEventListener(r,l,s),t.add(()=>n.removeEventListener(r,l,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Pe(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,l){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:l}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=q();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let l of e.splice(r,1))l()}},dispose(){for(let n of e.splice(0))n()}};return t}function de(){let[e]=i.useState(q);return i.useEffect(()=>()=>e.dispose(),[e]),e}let O=(e,t)=>{D.isServer?i.useEffect(e,t):i.useLayoutEffect(e,t)};function pe(e){let t=i.useRef(e);return O(()=>{t.current=e},[e]),t}let $=function(e){let t=pe(e);return b.useCallback((...n)=>t.current(...n),[t])};function X(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function K(e,t,...n){if(e in t){let l=t[e];return typeof l=="function"?l(...n):l}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(l=>`"${l}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,K),r}var me=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(me||{}),T=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(T||{});function he(){let e=He();return i.useCallback(t=>xe({mergeRefs:e,...t}),[e])}function xe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:l,visible:s=!0,name:f,mergeRefs:u}){u=u??Le;let a=ve(t,e);if(s)return M(a,n,r,f,u);let p=l??0;if(p&2){let{static:o=!1,...h}=a;if(o)return M(h,n,r,f,u)}if(p&1){let{unmount:o=!0,...h}=a;return K(o?0:1,{0(){return null},1(){return M({...h,hidden:!0,style:{display:"none"}},n,r,f,u)}})}return M(a,n,r,f,u)}function M(e,t={},n,r,l){let{as:s=n,children:f,refName:u="ref",...a}=W(e,["unmount","static"]),p=e.ref!==void 0?{[u]:e.ref}:{},o=typeof f=="function"?f(t):f;o=ge(o),"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let h={};if(t){let g=!1,d=[];for(let[c,v]of Object.entries(t))typeof v=="boolean"&&(g=!0),v===!0&&d.push(c.replace(/([A-Z])/g,m=>`-${m.toLowerCase()}`));if(g){h["data-headlessui-state"]=d.join(" ");for(let c of d)h[`data-${c}`]=""}}if(x(s)&&(Object.keys(R(a)).length>0||Object.keys(R(h)).length>0))if(!i.isValidElement(o)||Array.isArray(o)&&o.length>1||Ie(o)){if(Object.keys(R(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(R(a)).concat(Object.keys(R(h))).map(g=>` - ${g}`).join(`
|
|
2
2
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(`
|
|
3
3
|
`)].join(`
|
|
4
4
|
`))}else{let g=o.props,d=g?.className,c=typeof d=="function"?(...E)=>X(d(...E),a.className):X(d,a.className),v=c?{className:c}:{},m=ve(o.props,R(W(a,["ref"])));for(let E in h)E in m&&delete h[E];return i.cloneElement(o,Object.assign({},m,h,p,{ref:l(Ue(o),p.ref)},v))}return i.createElement(s,Object.assign({},W(a,["ref"]),!x(s)&&p,!x(s)&&h),o)}function He(){let e=i.useRef([]),t=i.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Le(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function ve(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let l in r)l.startsWith("on")&&typeof r[l]=="function"?(n[l]!=null||(n[l]=[]),n[l].push(r[l])):t[l]=r[l];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[l=>{var s;return(s=l?.preventDefault)==null?void 0:s.call(l)}]);for(let r in n)Object.assign(t,{[r](l,...s){let f=n[r];for(let u of f){if((l instanceof Event||l?.nativeEvent instanceof Event)&&l.defaultPrevented)return;u(l,...s)}}});return t}function ee(e){var t;return Object.assign(i.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function R(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function W(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Ue(e){return b.version.split(".")[0]>="19"?e.props.ref:e.ref}function ge(e){if(e!=null&&e.$$typeof===Symbol.for("react.lazy")){let t=e._payload;if(t!=null&&t.status==="fulfilled")return ge(t.value)}return e}function x(e){return e===i.Fragment||e===Symbol.for("react.fragment")}function Ie(e){return x(e.type)}let Me=Symbol();function ye(...e){let t=i.useRef(e);i.useEffect(()=>{t.current=e},[e]);let n=$(r=>{for(let l of t.current)l!=null&&(typeof l=="function"?l(r):l.current=r)});return e.every(r=>r==null||r?.[Me])?void 0:n}function De(e=0){let[t,n]=i.useState(e),r=i.useCallback(a=>n(a),[]),l=i.useCallback(a=>n(p=>p|a),[]),s=i.useCallback(a=>(t&a)===a,[t]),f=i.useCallback(a=>n(p=>p&~a),[]),u=i.useCallback(a=>n(p=>p^a),[]);return{flags:t,setFlag:r,addFlag:l,hasFlag:s,removeFlag:f,toggleFlag:u}}var qe={},fe,ce;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((fe=process==null?void 0:qe)==null?void 0:fe.NODE_ENV)==="test"&&typeof((ce=Element?.prototype)==null?void 0:ce.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as i,c as l,r as p}from"./inertia-
|
|
1
|
+
import{B as i,c as l,r as p}from"./inertia-Cuyz2ZHO.js";const u=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],f=i("copy",u);function x(){const e=l.c(3),[o,c]=p.useState(null);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async a=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),c(a),!0}catch(s){return console.warn("Copy failed",s),c(null),!1}},e[0]=t):t=e[0];const n=t;let r;return e[1]!==o?(r=[o,n],e[1]=o,e[2]=r):r=e[2],r}export{f as C,x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,c as nt,e as it}from"./inertia-CqnzqPVD.js";var C={logger:typeof console<"u"?console:void 0,WebSocket:typeof WebSocket<"u"?WebSocket:void 0},i={log(...n){this.enabled&&(n.push(Date.now()),C.logger.log("[ActionCable]",...n))}};const g=()=>new Date().getTime(),k=n=>(g()-n)/1e3;class x{constructor(t){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=t,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=g(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),i.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=g(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),i.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordMessage(){this.pingedAt=g()}recordConnect(){this.reconnectAttempts=0,delete this.disconnectedAt,i.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=g(),i.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout((()=>{this.reconnectIfStale(),this.poll()}),this.getPollInterval())}getPollInterval(){const{staleThreshold:t,reconnectionBackoffRate:e}=this.constructor,s=Math.pow(1+e,Math.min(this.reconnectAttempts,10)),r=(this.reconnectAttempts===0?1:e)*Math.random();return t*1e3*s*(1+r)}reconnectIfStale(){this.connectionIsStale()&&(i.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${k(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?i.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${k(this.disconnectedAt)} s`):(i.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return k(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&k(this.disconnectedAt)<this.constructor.staleThreshold}visibilityDidChange(){document.visibilityState==="visible"&&setTimeout((()=>{(this.connectionIsStale()||!this.connection.isOpen())&&(i.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())}),200)}}x.staleThreshold=6;x.reconnectionBackoffRate=.15;var V={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]};const{message_types:p,protocols:W}=V,st=W.slice(0,W.length-1),F=[].indexOf;class j{constructor(t){this.open=this.open.bind(this),this.consumer=t,this.subscriptions=this.consumer.subscriptions,this.monitor=new x(this),this.disconnected=!0}send(t){return this.isOpen()?(this.webSocket.send(JSON.stringify(t)),!0):!1}open(){if(this.isActive())return i.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{const t=[...W,...this.consumer.subprotocols||[]];return i.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${t}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new C.WebSocket(this.consumer.url,t),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:t}={allowReconnect:!0}){if(t||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(i.log(`Reopening WebSocket, current state is ${this.getState()}`),this.isActive())try{return this.close()}catch(t){i.log("Failed to reopen WebSocket",t)}finally{i.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}else return this.open()}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return F.call(st,this.getProtocol())>=0}isState(...t){return F.call(t,this.getState())>=0}getState(){if(this.webSocket){for(let t in C.WebSocket)if(C.WebSocket[t]===this.webSocket.readyState)return t.toLowerCase()}return null}installEventHandlers(){for(let t in this.events){const e=this.events[t].bind(this);this.webSocket[`on${t}`]=e}}uninstallEventHandlers(){for(let t in this.events)this.webSocket[`on${t}`]=function(){}}}j.reopenDelay=500;j.prototype.events={message(n){if(!this.isProtocolSupported())return;const{identifier:t,message:e,reason:s,reconnect:o,type:r}=JSON.parse(n.data);switch(this.monitor.recordMessage(),r){case p.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case p.disconnect:return i.log(`Disconnecting. Reason: ${s}`),this.close({allowReconnect:o});case p.ping:return null;case p.confirmation:return this.subscriptions.confirmSubscription(t),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(t,"connected",{reconnected:!0})):this.subscriptions.notify(t,"connected",{reconnected:!1});case p.rejection:return this.subscriptions.reject(t);default:return this.subscriptions.notify(t,"received",e)}},open(){if(i.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return i.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(n){if(i.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){i.log("WebSocket onerror event")}};const ot=function(n,t){if(t!=null)for(let e in t){const s=t[e];n[e]=s}return n};class rt{constructor(t,e={},s){this.consumer=t,this.identifier=JSON.stringify(e),ot(this,s)}perform(t,e={}){return e.action=t,this.send(e)}send(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}class ct{constructor(t){this.subscriptions=t,this.pendingSubscriptions=[]}guarantee(t){this.pendingSubscriptions.indexOf(t)==-1?(i.log(`SubscriptionGuarantor guaranteeing ${t.identifier}`),this.pendingSubscriptions.push(t)):i.log(`SubscriptionGuarantor already guaranteeing ${t.identifier}`),this.startGuaranteeing()}forget(t){i.log(`SubscriptionGuarantor forgetting ${t.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter((e=>e!==t))}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout((()=>{this.subscriptions&&typeof this.subscriptions.subscribe=="function"&&this.pendingSubscriptions.map((t=>{i.log(`SubscriptionGuarantor resubscribing ${t.identifier}`),this.subscriptions.subscribe(t)}))}),500)}}class lt{constructor(t){this.consumer=t,this.guarantor=new ct(this),this.subscriptions=[]}create(t,e){const s=t,o=typeof s=="object"?s:{channel:s},r=new rt(this.consumer,o,e);return this.add(r)}add(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.subscribe(t),t}remove(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t}reject(t){return this.findAll(t).map((e=>(this.forget(e),this.notify(e,"rejected"),e)))}forget(t){return this.guarantor.forget(t),this.subscriptions=this.subscriptions.filter((e=>e!==t)),t}findAll(t){return this.subscriptions.filter((e=>e.identifier===t))}reload(){return this.subscriptions.map((t=>this.subscribe(t)))}notifyAll(t,...e){return this.subscriptions.map((s=>this.notify(s,t,...e)))}notify(t,e,...s){let o;return typeof t=="string"?o=this.findAll(t):o=[t],o.map((r=>typeof r[e]=="function"?r[e](...s):void 0))}subscribe(t){this.sendCommand(t,"subscribe")&&this.guarantor.guarantee(t)}confirmSubscription(t){i.log(`Subscription confirmed ${t}`),this.findAll(t).map((e=>this.guarantor.forget(e)))}sendCommand(t,e){const{identifier:s}=t;return this.consumer.send({command:e,identifier:s})}}class ut{constructor(t){this._url=t,this.subscriptions=new lt(this),this.connection=new j(this),this.subprotocols=[]}get url(){return at(this._url)}send(t){return this.connection.send(t)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(t){this.subprotocols=[...this.subprotocols,t]}}function at(n){if(typeof n=="function"&&(n=n()),n&&!/^wss?:/i.test(n)){const t=document.createElement("a");return t.href=n,t.href=t.href,t.protocol=t.protocol.replace("http","ws"),t.href}else return n}function ht(n=dt("url")||V.default_mount_path){return new ut(n)}function dt(n){const t=document.head.querySelector(`meta[name='action-cable-${n}']`);if(t)return t.getAttribute("content")}let U;function ft(){return U??=ht(),U}const pt=5e3,q="railwatch:live-paused";let L=!1;const O=new Set;function z(n){if(L!==n){L=n;for(const t of O)t()}}function gt(n){return O.add(n),()=>{O.delete(n)}}function Rt(){return c.useSyncExternalStore(gt,bt,mt)}function mt(){return!1}function bt(){return L}function kt(n,t){const e=nt.c(19);let s;e[0]!==t?(s={},e[0]=t,e[1]=s):s=e[1];const{only:o,onEvent:r}=s,[u,T]=c.useState(!1),[E,G]=c.useState(null),[_,N]=c.useState(null),[K,Y]=c.useState(n);K!==n&&(Y(n),T(!1),G(null),N(null));const[l,Q]=c.useState(At),I=c.useRef(o),H=c.useRef(r),$=c.useRef(l);let m;e[2]!==r||e[3]!==o||e[4]!==l?(m=()=>{I.current=o,H.current=r,$.current=l},e[2]=r,e[3]=o,e[4]=l,e[5]=m):m=e[5],c.useEffect(m);const P=c.useRef(vt);let b,S;e[6]!==u||e[7]!==l?(b=()=>(z(u&&!l),yt),S=[u,l],e[6]=u,e[7]=l,e[8]=b,e[9]=S):(b=e[8],S=e[9]),c.useEffect(b,S);let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=function(h){$.current=h,localStorage.setItem(q,h?"1":"0"),Q(h),P.current()},e[10]=y):y=e[10];const X=y;let v,A;e[11]!==n?(v=()=>{let a=!1,h=!1,D=!1,J=-1/0,R,M;const Z=function(){h=!1,D=!0,J=Date.now(),it.reload({only:I.current,onCancelToken:et=>{M=()=>et.cancel()},onSuccess:()=>{a||N(Date.now())},onFinish:()=>{M=void 0,D=!1,f()}})};function f(){if(clearTimeout(R),R=void 0,a||!h||D||$.current||document.visibilityState!=="visible")return;const d=pt-(Date.now()-J);d>0?R=setTimeout(f,d):Z()}const B=function(){f()};document.addEventListener("visibilitychange",B),P.current=f;const tt=ft().subscriptions.create({channel:"EnvironmentChannel",id:n},{connected:()=>{a||T(!0)},disconnected:()=>{a||T(!1)},received:d=>{a||(G(Date.now()),H.current?.(d),h=!0,f())}});return()=>{a=!0,M?.(),clearTimeout(R),P.current=St,document.removeEventListener("visibilitychange",B),tt.unsubscribe()}},A=[n],e[11]=n,e[12]=v,e[13]=A):(v=e[12],A=e[13]),c.useEffect(v,A);let w;return e[14]!==u||e[15]!==E||e[16]!==_||e[17]!==l?(w={connected:u,lastEventAt:E,lastRefreshedAt:_,paused:l,setPaused:X},e[14]=u,e[15]=E,e[16]=_,e[17]=l,e[18]=w):w=e[18],w}function St(){}function yt(){return z(!1)}function vt(){}function At(){return typeof window>"u"?!1:localStorage.getItem(q)==="1"}export{Rt as a,kt as u};
|
|
1
|
+
import{r as c,c as nt,e as it}from"./inertia-Cuyz2ZHO.js";var C={logger:typeof console<"u"?console:void 0,WebSocket:typeof WebSocket<"u"?WebSocket:void 0},i={log(...n){this.enabled&&(n.push(Date.now()),C.logger.log("[ActionCable]",...n))}};const g=()=>new Date().getTime(),k=n=>(g()-n)/1e3;class x{constructor(t){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=t,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=g(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),i.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=g(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),i.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordMessage(){this.pingedAt=g()}recordConnect(){this.reconnectAttempts=0,delete this.disconnectedAt,i.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=g(),i.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout((()=>{this.reconnectIfStale(),this.poll()}),this.getPollInterval())}getPollInterval(){const{staleThreshold:t,reconnectionBackoffRate:e}=this.constructor,s=Math.pow(1+e,Math.min(this.reconnectAttempts,10)),r=(this.reconnectAttempts===0?1:e)*Math.random();return t*1e3*s*(1+r)}reconnectIfStale(){this.connectionIsStale()&&(i.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${k(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?i.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${k(this.disconnectedAt)} s`):(i.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return k(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&k(this.disconnectedAt)<this.constructor.staleThreshold}visibilityDidChange(){document.visibilityState==="visible"&&setTimeout((()=>{(this.connectionIsStale()||!this.connection.isOpen())&&(i.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())}),200)}}x.staleThreshold=6;x.reconnectionBackoffRate=.15;var V={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]};const{message_types:p,protocols:W}=V,st=W.slice(0,W.length-1),F=[].indexOf;class j{constructor(t){this.open=this.open.bind(this),this.consumer=t,this.subscriptions=this.consumer.subscriptions,this.monitor=new x(this),this.disconnected=!0}send(t){return this.isOpen()?(this.webSocket.send(JSON.stringify(t)),!0):!1}open(){if(this.isActive())return i.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{const t=[...W,...this.consumer.subprotocols||[]];return i.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${t}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new C.WebSocket(this.consumer.url,t),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:t}={allowReconnect:!0}){if(t||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(i.log(`Reopening WebSocket, current state is ${this.getState()}`),this.isActive())try{return this.close()}catch(t){i.log("Failed to reopen WebSocket",t)}finally{i.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}else return this.open()}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return F.call(st,this.getProtocol())>=0}isState(...t){return F.call(t,this.getState())>=0}getState(){if(this.webSocket){for(let t in C.WebSocket)if(C.WebSocket[t]===this.webSocket.readyState)return t.toLowerCase()}return null}installEventHandlers(){for(let t in this.events){const e=this.events[t].bind(this);this.webSocket[`on${t}`]=e}}uninstallEventHandlers(){for(let t in this.events)this.webSocket[`on${t}`]=function(){}}}j.reopenDelay=500;j.prototype.events={message(n){if(!this.isProtocolSupported())return;const{identifier:t,message:e,reason:s,reconnect:o,type:r}=JSON.parse(n.data);switch(this.monitor.recordMessage(),r){case p.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case p.disconnect:return i.log(`Disconnecting. Reason: ${s}`),this.close({allowReconnect:o});case p.ping:return null;case p.confirmation:return this.subscriptions.confirmSubscription(t),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(t,"connected",{reconnected:!0})):this.subscriptions.notify(t,"connected",{reconnected:!1});case p.rejection:return this.subscriptions.reject(t);default:return this.subscriptions.notify(t,"received",e)}},open(){if(i.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return i.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(n){if(i.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){i.log("WebSocket onerror event")}};const ot=function(n,t){if(t!=null)for(let e in t){const s=t[e];n[e]=s}return n};class rt{constructor(t,e={},s){this.consumer=t,this.identifier=JSON.stringify(e),ot(this,s)}perform(t,e={}){return e.action=t,this.send(e)}send(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}class ct{constructor(t){this.subscriptions=t,this.pendingSubscriptions=[]}guarantee(t){this.pendingSubscriptions.indexOf(t)==-1?(i.log(`SubscriptionGuarantor guaranteeing ${t.identifier}`),this.pendingSubscriptions.push(t)):i.log(`SubscriptionGuarantor already guaranteeing ${t.identifier}`),this.startGuaranteeing()}forget(t){i.log(`SubscriptionGuarantor forgetting ${t.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter((e=>e!==t))}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout((()=>{this.subscriptions&&typeof this.subscriptions.subscribe=="function"&&this.pendingSubscriptions.map((t=>{i.log(`SubscriptionGuarantor resubscribing ${t.identifier}`),this.subscriptions.subscribe(t)}))}),500)}}class lt{constructor(t){this.consumer=t,this.guarantor=new ct(this),this.subscriptions=[]}create(t,e){const s=t,o=typeof s=="object"?s:{channel:s},r=new rt(this.consumer,o,e);return this.add(r)}add(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.subscribe(t),t}remove(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t}reject(t){return this.findAll(t).map((e=>(this.forget(e),this.notify(e,"rejected"),e)))}forget(t){return this.guarantor.forget(t),this.subscriptions=this.subscriptions.filter((e=>e!==t)),t}findAll(t){return this.subscriptions.filter((e=>e.identifier===t))}reload(){return this.subscriptions.map((t=>this.subscribe(t)))}notifyAll(t,...e){return this.subscriptions.map((s=>this.notify(s,t,...e)))}notify(t,e,...s){let o;return typeof t=="string"?o=this.findAll(t):o=[t],o.map((r=>typeof r[e]=="function"?r[e](...s):void 0))}subscribe(t){this.sendCommand(t,"subscribe")&&this.guarantor.guarantee(t)}confirmSubscription(t){i.log(`Subscription confirmed ${t}`),this.findAll(t).map((e=>this.guarantor.forget(e)))}sendCommand(t,e){const{identifier:s}=t;return this.consumer.send({command:e,identifier:s})}}class ut{constructor(t){this._url=t,this.subscriptions=new lt(this),this.connection=new j(this),this.subprotocols=[]}get url(){return at(this._url)}send(t){return this.connection.send(t)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(t){this.subprotocols=[...this.subprotocols,t]}}function at(n){if(typeof n=="function"&&(n=n()),n&&!/^wss?:/i.test(n)){const t=document.createElement("a");return t.href=n,t.href=t.href,t.protocol=t.protocol.replace("http","ws"),t.href}else return n}function ht(n=dt("url")||V.default_mount_path){return new ut(n)}function dt(n){const t=document.head.querySelector(`meta[name='action-cable-${n}']`);if(t)return t.getAttribute("content")}let U;function ft(){return U??=ht(),U}const pt=5e3,q="railwatch:live-paused";let L=!1;const O=new Set;function z(n){if(L!==n){L=n;for(const t of O)t()}}function gt(n){return O.add(n),()=>{O.delete(n)}}function Rt(){return c.useSyncExternalStore(gt,bt,mt)}function mt(){return!1}function bt(){return L}function kt(n,t){const e=nt.c(19);let s;e[0]!==t?(s={},e[0]=t,e[1]=s):s=e[1];const{only:o,onEvent:r}=s,[u,T]=c.useState(!1),[E,G]=c.useState(null),[_,N]=c.useState(null),[K,Y]=c.useState(n);K!==n&&(Y(n),T(!1),G(null),N(null));const[l,Q]=c.useState(At),I=c.useRef(o),H=c.useRef(r),$=c.useRef(l);let m;e[2]!==r||e[3]!==o||e[4]!==l?(m=()=>{I.current=o,H.current=r,$.current=l},e[2]=r,e[3]=o,e[4]=l,e[5]=m):m=e[5],c.useEffect(m);const P=c.useRef(vt);let b,S;e[6]!==u||e[7]!==l?(b=()=>(z(u&&!l),yt),S=[u,l],e[6]=u,e[7]=l,e[8]=b,e[9]=S):(b=e[8],S=e[9]),c.useEffect(b,S);let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=function(h){$.current=h,localStorage.setItem(q,h?"1":"0"),Q(h),P.current()},e[10]=y):y=e[10];const X=y;let v,A;e[11]!==n?(v=()=>{let a=!1,h=!1,D=!1,J=-1/0,R,M;const Z=function(){h=!1,D=!0,J=Date.now(),it.reload({only:I.current,onCancelToken:et=>{M=()=>et.cancel()},onSuccess:()=>{a||N(Date.now())},onFinish:()=>{M=void 0,D=!1,f()}})};function f(){if(clearTimeout(R),R=void 0,a||!h||D||$.current||document.visibilityState!=="visible")return;const d=pt-(Date.now()-J);d>0?R=setTimeout(f,d):Z()}const B=function(){f()};document.addEventListener("visibilitychange",B),P.current=f;const tt=ft().subscriptions.create({channel:"EnvironmentChannel",id:n},{connected:()=>{a||T(!0)},disconnected:()=>{a||T(!1)},received:d=>{a||(G(Date.now()),H.current?.(d),h=!0,f())}});return()=>{a=!0,M?.(),clearTimeout(R),P.current=St,document.removeEventListener("visibilitychange",B),tt.unsubscribe()}},A=[n],e[11]=n,e[12]=v,e[13]=A):(v=e[12],A=e[13]),c.useEffect(v,A);let w;return e[14]!==u||e[15]!==E||e[16]!==_||e[17]!==l?(w={connected:u,lastEventAt:E,lastRefreshedAt:_,paused:l,setPaused:X},e[14]=u,e[15]=E,e[16]=_,e[17]=l,e[18]=w):w=e[18],w}function St(){}function yt(){return z(!1)}function vt(){}function At(){return typeof window>"u"?!1:localStorage.getItem(q)==="1"}export{Rt as a,kt as u};
|