@mediaradar/design-components 0.30.0 → 0.32.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.
package/dist/index.cjs CHANGED
@@ -32,6 +32,7 @@ __export(index_exports, {
32
32
  CheckBox: () => CheckBox,
33
33
  CheckBoxBox: () => CheckBoxBox,
34
34
  ChipContent: () => ChipContent,
35
+ CopyButton: () => CopyButton,
35
36
  DEFAULT_SEARCH_MATCH: () => DEFAULT_SEARCH_MATCH,
36
37
  DataScopeFilter: () => DataScopeFilter,
37
38
  DataTable: () => DataTable,
@@ -43,7 +44,9 @@ __export(index_exports, {
43
44
  FilterDropdownFooter: () => FilterDropdownFooter,
44
45
  Freshness: () => Freshness,
45
46
  InfoTip: () => InfoTip,
47
+ InlineMessage: () => InlineMessage,
46
48
  LineChartPlaceholder: () => LineChartPlaceholder,
49
+ MediaLabel: () => MediaLabel,
47
50
  Modal: () => Modal,
48
51
  MultiSelectFilter: () => MultiSelectFilter,
49
52
  NO_RESULTS_BODY: () => NO_RESULTS_BODY,
@@ -66,12 +69,14 @@ __export(index_exports, {
66
69
  SelectionPicker: () => SelectionPicker,
67
70
  SortButton: () => SortButton,
68
71
  StackedColumnPlaceholder: () => StackedColumnPlaceholder,
72
+ SuggestionChip: () => SuggestionChip,
69
73
  TablePagination: () => TablePagination,
70
74
  Tabs: () => Tabs,
71
75
  Tag: () => Tag,
72
76
  TextField: () => TextField,
73
77
  Toast: () => Toast,
74
78
  Toggle: () => Toggle,
79
+ ToggleChip: () => ToggleChip,
75
80
  Tooltip: () => Tooltip,
76
81
  WorkspaceAvatar: () => WorkspaceAvatar,
77
82
  WorkspaceSelectedCard: () => WorkspaceSelectedCard,
@@ -195,8 +200,46 @@ function AdvertiserSearchPrompt({ label = "an advertiser name" }) {
195
200
  ] });
196
201
  }
197
202
 
198
- // src/AdvertiserQuickFilter.tsx
203
+ // src/cn.ts
204
+ var import_clsx = require("clsx");
205
+ var import_tailwind_merge = require("tailwind-merge");
206
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
207
+ extend: {
208
+ classGroups: {
209
+ "font-size": [{ text: define_FONT_SIZE_KEYS_default }]
210
+ }
211
+ }
212
+ });
213
+ function cn(...inputs) {
214
+ return twMerge((0, import_clsx.clsx)(inputs));
215
+ }
216
+
217
+ // src/ChipTrigger.tsx
199
218
  var import_jsx_runtime3 = require("react/jsx-runtime");
219
+ function chipTriggerClass(_variant = "box") {
220
+ return cn(
221
+ "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
222
+ // One stroke for every trigger: a `box` chip on the lighter default
223
+ // border sat beside SelectFilter's darker one in the same row and read as
224
+ // a different kind of control. The variant no longer changes anything.
225
+ );
226
+ }
227
+ function ChipContent({ caption, value, icon }) {
228
+ const stack = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
229
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
230
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
231
+ ] });
232
+ if (icon) {
233
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex items-center gap-2", children: [
234
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
235
+ stack
236
+ ] });
237
+ }
238
+ return stack;
239
+ }
240
+
241
+ // src/AdvertiserQuickFilter.tsx
242
+ var import_jsx_runtime4 = require("react/jsx-runtime");
200
243
  function cx(...parts) {
201
244
  return parts.filter(Boolean).join(" ");
202
245
  }
@@ -280,8 +323,8 @@ function AdvertiserQuickFilter({
280
323
  const shown = open && !showFooter ? draft : selected;
281
324
  const counted = parked.length ? shown.filter((id) => !parked.includes(id)) : shown;
282
325
  const value = counted.length === 0 ? "All" : counted.length === 1 ? options.find((o) => o.id === counted[0])?.label ?? "1 selected" : `${counted.length} selected`;
283
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative", ref, children: [
284
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
326
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative", ref, children: [
327
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
285
328
  "button",
286
329
  {
287
330
  type: "button",
@@ -289,14 +332,10 @@ function AdvertiserQuickFilter({
289
332
  onClick: () => open ? close() : openTray(),
290
333
  "aria-haspopup": "dialog",
291
334
  "aria-expanded": open,
292
- className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
335
+ className: chipTriggerClass(),
293
336
  children: [
294
- icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
295
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
296
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
297
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
298
- ] }),
299
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
337
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChipContent, { caption, value, icon }),
338
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
300
339
  import_lucide_react3.ChevronDown,
301
340
  {
302
341
  size: 14,
@@ -307,7 +346,7 @@ function AdvertiserQuickFilter({
307
346
  ]
308
347
  }
309
348
  ),
310
- open && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
349
+ open && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
311
350
  "div",
312
351
  {
313
352
  className: cx(
@@ -318,9 +357,9 @@ function AdvertiserQuickFilter({
318
357
  "aria-label": caption,
319
358
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
320
359
  children: [
321
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
322
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
323
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
360
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
361
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
362
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
324
363
  "input",
325
364
  {
326
365
  ref: inputRef,
@@ -334,20 +373,20 @@ function AdvertiserQuickFilter({
334
373
  className: "h-full min-w-0 flex-1 bg-transparent text-[13px] outline-hidden placeholder:text-text-tertiary"
335
374
  }
336
375
  ),
337
- q && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
376
+ q && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
338
377
  "button",
339
378
  {
340
379
  type: "button",
341
380
  onClick: clearSearch,
342
381
  "aria-label": "Clear search",
343
382
  className: "shrink-0 text-text-tertiary transition-colors hover:text-text-primary",
344
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.X, { size: 13 })
383
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.X, { size: 13 })
345
384
  }
346
385
  )
347
386
  ] }) }),
348
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "max-h-[300px] overflow-y-auto p-1", children: [
349
- selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "mb-1 border-b border-border-default pb-1", children: [
350
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
387
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "max-h-[300px] overflow-y-auto p-1", children: [
388
+ selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "mb-1 border-b border-border-default pb-1", children: [
389
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
351
390
  "button",
352
391
  {
353
392
  type: "button",
@@ -356,7 +395,7 @@ function AdvertiserQuickFilter({
356
395
  "aria-expanded": selectedOpen,
357
396
  className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary",
358
397
  children: [
359
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
398
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
360
399
  import_lucide_react3.ChevronDown,
361
400
  {
362
401
  size: 13,
@@ -370,7 +409,7 @@ function AdvertiserQuickFilter({
370
409
  ]
371
410
  }
372
411
  ),
373
- selectedOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-col gap-0.5", children: selectedOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
412
+ selectedOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex flex-col gap-0.5", children: selectedOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
374
413
  OptionRow,
375
414
  {
376
415
  label: o.label,
@@ -381,15 +420,15 @@ function AdvertiserQuickFilter({
381
420
  o.id
382
421
  )) })
383
422
  ] }),
384
- !ql ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AdvertiserSearchPrompt, { label: promptLabel }) : results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
385
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
423
+ !ql ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AdvertiserSearchPrompt, { label: promptLabel }) : results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
424
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
386
425
  "No results found for \u201C",
387
426
  q.trim(),
388
427
  "\u201D"
389
428
  ] }),
390
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: noResultsHint })
391
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
392
- results.length > SELECT_ALL_THRESHOLD && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
429
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: noResultsHint })
430
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
431
+ results.length > SELECT_ALL_THRESHOLD && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
393
432
  "button",
394
433
  {
395
434
  type: "button",
@@ -397,12 +436,12 @@ function AdvertiserQuickFilter({
397
436
  onClick: toggleAllVisible,
398
437
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[12px] font-semibold text-text-link transition-colors hover:bg-subtle",
399
438
  children: [
400
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.ListChecks, { size: 14, "aria-hidden": "true" }),
439
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.ListChecks, { size: 14, "aria-hidden": "true" }),
401
440
  allVisibleSelected ? `Deselect ${results.length} visible` : `Select all ${results.length} visible`
402
441
  ]
403
442
  }
404
443
  ),
405
- results.map((o) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
444
+ results.map((o) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
406
445
  OptionRow,
407
446
  {
408
447
  label: o.label,
@@ -414,8 +453,8 @@ function AdvertiserQuickFilter({
414
453
  ))
415
454
  ] })
416
455
  ] }),
417
- showFooter ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default px-3 py-2.5", children: [
418
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
456
+ showFooter ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default px-3 py-2.5", children: [
457
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
419
458
  "button",
420
459
  {
421
460
  type: "button",
@@ -426,7 +465,7 @@ function AdvertiserQuickFilter({
426
465
  children: "Clear all"
427
466
  }
428
467
  ),
429
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
468
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
430
469
  "button",
431
470
  {
432
471
  type: "button",
@@ -436,12 +475,12 @@ function AdvertiserQuickFilter({
436
475
  children: "Apply"
437
476
  }
438
477
  )
439
- ] }) : draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default p-2", children: [
440
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "text-[11px] text-text-tertiary", children: [
478
+ ] }) : draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default p-2", children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "text-[11px] text-text-tertiary", children: [
441
480
  draft.length,
442
481
  " selected"
443
482
  ] }),
444
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
483
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
445
484
  "button",
446
485
  {
447
486
  type: "button",
@@ -462,13 +501,13 @@ function OptionRow({
462
501
  onToggle,
463
502
  testId
464
503
  }) {
465
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
504
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
466
505
  "div",
467
506
  {
468
507
  onClick: onToggle,
469
508
  className: "flex cursor-pointer items-center gap-2.5 rounded-control px-2 py-2 transition-colors hover:bg-subtle",
470
509
  children: [
471
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
510
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
472
511
  "button",
473
512
  {
474
513
  type: "button",
@@ -485,31 +524,17 @@ function OptionRow({
485
524
  "focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
486
525
  checked ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-surface hover:border-brand-primaryAction"
487
526
  ),
488
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Check, { size: 13, strokeWidth: 3 })
527
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.Check, { size: 13, strokeWidth: 3 })
489
528
  }
490
529
  ),
491
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: label })
530
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: label })
492
531
  ]
493
532
  }
494
533
  );
495
534
  }
496
535
 
497
- // src/cn.ts
498
- var import_clsx = require("clsx");
499
- var import_tailwind_merge = require("tailwind-merge");
500
- var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
501
- extend: {
502
- classGroups: {
503
- "font-size": [{ text: define_FONT_SIZE_KEYS_default }]
504
- }
505
- }
506
- });
507
- function cn(...inputs) {
508
- return twMerge((0, import_clsx.clsx)(inputs));
509
- }
510
-
511
536
  // src/Badge.tsx
