railwatch 0.9.1 → 0.9.2
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/CHANGELOG.md +11 -0
- data/app/frontend/components/railwatch/stat.tsx +13 -1
- data/app/frontend/hooks/use-live.ts +26 -0
- data/lib/railwatch/version.rb +1 -1
- data/public/railwatch/assets/{app-layout-LvxN9xSS.js → app-layout-CpEbDy93.js} +1 -1
- data/public/railwatch/assets/{arrow-up-DG01k9AL.js → arrow-up-DAODKT5N.js} +1 -1
- data/public/railwatch/assets/{braces-C3w7pfxS.js → braces-DgB4bqp0.js} +1 -1
- data/public/railwatch/assets/{card-Dpwlr0uY.js → card-C4EFUWG1.js} +1 -1
- data/public/railwatch/assets/{chart-DJHv3R7W.js → chart-CD6EHDjG.js} +1 -1
- data/public/railwatch/assets/{chart-hover-CEH-DtXO.js → chart-hover-B5cFOZ24.js} +1 -1
- data/public/railwatch/assets/{chart-panel-CUdIzJvk.js → chart-panel-XD8qJDmg.js} +1 -1
- data/public/railwatch/assets/{code-BRZprwun.js → code-CuTKEYtT.js} +1 -1
- data/public/railwatch/assets/{copy-id-CwhGGiwF.js → copy-id-COM9oXfT.js} +1 -1
- data/public/railwatch/assets/{cursor-load-more-uF1_955Q.js → cursor-load-more-CleS4nD4.js} +1 -1
- data/public/railwatch/assets/{data-table-DYi-N0hm.js → data-table-Bzj8zcao.js} +1 -1
- data/public/railwatch/assets/{env-layout-HdcOaPPX.js → env-layout-Dic4A8Kn.js} +1 -1
- data/public/railwatch/assets/{execution-path-CElXXFO_.js → execution-path-C7Up9w4e.js} +1 -1
- data/public/railwatch/assets/{filter-bar-DEv0G_34.js → filter-bar-B5wbix1y.js} +1 -1
- data/public/railwatch/assets/{flamegraph-SKD9yxW9.js → flamegraph-Dve4TVkl.js} +1 -1
- data/public/railwatch/assets/{frames-CUpyJQDy.js → frames-CkDFkUhi.js} +1 -1
- data/public/railwatch/assets/{index-HRXGir-0.js → index-0glo-UpF.js} +1 -1
- data/public/railwatch/assets/{index-CvqfEExO.js → index-6t2RLBwA.js} +1 -1
- data/public/railwatch/assets/{index-CjxXgOs-.js → index-7fYWYI1v.js} +1 -1
- data/public/railwatch/assets/{index-CiRMSYMn.js → index-B2hTf0w6.js} +1 -1
- data/public/railwatch/assets/{index-74ocuU5d.js → index-B51WiPQg.js} +1 -1
- data/public/railwatch/assets/{index-BxCXBHP2.js → index-BA3nScnV.js} +1 -1
- data/public/railwatch/assets/{index-CIaZkokF.js → index-BheGBdI9.js} +1 -1
- data/public/railwatch/assets/{index-d-3J7gQ5.js → index-BxSwNl8H.js} +1 -1
- data/public/railwatch/assets/{index-BBCEkLqp.js → index-CEcv5bba.js} +1 -1
- data/public/railwatch/assets/{index-CEetm4oC.js → index-CG7VCShP.js} +1 -1
- data/public/railwatch/assets/{index-ClL-PYEV.js → index-CXSEiNWw.js} +1 -1
- data/public/railwatch/assets/{index-B_KFb9LS.js → index-C_3JsXHv.js} +1 -1
- data/public/railwatch/assets/{index-DJd3OUSd.js → index-CgoVIV-m.js} +1 -1
- data/public/railwatch/assets/{index-C1jc1OoH.js → index-CnlT_aCL.js} +1 -1
- data/public/railwatch/assets/{index-DPD-rLp6.js → index-D7t5pSOT.js} +1 -1
- data/public/railwatch/assets/{index-CteZ6fop.js → index-DJZkxYZf.js} +1 -1
- data/public/railwatch/assets/{index-Ce4SB5AB.js → index-DKwz3gSX.js} +1 -1
- data/public/railwatch/assets/{index-CNH85TZp.js → index-DTLmaJha.js} +1 -1
- data/public/railwatch/assets/{index-UJOUALr_.js → index-D_dUD6LY.js} +1 -1
- data/public/railwatch/assets/{index-BqK_VKom.js → index-Dj03Gham.js} +1 -1
- data/public/railwatch/assets/{index-DrayARrI.js → index-DqeNWrJc.js} +1 -1
- data/public/railwatch/assets/{index-oQrvBpOm.js → index-DwGETVLb.js} +1 -1
- data/public/railwatch/assets/{index-CxTLT-Qh.js → index-Dx7oNB2j.js} +1 -1
- data/public/railwatch/assets/{index-BDcglJzX.js → index-Kxpc-Jju.js} +1 -1
- data/public/railwatch/assets/{index-B8NA62Lz.js → index-YqmR-RY4.js} +1 -1
- data/public/railwatch/assets/{index-2W-ppwap.js → index-kX9K5M8z.js} +1 -1
- data/public/railwatch/assets/{index-DYK_dps4.js → index-wH-xxmJK.js} +1 -1
- data/public/railwatch/assets/{index-C7zREldp.js → index-x18ma-AF.js} +1 -1
- data/public/railwatch/assets/{inertia-FoqYZAk8.js → inertia-b7M33AzA.js} +2 -2
- data/public/railwatch/assets/{json-viewer-CxqMojEm.js → json-viewer-C0RZwcC2.js} +1 -1
- data/public/railwatch/assets/{klass-DEF-Vat5.js → klass-BT-gRTuY.js} +1 -1
- data/public/railwatch/assets/{origin-identity-Y6gvfQVR.js → origin-identity-ouOEvOlq.js} +1 -1
- data/public/railwatch/assets/{percentile-picker-E2aUdLxx.js → percentile-picker-BYFo11OE.js} +1 -1
- data/public/railwatch/assets/{relative-time-DcJbkKlN.js → relative-time-CJX4HXBB.js} +1 -1
- data/public/railwatch/assets/{release-health-C8WSCDKD.js → release-health-CIxeXQ_e.js} +1 -1
- data/public/railwatch/assets/{route-qO5vX1p-.js → route-eUFnanVO.js} +1 -1
- data/public/railwatch/assets/{segmented-BWee8uc9.js → segmented-CJq8WOHZ.js} +1 -1
- data/public/railwatch/assets/{select-G7rNBzv0.js → select-vYjStP1q.js} +1 -1
- data/public/railwatch/assets/{series-chart-C5nXIUc5.js → series-chart-FBOfRLhK.js} +1 -1
- data/public/railwatch/assets/{show-CTO8Lvd2.js → show-BBNCHyV9.js} +1 -1
- data/public/railwatch/assets/{show-Nfpxs8su.js → show-BJcTlqdU.js} +1 -1
- data/public/railwatch/assets/{show-CH7yxt7R.js → show-Bq4w9YtT.js} +1 -1
- data/public/railwatch/assets/{show-DyzHM527.js → show-C5SMVt6Z.js} +1 -1
- data/public/railwatch/assets/{show-BEa9PGu1.js → show-C7w8Tnt2.js} +1 -1
- data/public/railwatch/assets/{show-ddjUMo9G.js → show-D7fBqLw0.js} +1 -1
- data/public/railwatch/assets/{show-DnYsDMUt.js → show-DGPuUSHE.js} +1 -1
- data/public/railwatch/assets/{show-ksjbSzDH.js → show-DNY79oEl.js} +1 -1
- data/public/railwatch/assets/{show-BpCO49d3.js → show-DeTnRall.js} +1 -1
- data/public/railwatch/assets/{show-BiT_Aloc.js → show-daCAn8qV.js} +1 -1
- data/public/railwatch/assets/{show-BEWisLQw.js → show-zaB17ZGC.js} +1 -1
- data/public/railwatch/assets/{sort-header-uOq5VlrB.js → sort-header-dslBMND2.js} +1 -1
- data/public/railwatch/assets/{sparkline-cell-DgGij0cu.js → sparkline-cell-C7fhjJby.js} +1 -1
- data/public/railwatch/assets/stat-nY8iS5q9.js +1 -0
- data/public/railwatch/assets/{status-badge-BDkOXa-C.js → status-badge-D40D8TiV.js} +1 -1
- data/public/railwatch/assets/{tenant-path-DU0ezKSU.js → tenant-path-UhieazCc.js} +1 -1
- data/public/railwatch/assets/{use-clipboard-DoENmlWY.js → use-clipboard-T9kCBcs8.js} +1 -1
- data/public/railwatch/assets/use-live-rp6jfGac.js +1 -0
- data/public/railwatch/manifest.json +611 -611
- metadata +74 -74
- data/public/railwatch/assets/stat-BTzNKTm2.js +0 -1
- data/public/railwatch/assets/use-live-CE_fN5_6.js +0 -1
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: railwatch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cole Robertson
|
|
@@ -502,82 +502,82 @@ files:
|
|
|
502
502
|
- public/railwatch/assets/Roboto-Bold-CJLnO8j1.woff2
|
|
503
503
|
- public/railwatch/assets/Roboto-Medium-Cm2bwKpj.woff2
|
|
504
504
|
- public/railwatch/assets/Roboto-Regular-Chaq1-PV.woff2
|
|
505
|
-
- public/railwatch/assets/app-layout-
|
|
505
|
+
- public/railwatch/assets/app-layout-CpEbDy93.js
|
|
506
506
|
- public/railwatch/assets/application-Cc5v_Vk9.css
|
|
507
|
-
- public/railwatch/assets/arrow-up-
|
|
508
|
-
- public/railwatch/assets/braces-
|
|
509
|
-
- public/railwatch/assets/card-
|
|
510
|
-
- public/railwatch/assets/chart-
|
|
511
|
-
- public/railwatch/assets/chart-hover-
|
|
512
|
-
- public/railwatch/assets/chart-panel-
|
|
513
|
-
- public/railwatch/assets/code-
|
|
514
|
-
- public/railwatch/assets/copy-id-
|
|
515
|
-
- public/railwatch/assets/cursor-load-more-
|
|
516
|
-
- public/railwatch/assets/data-table-
|
|
517
|
-
- public/railwatch/assets/env-layout-
|
|
518
|
-
- public/railwatch/assets/execution-path-
|
|
519
|
-
- public/railwatch/assets/filter-bar-
|
|
520
|
-
- public/railwatch/assets/flamegraph-
|
|
507
|
+
- public/railwatch/assets/arrow-up-DAODKT5N.js
|
|
508
|
+
- public/railwatch/assets/braces-DgB4bqp0.js
|
|
509
|
+
- public/railwatch/assets/card-C4EFUWG1.js
|
|
510
|
+
- public/railwatch/assets/chart-CD6EHDjG.js
|
|
511
|
+
- public/railwatch/assets/chart-hover-B5cFOZ24.js
|
|
512
|
+
- public/railwatch/assets/chart-panel-XD8qJDmg.js
|
|
513
|
+
- public/railwatch/assets/code-CuTKEYtT.js
|
|
514
|
+
- public/railwatch/assets/copy-id-COM9oXfT.js
|
|
515
|
+
- public/railwatch/assets/cursor-load-more-CleS4nD4.js
|
|
516
|
+
- public/railwatch/assets/data-table-Bzj8zcao.js
|
|
517
|
+
- public/railwatch/assets/env-layout-Dic4A8Kn.js
|
|
518
|
+
- public/railwatch/assets/execution-path-C7Up9w4e.js
|
|
519
|
+
- public/railwatch/assets/filter-bar-B5wbix1y.js
|
|
520
|
+
- public/railwatch/assets/flamegraph-Dve4TVkl.js
|
|
521
521
|
- public/railwatch/assets/format-B9SDkrWj.js
|
|
522
|
-
- public/railwatch/assets/frames-
|
|
523
|
-
- public/railwatch/assets/index-
|
|
524
|
-
- public/railwatch/assets/index-
|
|
525
|
-
- public/railwatch/assets/index-
|
|
526
|
-
- public/railwatch/assets/index-
|
|
527
|
-
- public/railwatch/assets/index-
|
|
528
|
-
- public/railwatch/assets/index-
|
|
529
|
-
- public/railwatch/assets/index-
|
|
530
|
-
- public/railwatch/assets/index-
|
|
531
|
-
- public/railwatch/assets/index-
|
|
532
|
-
- public/railwatch/assets/index-
|
|
533
|
-
- public/railwatch/assets/index-
|
|
534
|
-
- public/railwatch/assets/index-
|
|
535
|
-
- public/railwatch/assets/index-
|
|
536
|
-
- public/railwatch/assets/index-
|
|
537
|
-
- public/railwatch/assets/index-
|
|
538
|
-
- public/railwatch/assets/index-
|
|
539
|
-
- public/railwatch/assets/index-
|
|
540
|
-
- public/railwatch/assets/index-
|
|
541
|
-
- public/railwatch/assets/index-
|
|
542
|
-
- public/railwatch/assets/index-
|
|
543
|
-
- public/railwatch/assets/index-
|
|
544
|
-
- public/railwatch/assets/index-
|
|
545
|
-
- public/railwatch/assets/index-
|
|
546
|
-
- public/railwatch/assets/index-
|
|
547
|
-
- public/railwatch/assets/index-
|
|
548
|
-
- public/railwatch/assets/index-
|
|
549
|
-
- public/railwatch/assets/index-
|
|
550
|
-
- public/railwatch/assets/index-
|
|
551
|
-
- public/railwatch/assets/inertia-
|
|
552
|
-
- public/railwatch/assets/json-viewer-
|
|
553
|
-
- public/railwatch/assets/klass-
|
|
554
|
-
- public/railwatch/assets/origin-identity-
|
|
555
|
-
- public/railwatch/assets/percentile-picker-
|
|
556
|
-
- public/railwatch/assets/relative-time-
|
|
557
|
-
- public/railwatch/assets/release-health-
|
|
558
|
-
- public/railwatch/assets/route-
|
|
559
|
-
- public/railwatch/assets/segmented-
|
|
560
|
-
- public/railwatch/assets/select-
|
|
561
|
-
- public/railwatch/assets/series-chart-
|
|
562
|
-
- public/railwatch/assets/show-
|
|
563
|
-
- public/railwatch/assets/show-
|
|
564
|
-
- public/railwatch/assets/show-
|
|
565
|
-
- public/railwatch/assets/show-
|
|
566
|
-
- public/railwatch/assets/show-
|
|
567
|
-
- public/railwatch/assets/show-
|
|
568
|
-
- public/railwatch/assets/show-
|
|
569
|
-
- public/railwatch/assets/show-
|
|
570
|
-
- public/railwatch/assets/show-
|
|
571
|
-
- public/railwatch/assets/show-
|
|
572
|
-
- public/railwatch/assets/show-
|
|
573
|
-
- public/railwatch/assets/sort-header-
|
|
522
|
+
- public/railwatch/assets/frames-CkDFkUhi.js
|
|
523
|
+
- public/railwatch/assets/index-0glo-UpF.js
|
|
524
|
+
- public/railwatch/assets/index-6t2RLBwA.js
|
|
525
|
+
- public/railwatch/assets/index-7fYWYI1v.js
|
|
526
|
+
- public/railwatch/assets/index-B2hTf0w6.js
|
|
527
|
+
- public/railwatch/assets/index-B51WiPQg.js
|
|
528
|
+
- public/railwatch/assets/index-BA3nScnV.js
|
|
529
|
+
- public/railwatch/assets/index-BheGBdI9.js
|
|
530
|
+
- public/railwatch/assets/index-BxSwNl8H.js
|
|
531
|
+
- public/railwatch/assets/index-CEcv5bba.js
|
|
532
|
+
- public/railwatch/assets/index-CG7VCShP.js
|
|
533
|
+
- public/railwatch/assets/index-CXSEiNWw.js
|
|
534
|
+
- public/railwatch/assets/index-C_3JsXHv.js
|
|
535
|
+
- public/railwatch/assets/index-CgoVIV-m.js
|
|
536
|
+
- public/railwatch/assets/index-CnlT_aCL.js
|
|
537
|
+
- public/railwatch/assets/index-D7t5pSOT.js
|
|
538
|
+
- public/railwatch/assets/index-DJZkxYZf.js
|
|
539
|
+
- public/railwatch/assets/index-DKwz3gSX.js
|
|
540
|
+
- public/railwatch/assets/index-DTLmaJha.js
|
|
541
|
+
- public/railwatch/assets/index-D_dUD6LY.js
|
|
542
|
+
- public/railwatch/assets/index-Dj03Gham.js
|
|
543
|
+
- public/railwatch/assets/index-DqeNWrJc.js
|
|
544
|
+
- public/railwatch/assets/index-DwGETVLb.js
|
|
545
|
+
- public/railwatch/assets/index-Dx7oNB2j.js
|
|
546
|
+
- public/railwatch/assets/index-Kxpc-Jju.js
|
|
547
|
+
- public/railwatch/assets/index-YqmR-RY4.js
|
|
548
|
+
- public/railwatch/assets/index-kX9K5M8z.js
|
|
549
|
+
- public/railwatch/assets/index-wH-xxmJK.js
|
|
550
|
+
- public/railwatch/assets/index-x18ma-AF.js
|
|
551
|
+
- public/railwatch/assets/inertia-b7M33AzA.js
|
|
552
|
+
- public/railwatch/assets/json-viewer-C0RZwcC2.js
|
|
553
|
+
- public/railwatch/assets/klass-BT-gRTuY.js
|
|
554
|
+
- public/railwatch/assets/origin-identity-ouOEvOlq.js
|
|
555
|
+
- public/railwatch/assets/percentile-picker-BYFo11OE.js
|
|
556
|
+
- public/railwatch/assets/relative-time-CJX4HXBB.js
|
|
557
|
+
- public/railwatch/assets/release-health-CIxeXQ_e.js
|
|
558
|
+
- public/railwatch/assets/route-eUFnanVO.js
|
|
559
|
+
- public/railwatch/assets/segmented-CJq8WOHZ.js
|
|
560
|
+
- public/railwatch/assets/select-vYjStP1q.js
|
|
561
|
+
- public/railwatch/assets/series-chart-FBOfRLhK.js
|
|
562
|
+
- public/railwatch/assets/show-BBNCHyV9.js
|
|
563
|
+
- public/railwatch/assets/show-BJcTlqdU.js
|
|
564
|
+
- public/railwatch/assets/show-Bq4w9YtT.js
|
|
565
|
+
- public/railwatch/assets/show-C5SMVt6Z.js
|
|
566
|
+
- public/railwatch/assets/show-C7w8Tnt2.js
|
|
567
|
+
- public/railwatch/assets/show-D7fBqLw0.js
|
|
568
|
+
- public/railwatch/assets/show-DGPuUSHE.js
|
|
569
|
+
- public/railwatch/assets/show-DNY79oEl.js
|
|
570
|
+
- public/railwatch/assets/show-DeTnRall.js
|
|
571
|
+
- public/railwatch/assets/show-daCAn8qV.js
|
|
572
|
+
- public/railwatch/assets/show-zaB17ZGC.js
|
|
573
|
+
- public/railwatch/assets/sort-header-dslBMND2.js
|
|
574
574
|
- public/railwatch/assets/source-link-B2183i2-.js
|
|
575
|
-
- public/railwatch/assets/sparkline-cell-
|
|
576
|
-
- public/railwatch/assets/stat-
|
|
577
|
-
- public/railwatch/assets/status-badge-
|
|
578
|
-
- public/railwatch/assets/tenant-path-
|
|
579
|
-
- public/railwatch/assets/use-clipboard-
|
|
580
|
-
- public/railwatch/assets/use-live-
|
|
575
|
+
- public/railwatch/assets/sparkline-cell-C7fhjJby.js
|
|
576
|
+
- public/railwatch/assets/stat-nY8iS5q9.js
|
|
577
|
+
- public/railwatch/assets/status-badge-D40D8TiV.js
|
|
578
|
+
- public/railwatch/assets/tenant-path-UhieazCc.js
|
|
579
|
+
- public/railwatch/assets/use-clipboard-T9kCBcs8.js
|
|
580
|
+
- public/railwatch/assets/use-live-rp6jfGac.js
|
|
581
581
|
- public/railwatch/icon.png
|
|
582
582
|
- public/railwatch/icon.svg
|
|
583
583
|
- public/railwatch/manifest.json
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as w,j as R,o as C,c as k}from"./inertia-FoqYZAk8.js";import{a as M}from"./use-live-CE_fN5_6.js";import{A as D,a as I}from"./arrow-up-DG01k9AL.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 +0,0 @@
|
|
|
1
|
-
import{r as c,c as nt,d as it}from"./inertia-FoqYZAk8.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};
|