PRODUCTION / POST-TRANSFORM / PRE-BUNDLE
1572 removed ยท 558 addedCompiled sources
compilerbaselineApp.js
1- import { c as _c } from "react/compiler-runtime";21import { useEffect, useState } from "react";32import {43Activity,54ArrowDownUp,65Bell,76Check,87ChevronLeft,98CircleAlert,109Clock3,1110CreditCard,1211Search,1312Server,1413ShieldCheck,1514Star,1615} from "lucide-react";1716import { queues, statuses, visibleIncidents } from "./incidents";1817import { Profiled } from "../benchmark/recorder";1918import { Button, Select, StatusBadge, TextInput } from "./controls";2019import { NotificationsDialog, OperationsDialog, ProfileDialog } from "./workspace";2120import {2221FilterProvider,2322IncidentProvider,2423NotificationProvider,2524SettingsProvider,2625SelectionProvider,2726WorkspaceProvider,2827useFilters,2928useIncidentActions,3029useIncidents,3130useNotifications,3231useUserSettings,3332useSelection,3433useSelectionActions,3534useWorkspace,3635} from "./providers";3736import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";3837function Header() {39- const $ = _c(40);4038const { notifications, markRead, markAllRead } = useNotifications();4139const { settings, saveSettings } = useUserSettings();4240const { incidents } = useIncidents();4341const { setSelectedId } = useSelectionActions();4442const { setQueue } = useWorkspace();4543const { setSearch, setStatus, setFavoritesOnly } = useFilters();4644const [panel, setPanel] = useState(null);47- let t0;48- if ($[0] !== notifications) {49- t0 = notifications.filter(_temp);50- $[0] = notifications;51- $[1] = t0;52- } else {53- t0 = $[1];45+ const unread = notifications.filter((item) => !item.read).length;46+ const initials = settings.displayName47+ .split(/\s+/)48+ .slice(0, 2)49+ .map((part) => part[0])50+ .join("")51+ .toUpperCase();52+ function openNotification(id) {53+ markRead(id);54+ setQueue("All incidents");55+ setSearch("");56+ setStatus("All statuses");57+ setFavoritesOnly(false);58+ setSelectedId(id);59+ setPanel(null);5460}55- const unread = t0.length;56- let t1;57- if ($[2] !== settings.displayName) {58- t1 = settings.displayName.split(/\s+/).slice(0, 2).map(_temp2).join("").toUpperCase();59- $[2] = settings.displayName;60- $[3] = t1;61- } else {62- t1 = $[3];63- }64- const initials = t1;65- let t2;66- if (67- $[4] !== markRead ||68- $[5] !== setFavoritesOnly ||69- $[6] !== setQueue ||70- $[7] !== setSearch ||71- $[8] !== setSelectedId ||72- $[9] !== setStatus73- ) {74- t2 = function openNotification(id) {75- markRead(id);76- setQueue("All incidents");77- setSearch("");78- setStatus("All statuses");79- setFavoritesOnly(false);80- setSelectedId(id);81- setPanel(null);82- };83- $[4] = markRead;84- $[5] = setFavoritesOnly;85- $[6] = setQueue;86- $[7] = setSearch;87- $[8] = setSelectedId;88- $[9] = setStatus;89- $[10] = t2;90- } else {91- t2 = $[10];92- }93- const openNotification = t2;94- let t3;95- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {96- t3 = /* @__PURE__ */ _jsx("span", {97- className: "brand-mark",98- children: /* @__PURE__ */ _jsx(Activity, { size: 19 }),99- });100- $[11] = t3;101- } else {102- t3 = $[11];103- }104- let t4;105- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {106- t4 = /* @__PURE__ */ _jsxs("div", {107- className: "brand",108- children: [109- t3,110- /* @__PURE__ */ _jsxs("span", {111- children: [112- "signal",113- /* @__PURE__ */ _jsx("span", {114- className: "brand-dot",115- children: ".",116- }),117- ],118- }),119- /* @__PURE__ */ _jsx("span", {120- className: "brand-sub",121- children: "/ incident operations",122- }),123- ],124- });125- $[12] = t4;126- } else {127- t4 = $[12];128- }129- let t5;130- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {131- t5 = /* @__PURE__ */ _jsxs("span", {132- className: "environment",133- children: [/* @__PURE__ */ _jsx("span", { className: "live-dot" }), " Production"],134- });135- $[13] = t5;136- } else {137- t5 = $[13];138- }139- let t6;140- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {141- t6 = () => setPanel("notifications");142- $[14] = t6;143- } else {144- t6 = $[14];145- }146- let t7;147- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {148- t7 = /* @__PURE__ */ _jsx(Bell, { size: 16 });149- $[15] = t7;150- } else {151- t7 = $[15];152- }153- let t8;154- if ($[16] !== unread) {155- t8 = /* @__PURE__ */ _jsxs(Button, {156- className: "notification-button",157- onClick: t6,158- "aria-label": "Open notifications",159- "aria-haspopup": "dialog",160- children: [161- t7,162- " Notifications ",163- /* @__PURE__ */ _jsx("strong", {164- "data-testid": "notifications",165- children: unread,166- }),167- ],168- });169- $[16] = unread;170- $[17] = t8;171- } else {172- t8 = $[17];173- }174- const t9 = `Profile settings for ${settings.displayName}`;175- let t10;176- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {177- t10 = () => setPanel("profile");178- $[18] = t10;179- } else {180- t10 = $[18];181- }182- let t11;183- if ($[19] !== initials || $[20] !== t9) {184- t11 = /* @__PURE__ */ _jsx(Button, {185- className: "avatar",186- "aria-label": t9,187- "aria-haspopup": "dialog",188- onClick: t10,189- children: initials,190- });191- $[19] = initials;192- $[20] = t9;193- $[21] = t11;194- } else {195- t11 = $[21];196- }197- let t12;198- if ($[22] !== t11 || $[23] !== t8) {199- t12 = /* @__PURE__ */ _jsxs("div", {200- className: "header-actions",201- children: [t5, t8, t11],202- });203- $[22] = t11;204- $[23] = t8;205- $[24] = t12;206- } else {207- t12 = $[24];208- }209- let t13;210- if (211- $[25] !== incidents ||212- $[26] !== markAllRead ||213- $[27] !== markRead ||214- $[28] !== notifications ||215- $[29] !== openNotification ||216- $[30] !== panel217- ) {218- t13 =61+ return /* @__PURE__ */ _jsxs("header", {62+ className: "topbar",63+ children: [64+ /* @__PURE__ */ _jsxs("div", {65+ className: "brand",66+ children: [67+ /* @__PURE__ */ _jsx("span", {68+ className: "brand-mark",69+ children: /* @__PURE__ */ _jsx(Activity, { size: 19 }),70+ }),71+ /* @__PURE__ */ _jsxs("span", {72+ children: [73+ "signal",74+ /* @__PURE__ */ _jsx("span", {75+ className: "brand-dot",76+ children: ".",77+ }),78+ ],79+ }),80+ /* @__PURE__ */ _jsx("span", {81+ className: "brand-sub",82+ children: "/ incident operations",83+ }),84+ ],85+ }),86+ /* @__PURE__ */ _jsxs("div", {87+ className: "header-actions",88+ children: [89+ /* @__PURE__ */ _jsxs("span", {90+ className: "environment",91+ children: [/* @__PURE__ */ _jsx("span", { className: "live-dot" }), " Production"],92+ }),93+ /* @__PURE__ */ _jsxs(Button, {94+ className: "notification-button",95+ onClick: () => setPanel("notifications"),96+ "aria-label": "Open notifications",97+ "aria-haspopup": "dialog",98+ children: [99+ /* @__PURE__ */ _jsx(Bell, { size: 16 }),100+ " Notifications ",101+ /* @__PURE__ */ _jsx("strong", {102+ "data-testid": "notifications",103+ children: unread,104+ }),105+ ],106+ }),107+ /* @__PURE__ */ _jsx(Button, {108+ className: "avatar",109+ "aria-label": `Profile settings for ${settings.displayName}`,110+ "aria-haspopup": "dialog",111+ onClick: () => setPanel("profile"),112+ children: initials,113+ }),114+ ],115+ }),219116panel === "notifications" &&220- /* @__PURE__ */ _jsx(NotificationsDialog, {221- notifications,222- incidents,223- onRead: markRead,224- onReadAll: markAllRead,225- onOpen: openNotification,226- onClose: () => setPanel(null),227- });228- $[25] = incidents;229- $[26] = markAllRead;230- $[27] = markRead;231- $[28] = notifications;232- $[29] = openNotification;233- $[30] = panel;234- $[31] = t13;235- } else {236- t13 = $[31];237- }238- let t14;239- if ($[32] !== panel || $[33] !== saveSettings || $[34] !== settings) {240- t14 =117+ /* @__PURE__ */ _jsx(NotificationsDialog, {118+ notifications,119+ incidents,120+ onRead: markRead,121+ onReadAll: markAllRead,122+ onOpen: openNotification,123+ onClose: () => setPanel(null),124+ }),241125panel === "profile" &&242- /* @__PURE__ */ _jsx(ProfileDialog, {243- settings,244- onSave: saveSettings,245- onClose: () => setPanel(null),246- });247- $[32] = panel;248- $[33] = saveSettings;249- $[34] = settings;250- $[35] = t14;251- } else {252- t14 = $[35];253- }254- let t15;255- if ($[36] !== t12 || $[37] !== t13 || $[38] !== t14) {256- t15 = /* @__PURE__ */ _jsxs("header", {257- className: "topbar",258- children: [t4, t12, t13, t14],259- });260- $[36] = t12;261- $[37] = t13;262- $[38] = t14;263- $[39] = t15;264- } else {265- t15 = $[39];266- }267- return t15;126+ /* @__PURE__ */ _jsx(ProfileDialog, {127+ settings,128+ onSave: saveSettings,129+ onClose: () => setPanel(null),130+ }),131+ ],132+ });268133}269- function _temp2(part) {270- return part[0];134+ function QueueIcon({ item }) {135+ if (item === "Platform") return /* @__PURE__ */ _jsx(Server, { size: 16 });136+ if (item === "Payments") return /* @__PURE__ */ _jsx(CreditCard, { size: 16 });137+ if (item === "Identity") return /* @__PURE__ */ _jsx(ShieldCheck, { size: 16 });138+ return /* @__PURE__ */ _jsx(Activity, { size: 16 });271139}272- function _temp(item) {273- return !item.read;140+ function QueueItem({ item, count, selected, onSelect }) {141+ const selectQueue = () => onSelect(item);142+ return /* @__PURE__ */ _jsxs(Button, {143+ className: `queue-item ${selected ? "active" : ""}`,144+ onClick: selectQueue,145+ "aria-current": selected ? "page" : undefined,146+ children: [147+ /* @__PURE__ */ _jsx("span", {148+ className: "queue-glyph",149+ children: /* @__PURE__ */ _jsx(QueueIcon, { item }),150+ }),151+ item,152+ /* @__PURE__ */ _jsx("span", {153+ className: "queue-count",154+ children: count,155+ }),156+ ],157+ });274158}275- function QueueIcon(t0) {276- const $ = _c(4);277- const { item } = t0;278- if (item === "Platform") {279- let t1;280- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {281- t1 = /* @__PURE__ */ _jsx(Server, { size: 16 });282- $[0] = t1;283- } else {284- t1 = $[0];285- }286- return t1;287- }288- if (item === "Payments") {289- let t1;290- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {291- t1 = /* @__PURE__ */ _jsx(CreditCard, { size: 16 });292- $[1] = t1;293- } else {294- t1 = $[1];295- }296- return t1;297- }298- if (item === "Identity") {299- let t1;300- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {301- t1 = /* @__PURE__ */ _jsx(ShieldCheck, { size: 16 });302- $[2] = t1;303- } else {304- t1 = $[2];305- }306- return t1;307- }308- let t1;309- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {310- t1 = /* @__PURE__ */ _jsx(Activity, { size: 16 });311- $[3] = t1;312- } else {313- t1 = $[3];314- }315- return t1;316- }317- function QueueItem(t0) {318- const $ = _c(14);319- const { item, count, selected, onSelect } = t0;320- let t1;321- if ($[0] !== item || $[1] !== onSelect) {322- t1 = () => onSelect(item);323- $[0] = item;324- $[1] = onSelect;325- $[2] = t1;326- } else {327- t1 = $[2];328- }329- const selectQueue = t1;330- const t2 = `queue-item ${selected ? "active" : ""}`;331- const t3 = selected ? "page" : undefined;332- let t4;333- if ($[3] !== item) {334- t4 = /* @__PURE__ */ _jsx("span", {335- className: "queue-glyph",336- children: /* @__PURE__ */ _jsx(QueueIcon, { item }),337- });338- $[3] = item;339- $[4] = t4;340- } else {341- t4 = $[4];342- }343- let t5;344- if ($[5] !== count) {345- t5 = /* @__PURE__ */ _jsx("span", {346- className: "queue-count",347- children: count,348- });349- $[5] = count;350- $[6] = t5;351- } else {352- t5 = $[6];353- }354- let t6;355- if (356- $[7] !== item ||357- $[8] !== selectQueue ||358- $[9] !== t2 ||359- $[10] !== t3 ||360- $[11] !== t4 ||361- $[12] !== t5362- ) {363- t6 = /* @__PURE__ */ _jsxs(Button, {364- className: t2,365- onClick: selectQueue,366- "aria-current": t3,367- children: [t4, item, t5],368- });369- $[7] = item;370- $[8] = selectQueue;371- $[9] = t2;372- $[10] = t3;373- $[11] = t4;374- $[12] = t5;375- $[13] = t6;376- } else {377- t6 = $[13];378- }379- return t6;380- }381- function QueueNavigation(t0) {382- const $ = _c(5);383- const { selectedQueue, onSelect } = t0;384- let t1;385- if ($[0] !== onSelect || $[1] !== selectedQueue) {386- t1 = queues.map((item, index) =>159+ function QueueNavigation({ selectedQueue, onSelect }) {160+ return /* @__PURE__ */ _jsx("nav", {161+ "aria-label": "Incident queues",162+ children: queues.map((item, index) =>387163/* @__PURE__ */ _jsx(388164Profiled,389165{390166id: `queue:${item}`,391167children: /* @__PURE__ */ _jsx(QueueItem, {392168item,393169count: index === 0 ? 200 : index === 3 ? 66 : 67,394170selected: selectedQueue === item,395171onSelect,396172}),397173},398174item,399175),400- );401- $[0] = onSelect;402- $[1] = selectedQueue;403- $[2] = t1;404- } else {405- t1 = $[2];406- }407- let t2;408- if ($[3] !== t1) {409- t2 = /* @__PURE__ */ _jsx("nav", {410- "aria-label": "Incident queues",411- children: t1,412- });413- $[3] = t1;414- $[4] = t2;415- } else {416- t2 = $[4];417- }418- return t2;176+ ),177+ });419178}420179function SidebarFooter() {421- const $ = _c(24);422180const { incidents } = useIncidents();423181const { setQueue } = useWorkspace();424182const { setSelectedId } = useSelectionActions();425183const { setSearch, setStatus, setSort, setFavoritesOnly } = useFilters();426184const [open, setOpen] = useState(false);427- let t0;428- if ($[0] !== incidents) {429- t0 = incidents.filter(_temp3);430- $[0] = incidents;431- $[1] = t0;432- } else {433- t0 = $[1];185+ const active = incidents.filter((incident) => incident.status !== "Resolved").length;186+ function navigate(queue) {187+ setQueue(queue);188+ setSearch("");189+ setStatus("All statuses");190+ setSort("newest");191+ setFavoritesOnly(false);192+ setSelectedId(null);193+ setOpen(false);434194}435- const active = t0.length;436- let t1;437- if (438- $[2] !== setFavoritesOnly ||439- $[3] !== setQueue ||440- $[4] !== setSearch ||441- $[5] !== setSelectedId ||442- $[6] !== setSort ||443- $[7] !== setStatus444- ) {445- t1 = function navigate(queue) {446- setQueue(queue);447- setSearch("");448- setStatus("All statuses");449- setSort("newest");450- setFavoritesOnly(false);451- setSelectedId(null);452- setOpen(false);453- };454- $[2] = setFavoritesOnly;455- $[3] = setQueue;456- $[4] = setSearch;457- $[5] = setSelectedId;458- $[6] = setSort;459- $[7] = setStatus;460- $[8] = t1;461- } else {462- t1 = $[8];463- }464- const navigate = t1;465- let t2;466- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {467- t2 = () => setOpen(true);468- $[9] = t2;469- } else {470- t2 = $[9];471- }472- let t3;473- let t4;474- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {475- t3 = /* @__PURE__ */ _jsx("span", {476- className: "sidebar-footer-icon",477- children: /* @__PURE__ */ _jsx(CircleAlert, { size: 17 }),478- });479- t4 = /* @__PURE__ */ _jsx("strong", { children: "Operations desk" });480- $[10] = t3;481- $[11] = t4;482- } else {483- t3 = $[10];484- t4 = $[11];485- }486- let t5;487- if ($[12] !== active) {488- t5 = /* @__PURE__ */ _jsxs("span", {489- children: [t4, /* @__PURE__ */ _jsxs("small", { children: [active, " active incidents"] })],490- });491- $[12] = active;492- $[13] = t5;493- } else {494- t5 = $[13];495- }496- let t6;497- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {498- t6 = /* @__PURE__ */ _jsx("span", { className: "live-dot" });499- $[14] = t6;500- } else {501- t6 = $[14];502- }503- let t7;504- if ($[15] !== t5) {505- t7 = /* @__PURE__ */ _jsxs(Button, {506- className: "sidebar-footer",507- "aria-label": "Open operations desk",508- "aria-haspopup": "dialog",509- onClick: t2,510- children: [t3, t5, t6],511- });512- $[15] = t5;513- $[16] = t7;514- } else {515- t7 = $[16];516- }517- let t8;518- if ($[17] !== incidents || $[18] !== navigate || $[19] !== open) {519- t8 =195+ return /* @__PURE__ */ _jsxs(_Fragment, {196+ children: [197+ /* @__PURE__ */ _jsxs(Button, {198+ className: "sidebar-footer",199+ "aria-label": "Open operations desk",200+ "aria-haspopup": "dialog",201+ onClick: () => setOpen(true),202+ children: [203+ /* @__PURE__ */ _jsx("span", {204+ className: "sidebar-footer-icon",205+ children: /* @__PURE__ */ _jsx(CircleAlert, { size: 17 }),206+ }),207+ /* @__PURE__ */ _jsxs("span", {208+ children: [209+ /* @__PURE__ */ _jsx("strong", { children: "Operations desk" }),210+ /* @__PURE__ */ _jsxs("small", { children: [active, " active incidents"] }),211+ ],212+ }),213+ /* @__PURE__ */ _jsx("span", { className: "live-dot" }),214+ ],215+ }),520216open &&521- /* @__PURE__ */ _jsx(OperationsDialog, {522- incidents,523- onNavigate: navigate,524- onClose: () => setOpen(false),525- });526- $[17] = incidents;527- $[18] = navigate;528- $[19] = open;529- $[20] = t8;530- } else {531- t8 = $[20];532- }533- let t9;534- if ($[21] !== t7 || $[22] !== t8) {535- t9 = /* @__PURE__ */ _jsxs(_Fragment, { children: [t7, t8] });536- $[21] = t7;537- $[22] = t8;538- $[23] = t9;539- } else {540- t9 = $[23];541- }542- return t9;217+ /* @__PURE__ */ _jsx(OperationsDialog, {218+ incidents,219+ onNavigate: navigate,220+ onClose: () => setOpen(false),221+ }),222+ ],223+ });543224}544- function _temp3(incident) {545- return incident.status !== "Resolved";546- }547225function Sidebar() {548- const $ = _c(8);549226const { queue, setQueue } = useWorkspace();550- let t0;551- let t1;552- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {553- t0 = /* @__PURE__ */ _jsxs("div", {554- className: "section-label",555- children: ["WORKSPACE ", /* @__PURE__ */ _jsx("span", { children: "01 / 04" })],556- });557- t1 = /* @__PURE__ */ _jsx("div", {558- className: "sidebar-heading",559- children: "Queues",560- });561- $[0] = t0;562- $[1] = t1;563- } else {564- t0 = $[0];565- t1 = $[1];566- }567- let t2;568- if ($[2] !== queue || $[3] !== setQueue) {569- t2 = /* @__PURE__ */ _jsx(QueueNavigation, {570- selectedQueue: queue,571- onSelect: setQueue,572- });573- $[2] = queue;574- $[3] = setQueue;575- $[4] = t2;576- } else {577- t2 = $[4];578- }579- let t3;580- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {581- t3 = /* @__PURE__ */ _jsx(SidebarFooter, {});582- $[5] = t3;583- } else {584- t3 = $[5];585- }586- let t4;587- if ($[6] !== t2) {588- t4 = /* @__PURE__ */ _jsxs("aside", {589- className: "sidebar",590- children: [t0, t1, t2, t3],591- });592- $[6] = t2;593- $[7] = t4;594- } else {595- t4 = $[7];596- }597- return t4;227+ return /* @__PURE__ */ _jsxs("aside", {228+ className: "sidebar",229+ children: [230+ /* @__PURE__ */ _jsxs("div", {231+ className: "section-label",232+ children: ["WORKSPACE ", /* @__PURE__ */ _jsx("span", { children: "01 / 04" })],233+ }),234+ /* @__PURE__ */ _jsx("div", {235+ className: "sidebar-heading",236+ children: "Queues",237+ }),238+ /* @__PURE__ */ _jsx(QueueNavigation, {239+ selectedQueue: queue,240+ onSelect: setQueue,241+ }),242+ /* @__PURE__ */ _jsx(SidebarFooter, {}),243+ ],244+ });598245}599- function Toolbar(t0) {600- const $ = _c(74);601- const { incidents } = t0;246+ function Toolbar({ incidents }) {602247const { search, setSearch, status, setStatus, sort, setSort, favoritesOnly, setFavoritesOnly } =603248useFilters();604249const count = incidents.length;605- let t1;606- if ($[0] !== incidents) {607- t1 = statuses.map((item) => incidents.filter((incident) => incident.status === item).length);608- $[0] = incidents;609- $[1] = t1;610- } else {611- t1 = $[1];612- }613- const statusCounts = t1;614- let t2;615- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {616- t2 = /* @__PURE__ */ _jsxs("div", {617- children: [618- /* @__PURE__ */ _jsx("div", {619- className: "eyebrow",620- children: "OPERATIONS / INCIDENTS",621- }),622- /* @__PURE__ */ _jsx("h1", { children: "Incident triage" }),623- /* @__PURE__ */ _jsx("p", {624- children: "Monitor, investigate, and resolve service disruptions.",625- }),626- ],627- });628- $[2] = t2;629- } else {630- t2 = $[2];631- }632- let t3;633- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {634- t3 = /* @__PURE__ */ _jsxs("div", {635- className: "content-heading",636- children: [637- t2,638- /* @__PURE__ */ _jsxs("div", {639- className: "date-stamp",640- children: [/* @__PURE__ */ _jsx(Clock3, { size: 15 }), " Live workspace"],641- }),642- ],643- });644- $[3] = t3;645- } else {646- t3 = $[3];647- }648- let t4;649- let t5;650- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {651- t4 = /* @__PURE__ */ _jsx("span", {652- className: "summary-icon orange",653- children: /* @__PURE__ */ _jsx(CircleAlert, { size: 17 }),654- });655- t5 = /* @__PURE__ */ _jsx("small", { children: "TOTAL INCIDENTS" });656- $[4] = t4;657- $[5] = t5;658- } else {659- t4 = $[4];660- t5 = $[5];661- }662- let t6;663- if ($[6] !== count) {664- t6 = /* @__PURE__ */ _jsxs("div", {665- children: [666- t4,667- /* @__PURE__ */ _jsxs("span", {668- children: [669- t5,670- /* @__PURE__ */ _jsx("strong", {671- "data-testid": "total",672- children: count,673- }),674- ],675- }),676- ],677- });678- $[6] = count;679- $[7] = t6;680- } else {681- t6 = $[7];682- }683- let t7;684- let t8;685- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {686- t7 = /* @__PURE__ */ _jsx("span", {687- className: "summary-icon red",688- children: /* @__PURE__ */ _jsx(Activity, { size: 17 }),689- });690- t8 = /* @__PURE__ */ _jsx("small", { children: "OPEN" });691- $[8] = t7;692- $[9] = t8;693- } else {694- t7 = $[8];695- t8 = $[9];696- }697- let t9;698- if ($[10] !== statusCounts[0]) {699- t9 = /* @__PURE__ */ _jsxs("div", {700- children: [701- t7,702- /* @__PURE__ */ _jsxs("span", {703- children: [704- t8,705- /* @__PURE__ */ _jsx("strong", {706- "data-testid": "open-count",707- children: statusCounts[0],708- }),709- ],710- }),711- ],712- });713- $[10] = statusCounts[0];714- $[11] = t9;715- } else {716- t9 = $[11];717- }718- let t10;719- let t11;720- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {721- t10 = /* @__PURE__ */ _jsx("span", {722- className: "summary-icon blue",723- children: /* @__PURE__ */ _jsx(Clock3, { size: 17 }),724- });725- t11 = /* @__PURE__ */ _jsx("small", { children: "INVESTIGATING" });726- $[12] = t10;727- $[13] = t11;728- } else {729- t10 = $[12];730- t11 = $[13];731- }732- let t12;733- if ($[14] !== statusCounts[1]) {734- t12 = /* @__PURE__ */ _jsxs("div", {735- children: [736- t10,737- /* @__PURE__ */ _jsxs("span", {738- children: [t11, /* @__PURE__ */ _jsx("strong", { children: statusCounts[1] })],739- }),740- ],741- });742- $[14] = statusCounts[1];743- $[15] = t12;744- } else {745- t12 = $[15];746- }747- let t13;748- let t14;749- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {750- t13 = /* @__PURE__ */ _jsx("span", {751- className: "summary-icon green",752- children: /* @__PURE__ */ _jsx(Check, { size: 17 }),753- });754- t14 = /* @__PURE__ */ _jsx("small", { children: "RESOLVED" });755- $[16] = t13;756- $[17] = t14;757- } else {758- t13 = $[16];759- t14 = $[17];760- }761- let t15;762- if ($[18] !== statusCounts[2]) {763- t15 = /* @__PURE__ */ _jsxs("div", {764- children: [765- t13,766- /* @__PURE__ */ _jsxs("span", {767- children: [t14, /* @__PURE__ */ _jsx("strong", { children: statusCounts[2] })],768- }),769- ],770- });771- $[18] = statusCounts[2];772- $[19] = t15;773- } else {774- t15 = $[19];775- }776- let t16;777- if ($[20] !== t12 || $[21] !== t15 || $[22] !== t6 || $[23] !== t9) {778- t16 = /* @__PURE__ */ _jsxs("div", {779- className: "summary",780- children: [t6, t9, t12, t15],781- });782- $[20] = t12;783- $[21] = t15;784- $[22] = t6;785- $[23] = t9;786- $[24] = t16;787- } else {788- t16 = $[24];789- }790- let t17;791- if ($[25] !== count) {792- t17 = /* @__PURE__ */ _jsxs("h2", {793- children: ["Incidents ", /* @__PURE__ */ _jsx("span", { children: count })],794- });795- $[25] = count;796- $[26] = t17;797- } else {798- t17 = $[26];799- }800- let t18;801- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {802- t18 = /* @__PURE__ */ _jsx("p", { children: "Manage and track your active incidents" });803- $[27] = t18;804- } else {805- t18 = $[27];806- }807- let t19;808- if ($[28] !== t17) {809- t19 = /* @__PURE__ */ _jsxs("div", { children: [t17, t18] });810- $[28] = t17;811- $[29] = t19;812- } else {813- t19 = $[29];814- }815- let t20;816- if ($[30] !== favoritesOnly || $[31] !== setFavoritesOnly) {817- t20 = () => setFavoritesOnly(!favoritesOnly);818- $[30] = favoritesOnly;819- $[31] = setFavoritesOnly;820- $[32] = t20;821- } else {822- t20 = $[32];823- }824- const t21 = favoritesOnly ? "currentColor" : "none";825- let t22;826- if ($[33] !== t21) {827- t22 = /* @__PURE__ */ _jsx(Star, {828- size: 16,829- fill: t21,830- });831- $[33] = t21;832- $[34] = t22;833- } else {834- t22 = $[34];835- }836- let t23;837- if ($[35] !== favoritesOnly || $[36] !== t20 || $[37] !== t22) {838- t23 = /* @__PURE__ */ _jsxs(Button, {839- className: "favorites-filter",840- "aria-label": "Favorites only",841- "aria-pressed": favoritesOnly,842- onClick: t20,843- children: [t22, " Favorites"],844- });845- $[35] = favoritesOnly;846- $[36] = t20;847- $[37] = t22;848- $[38] = t23;849- } else {850- t23 = $[38];851- }852- let t24;853- if ($[39] === Symbol.for("react.memo_cache_sentinel")) {854- t24 = /* @__PURE__ */ _jsx(Search, { size: 16 });855- $[39] = t24;856- } else {857- t24 = $[39];858- }859- let t25;860- if ($[40] !== setSearch) {861- t25 = (event) => setSearch(event.target.value);862- $[40] = setSearch;863- $[41] = t25;864- } else {865- t25 = $[41];866- }867- let t26;868- if ($[42] !== search || $[43] !== t25) {869- t26 = /* @__PURE__ */ _jsxs("label", {870- className: "search-field",871- htmlFor: "incident-search",872- children: [873- t24,874- /* @__PURE__ */ _jsx(TextInput, {875- id: "incident-search",876- "aria-label": "Search incidents",877- placeholder: "Search incidents...",878- value: search,879- onChange: t25,880- }),881- ],882- });883- $[42] = search;884- $[43] = t25;885- $[44] = t26;886- } else {887- t26 = $[44];888- }889- let t27;890- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {891- t27 = /* @__PURE__ */ _jsx("span", {892- className: "sr-only",893- children: "Status",894- });895- $[45] = t27;896- } else {897- t27 = $[45];898- }899- let t28;900- if ($[46] !== setStatus) {901- t28 = (event_0) => setStatus(event_0.target.value);902- $[46] = setStatus;903- $[47] = t28;904- } else {905- t28 = $[47];906- }907- let t29;908- let t30;909- if ($[48] === Symbol.for("react.memo_cache_sentinel")) {910- t29 = /* @__PURE__ */ _jsx("option", { children: "All statuses" });911- t30 = statuses.map(_temp4);912- $[48] = t29;913- $[49] = t30;914- } else {915- t29 = $[48];916- t30 = $[49];917- }918- let t31;919- if ($[50] !== status || $[51] !== t28) {920- t31 = /* @__PURE__ */ _jsxs("label", {921- className: "select-field",922- htmlFor: "incident-status",923- children: [924- t27,925- /* @__PURE__ */ _jsxs(Select, {926- id: "incident-status",927- "aria-label": "Status",928- value: status,929- onChange: t28,930- children: [t29, t30],931- }),932- ],933- });934- $[50] = status;935- $[51] = t28;936- $[52] = t31;937- } else {938- t31 = $[52];939- }940- let t32;941- let t33;942- if ($[53] === Symbol.for("react.memo_cache_sentinel")) {943- t32 = /* @__PURE__ */ _jsx(ArrowDownUp, { size: 15 });944- t33 = /* @__PURE__ */ _jsx("span", {945- className: "sr-only",946- children: "Sort",947- });948- $[53] = t32;949- $[54] = t33;950- } else {951- t32 = $[53];952- t33 = $[54];953- }954- let t34;955- if ($[55] !== setSort) {956- t34 = (event_1) => setSort(event_1.target.value);957- $[55] = setSort;958- $[56] = t34;959- } else {960- t34 = $[56];961- }962- let t35;963- let t36;964- let t37;965- if ($[57] === Symbol.for("react.memo_cache_sentinel")) {966- t35 = /* @__PURE__ */ _jsx("option", {967- value: "newest",968- children: "Newest first",969- });970- t36 = /* @__PURE__ */ _jsx("option", {971- value: "oldest",972- children: "Oldest first",973- });974- t37 = /* @__PURE__ */ _jsx("option", {975- value: "severity",976- children: "Severity",977- });978- $[57] = t35;979- $[58] = t36;980- $[59] = t37;981- } else {982- t35 = $[57];983- t36 = $[58];984- t37 = $[59];985- }986- let t38;987- if ($[60] !== sort || $[61] !== t34) {988- t38 = /* @__PURE__ */ _jsxs("label", {989- className: "select-field sort-field",990- htmlFor: "incident-sort",991- children: [992- t32,993- t33,994- /* @__PURE__ */ _jsxs(Select, {995- id: "incident-sort",996- "aria-label": "Sort",997- value: sort,998- onChange: t34,999- children: [t35, t36, t37],1000- }),1001- ],1002- });1003- $[60] = sort;1004- $[61] = t34;1005- $[62] = t38;1006- } else {1007- t38 = $[62];1008- }1009- let t39;1010- if ($[63] !== t23 || $[64] !== t26 || $[65] !== t31 || $[66] !== t38) {1011- t39 = /* @__PURE__ */ _jsxs("div", {1012- className: "filters",1013- children: [t23, t26, t31, t38],1014- });1015- $[63] = t23;1016- $[64] = t26;1017- $[65] = t31;1018- $[66] = t38;1019- $[67] = t39;1020- } else {1021- t39 = $[67];1022- }1023- let t40;1024- if ($[68] !== t19 || $[69] !== t39) {1025- t40 = /* @__PURE__ */ _jsxs("div", {1026- className: "list-top",1027- children: [t19, t39],1028- });1029- $[68] = t19;1030- $[69] = t39;1031- $[70] = t40;1032- } else {1033- t40 = $[70];1034- }1035- let t41;1036- if ($[71] !== t16 || $[72] !== t40) {1037- t41 = /* @__PURE__ */ _jsxs(_Fragment, { children: [t3, t16, t40] });1038- $[71] = t16;1039- $[72] = t40;1040- $[73] = t41;1041- } else {1042- t41 = $[73];1043- }1044- return t41;250+ const statusCounts = statuses.map(251+ (item) => incidents.filter((incident) => incident.status === item).length,252+ );253+ return /* @__PURE__ */ _jsxs(_Fragment, {254+ children: [255+ /* @__PURE__ */ _jsxs("div", {256+ className: "content-heading",257+ children: [258+ /* @__PURE__ */ _jsxs("div", {259+ children: [260+ /* @__PURE__ */ _jsx("div", {261+ className: "eyebrow",262+ children: "OPERATIONS / INCIDENTS",263+ }),264+ /* @__PURE__ */ _jsx("h1", { children: "Incident triage" }),265+ /* @__PURE__ */ _jsx("p", {266+ children: "Monitor, investigate, and resolve service disruptions.",267+ }),268+ ],269+ }),270+ /* @__PURE__ */ _jsxs("div", {271+ className: "date-stamp",272+ children: [/* @__PURE__ */ _jsx(Clock3, { size: 15 }), " Live workspace"],273+ }),274+ ],275+ }),276+ /* @__PURE__ */ _jsxs("div", {277+ className: "summary",278+ children: [279+ /* @__PURE__ */ _jsxs("div", {280+ children: [281+ /* @__PURE__ */ _jsx("span", {282+ className: "summary-icon orange",283+ children: /* @__PURE__ */ _jsx(CircleAlert, { size: 17 }),284+ }),285+ /* @__PURE__ */ _jsxs("span", {286+ children: [287+ /* @__PURE__ */ _jsx("small", { children: "TOTAL INCIDENTS" }),288+ /* @__PURE__ */ _jsx("strong", {289+ "data-testid": "total",290+ children: count,291+ }),292+ ],293+ }),294+ ],295+ }),296+ /* @__PURE__ */ _jsxs("div", {297+ children: [298+ /* @__PURE__ */ _jsx("span", {299+ className: "summary-icon red",300+ children: /* @__PURE__ */ _jsx(Activity, { size: 17 }),301+ }),302+ /* @__PURE__ */ _jsxs("span", {303+ children: [304+ /* @__PURE__ */ _jsx("small", { children: "OPEN" }),305+ /* @__PURE__ */ _jsx("strong", {306+ "data-testid": "open-count",307+ children: statusCounts[0],308+ }),309+ ],310+ }),311+ ],312+ }),313+ /* @__PURE__ */ _jsxs("div", {314+ children: [315+ /* @__PURE__ */ _jsx("span", {316+ className: "summary-icon blue",317+ children: /* @__PURE__ */ _jsx(Clock3, { size: 17 }),318+ }),319+ /* @__PURE__ */ _jsxs("span", {320+ children: [321+ /* @__PURE__ */ _jsx("small", { children: "INVESTIGATING" }),322+ /* @__PURE__ */ _jsx("strong", { children: statusCounts[1] }),323+ ],324+ }),325+ ],326+ }),327+ /* @__PURE__ */ _jsxs("div", {328+ children: [329+ /* @__PURE__ */ _jsx("span", {330+ className: "summary-icon green",331+ children: /* @__PURE__ */ _jsx(Check, { size: 17 }),332+ }),333+ /* @__PURE__ */ _jsxs("span", {334+ children: [335+ /* @__PURE__ */ _jsx("small", { children: "RESOLVED" }),336+ /* @__PURE__ */ _jsx("strong", { children: statusCounts[2] }),337+ ],338+ }),339+ ],340+ }),341+ ],342+ }),343+ /* @__PURE__ */ _jsxs("div", {344+ className: "list-top",345+ children: [346+ /* @__PURE__ */ _jsxs("div", {347+ children: [348+ /* @__PURE__ */ _jsxs("h2", {349+ children: ["Incidents ", /* @__PURE__ */ _jsx("span", { children: count })],350+ }),351+ /* @__PURE__ */ _jsx("p", { children: "Manage and track your active incidents" }),352+ ],353+ }),354+ /* @__PURE__ */ _jsxs("div", {355+ className: "filters",356+ children: [357+ /* @__PURE__ */ _jsxs(Button, {358+ className: "favorites-filter",359+ "aria-label": "Favorites only",360+ "aria-pressed": favoritesOnly,361+ onClick: () => setFavoritesOnly(!favoritesOnly),362+ children: [363+ /* @__PURE__ */ _jsx(Star, {364+ size: 16,365+ fill: favoritesOnly ? "currentColor" : "none",366+ }),367+ " Favorites",368+ ],369+ }),370+ /* @__PURE__ */ _jsxs("label", {371+ className: "search-field",372+ htmlFor: "incident-search",373+ children: [374+ /* @__PURE__ */ _jsx(Search, { size: 16 }),375+ /* @__PURE__ */ _jsx(TextInput, {376+ id: "incident-search",377+ "aria-label": "Search incidents",378+ placeholder: "Search incidents...",379+ value: search,380+ onChange: (event) => setSearch(event.target.value),381+ }),382+ ],383+ }),384+ /* @__PURE__ */ _jsxs("label", {385+ className: "select-field",386+ htmlFor: "incident-status",387+ children: [388+ /* @__PURE__ */ _jsx("span", {389+ className: "sr-only",390+ children: "Status",391+ }),392+ /* @__PURE__ */ _jsxs(Select, {393+ id: "incident-status",394+ "aria-label": "Status",395+ value: status,396+ onChange: (event) => setStatus(event.target.value),397+ children: [398+ /* @__PURE__ */ _jsx("option", { children: "All statuses" }),399+ statuses.map((item) =>400+ /* @__PURE__ */ _jsx("option", { children: item }, item),401+ ),402+ ],403+ }),404+ ],405+ }),406+ /* @__PURE__ */ _jsxs("label", {407+ className: "select-field sort-field",408+ htmlFor: "incident-sort",409+ children: [410+ /* @__PURE__ */ _jsx(ArrowDownUp, { size: 15 }),411+ /* @__PURE__ */ _jsx("span", {412+ className: "sr-only",413+ children: "Sort",414+ }),415+ /* @__PURE__ */ _jsxs(Select, {416+ id: "incident-sort",417+ "aria-label": "Sort",418+ value: sort,419+ onChange: (event) => setSort(event.target.value),420+ children: [421+ /* @__PURE__ */ _jsx("option", {422+ value: "newest",423+ children: "Newest first",424+ }),425+ /* @__PURE__ */ _jsx("option", {426+ value: "oldest",427+ children: "Oldest first",428+ }),429+ /* @__PURE__ */ _jsx("option", {430+ value: "severity",431+ children: "Severity",432+ }),433+ ],434+ }),435+ ],436+ }),437+ ],438+ }),439+ ],440+ }),441+ ],442+ });1045443}1046- function _temp4(item_0) {1047- return /* @__PURE__ */ _jsx("option", { children: item_0 }, item_0);444+ function OpenIncidentButton({ id, title, severity, onOpen }) {445+ return /* @__PURE__ */ _jsxs(Button, {446+ className: "row-open",447+ onClick: onOpen,448+ "aria-label": `Open ${id}`,449+ children: [450+ /* @__PURE__ */ _jsx("span", { className: `severity-mark ${severity.toLowerCase()}` }),451+ /* @__PURE__ */ _jsx("span", {452+ className: "incident-title",453+ children: title,454+ }),455+ /* @__PURE__ */ _jsx("span", {456+ className: "incident-id",457+ children: id,458+ }),459+ ],460+ });1048461}1049- function OpenIncidentButton(t0) {1050- const $ = _c(14);1051- const { id, title, severity, onOpen } = t0;1052- const t1 = `Open ${id}`;1053- let t2;1054- if ($[0] !== severity) {1055- t2 = severity.toLowerCase();1056- $[0] = severity;1057- $[1] = t2;1058- } else {1059- t2 = $[1];1060- }1061- const t3 = `severity-mark ${t2}`;1062- let t4;1063- if ($[2] !== t3) {1064- t4 = /* @__PURE__ */ _jsx("span", { className: t3 });1065- $[2] = t3;1066- $[3] = t4;1067- } else {1068- t4 = $[3];1069- }1070- let t5;1071- if ($[4] !== title) {1072- t5 = /* @__PURE__ */ _jsx("span", {1073- className: "incident-title",1074- children: title,1075- });1076- $[4] = title;1077- $[5] = t5;1078- } else {1079- t5 = $[5];1080- }1081- let t6;1082- if ($[6] !== id) {1083- t6 = /* @__PURE__ */ _jsx("span", {1084- className: "incident-id",1085- children: id,1086- });1087- $[6] = id;1088- $[7] = t6;1089- } else {1090- t6 = $[7];1091- }1092- let t7;1093- if ($[8] !== onOpen || $[9] !== t1 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6) {1094- t7 = /* @__PURE__ */ _jsxs(Button, {1095- className: "row-open",1096- onClick: onOpen,1097- "aria-label": t1,1098- children: [t4, t5, t6],1099- });1100- $[8] = onOpen;1101- $[9] = t1;1102- $[10] = t4;1103- $[11] = t5;1104- $[12] = t6;1105- $[13] = t7;1106- } else {1107- t7 = $[13];1108- }1109- return t7;1110- }1111- function FavoriteButton(t0) {1112- const $ = _c(8);1113- const { id, favorite, onToggle } = t0;1114- const t1 = `favorite ${favorite ? "is-favorite" : ""}`;1115- const t2 = `${favorite ? "Unfavorite" : "Favorite"} ${id}`;1116- const t3 = favorite ? "currentColor" : "none";1117- let t4;1118- if ($[0] !== t3) {1119- t4 = /* @__PURE__ */ _jsx(Star, {462+ function FavoriteButton({ id, favorite, onToggle }) {463+ return /* @__PURE__ */ _jsx(Button, {464+ className: `favorite ${favorite ? "is-favorite" : ""}`,465+ "aria-label": `${favorite ? "Unfavorite" : "Favorite"} ${id}`,466+ "aria-pressed": favorite,467+ onClick: onToggle,468+ children: /* @__PURE__ */ _jsx(Star, {1120469size: 16,1121- fill: t3,1122- });1123- $[0] = t3;1124- $[1] = t4;1125- } else {1126- t4 = $[1];1127- }1128- let t5;1129- if ($[2] !== favorite || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2 || $[6] !== t4) {1130- t5 = /* @__PURE__ */ _jsx(Button, {1131- className: t1,1132- "aria-label": t2,1133- "aria-pressed": favorite,1134- onClick: onToggle,1135- children: t4,1136- });1137- $[2] = favorite;1138- $[3] = onToggle;1139- $[4] = t1;1140- $[5] = t2;1141- $[6] = t4;1142- $[7] = t5;1143- } else {1144- t5 = $[7];1145- }1146- return t5;470+ fill: favorite ? "currentColor" : "none",471+ }),472+ });1147473}1148- function IncidentRow(t0) {1149- const $ = _c(43);1150- const { incident, selected } = t0;474+ function IncidentRow({ incident, selected }) {1151475const { setSelectedId } = useSelectionActions();1152476const { toggleFavorite } = useIncidentActions();1153- let t1;1154- if ($[0] !== incident.id || $[1] !== setSelectedId) {1155- t1 = () => setSelectedId(incident.id);1156- $[0] = incident.id;1157- $[1] = setSelectedId;1158- $[2] = t1;1159- } else {1160- t1 = $[2];1161- }1162- const openIncident = t1;1163- let t2;1164- if ($[3] !== incident.id || $[4] !== toggleFavorite) {1165- t2 = () => toggleFavorite(incident.id);1166- $[3] = incident.id;1167- $[4] = toggleFavorite;1168- $[5] = t2;1169- } else {1170- t2 = $[5];1171- }1172- const toggleIncidentFavorite = t2;1173- const t3 = selected ? "selected" : "";1174- const t4 = `button:open:${incident.id}`;1175- let t5;1176- if (1177- $[6] !== incident.id ||1178- $[7] !== incident.severity ||1179- $[8] !== incident.title ||1180- $[9] !== openIncident1181- ) {1182- t5 = /* @__PURE__ */ _jsx(OpenIncidentButton, {1183- id: incident.id,1184- title: incident.title,1185- severity: incident.severity,1186- onOpen: openIncident,1187- });1188- $[6] = incident.id;1189- $[7] = incident.severity;1190- $[8] = incident.title;1191- $[9] = openIncident;1192- $[10] = t5;1193- } else {1194- t5 = $[10];1195- }1196- let t6;1197- if ($[11] !== t4 || $[12] !== t5) {1198- t6 = /* @__PURE__ */ _jsx("td", {1199- children: /* @__PURE__ */ _jsx(Profiled, {1200- id: t4,1201- children: t5,477+ const openIncident = () => setSelectedId(incident.id);478+ const toggleIncidentFavorite = () => toggleFavorite(incident.id);479+ return /* @__PURE__ */ _jsxs("tr", {480+ className: selected ? "selected" : "",481+ children: [482+ /* @__PURE__ */ _jsx("td", {483+ children: /* @__PURE__ */ _jsx(Profiled, {484+ id: `button:open:${incident.id}`,485+ children: /* @__PURE__ */ _jsx(OpenIncidentButton, {486+ id: incident.id,487+ title: incident.title,488+ severity: incident.severity,489+ onOpen: openIncident,490+ }),491+ }),1202492}),1203- });1204- $[11] = t4;1205- $[12] = t5;1206- $[13] = t6;1207- } else {1208- t6 = $[13];1209- }1210- let t7;1211- if ($[14] !== incident.service) {1212- t7 = /* @__PURE__ */ _jsx("td", {1213- className: "service-cell",1214- children: incident.service,1215- });1216- $[14] = incident.service;1217- $[15] = t7;1218- } else {1219- t7 = $[15];1220- }1221- let t8;1222- if ($[16] !== incident.status) {1223- t8 = /* @__PURE__ */ _jsx("td", {1224- children: /* @__PURE__ */ _jsx(StatusBadge, { status: incident.status }),1225- });1226- $[16] = incident.status;1227- $[17] = t8;1228- } else {1229- t8 = $[17];1230- }1231- let t9;1232- if ($[18] !== incident.severity) {1233- t9 = incident.severity.toLowerCase();1234- $[18] = incident.severity;1235- $[19] = t9;1236- } else {1237- t9 = $[19];1238- }1239- const t10 = `severity-label ${t9}`;1240- let t11;1241- if ($[20] !== incident.severity || $[21] !== t10) {1242- t11 = /* @__PURE__ */ _jsx("td", {1243- children: /* @__PURE__ */ _jsx("span", {1244- className: t10,1245- children: incident.severity,493+ /* @__PURE__ */ _jsx("td", {494+ className: "service-cell",495+ children: incident.service,1246496}),1247- });1248- $[20] = incident.severity;1249- $[21] = t10;1250- $[22] = t11;1251- } else {1252- t11 = $[22];1253- }1254- let t12;1255- if ($[23] !== incident.owner) {1256- t12 = /* @__PURE__ */ _jsx("td", {1257- className: "owner-cell",1258- children: incident.owner,1259- });1260- $[23] = incident.owner;1261- $[24] = t12;1262- } else {1263- t12 = $[24];1264- }1265- let t13;1266- if ($[25] !== incident.time) {1267- t13 = /* @__PURE__ */ _jsx("td", {1268- className: "time-cell",1269- children: incident.time,1270- });1271- $[25] = incident.time;1272- $[26] = t13;1273- } else {1274- t13 = $[26];1275- }1276- const t14 = `button:favorite:${incident.id}`;1277- let t15;1278- if ($[27] !== incident.favorite || $[28] !== incident.id || $[29] !== toggleIncidentFavorite) {1279- t15 = /* @__PURE__ */ _jsx(FavoriteButton, {1280- id: incident.id,1281- favorite: incident.favorite,1282- onToggle: toggleIncidentFavorite,1283- });1284- $[27] = incident.favorite;1285- $[28] = incident.id;1286- $[29] = toggleIncidentFavorite;1287- $[30] = t15;1288- } else {1289- t15 = $[30];1290- }1291- let t16;1292- if ($[31] !== t14 || $[32] !== t15) {1293- t16 = /* @__PURE__ */ _jsx("td", {1294- children: /* @__PURE__ */ _jsx(Profiled, {1295- id: t14,1296- children: t15,497+ /* @__PURE__ */ _jsx("td", {498+ children: /* @__PURE__ */ _jsx(StatusBadge, { status: incident.status }),1297499}),1298- });1299- $[31] = t14;1300- $[32] = t15;1301- $[33] = t16;1302- } else {1303- t16 = $[33];1304- }1305- let t17;1306- if (1307- $[34] !== t11 ||1308- $[35] !== t12 ||1309- $[36] !== t13 ||1310- $[37] !== t16 ||1311- $[38] !== t3 ||1312- $[39] !== t6 ||1313- $[40] !== t7 ||1314- $[41] !== t81315- ) {1316- t17 = /* @__PURE__ */ _jsxs("tr", {1317- className: t3,1318- children: [t6, t7, t8, t11, t12, t13, t16],1319- });1320- $[34] = t11;1321- $[35] = t12;1322- $[36] = t13;1323- $[37] = t16;1324- $[38] = t3;1325- $[39] = t6;1326- $[40] = t7;1327- $[41] = t8;1328- $[42] = t17;1329- } else {1330- t17 = $[42];1331- }1332- return t17;500+ /* @__PURE__ */ _jsx("td", {501+ children: /* @__PURE__ */ _jsx("span", {502+ className: `severity-label ${incident.severity.toLowerCase()}`,503+ children: incident.severity,504+ }),505+ }),506+ /* @__PURE__ */ _jsx("td", {507+ className: "owner-cell",508+ children: incident.owner,509+ }),510+ /* @__PURE__ */ _jsx("td", {511+ className: "time-cell",512+ children: incident.time,513+ }),514+ /* @__PURE__ */ _jsx("td", {515+ children: /* @__PURE__ */ _jsx(Profiled, {516+ id: `button:favorite:${incident.id}`,517+ children: /* @__PURE__ */ _jsx(FavoriteButton, {518+ id: incident.id,519+ favorite: incident.favorite,520+ onToggle: toggleIncidentFavorite,521+ }),522+ }),523+ }),524+ ],525+ });1333526}1334- function IncidentList(t0) {1335- const $ = _c(13);1336- const { incidents } = t0;527+ function IncidentList({ incidents }) {1337528const { selectedId } = useSelection();1338- let t1;1339- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {1340- t1 = /* @__PURE__ */ _jsx("thead", {1341- children: /* @__PURE__ */ _jsxs("tr", {529+ return /* @__PURE__ */ _jsxs("div", {530+ className: "table-scroll",531+ children: [532+ /* @__PURE__ */ _jsxs("table", {1342533children: [1343- /* @__PURE__ */ _jsx("th", { children: "INCIDENT" }),1344- /* @__PURE__ */ _jsx("th", { children: "SERVICE" }),1345- /* @__PURE__ */ _jsx("th", { children: "STATUS" }),1346- /* @__PURE__ */ _jsx("th", { children: "SEVERITY" }),1347- /* @__PURE__ */ _jsx("th", { children: "OWNER" }),1348- /* @__PURE__ */ _jsx("th", { children: "TIME" }),1349- /* @__PURE__ */ _jsx("th", {1350- children: /* @__PURE__ */ _jsx("span", {1351- className: "sr-only",1352- children: "Favorite",534+ /* @__PURE__ */ _jsx("thead", {535+ children: /* @__PURE__ */ _jsxs("tr", {536+ children: [537+ /* @__PURE__ */ _jsx("th", { children: "INCIDENT" }),538+ /* @__PURE__ */ _jsx("th", { children: "SERVICE" }),539+ /* @__PURE__ */ _jsx("th", { children: "STATUS" }),540+ /* @__PURE__ */ _jsx("th", { children: "SEVERITY" }),541+ /* @__PURE__ */ _jsx("th", { children: "OWNER" }),542+ /* @__PURE__ */ _jsx("th", { children: "TIME" }),543+ /* @__PURE__ */ _jsx("th", {544+ children: /* @__PURE__ */ _jsx("span", {545+ className: "sr-only",546+ children: "Favorite",547+ }),548+ }),549+ ],1353550}),1354551}),552+ /* @__PURE__ */ _jsx("tbody", {553+ children: incidents.map((incident) =>554+ /* @__PURE__ */ _jsx(555+ Profiled,556+ {557+ id: `row:${incident.id}`,558+ children: /* @__PURE__ */ _jsx(IncidentRow, {559+ incident,560+ selected: selectedId === incident.id,561+ }),562+ },563+ incident.id,564+ ),565+ ),566+ }),1355567],1356568}),1357- });1358- $[0] = t1;1359- } else {1360- t1 = $[0];1361- }1362- let t2;1363- if ($[1] !== incidents || $[2] !== selectedId) {1364- let t3;1365- if ($[4] !== selectedId) {1366- t3 = (incident) =>1367- /* @__PURE__ */ _jsx(1368- Profiled,1369- {1370- id: `row:${incident.id}`,1371- children: /* @__PURE__ */ _jsx(IncidentRow, {1372- incident,1373- selected: selectedId === incident.id,1374- }),1375- },1376- incident.id,1377- );1378- $[4] = selectedId;1379- $[5] = t3;1380- } else {1381- t3 = $[5];1382- }1383- t2 = incidents.map(t3);1384- $[1] = incidents;1385- $[2] = selectedId;1386- $[3] = t2;1387- } else {1388- t2 = $[3];1389- }1390- let t3;1391- if ($[6] !== t2) {1392- t3 = /* @__PURE__ */ _jsxs("table", {1393- children: [t1, /* @__PURE__ */ _jsx("tbody", { children: t2 })],1394- });1395- $[6] = t2;1396- $[7] = t3;1397- } else {1398- t3 = $[7];1399- }1400- let t4;1401- if ($[8] !== incidents.length) {1402- t4 =1403569incidents.length === 0 &&1404- /* @__PURE__ */ _jsx("div", {1405- className: "empty",1406- children: "No incidents match your filters.",1407- });1408- $[8] = incidents.length;1409- $[9] = t4;1410- } else {1411- t4 = $[9];1412- }1413- let t5;1414- if ($[10] !== t3 || $[11] !== t4) {1415- t5 = /* @__PURE__ */ _jsxs("div", {1416- className: "table-scroll",1417- children: [t3, t4],1418- });1419- $[10] = t3;1420- $[11] = t4;1421- $[12] = t5;1422- } else {1423- t5 = $[12];1424- }1425- return t5;570+ /* @__PURE__ */ _jsx("div", {571+ className: "empty",572+ children: "No incidents match your filters.",573+ }),574+ ],575+ });1426576}1427577function Detail() {1428- const $ = _c(23);1429578const { selectedId, setSelectedId } = useSelection();1430579const { incidents, resolve, toggleFavorite } = useIncidents();1431- let t0;1432- if ($[0] !== incidents || $[1] !== selectedId) {1433- let t1;1434- if ($[3] !== selectedId) {1435- t1 = (item) => item.id === selectedId;1436- $[3] = selectedId;1437- $[4] = t1;1438- } else {1439- t1 = $[4];580+ const incident = incidents.find((item) => item.id === selectedId);581+ useEffect(() => {582+ if (selectedId && window.matchMedia("(max-width: 1050px)").matches)583+ document.querySelector(".detail .back-button")?.focus();584+ }, [selectedId]);585+ function closeDetail() {586+ setSelectedId(null);587+ document.querySelector(`[aria-label="Open ${selectedId}"]`)?.focus();588+ }589+ function onDetailKeyDown(event) {590+ if (event.key === "Escape") closeDetail();591+ if (event.key !== "Tab" || !window.matchMedia("(max-width: 1050px)").matches) return;592+ const buttons = Array.from(event.currentTarget.querySelectorAll("button:not(:disabled)"));593+ if (event.shiftKey && document.activeElement === buttons[0]) {594+ event.preventDefault();595+ buttons.at(-1)?.focus();596+ } else if (!event.shiftKey && document.activeElement === buttons.at(-1)) {597+ event.preventDefault();598+ buttons[0]?.focus();1440599}1441- t0 = incidents.find(t1);1442- $[0] = incidents;1443- $[1] = selectedId;1444- $[2] = t0;1445- } else {1446- t0 = $[2];1447600}1448- const incident = t0;1449- let t1;1450- let t2;1451- if ($[5] !== selectedId) {1452- t1 = () => {1453- if (selectedId && window.matchMedia("(max-width: 1050px)").matches) {1454- document.querySelector(".detail .back-button")?.focus();1455- }1456- };1457- t2 = [selectedId];1458- $[5] = selectedId;1459- $[6] = t1;1460- $[7] = t2;1461- } else {1462- t1 = $[6];1463- t2 = $[7];1464- }1465- useEffect(t1, t2);1466- let t3;1467- if ($[8] !== selectedId || $[9] !== setSelectedId) {1468- t3 = function closeDetail() {1469- setSelectedId(null);1470- document.querySelector(`[aria-label="Open ${selectedId}"]`)?.focus();1471- };1472- $[8] = selectedId;1473- $[9] = setSelectedId;1474- $[10] = t3;1475- } else {1476- t3 = $[10];1477- }1478- const closeDetail = t3;1479- let t4;1480- if ($[11] !== closeDetail) {1481- t4 = function onDetailKeyDown(event) {1482- if (event.key === "Escape") {1483- closeDetail();1484- }1485- if (event.key !== "Tab" || !window.matchMedia("(max-width: 1050px)").matches) {1486- return;1487- }1488- const buttons = Array.from(event.currentTarget.querySelectorAll("button:not(:disabled)"));1489- if (event.shiftKey && document.activeElement === buttons[0]) {1490- event.preventDefault();1491- buttons.at(-1)?.focus();1492- } else {1493- if (!event.shiftKey && document.activeElement === buttons.at(-1)) {1494- event.preventDefault();1495- buttons[0]?.focus();1496- }1497- }1498- };1499- $[11] = closeDetail;1500- $[12] = t4;1501- } else {1502- t4 = $[12];1503- }1504- const onDetailKeyDown = t4;1505- const t5 = `detail ${incident ? "detail-open" : ""}`;1506- const t6 = incident && window.matchMedia("(max-width: 1050px)").matches ? true : undefined;1507- let t7;1508- if (1509- $[13] !== closeDetail ||1510- $[14] !== incident ||1511- $[15] !== resolve ||1512- $[16] !== toggleFavorite1513- ) {1514- t7 = incident601+ return /* @__PURE__ */ _jsx("dialog", {602+ open: true,603+ className: `detail ${incident ? "detail-open" : ""}`,604+ "aria-modal": incident && window.matchMedia("(max-width: 1050px)").matches ? true : undefined,605+ onKeyDown: onDetailKeyDown,606+ "aria-label": "Incident detail",607+ children: incident1515608? /* @__PURE__ */ _jsxs(_Fragment, {1516609children: [1517610/* @__PURE__ */ _jsxs("div", {1518611className: "detail-head",1519612children: [1520613/* @__PURE__ */ _jsx(Button, {1521614className: "back-button",1522615onClick: closeDetail,1523616"aria-label": "Close detail",1524617children: /* @__PURE__ */ _jsx(ChevronLeft, { size: 18 }),1525618}),1526619/* @__PURE__ */ _jsx("span", { children: "INCIDENT DETAILS" }),1527620/* @__PURE__ */ _jsx(Button, {1528621className: `favorite ${incident.favorite ? "is-favorite" : ""}`,1529622"aria-label": `${incident.favorite ? "Unfavorite" : "Favorite"} detail`,1530623onClick: () => toggleFavorite(incident.id),1531624children: /* @__PURE__ */ _jsx(Star, {1532625size: 17,1533626fill: incident.favorite ? "currentColor" : "none",1534627}),1535628}),1536629],1537630}),1538631/* @__PURE__ */ _jsxs("div", {1539632className: "detail-body",1540633children: [1541634/* @__PURE__ */ _jsx("span", {1542635className: "detail-id",1543636children: incident.id,1544637}),1545638/* @__PURE__ */ _jsx("h2", { children: incident.title }),1546639/* @__PURE__ */ _jsx(StatusBadge, { status: incident.status }),1547640/* @__PURE__ */ _jsxs("div", {1548641className: "detail-section",1549642children: [1550643/* @__PURE__ */ _jsx("h3", { children: "Overview" }),1551644/* @__PURE__ */ _jsxs("dl", {1552645children: [1553646/* @__PURE__ */ _jsxs("div", {1554647children: [1555648/* @__PURE__ */ _jsx("dt", { children: "Service" }),1556649/* @__PURE__ */ _jsx("dd", { children: incident.service }),1557650],1558651}),1559652/* @__PURE__ */ _jsxs("div", {1560653children: [1561654/* @__PURE__ */ _jsx("dt", { children: "Queue" }),1562655/* @__PURE__ */ _jsx("dd", { children: incident.queue }),1563656],1564657}),1565658/* @__PURE__ */ _jsxs("div", {1566659children: [1567660/* @__PURE__ */ _jsx("dt", { children: "Severity" }),1568661/* @__PURE__ */ _jsx("dd", { children: incident.severity }),1569662],1570663}),1571664/* @__PURE__ */ _jsxs("div", {1572665children: [1573666/* @__PURE__ */ _jsx("dt", { children: "Owner" }),1574667/* @__PURE__ */ _jsx("dd", { children: incident.owner }),1575668],1576669}),1577670/* @__PURE__ */ _jsxs("div", {1578671children: [1579672/* @__PURE__ */ _jsx("dt", { children: "Detected" }),1580673/* @__PURE__ */ _jsxs("dd", { children: ["Today, ", incident.time] }),1581674],1582675}),1583676],1584677}),1585678],1586679}),1587680/* @__PURE__ */ _jsxs("div", {1588681className: "detail-section",1589682children: [1590683/* @__PURE__ */ _jsx("h3", { children: "Activity" }),1591684/* @__PURE__ */ _jsx("ul", {1592685className: "activity-list",1593- children: incident.activity.map(_temp5),686+ children: incident.activity.map((entry, index) =>687+ /* @__PURE__ */ _jsxs(688+ "li",689+ {690+ children: [entry, /* @__PURE__ */ _jsx("small", { children: "Today" })],691+ },692+ index,693+ ),694+ ),1594695}),1595696],1596697}),1597698incident.status !== "Resolved" &&1598699/* @__PURE__ */ _jsxs(Button, {1599700className: "resolve-button",1600701onClick: () => resolve(incident.id),1601702children: [/* @__PURE__ */ _jsx(Check, { size: 16 }), " Mark resolved"],1602703}),1603704],1604705}),1605706],1606707})1607708: /* @__PURE__ */ _jsxs("div", {1608709className: "detail-placeholder",1609710children: [1610711/* @__PURE__ */ _jsx("span", {1611712className: "placeholder-icon",1612713children: /* @__PURE__ */ _jsx(Activity, { size: 24 }),1613714}),1614715/* @__PURE__ */ _jsx("h2", { children: "No incident selected" }),1615716/* @__PURE__ */ _jsx("p", {1616717children: "Select an incident from the list to view its details and activity.",1617718}),1618719],1619- });1620- $[13] = closeDetail;1621- $[14] = incident;1622- $[15] = resolve;1623- $[16] = toggleFavorite;1624- $[17] = t7;1625- } else {1626- t7 = $[17];1627- }1628- let t8;1629- if ($[18] !== onDetailKeyDown || $[19] !== t5 || $[20] !== t6 || $[21] !== t7) {1630- t8 = /* @__PURE__ */ _jsx("dialog", {1631- open: true,1632- className: t5,1633- "aria-modal": t6,1634- onKeyDown: onDetailKeyDown,1635- "aria-label": "Incident detail",1636- children: t7,1637- });1638- $[18] = onDetailKeyDown;1639- $[19] = t5;1640- $[20] = t6;1641- $[21] = t7;1642- $[22] = t8;1643- } else {1644- t8 = $[22];1645- }1646- return t8;720+ }),721+ });1647722}1648- function _temp5(entry, index) {1649- return /* @__PURE__ */ _jsxs(1650- "li",1651- { children: [entry, /* @__PURE__ */ _jsx("small", { children: "Today" })] },1652- index,1653- );1654- }1655723function Shell() {1656- const $ = _c(22);1657724const { incidents } = useIncidents();1658725const { queue } = useWorkspace();1659726const { search, status, sort, favoritesOnly } = useFilters();1660727const { settings } = useUserSettings();1661- let t0;1662- if (1663- $[0] !== favoritesOnly ||1664- $[1] !== incidents ||1665- $[2] !== queue ||1666- $[3] !== search ||1667- $[4] !== sort ||1668- $[5] !== status1669- ) {1670- t0 = visibleIncidents(incidents, queue, search, status, sort, favoritesOnly);1671- $[0] = favoritesOnly;1672- $[1] = incidents;1673- $[2] = queue;1674- $[3] = search;1675- $[4] = sort;1676- $[5] = status;1677- $[6] = t0;1678- } else {1679- t0 = $[6];1680- }1681- const visible = t0;1682- let t1;1683- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {1684- t1 = /* @__PURE__ */ _jsx(Header, {});1685- $[7] = t1;1686- } else {1687- t1 = $[7];1688- }1689- let t2;1690- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {1691- t2 = /* @__PURE__ */ _jsx(Sidebar, {});1692- $[8] = t2;1693- } else {1694- t2 = $[8];1695- }1696- let t3;1697- if ($[9] !== visible) {1698- t3 = /* @__PURE__ */ _jsx(Profiled, {1699- id: "toolbar",1700- children: /* @__PURE__ */ _jsx(Toolbar, { incidents: visible }),1701- });1702- $[9] = visible;1703- $[10] = t3;1704- } else {1705- t3 = $[10];1706- }1707- let t4;1708- if ($[11] !== visible) {1709- t4 = /* @__PURE__ */ _jsx(Profiled, {1710- id: "list",1711- children: /* @__PURE__ */ _jsx(IncidentList, { incidents: visible }),1712- });1713- $[11] = visible;1714- $[12] = t4;1715- } else {1716- t4 = $[12];1717- }1718- let t5;1719- if ($[13] !== t3 || $[14] !== t4) {1720- t5 = /* @__PURE__ */ _jsxs("main", {1721- className: "main",1722- children: [t3, t4],1723- });1724- $[13] = t3;1725- $[14] = t4;1726- $[15] = t5;1727- } else {1728- t5 = $[15];1729- }1730- let t6;1731- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {1732- t6 = /* @__PURE__ */ _jsx(Profiled, {1733- id: "detail",1734- children: /* @__PURE__ */ _jsx(Detail, {}),1735- });1736- $[16] = t6;1737- } else {1738- t6 = $[16];1739- }1740- let t7;1741- if ($[17] !== t5) {1742- t7 = /* @__PURE__ */ _jsxs("div", {1743- className: "workspace",1744- children: [t2, t5, t6],1745- });1746- $[17] = t5;1747- $[18] = t7;1748- } else {1749- t7 = $[18];1750- }1751- let t8;1752- if ($[19] !== settings.density || $[20] !== t7) {1753- t8 = /* @__PURE__ */ _jsxs("div", {1754- className: "app",1755- "data-density": settings.density,1756- children: [t1, t7],1757- });1758- $[19] = settings.density;1759- $[20] = t7;1760- $[21] = t8;1761- } else {1762- t8 = $[21];1763- }1764- return t8;728+ const visible = visibleIncidents(incidents, queue, search, status, sort, favoritesOnly);729+ return /* @__PURE__ */ _jsxs("div", {730+ className: "app",731+ "data-density": settings.density,732+ children: [733+ /* @__PURE__ */ _jsx(Header, {}),734+ /* @__PURE__ */ _jsxs("div", {735+ className: "workspace",736+ children: [737+ /* @__PURE__ */ _jsx(Sidebar, {}),738+ /* @__PURE__ */ _jsxs("main", {739+ className: "main",740+ children: [741+ /* @__PURE__ */ _jsx(Profiled, {742+ id: "toolbar",743+ children: /* @__PURE__ */ _jsx(Toolbar, { incidents: visible }),744+ }),745+ /* @__PURE__ */ _jsx(Profiled, {746+ id: "list",747+ children: /* @__PURE__ */ _jsx(IncidentList, { incidents: visible }),748+ }),749+ ],750+ }),751+ /* @__PURE__ */ _jsx(Profiled, {752+ id: "detail",753+ children: /* @__PURE__ */ _jsx(Detail, {}),754+ }),755+ ],756+ }),757+ ],758+ });1765759}1766760export default function App() {1767- const $ = _c(1);1768- let t0;1769- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {1770- t0 = /* @__PURE__ */ _jsx(WorkspaceProvider, {1771- children: /* @__PURE__ */ _jsx(IncidentProvider, {1772- children: /* @__PURE__ */ _jsx(FilterProvider, {1773- children: /* @__PURE__ */ _jsx(SelectionProvider, {1774- children: /* @__PURE__ */ _jsx(SettingsProvider, {1775- children: /* @__PURE__ */ _jsx(NotificationProvider, {1776- children: /* @__PURE__ */ _jsx(Profiled, {1777- id: "shell",1778- children: /* @__PURE__ */ _jsx(Shell, {}),1779- }),761+ return /* @__PURE__ */ _jsx(WorkspaceProvider, {762+ children: /* @__PURE__ */ _jsx(IncidentProvider, {763+ children: /* @__PURE__ */ _jsx(FilterProvider, {764+ children: /* @__PURE__ */ _jsx(SelectionProvider, {765+ children: /* @__PURE__ */ _jsx(SettingsProvider, {766+ children: /* @__PURE__ */ _jsx(NotificationProvider, {767+ children: /* @__PURE__ */ _jsx(Profiled, {768+ id: "shell",769+ children: /* @__PURE__ */ _jsx(Shell, {}),1780770}),1781771}),1782772}),1783773}),1784774}),1785- });1786- $[0] = t0;1787- } else {1788- t0 = $[0];1789- }1790- return t0;775+ }),776+ });1791777}