512
- var import_jsx_runtime4 = require("react/jsx-runtime");
537
+ var import_jsx_runtime5 = require("react/jsx-runtime");
513
538
  var TONE = {
514
539
  neutral: "bg-subtle text-text-secondary",
515
540
  brand: "bg-brand-primarySoft text-brand-primaryAction",
@@ -560,25 +585,30 @@ var KIND = {
560
585
  count: "h-[18px] min-w-[18px] justify-center px-1.5 tabular-nums",
561
586
  // The only kind that shouts. Caps need the letterspacing -- caps set tight
562
587
  // are harder to read than the sentence case they replaced.
563
- eyebrow: "px-2.5 py-1 uppercase tracking-wider"
588
+ eyebrow: "px-2.5 py-1 uppercase tracking-wider",
589
+ // What a thing IS (a topic, a category) rather than a signal about it.
590
+ // Always the same quiet grey whatever `tone` says: colour here would read
591
+ // as meaning, and a category has none. This is the old Tag.
592
+ category: "px-2 py-1"
564
593
  };
594
+ var CATEGORY = "bg-subtle font-medium text-text-tertiary";
565
595
  function Badge({ tone = "neutral", kind = "label", dot = false, children, className }) {
566
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
596
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
567
597
  "span",
568
598
  {
569
- style: TONE_STYLE[tone],
599
+ style: kind === "category" ? void 0 : TONE_STYLE[tone],
570
600
  className: cn(
571
601
  // `inline-flex` + `gap` so a leading icon sits on the text baseline
572
602
  // without every caller re-inventing the spacing. `shrink-0` because a
573
603
  // badge is almost always beside flexible text that would otherwise
574
604
  // squash it. `whitespace-nowrap` because a wrapped badge is a bug.
575
- "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full text-micro font-semibold leading-none",
576
- TONE[tone],
605
+ "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full text-micro leading-none",
606
+ kind === "category" ? CATEGORY : cn("font-semibold", TONE[tone]),
577
607
  KIND[kind],
578
608
  className
579
609
  ),
580
610
  children: [
581
- dot && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-current" }),
611
+ dot && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-current" }),
582
612
  children
583
613
  ]
584
614
  }
@@ -587,10 +617,10 @@ function Badge({ tone = "neutral", kind = "label", dot = false, children, classN
587
617
 
588
618
  // src/Delta.tsx
589
619
  var import_lucide_react4 = require("lucide-react");
590
- var import_jsx_runtime5 = require("react/jsx-runtime");
620
+ var import_jsx_runtime6 = require("react/jsx-runtime");
591
621
  function Delta({ value, suffix = "%", arrow = false, period, className }) {
592
622
  const up = value >= 0;
593
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
623
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
594
624
  "span",
595
625
  {
596
626
  className: cn(
@@ -599,11 +629,11 @@ function Delta({ value, suffix = "%", arrow = false, period, className }) {
599
629
  className
600
630
  ),
601
631
  children: [
602
- arrow && (up ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react4.ArrowUpRight, { size: 13, "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react4.ArrowDownRight, { size: 13, "aria-hidden": "true" })),
632
+ arrow && (up ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ArrowUpRight, { size: 13, "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ArrowDownRight, { size: 13, "aria-hidden": "true" })),
603
633
  up ? "+" : "\u2212",
604
634
  Math.abs(value).toFixed(1),
605
635
  suffix,
606
- period && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ml-0.5", children: period })
636
+ period && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ml-0.5", children: period })
607
637
  ]
608
638
  }
609
639
  );
@@ -611,7 +641,7 @@ function Delta({ value, suffix = "%", arrow = false, period, className }) {
611
641
 
612
642
  // src/CheckBox.tsx
613
643
  var import_lucide_react5 = require("lucide-react");
614
- var import_jsx_runtime6 = require("react/jsx-runtime");
644
+ var import_jsx_runtime7 = require("react/jsx-runtime");
615
645
  function boxClass(on, disabled) {
616
646
  return cn(
617
647
  "flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",
@@ -620,8 +650,8 @@ function boxClass(on, disabled) {
620
650
  );
621
651
  }
622
652
  function Glyph({ checked, indeterminate }) {
623
- if (indeterminate) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Minus, { size: 13, strokeWidth: 3 });
624
- return checked ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { size: 13, strokeWidth: 3 }) : null;
653
+ if (indeterminate) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Minus, { size: 13, strokeWidth: 3 });
654
+ return checked ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { size: 13, strokeWidth: 3 }) : null;
625
655
  }
626
656
  function CheckBox({
627
657
  checked,
@@ -635,7 +665,7 @@ function CheckBox({
635
665
  className
636
666
  }) {
637
667
  const on = checked || !!indeterminate;
638
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
668
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
639
669
  "button",
640
670
  {
641
671
  type: "button",
@@ -659,18 +689,18 @@ function CheckBox({
659
689
  disabled && "hover:border-border-interactive",
660
690
  className
661
691
  ),
662
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Glyph, { checked, indeterminate })
692
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Glyph, { checked, indeterminate })
663
693
  }
664
694
  );
665
695
  }
666
696
  function CheckBoxBox({ checked, indeterminate, disabled, className }) {
667
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": "true", className: cn(boxClass(checked || !!indeterminate, disabled), className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Glyph, { checked, indeterminate }) });
697
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { "aria-hidden": "true", className: cn(boxClass(checked || !!indeterminate, disabled), className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Glyph, { checked, indeterminate }) });
668
698
  }
669
699
 
670
700
  // src/DateRangeFilter.tsx
671
701
  var import_react3 = require("react");
672
702
  var import_lucide_react6 = require("lucide-react");
673
- var import_jsx_runtime7 = require("react/jsx-runtime");
703
+ var import_jsx_runtime8 = require("react/jsx-runtime");
674
704
  var DEFAULT_SHORTCUTS = [
675
705
  "Year to date",
676
706
  "Rolling 3 months",
@@ -719,6 +749,9 @@ var addDays = (d, n) => {
719
749
  };
720
750
  var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
721
751
  var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
752
+ var firstOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
753
+ var lastOfMonth = (d) => new Date(d.getFullYear(), d.getMonth() + 1, 0);
754
+ var fmtMonth = (d) => `${MONTHS[d.getMonth()].slice(0, 3)} ${d.getFullYear()}`;
722
755
  var fmt = (d) => `${MONTHS[d.getMonth()].slice(0, 3)} ${d.getDate()}, ${d.getFullYear()}`;
723
756
  var fmtFull = (d) => `${MONTHS[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
724
757
  var fullRangeLabel = (s, e) => `${fmtFull(s)} - ${fmtFull(e)}`;
@@ -799,14 +832,17 @@ function DateRangeFilter({
799
832
  shortDates = false,
800
833
  icon,
801
834
  presetSet = "default",
802
- testIdPrefix
835
+ testIdPrefix,
836
+ granularity = "day"
803
837
  }) {
838
+ const monthly = granularity === "month";
839
+ const snap = (s, e) => monthly ? [firstOfMonth(s), lastOfMonth(e)] : [s, e];
804
840
  const controlled = controlledValue !== void 0 && controlledRange !== void 0;
805
841
  const SHORTCUTS = presetSet === "creativeIntel" ? CREATIVE_INTEL_SHORTCUTS : DEFAULT_SHORTCUTS;
806
842
  const today = (0, import_react3.useMemo)(() => /* @__PURE__ */ new Date(), []);
807
843
  const initShortcut = matchShortcut(SHORTCUTS, controlled ? controlledValue : defaultValue);
808
- const initRange = controlled ? controlledRange : presetRange(initShortcut === "Custom" ? "Rolling 12 months" : initShortcut, today);
809
- const dateLine = (s, e) => shortDates ? `${fmt(s)} \u2013 ${fmt(e)}` : fullRangeLabel(s, e);
844
+ const initRange = controlled ? controlledRange : snap(...presetRange(initShortcut === "Custom" ? "Rolling 12 months" : initShortcut, today));
845
+ const dateLine = (s, e) => monthly ? `${fmtMonth(s)} \u2013 ${fmtMonth(e)}` : shortDates ? `${fmt(s)} \u2013 ${fmt(e)}` : fullRangeLabel(s, e);
810
846
  const [open, setOpen] = (0, import_react3.useState)(false);
811
847
  const [uncontrolledValue, setUncontrolledValue] = (0, import_react3.useState)(
812
848
  showDates ? presetLabel(initShortcut) : defaultValue || "Last 7 days"
@@ -849,25 +885,27 @@ function DateRangeFilter({
849
885
  if (key === "Custom") return;
850
886
  const r = presetRange(key, today);
851
887
  if (r) {
852
- setStart(r[0]);
853
- setEnd(r[1]);
854
- setLeftMonth(new Date(r[0].getFullYear(), r[0].getMonth(), 1));
888
+ const [s, e] = snap(r[0], r[1]);
889
+ setStart(s);
890
+ setEnd(e);
891
+ setLeftMonth(new Date(s.getFullYear(), s.getMonth(), 1));
855
892
  }
856
893
  };
857
894
  const pickDay = (d) => {
858
895
  setShortcut("Custom");
859
896
  if (!start || start && end) {
860
- setStart(d);
897
+ setStart(monthly ? firstOfMonth(d) : d);
861
898
  setEnd(null);
862
899
  } else if (d < start) {
863
- setEnd(start);
864
- setStart(d);
865
- } else setEnd(d);
900
+ const [s, e] = snap(d, start);
901
+ setStart(s);
902
+ setEnd(e);
903
+ } else setEnd(monthly ? lastOfMonth(d) : d);
866
904
  };
867
905
  const apply = () => {
868
- const s = start || initRange[0];
869
- const e = end || s;
870
- const v = showDates ? presetLabel(shortcut) : shortcut === "Custom" ? `${fmt(s)} \u2014 ${fmt(e)}` : shortcut;
906
+ const [s, e] = snap(start || initRange[0], end || start || initRange[0]);
907
+ const custom = monthly ? `${fmtMonth(s)} \u2014 ${fmtMonth(e)}` : `${fmt(s)} \u2014 ${fmt(e)}`;
908
+ const v = showDates ? presetLabel(shortcut) : shortcut === "Custom" ? custom : shortcut;
871
909
  if (!controlled) {
872
910
  committed.current = { shortcut, start: s, end: e };
873
911
  setUncontrolledValue(v);
@@ -884,26 +922,26 @@ function DateRangeFilter({
884
922
  setFlipBelow(ref.current.getBoundingClientRect().top < popRef.current.offsetHeight + 16);
885
923
  }, [open, placement]);
886
924
  const above = placement === "above" && !flipBelow;
887
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative", ref, children: [
888
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
925
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", ref, children: [
926
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
889
927
  "button",
890
928
  {
891
929
  type: "button",
892
930
  "data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
893
931
  onClick: () => setOpen((v) => !v),
894
932
  "aria-expanded": open,
895
- className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
933
+ className: chipTriggerClass(),
896
934
  children: [
897
- icon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
898
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
899
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: showDates ? "text-[11px] text-text-tertiary" : "text-control-caption uppercase tracking-wide text-text-tertiary", children: showDates ? displayDatesLine : caption }),
900
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: displayValue })
935
+ icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
936
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
937
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: showDates ? "text-[11px] text-text-tertiary" : "text-control-caption uppercase tracking-wide text-text-tertiary", children: showDates ? displayDatesLine : caption }),
938
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: displayValue })
901
939
  ] }),
902
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronDown, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
940
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
903
941
  ]
904
942
  }
905
943
  ),
906
- open && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
944
+ open && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
907
945
  "div",
908
946
  {
909
947
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
@@ -912,7 +950,7 @@ function DateRangeFilter({
912
950
  role: "dialog",
913
951
  "aria-label": "Select date range",
914
952
  children: [
915
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex w-44 shrink-0 flex-col gap-0.5 border-r border-border-default p-2", children: SHORTCUTS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
953
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex w-44 shrink-0 flex-col gap-0.5 border-r border-border-default p-2", children: SHORTCUTS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
916
954
  "button",
917
955
  {
918
956
  type: "button",
@@ -923,28 +961,28 @@ function DateRangeFilter({
923
961
  },
924
962
  s
925
963
  )) }),
926
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-4", children: [
927
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-end gap-3", children: [
928
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: "Start date", value: start ? fmt(start) : "\u2014" }),
929
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pb-2.5 text-text-tertiary", children: "\u2014" }),
930
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: "End date", value: end ? fmt(end) : start ? fmt(start) : "\u2014" })
964
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-4", children: [
965
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-end gap-3", children: [
966
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Field, { label: "Start date", value: start ? fmt(start) : "\u2014" }),
967
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "pb-2.5 text-text-tertiary", children: "\u2014" }),
968
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Field, { label: "End date", value: end ? fmt(end) : start ? fmt(start) : "\u2014" })
931
969
  ] }),
932
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "my-4 border-t border-border-default" }),
933
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
970
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "my-4 border-t border-border-default" }),
971
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
934
972
  const m = addMonths(leftMonth, offset);
935
973
  const grid = monthGrid(m.getFullYear(), m.getMonth());
936
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-[252px]", children: [
937
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
938
- offset === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "h-7 w-7" }),
939
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "text-[15px] font-semibold text-text-primary", children: [
974
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-[252px]", children: [
975
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
976
+ offset === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-7 w-7" }),
977
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "text-[15px] font-semibold text-text-primary", children: [
940
978
  MONTHS[m.getMonth()],
941
979
  " ",
942
980
  m.getFullYear()
943
981
  ] }),
944
- offset === 1 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronRight, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "h-7 w-7" })
982
+ offset === 1 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronRight, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-7 w-7" })
945
983
  ] }),
946
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "grid grid-cols-7", children: [
947
- WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex h-8 items-center justify-center text-[12px] font-semibold text-text-secondary", children: w }, w)),
984
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-cols-7", children: [
985
+ WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-8 items-center justify-center text-[12px] font-semibold text-text-secondary", children: w }, w)),
948
986
  grid.map((d, i) => {
949
987
  const inMonth = d.getMonth() === m.getMonth();
950
988
  const hasRange = !!(start && end);
@@ -959,9 +997,9 @@ function DateRangeFilter({
959
997
  else if (end && isEnd) band = "left-0 right-1/2";
960
998
  else band = "left-0 right-0";
961
999
  }
962
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", onClick: () => pickDay(d), className: "relative flex h-9 items-center justify-center", children: [
963
- band && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `absolute inset-y-[3px] bg-ai-tint ${band}`, "aria-hidden": "true" }),
964
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1000
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", onClick: () => pickDay(d), className: "relative flex h-9 items-center justify-center", children: [
1001
+ band && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `absolute inset-y-[3px] bg-ai-tint ${band}`, "aria-hidden": "true" }),
1002
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
965
1003
  "span",
966
1004
  {
967
1005
  className: `relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-[13px] tabular-nums ${endpoint ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : inMonth ? "text-text-primary hover:bg-subtle" : "text-text-tertiary"}`,
@@ -973,9 +1011,10 @@ function DateRangeFilter({
973
1011
  ] })
974
1012
  ] }, offset);
975
1013
  }) }),
976
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
977
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => setOpen(false), className: "rounded-control border border-border-default bg-surface px-5 py-2 text-[13px] font-semibold text-text-primary transition-colors hover:bg-subtle", children: "Cancel" }),
978
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-[13px] font-semibold text-brand-onprimary transition-[filter] hover:brightness-110", children: "Apply" })
1014
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
1015
+ monthly && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mr-auto text-xs text-text-tertiary", children: "Data is monthly, so ranges cover whole months." }),
1016
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => setOpen(false), className: "rounded-control border border-border-default bg-surface px-5 py-2 text-[13px] font-semibold text-text-primary transition-colors hover:bg-subtle", children: "Cancel" }),
1017
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-[13px] font-semibold text-brand-onprimary transition-[filter] hover:brightness-110", children: "Apply" })
979
1018
  ] })
980
1019
  ] })
981
1020
  ]
@@ -984,19 +1023,19 @@ function DateRangeFilter({
984
1023
  ] });
985
1024
  }
986
1025
  function Field({ label, value }) {
987
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
988
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-[12px] font-medium text-text-secondary", children: label }),
989
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
1026
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[12px] font-medium text-text-secondary", children: label }),
1028
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
990
1029
  ] });
991
1030
  }
992
1031
  function NavBtn({ children, onClick, ...rest }) {
993
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary", ...rest, children });
1032
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary", ...rest, children });
994
1033
  }
995
1034
 
996
1035
  // src/SearchBar.tsx
997
1036
  var import_react4 = require("react");
998
1037
  var import_lucide_react7 = require("lucide-react");
999
- var import_jsx_runtime8 = require("react/jsx-runtime");
1038
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1000
1039
  var HEIGHT = { sm: "h-8", md: "h-10", lg: "h-11" };
1001
1040
  var DEFAULT_SEARCH_MATCH = { mode: "anyWord", wordJoin: "Or" };
1002
1041
  var MODE_LABEL = {
@@ -1036,7 +1075,7 @@ function SearchBar({
1036
1075
  };
1037
1076
  }, [open]);
1038
1077
  const showMatch = variant === "filterable" && matchValue;
1039
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1078
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1040
1079
  "div",
1041
1080
  {
1042
1081
  className: cx2(
@@ -1045,9 +1084,9 @@ function SearchBar({
1045
1084
  className
1046
1085
  ),
1047
1086
  children: [
1048
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "flex min-w-0 flex-1 items-center gap-2 px-2.5", children: [
1049
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Search, { size: 15, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
1050
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1087
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex min-w-0 flex-1 items-center gap-2 px-2.5", children: [
1088
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Search, { size: 15, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
1089
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1051
1090
  "input",
1052
1091
  {
1053
1092
  ref: input,
@@ -1061,7 +1100,7 @@ function SearchBar({
1061
1100
  }
1062
1101
  )
1063
1102
  ] }),
1064
- value && onChange && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1103
+ value && onChange && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1065
1104
  "button",
1066
1105
  {
1067
1106
  type: "button",
@@ -1072,7 +1111,7 @@ function SearchBar({
1072
1111
  "aria-label": "Clear search",
1073
1112
  "data-testid": testIdPrefix && `${testIdPrefix}-clear`,
1074
1113
  className: "mr-1.5 flex size-6 shrink-0 items-center justify-center self-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-border-focus",
1075
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.X, { size: 14, "aria-hidden": "true" })
1114
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.X, { size: 14, "aria-hidden": "true" })
1076
1115
  }
1077
1116
  ),
1078
1117
  showMatch && // border-border-default, not the bare `border-border` both source
@@ -1086,8 +1125,8 @@ function SearchBar({
1086
1125
  // token package (insights-studio-prototype's own src/index.css;
1087
1126
  // mr-clientapps' own tailwind.config.ts `colors.border.DEFAULT`) --
1088
1127
  // an alias this shared component can't rely on existing.
1089
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative shrink-0 border-l border-border-default", ref, children: [
1090
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1128
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative shrink-0 border-l border-border-default", ref, children: [
1129
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1091
1130
  "button",
1092
1131
  {
1093
1132
  type: "button",
@@ -1098,7 +1137,7 @@ function SearchBar({
1098
1137
  className: "flex h-full items-center gap-1 px-2.5 text-[13px] font-medium text-text-primary transition-colors hover:bg-subtle",
1099
1138
  children: [
1100
1139
  matchValue.mode === "anyWord" ? `${MODE_LABEL.anyWord} (${matchValue.wordJoin})` : MODE_LABEL[matchValue.mode],
1101
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1140
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1102
1141
  import_lucide_react7.ChevronDown,
1103
1142
  {
1104
1143
  size: 14,
@@ -1109,25 +1148,25 @@ function SearchBar({
1109
1148
  ]
1110
1149
  }
1111
1150
  ),
1112
- open && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1151
+ open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1113
1152
  "div",
1114
1153
  {
1115
1154
  role: "dialog",
1116
1155
  "aria-label": "Search match type",
1117
1156
  "data-testid": testIdPrefix && `${testIdPrefix}-mode-popover`,
1118
1157
  className: "absolute right-0 top-[calc(100%+8px)] z-50 w-[400px] rounded-card border border-border-default bg-surface p-3 shadow-overlay",
1119
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
1120
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1158
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
1159
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1121
1160
  ModeRow,
1122
1161
  {
1123
1162
  title: "Any Word Text Search",
1124
1163
  selected: matchValue.mode === "anyWord",
1125
1164
  onSelect: () => onMatchChange?.({ mode: "anyWord", wordJoin: matchValue.wordJoin }),
1126
1165
  testId: testIdPrefix && `${testIdPrefix}-mode-anyWord`,
1127
- description: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: "Find creatives that contain your keyword(s) using an \u201COr\u201D (match any) or \u201CAnd\u201D (match all) conditional in any order." }),
1166
+ description: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: "Find creatives that contain your keyword(s) using an \u201COr\u201D (match any) or \u201CAnd\u201D (match all) conditional in any order." }),
1128
1167
  infoText: "The Or/And choice applies only when Any Word is the active search mode.",
1129
- extra: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex items-center gap-3", children: [
1130
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1168
+ extra: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-3", children: [
1169
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1131
1170
  RadioOption,
1132
1171
  {
1133
1172
  label: "Or",
@@ -1136,7 +1175,7 @@ function SearchBar({
1136
1175
  testId: testIdPrefix && `${testIdPrefix}-word-join-or`
1137
1176
  }
1138
1177
  ),
1139
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1178
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1140
1179
  RadioOption,
1141
1180
  {
1142
1181
  label: "And",
@@ -1148,8 +1187,8 @@ function SearchBar({
1148
1187
  ] })
1149
1188
  }
1150
1189
  ),
1151
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, {}),
1152
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1190
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider, {}),
1191
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1153
1192
  ModeRow,
1154
1193
  {
1155
1194
  title: "Exact Match Text Search",
@@ -1160,8 +1199,8 @@ function SearchBar({
1160
1199
  infoText: "Keywords are matched as a single contiguous phrase, in the order you typed them."
1161
1200
  }
1162
1201
  ),
1163
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, {}),
1164
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1202
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider, {}),
1203
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1165
1204
  ModeRow,
1166
1205
  {
1167
1206
  title: "Contextual Search",
@@ -1173,8 +1212,8 @@ function SearchBar({
1173
1212
  infoText: "Uses semantic matching, so results can include related terms even when the exact keyword isn't present."
1174
1213
  }
1175
1214
  ),
1176
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, {}),
1177
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1215
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider, {}),
1216
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1178
1217
  ModeRow,
1179
1218
  {
1180
1219
  title: "Ad Code Search",
@@ -1194,7 +1233,7 @@ function SearchBar({
1194
1233
  );
1195
1234
  }
1196
1235
  function Divider() {
1197
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "my-2.5 border-t border-border-default", "aria-hidden": "true" });
1236
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "my-2.5 border-t border-border-default", "aria-hidden": "true" });
1198
1237
  }
1199
1238
  function ModeRow({
1200
1239
  title,
@@ -1206,7 +1245,7 @@ function ModeRow({
1206
1245
  onSelect,
1207
1246
  testId
1208
1247
  }) {
1209
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1248
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1210
1249
  "div",
1211
1250
  {
1212
1251
  role: "radio",
@@ -1222,18 +1261,18 @@ function ModeRow({
1222
1261
  },
1223
1262
  className: "flex cursor-pointer flex-col items-stretch gap-1 rounded-control p-1.5 text-left transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1224
1263
  children: [
1225
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
1226
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
1227
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex items-center gap-1", children: [
1228
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: title }),
1229
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RowInfoTip, { text: infoText })
1264
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
1265
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
1266
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1", children: [
1267
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: title }),
1268
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RowInfoTip, { text: infoText })
1230
1269
  ] }),
1231
- badge && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rounded-full bg-subtle px-2 py-0.5 text-badge font-semibold uppercase tracking-wide text-text-secondary", children: badge }),
1270
+ badge && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rounded-full bg-subtle px-2 py-0.5 text-badge font-semibold uppercase tracking-wide text-text-secondary", children: badge }),
1232
1271
  extra
1233
1272
  ] }),
1234
- selected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
1273
+ selected && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
1235
1274
  ] }),
1236
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block text-[12.5px] leading-snug text-text-secondary", children: description })
1275
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "block text-[12.5px] leading-snug text-text-secondary", children: description })
1237
1276
  ]
1238
1277
  }
1239
1278
  );
@@ -1244,7 +1283,7 @@ function RadioOption({
1244
1283
  onSelect,
1245
1284
  testId
1246
1285
  }) {
1247
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1286
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1248
1287
  "button",
1249
1288
  {
1250
1289
  type: "button",
@@ -1257,14 +1296,14 @@ function RadioOption({
1257
1296
  "aria-checked": checked,
1258
1297
  className: "flex items-center gap-1.5 text-[13px] font-medium text-text-primary",
1259
1298
  children: [
1260
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1299
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1261
1300
  "span",
1262
1301
  {
1263
1302
  className: cx2(
1264
1303
  "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
1265
1304
  checked ? "border-brand-primaryAction" : "border-border-interactive"
1266
1305
  ),
1267
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-2 w-2 rounded-full bg-brand-primaryAction" })
1306
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "h-2 w-2 rounded-full bg-brand-primaryAction" })
1268
1307
  }
1269
1308
  ),
1270
1309
  label
@@ -1284,8 +1323,8 @@ function RowInfoTip({ text }) {
1284
1323
  window.addEventListener("mousedown", onDown);
1285
1324
  return () => window.removeEventListener("mousedown", onDown);
1286
1325
  }, [open]);
1287
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "relative inline-flex shrink-0 items-center", ref, children: [
1288
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1326
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "relative inline-flex shrink-0 items-center", ref, children: [
1327
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1289
1328
  "button",
1290
1329
  {
1291
1330
  type: "button",
@@ -1297,10 +1336,10 @@ function RowInfoTip({ text }) {
1297
1336
  "aria-expanded": open,
1298
1337
  "aria-describedby": id,
1299
1338
  className: "inline-flex text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1300
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.AlertCircle, { size: 13, "aria-hidden": "true" })
1339
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.AlertCircle, { size: 13, "aria-hidden": "true" })
1301
1340
  }
1302
1341
  ),
1303
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1342
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1304
1343
  "span",
1305
1344
  {
1306
1345
  id,
@@ -1315,7 +1354,7 @@ function RowInfoTip({ text }) {
1315
1354
  // src/SectionRail.tsx
1316
1355
  var import_react5 = require("react");
1317
1356
  var import_lucide_react8 = require("lucide-react");
1318
- var import_jsx_runtime9 = require("react/jsx-runtime");
1357
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1319
1358
  function SectionRail({
1320
1359
  title,
1321
1360
  titleSerif,
@@ -1328,20 +1367,20 @@ function SectionRail({
1328
1367
  const scroll = (direction) => {
1329
1368
  scrollRef.current?.scrollBy({ left: direction * 320, behavior: "smooth" });
1330
1369
  };
1331
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "flex flex-col gap-4", children: [
1332
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
1333
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1334
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1370
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "flex flex-col gap-4", children: [
1371
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
1372
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1335
1374
  "h2",
1336
1375
  {
1337
1376
  className: titleSerif ? "font-serif text-2xl font-normal tracking-tight text-text-primary sm:text-[28px]" : "text-xl font-medium tracking-tight text-text-primary sm:text-2xl",
1338
1377
  children: title
1339
1378
  }
1340
1379
  ),
1341
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mt-1 text-sm text-text-secondary", children: subtitle })
1380
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "mt-1 text-sm text-text-secondary", children: subtitle })
1342
1381
  ] }),
1343
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
1344
- viewAllLabel && viewAllHref && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1382
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
1383
+ viewAllLabel && viewAllHref && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1345
1384
  "a",
1346
1385
  {
1347
1386
  href: viewAllHref,
@@ -1352,29 +1391,29 @@ function SectionRail({
1352
1391
  ]
1353
1392
  }
1354
1393
  ),
1355
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1394
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1356
1395
  "button",
1357
1396
  {
1358
1397
  type: "button",
1359
1398
  onClick: () => scroll(-1),
1360
1399
  "aria-label": "Previous",
1361
1400
  className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
1362
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.ChevronLeft, { size: 16 })
1401
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.ChevronLeft, { size: 16 })
1363
1402
  }
1364
1403
  ),
1365
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1404
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1366
1405
  "button",
1367
1406
  {
1368
1407
  type: "button",
1369
1408
  onClick: () => scroll(1),
1370
1409
  "aria-label": "Next",
1371
1410
  className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
1372
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.ChevronRight, { size: 16 })
1411
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.ChevronRight, { size: 16 })
1373
1412
  }
1374
1413
  )
1375
1414
  ] })
1376
1415
  ] }),
1377
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1416
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1378
1417
  "div",
1379
1418
  {
1380
1419
  ref: scrollRef,
@@ -1388,7 +1427,7 @@ function SectionRail({
1388
1427
  // src/DataScopeFilter.tsx
1389
1428
  var import_react6 = require("react");
1390
1429
  var import_lucide_react9 = require("lucide-react");
1391
- var import_jsx_runtime10 = require("react/jsx-runtime");
1430
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1392
1431
  var FINAL_ONLY_TEXT = "Trims time periods to data that has finalized across the selected media formats. Some formats (e.g. Network TV and Cinema) finalize later, so the most recent periods may still change. Turn on for stable, report-ready numbers.";
1393
1432
  function cx3(...classes) {
1394
1433
  return classes.filter(Boolean).join(" ");
@@ -1414,21 +1453,17 @@ function DataScopeFilter({ value, onChange, align = "right" }) {
1414
1453
  onChange(v);
1415
1454
  setOpen(false);
1416
1455
  };
1417
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative", ref, children: [
1418
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1456
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative", ref, children: [
1457
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1419
1458
  "button",
1420
1459
  {
1421
1460
  type: "button",
1422
1461
  onClick: () => setOpen((o) => !o),
1423
1462
  "aria-expanded": open,
1424
- "aria-haspopup": "listbox",
1425
- className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1463
+ className: chipTriggerClass(),
1426
1464
  children: [
1427
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1428
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: "Data" }),
1429
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: display })
1430
- ] }),
1431
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1465
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChipContent, { caption: "Data", value: display }),
1466
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1432
1467
  import_lucide_react9.ChevronDown,
1433
1468
  {
1434
1469
  size: 14,
@@ -1439,18 +1474,18 @@ function DataScopeFilter({ value, onChange, align = "right" }) {
1439
1474
  ]
1440
1475
  }
1441
1476
  ),
1442
- open && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1477
+ open && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1443
1478
  "div",
1444
1479
  {
1445
- role: "listbox",
1480
+ role: "group",
1446
1481
  "aria-label": "Data",
1447
1482
  className: cx3(
1448
1483
  "absolute top-[calc(100%+8px)] z-30 min-w-[220px] overflow-hidden rounded-card border border-border-default bg-surface p-1 shadow-overlay",
1449
1484
  align === "right" ? "right-0" : "left-0"
1450
1485
  ),
1451
1486
  children: [
1452
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Option, { label: "All", selected: !value, onClick: () => choose(false) }),
1453
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Option, { label: "Final only", selected: value, onClick: () => choose(true), hint: FINAL_ONLY_TEXT })
1487
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Option, { label: "All", selected: !value, onClick: () => choose(false) }),
1488
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Option, { label: "Final only", selected: value, onClick: () => choose(true), hint: FINAL_ONLY_TEXT })
1454
1489
  ]
1455
1490
  }
1456
1491
  )
@@ -1462,12 +1497,11 @@ function Option({
1462
1497
  onClick,
1463
1498
  hint
1464
1499
  }) {
1465
- const option = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1500
+ const option = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1466
1501
  "button",
1467
1502
  {
1468
1503
  type: "button",
1469
- role: "option",
1470
- "aria-selected": selected,
1504
+ "aria-pressed": selected,
1471
1505
  onClick,
1472
1506
  className: cx3(
1473
1507
  "flex items-center gap-2 rounded-control px-2.5 py-2 text-left text-[13px] transition-colors hover:bg-subtle",
@@ -1475,15 +1509,15 @@ function Option({
1475
1509
  selected ? "font-semibold text-text-primary" : "text-text-secondary"
1476
1510
  ),
1477
1511
  children: [
1478
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Check, { size: 14, "aria-hidden": "true", className: cx3("shrink-0 text-brand-primaryAction", !selected && "invisible") }),
1512
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Check, { size: 14, "aria-hidden": "true", className: cx3("shrink-0 text-brand-primaryAction", !selected && "invisible") }),
1479
1513
  label
1480
1514
  ]
1481
1515
  }
1482
1516
  );
1483
1517
  if (!hint) return option;
1484
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center pr-2.5", children: [
1518
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2 pr-2.5", children: [
1485
1519
  option,
1486
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(InfoTip, { text: hint, trigger: "hover", label: `About ${label}` })
1520
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InfoTip, { text: hint, trigger: "hover", label: `About ${label}` })
1487
1521
  ] });
1488
1522
  }
1489
1523
 
@@ -1491,7 +1525,30 @@ function Option({
1491
1525
  var import_react7 = require("react");
1492
1526
  var import_react_dom2 = require("react-dom");
1493
1527
  var import_lucide_react10 = require("lucide-react");
1494
- var import_jsx_runtime11 = require("react/jsx-runtime");
1528
+
1529
+ // src/MenuStatus.tsx
1530
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1531
+ var ROW_WIDTHS = ["w-3/4", "w-1/2", "w-4/5", "w-3/5"];
1532
+ function MenuLoading() {
1533
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { role: "status", "aria-label": "Loading options", className: "p-1", children: ROW_WIDTHS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex h-9 items-center px-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `inline-block h-3 ${w} animate-pulse rounded-full bg-subtle`, "aria-hidden": "true" }) }, w)) });
1534
+ }
1535
+ function MenuError({ onRetry }) {
1536
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { role: "alert", className: "px-3 py-5 text-center text-dense text-text-secondary", children: [
1537
+ "Couldn't load options.",
1538
+ onRetry && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1539
+ "button",
1540
+ {
1541
+ type: "button",
1542
+ onClick: onRetry,
1543
+ className: "mt-1.5 block w-full font-medium text-text-link hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1544
+ children: "Try again"
1545
+ }
1546
+ )
1547
+ ] });
1548
+ }
1549
+
1550
+ // src/SelectFilter.tsx
1551
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1495
1552
  function cx4(...classes) {
1496
1553
  return classes.filter(Boolean).join(" ");
1497
1554
  }
@@ -1499,7 +1556,7 @@ function slug3(value) {
1499
1556
  return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
1500
1557
  }
1501
1558
  function OptionIcon({ children }) {
1502
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1559
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1503
1560
  "span",
1504
1561
  {
1505
1562
  "aria-hidden": "true",
@@ -1517,8 +1574,14 @@ function SelectFilter({
1517
1574
  fullWidth = false,
1518
1575
  className,
1519
1576
  testIdPrefix,
1577
+ loading = false,
1578
+ error = false,
1579
+ onRetry,
1580
+ size = "md",
1581
+ disabled = false,
1520
1582
  renderIcon
1521
1583
  }) {
1584
+ const sm = size === "sm";
1522
1585
  const [open, setOpen] = (0, import_react7.useState)(false);
1523
1586
  const [pos, setPos] = (0, import_react7.useState)(null);
1524
1587
  const ref = (0, import_react7.useRef)(null);
@@ -1527,8 +1590,10 @@ function SelectFilter({
1527
1590
  const reposition = (0, import_react7.useCallback)(() => {
1528
1591
  if (!ref.current) return;
1529
1592
  const r = ref.current.getBoundingClientRect();
1530
- setPos({ top: r.bottom + 8, left: align === "right" ? r.right - r.width : r.left, width: r.width });
1531
- }, [align]);
1593
+ const h = Math.min(options.length * 36 + 8, 288);
1594
+ const above = r.bottom + 8 + h > window.innerHeight && r.top - 8 - h > 0;
1595
+ setPos({ top: above ? r.top - 8 - h : r.bottom + 8, left: align === "right" ? r.right - r.width : r.left, width: r.width });
1596
+ }, [align, options.length]);
1532
1597
  (0, import_react7.useLayoutEffect)(() => {
1533
1598
  if (!open) return;
1534
1599
  reposition();
@@ -1552,9 +1617,12 @@ function SelectFilter({
1552
1617
  window.removeEventListener("scroll", reposition, true);
1553
1618
  };
1554
1619
  }, [open, close, reposition]);
1555
- const valueText = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value });
1556
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cx4("relative", fullWidth && "w-full"), ref, children: [
1557
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1620
+ const triggerValue = renderIcon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1621
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OptionIcon, { children: renderIcon(value) }),
1622
+ value
1623
+ ] }) : value;
1624
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cx4("relative", fullWidth && "w-full"), ref, children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1558
1626
  "button",
1559
1627
  {
1560
1628
  type: "button",
@@ -1562,20 +1630,17 @@ function SelectFilter({
1562
1630
  onClick: () => setOpen((o) => !o),
1563
1631
  "aria-expanded": open,
1564
1632
  "aria-haspopup": "listbox",
1633
+ "aria-label": sm ? caption : void 0,
1634
+ disabled,
1565
1635
  className: cx4(
1566
- "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1636
+ sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus" : chipTriggerClass(),
1637
+ "disabled:pointer-events-none disabled:opacity-40",
1567
1638
  fullWidth && "w-full justify-between",
1568
1639
  className
1569
1640
  ),
1570
1641
  children: [
1571
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1572
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
1573
- renderIcon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1574
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OptionIcon, { children: renderIcon(value) }),
1575
- valueText
1576
- ] }) : valueText
1577
- ] }),
1578
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1642
+ sm ? triggerValue : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChipContent, { caption, value: triggerValue }),
1643
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1579
1644
  import_lucide_react10.ChevronDown,
1580
1645
  {
1581
1646
  size: 14,
@@ -1587,7 +1652,7 @@ function SelectFilter({
1587
1652
  }
1588
1653
  ),
1589
1654
  open && pos && (0, import_react_dom2.createPortal)(
1590
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1655
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1591
1656
  "div",
1592
1657
  {
1593
1658
  ref: popoverRef,
@@ -1595,13 +1660,13 @@ function SelectFilter({
1595
1660
  style: { position: "fixed", top: pos.top, left: pos.left, width: fullWidth ? pos.width : void 0 },
1596
1661
  className: cx4(
1597
1662
  "z-[65] flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
1598
- !fullWidth && "w-56"
1663
+ !fullWidth && (sm ? "w-28" : "w-56")
1599
1664
  ),
1600
- role: "listbox",
1665
+ role: loading || error ? "group" : "listbox",
1601
1666
  "aria-label": caption,
1602
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: options.map((o) => {
1667
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: options.map((o) => {
1603
1668
  const selected = o === value;
1604
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1669
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1605
1670
  "button",
1606
1671
  {
1607
1672
  type: "button",
@@ -1614,9 +1679,9 @@ function SelectFilter({
1614
1679
  },
1615
1680
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
1616
1681
  children: [
1617
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react10.Check, { size: 15, strokeWidth: 3 }) }),
1618
- renderIcon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OptionIcon, { children: renderIcon(o) }),
1619
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1682
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Check, { size: 15, strokeWidth: 3 }) }),
1683
+ renderIcon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OptionIcon, { children: renderIcon(o) }),
1684
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1620
1685
  "span",
1621
1686
  {
1622
1687
  className: cx4("flex-1 text-[14px]", selected ? "font-semibold text-text-primary" : "text-text-primary"),
@@ -1637,9 +1702,9 @@ function SelectFilter({
1637
1702
 
1638
1703
  // src/Card.tsx
1639
1704
  var import_react8 = require("react");
1640
- var import_jsx_runtime12 = require("react/jsx-runtime");
1705
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1641
1706
  var Card = (0, import_react8.forwardRef)(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, action, className, children, ...rest }, ref) {
1642
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1707
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1643
1708
  "article",
1644
1709
  {
1645
1710
  ref,
@@ -1650,15 +1715,15 @@ var Card = (0, import_react8.forwardRef)(function Card2({ staticCard, title, tit
1650
1715
  className
1651
1716
  ].filter(Boolean).join(" "),
1652
1717
  ...rest,
1653
- children: title ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
1654
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
1655
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1656
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TitleTag, { className: "text-style-card-title", children: title }),
1657
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
1718
+ children: title ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
1719
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
1720
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
1721
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TitleTag, { className: "text-style-card-title", children: title }),
1722
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
1658
1723
  ] }),
1659
- action && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
1724
+ action && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
1660
1725
  ] }),
1661
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children })
1726
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children })
1662
1727
  ] }) : children
1663
1728
  }
1664
1729
  );
@@ -1666,7 +1731,7 @@ var Card = (0, import_react8.forwardRef)(function Card2({ staticCard, title, tit
1666
1731
 
1667
1732
  // src/NoResultsEmptyState.tsx
1668
1733
  var import_lucide_react11 = require("lucide-react");
1669
- var import_jsx_runtime13 = require("react/jsx-runtime");
1734
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1670
1735
  var NO_RESULTS_TITLE = "No results match your filters";
1671
1736
  var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
1672
1737
  function noResultsBody(workspaceName) {
@@ -1688,12 +1753,12 @@ function NoResultsEmptyState({
1688
1753
  const showClear = hasFilters !== false && Boolean(onClearFilters);
1689
1754
  const showEdit = Boolean(onEditFilters);
1690
1755
  const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
1691
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 text-center", "data-testid": testIdPrefix, children: [
1692
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.FilterX, { size: 20, "aria-hidden": "true" }) }),
1693
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
1694
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "max-w-[420px] text-[13px] leading-relaxed text-text-secondary", children: bodyText }),
1695
- hasActions && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
1696
- showClear && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1756
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 text-center", "data-testid": testIdPrefix, children: [
1757
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react11.FilterX, { size: 20, "aria-hidden": "true" }) }),
1758
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
1759
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "max-w-[420px] text-[13px] leading-relaxed text-text-secondary", children: bodyText }),
1760
+ hasActions && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
1761
+ showClear && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1697
1762
  "button",
1698
1763
  {
1699
1764
  type: "button",
@@ -1703,7 +1768,7 @@ function NoResultsEmptyState({
1703
1768
  children: "Clear all filters"
1704
1769
  }
1705
1770
  ),
1706
- showEdit && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1771
+ showEdit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1707
1772
  "button",
1708
1773
  {
1709
1774
  type: "button",
@@ -1713,7 +1778,7 @@ function NoResultsEmptyState({
1713
1778
  children: "Edit filters"
1714
1779
  }
1715
1780
  ),
1716
- actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1781
+ actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1717
1782
  "button",
1718
1783
  {
1719
1784
  type: "button",
@@ -1730,12 +1795,12 @@ function NoResultsEmptyState({
1730
1795
  // src/WorkspaceSelectedCard.tsx
1731
1796
  var import_react9 = require("react");
1732
1797
  var import_lucide_react12 = require("lucide-react");
1733
- var import_jsx_runtime14 = require("react/jsx-runtime");
1798
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1734
1799
  function cx5(...parts) {
1735
1800
  return parts.filter(Boolean).join(" ");
1736
1801
  }
1737
1802
  function WorkspaceSelectedCard({ groups, testIdPrefix }) {
1738
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("aside", { className: "sticky top-4 flex min-w-0 flex-col gap-4 self-start rounded-card border border-border-default bg-surface px-5 pb-5 pt-4 shadow-raised sm:px-6 sm:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) }) });
1803
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("aside", { className: "sticky top-4 flex min-w-0 flex-col gap-4 self-start rounded-card border border-border-default bg-surface px-5 pb-5 pt-4 shadow-raised sm:px-6 sm:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) }) });
1739
1804
  }
1740
1805
  function SummaryGroupItem({
1741
1806
  group,
@@ -1752,8 +1817,8 @@ function SummaryGroupItem({
1752
1817
  else if (expandCount === 0) setOpen(false);
1753
1818
  wasEmpty.current = expandCount === 0;
1754
1819
  }, [expandCount]);
1755
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
1756
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1820
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
1821
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1757
1822
  "button",
1758
1823
  {
1759
1824
  type: "button",
@@ -1762,7 +1827,7 @@ function SummaryGroupItem({
1762
1827
  "data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
1763
1828
  className: "flex w-full min-w-0 items-center gap-2 text-left",
1764
1829
  children: [
1765
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1830
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1766
1831
  import_lucide_react12.ChevronDown,
1767
1832
  {
1768
1833
  size: 14,
@@ -1770,37 +1835,37 @@ function SummaryGroupItem({
1770
1835
  className: cx5("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
1771
1836
  }
1772
1837
  ),
1773
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: cx5("truncate font-semibold text-text-primary", nested ? "text-[12px]" : "text-[13px]"), children: group.label }),
1774
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-[11px] font-semibold text-text-secondary", children: ownCount })
1838
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: cx5("truncate font-semibold text-text-primary", nested ? "text-[12px]" : "text-[13px]"), children: group.label }),
1839
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-[11px] font-semibold text-text-secondary", children: ownCount })
1775
1840
  ]
1776
1841
  }
1777
1842
  ),
1778
- open && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[12px] text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
1779
- ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
1780
- group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1843
+ open && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-[12px] text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
1844
+ ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
1845
+ group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1781
1846
  "div",
1782
1847
  {
1783
1848
  className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
1784
1849
  children: [
1785
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "min-w-0 flex-1", children: [
1786
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "block truncate text-[12px] text-text-primary", children: item.name }),
1787
- item.meta && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "block truncate text-[11px] text-text-secondary", children: item.meta })
1850
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "min-w-0 flex-1", children: [
1851
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block truncate text-[12px] text-text-primary", children: item.name }),
1852
+ item.meta && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block truncate text-[11px] text-text-secondary", children: item.meta })
1788
1853
  ] }),
1789
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1854
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1790
1855
  "button",
1791
1856
  {
1792
1857
  type: "button",
1793
1858
  "aria-label": `Remove ${item.name}`,
1794
1859
  onClick: () => group.onRemove(item.id),
1795
1860
  className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-control text-text-secondary hover:bg-subtle hover:text-text-danger",
1796
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.X, { size: 12, "aria-hidden": "true" })
1861
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.X, { size: 12, "aria-hidden": "true" })
1797
1862
  }
1798
1863
  )
1799
1864
  ]
1800
1865
  },
1801
1866
  item.id
1802
1867
  )),
1803
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1868
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1804
1869
  "button",
1805
1870
  {
1806
1871
  type: "button",
@@ -1811,13 +1876,13 @@ function SummaryGroupItem({
1811
1876
  }
1812
1877
  )
1813
1878
  ] }),
1814
- group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
1879
+ group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
1815
1880
  ] }) })
1816
1881
  ] });
1817
1882
  }
1818
1883
 
1819
1884
  // src/chart-placeholder-shared.tsx
1820
- var import_jsx_runtime15 = require("react/jsx-runtime");
1885
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1821
1886
  var GRID_ROWS = [0, 25, 50, 75, 100];
1822
1887
  var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
1823
1888
  var Y_AXIS_W = 48;
@@ -1829,9 +1894,9 @@ function AxisFrame({
1829
1894
  children
1830
1895
  }) {
1831
1896
  const gutter = xTicks > 0 ? X_AXIS_H : 0;
1832
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w-full", style: { height }, role: "presentation", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative h-full w-full", children: [
1833
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
1834
- GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1897
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-full", style: { height }, role: "presentation", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative h-full w-full", children: [
1898
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
1899
+ GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1835
1900
  "div",
1836
1901
  {
1837
1902
  className: "absolute inset-x-0 border-t border-dashed",
@@ -1839,9 +1904,9 @@ function AxisFrame({
1839
1904
  },
1840
1905
  pct
1841
1906
  )),
1842
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute inset-0", children })
1907
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute inset-0", children })
1843
1908
  ] }),
1844
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1909
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1845
1910
  "div",
1846
1911
  {
1847
1912
  className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
@@ -1849,27 +1914,27 @@ function AxisFrame({
1849
1914
  },
1850
1915
  pct
1851
1916
  )) }),
1852
- xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1917
+ xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1853
1918
  "div",
1854
1919
  {
1855
1920
  className: "absolute bottom-0 right-0 flex items-center",
1856
1921
  style: { left: Y_AXIS_W, height: X_AXIS_H },
1857
- children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-2 w-full max-w-[26px] rounded-xs bg-subtle" }) }, i))
1922
+ children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-2 w-full max-w-[26px] rounded-xs bg-subtle" }) }, i))
1858
1923
  }
1859
1924
  )
1860
1925
  ] }) });
1861
1926
  }
1862
1927
  function BlankLegend({ rows, reverse = false }) {
1863
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1928
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1864
1929
  "ul",
1865
1930
  {
1866
1931
  className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
1867
1932
  role: "presentation",
1868
1933
  "aria-hidden": "true",
1869
- children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
1870
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1871
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
1872
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1934
+ children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
1935
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1936
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
1937
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1873
1938
  "span",
1874
1939
  {
1875
1940
  className: "h-2 rounded-xs bg-subtle",
@@ -1877,21 +1942,21 @@ function BlankLegend({ rows, reverse = false }) {
1877
1942
  }
1878
1943
  )
1879
1944
  ] }),
1880
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
1945
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
1881
1946
  ] }, i))
1882
1947
  }
1883
1948
  );
1884
1949
  }
1885
1950
 
1886
1951
  // src/BarChartPlaceholder.tsx
1887
- var import_jsx_runtime16 = require("react/jsx-runtime");
1952
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1888
1953
  var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
1889
1954
  function BarChartPlaceholder({ height = 220 }) {
1890
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-1 rounded-t-[3px] bg-subtle", style: { height: `${pct}%` } }, i)) }) });
1955
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-1 rounded-t-[3px] bg-subtle", style: { height: `${pct}%` } }, i)) }) });
1891
1956
  }
1892
1957
 
1893
1958
  // src/LineChartPlaceholder.tsx
1894
- var import_jsx_runtime17 = require("react/jsx-runtime");
1959
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1895
1960
  var LINE_SERIES = [
1896
1961
  [58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
1897
1962
  [74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
@@ -1901,9 +1966,9 @@ var LINE_SERIES = [
1901
1966
  var LINE_FORECAST_FROM = 7;
1902
1967
  function LineChartPlaceholder({ height = 280 }) {
1903
1968
  const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
1904
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, children: [
1905
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("g", { children: [
1906
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1969
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, children: [
1970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("g", { children: [
1971
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1907
1972
  "polyline",
1908
1973
  {
1909
1974
  points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
@@ -1915,7 +1980,7 @@ function LineChartPlaceholder({ height = 280 }) {
1915
1980
  strokeLinejoin: "round"
1916
1981
  }
1917
1982
  ),
1918
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1983
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1919
1984
  "polyline",
1920
1985
  {
1921
1986
  points: toPath(pts, LINE_FORECAST_FROM, pts.length),
@@ -1930,7 +1995,7 @@ function LineChartPlaceholder({ height = 280 }) {
1930
1995
  )
1931
1996
  ] }, s)) }),
1932
1997
  LINE_SERIES.map(
1933
- (pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1998
+ (pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1934
1999
  "div",
1935
2000
  {
1936
2001
  className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
@@ -1947,16 +2012,16 @@ function LineChartPlaceholder({ height = 280 }) {
1947
2012
  }
1948
2013
 
1949
2014
  // src/PieChartPlaceholder.tsx
1950
- var import_jsx_runtime18 = require("react/jsx-runtime");
2015
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1951
2016
  var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
1952
2017
  function PieChartPlaceholder({ height = 220, legendRows = 8 }) {
1953
2018
  const r = 45;
1954
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex w-full items-center gap-3", style: { height }, role: "presentation", "aria-hidden": "true", children: [
1955
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
1956
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
2019
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex w-full items-center gap-3", style: { height }, role: "presentation", "aria-hidden": "true", children: [
2020
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
2021
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
1957
2022
  PIE_SEAMS.map((deg) => {
1958
2023
  const rad = (deg - 90) * Math.PI / 180;
1959
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2024
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1960
2025
  "line",
1961
2026
  {
1962
2027
  x1: "50",
@@ -1970,12 +2035,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8 }) {
1970
2035
  );
1971
2036
  })
1972
2037
  ] }) }),
1973
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BlankLegend, { rows: legendRows })
2038
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BlankLegend, { rows: legendRows })
1974
2039
  ] });
1975
2040
  }
1976
2041
 
1977
2042
  // src/StackedColumnPlaceholder.tsx
1978
- var import_jsx_runtime19 = require("react/jsx-runtime");
2043
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1979
2044
  var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
1980
2045
  function columnBands(count) {
1981
2046
  const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
@@ -1988,7 +2053,7 @@ function StackedColumnPlaceholder({
1988
2053
  legendRows = 4,
1989
2054
  axis = false
1990
2055
  }) {
1991
- const column = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2056
+ const column = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1992
2057
  "div",
1993
2058
  {
1994
2059
  style: {
@@ -2000,16 +2065,16 @@ function StackedColumnPlaceholder({
2000
2065
  },
2001
2066
  i
2002
2067
  )) });
2003
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex w-full gap-4", style: { height }, role: "presentation", "aria-hidden": "true", children: [
2004
- axis ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-stretch py-1", children: column }),
2005
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
2068
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex w-full gap-4", style: { height }, role: "presentation", "aria-hidden": "true", children: [
2069
+ axis ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-stretch py-1", children: column }),
2070
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
2006
2071
  ] });
2007
2072
  }
2008
2073
 
2009
2074
  // src/Tooltip.tsx
2010
2075
  var import_react10 = require("react");
2011
2076
  var import_react_dom3 = require("react-dom");
2012
- var import_jsx_runtime20 = require("react/jsx-runtime");
2077
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2013
2078
  function cx6(...parts) {
2014
2079
  return parts.filter(Boolean).join(" ");
2015
2080
  }
@@ -2198,7 +2263,7 @@ function Tooltip({
2198
2263
  }
2199
2264
  }
2200
2265
  const floating = anchor != null && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
2201
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2266
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2202
2267
  "span",
2203
2268
  {
2204
2269
  ref: boxRef,
@@ -2229,7 +2294,7 @@ function Tooltip({
2229
2294
  document.body
2230
2295
  ) : null;
2231
2296
  if (anchorRef) return floating;
2232
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2297
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2233
2298
  "span",
2234
2299
  {
2235
2300
  ref,
@@ -2250,26 +2315,26 @@ function Tooltip({
2250
2315
  }
2251
2316
 
2252
2317
  // src/AdvertiserNoResults.tsx
2253
- var import_jsx_runtime21 = require("react/jsx-runtime");
2318
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2254
2319
  function AdvertiserNoResults({
2255
2320
  query,
2256
2321
  hint = "Try checking your spelling or searching for a broader brand name."
2257
2322
  }) {
2258
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
2259
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
2323
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
2324
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
2260
2325
  "No results found for \u201C",
2261
2326
  query,
2262
2327
  "\u201D"
2263
2328
  ] }),
2264
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: hint })
2329
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: hint })
2265
2330
  ] });
2266
2331
  }
2267
2332
 
2268
2333
  // src/SelectAllVisible.tsx
2269
2334
  var import_lucide_react13 = require("lucide-react");
2270
- var import_jsx_runtime22 = require("react/jsx-runtime");
2335
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2271
2336
  function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
2272
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2337
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2273
2338
  "button",
2274
2339
  {
2275
2340
  type: "button",
@@ -2277,7 +2342,7 @@ function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
2277
2342
  onClick: onToggle,
2278
2343
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[12px] font-semibold text-text-link transition-colors hover:bg-subtle",
2279
2344
  children: [
2280
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react13.ListChecks, { size: 14, "aria-hidden": "true" }),
2345
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.ListChecks, { size: 14, "aria-hidden": "true" }),
2281
2346
  allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
2282
2347
  ]
2283
2348
  }
@@ -2286,14 +2351,14 @@ function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
2286
2351
 
2287
2352
  // src/SelectedSection.tsx
2288
2353
  var import_lucide_react14 = require("lucide-react");
2289
- var import_jsx_runtime23 = require("react/jsx-runtime");
2354
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2290
2355
  function cx7(...parts) {
2291
2356
  return parts.filter(Boolean).join(" ");
2292
2357
  }
2293
2358
  function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2294
2359
  if (count === 0) return null;
2295
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col", children: [
2296
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2360
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col", children: [
2361
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2297
2362
  "button",
2298
2363
  {
2299
2364
  type: "button",
@@ -2302,14 +2367,14 @@ function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2302
2367
  "aria-expanded": open,
2303
2368
  className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary",
2304
2369
  children: [
2305
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react14.ChevronDown, { size: 13, "aria-hidden": "true", className: cx7("transition-transform", !open && "-rotate-90") }),
2370
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.ChevronDown, { size: 13, "aria-hidden": "true", className: cx7("transition-transform", !open && "-rotate-90") }),
2306
2371
  "Selected (",
2307
2372
  count,
2308
2373
  ")"
2309
2374
  ]
2310
2375
  }
2311
2376
  ),
2312
- open && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col gap-0.5", children })
2377
+ open && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-0.5", children })
2313
2378
  ] });
2314
2379
  }
2315
2380
 
@@ -2317,7 +2382,7 @@ function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2317
2382
  var import_react11 = require("react");
2318
2383
  var import_react_dom4 = require("react-dom");
2319
2384
  var import_lucide_react15 = require("lucide-react");
2320
- var import_jsx_runtime24 = require("react/jsx-runtime");
2385
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2321
2386
  function cx8(...parts) {
2322
2387
  return parts.filter(Boolean).join(" ");
2323
2388
  }
@@ -2412,17 +2477,17 @@ function SelectionPicker({
2412
2477
  }
2413
2478
  };
2414
2479
  const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
2415
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4", children: [
2416
- helper && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2417
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-secondary", children: helper }),
2418
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
2480
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-4", children: [
2481
+ helper && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2482
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-secondary", children: helper }),
2483
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
2419
2484
  ] }),
2420
- hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "inline-flex gap-0.5 self-start rounded-control border border-border-default bg-canvas p-0.5", children: [
2485
+ hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "inline-flex gap-0.5 self-start rounded-control border border-border-default bg-canvas p-0.5", children: [
2421
2486
  { id: "search", label: "Search", icon: import_lucide_react15.Search },
2422
2487
  { id: "lists", label: "Account lists", icon: import_lucide_react15.List }
2423
2488
  ].map((t) => {
2424
2489
  const on = source === t.id;
2425
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2490
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2426
2491
  "button",
2427
2492
  {
2428
2493
  type: "button",
@@ -2433,18 +2498,18 @@ function SelectionPicker({
2433
2498
  on ? "bg-surface text-text-primary shadow-raised" : "text-text-secondary hover:text-text-primary"
2434
2499
  ),
2435
2500
  children: [
2436
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(t.icon, { size: 14, "aria-hidden": "true" }),
2501
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(t.icon, { size: 14, "aria-hidden": "true" }),
2437
2502
  t.label
2438
2503
  ]
2439
2504
  },
2440
2505
  t.id
2441
2506
  );
2442
2507
  }) }),
2443
- source === "search" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2444
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2445
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-8 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
2446
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2447
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2508
+ source === "search" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2509
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2510
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex h-8 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
2511
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2512
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2448
2513
  "input",
2449
2514
  {
2450
2515
  value: query,
@@ -2460,7 +2525,7 @@ function SelectionPicker({
2460
2525
  }
2461
2526
  )
2462
2527
  ] }),
2463
- filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2528
+ filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2464
2529
  FilterDropdown,
2465
2530
  {
2466
2531
  filter: f,
@@ -2472,14 +2537,14 @@ function SelectionPicker({
2472
2537
  )),
2473
2538
  toolbarExtra
2474
2539
  ] }),
2475
- !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2476
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2477
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
2478
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "Search to get started" }),
2479
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Use the search or filters above to find and add options." })
2540
+ !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2541
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2542
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
2543
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "Search to get started" }),
2544
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Use the search or filters above to find and add options." })
2480
2545
  ] })
2481
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
2482
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2546
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
2547
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2483
2548
  "div",
2484
2549
  {
2485
2550
  className: cx8(
@@ -2487,7 +2552,7 @@ function SelectionPicker({
2487
2552
  rowGridCols
2488
2553
  ),
2489
2554
  children: [
2490
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2555
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2491
2556
  CheckBox,
2492
2557
  {
2493
2558
  checked: allSelected,
@@ -2498,18 +2563,18 @@ function SelectionPicker({
2498
2563
  testId: testIdPrefix && `${testIdPrefix}-select-all`
2499
2564
  }
2500
2565
  ),
2501
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx8("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
2502
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-right", children: "Info" })
2566
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
2567
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-right", children: "Info" })
2503
2568
  ]
2504
2569
  }
2505
2570
  ),
2506
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "max-h-[360px] overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
2571
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "max-h-[360px] overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
2507
2572
  const isSel = selectedIds.has(row.id);
2508
2573
  const isLocked = lockedIds?.has(row.id) ?? false;
2509
2574
  const kids = getChildren?.(row);
2510
2575
  const isOpen = expanded.has(row.id);
2511
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
2512
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2576
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
2577
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2513
2578
  "div",
2514
2579
  {
2515
2580
  onClick: isLocked ? void 0 : () => toggleRow(row),
@@ -2522,7 +2587,7 @@ function SelectionPicker({
2522
2587
  !isLocked && isSel && "opacity-70"
2523
2588
  ),
2524
2589
  children: [
2525
- isLocked ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2590
+ isLocked ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2526
2591
  CheckBox,
2527
2592
  {
2528
2593
  checked: isSel,
@@ -2531,8 +2596,8 @@ function SelectionPicker({
2531
2596
  testId: testIdPrefix && `${testIdPrefix}-row-${slug4(row.id)}`
2532
2597
  }
2533
2598
  ),
2534
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx8("grid gap-2 text-[13px] text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: cx8("truncate", c.className), children: c.render(row) }, c.key)) }),
2535
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2599
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("grid gap-2 text-[13px] text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cx8("truncate", c.className), children: c.render(row) }, c.key)) }),
2600
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2536
2601
  "button",
2537
2602
  {
2538
2603
  type: "button",
@@ -2546,28 +2611,28 @@ function SelectionPicker({
2546
2611
  });
2547
2612
  },
2548
2613
  className: "flex h-7 w-7 items-center justify-center rounded-control text-text-secondary hover:bg-canvas hover:text-text-primary",
2549
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.ChevronRight, { size: 15, className: cx8("transition-transform", isOpen && "rotate-90") })
2614
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.ChevronRight, { size: 15, className: cx8("transition-transform", isOpen && "rotate-90") })
2550
2615
  }
2551
- ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2616
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2552
2617
  "span",
2553
2618
  {
2554
2619
  className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
2555
2620
  title: "No additional details",
2556
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Info, { size: 14 })
2621
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Info, { size: 14 })
2557
2622
  }
2558
2623
  ) })
2559
2624
  ]
2560
2625
  }
2561
2626
  ),
2562
- isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
2627
+ isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
2563
2628
  const kidSel = selectedIds.has(kid.id);
2564
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2629
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2565
2630
  "div",
2566
2631
  {
2567
2632
  className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
2568
2633
  children: [
2569
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate text-[13px] text-text-secondary", children: kid.name }),
2570
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2634
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-[13px] text-text-secondary", children: kid.name }),
2635
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2571
2636
  "button",
2572
2637
  {
2573
2638
  type: "button",
@@ -2578,7 +2643,7 @@ function SelectionPicker({
2578
2643
  kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
2579
2644
  ),
2580
2645
  children: [
2581
- kidSel ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Plus, { size: 13 }),
2646
+ kidSel ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Plus, { size: 13 }),
2582
2647
  kidSel ? "Added" : "Add"
2583
2648
  ]
2584
2649
  }
@@ -2590,7 +2655,7 @@ function SelectionPicker({
2590
2655
  }) })
2591
2656
  ] }, row.id);
2592
2657
  }) }),
2593
- !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2658
+ !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2594
2659
  "button",
2595
2660
  {
2596
2661
  type: "button",
@@ -2599,19 +2664,19 @@ function SelectionPicker({
2599
2664
  "data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
2600
2665
  className: "flex w-full items-center justify-center gap-2 border-t border-border-default px-2 py-1.5 text-[13px] text-brand-primaryAction transition-colors hover:bg-subtle disabled:opacity-50",
2601
2666
  children: [
2602
- loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
2667
+ loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
2603
2668
  loadingMore ? "Loading\u2026" : "Load more"
2604
2669
  ]
2605
2670
  }
2606
2671
  )
2607
2672
  ] })
2608
2673
  ] }),
2609
- source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2610
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
2611
- accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2612
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ScrollFade, { className: "flex max-h-[396px] flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
2674
+ source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2675
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
2676
+ accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2677
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScrollFade, { className: "flex max-h-[396px] flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
2613
2678
  const on = (selectedListIds ?? []).includes(list.id);
2614
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2679
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2615
2680
  "button",
2616
2681
  {
2617
2682
  type: "button",
@@ -2623,19 +2688,19 @@ function SelectionPicker({
2623
2688
  on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
2624
2689
  ),
2625
2690
  children: [
2626
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2691
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2627
2692
  "span",
2628
2693
  {
2629
2694
  className: cx8(
2630
2695
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
2631
2696
  on ? "text-brand-primaryAction" : "text-text-secondary"
2632
2697
  ),
2633
- children: on ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Plus, { size: 16 })
2698
+ children: on ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Plus, { size: 16 })
2634
2699
  }
2635
2700
  ),
2636
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "min-w-0 flex-1", children: [
2637
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate text-[14px] font-medium text-text-primary", children: list.name }) }),
2638
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "block truncate text-[12px] text-text-secondary", children: [
2701
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "min-w-0 flex-1", children: [
2702
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-[14px] font-medium text-text-primary", children: list.name }) }),
2703
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "block truncate text-[12px] text-text-secondary", children: [
2639
2704
  list.count,
2640
2705
  " accounts \xB7 ",
2641
2706
  list.entityTypes.join(", "),
@@ -2643,13 +2708,13 @@ function SelectionPicker({
2643
2708
  formatListDate(list.updatedAt)
2644
2709
  ] })
2645
2710
  ] }),
2646
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: cx8("shrink-0 text-[12px] font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
2711
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cx8("shrink-0 text-[12px] font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
2647
2712
  ]
2648
2713
  },
2649
2714
  list.id
2650
2715
  );
2651
2716
  }) }),
2652
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2717
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2653
2718
  "p",
2654
2719
  {
2655
2720
  className: "border-t border-border-default pt-2 text-right text-[12px] font-medium text-text-tertiary",
@@ -2661,11 +2726,11 @@ function SelectionPicker({
2661
2726
  ]
2662
2727
  }
2663
2728
  )
2664
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2665
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2666
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
2667
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "No account lists yet" }),
2668
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Account lists set up for you will appear here." })
2729
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2730
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2731
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
2732
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "No account lists yet" }),
2733
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Account lists set up for you will appear here." })
2669
2734
  ] })
2670
2735
  ] })
2671
2736
  ] })
@@ -2697,7 +2762,7 @@ function ScrollFade({ className, children }) {
2697
2762
  [sync]
2698
2763
  );
2699
2764
  const mask = edges.top || edges.bottom ? `linear-gradient(to bottom, transparent 0, #000 ${edges.top ? EDGE_FADE : 0}px, #000 calc(100% - ${edges.bottom ? EDGE_FADE : 0}px), transparent 100%)` : void 0;
2700
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
2765
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
2701
2766
  }
2702
2767
  function formatListDate(iso) {
2703
2768
  try {
@@ -2747,8 +2812,8 @@ function FilterDropdown({
2747
2812
  const count = active.size;
2748
2813
  const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
2749
2814
  const filterSlug = slug4(filter.label);
2750
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative", children: [
2751
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2815
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
2816
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2752
2817
  "button",
2753
2818
  {
2754
2819
  ref: btnRef,
@@ -2759,12 +2824,12 @@ function FilterDropdown({
2759
2824
  className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-[13px] font-medium text-text-secondary transition-colors hover:bg-subtle",
2760
2825
  children: [
2761
2826
  label,
2762
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
2827
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
2763
2828
  ]
2764
2829
  }
2765
2830
  ),
2766
2831
  open && pos && (0, import_react_dom4.createPortal)(
2767
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2832
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2768
2833
  "div",
2769
2834
  {
2770
2835
  ref: menuRef,
@@ -2773,9 +2838,9 @@ function FilterDropdown({
2773
2838
  style: { top: pos.top, left: pos.left },
2774
2839
  className: "fixed z-[80] min-w-[220px] rounded-card border border-border-default bg-surface p-2 shadow-overlay",
2775
2840
  children: [
2776
- searchable && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
2777
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
2778
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2841
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
2842
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
2843
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2779
2844
  "input",
2780
2845
  {
2781
2846
  autoFocus: true,
@@ -2786,14 +2851,14 @@ function FilterDropdown({
2786
2851
  }
2787
2852
  )
2788
2853
  ] }),
2789
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx8("flex flex-col gap-0.5", searchable && "max-h-[240px] overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "px-2 py-3 text-center text-[12px] text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
2854
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("flex flex-col gap-0.5", searchable && "max-h-[240px] overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-2 py-3 text-center text-[12px] text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
2790
2855
  const on = active.has(opt);
2791
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2856
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2792
2857
  "label",
2793
2858
  {
2794
2859
  className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-[13px] text-text-primary hover:bg-subtle",
2795
2860
  children: [
2796
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2861
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2797
2862
  CheckBox,
2798
2863
  {
2799
2864
  checked: on,
@@ -2824,7 +2889,7 @@ function gridForColumns(columns) {
2824
2889
 
2825
2890
  // src/PublisherBreakdownList.tsx
2826
2891
  var import_react12 = require("react");
2827
- var import_jsx_runtime25 = require("react/jsx-runtime");
2892
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2828
2893
  function cx9(...parts) {
2829
2894
  return parts.filter(Boolean).join(" ");
2830
2895
  }
@@ -2839,7 +2904,7 @@ function initials(name) {
2839
2904
  return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
2840
2905
  }
2841
2906
  function Monogram({ name, size = 28 }) {
2842
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2907
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2843
2908
  "span",
2844
2909
  {
2845
2910
  "aria-hidden": "true",
@@ -2850,12 +2915,12 @@ function Monogram({ name, size = 28 }) {
2850
2915
  );
2851
2916
  }
2852
2917
  function BreakdownTag({ children }) {
2853
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary", children });
2918
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary", children });
2854
2919
  }
2855
2920
  function DelayedTip({ label, children }) {
2856
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
2921
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
2857
2922
  children,
2858
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2923
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2859
2924
  "span",
2860
2925
  {
2861
2926
  role: "tooltip",
@@ -2869,22 +2934,22 @@ var COL_CURRENT = 76;
2869
2934
  var COL_PREVIOUS = 76;
2870
2935
  var COL_YOY = 44;
2871
2936
  function MetricListHeader({ className }) {
2872
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
2873
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex-1" }),
2874
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2875
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
2876
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
2877
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
2937
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
2938
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex-1" }),
2939
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2940
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
2941
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
2942
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
2878
2943
  ] })
2879
2944
  ] });
2880
2945
  }
2881
2946
  function MetricCells({ spendN, yoy }) {
2882
2947
  const prior = priorYearAmt(spendN, yoy);
2883
2948
  const up = yoy !== "NEW" && yoy >= 0;
2884
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2885
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
2886
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
2887
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
2949
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2950
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
2951
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
2952
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
2888
2953
  up ? "+" : "\u2212",
2889
2954
  Math.abs(yoy),
2890
2955
  "%"
@@ -2895,35 +2960,35 @@ function PublisherBreakdownList({ rows, defaultVisibleCount = 10, padded = true,
2895
2960
  const [showAll, setShowAll] = (0, import_react12.useState)(false);
2896
2961
  const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
2897
2962
  const rowPad = padded ? "px-5" : "";
2898
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col", children: [
2899
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col", children: [
2900
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MetricListHeader, { className: rowPad }),
2901
- visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cx9("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
2902
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
2903
- renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Monogram, { name: p.brand, size: 28 }),
2904
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0", children: [
2905
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2906
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: p.brand }),
2907
- p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BreakdownTag, { children: t }, t))
2963
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col", children: [
2964
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col", children: [
2965
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetricListHeader, { className: rowPad }),
2966
+ visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
2967
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
2968
+ renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Monogram, { name: p.brand, size: 28 }),
2969
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "min-w-0", children: [
2970
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2971
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: p.brand }),
2972
+ p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(BreakdownTag, { children: t }, t))
2908
2973
  ] }),
2909
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
2974
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
2910
2975
  ] })
2911
2976
  ] }),
2912
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
2977
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
2913
2978
  ] }, p.brand))
