railwatch 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AGENTS.md +42 -26
- data/CHANGELOG.md +41 -0
- data/README.md +40 -29
- data/app/frontend/components/app-content.tsx +26 -0
- data/app/frontend/components/app-logo-icon.tsx +23 -0
- data/app/frontend/components/app-logo.tsx +14 -0
- data/app/frontend/components/app-shell.tsx +38 -0
- data/app/frontend/components/app-sidebar-header.tsx +54 -0
- data/app/frontend/components/app-sidebar.tsx +94 -0
- data/app/frontend/components/app-wordmark.tsx +29 -0
- data/app/frontend/components/breadcrumbs.tsx +46 -0
- data/app/frontend/components/icon.tsx +16 -0
- data/app/frontend/components/input-error.tsx +18 -0
- data/app/frontend/components/nav-footer.tsx +46 -0
- data/app/frontend/components/nav-main.tsx +41 -0
- data/app/frontend/components/nav-user.tsx +50 -0
- data/app/frontend/components/railwatch/chart-hover.tsx +34 -0
- data/app/frontend/components/railwatch/chart-panel.tsx +170 -0
- data/app/frontend/components/railwatch/code.tsx +28 -0
- data/app/frontend/components/railwatch/command-palette.tsx +132 -0
- data/app/frontend/components/railwatch/copy-block.tsx +52 -0
- data/app/frontend/components/railwatch/copy-id.tsx +49 -0
- data/app/frontend/components/railwatch/cursor-load-more.tsx +39 -0
- data/app/frontend/components/railwatch/data-table.tsx +195 -0
- data/app/frontend/components/railwatch/digit-roll.tsx +312 -0
- data/app/frontend/components/railwatch/empty-state.tsx +159 -0
- data/app/frontend/components/railwatch/env-nav.tsx +130 -0
- data/app/frontend/components/railwatch/env-switcher.tsx +145 -0
- data/app/frontend/components/railwatch/filter-bar.tsx +153 -0
- data/app/frontend/components/railwatch/flamegraph.tsx +324 -0
- data/app/frontend/components/railwatch/frames.tsx +295 -0
- data/app/frontend/components/railwatch/json-viewer.tsx +159 -0
- data/app/frontend/components/railwatch/live-dot.tsx +78 -0
- data/app/frontend/components/railwatch/live-toggle.tsx +76 -0
- data/app/frontend/components/railwatch/metric-chart.tsx +112 -0
- data/app/frontend/components/railwatch/mobile-page-switcher.tsx +89 -0
- data/app/frontend/components/railwatch/onboarding.tsx +91 -0
- data/app/frontend/components/railwatch/origin-identity.tsx +84 -0
- data/app/frontend/components/railwatch/page-header.tsx +42 -0
- data/app/frontend/components/railwatch/percentile-picker.tsx +18 -0
- data/app/frontend/components/railwatch/relative-time.tsx +18 -0
- data/app/frontend/components/railwatch/saved-views.tsx +232 -0
- data/app/frontend/components/railwatch/segmented.tsx +64 -0
- data/app/frontend/components/railwatch/series-chart.tsx +400 -0
- data/app/frontend/components/railwatch/shortcuts-dialog.tsx +89 -0
- data/app/frontend/components/railwatch/signal-toast.tsx +121 -0
- data/app/frontend/components/railwatch/sort-header.tsx +37 -0
- data/app/frontend/components/railwatch/source-link.tsx +57 -0
- data/app/frontend/components/railwatch/sparkline-cell.tsx +14 -0
- data/app/frontend/components/railwatch/sql-block.tsx +116 -0
- data/app/frontend/components/railwatch/stat.tsx +173 -0
- data/app/frontend/components/railwatch/status-badge.tsx +79 -0
- data/app/frontend/components/railwatch/step-picker.tsx +57 -0
- data/app/frontend/components/railwatch/timeline.tsx +405 -0
- data/app/frontend/components/railwatch/utilisation-bar.tsx +44 -0
- data/app/frontend/components/railwatch/window-picker.tsx +147 -0
- data/app/frontend/components/ui/avatar.tsx +51 -0
- data/app/frontend/components/ui/badge.tsx +46 -0
- data/app/frontend/components/ui/breadcrumb.tsx +109 -0
- data/app/frontend/components/ui/button.tsx +60 -0
- data/app/frontend/components/ui/card.tsx +92 -0
- data/app/frontend/components/ui/chart.tsx +374 -0
- data/app/frontend/components/ui/checkbox.tsx +32 -0
- data/app/frontend/components/ui/collapsible.tsx +31 -0
- data/app/frontend/components/ui/command.tsx +182 -0
- data/app/frontend/components/ui/dialog.tsx +158 -0
- data/app/frontend/components/ui/dropdown-menu.tsx +255 -0
- data/app/frontend/components/ui/hover-card.tsx +42 -0
- data/app/frontend/components/ui/input.tsx +21 -0
- data/app/frontend/components/ui/label.tsx +24 -0
- data/app/frontend/components/ui/popover.tsx +87 -0
- data/app/frontend/components/ui/select.tsx +185 -0
- data/app/frontend/components/ui/separator.tsx +28 -0
- data/app/frontend/components/ui/sheet.tsx +137 -0
- data/app/frontend/components/ui/sidebar.tsx +726 -0
- data/app/frontend/components/ui/skeleton.tsx +13 -0
- data/app/frontend/components/ui/sonner.tsx +41 -0
- data/app/frontend/components/ui/table.tsx +114 -0
- data/app/frontend/components/ui/tabs.tsx +91 -0
- data/app/frontend/components/ui/textarea.tsx +18 -0
- data/app/frontend/components/ui/tooltip.tsx +61 -0
- data/app/frontend/components/user-info.tsx +32 -0
- data/app/frontend/components/user-menu-content.tsx +94 -0
- data/app/frontend/entrypoints/application.css +244 -0
- data/app/frontend/entrypoints/inertia.tsx +95 -0
- data/app/frontend/fonts/CommitMono-Bold.woff2 +0 -0
- data/app/frontend/fonts/CommitMono-Regular.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Black.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Bold.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Medium.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Regular.woff2 +0 -0
- data/app/frontend/hooks/use-appearance.tsx +67 -0
- data/app/frontend/hooks/use-clipboard.ts +32 -0
- data/app/frontend/hooks/use-flash.tsx +23 -0
- data/app/frontend/hooks/use-hotkeys.ts +63 -0
- data/app/frontend/hooks/use-initials.tsx +15 -0
- data/app/frontend/hooks/use-live.ts +179 -0
- data/app/frontend/hooks/use-mobile-navigation.ts +8 -0
- data/app/frontend/hooks/use-mobile.ts +21 -0
- data/app/frontend/hooks/use-percentile.ts +24 -0
- data/app/frontend/hooks/use-reduced-motion.ts +25 -0
- data/app/frontend/hooks/use-row-nav.ts +106 -0
- data/app/frontend/hooks/use-step.ts +27 -0
- data/app/frontend/hooks/use-ticker.ts +12 -0
- data/app/frontend/hooks/use-window.ts +58 -0
- data/app/frontend/layouts/app/app-sidebar-layout.tsx +107 -0
- data/app/frontend/layouts/app-layout.tsx +21 -0
- data/app/frontend/layouts/env-layout.tsx +53 -0
- data/app/frontend/layouts/persistent-layout.tsx +18 -0
- data/app/frontend/lib/cable.ts +10 -0
- data/app/frontend/lib/env-pages.ts +236 -0
- data/app/frontend/lib/execution-path.ts +55 -0
- data/app/frontend/lib/explain.ts +50 -0
- data/app/frontend/lib/filter.ts +25 -0
- data/app/frontend/lib/flamegraph.ts +155 -0
- data/app/frontend/lib/format.ts +71 -0
- data/app/frontend/lib/keyboard.ts +18 -0
- data/app/frontend/lib/source-link.ts +217 -0
- data/app/frontend/lib/utils.ts +6 -0
- data/app/frontend/pages/alerts/index.tsx +171 -0
- data/app/frontend/pages/broadcasts/index.tsx +171 -0
- data/app/frontend/pages/cache_events/index.tsx +127 -0
- data/app/frontend/pages/commands/index.tsx +143 -0
- data/app/frontend/pages/deploys/index.tsx +94 -0
- data/app/frontend/pages/deploys/show.tsx +309 -0
- data/app/frontend/pages/deprecations/index.tsx +176 -0
- data/app/frontend/pages/exceptions/index.tsx +271 -0
- data/app/frontend/pages/executions/show.tsx +821 -0
- data/app/frontend/pages/issues/index.tsx +399 -0
- data/app/frontend/pages/issues/show.tsx +1367 -0
- data/app/frontend/pages/jobs/index.tsx +381 -0
- data/app/frontend/pages/jobs/klass.tsx +215 -0
- data/app/frontend/pages/llm_calls/index.tsx +664 -0
- data/app/frontend/pages/logs/index.tsx +303 -0
- data/app/frontend/pages/mails/index.tsx +218 -0
- data/app/frontend/pages/notifications/index.tsx +161 -0
- data/app/frontend/pages/outgoing_requests/index.tsx +309 -0
- data/app/frontend/pages/overview/show.tsx +333 -0
- data/app/frontend/pages/people/index.tsx +102 -0
- data/app/frontend/pages/people/show.tsx +149 -0
- data/app/frontend/pages/processes/index.tsx +335 -0
- data/app/frontend/pages/profiles/index.tsx +110 -0
- data/app/frontend/pages/profiles/show.tsx +105 -0
- data/app/frontend/pages/queries/index.tsx +492 -0
- data/app/frontend/pages/queries/show.tsx +276 -0
- data/app/frontend/pages/releases/index.tsx +190 -0
- data/app/frontend/pages/releases/release-health.tsx +68 -0
- data/app/frontend/pages/releases/release-path.ts +25 -0
- data/app/frontend/pages/releases/show.tsx +262 -0
- data/app/frontend/pages/requests/index.tsx +235 -0
- data/app/frontend/pages/requests/route.tsx +159 -0
- data/app/frontend/pages/scheduled_tasks/index.tsx +220 -0
- data/app/frontend/pages/spans/index.tsx +229 -0
- data/app/frontend/pages/spans/show.tsx +220 -0
- data/app/frontend/pages/storage_ops/index.tsx +150 -0
- data/app/frontend/pages/tenants/index.tsx +236 -0
- data/app/frontend/pages/tenants/show.tsx +477 -0
- data/app/frontend/pages/tenants/tenant-path.ts +26 -0
- data/app/frontend/pages/thresholds/index.tsx +414 -0
- data/app/frontend/pages/traces/show.tsx +208 -0
- data/app/frontend/pages/transactions/index.tsx +220 -0
- data/app/frontend/pages/view_renders/index.tsx +241 -0
- data/app/frontend/pages/visits/index.tsx +321 -0
- data/app/frontend/public/icon.png +0 -0
- data/app/frontend/public/icon.svg +5 -0
- data/app/frontend/routes/index.d.ts +2136 -0
- data/app/frontend/routes/index.js +2112 -0
- data/app/frontend/types/globals.d.ts +9 -0
- data/app/frontend/types/index.ts +288 -0
- data/app/frontend/types/vite-env.d.ts +9 -0
- 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/lib/railwatch.rb +8 -3
- data/llms.txt +21 -18
- data/public/railwatch/assets/app-layout-LvxN9xSS.js +41 -0
- data/public/railwatch/assets/application-Cc5v_Vk9.css +1 -0
- data/public/railwatch/assets/{arrow-up-EmePsTKP.js → arrow-up-DG01k9AL.js} +1 -1
- data/public/railwatch/assets/{braces-iZ7MEfYP.js → braces-C3w7pfxS.js} +1 -1
- data/public/railwatch/assets/{card-DqdEEKcJ.js → card-Dpwlr0uY.js} +1 -1
- data/public/railwatch/assets/{chart-C4k7Ub9W.js → chart-DJHv3R7W.js} +1 -1
- data/public/railwatch/assets/{chart-hover-2yZG3w2u.js → chart-hover-CEH-DtXO.js} +1 -1
- data/public/railwatch/assets/{chart-panel-CONkZcn9.js → chart-panel-CUdIzJvk.js} +1 -1
- data/public/railwatch/assets/code-BRZprwun.js +1 -0
- data/public/railwatch/assets/copy-id-CwhGGiwF.js +1 -0
- data/public/railwatch/assets/cursor-load-more-uF1_955Q.js +1 -0
- data/public/railwatch/assets/data-table-DYi-N0hm.js +1 -0
- data/public/railwatch/assets/env-layout-HdcOaPPX.js +1 -0
- data/public/railwatch/assets/{execution-path-DWovhgLi.js → execution-path-CElXXFO_.js} +1 -1
- data/public/railwatch/assets/filter-bar-DEv0G_34.js +1 -0
- data/public/railwatch/assets/{flamegraph-BNbNIuKT.js → flamegraph-SKD9yxW9.js} +2 -2
- data/public/railwatch/assets/frames-CUpyJQDy.js +1 -0
- data/public/railwatch/assets/index-2W-ppwap.js +1 -0
- data/public/railwatch/assets/index-74ocuU5d.js +1 -0
- data/public/railwatch/assets/{index-Zkt4W_CM.js → index-B8NA62Lz.js} +2 -2
- data/public/railwatch/assets/index-BBCEkLqp.js +1 -0
- data/public/railwatch/assets/index-BDcglJzX.js +1 -0
- data/public/railwatch/assets/index-B_KFb9LS.js +1 -0
- data/public/railwatch/assets/index-BqK_VKom.js +1 -0
- data/public/railwatch/assets/index-BxCXBHP2.js +1 -0
- data/public/railwatch/assets/index-C1jc1OoH.js +1 -0
- data/public/railwatch/assets/index-C7zREldp.js +1 -0
- data/public/railwatch/assets/index-CEetm4oC.js +1 -0
- data/public/railwatch/assets/index-CIaZkokF.js +1 -0
- data/public/railwatch/assets/index-CNH85TZp.js +1 -0
- data/public/railwatch/assets/index-Ce4SB5AB.js +1 -0
- data/public/railwatch/assets/index-CiRMSYMn.js +1 -0
- data/public/railwatch/assets/index-CjxXgOs-.js +1 -0
- data/public/railwatch/assets/index-ClL-PYEV.js +1 -0
- data/public/railwatch/assets/index-CteZ6fop.js +1 -0
- data/public/railwatch/assets/index-CvqfEExO.js +1 -0
- data/public/railwatch/assets/index-CxTLT-Qh.js +1 -0
- data/public/railwatch/assets/index-DJd3OUSd.js +1 -0
- data/public/railwatch/assets/index-DPD-rLp6.js +1 -0
- data/public/railwatch/assets/index-DYK_dps4.js +1 -0
- data/public/railwatch/assets/index-DrayARrI.js +1 -0
- data/public/railwatch/assets/index-HRXGir-0.js +1 -0
- data/public/railwatch/assets/index-UJOUALr_.js +1 -0
- data/public/railwatch/assets/index-d-3J7gQ5.js +1 -0
- data/public/railwatch/assets/index-oQrvBpOm.js +1 -0
- data/public/railwatch/assets/inertia-FoqYZAk8.js +97 -0
- data/public/railwatch/assets/json-viewer-CxqMojEm.js +1 -0
- data/public/railwatch/assets/klass-DEF-Vat5.js +1 -0
- data/public/railwatch/assets/origin-identity-Y6gvfQVR.js +1 -0
- data/public/railwatch/assets/{percentile-picker-BxIVblBw.js → percentile-picker-E2aUdLxx.js} +1 -1
- data/public/railwatch/assets/relative-time-DcJbkKlN.js +1 -0
- data/public/railwatch/assets/{release-health-Cb1tMOOO.js → release-health-C8WSCDKD.js} +1 -1
- data/public/railwatch/assets/route-qO5vX1p-.js +1 -0
- data/public/railwatch/assets/{segmented-C4oWE73o.js → segmented-BWee8uc9.js} +1 -1
- data/public/railwatch/assets/select-G7rNBzv0.js +1 -0
- data/public/railwatch/assets/series-chart-C5nXIUc5.js +1 -0
- data/public/railwatch/assets/show-BEWisLQw.js +1 -0
- data/public/railwatch/assets/show-BEa9PGu1.js +2 -0
- data/public/railwatch/assets/{show-gtwKsTsl.js → show-BiT_Aloc.js} +3 -3
- data/public/railwatch/assets/show-BpCO49d3.js +1 -0
- data/public/railwatch/assets/show-CH7yxt7R.js +1 -0
- data/public/railwatch/assets/show-CTO8Lvd2.js +1 -0
- data/public/railwatch/assets/show-DnYsDMUt.js +2 -0
- data/public/railwatch/assets/show-DyzHM527.js +1 -0
- data/public/railwatch/assets/show-Nfpxs8su.js +1 -0
- data/public/railwatch/assets/show-ddjUMo9G.js +1 -0
- data/public/railwatch/assets/show-ksjbSzDH.js +1 -0
- data/public/railwatch/assets/{sort-header-CPM6fhXv.js → sort-header-uOq5VlrB.js} +1 -1
- data/public/railwatch/assets/{sparkline-cell-CXCxXPWt.js → sparkline-cell-DgGij0cu.js} +1 -1
- data/public/railwatch/assets/stat-BTzNKTm2.js +1 -0
- data/public/railwatch/assets/status-badge-BDkOXa-C.js +1 -0
- data/public/railwatch/assets/{tenant-path-C4aM_cO0.js → tenant-path-DU0ezKSU.js} +1 -1
- data/public/railwatch/assets/{use-clipboard-C1ApSwzA.js → use-clipboard-DoENmlWY.js} +1 -1
- data/public/railwatch/assets/{use-live-DWwLg1Nj.js → use-live-CE_fN5_6.js} +1 -1
- data/public/railwatch/manifest.json +612 -1591
- metadata +242 -117
- data/public/railwatch/assets/app-layout-2xAKndVD.js +0 -1
- data/public/railwatch/assets/app-wordmark-Bt6XqURo.js +0 -1
- data/public/railwatch/assets/appearance-DyCfeh9o.js +0 -1
- data/public/railwatch/assets/application-B7h1MIhi.css +0 -1
- data/public/railwatch/assets/auth-layout-BuwogWMZ.js +0 -1
- data/public/railwatch/assets/badge-Dv7I-ebP.js +0 -1
- data/public/railwatch/assets/checkbox-DKbThbxr.js +0 -1
- data/public/railwatch/assets/code-CYahYQHZ.js +0 -1
- data/public/railwatch/assets/copy-DaQMJWoT.js +0 -1
- data/public/railwatch/assets/copy-block-CbJum9s8.js +0 -1
- data/public/railwatch/assets/copy-id-JmvLfkmx.js +0 -1
- data/public/railwatch/assets/cursor-load-more-C1ylbqqL.js +0 -1
- data/public/railwatch/assets/data-table-CVKR2wkq.js +0 -1
- data/public/railwatch/assets/edit-BXF5oNYA.js +0 -1
- data/public/railwatch/assets/edit-BwSEVrTG.js +0 -8
- data/public/railwatch/assets/edit-D5BRDwLT.js +0 -1
- data/public/railwatch/assets/empty-state-Bn48Gplm.js +0 -1
- data/public/railwatch/assets/env-layout-CKLL8Ds7.js +0 -1
- data/public/railwatch/assets/filter-bar-xcbJC93z.js +0 -1
- data/public/railwatch/assets/frames-Bk39xfJG.js +0 -1
- data/public/railwatch/assets/google-sign-in-button-B5as2ps1.js +0 -1
- data/public/railwatch/assets/index-Atp1FTgX.js +0 -1
- data/public/railwatch/assets/index-B-FXAo1w.js +0 -1
- data/public/railwatch/assets/index-B0xgzHuN.js +0 -1
- data/public/railwatch/assets/index-BDVShWMs.js +0 -1
- data/public/railwatch/assets/index-BRvRkfob.js +0 -1
- data/public/railwatch/assets/index-BVWapDeB.js +0 -1
- data/public/railwatch/assets/index-Bd4YpOIO.js +0 -1
- data/public/railwatch/assets/index-BeQw69GM.js +0 -1
- data/public/railwatch/assets/index-BfitxVBv.js +0 -1
- data/public/railwatch/assets/index-C-EwH4lO.js +0 -1
- data/public/railwatch/assets/index-C8JIdb3_.js +0 -1
- data/public/railwatch/assets/index-CBFCtJAR.js +0 -1
- data/public/railwatch/assets/index-CDXlITyG.js +0 -1
- data/public/railwatch/assets/index-COd9lT84.js +0 -1
- data/public/railwatch/assets/index-C_hQmVTP.js +0 -1
- data/public/railwatch/assets/index-CcennT28.js +0 -1
- data/public/railwatch/assets/index-CiaeS-n7.js +0 -1
- data/public/railwatch/assets/index-CrA7jBTK.js +0 -1
- data/public/railwatch/assets/index-D0mKj3Hg.js +0 -1
- data/public/railwatch/assets/index-DV5MdmpY.js +0 -1
- data/public/railwatch/assets/index-DaE-1xhx.js +0 -1
- data/public/railwatch/assets/index-DdVg9LKX.js +0 -1
- data/public/railwatch/assets/index-DeLtMWou.js +0 -1
- data/public/railwatch/assets/index-DiQ4mqT_.js +0 -1
- data/public/railwatch/assets/index-LKgpCzoR.js +0 -1
- data/public/railwatch/assets/index-S0NVaLj9.js +0 -1
- data/public/railwatch/assets/index-Vj93BTR5.js +0 -1
- data/public/railwatch/assets/index-XjXcV-EO.js +0 -1
- data/public/railwatch/assets/index-aPCZX-pW.js +0 -1
- data/public/railwatch/assets/index-cTzBycCg.js +0 -1
- data/public/railwatch/assets/index-dpG-19ZN.js +0 -1
- data/public/railwatch/assets/index-gCvuyG1l.js +0 -1
- data/public/railwatch/assets/index-o1xqGvLo.js +0 -1
- data/public/railwatch/assets/index-w_skgMmK.js +0 -1
- data/public/railwatch/assets/inertia-CqnzqPVD.js +0 -97
- data/public/railwatch/assets/input-error-ByT28UdP.js +0 -1
- data/public/railwatch/assets/json-viewer-Bnu9RsJL.js +0 -1
- data/public/railwatch/assets/klass-nLiBV-Az.js +0 -1
- data/public/railwatch/assets/label-1nSzpSB6.js +0 -1
- data/public/railwatch/assets/layout-D7lE1Doo.js +0 -1
- data/public/railwatch/assets/live-dot-UdzOfzJb.js +0 -41
- data/public/railwatch/assets/nav-BRCgp2w3.js +0 -1
- data/public/railwatch/assets/new-C60G72DR.js +0 -1
- data/public/railwatch/assets/new-COyDKOOb.js +0 -1
- data/public/railwatch/assets/new-Cd9zPNJ8.js +0 -1
- data/public/railwatch/assets/new-DMJGKjmH.js +0 -1
- data/public/railwatch/assets/new-Omvf-c9s.js +0 -1
- data/public/railwatch/assets/new-vjRzERL3.js +0 -1
- data/public/railwatch/assets/onboarding-gUjJQc-6.js +0 -1
- data/public/railwatch/assets/origin-identity-M1YUPYS0.js +0 -1
- data/public/railwatch/assets/relative-time-DQ4kjowZ.js +0 -1
- data/public/railwatch/assets/route-BJkoEm7r.js +0 -1
- data/public/railwatch/assets/select-ocdQJdQo.js +0 -1
- data/public/railwatch/assets/separator-Ct2UcZ2x.js +0 -1
- data/public/railwatch/assets/series-chart-D6upsrSn.js +0 -1
- data/public/railwatch/assets/show-B4bwI9x2.js +0 -2
- data/public/railwatch/assets/show-BAjfddEn.js +0 -6
- data/public/railwatch/assets/show-BLJOyLb_.js +0 -1
- data/public/railwatch/assets/show-BoVyMQS6.js +0 -1
- data/public/railwatch/assets/show-Bsu1rvnK.js +0 -1
- data/public/railwatch/assets/show-C6OiJ6Hr.js +0 -1
- data/public/railwatch/assets/show-C8TkpEgm.js +0 -1
- data/public/railwatch/assets/show-CBFBiBY2.js +0 -1
- data/public/railwatch/assets/show-CEhPVMMT.js +0 -1
- data/public/railwatch/assets/show-CV-lG2b6.js +0 -2
- data/public/railwatch/assets/show-CX_pab9S.js +0 -2
- data/public/railwatch/assets/show-D6lgzL6n.js +0 -1
- data/public/railwatch/assets/show-DDVsv-uS.js +0 -1
- data/public/railwatch/assets/show-Dwiq-8hA.js +0 -1
- data/public/railwatch/assets/show-eKazflRI.js +0 -1
- data/public/railwatch/assets/show-yEOrk6Pt.js +0 -1
- data/public/railwatch/assets/stat-BNEfE8X1.js +0 -1
- data/public/railwatch/assets/status-badge-D0aylrM5.js +0 -1
- data/public/railwatch/assets/text-link-CP4lqUi6.js +0 -1
- data/public/railwatch/assets/textarea-DzJo2ds4.js +0 -1
- data/public/railwatch/assets/timeline-BNcJ9PMc.js +0 -1
- data/public/railwatch/assets/transition-BX2M1iaq.js +0 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{x as Yt,c as Zt,o as vs,j as s,r as Q,v as bs,i as ft,L as zt,q as ts,y as Ns,d as Wt,z as ks,H as ws,F as Ss,s as $s}from"./inertia-FoqYZAk8.js";import{D as rt}from"./data-table-DYi-N0hm.js";import{S as Cs,E as Ls,B as Is,a as As,C as Ms}from"./frames-CUpyJQDy.js";import{J as ls}from"./json-viewer-CxqMojEm.js";import{R as as}from"./relative-time-DcJbkKlN.js";import{S as ut,a as Ts}from"./stat-BTzNKTm2.js";import{I as cs}from"./status-badge-BDkOXa-C.js";import{B as xt,b as O,v as zs,w as Rs,x as Ds,y as Fs,t as Es,z as Bs,q as Ps,F as Os,H as Ks,J as qs,K as Gs}from"./app-layout-LvxN9xSS.js";import{C as c,b as d,c as m,a as o}from"./card-Dpwlr0uY.js";import{C as os,X as ds,Y as ms,a as us,b as fs,B as xs,c as hs,d as ps,R as Hs}from"./chart-DJHv3R7W.js";import{S as ss,a as ns,b as is,c as rs,d as es}from"./select-G7rNBzv0.js";import{u as Vs}from"./use-clipboard-DoENmlWY.js";import{e as Xt}from"./execution-path-CElXXFO_.js";import{c as Rt,a as Tt,w as at,b as Us}from"./format-B9SDkrWj.js";import"./chart-hover-CEH-DtXO.js";import"./source-link-B2183i2-.js";import"./use-live-CE_fN5_6.js";import"./arrow-up-DG01k9AL.js";const Js=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Qs=Yt("git-merge",Js);const Ws=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Xs=Yt("globe",Ws);const Ys=[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]],Zs=Yt("split",Ys);function en(t){const e=Zt.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let l;e[3]!==n?(l=vs("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",n),e[3]=n,e[4]=l):l=e[4];let u;return e[5]!==i||e[6]!==l?(u=s.jsx("textarea",{"data-slot":"textarea",className:l,...i}),e[5]=i,e[6]=l,e[7]=u):u=e[7],u}function tn(t,e){return t.filter(n=>n.at.slice(0,10)===e).map(n=>n.ref)}const sn={count:{label:"Occurrences",color:"var(--chart-5)"}},nn={value:{label:"Measured value",color:"var(--chart-2)"}},rn={report:"Fingerprint passed to Railwatch.report.",error:"Fingerprint from the error's own #railwatch_fingerprint.",resolver:"Fingerprint from the app's Railwatch.fingerprint block.",default:"Railwatch's default: exception class, top in-app frame, and the message with its variable data removed."};function ln(t,e){return e?e.kind==="query"?e.group_hash?$s(t.application.id,t.environment.id,e.group_hash):null:Xt({applicationId:t.application.id,environmentId:t.environment.id,source:e.kind,executionId:e.execution_id}):null}function an(t,e){const n=t.data;switch(t.kind){case"created":return"opened this issue";case"status":return`changed status ${n.from} → ${n.to}`;case"priority":return`changed priority ${n.from} → ${n.to}`;case"assignee":{const i=n.from_id?e.get(Number(n.from_id))??"someone":"unassigned",l=n.to_id?e.get(Number(n.to_id))??"someone":"unassigned";return`reassigned ${i} → ${l}`}case"merge":return`merged this issue into ${n.target_key}`;case"absorbed":return`merged ${n.source_key} into this issue (${n.occurrences} events)`;case"unmerge":return"unmerged this issue";case"split":{const i=Array.isArray(t.data.into)?t.data.into:[];return n.from_key?`split ${n.occurrences} events out of ${n.from_key}`:`split ${n.occurrences} events by message into ${i.join(", ")}`}case"regressed":return"regressed — a new occurrence reopened this issue";case"alert":return`sent a "${n.event}" alert via ${n.integration}`;case"agent":return`acted via ${String(n.agent??"an AI agent")} (MCP)`;case"comment":return"commented";default:return String(t.kind)}}function cn(t){const e=t.issue,n=[];if(n.push(`# ${e.key}: ${e.title}`),e.culprit&&n.push(`Culprit: ${e.culprit}`),n.push(`Environment: ${e.application.name} / ${e.environment.name}`),t.detection?.available&&(n.push(""),n.push("## Detector measurement"),n.push(`${t.detection.metric} for ${t.detection.target}: ${lt(t.detection.measurement?.value,t.detection.unit)}`),t.detection.measurement?.limit!=null&&n.push(`Limit: ${lt(t.detection.measurement.limit,t.detection.unit)}`),t.detection.baseline?.mean!=null&&n.push(`Baseline: ${lt(t.detection.baseline.mean,t.detection.unit)} (${t.detection.baseline.sigmas}σ)`),n.push(`Underlying telemetry: ${t.detection.telemetry_type} ${t.detection.telemetry_group_hash}`)),t.latest){n.push(""),n.push(`## ${t.latest.class_name}`),n.push(t.latest.message);const i=t.latest.frames.filter(l=>l.in_app);if(i.length>0){n.push(""),n.push("### Frames");for(const l of i)if(n.push(`${l.file}:${l.line} in \`${l.function}\``),l.code)for(const[u,T]of Object.entries(l.code))n.push(`${u}: ${T}`)}t.latest.context&&(n.push(""),n.push("### Context"),n.push(String(t.latest.context)))}return n.join(`
|
|
2
|
+
`)}function lt(t,e){return t==null?"–":e==="milliseconds"?`${t.toLocaleString()} ms`:e==="percent"?`${t.toLocaleString()}%`:e==="events_per_minute"?`${t.toLocaleString()} / min`:t.toLocaleString()}function on(t){const e=Zt.c(80),{issue:n,detail:i}=t;if(!i.available){let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(d,{children:s.jsx(m,{children:"Detector sample"})}),e[0]=v):v=e[0];let f;return e[1]!==n.sample?(f=s.jsxs(c,{children:[v,s.jsx(o,{children:s.jsx(ls,{data:n.sample})})]}),e[1]=n.sample,e[2]=f):f=e[2],f}let l;e[3]!==i.representative_records?(l=i.representative_records??[],e[3]=i.representative_records,e[4]=l):l=e[4];const u=l;let T;e[5]!==i.deploy_comparison?(T=i.deploy_comparison??[],e[5]=i.deploy_comparison,e[6]=T):T=e[6];const U=T;let N;e[7]!==i.trend?(N=i.trend??[],e[7]=i.trend,e[8]=N):N=e[8];const K=N,a=i.metric==="missed",W=a?"Missed scheduled task":i.kind==="anomaly"?"Anomaly measurement":"Threshold breach";let k;e[9]!==W?(k=s.jsx(d,{children:s.jsx(m,{children:W})}),e[9]=W,e[10]=k):k=e[10];let B;e[11]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("p",{className:"text-muted-foreground text-xs",children:"Target"}),e[11]=B):B=e[11];let z;e[12]!==i.target?(z=s.jsxs("div",{children:[B,s.jsx("p",{className:"font-mono text-sm",children:i.target})]}),e[12]=i.target,e[13]=z):z=e[13];const ct=a?"Schedule":"Metric";let P;e[14]!==ct?(P=s.jsx("p",{className:"text-muted-foreground text-xs",children:ct}),e[14]=ct,e[15]=P):P=e[15];const ot=a?i.rule?.schedule:i.metric;let R;e[16]!==ot?(R=s.jsx("p",{className:"text-sm",children:ot}),e[16]=ot,e[17]=R):R=e[17];let q;e[18]!==R||e[19]!==P?(q=s.jsxs("div",{children:[P,R]}),e[18]=R,e[19]=P,e[20]=q):q=e[20];const dt=a?"Expected":"Measured";let w;e[21]!==dt?(w=s.jsx("p",{className:"text-muted-foreground text-xs",children:dt}),e[21]=dt,e[22]=w):w=e[22];let D;e[23]!==i.measurement?.value||e[24]!==i.rule||e[25]!==i.unit||e[26]!==a?(D=a&&i.rule?.expected?at(i.rule.expected):lt(i.measurement?.value,i.unit),e[23]=i.measurement?.value,e[24]=i.rule,e[25]=i.unit,e[26]=a,e[27]=D):D=e[27];let S;e[28]!==D?(S=s.jsx("p",{className:"text-sm font-semibold",children:D}),e[28]=D,e[29]=S):S=e[29];let $;e[30]!==w||e[31]!==S?($=s.jsxs("div",{children:[w,S]}),e[30]=w,e[31]=S,e[32]=$):$=e[32];const G=a?"Last run":i.kind==="anomaly"?"Baseline":"Limit";let C;e[33]!==G?(C=s.jsx("p",{className:"text-muted-foreground text-xs",children:G}),e[33]=G,e[34]=C):C=e[34];let F;e[35]!==i.baseline?.mean||e[36]!==i.kind||e[37]!==i.measurement?.limit||e[38]!==i.rule||e[39]!==i.unit||e[40]!==a?(F=a&&i.rule?.last_run?at(i.rule.last_run):i.kind==="anomaly"?lt(i.baseline?.mean,i.unit):lt(i.measurement?.limit,i.unit),e[35]=i.baseline?.mean,e[36]=i.kind,e[37]=i.measurement?.limit,e[38]=i.rule,e[39]=i.unit,e[40]=a,e[41]=F):F=e[41];let L;e[42]!==F?(L=s.jsx("p",{className:"text-sm",children:F}),e[42]=F,e[43]=L):L=e[43];let H;e[44]!==C||e[45]!==L?(H=s.jsxs("div",{children:[C,L]}),e[44]=C,e[45]=L,e[46]=H):H=e[46];let x;e[47]!==q||e[48]!==$||e[49]!==H||e[50]!==z?(x=s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[z,q,$,H]}),e[47]=q,e[48]=$,e[49]=H,e[50]=z,e[51]=x):x=e[51];const E=i.window?.minutes,J=i.baseline?.sigmas!=null&&` · ${i.baseline.sigmas}σ above a ${i.baseline.days}-day baseline`;let h;e[52]!==i.telemetry_group_hash||e[53]!==i.telemetry_type||e[54]!==E||e[55]!==J?(h=s.jsxs("p",{className:"text-muted-foreground text-xs",children:[i.telemetry_type," group ",i.telemetry_group_hash," ·"," ",E," minute window",J]}),e[52]=i.telemetry_group_hash,e[53]=i.telemetry_type,e[54]=E,e[55]=J,e[56]=h):h=e[56];let V;e[57]!==x||e[58]!==h?(V=s.jsxs(o,{className:"space-y-4",children:[x,h]}),e[57]=x,e[58]=h,e[59]=V):V=e[59];let p;e[60]!==V||e[61]!==k?(p=s.jsxs(c,{children:[k,V]}),e[60]=V,e[61]=k,e[62]=p):p=e[62];let g;e[63]!==i.metric||e[64]!==K?(g=K.length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsxs(m,{children:[i.metric," trend (30d)"]})}),s.jsx(o,{children:s.jsx(hs,{config:nn,className:"h-48 w-full",children:s.jsxs(ps,{data:K,children:[s.jsx(os,{vertical:!1}),s.jsx(ds,{dataKey:"day",tickLine:!1,axisLine:!1,minTickGap:24,tickFormatter:_n}),s.jsx(ms,{width:45,tickLine:!1,axisLine:!1}),s.jsx(us,{content:s.jsx(fs,{})}),s.jsx(xs,{dataKey:"value",fill:"var(--color-value)",radius:2})]})})})]}),e[63]=i.metric,e[64]=K,e[65]=g):g=e[65];let I;e[66]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(d,{children:s.jsx(m,{children:"Representative telemetry"})}),e[66]=I):I=e[66];let j;e[67]!==n?(j=v=>{const f=ln(n,v.drilldown);f&&Wt.visit(f)},e[67]=n,e[68]=j):j=e[68];let A;e[69]===Symbol.for("react.memo_cache_sentinel")?(A=[{key:"when",header:"When",cell:jn},{key:"record",header:"Record",className:"max-w-0",cell:gn},{key:"duration",header:"Duration",align:"right",cell:pn},{key:"deploy",header:"Deploy",cell:hn}],e[69]=A):A=e[69];let y;e[70]!==u||e[71]!==j?(y=s.jsxs(c,{children:[I,s.jsx(o,{children:s.jsx(rt,{rows:u,rowKey:yn,empty:"Representative raw telemetry has been pruned.",onRowClick:j,columns:A})})]}),e[70]=u,e[71]=j,e[72]=y):y=e[72];let _;e[73]!==U?(_=U.length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsx(m,{children:"Deploy comparison (30d)"})}),s.jsx(o,{children:s.jsx(rt,{rows:U,rowKey:xn,columns:[{key:"deploy",header:"Deploy",cell:fn},{key:"events",header:"Events",align:"right",cell:un},{key:"avg",header:"Avg",align:"right",cell:mn},{key:"max",header:"Max",align:"right",cell:dn}]})})]}),e[73]=U,e[74]=_):_=e[74];let M;return e[75]!==p||e[76]!==g||e[77]!==y||e[78]!==_?(M=s.jsxs(s.Fragment,{children:[p,g,y,_]}),e[75]=p,e[76]=g,e[77]=y,e[78]=_,e[79]=M):M=e[79],M}function dn(t){return`${t.max_ms} ms`}function mn(t){return`${t.avg_ms} ms`}function un(t){return Rt(t.events)}function fn(t){return s.jsx("span",{className:"font-mono text-xs",children:t.deploy.slice(0,12)})}function xn(t){return t.deploy}function hn(t){return s.jsx("span",{className:"font-mono text-xs",children:t.deploy?.slice(0,10)})}function pn(t){return`${t.duration_ms.toLocaleString()} ms`}function gn(t){return s.jsx("span",{className:"block truncate font-mono text-xs",children:t.name})}function jn(t){return s.jsx("span",{className:"text-xs",children:at(t.occurred_at)})}function yn(t){return`${t.record_type}-${t.record_id}`}function _n(t){return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function hi(t){const e=Zt.c(259),n=t.issue;let i;e[0]!==n.id?(i=(r,b)=>{const mt=b===void 0?{}:b;return Wt.patch(ft(n.id),{action_name:r,...mt},{preserveScroll:!0})},e[0]=n.id,e[1]=i):i=e[1];const l=i,[,u]=Vs(),[T,U]=Q.useState(!1),[N,K]=Q.useState(!1),[a,W]=Q.useState("");let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=[],e[2]=k):k=e[2];const[B,z]=Q.useState(k),[ct,P]=Q.useState(!1),[ot,R]=Q.useState(!1),q=new Map(t.members.map(Wn)),dt=Bs();let w;e[3]!==n.application.id||e[4]!==n.environment.id?(w=r=>Xt({applicationId:n.application.id,environmentId:n.environment.id,source:r.execution_source,executionId:r.execution_id}),e[3]=n.application.id,e[4]=n.environment.id,e[5]=w):w=e[5];const D=w;let S;e[6]!==n.application.id||e[7]!==n.environment.id||e[8]!==t.latest?(S=t.latest?Xt({applicationId:n.application.id,environmentId:n.environment.id,source:t.latest.execution_source,executionId:t.latest.execution_id}):null,e[6]=n.application.id,e[7]=n.environment.id,e[8]=t.latest,e[9]=S):S=e[9];const $=S;let G,C;e[10]!==n.id||e[11]!==N||e[12]!==a?(G=()=>{if(!N)return;const r=new AbortController,b=window.setTimeout(()=>{P(!0),R(!1),fetch(ks(n.id,{q:a}),{headers:{Accept:"application/json"},credentials:"same-origin",signal:r.signal}).then(Qn).then(mt=>{const{issues:Mt}=mt;return z(Mt)}).catch(()=>{r.signal.aborted||(z([]),R(!0))}).finally(()=>{r.signal.aborted||P(!1)})},150);return()=>{window.clearTimeout(b),r.abort()}},C=[n.id,N,a],e[10]=n.id,e[11]=N,e[12]=a,e[13]=G,e[14]=C):(G=e[13],C=e[14]),Q.useEffect(G,C);const F=Es;let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L={title:"Issues",href:bs()},e[15]=L):L=e[15];const H=n.key;let x;e[16]!==n.id?(x=ft(n.id),e[16]=n.id,e[17]=x):x=e[17];let E;e[18]!==n.key||e[19]!==x?(E=[L,{title:H,href:x}],e[18]=n.key,e[19]=x,e[20]=E):E=e[20];const J=`${n.key} ${n.title}`;let h;e[21]!==J?(h=s.jsx(ws,{title:J}),e[21]=J,e[22]=h):h=e[22];const V="flex flex-1 flex-col gap-4 p-3 md:gap-5 md:px-6 md:pt-2 md:pb-6";let p;e[23]!==n.key?(p=s.jsx("span",{className:"font-mono text-sm font-semibold",children:n.key}),e[23]=n.key,e[24]=p):p=e[24];let g;e[25]!==n.status?(g=s.jsx(cs,{status:n.status}),e[25]=n.status,e[26]=g):g=e[26];let I;e[27]!==n.kind?(I=s.jsx(xt,{variant:"outline",children:n.kind}),e[27]=n.kind,e[28]=I):I=e[28];let j;e[29]!==n.source?(j=n.source==="browser"&&s.jsxs(xt,{variant:"outline",className:"gap-1",children:[s.jsx(Xs,{className:"size-3"}),"browser"]}),e[29]=n.source,e[30]=j):j=e[30];let A;e[31]!==n.application.name||e[32]!==n.environment.name?(A=s.jsxs("span",{className:"text-muted-foreground text-xs",children:[n.application.name," · ",n.environment.name]}),e[31]=n.application.name,e[32]=n.environment.name,e[33]=A):A=e[33];let y;e[34]!==p||e[35]!==g||e[36]!==I||e[37]!==j||e[38]!==A?(y=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p,g,I,j,A]}),e[34]=p,e[35]=g,e[36]=I,e[37]=j,e[38]=A,e[39]=y):y=e[39];let _;e[40]!==n.title?(_=s.jsx("h1",{className:"mt-1 text-lg font-semibold break-words",children:n.title}),e[40]=n.title,e[41]=_):_=e[41];let M;e[42]!==n.culprit||e[43]!==n.sample?(M=n.culprit&&s.jsx("div",{className:"text-muted-foreground",children:s.jsx(Cs,{location:n.culprit,deploy:n.sample.deploy})}),e[42]=n.culprit,e[43]=n.sample,e[44]=M):M=e[44];let v;e[45]!==y||e[46]!==_||e[47]!==M?(v=s.jsxs("div",{className:"min-w-0",children:[y,_,M]}),e[45]=y,e[46]=_,e[47]=M,e[48]=v):v=e[48];let f;e[49]!==l?(f=r=>l("priority",{priority:r}),e[49]=l,e[50]=f):f=e[50];let ht;e[51]===Symbol.for("react.memo_cache_sentinel")?(ht=s.jsx(ns,{className:"w-28",children:s.jsx(is,{})}),e[51]=ht):ht=e[51];let pt;e[52]===Symbol.for("react.memo_cache_sentinel")?(pt=s.jsx(rs,{children:["low","normal","high","urgent"].map(Jn)}),e[52]=pt):pt=e[52];let X;e[53]!==n.priority||e[54]!==f?(X=s.jsxs(ss,{value:n.priority,onValueChange:f,children:[ht,pt]}),e[53]=n.priority,e[54]=f,e[55]=X):X=e[55];const Dt=n.assignee?String(n.assignee.id):"none";let Y;e[56]!==l?(Y=r=>l("assign",{assignee_id:r==="none"?null:r}),e[56]=l,e[57]=Y):Y=e[57];let gt;e[58]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(ns,{className:"w-40",children:s.jsx(is,{placeholder:"Assign"})}),e[58]=gt):gt=e[58];let jt;e[59]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(es,{value:"none",children:"Unassigned"}),e[59]=jt):jt=e[59];let Z;e[60]!==t.members?(Z=t.members.map(Un),e[60]=t.members,e[61]=Z):Z=e[61];let ee;e[62]!==Z?(ee=s.jsxs(rs,{children:[jt,Z]}),e[62]=Z,e[63]=ee):ee=e[63];let te;e[64]!==Dt||e[65]!==Y||e[66]!==ee?(te=s.jsxs(ss,{value:Dt,onValueChange:Y,children:[gt,ee]}),e[64]=Dt,e[65]=Y,e[66]=ee,e[67]=te):te=e[67];let se;e[68]!==l||e[69]!==n.status?(se=n.status==="merged"?s.jsx(O,{size:"sm",variant:"outline",onClick:()=>l("unmerge"),children:"Unmerge"}):n.status==="open"?s.jsxs(s.Fragment,{children:[s.jsx(O,{size:"sm",onClick:()=>l("resolve"),children:"Resolve"}),s.jsx(O,{size:"sm",variant:"outline",onClick:()=>l("ignore"),children:"Ignore"})]}):s.jsx(O,{size:"sm",variant:"outline",onClick:()=>l("reopen"),children:"Reopen"}),e[68]=l,e[69]=n.status,e[70]=se):se=e[70];let ne;e[71]!==n.status?(ne=n.status!=="merged"&&s.jsxs(O,{size:"sm",variant:"outline",onClick:()=>K(!0),children:[s.jsx(Qs,{"data-icon":"inline-start"}),"Merge into…"]}),e[71]=n.status,e[72]=ne):ne=e[72];let ie;e[73]!==u||e[74]!==t?(ie=()=>{(async()=>await u(cn(t))&&(U(!0),setTimeout(()=>U(!1),1200)))()},e[73]=u,e[74]=t,e[75]=ie):ie=e[75];let re;e[76]!==T?(re=T?s.jsx(Ps,{className:"size-3.5"}):s.jsx(Ms,{className:"size-3.5"}),e[76]=T,e[77]=re):re=e[77];let le;e[78]!==ie||e[79]!==re?(le=s.jsxs(O,{size:"sm",variant:"outline",onClick:ie,children:[re,"Copy for AI"]}),e[78]=ie,e[79]=re,e[80]=le):le=e[80];let ae;e[81]!==X||e[82]!==te||e[83]!==se||e[84]!==ne||e[85]!==le?(ae=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[X,te,se,ne,le]}),e[81]=X,e[82]=te,e[83]=se,e[84]=ne,e[85]=le,e[86]=ae):ae=e[86];let ce;e[87]!==v||e[88]!==ae?(ce=s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[v,ae]}),e[87]=v,e[88]=ae,e[89]=ce):ce=e[89];let oe;e[90]!==l||e[91]!==t.merged_into?(oe=t.merged_into&&s.jsxs("div",{className:"bg-muted flex flex-wrap items-center justify-between gap-2 rounded-md border px-4 py-3 text-sm",children:[s.jsxs("span",{children:["Merged into"," ",s.jsx(zt,{href:ft(t.merged_into.id),className:"font-mono font-semibold underline",children:t.merged_into.key})," ",s.jsx("span",{className:"text-muted-foreground",children:t.merged_into.title})]}),s.jsx(O,{size:"sm",variant:"outline",onClick:()=>l("unmerge"),children:"Unmerge"})]}),e[90]=l,e[91]=t.merged_into,e[92]=oe):oe=e[92];let yt;e[93]===Symbol.for("react.memo_cache_sentinel")?(yt=r=>{K(r),r||(W(""),z([]),R(!1))},e[93]=yt):yt=e[93];let de;e[94]!==a?(de=s.jsx(Os,{placeholder:"Search issues by key or title…",value:a,onValueChange:W}),e[94]=a,e[95]=de):de=e[95];const Ft=ct?"Searching…":ot?"Search failed. Try again.":"No open issues found.";let me;e[96]!==Ft?(me=s.jsx(Ks,{children:Ft}),e[96]=Ft,e[97]=me):me=e[97];let ue;e[98]!==l||e[99]!==B?(ue=B.length>0&&s.jsx(zs,{children:B.map(r=>s.jsxs(Rs,{value:`${r.key} ${r.title}`,onSelect:()=>{l("merge",{target_id:r.id}),K(!1)},children:[s.jsx("span",{className:"font-mono font-semibold",children:r.key}),s.jsx("span",{className:"text-muted-foreground truncate",children:r.title})]},r.id))}),e[98]=l,e[99]=B,e[100]=ue):ue=e[100];let fe;e[101]!==me||e[102]!==ue?(fe=s.jsxs(qs,{children:[me,ue]}),e[101]=me,e[102]=ue,e[103]=fe):fe=e[103];let xe;e[104]!==N||e[105]!==de||e[106]!==fe?(xe=s.jsxs(Gs,{open:N,onOpenChange:yt,title:"Merge into…",description:"Search issues to merge this one into",children:[de,fe]}),e[104]=N,e[105]=de,e[106]=fe,e[107]=xe):xe=e[107];const Et=t.detection?.count_label??"Events",Bt=t.detection?.breached_windows??n.occurrences;let he;e[108]!==Bt?(he=Rt(Bt),e[108]=Bt,e[109]=he):he=e[109];let pe;e[110]!==Et||e[111]!==he?(pe=s.jsx(ut,{label:Et,value:he}),e[110]=Et,e[111]=he,e[112]=pe):pe=e[112];const Pt=t.detection?"Events in measured window":"Users affected";let ge;e[113]!==n.affected_users||e[114]!==t.detection?(ge=t.detection?t.detection.event_count==null?"–":Rt(t.detection.event_count):n.affected_users,e[113]=n.affected_users,e[114]=t.detection,e[115]=ge):ge=e[115];let je;e[116]!==Pt||e[117]!==ge?(je=s.jsx(ut,{label:Pt,value:ge}),e[116]=Pt,e[117]=ge,e[118]=je):je=e[118];let ye;e[119]!==n.first_seen_at?(ye=Tt(n.first_seen_at),e[119]=n.first_seen_at,e[120]=ye):ye=e[120];let _e;e[121]!==n.first_seen_at?(_e=at(n.first_seen_at),e[121]=n.first_seen_at,e[122]=_e):_e=e[122];let ve;e[123]!==ye||e[124]!==_e?(ve=s.jsx(ut,{label:"First seen",value:ye,hint:_e}),e[123]=ye,e[124]=_e,e[125]=ve):ve=e[125];let be;e[126]!==n.last_seen_at?(be=Tt(n.last_seen_at),e[126]=n.last_seen_at,e[127]=be):be=e[127];let Ne;e[128]!==n.last_seen_at?(Ne=at(n.last_seen_at),e[128]=n.last_seen_at,e[129]=Ne):Ne=e[129];let ke;e[130]!==be||e[131]!==Ne?(ke=s.jsx(ut,{label:"Last seen",value:be,hint:Ne}),e[130]=be,e[131]=Ne,e[132]=ke):ke=e[132];const Ot=n.regressed_at?"Regressed":"Resolved";let we;e[133]!==n.regressed_at||e[134]!==n.resolved_at?(we=n.regressed_at?Tt(n.regressed_at):n.resolved_at?Tt(n.resolved_at):"–",e[133]=n.regressed_at,e[134]=n.resolved_at,e[135]=we):we=e[135];let Se;e[136]!==n.resolved_in_deploy?(Se=n.resolved_in_deploy?`in ${n.resolved_in_deploy.slice(0,12)}`:void 0,e[136]=n.resolved_in_deploy,e[137]=Se):Se=e[137];const Kt=n.regressed_at?"destructive":void 0;let $e;e[138]!==Ot||e[139]!==we||e[140]!==Se||e[141]!==Kt?($e=s.jsx(ut,{label:Ot,value:we,hint:Se,tone:Kt}),e[138]=Ot,e[139]=we,e[140]=Se,e[141]=Kt,e[142]=$e):$e=e[142];let Ce;e[143]!==pe||e[144]!==je||e[145]!==ve||e[146]!==ke||e[147]!==$e?(Ce=s.jsxs(Ts,{children:[pe,je,ve,ke,$e]}),e[143]=pe,e[144]=je,e[145]=ve,e[146]=ke,e[147]=$e,e[148]=Ce):Ce=e[148];const gs="grid gap-6 lg:grid-cols-3";let Le;e[149]!==n||e[150]!==$||e[151]!==t.breadcrumbs||e[152]!==t.browser_breadcrumbs||e[153]!==t.detection||e[154]!==t.latest?(Le=t.detection?s.jsx(on,{issue:n,detail:t.detection}):t.latest?s.jsxs(c,{children:[s.jsxs(d,{className:"flex-row items-center justify-between",children:[s.jsx(m,{children:"Latest occurrence"}),$&&s.jsxs(zt,{className:"text-xs underline",href:$,children:["Open ",t.latest.execution_preview]})]}),s.jsxs(o,{children:[s.jsx(Ls,{exception:t.latest,deploy:t.latest.deploy}),s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsx(Is,{entries:t.breadcrumbs}),s.jsx(As,{crumbs:t.browser_breadcrumbs})]}),(t.latest.ruby_version??t.latest.rails_version)&&s.jsxs("p",{className:"text-muted-foreground mt-3 text-xs",children:["Ruby ",t.latest.ruby_version," · Rails"," ",t.latest.rails_version]})]})]}):s.jsx(c,{children:s.jsx(o,{children:s.jsx(ls,{data:n.sample})})}),e[149]=n,e[150]=$,e[151]=t.breadcrumbs,e[152]=t.browser_breadcrumbs,e[153]=t.detection,e[154]=t.latest,e[155]=Le):Le=e[155];const qt=t.detection?"hidden":void 0;let _t;e[156]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(d,{children:s.jsx(m,{children:"Occurrences (30d)"})}),e[156]=_t):_t=e[156];let Ie;e[157]!==D?(Ie=r=>{const b=D(r);b&&Wt.visit(b)},e[157]=D,e[158]=Ie):Ie=e[158];let vt;e[159]===Symbol.for("react.memo_cache_sentinel")?(vt=[{key:"when",header:"When",cell:Hn},{key:"in",header:"In",cell:Gn},{key:"u",header:"User",cell:qn},{key:"t",header:"Tenant",cell:Kn},{key:"d",header:"Deploy",cell:On},{key:"h",header:"",cell:Pn}],e[159]=vt):vt=e[159];let Ae;e[160]!==t.occurrences||e[161]!==Ie?(Ae=s.jsx(o,{children:s.jsx(rt,{rows:t.occurrences,rowKey:Vn,empty:"Raw occurrences have been pruned.",onRowClick:Ie,columns:vt})}),e[160]=t.occurrences,e[161]=Ie,e[162]=Ae):Ae=e[162];let Me;e[163]!==qt||e[164]!==Ae?(Me=s.jsxs(c,{className:qt,children:[_t,Ae]}),e[163]=qt,e[164]=Ae,e[165]=Me):Me=e[165];let Te;e[166]!==n.application.id||e[167]!==n.environment.id||e[168]!==t.attachments?(Te=t.attachments.length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsx(m,{children:"Attachments"})}),s.jsx(o,{children:s.jsx(rt,{rows:t.attachments,rowKey:Bn,columns:[{key:"name",header:"Name",className:"max-w-0",cell:En},{key:"in",header:"In",cell:Fn},{key:"size",header:"Size",align:"right",cell:Dn},{key:"links",header:"",align:"right",cell:r=>s.jsxs("span",{className:"flex justify-end gap-3",children:[r.viewable&&s.jsx("a",{className:"text-primary hover:underline",href:ts(n.application.id,n.environment.id,r.id,{view:1}),children:"View"}),s.jsx("a",{className:"text-primary hover:underline",href:ts(n.application.id,n.environment.id,r.id),children:"Download"})]})}]})})]}),e[166]=n.application.id,e[167]=n.environment.id,e[168]=t.attachments,e[169]=Te):Te=e[169];let ze;e[170]!==Le||e[171]!==Me||e[172]!==Te?(ze=s.jsxs("div",{className:"space-y-6 lg:col-span-2",children:[Le,Me,Te]}),e[170]=Le,e[171]=Me,e[172]=Te,e[173]=ze):ze=e[173];const js="space-y-6",Gt=t.detection?"hidden":void 0;let bt;e[174]===Symbol.for("react.memo_cache_sentinel")?(bt=s.jsx(d,{children:s.jsx(m,{children:"Daily (30d)"})}),e[174]=bt):bt=e[174];const ys=t.daily;let Nt,kt,wt;e[175]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(os,{vertical:!1}),kt=s.jsx(ds,{dataKey:"day",tickLine:!1,axisLine:!1,minTickGap:24,tickFormatter:Rn}),wt=s.jsx(ms,{width:28,tickLine:!1,axisLine:!1,allowDecimals:!1}),e[175]=Nt,e[176]=kt,e[177]=wt):(Nt=e[175],kt=e[176],wt=e[177]);let Re;e[178]!==t.deploys?(Re=s.jsx(us,{content:s.jsx(fs,{labelFormatter:r=>{const b=tn(t.deploys,String(r));return b.length>0?`${String(r)} · deployed ${b.join(", ")}`:String(r)}})}),e[178]=t.deploys,e[179]=Re):Re=e[179];let St;e[180]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(xs,{dataKey:"count",fill:"var(--color-count)",radius:2}),e[180]=St):St=e[180];let De;e[181]!==t.deploys?(De=new Set(t.deploys.map(zn)),e[181]=t.deploys,e[182]=De):De=e[182];let Fe;e[183]!==De?(Fe=[...De].map(Tn),e[183]=De,e[184]=Fe):Fe=e[184];let Ee;e[185]!==t.daily||e[186]!==Re||e[187]!==Fe?(Ee=s.jsx(o,{children:s.jsx(hs,{config:sn,className:"h-40 w-full",children:s.jsxs(ps,{data:ys,children:[Nt,kt,wt,Re,St,Fe]})})}),e[185]=t.daily,e[186]=Re,e[187]=Fe,e[188]=Ee):Ee=e[188];let Be;e[189]!==Gt||e[190]!==Ee?(Be=s.jsxs(c,{className:Gt,children:[bt,Ee]}),e[189]=Gt,e[190]=Ee,e[191]=Be):Be=e[191];const Ht=t.detection?"hidden":void 0;let $t;e[192]===Symbol.for("react.memo_cache_sentinel")?($t=s.jsx(d,{children:s.jsx(m,{children:"Grouping"})}),e[192]=$t):$t=e[192];let Pe;e[193]!==t.fingerprint?(Pe=t.fingerprint.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:t.fingerprint.map(Mn)}),e[193]=t.fingerprint,e[194]=Pe):Pe=e[194];const Vt=rn[t.fingerprint_source??"default"]??`Fingerprint from ${t.fingerprint_source}.`;let Oe;e[195]!==Vt?(Oe=s.jsx("p",{className:"text-muted-foreground text-xs",children:Vt}),e[195]=Vt,e[196]=Oe):Oe=e[196];let Ke;e[197]!==l||e[198]!==t.distinct_messages||e[199]!==t.top_messages?(Ke=t.distinct_messages>1&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-1",children:t.top_messages.map(An)}),s.jsxs(O,{size:"sm",variant:"outline",onClick:()=>l("split",{by:"message"}),children:[s.jsx(Zs,{className:"size-3.5"}),"Split into ",t.distinct_messages," issues"]})]}),e[197]=l,e[198]=t.distinct_messages,e[199]=t.top_messages,e[200]=Ke):Ke=e[200];let qe;e[201]!==Pe||e[202]!==Oe||e[203]!==Ke?(qe=s.jsxs(o,{className:"space-y-3",children:[Pe,Oe,Ke]}),e[201]=Pe,e[202]=Oe,e[203]=Ke,e[204]=qe):qe=e[204];let Ge;e[205]!==Ht||e[206]!==qe?(Ge=s.jsxs(c,{className:Ht,children:[$t,qe]}),e[205]=Ht,e[206]=qe,e[207]=Ge):Ge=e[207];let He;e[208]!==t.related_issues?(He=t.related_issues.length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsx(m,{children:"Related issues"})}),s.jsx(o,{className:"space-y-2",children:t.related_issues.map(In)})]}),e[208]=t.related_issues,e[209]=He):He=e[209];let Ve;e[210]!==t.merged_issues?(Ve=t.merged_issues.length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsx(m,{children:"Merged issues"})}),s.jsx(o,{className:"space-y-2",children:t.merged_issues.map(Ln)})]}),e[210]=t.merged_issues,e[211]=Ve):Ve=e[211];let Ue;e[212]!==t.alerts?(Ue=t.alerts.length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsx(m,{children:"Alerts"})}),s.jsx(o,{className:"space-y-2",children:t.alerts.map(Cn)})]}),e[212]=t.alerts,e[213]=Ue):Ue=e[213];let Ct;e[214]===Symbol.for("react.memo_cache_sentinel")?(Ct=s.jsx(d,{children:s.jsx(m,{children:"By deploy"})}),e[214]=Ct):Ct=e[214];let Je;e[215]!==t.by_deploy?(Je=Object.entries(t.by_deploy),e[215]=t.by_deploy,e[216]=Je):Je=e[216];let Lt;e[217]===Symbol.for("react.memo_cache_sentinel")?(Lt=[{key:"d",header:"Deploy",cell:Sn},{key:"n",header:"Count",align:"right",cell:wn}],e[217]=Lt):Lt=e[217];let Qe;e[218]!==Je?(Qe=s.jsxs(c,{children:[Ct,s.jsx(o,{children:s.jsx(rt,{rows:Je,rowKey:$n,columns:Lt})})]}),e[218]=Je,e[219]=Qe):Qe=e[219];let We;e[220]!==t.by_tenant?(We=Object.keys(t.by_tenant).length>0&&s.jsxs(c,{children:[s.jsx(d,{children:s.jsx(m,{children:"By tenant"})}),s.jsx(o,{children:s.jsx(rt,{rows:Object.entries(t.by_tenant),rowKey:kn,columns:[{key:"t",header:"Tenant",cell:Nn},{key:"n",header:"Count",align:"right",cell:bn}]})})]}),e[220]=t.by_tenant,e[221]=We):We=e[221];const Ut=c;let Xe;e[222]===Symbol.for("react.memo_cache_sentinel")?(Xe=s.jsx(d,{children:s.jsx(m,{children:"Activity"})}),e[222]=Xe):Xe=e[222];const Jt=o,_s="space-y-3",Qt=t.activities.map(r=>{const b=r.data.source==="linear",mt=typeof r.data.author_name=="string"?r.data.author_name:"Linear",Mt=r.user?.name??(b?mt:"System");return s.jsxs("div",{className:"flex gap-2 text-sm",children:[s.jsx(Ds,{className:"size-6",children:s.jsx(Fs,{className:"text-[10px]",children:r.user||b?dt(Mt):"sys"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"font-medium",children:Mt})," ",s.jsx("span",{className:"text-muted-foreground",children:an(r,q)})," ",s.jsx(as,{iso:r.created_at,className:"text-muted-foreground"})]}),r.kind==="comment"&&s.jsx("div",{className:"mt-0.5 whitespace-pre-wrap",children:String(r.data.body)})]})]},r.id)});let Ye;e[223]!==n.id?(Ye=Ns(n.id),e[223]=n.id,e[224]=Ye):Ye=e[224];let It;e[225]===Symbol.for("react.memo_cache_sentinel")?(It={preserveScroll:!0},e[225]=It):It=e[225];let Ze;e[226]!==Ye?(Ze=s.jsx(Ss,{method:"post",action:Ye,options:It,resetOnSuccess:!0,className:"space-y-2",children:vn}),e[226]=Ye,e[227]=Ze):Ze=e[227];let et;e[228]!==Jt||e[229]!==Qt||e[230]!==Ze?(et=s.jsxs(Jt,{className:_s,children:[Qt,Ze]}),e[228]=Jt,e[229]=Qt,e[230]=Ze,e[231]=et):et=e[231];let tt;e[232]!==Ut||e[233]!==Xe||e[234]!==et?(tt=s.jsxs(Ut,{children:[Xe,et]}),e[232]=Ut,e[233]=Xe,e[234]=et,e[235]=tt):tt=e[235];let st;e[236]!==Ue||e[237]!==Qe||e[238]!==We||e[239]!==tt||e[240]!==Be||e[241]!==Ge||e[242]!==He||e[243]!==Ve?(st=s.jsxs("div",{className:js,children:[Be,Ge,He,Ve,Ue,Qe,We,tt]}),e[236]=Ue,e[237]=Qe,e[238]=We,e[239]=tt,e[240]=Be,e[241]=Ge,e[242]=He,e[243]=Ve,e[244]=st):st=e[244];let nt;e[245]!==st||e[246]!==ze?(nt=s.jsxs("div",{className:gs,children:[ze,st]}),e[245]=st,e[246]=ze,e[247]=nt):nt=e[247];let it;e[248]!==nt||e[249]!==ce||e[250]!==oe||e[251]!==xe||e[252]!==Ce?(it=s.jsxs("div",{className:V,children:[ce,oe,xe,Ce,nt]}),e[248]=nt,e[249]=ce,e[250]=oe,e[251]=xe,e[252]=Ce,e[253]=it):it=e[253];let At;return e[254]!==F||e[255]!==h||e[256]!==it||e[257]!==E?(At=s.jsxs(F,{breadcrumbs:E,children:[h,it]}),e[254]=F,e[255]=h,e[256]=it,e[257]=E,e[258]=At):At=e[258],At}function vn(t){const{processing:e}=t;return s.jsxs(s.Fragment,{children:[s.jsx(en,{name:"body",placeholder:"Add a comment…",required:!0,rows:3}),s.jsx(O,{size:"sm",disabled:e,children:"Comment"})]})}function bn(t){const[,e]=t;return e}function Nn(t){const[e]=t;return s.jsx("span",{className:"font-mono text-xs",children:e})}function kn(t){const[e]=t;return e}function wn(t){const[,e]=t;return e}function Sn(t){const[e]=t;return s.jsx("span",{className:"font-mono text-xs",children:e??"unknown"})}function $n(t){const[e]=t;return e??"none"}function Cn(t){return s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",title:t.error??void 0,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xt,{variant:t.status==="failed"?"destructive":"outline",className:"capitalize",children:t.status}),s.jsxs("span",{children:[t.event," via ",t.integration.name]}),s.jsx(as,{iso:t.sent_at,className:"text-muted-foreground"})]}),t.error&&s.jsx("span",{className:"text-destructive",children:t.error})]},t.id)}function Ln(t){return s.jsxs(zt,{href:ft(t.id),className:"hover:bg-muted/60 -mx-2 flex flex-col rounded px-2 py-1 text-xs",children:[s.jsx("span",{className:"font-mono font-semibold",children:t.key}),s.jsx("span",{className:"text-muted-foreground line-clamp-1",children:t.title})]},t.id)}function In(t){return s.jsxs(zt,{href:ft(t.id),className:"hover:bg-muted/60 -mx-2 flex flex-col rounded px-2 py-1 text-xs",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono font-semibold",children:t.key}),s.jsx(cs,{status:t.status})]}),s.jsx("span",{className:"text-muted-foreground line-clamp-1",children:t.title}),s.jsx("span",{className:"text-muted-foreground",children:t.environment.name})]},t.id)}function An(t){return s.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[s.jsx("span",{className:"line-clamp-1 font-mono",children:t.message}),s.jsx("span",{className:"text-muted-foreground",children:Rt(t.count)})]},t.message)}function Mn(t,e){return s.jsx("span",{className:"bg-muted rounded px-1.5 py-0.5 font-mono text-[11px] break-all",children:t},`${e}-${t}`)}function Tn(t){return s.jsx(Hs,{x:t,stroke:"var(--muted-foreground)",strokeDasharray:"3 3"},t)}function zn(t){return t.at.slice(0,10)}function Rn(t){return new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Dn(t){return Us(t.bytes)}function Fn(t){return s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:t.execution_preview??"–"})}function En(t){return s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"truncate font-mono text-xs",children:t.name}),t.truncated&&s.jsx(xt,{variant:"secondary",children:"truncated"})]})}function Bn(t){return t.id}function Pn(t){return t.handled?s.jsx(xt,{variant:"secondary",children:"handled"}):null}function On(t){return s.jsx("span",{className:"font-mono text-xs",children:t.deploy?.slice(0,10)})}function Kn(t){return s.jsx("span",{className:"font-mono text-xs",children:t.tenant??""})}function qn(t){return s.jsx("span",{className:"font-mono text-xs",children:t.user_ref??""})}function Gn(t){return s.jsxs("span",{className:"font-mono text-xs",children:[t.execution_source," ",t.execution_preview]})}function Hn(t){return s.jsx("span",{className:"text-xs",children:at(t.occurred_at)})}function Vn(t){return t.id}function Un(t){return s.jsx(es,{value:String(t.id),children:t.name},t.id)}function Jn(t){return s.jsx(es,{value:t,children:t},t)}function Qn(t){if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}function Wn(t){return[t.id,t.name]}export{hi as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as se,u as ne,a2 as re,j as s,L as ae,f as oe}from"./inertia-FoqYZAk8.js";import{V as ie,D as le}from"./chart-panel-CUdIzJvk.js";import{D as Z}from"./data-table-DYi-N0hm.js";import{E as ee}from"./app-layout-LvxN9xSS.js";import{P as ce,E as me}from"./env-layout-HdcOaPPX.js";import{S as T,a as ue}from"./stat-BTzNKTm2.js";import{S as de}from"./status-badge-BDkOXa-C.js";import{C as fe,a as pe,b as xe,c as he}from"./card-Dpwlr0uY.js";import{c as Y,m as P,w as je}from"./format-B9SDkrWj.js";import{B as te}from"./braces-C3w7pfxS.js";import"./series-chart-C5nXIUc5.js";import"./chart-hover-CEH-DtXO.js";import"./chart-DJHv3R7W.js";import"./use-live-CE_fN5_6.js";import"./segmented-BWee8uc9.js";import"./arrow-up-DG01k9AL.js";function ge(t){const e=se.c(5),{attributes:o}=t;let i;e[0]!==o?(i=Object.entries(o),e[0]=o,e[1]=i):i=e[1];const r=i;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 a;return e[3]!==r?(a=s.jsx("span",{className:"flex flex-wrap gap-1",children:r.map(ye)}),e[3]=r,e[4]=a):a=e[4],a}function ye(t){const[e,o]=t;return s.jsxs("span",{className:"bg-muted rounded-sm px-1.5 font-mono text-[10px]",children:[e,"=",String(o)]},e)}function ze(t){const e=se.c(73),{environment:o,window:i}=ne().props,r=o.application_id,a=o.id,n=t.summary.current,V=t.name??"Span";let l;e[0]!==r||e[1]!==a||e[2]!==i?(l=re(r,a,{window:i}),e[0]=r,e[1]=a,e[2]=i,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 f;e[13]!==n.count?(f=Y(n.count),e[13]=n.count,e[14]=f):f=e[14];let p;e[15]!==n.count||e[16]!==t.summary.previous.count?(p={current:n.count,previous:t.summary.previous.count,goodDirection:"up"},e[15]=n.count,e[16]=t.summary.previous.count,e[17]=p):p=e[17];let x;e[18]!==f||e[19]!==p?(x=s.jsx(T,{label:"Recorded",value:f,delta:p,deltaCaption:"vs previous period"}),e[18]=f,e[19]=p,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(ie,{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(fe,{children:[R,s.jsx(pe,{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]!==a?(N={key:"in",hideOnMobile:!0,header:"In",cell:X=>X.execution_id?s.jsx(ae,{className:"font-mono text-xs hover:underline",href:oe(r,a,X.execution_id),children:X.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},e[55]=r,e[56]=a,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,o]=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:[" ×",o]})]},e)}function Pe(t){return s.jsx("span",{className:"font-mono text-xs",children:t.key})}function Ce(t){return t.key}export{ze as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{x as Oe,c as be,r as Re,o as Pe,j as s,L as ke,J as qe,d as Ee,u as Le,K as Te,i as De}from"./inertia-FoqYZAk8.js";import{C as Me}from"./chart-hover-CEH-DtXO.js";import{V as Ce,D as Ae}from"./chart-panel-CUdIzJvk.js";import{D as ve}from"./data-table-DYi-N0hm.js";import{q as Ie,b as Ne,a4 as ze,E as Se,O as Ke,a5 as He}from"./app-layout-LvxN9xSS.js";import{u as Be,C as Je}from"./use-clipboard-DoENmlWY.js";import{b as ae,c as ce,a as ue,C as de}from"./card-Dpwlr0uY.js";import{u as We,P as Ve,E as Fe}from"./env-layout-HdcOaPPX.js";import{R as Ge}from"./relative-time-DcJbkKlN.js";import{S as Ze}from"./sparkline-cell-DgGij0cu.js";import{S as J,a as Qe}from"./stat-BTzNKTm2.js";import{I as Ue}from"./status-badge-BDkOXa-C.js";import{c as W,p as ge,m as me,a as $e}from"./format-B9SDkrWj.js";import{crashFreeTone as Xe,rate as Ye}from"./release-health-C8WSCDKD.js";import"./series-chart-C5nXIUc5.js";import"./chart-DJHv3R7W.js";import"./use-live-CE_fN5_6.js";import"./segmented-BWee8uc9.js";import"./arrow-up-DG01k9AL.js";const et=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],tt=Oe("refresh-cw",et),st=1500;function ie(t){const e=be.c(17),{code:l,className:p}=t,[,j]=Be(),[x,g]=Re.useState(!1);let r;e[0]!==l||e[1]!==j?(r=()=>{j(l).then(m=>{m&&(g(!0),window.setTimeout(()=>g(!1),st))})},e[0]=l,e[1]=j,e[2]=r):r=e[2];const u=r;let o;e[3]!==p?(o=Pe("relative",p),e[3]=p,e[4]=o):o=e[4];let d;e[5]!==l?(d=s.jsx("pre",{className:"bg-muted overflow-x-auto rounded p-3 pr-10 font-mono text-xs",children:l}),e[5]=l,e[6]=d):d=e[6];const n=x?"Copied code":"Copy code";let i;e[7]!==x?(i=x?s.jsx(Ie,{className:"size-3.5 text-emerald-500"}):s.jsx(Je,{className:"size-3.5 opacity-60"}),e[7]=x,e[8]=i):i=e[8];let a;e[9]!==u||e[10]!==n||e[11]!==i?(a=s.jsx(Ne,{type:"button","aria-label":n,variant:"ghost",size:"icon",className:"absolute top-1.5 right-1.5 size-6",onClick:u,children:i}),e[9]=u,e[10]=n,e[11]=i,e[12]=a):a=e[12];let c;return e[13]!==o||e[14]!==d||e[15]!==a?(c=s.jsxs("div",{className:o,children:[d,a]}),e[13]=o,e[14]=d,e[15]=a,e[16]=c):c=e[16],c}function rt(t){const e=be.c(22),{tokenPrefix:l,newToken:p,className:j}=t,x=p??`${l}…`,g=ot;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ae,{children:s.jsx(ce,{children:"Set up this environment"})}),e[0]=r):r=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("li",{children:["Add the gem",s.jsx(ie,{code:'gem "railwatch"',className:"mt-1.5"})]}),e[1]=u):u=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("li",{children:["Run the generator",s.jsx(ie,{code:"bin/rails generate railwatch:install --cloud",className:"mt-1.5"})]}),e[2]=o):o=e[2];const d=`RAILWATCH_TOKEN=${x}`;let n;e[3]!==d?(n=s.jsx(ie,{code:d,className:"mt-1.5"}),e[3]=d,e[4]=n):n=e[4];let i;e[5]!==p?(i=!p&&s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Showing the token prefix only. The full token is shown once, right after an environment is created."}),e[5]=p,e[6]=i):i=e[6];let a;e[7]!==n||e[8]!==i?(a=s.jsxs("li",{children:["Set the token in the app's environment",n,i]}),e[7]=n,e[8]=i,e[9]=a):a=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs("li",{children:["Check every piece is wired up",s.jsx(ie,{code:"bin/rails railwatch:doctor",className:"mt-1.5"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Prints a ✓/✗ line per check — token, ingest, middleware, routes, deploy marker, browser client, test matchers — and exits non-zero if anything required is missing."})]}),e[10]=c):c=e[10];let m,f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs("li",{children:["Connect your AI assistant",s.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Generate a personal token on your"," ",s.jsx(ke,{href:qe(),className:"underline underline-offset-4",children:"profile page"})," ","for paste-ready Claude Code, Cursor, VS Code, and Zed config."]})]}),m=s.jsx("li",{children:"Deploy"}),e[11]=m,e[12]=f):(m=e[11],f=e[12]);let h;e[13]!==a?(h=s.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[u,o,a,c,f,m]}),e[13]=a,e[14]=h):h=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[s.jsx(ze,{lastSeenAt:null}),"Waiting for first event…"]}),e[15]=y):y=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex items-center justify-between border-t pt-3",children:[y,s.jsxs(Ne,{type:"button",variant:"outline",size:"sm",onClick:g,children:[s.jsx(tt,{className:"size-3.5"}),"Check now"]})]}),e[16]=v):v=e[16];let _;e[17]!==h?(_=s.jsxs(ue,{className:"space-y-4",children:[h,v]}),e[17]=h,e[18]=_):_=e[18];let b;return e[19]!==j||e[20]!==_?(b=s.jsxs(de,{className:j,children:[r,_]}),e[19]=j,e[20]=_,e[21]=b):b=e[21],b}function ot(){return Ee.reload()}function Ht(t){const e=be.c(109),{environment:l}=Le().props,{window:p,label:j}=We(),x=l.application_id,g=l.id,r=t.totals.requests.current,u=t.totals.requests.previous,o=t.totals.jobs.current,d=t.totals.jobs.previous,n=p==="custom"?"vs previous period":`vs previous ${j}`;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[{title:"Overview",href:"#"}],e[0]=i):i=e[0];const a=`${l.application_name} · ${l.name}`;let c;e[1]!==l.last_seen_at?(c=l.last_seen_at?s.jsxs(s.Fragment,{children:["Last event ",s.jsx(Ge,{iso:l.last_seen_at})]}):"No events received yet.",e[1]=l.last_seen_at,e[2]=c):c=e[2];let m;e[3]!==a||e[4]!==c?(m=s.jsx(Ve,{title:a,description:c}),e[3]=a,e[4]=c,e[5]=m):m=e[5];let f;e[6]!==l.last_seen_at||e[7]!==l.token_prefix?(f=!l.last_seen_at&&s.jsx(rt,{tokenPrefix:l.token_prefix}),e[6]=l.last_seen_at,e[7]=l.token_prefix,e[8]=f):f=e[8];let h;e[9]!==r.count?(h={value:r.count,format:W},e[9]=r.count,e[10]=h):h=e[10];let y;e[11]!==r.count||e[12]!==r.errors?(y=ge(r.errors,r.count),e[11]=r.count,e[12]=r.errors,e[13]=y):y=e[13];let v;e[14]!==r.client_errors||e[15]!==r.count?(v=ge(r.client_errors,r.count),e[14]=r.client_errors,e[15]=r.count,e[16]=v):v=e[16];const _=`${y} 5xx · ${v} 4xx`,b=r.errors>0?"warning":void 0;let k;e[17]!==r.count||e[18]!==u.count?(k={current:r.count,previous:u.count,goodDirection:"up"},e[17]=r.count,e[18]=u.count,e[19]=k):k=e[19];let w;e[20]!==n||e[21]!==k||e[22]!==h||e[23]!==_||e[24]!==b?(w=s.jsx(J,{label:"Requests",roll:h,hint:_,tone:b,delta:k,deltaCaption:n}),e[20]=n,e[21]=k,e[22]=h,e[23]=_,e[24]=b,e[25]=w):w=e[25];const he=r.p95/1e3;let C;e[26]!==he?(C=me(he),e[26]=he,e[27]=C):C=e[27];const fe=r.avg/1e3;let V;e[28]!==fe?(V=me(fe),e[28]=fe,e[29]=V):V=e[29];const pe=r.max/1e3;let F;e[30]!==pe?(F=me(pe),e[30]=pe,e[31]=F):F=e[31];const xe=`avg ${V} · max ${F}`;let S;e[32]!==r.p95||e[33]!==u.p95?(S={current:r.p95,previous:u.p95,goodDirection:"down"},e[32]=r.p95,e[33]=u.p95,e[34]=S):S=e[34];let N;e[35]!==n||e[36]!==C||e[37]!==xe||e[38]!==S?(N=s.jsx(J,{label:"Request p95",value:C,hint:xe,delta:S,deltaCaption:n}),e[35]=n,e[36]=C,e[37]=xe,e[38]=S,e[39]=N):N=e[39];let $;e[40]!==o.count?($={value:o.count,format:W},e[40]=o.count,e[41]=$):$=e[41];let G;e[42]!==o.count||e[43]!==o.errors?(G=ge(o.errors,o.count),e[42]=o.count,e[43]=o.errors,e[44]=G):G=e[44];const _e=`${G} failed`,je=o.errors>0?"warning":void 0;let O;e[45]!==o.count||e[46]!==d.count?(O={current:o.count,previous:d.count,goodDirection:"up"},e[45]=o.count,e[46]=d.count,e[47]=O):O=e[47];let R;e[48]!==n||e[49]!==$||e[50]!==_e||e[51]!==je||e[52]!==O?(R=s.jsx(J,{label:"Job attempts",roll:$,hint:_e,tone:je,delta:O,deltaCaption:n}),e[48]=n,e[49]=$,e[50]=_e,e[51]=je,e[52]=O,e[53]=R):R=e[53];const ye=t.issues.length?"destructive":"success";let P;e[54]!==t.issues.length||e[55]!==ye?(P=s.jsx(J,{label:"Open issues",value:t.issues.length,tone:ye}),e[54]=t.issues.length,e[55]=ye,e[56]=P):P=e[56];let q;e[57]!==t.release_health?(q=t.release_health&&s.jsx(J,{label:"Crash-free sessions",value:Ye(t.release_health.crash_free_sessions),tone:Xe(t.release_health.crash_free_sessions),hint:`${t.release_health.ref} · ${W(t.release_health.sessions)} sessions`}),e[57]=t.release_health,e[58]=q):q=e[58];let E;e[59]!==w||e[60]!==N||e[61]!==R||e[62]!==P||e[63]!==q?(E=s.jsxs(Qe,{children:[w,N,R,P,q]}),e[59]=w,e[60]=N,e[61]=R,e[62]=P,e[63]=q,e[64]=E):E=e[64];let L;e[65]!==t.deploys||e[66]!==t.request_series?(L=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Ce,{label:"Requests",data:t.request_series,deploys:t.deploys}),s.jsx(Ae,{label:"Request latency",data:t.request_series,deploys:t.deploys})]}),e[65]=t.deploys,e[66]=t.request_series,e[67]=L):L=e[67];let Z;e[68]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(ae,{children:s.jsx(ce,{children:"Slowest routes (p95)"})}),e[68]=Z):Z=e[68];let T;e[69]!==x||e[70]!==g?(T={key:"name",header:"Route",grow:!0,cell:we=>s.jsx(ke,{className:"font-mono text-xs hover:underline",href:Te(x,g,we.group_hash),children:we.name})},e[69]=x,e[70]=g,e[71]=T):T=e[71];let Q,U,X,Y;e[72]===Symbol.for("react.memo_cache_sentinel")?(Q={key:"trend",hideOnMobile:!0,header:"Trend",cell:vt},U={key:"count",header:"Count",align:"right",cell:yt},X={key:"p95",header:"p95",align:"right",cell:jt},Y={key:"errors",hideOnMobile:!0,header:"5xx",align:"right",cell:_t},e[72]=Q,e[73]=U,e[74]=X,e[75]=Y):(Q=e[72],U=e[73],X=e[74],Y=e[75]);let D;e[76]!==T?(D=[T,Q,U,X,Y],e[76]=T,e[77]=D):D=e[77];let M;e[78]!==t.slow_routes||e[79]!==D?(M=s.jsxs(de,{children:[Z,s.jsx(ue,{children:s.jsx(ve,{rows:t.slow_routes,rowKey:bt,hoverKey:gt,columns:D})})]}),e[78]=t.slow_routes,e[79]=D,e[80]=M):M=e[80];let ee;e[81]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(ae,{children:s.jsx(ce,{children:"Open issues"})}),e[81]=ee):ee=e[81];let te,se;e[82]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Se,{icon:Ke,title:"No open issues",description:"Issues are grouped from repeated request, job, and exception errors."}),se=[{key:"key",header:"Issue",cell:pt},{key:"title",header:"Title",cell:ft},{key:"status",hideOnMobile:!0,header:"",cell:ht},{key:"n",hideOnMobile:!0,header:"Count",align:"right",cell:mt},{key:"last",header:"Last",align:"right",cell:dt}],e[82]=te,e[83]=se):(te=e[82],se=e[83]);let A;e[84]!==t.issues?(A=s.jsxs(de,{children:[ee,s.jsx(ue,{children:s.jsx(ve,{rows:t.issues,rowKey:xt,empty:te,columns:se})})]}),e[84]=t.issues,e[85]=A):A=e[85];let I;e[86]!==M||e[87]!==A?(I=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[M,A]}),e[86]=M,e[87]=A,e[88]=I):I=e[88];let z;e[89]!==t.deploys||e[90]!==t.job_series?(z=s.jsx(Ce,{label:"Jobs",legend:"job",seriesLabel:"Attempts",data:t.job_series,deploys:t.deploys}),e[89]=t.deploys,e[90]=t.job_series,e[91]=z):z=e[91];let re;e[92]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(ae,{children:s.jsx(ce,{children:"Servers"})}),e[92]=re):re=e[92];let K;e[93]!==t.processes?(K=Object.entries(t.processes),e[93]=t.processes,e[94]=K):K=e[94];let oe,le;e[95]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(Se,{icon:He,title:"No process has reported yet",description:"Server processes report here once they boot with the gem installed."}),le=[{key:"server",header:"Server",cell:ct},{key:"role",header:"Role",cell:at},{key:"deploy",header:"Deploy",cell:it},{key:"ver",hideOnMobile:!0,header:"Ruby / Rails",cell:nt},{key:"boot",hideOnMobile:!0,header:"Booted",align:"right",cell:lt}],e[95]=oe,e[96]=le):(oe=e[95],le=e[96]);let H;e[97]!==K?(H=s.jsxs(de,{children:[re,s.jsx(ue,{children:s.jsx(ve,{rows:K,rowKey:ut,empty:oe,columns:le})})]}),e[97]=K,e[98]=H):H=e[98];let B;e[99]!==z||e[100]!==H?(B=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[z,H]}),e[99]=z,e[100]=H,e[101]=B):B=e[101];let ne;return e[102]!==m||e[103]!==E||e[104]!==L||e[105]!==f||e[106]!==I||e[107]!==B?(ne=s.jsx(Fe,{title:"Overview",crumbs:i,children:s.jsxs(Me,{children:[m,f,E,L,I,B]})}),e[102]=m,e[103]=E,e[104]=L,e[105]=f,e[106]=I,e[107]=B,e[108]=ne):ne=e[108],ne}function lt(t){const[,e]=t;return $e(e.booted_at)}function nt(t){const[,e]=t;return`${e.ruby_version} / ${e.rails_version}`}function it(t){const[,e]=t;return s.jsx("span",{className:"font-mono text-xs",children:e.deploy?.slice(0,10)})}function at(t){const[,e]=t;return e.role}function ct(t){const[e]=t;return s.jsx("span",{className:"font-mono text-xs",children:e})}function ut(t){const[e]=t;return e}function dt(t){return $e(t.last_seen_at)}function mt(t){return W(t.occurrences)}function ht(t){return s.jsx(Ue,{status:t.status})}function ft(t){return s.jsx("span",{className:"line-clamp-1 text-xs",children:t.title})}function pt(t){return s.jsx(ke,{className:"font-mono text-xs hover:underline",href:De(t.id),children:t.key})}function xt(t){return t.id}function _t(t){return t.errors}function jt(t){return me(t.p95)}function yt(t){return W(t.count)}function vt(t){return s.jsx(Ze,{data:t.sparkline,hoverKey:t.group_hash})}function gt(t){return t.group_hash}function bt(t){return t.group_hash}export{Ht as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as A,u as B,O as G,j as s,L as J}from"./inertia-FoqYZAk8.js";import{F as K}from"./flamegraph-SKD9yxW9.js";import{P as M,E as Q}from"./env-layout-HdcOaPPX.js";import{S as N,a as T}from"./stat-BTzNKTm2.js";import{C as U,a as V}from"./card-Dpwlr0uY.js";import{e as X}from"./execution-path-CElXXFO_.js";import{w as Y,c as Z,m as z,b as ee}from"./format-B9SDkrWj.js";import"./data-table-DYi-N0hm.js";import"./chart-hover-CEH-DtXO.js";import"./app-layout-LvxN9xSS.js";import"./segmented-BWee8uc9.js";import"./use-live-CE_fN5_6.js";import"./arrow-up-DG01k9AL.js";function me(i){const e=A.c(71),{environment:q,window:I}=B().props,l=q.application_id,r=q.id,t=i.profile,L=t.execution_preview??"Profile";let o;e[0]!==l||e[1]!==r||e[2]!==I?(o=G(l,r,{window:I}),e[0]=l,e[1]=r,e[2]=I,e[3]=o):o=e[3];let a;e[4]!==o?(a={title:"Profiles",href:o},e[4]=o,e[5]=a):a=e[5];const F=t.execution_preview??`Profile ${t.id}`;let n;e[6]!==F?(n={title:F,href:"#"},e[6]=F,e[7]=n):n=e[7];let c;e[8]!==a||e[9]!==n?(c=[a,n],e[8]=a,e[9]=n,e[10]=c):c=e[10];const R=t.execution_preview??`Profile ${t.id}`;let d;e[11]!==R?(d=s.jsx("span",{className:"font-mono",children:R}),e[11]=R,e[12]=d):d=e[12];let p;e[13]!==t.occurred_at?(p=Y(t.occurred_at),e[13]=t.occurred_at,e[14]=p):p=e[14];let f;e[15]!==p?(f=s.jsx("span",{children:p}),e[15]=p,e[16]=f):f=e[16];const D=t.mode?` · ${t.mode}`:"";let u;e[17]!==D||e[18]!==t.profiler?(u=s.jsxs("span",{children:[t.profiler,D]}),e[17]=D,e[18]=t.profiler,e[19]=u):u=e[19];let m;e[20]!==t.server?(m=t.server&&s.jsxs("span",{children:["server ",t.server]}),e[20]=t.server,e[21]=m):m=e[21];let x;e[22]!==t.deploy?(x=t.deploy&&s.jsxs("span",{children:["deploy ",t.deploy.slice(0,12)]}),e[22]=t.deploy,e[23]=x):x=e[23];let v;e[24]!==l||e[25]!==r||e[26]!==t.execution_id||e[27]!==t.execution_source?(v=t.execution_id&&s.jsx(J,{className:"hover:underline",href:X({applicationId:l,environmentId:r,source:t.execution_source,executionId:t.execution_id}),children:"view execution"}),e[24]=l,e[25]=r,e[26]=t.execution_id,e[27]=t.execution_source,e[28]=v):v=e[28];let h;e[29]!==u||e[30]!==m||e[31]!==x||e[32]!==v||e[33]!==f?(h=s.jsxs("span",{className:"flex flex-wrap gap-x-3 text-xs",children:[f,u,m,x,v]}),e[29]=u,e[30]=m,e[31]=x,e[32]=v,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==h||e[36]!==d?(j=s.jsx(M,{withWindow:!1,title:d,description:h}),e[35]=h,e[36]=d,e[37]=j):j=e[37];let _;e[38]!==t.samples?(_=Z(t.samples),e[38]=t.samples,e[39]=_):_=e[39];let w;e[40]!==_?(w=s.jsx(N,{label:"Samples",value:_}),e[40]=_,e[41]=w):w=e[41];let y;e[42]!==t.duration?(y=z(t.duration),e[42]=t.duration,e[43]=y):y=e[43];let P;e[44]!==t.interval?(P=t.interval?`every ${z(t.interval/1e3,2)}`:void 0,e[44]=t.interval,e[45]=P):P=e[45];let b;e[46]!==y||e[47]!==P?(b=s.jsx(N,{label:"Duration",value:y,hint:P}),e[46]=y,e[47]=P,e[48]=b):b=e[48];const H=t.mode??void 0;let S;e[49]!==H||e[50]!==t.profiler?(S=s.jsx(N,{label:"Profiler",value:t.profiler,hint:H}),e[49]=H,e[50]=t.profiler,e[51]=S):S=e[51];let g;e[52]!==t.stacks_bytes?(g=ee(t.stacks_bytes),e[52]=t.stacks_bytes,e[53]=g):g=e[53];const O=i.truncated?"truncated for display":"uncompressed",W=i.truncated?"warning":void 0;let k;e[54]!==g||e[55]!==O||e[56]!==W?(k=s.jsx(N,{label:"Stacks",value:g,hint:O,tone:W}),e[54]=g,e[55]=O,e[56]=W,e[57]=k):k=e[57];let E;e[58]!==w||e[59]!==b||e[60]!==S||e[61]!==k?(E=s.jsxs(T,{children:[w,b,S,k]}),e[58]=w,e[59]=b,e[60]=S,e[61]=k,e[62]=E):E=e[62];let $;e[63]!==i.collapsed?($=s.jsx(U,{children:s.jsx(V,{className:"pt-4",children:s.jsx(K,{collapsed:i.collapsed})})}),e[63]=i.collapsed,e[64]=$):$=e[64];let C;return e[65]!==L||e[66]!==j||e[67]!==E||e[68]!==$||e[69]!==c?(C=s.jsxs(Q,{title:L,crumbs:c,children:[j,E,$]}),e[65]=L,e[66]=j,e[67]=E,e[68]=$,e[69]=c,e[70]=C):C=e[70],C}export{me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as g,u as v,N,j as s,d as P,f as C,L as E,i as S}from"./inertia-FoqYZAk8.js";import{D as y}from"./data-table-DYi-N0hm.js";import{P as $,E as b}from"./env-layout-HdcOaPPX.js";import{I,S as R}from"./status-badge-BDkOXa-C.js";import{C as D,b as H,c as K,a as L}from"./card-Dpwlr0uY.js";import{a as w,w as T,m as B}from"./format-B9SDkrWj.js";import"./chart-hover-CEH-DtXO.js";import"./app-layout-LvxN9xSS.js";import"./use-live-CE_fN5_6.js";import"./segmented-BWee8uc9.js";function oe(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 a;e[0]!==r||e[1]!==i||e[2]!==_?(a=N(r,i,{window:_}),e[0]=r,e[1]=i,e[2]=_,e[3]=a):a=e[3];let o;e[4]!==a?(o={title:"Users",href:a},e[4]=a,e[5]=o):o=e[5];let l;e[6]!==n?(l={title:n,href:"#"},e[6]=n,e[7]=l):l=e[7];let c;e[8]!==o||e[9]!==l?(c=[o,l],e[8]=o,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 f;e[18]!==r||e[19]!==i?(f=k=>k.execution_id&&P.visit(C(r,i,k.execution_id)),e[18]=r,e[19]=i,e[20]=f):f=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 p;e[22]!==t.executions||e[23]!==f?(p=s.jsx(y,{rows:t.executions,rowKey:G,onRowClick:f,columns:x}),e[22]=t.executions,e[23]=f,e[24]=p):p=e[24];let h;return e[25]!==n||e[26]!==c||e[27]!==m||e[28]!==d||e[29]!==p?(h=s.jsxs(b,{title:n,crumbs:c,children:[m,d,p]}),e[25]=n,e[26]=c,e[27]=m,e[28]=d,e[29]=p,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(E,{className:"font-mono text-xs hover:underline",href:S(t.id),children:t.key})}function V(t){return t.id}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,
|
|
1
|
+
import{c as f,o as x,j as c}from"./inertia-FoqYZAk8.js";import{A as p,a as u}from"./arrow-up-DG01k9AL.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-FoqYZAk8.js";import{S as n}from"./series-chart-C5nXIUc5.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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,o as d,j as m}from"./inertia-FoqYZAk8.js";import{B as g}from"./app-layout-LvxN9xSS.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{
|
|
1
|
+
import{am as p}from"./inertia-FoqYZAk8.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{
|
|
1
|
+
import{x as i,c as l,r as p}from"./inertia-FoqYZAk8.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,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};
|