2914
2979
  ] }),
2915
- rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cx9("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("a", { href: viewAllHref, className: "text-[12px] font-semibold text-text-link hover:underline", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cx9("flex items-center gap-2 border-t border-border-default py-3 text-[12px] text-text-tertiary", rowPad), children: [
2916
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { children: [
2980
+ rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cx9("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("a", { href: viewAllHref, className: "text-[12px] font-semibold text-text-link hover:underline", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-center gap-2 border-t border-border-default py-3 text-[12px] text-text-tertiary", rowPad), children: [
2981
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
2917
2982
  "Showing ",
2918
2983
  visible.length,
2919
2984
  " of ",
2920
2985
  rows.length
2921
2986
  ] }),
2922
- !showAll ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline", children: [
2987
+ !showAll ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline", children: [
2923
2988
  "See all (",
2924
2989
  rows.length - defaultVisibleCount,
2925
2990
  " more)"
2926
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline", children: "Show less" })
2991
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline", children: "Show less" })
2927
2992
  ] }))
2928
2993
  ] });
2929
2994
  }
@@ -2933,7 +2998,7 @@ var import_react13 = require("react");
2933
2998
  var import_react_slot = require("@radix-ui/react-slot");
2934
2999
  var import_class_variance_authority = require("class-variance-authority");
2935
3000
  var import_lucide_react16 = require("lucide-react");
2936
- var import_jsx_runtime26 = require("react/jsx-runtime");
3001
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2937
3002
  var buttonVariants = (0, import_class_variance_authority.cva)(
2938
3003
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
2939
3004
  {
@@ -3003,10 +3068,10 @@ var Button = (0, import_react13.forwardRef)(
3003
3068
  ...props
3004
3069
  };
3005
3070
  if (asChild) {
3006
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_slot.Slot, { ref, ...shared, children });
3071
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_slot.Slot, { ref, ...shared, children });
3007
3072
  }
3008
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { ref, ...shared, children: [
3009
- loading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
3073
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { ref, ...shared, children: [
3074
+ loading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
3010
3075
  children
3011
3076
  ] });
3012
3077
  }
@@ -3014,14 +3079,14 @@ var Button = (0, import_react13.forwardRef)(
3014
3079
  Button.displayName = "Button";
3015
3080
 
3016
3081
  // src/FilterDropdownFooter.tsx
3017
- var import_jsx_runtime27 = require("react/jsx-runtime");
3082
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3018
3083
  function FilterDropdownFooter({
3019
3084
  onClear,
3020
3085
  onApply,
3021
3086
  clearLabel = "Clear all",
3022
3087
  applyLabel = "Apply"
3023
3088
  }) {
3024
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3089
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3025
3090
  "div",
3026
3091
  {
3027
3092
  className: cn(
@@ -3029,8 +3094,8 @@ function FilterDropdownFooter({
3029
3094
  onClear ? "justify-between" : "justify-end"
3030
3095
  ),
3031
3096
  children: [
3032
- onClear && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3033
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3097
+ onClear && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3098
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3034
3099
  ]
3035
3100
  }
3036
3101
  );
@@ -3039,7 +3104,7 @@ function FilterDropdownFooter({
3039
3104
  // src/NameListModal.tsx
3040
3105
  var import_react14 = require("react");
3041
3106
  var import_react_dom5 = require("react-dom");
3042
- var import_jsx_runtime28 = require("react/jsx-runtime");
3107
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3043
3108
  function NameListModal({
3044
3109
  title,
3045
3110
  initialName,
@@ -3091,12 +3156,12 @@ function NameListModal({
3091
3156
  // bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
3092
3157
  // No in-data-[theme=dark] override needed any more -- the token redefines
3093
3158
  // itself under that attribute in dark.css, so one class covers both themes.
3094
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3159
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3095
3160
  "div",
3096
3161
  {
3097
3162
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
3098
3163
  onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
3099
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3164
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3100
3165
  "div",
3101
3166
  {
3102
3167
  ref: dialogRef,
@@ -3106,10 +3171,10 @@ function NameListModal({
3106
3171
  onKeyDown: trapTab,
3107
3172
  className: "w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay",
3108
3173
  children: [
3109
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3110
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
3111
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { htmlFor: fieldId, className: "text-[12px] font-medium text-text-secondary", children: fieldLabel }),
3112
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3174
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3175
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
3176
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: fieldId, className: "text-[12px] font-medium text-text-secondary", children: fieldLabel }),
3177
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3113
3178
  "input",
3114
3179
  {
3115
3180
  id: fieldId,
@@ -3121,13 +3186,13 @@ function NameListModal({
3121
3186
  }
3122
3187
  )
3123
3188
  ] }),
3124
- options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-[13px] text-text-primary", children: [
3125
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
3189
+ options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-[13px] text-text-primary", children: [
3190
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
3126
3191
  o.label
3127
3192
  ] }, o.key)) }),
3128
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
3129
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
3130
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
3193
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
3194
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
3195
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
3131
3196
  ] })
3132
3197
  ]
3133
3198
  }
@@ -3138,37 +3203,13 @@ function NameListModal({
3138
3203
  );
3139
3204
  }
3140
3205
 
3141
- // src/ChipTrigger.tsx
3142
- var import_jsx_runtime29 = require("react/jsx-runtime");
3143
- function chipTriggerClass(_variant = "box") {
3144
- return cn(
3145
- "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
3146
- // One stroke for every trigger: a `box` chip on the lighter default
3147
- // border sat beside SelectFilter's darker one in the same row and read as
3148
- // a different kind of control. The variant no longer changes anything.
3149
- );
3150
- }
3151
- function ChipContent({ caption, value, icon }) {
3152
- const stack = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3153
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
3154
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3155
- ] });
3156
- if (icon) {
3157
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "flex items-center gap-2", children: [
3158
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
3159
- stack
3160
- ] });
3161
- }
3162
- return stack;
3163
- }
3164
-
3165
3206
  // src/FilterChipBar.tsx
3166
3207
  var import_lucide_react17 = require("lucide-react");
3167
- var import_jsx_runtime30 = require("react/jsx-runtime");
3208
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3168
3209
  function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
3169
3210
  if (chips.length === 0) return null;
3170
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", children: [
3171
- chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3211
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", children: [
3212
+ chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3172
3213
  Chip,
3173
3214
  {
3174
3215
  label: c.label,
@@ -3178,7 +3219,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
3178
3219
  },
3179
3220
  c.key
3180
3221
  )),
3181
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-[12px] font-medium text-text-link hover:underline", children: "Clear all" })
3222
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-[12px] font-medium text-text-link hover:underline", children: "Clear all" })
3182
3223
  ] });
3183
3224
  }
3184
3225
  function Chip({
@@ -3187,8 +3228,8 @@ function Chip({
3187
3228
  parked,
3188
3229
  onRemove
3189
3230
  }) {
3190
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "group relative inline-flex", children: [
3191
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3231
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "group relative inline-flex", children: [
3232
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3192
3233
  "span",
3193
3234
  {
3194
3235
  className: cn(
@@ -3200,22 +3241,22 @@ function Chip({
3200
3241
  ) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
3201
3242
  ),
3202
3243
  children: [
3203
- parked && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react17.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
3244
+ parked && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
3204
3245
  label,
3205
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3246
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3206
3247
  "button",
3207
3248
  {
3208
3249
  type: "button",
3209
3250
  onClick: onRemove,
3210
3251
  "aria-label": `Remove ${groupLabel}: ${label}`,
3211
3252
  className: "text-text-tertiary transition-colors hover:text-text-primary",
3212
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react17.X, { size: 12 })
3253
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.X, { size: 12 })
3213
3254
  }
3214
3255
  )
3215
3256
  ]
3216
3257
  }
3217
3258
  ),
3218
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3259
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3219
3260
  "span",
3220
3261
  {
3221
3262
  role: "tooltip",
@@ -3228,7 +3269,7 @@ function Chip({
3228
3269
 
3229
3270
  // src/SortButton.tsx
3230
3271
  var import_lucide_react18 = require("lucide-react");
3231
- var import_jsx_runtime31 = require("react/jsx-runtime");
3272
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3232
3273
  var ALIGN = {
3233
3274
  left: "justify-start text-left",
3234
3275
  center: "justify-center text-center",
@@ -3244,9 +3285,9 @@ function SortButton({
3244
3285
  align = "left",
3245
3286
  testIdPrefix
3246
3287
  }) {
3247
- if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("inline-flex", ALIGN[align]), children: label });
3288
+ if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn("inline-flex", ALIGN[align]), children: label });
3248
3289
  const active = !disabled && sort.key === sortKey;
3249
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3290
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3250
3291
  "button",
3251
3292
  {
3252
3293
  type: "button",
@@ -3275,7 +3316,7 @@ function SortButton({
3275
3316
  ),
3276
3317
  children: [
3277
3318
  label,
3278
- !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react18.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react18.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3319
+ !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3279
3320
  import_lucide_react18.ArrowUpDown,
3280
3321
  {
3281
3322
  size: 12,
@@ -3304,7 +3345,7 @@ function ariaSortFor(sort, key) {
3304
3345
 
3305
3346
  // src/Pager.tsx
3306
3347
  var import_lucide_react19 = require("lucide-react");
3307
- var import_jsx_runtime32 = require("react/jsx-runtime");
3348
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3308
3349
  function pageWindow(current, total) {
3309
3350
  if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
3310
3351
  const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
@@ -3320,8 +3361,8 @@ function pageWindow(current, total) {
3320
3361
  }
3321
3362
  function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination" }) {
3322
3363
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-30";
3323
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3324
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3364
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3365
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3325
3366
  "button",
3326
3367
  {
3327
3368
  type: "button",
@@ -3329,11 +3370,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3329
3370
  disabled: disabled || page === 1,
3330
3371
  "aria-label": "Previous page",
3331
3372
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3332
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3373
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3333
3374
  }
3334
3375
  ),
3335
3376
  pageWindow(page, totalPages).map(
3336
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3377
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3337
3378
  "button",
3338
3379
  {
3339
3380
  type: "button",
@@ -3342,14 +3383,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3342
3383
  "aria-current": p === page ? "page" : void 0,
3343
3384
  className: cn(
3344
3385
  btn,
3345
- p === page ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3386
+ p === page ? "bg-subtle font-semibold text-text-primary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3346
3387
  ),
3347
3388
  children: p.toLocaleString()
3348
3389
  },
3349
3390
  p
3350
3391
  )
3351
3392
  ),
3352
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3393
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3353
3394
  "button",
3354
3395
  {
3355
3396
  type: "button",
@@ -3357,14 +3398,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3357
3398
  disabled: disabled || page === totalPages,
3358
3399
  "aria-label": "Next page",
3359
3400
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3360
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3401
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3361
3402
  }
3362
3403
  )
3363
3404
  ] });
3364
3405
  }
3365
3406
 
3366
3407
  // src/WorkspaceAvatar.tsx
3367
- var import_jsx_runtime33 = require("react/jsx-runtime");
3408
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3368
3409
  function workspaceInitials(name) {
3369
3410
  const words = name.trim().split(/\s+/).filter(Boolean);
3370
3411
  if (words.length === 0) return "\xB7";
@@ -3382,7 +3423,7 @@ var SIZES = {
3382
3423
  lg: "h-11 w-11 text-panel-title"
3383
3424
  };
3384
3425
  function WorkspaceAvatar({ name, size = "md" }) {
3385
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3426
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3386
3427
  "span",
3387
3428
  {
3388
3429
  "aria-hidden": "true",
@@ -3399,11 +3440,11 @@ function WorkspaceAvatar({ name, size = "md" }) {
3399
3440
  var import_react15 = require("react");
3400
3441
  var import_react_dom6 = require("react-dom");
3401
3442
  var import_lucide_react20 = require("lucide-react");
3402
- var import_jsx_runtime34 = require("react/jsx-runtime");
3443
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3403
3444
  var ICON = {
3404
3445
  neutral: null,
3405
- success: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react20.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
3406
- warning: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react20.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
3446
+ success: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react20.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
3447
+ warning: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react20.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
3407
3448
  };
3408
3449
  function Toast({ message, action, onClose, tone = "neutral", duration, className }) {
3409
3450
  const ms = duration ?? (action ? 1e4 : 5e3);
@@ -3419,7 +3460,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3419
3460
  return () => window.clearTimeout(t);
3420
3461
  }, [message, ms, paused]);
3421
3462
  return (0, import_react_dom6.createPortal)(
3422
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3463
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3423
3464
  "div",
3424
3465
  {
3425
3466
  role: "status",
@@ -3436,7 +3477,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3436
3477
  children: [
3437
3478
  ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
3438
3479
  // for the page, and on the toast's flipped surface amber drops to 2:1.
3439
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3480
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3440
3481
  "span",
3441
3482
  {
3442
3483
  className: cn(
@@ -3446,8 +3487,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3446
3487
  children: ICON[tone]
3447
3488
  }
3448
3489
  ),
3449
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0", children: message }),
3450
- action && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3490
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "min-w-0", children: message }),
3491
+ action && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3451
3492
  "button",
3452
3493
  {
3453
3494
  type: "button",
@@ -3469,29 +3510,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3469
3510
  }
3470
3511
 
3471
3512
  // src/Tag.tsx
3472
- var import_jsx_runtime35 = require("react/jsx-runtime");
3513
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3473
3514
  function Tag({ children, className }) {
3474
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3475
- "span",
3476
- {
3477
- className: cn(
3478
- // text-micro and tertiary ink. The component used to sit at 11px in
3479
- // secondary -- a step darker than the ten hand-rolled copies the audit
3480
- // found, which had independently drifted to tertiary. Ten people
3481
- // reaching for "quieter" is worth more than the component's original
3482
- // guess: a tag names what a row IS, which is background to the row
3483
- // itself rather than part of it.
3484
- "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-micro font-medium text-text-tertiary",
3485
- className
3486
- ),
3487
- children
3488
- }
3489
- );
3515
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Badge, { kind: "category", className, children });
3490
3516
  }
3491
3517
 
3492
3518
  // src/TablePagination.tsx
3493
3519
  var import_lucide_react21 = require("lucide-react");
3494
- var import_jsx_runtime36 = require("react/jsx-runtime");
3520
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3495
3521
  function TablePagination({
3496
3522
  page,
3497
3523
  perPage,
@@ -3511,7 +3537,7 @@ function TablePagination({
3511
3537
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors";
3512
3538
  const off = "disabled:pointer-events-none disabled:opacity-30";
3513
3539
  const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
3514
- const range = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-[13px] text-text-tertiary tabular-nums", children: [
3540
+ const range = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-[13px] text-text-tertiary tabular-nums", children: [
3515
3541
  rangeStart.toLocaleString(),
3516
3542
  " \u2013 ",
3517
3543
  rangeEnd.toLocaleString(),
@@ -3520,37 +3546,30 @@ function TablePagination({
3520
3546
  " ",
3521
3547
  itemLabel
3522
3548
  ] });
3523
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3524
- onPerPageChange ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-2 text-[13px] text-text-secondary", children: [
3525
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "relative", children: [
3526
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3527
- "select",
3528
- {
3529
- value: perPage,
3530
- onChange: (e) => onPerPageChange(Number(e.target.value)),
3531
- disabled,
3532
- "aria-label": "Items per page",
3533
- "data-testid": testIdPrefix && `${testIdPrefix}-per-page`,
3534
- className: cn(
3535
- "appearance-none rounded-control border border-border-strong bg-input py-1 pl-2.5 pr-7 text-[13px] font-medium text-text-primary focus:outline focus:outline-2 focus:outline-border-focus",
3536
- off
3537
- ),
3538
- children: perPageOptions.map((n) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: n, children: n }, n))
3539
- }
3540
- ),
3541
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3542
- import_lucide_react21.ChevronDown,
3543
- {
3544
- size: 13,
3545
- "aria-hidden": "true",
3546
- className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-text-secondary"
3547
- }
3548
- )
3549
- ] }),
3550
- "items per page"
3551
- ] }) : range,
3552
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3553
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3549
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3550
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3551
+ "div",
3552
+ {
3553
+ className: cn("flex items-center gap-2 text-[13px] text-text-secondary", !onPerPageChange && "invisible"),
3554
+ children: [
3555
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3556
+ SelectFilter,
3557
+ {
3558
+ size: "sm",
3559
+ caption: "Items per page",
3560
+ value: String(perPage),
3561
+ options: perPageOptions.map(String),
3562
+ onChange: (v) => onPerPageChange?.(Number(v)),
3563
+ disabled,
3564
+ testIdPrefix: testIdPrefix && `${testIdPrefix}-per-page`
3565
+ }
3566
+ ),
3567
+ "items per page"
3568
+ ]
3569
+ }
3570
+ ),
3571
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3572
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3554
3573
  "button",
3555
3574
  {
3556
3575
  type: "button",
@@ -3559,10 +3578,10 @@ function TablePagination({
3559
3578
  "aria-label": "First page",
3560
3579
  "data-testid": testIdPrefix && `${testIdPrefix}-first`,
3561
3580
  className: stepBtn,
3562
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronFirst, { size: 16, "aria-hidden": "true" })
3581
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronFirst, { size: 16, "aria-hidden": "true" })
3563
3582
  }
3564
3583
  ),
3565
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3584
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3566
3585
  "button",
3567
3586
  {
3568
3587
  type: "button",
@@ -3571,11 +3590,11 @@ function TablePagination({
3571
3590
  "aria-label": "Previous page",
3572
3591
  "data-testid": testIdPrefix && `${testIdPrefix}-prev`,
3573
3592
  className: stepBtn,
3574
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronLeft, { size: 16, "aria-hidden": "true" })
3593
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronLeft, { size: 16, "aria-hidden": "true" })
3575
3594
  }
3576
3595
  ),
3577
3596
  pageWindow(current, totalPages).map(
3578
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3597
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3579
3598
  "button",
3580
3599
  {
3581
3600
  type: "button",
@@ -3586,14 +3605,14 @@ function TablePagination({
3586
3605
  className: cn(
3587
3606
  btn,
3588
3607
  off,
3589
- p === current ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3608
+ p === current ? "bg-subtle font-semibold text-text-primary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3590
3609
  ),
3591
3610
  children: p.toLocaleString()
3592
3611
  },
3593
3612
  p
3594
3613
  )
3595
3614
  ),
3596
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3615
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3597
3616
  "button",
3598
3617
  {
3599
3618
  type: "button",
@@ -3602,10 +3621,10 @@ function TablePagination({
3602
3621
  "aria-label": "Next page",
3603
3622
  "data-testid": testIdPrefix && `${testIdPrefix}-next`,
3604
3623
  className: stepBtn,
3605
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronRight, { size: 16, "aria-hidden": "true" })
3624
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronRight, { size: 16, "aria-hidden": "true" })
3606
3625
  }
3607
3626
  ),
3608
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3627
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3609
3628
  "button",
3610
3629
  {
3611
3630
  type: "button",
@@ -3614,18 +3633,18 @@ function TablePagination({
3614
3633
  "aria-label": "Last page",
3615
3634
  "data-testid": testIdPrefix && `${testIdPrefix}-last`,
3616
3635
  className: stepBtn,
3617
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronLast, { size: 16, "aria-hidden": "true" })
3636
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronLast, { size: 16, "aria-hidden": "true" })
3618
3637
  }
3619
3638
  )
3620
3639
  ] }),
3621
- onPerPageChange && range
3640
+ range
3622
3641
  ] });
3623
3642
  }
3624
3643
 
3625
3644
  // src/DateRangePicker.tsx
3626
3645
  var import_react16 = require("react");
3627
3646
  var import_lucide_react22 = require("lucide-react");
3628
- var import_jsx_runtime37 = require("react/jsx-runtime");
3647
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3629
3648
  var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
3630
3649
  var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
3631
3650
  var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
@@ -3661,7 +3680,7 @@ function spanLabel(label, today) {
3661
3680
  return `${fmtDate(s)} \u2013 ${fmtDate(e)}`;
3662
3681
  }
3663
3682
  function MiniSelect({ value, onChange, options }) {
3664
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3683
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3665
3684
  "select",
3666
3685
  {
3667
3686
  value: String(value),
@@ -3670,7 +3689,7 @@ function MiniSelect({ value, onChange, options }) {
3670
3689
  if (opt) onChange(opt.value);
3671
3690
  },
3672
3691
  className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-[12px] text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
3673
- children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3692
+ children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3674
3693
  }
3675
3694
  );
3676
3695
  }
@@ -3731,8 +3750,8 @@ function DateRangePicker({
3731
3750
  if (showFooter) setDraft(label);
3732
3751
  else commit(label);
3733
3752
  };
3734
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", ref, children: [
3735
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3753
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative", ref, children: [
3754
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3736
3755
  "button",
3737
3756
  {
3738
3757
  type: "button",
@@ -3741,16 +3760,16 @@ function DateRangePicker({
3741
3760
  "aria-haspopup": "listbox",
3742
3761
  className: chipTriggerClass(),
3743
3762
  children: [
3744
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3745
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel(value, end) }),
3746
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3763
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3764
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel(value, end) }),
3765
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3747
3766
  ] }),
3748
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
3767
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
3749
3768
  ]
3750
3769
  }
3751
3770
  ),
3752
- open && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("absolute top-[calc(100%+8px)] z-30 w-[280px] overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
3753
- presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3771
+ open && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("absolute top-[calc(100%+8px)] z-30 w-[280px] overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
3772
+ presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3754
3773
  "button",
3755
3774
  {
3756
3775
  type: "button",
@@ -3760,26 +3779,26 @@ function DateRangePicker({
3760
3779
  },
3761
3780
  p
3762
3781
  )),
3763
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
3764
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-[13px] font-semibold text-text-primary", children: "Custom range" }),
3765
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
3766
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3782
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
3783
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "text-[13px] font-semibold text-text-primary", children: "Custom range" }),
3784
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
3785
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3767
3786
  "From",
3768
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex gap-1", children: [
3769
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3770
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3771
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3787
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex gap-1", children: [
3788
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3789
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3790
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3772
3791
  ] })
3773
3792
  ] }),
3774
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3793
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3775
3794
  "To",
3776
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex gap-1", children: [
3777
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3778
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3779
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3795
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex gap-1", children: [
3796
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3797
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3798
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3780
3799
  ] })
3781
3800
  ] }),
3782
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3801
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3783
3802
  "button",
3784
3803
  {
3785
3804
  type: "button",
@@ -3791,7 +3810,7 @@ function DateRangePicker({
3791
3810
  )
3792
3811
  ] })
3793
3812
  ] }),
3794
- showFooter && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
3813
+ showFooter && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
3795
3814
  ] })
3796
3815
  ] });
3797
3816
  }
@@ -3799,7 +3818,7 @@ function DateRangePicker({
3799
3818
  // src/MultiSelectFilter.tsx
3800
3819
  var import_react17 = require("react");
3801
3820
  var import_lucide_react23 = require("lucide-react");
3802
- var import_jsx_runtime38 = require("react/jsx-runtime");
3821
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3803
3822
  function MultiSelectFilter({
3804
3823
  caption,
3805
3824
  options = [],
@@ -3819,7 +3838,10 @@ function MultiSelectFilter({
3819
3838
  clearValue = [],
3820
3839
  menuWidthClass = "w-60",
3821
3840
  plainParent = false,
3822
- fullWidth = false
3841
+ fullWidth = false,
3842
+ loading = false,
3843
+ error = false,
3844
+ onRetry
3823
3845
  }) {
3824
3846
  const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
3825
3847
  const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
@@ -3890,8 +3912,8 @@ function MultiSelectFilter({
3890
3912
  const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
3891
3913
  return kids.length ? { ...g, children: kids } : null;
3892
3914
  }).filter((g) => g !== null) : [];
3893
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, children: [
3894
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3915
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, children: [
3916
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3895
3917
  "button",
3896
3918
  {
3897
3919
  type: "button",
@@ -3899,8 +3921,8 @@ function MultiSelectFilter({
3899
3921
  "aria-expanded": open,
3900
3922
  className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
3901
3923
  children: [
3902
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChipContent, { caption, value, icon }),
3903
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3924
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChipContent, { caption, value, icon }),
3925
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3904
3926
  import_lucide_react23.ChevronDown,
3905
3927
  {
3906
3928
  size: 14,
@@ -3911,7 +3933,7 @@ function MultiSelectFilter({
3911
3933
  ]
3912
3934
  }
3913
3935
  ),
3914
- open && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3936
+ open && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3915
3937
  "div",
3916
3938
  {
3917
3939
  className: cn(
@@ -3921,10 +3943,10 @@ function MultiSelectFilter({
3921
3943
  ),
3922
3944
  role: "dialog",
3923
3945
  "aria-label": caption,
3924
- children: [
3925
- searchable && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
3926
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
3927
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3946
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
3947
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
3948
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
3949
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3928
3950
  "input",
3929
3951
  {
3930
3952
  type: "text",
@@ -3934,37 +3956,37 @@ function MultiSelectFilter({
3934
3956
  className: "h-full flex-1 bg-transparent text-[13px] outline-hidden placeholder:text-text-tertiary"
3935
3957
  }
3936
3958
  ),
3937
- q && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.X, { size: 13 }) })
3959
+ q && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.X, { size: 13 }) })
3938
3960
  ] }) }),
3939
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: [
3961
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: [
3940
3962
  groups ? visibleGroups.map((g) => {
3941
3963
  const state = groupState(g);
3942
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
3943
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3964
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
3965
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3944
3966
  "button",
3945
3967
  {
3946
3968
  type: "button",
3947
3969
  onClick: () => toggleGroup(g),
3948
3970
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
3949
3971
  children: [
3950
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TriCheck, { state }),
3951
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("flex-1 text-[14px] text-text-primary", !plainParent && "font-semibold"), children: g.label }),
3952
- counts && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionCount, { n: countFor(g.id) })
3972
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TriCheck, { state }),
3973
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("flex-1 text-[14px] text-text-primary", !plainParent && "font-semibold"), children: g.label }),
3974
+ counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(g.id) })
3953
3975
  ]
3954
3976
  }
3955
3977
  ),
3956
3978
  g.children.map((c) => {
3957
3979
  const checked = draft.includes(c.id);
3958
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3980
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3959
3981
  "button",
3960
3982
  {
3961
3983
  type: "button",
3962
3984
  onClick: () => toggle(c.id),
3963
3985
  className: "flex w-full items-center gap-2.5 rounded-control py-2 pl-9 pr-2 text-left transition-colors hover:bg-subtle",
3964
3986
  children: [
3965
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TriCheck, { state: checked ? "all" : "none" }),
3966
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: c.label }),
3967
- counts && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionCount, { n: countFor(c.id) })
3987
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TriCheck, { state: checked ? "all" : "none" }),
3988
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: c.label }),
3989
+ counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(c.id) })
3968
3990
  ]
3969
3991
  },
3970
3992
  c.id
@@ -3973,33 +3995,33 @@ function MultiSelectFilter({
3973
3995
  ] }, g.id);
3974
3996
  }) : items.map((o) => {
3975
3997
  const checked = draft.includes(o.id);
3976
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3998
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3977
3999
  "button",
3978
4000
  {
3979
4001
  type: "button",
3980
4002
  onClick: () => toggle(o.id),
3981
4003
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
3982
4004
  children: [
3983
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4005
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3984
4006
  "span",
3985
4007
  {
3986
4008
  className: cn(
3987
4009
  "flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",
3988
4010
  checked ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-input"
3989
4011
  ),
3990
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 })
4012
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 })
3991
4013
  }
3992
4014
  ),
3993
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: o.label }),
3994
- counts && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionCount, { n: countFor(o.id) })
4015
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: o.label }),
4016
+ counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(o.id) })
3995
4017
  ]
3996
4018
  },
3997
4019
  o.id
3998
4020
  );
3999
4021
  }),
4000
- (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "py-6 text-center text-[13px] text-text-tertiary", children: "No matches." })
4022
+ (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "py-6 text-center text-[13px] text-text-tertiary", children: "No matches." })
4001
4023
  ] }),
4002
- showFooter ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FilterDropdownFooter, { onClear: () => setDraft(clearValue), onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
4024
+ showFooter ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FilterDropdownFooter, { onClear: () => setDraft(clearValue), onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4003
4025
  "button",
4004
4026
  {
4005
4027
  type: "button",
@@ -4011,14 +4033,14 @@ function MultiSelectFilter({
4011
4033
  ]
4012
4034
  }
4013
4035
  ) })
4014
- ]
4036
+ ] })
4015
4037
  }
4016
4038
  )
4017
4039
  ] });
4018
4040
  }
4019
4041
  function TriCheck({ state }) {
4020
4042
  const filled = state !== "none";
4021
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
4043
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4022
4044
  "span",
4023
4045
  {
4024
4046
  className: cn(
@@ -4026,14 +4048,14 @@ function TriCheck({ state }) {
4026
4048
  filled ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-input"
4027
4049
  ),
4028
4050
  children: [
4029
- state === "all" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 }),
4030
- state === "some" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Minus, { size: 13, strokeWidth: 3 })
4051
+ state === "all" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 }),
4052
+ state === "some" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Minus, { size: 13, strokeWidth: 3 })
4031
4053
  ]
4032
4054
  }
4033
4055
  );
4034
4056
  }
4035
4057
  function OptionCount({ n }) {
4036
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "shrink-0 text-[12px] tabular-nums text-text-tertiary", children: [
4058
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "shrink-0 text-[12px] tabular-nums text-text-tertiary", children: [
4037
4059
  "(",
4038
4060
  n.toLocaleString(),
4039
4061
  ")"
@@ -4041,7 +4063,7 @@ function OptionCount({ n }) {
4041
4063
  }
4042
4064
 
4043
4065
  // src/Toggle.tsx
4044
- var import_jsx_runtime39 = require("react/jsx-runtime");
4066
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4045
4067
  var SIZES2 = {
4046
4068
  sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-[18px]" },
4047
4069
  md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-[22px]" }
@@ -4049,7 +4071,7 @@ var SIZES2 = {
4049
4071
  var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
4050
4072
  function Toggle({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }) {
4051
4073
  const s = SIZES2[size];
4052
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4074
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4053
4075
  "button",
4054
4076
  {
4055
4077
  type: "button",
@@ -4067,7 +4089,7 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
4067
4089
  disabled && "cursor-not-allowed opacity-50",
4068
4090
  className
4069
4091
  ),
4070
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4092
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4071
4093
  "span",
4072
4094
  {
4073
4095
  className: cn(
@@ -4084,20 +4106,20 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
4084
4106
  // src/AISpark.tsx
4085
4107
  var import_react18 = require("react");
4086
4108
  var import_lucide_react24 = require("lucide-react");
4087
- var import_jsx_runtime40 = require("react/jsx-runtime");
4109
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4088
4110
  function AISpark({ size = 16, className }) {
4089
4111
  const id = (0, import_react18.useId)();
4090
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
4091
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4092
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4093
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { offset: "100%", className: "[stop-color:#9474ff] in-data-[theme=dark]:[stop-color:#a488ff]" })
4112
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
4113
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4114
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4115
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "100%", className: "[stop-color:#9474ff] in-data-[theme=dark]:[stop-color:#a488ff]" })
4094
4116
  ] }) }) }),
4095
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react24.Sparkles, { size, stroke: `url(#${id})`, className, "aria-hidden": "true" })
4117
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.Sparkles, { size, stroke: `url(#${id})`, className, "aria-hidden": "true" })
4096
4118
  ] });
4097
4119
  }
4098
4120
 
4099
4121
  // src/Freshness.tsx
4100
- var import_jsx_runtime41 = require("react/jsx-runtime");
4122
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4101
4123
  var dotColor = {
4102
4124
  fresh: "bg-status-success",
4103
4125
  recent: "bg-status-warning",
@@ -4109,7 +4131,7 @@ var srLabel = {
4109
4131
  stale: "Older than a day"
4110
4132
  };
4111
4133
  function Freshness({ level }) {
4112
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4134
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4113
4135
  "span",
4114
4136
  {
4115
4137
  className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level]),
@@ -4120,39 +4142,39 @@ function Freshness({ level }) {
4120
4142
  }
4121
4143
 
4122
4144
  // src/SectionHeading.tsx
4123
- var import_jsx_runtime42 = require("react/jsx-runtime");
4145
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4124
4146
  function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className }) {
4125
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), children: [
4126
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "min-w-0", children: [
4127
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
4128
- description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
4147
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), children: [
4148
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
4149
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
4150
+ description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
4129
4151
  ] }),
4130
- actions && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4152
+ actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4131
4153
  ] });
4132
4154
  }
4133
4155
 
4134
4156
  // src/PageHeader.tsx
4135
4157
  var import_lucide_react25 = require("lucide-react");
4136
- var import_jsx_runtime43 = require("react/jsx-runtime");
4158
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4137
4159
  function PageHeader({ title, description, actions, back, className }) {
4138
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4139
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
4140
- back && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4160
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4161
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0", children: [
4162
+ back && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4141
4163
  "a",
4142
4164
  {
4143
4165
  href: back.href ?? "#",
4144
4166
  onClick: back.onClick,
4145
4167
  className: "mb-1.5 inline-flex items-center gap-1.5 rounded-control text-micro font-semibold uppercase tracking-wider text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4146
4168
  children: [
4147
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4169
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4148
4170
  back.label
4149
4171
  ]
4150
4172
  }
4151
4173
  ),
4152
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4153
- description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4174
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4175
+ description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4154
4176
  ] }),
4155
- actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4177
+ actions && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4156
4178
  ] });
4157
4179
  }
4158
4180
 
@@ -4160,7 +4182,7 @@ function PageHeader({ title, description, actions, back, className }) {
4160
4182
  var import_react19 = require("react");
4161
4183
  var import_react_dom7 = require("react-dom");
4162
4184
  var import_lucide_react26 = require("lucide-react");
4163
- var import_jsx_runtime44 = require("react/jsx-runtime");
4185
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4164
4186
  var WIDTH = {
4165
4187
  sm: "max-w-110",
4166
4188
  md: "max-w-160",
@@ -4210,12 +4232,12 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4210
4232
  }, [open]);
4211
4233
  if (!open || typeof document === "undefined") return null;
4212
4234
  return (0, import_react_dom7.createPortal)(
4213
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4235
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4214
4236
  "div",
4215
4237
  {
4216
4238
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4 py-6",
4217
4239
  onMouseDown: (e) => e.target === e.currentTarget && onClose(),
4218
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4240
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4219
4241
  "div",
4220
4242
  {
4221
4243
  ref: panel,
@@ -4230,24 +4252,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4230
4252
  className
4231
4253
  ),
4232
4254
  children: [
4233
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4234
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0 flex-1", children: [
4235
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4236
- description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4255
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4256
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "min-w-0 flex-1", children: [
4257
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4258
+ description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4237
4259
  ] }),
4238
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4260
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4239
4261
  "button",
4240
4262
  {
4241
4263
  type: "button",
4242
4264
  onClick: onClose,
4243
4265
  "aria-label": "Close",
4244
4266
  className: "-mr-1.5 -mt-1 flex size-8 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4245
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4267
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4246
4268
  }
4247
4269
  )
4248
4270
  ] }),
4249
- children && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
4250
- footer && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
4271
+ children && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
4272
+ footer && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
4251
4273
  ]
4252
4274
  }
4253
4275
  )
@@ -4258,10 +4280,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4258
4280
  }
4259
4281
 
4260
4282
  // src/EmptyState.tsx
4261
- var import_jsx_runtime45 = require("react/jsx-runtime");
4283
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4262
4284
  function EmptyState({ icon, title, description, action, size = "sm", className }) {
4263
4285
  const md = size === "md";
4264
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4286
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4265
4287
  "div",
4266
4288
  {
4267
4289
  className: cn(
@@ -4270,7 +4292,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4270
4292
  className
4271
4293
  ),
4272
4294
  children: [
4273
- icon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4295
+ icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4274
4296
  "span",
4275
4297
  {
4276
4298
  "aria-hidden": "true",
@@ -4281,9 +4303,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4281
4303
  children: icon
4282
4304
  }
4283
4305
  ),
4284
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4285
- description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4286
- action && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4306
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4307
+ description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4308
+ action && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4287
4309
  ]
4288
4310
  }
4289
4311
  );
@@ -4291,7 +4313,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4291
4313
 
4292
4314
  // src/Tabs.tsx
4293
4315
  var import_react20 = require("react");
4294
- var import_jsx_runtime46 = require("react/jsx-runtime");
4316
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4295
4317
  function arrowKeys(e, row) {
4296
4318
  if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
4297
4319
  const items = Array.from(row.querySelectorAll("button:not([disabled])"));
@@ -4303,7 +4325,7 @@ function arrowKeys(e, row) {
4303
4325
  }
4304
4326
  function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest }) {
4305
4327
  const row = (0, import_react20.useRef)(null);
4306
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4328
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4307
4329
  "div",
4308
4330
  {
4309
4331
  ref: row,
@@ -4313,7 +4335,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest })
4313
4335
  className: cn("flex gap-6 border-b border-border-default", className),
4314
4336
  children: items.map((item) => {
4315
4337
  const on = item.value === value;
4316
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4338
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4317
4339
  "button",
4318
4340
  {
4319
4341
  type: "button",
@@ -4325,12 +4347,12 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest })
4325
4347
  disabled: item.disabled,
4326
4348
  onClick: () => onChange(item.value),
4327
4349
  className: cn(
4328
- "-mb-px flex items-center gap-1.5 rounded-control border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:opacity-50",
4350
+ "-mb-px flex items-center gap-1.5 border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:opacity-50",
4329
4351
  on ? "border-brand-primaryAction font-semibold text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"
4330
4352
  ),
4331
4353
  children: [
4332
4354
  item.label,
4333
- item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
4355
+ item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
4334
4356
  ]
4335
4357
  },
4336
4358
  item.value
@@ -4348,7 +4370,7 @@ function SegmentedControl({
4348
4370
  ...rest
4349
4371
  }) {
4350
4372
  const row = (0, import_react20.useRef)(null);
4351
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4373
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4352
4374
  "div",
4353
4375
  {
4354
4376
  ref: row,
@@ -4358,7 +4380,7 @@ function SegmentedControl({
4358
4380
  className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
4359
4381
  children: options.map((o) => {
4360
4382
  const on = o.value === value;
4361
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4383
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4362
4384
  "button",
4363
4385
  {
4364
4386
  type: "button",
@@ -4382,7 +4404,7 @@ function SegmentedControl({
4382
4404
 
4383
4405
  // src/TextField.tsx
4384
4406
  var import_react21 = require("react");
4385
- var import_jsx_runtime47 = require("react/jsx-runtime");
4407
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4386
4408
  var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
4387
4409
  var TextField = (0, import_react21.forwardRef)(
4388
4410
  ({ label, hint, error, size = "md", icon, className, id, disabled, ...props }, ref) => {
@@ -4390,9 +4412,9 @@ var TextField = (0, import_react21.forwardRef)(
4390
4412
  const fieldId = id ?? auto;
4391
4413
  const noteId = `${fieldId}-note`;
4392
4414
  const note = error ?? hint;
4393
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), children: [
4394
- label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
4395
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4415
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), children: [
4416
+ label && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
4417
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
4396
4418
  "div",
4397
4419
  {
4398
4420
  className: cn(
@@ -4402,8 +4424,8 @@ var TextField = (0, import_react21.forwardRef)(
4402
4424
  disabled && "opacity-50"
4403
4425
  ),
4404
4426
  children: [
4405
- icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
4406
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4427
+ icon && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
4428
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4407
4429
  "input",
4408
4430
  {
4409
4431
  ref,
@@ -4418,7 +4440,7 @@ var TextField = (0, import_react21.forwardRef)(
4418
4440
  ]
4419
4441
  }
4420
4442
  ),
4421
- note && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
4443
+ note && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
4422
4444
  ] });
4423
4445
  }
4424
4446
  );
@@ -4426,7 +4448,7 @@ TextField.displayName = "TextField";
4426
4448
 
4427
4449
  // src/DataTable.tsx
4428
4450
  var import_react22 = require("react");
4429
- var import_jsx_runtime48 = require("react/jsx-runtime");
4451
+ var import_jsx_runtime49 = require("react/jsx-runtime");
4430
4452
  var WIDTH2 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
4431
4453
  var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
4432
4454
  var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
@@ -4458,15 +4480,15 @@ function DataTable({
4458
4480
  const col = columns.find((c) => c.key === key);
4459
4481
  onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
4460
4482
  };
4461
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className), children: [
4462
- title && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
4463
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "min-w-0", children: [
4464
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
4465
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
4483
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className), children: [
4484
+ title && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
4485
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
4486
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
4487
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
4466
4488
  ] }),
4467
- action && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "shrink-0", children: action })
4489
+ action && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "shrink-0", children: action })
4468
4490
  ] }),
4469
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
4491
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
4470
4492
  "table",
4471
4493
  {
4472
4494
  "aria-labelledby": title ? titleId : void 0,
@@ -4474,13 +4496,13 @@ function DataTable({
4474
4496
  "aria-busy": loading || void 0,
4475
4497
  className: "w-full border-collapse text-left",
4476
4498
  children: [
4477
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4499
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4478
4500
  "th",
4479
4501
  {
4480
4502
  scope: "col",
4481
4503
  "aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
4482
4504
  className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
4483
- children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4505
+ children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4484
4506
  SortButton,
4485
4507
  {
4486
4508
  label: c.label,
@@ -4493,7 +4515,7 @@ function DataTable({
4493
4515
  },
4494
4516
  c.key
4495
4517
  )) }) }),
4496
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4518
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4497
4519
  "span",
4498
4520
  {
4499
4521
  className: cn(
@@ -4501,7 +4523,7 @@ function DataTable({
4501
4523
  c.numeric ? "w-12" : "w-2/3"
4502
4524
  )
4503
4525
  }
4504
- ) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { colSpan: columns.length, children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4526
+ ) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4505
4527
  "td",
4506
4528
  {
4507
4529
  className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
@@ -4512,9 +4534,164 @@ function DataTable({
4512
4534
  ]
4513
4535
  }
4514
4536
  ) }),
4515
- footer && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
4537
+ footer && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
4516
4538
  ] });
4517
4539
  }
4540
+
4541
+ // src/MediaLabel.tsx
4542
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4543
+ var FILL = {
4544
+ TV: "bg-media-tv",
4545
+ CTV: "bg-media-ctv",
4546
+ Digital: "bg-media-digital",
4547
+ Social: "bg-media-social",
4548
+ Radio: "bg-media-radio",
4549
+ Newspaper: "bg-media-newspaper",
4550
+ Magazine: "bg-media-magazine"
4551
+ };
4552
+ function MediaLabel({ type, className }) {
4553
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4554
+ "span",
4555
+ {
4556
+ className: cn(
4557
+ "inline-flex items-center whitespace-nowrap rounded-sm px-1.5 py-0.5 text-micro font-semibold text-status-onstatus",
4558
+ FILL[type] ?? "bg-media-other",
4559
+ className
4560
+ ),
4561
+ children: type
4562
+ }
4563
+ );
4564
+ }
4565
+
4566
+ // src/SuggestionChip.tsx
4567
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4568
+ function SuggestionChip({ children, className, type = "button", ...props }) {
4569
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4570
+ "button",
4571
+ {
4572
+ type,
4573
+ ...props,
4574
+ className: cn(
4575
+ "inline-flex h-8 max-w-full items-center rounded-full border border-border-default bg-surface px-3 text-sm text-text-primary transition-colors duration-(--mr-motion-duration-interactive) ease-interactive hover:border-border-strong hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4576
+ className
4577
+ ),
4578
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children })
4579
+ }
4580
+ );
4581
+ }
4582
+
4583
+ // src/ToggleChip.tsx
4584
+ var import_lucide_react27 = require("lucide-react");
4585
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4586
+ function ToggleChip({ selected, onChange, children, className, type = "button", onClick, ...props }) {
4587
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
4588
+ "button",
4589
+ {
4590
+ type,
4591
+ "aria-pressed": selected,
4592
+ ...props,
4593
+ onClick: (e) => {
4594
+ onClick?.(e);
4595
+ if (!e.defaultPrevented) onChange(!selected);
4596
+ },
4597
+ className: cn(
4598
+ "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 text-sm transition-colors duration-(--mr-motion-duration-interactive) ease-interactive focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4599
+ selected ? "border-brand-primaryAction bg-brand-primaryAction/15 font-medium text-brand-primaryAction" : "border-border-default bg-surface text-text-primary hover:border-border-strong hover:bg-subtle",
4600
+ className
4601
+ ),
4602
+ children: [
4603
+ selected && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react27.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
4604
+ children
4605
+ ]
4606
+ }
4607
+ );
4608
+ }
4609
+
4610
+ // src/CopyButton.tsx
4611
+ var import_react23 = require("react");
4612
+ var import_lucide_react28 = require("lucide-react");
4613
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4614
+ var CONFIRM_MS = 2e3;
4615
+ function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", className }) {
4616
+ const [copied, setCopied] = (0, import_react23.useState)(false);
4617
+ const timer = (0, import_react23.useRef)(void 0);
4618
+ (0, import_react23.useEffect)(() => () => clearTimeout(timer.current), []);
4619
+ const copy = async () => {
4620
+ try {
4621
+ await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
4622
+ } catch {
4623
+ return;
4624
+ }
4625
+ setCopied(true);
4626
+ clearTimeout(timer.current);
4627
+ timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
4628
+ };
4629
+ const iconSize = size === "xs" ? 13 : 15;
4630
+ const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
4631
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
4632
+ Button,
4633
+ {
4634
+ type: "button",
4635
+ variant: "ghost",
4636
+ size,
4637
+ iconOnly: !label,
4638
+ "aria-label": label ? void 0 : ariaLabel,
4639
+ onClick: copy,
4640
+ className: cn(!copied && "text-text-secondary", className),
4641
+ children: [
4642
+ icon,
4643
+ label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: copied ? "Copied" : label }),
4644
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
4645
+ ]
4646
+ }
4647
+ );
4648
+ }
4649
+
4650
+ // src/InlineMessage.tsx
4651
+ var import_lucide_react29 = require("lucide-react");
4652
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4653
+ var BOX = {
4654
+ info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
4655
+ success: "border-status-success/40 bg-status-success/10",
4656
+ // Heavier tint for the same reason as Badge: the amber sits close to the warm canvas.
4657
+ warning: "border-status-warning/50 bg-status-warning/15",
4658
+ danger: "border-status-danger/40 bg-status-danger/10"
4659
+ };
4660
+ var ICON_INK = {
4661
+ info: "text-brand-primaryAction",
4662
+ success: "text-text-success",
4663
+ warning: "text-text-warning",
4664
+ danger: "text-text-danger"
4665
+ };
4666
+ var ICON2 = { info: import_lucide_react29.Info, success: import_lucide_react29.CheckCircle2, warning: import_lucide_react29.AlertTriangle, danger: import_lucide_react29.XCircle };
4667
+ function InlineMessage({ tone = "info", title, children, actions, onDismiss, className }) {
4668
+ const Icon = ICON2[tone];
4669
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
4670
+ "div",
4671
+ {
4672
+ role: tone === "warning" || tone === "danger" ? "alert" : "status",
4673
+ className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
4674
+ children: [
4675
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
4676
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
4677
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
4678
+ children && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
4679
+ actions && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
4680
+ ] }),
4681
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4682
+ "button",
4683
+ {
4684
+ type: "button",
4685
+ onClick: onDismiss,
4686
+ "aria-label": "Dismiss",
4687
+ className: "-mr-1 -mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-border-focus",
4688
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.X, { size: 14, "aria-hidden": "true" })
4689
+ }
4690
+ )
4691
+ ]
4692
+ }
4693
+ );
4694
+ }
4518
4695
  // Annotate the CommonJS export names for ESM import in node:
4519
4696
  0 && (module.exports = {
4520
4697
  AISpark,
@@ -4528,6 +4705,7 @@ function DataTable({
4528
4705
  CheckBox,
4529
4706
  CheckBoxBox,
4530
4707
  ChipContent,
4708
+ CopyButton,
4531
4709
  DEFAULT_SEARCH_MATCH,
4532
4710
  DataScopeFilter,
4533
4711
  DataTable,
@@ -4539,7 +4717,9 @@ function DataTable({
4539
4717
  FilterDropdownFooter,
4540
4718
  Freshness,
4541
4719
  InfoTip,
4720
+ InlineMessage,
4542
4721
  LineChartPlaceholder,
4722
+ MediaLabel,
4543
4723
  Modal,
4544
4724
  MultiSelectFilter,
4545
4725
  NO_RESULTS_BODY,
@@ -4562,12 +4742,14 @@ function DataTable({
4562
4742
  SelectionPicker,
4563
4743
  SortButton,
4564
4744
  StackedColumnPlaceholder,
4745
+ SuggestionChip,
4565
4746
  TablePagination,
4566
4747
  Tabs,
4567
4748
  Tag,
4568
4749
  TextField,
4569
4750
  Toast,
4570
4751
  Toggle,
4752
+ ToggleChip,
4571
4753
  Tooltip,
4572
4754
  WorkspaceAvatar,
4573
4755
  WorkspaceSelectedCard,