@ammarkhalidfarooq/dashboard-package 0.6.92 → 0.6.94

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.js CHANGED
@@ -1535,7 +1535,7 @@ var getActiveFilterChips = function getActiveFilterChips(apiData) {
1535
1535
  return s.trim();
1536
1536
  }).filter(Boolean);
1537
1537
  }
1538
- return ["Status: Successful", "Country: United States, UAE", "Amount: $50 – $5,000"];
1538
+ return [];
1539
1539
  };
1540
1540
  var buildReportData = function buildReportData() {
1541
1541
  var _apiData$overviewStat2, _overview$totalRevenu, _overview$netRevenue, _overview$totalDonati, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _overview$overallAVGD2, _growth$overallAVGDon, _growth$totalRevenue, _growth$netRevenue, _growth$totalDonation, _growth$overallAVGDon2, _apiData$roasCard, _apiData$roasCardPrev, _apiData$adSpend, _apiData$attributedRe, _growth$conversionRat, _apiData$overviewStat3, _growth$totalRevenue2;
@@ -1545,13 +1545,13 @@ var buildReportData = function buildReportData() {
1545
1545
  var refundsRaw = (apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || {};
1546
1546
  var refunds = parseRefundsChargebacks(refundsRaw);
1547
1547
  var avgDonationDetail = parseAvgDonationDetail(apiData);
1548
- var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 240938);
1549
- var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 222300);
1550
- var totalDonors = Number((_overview$totalDonati = overview === null || overview === void 0 ? void 0 : overview.totalDonations) !== null && _overview$totalDonati !== void 0 ? _overview$totalDonati : 215);
1551
- var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 130.58);
1552
- var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 1.7);
1553
- var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
1554
- var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
1548
+ var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 0);
1549
+ var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 0);
1550
+ var totalDonors = Number((_overview$totalDonati = overview === null || overview === void 0 ? void 0 : overview.totalDonations) !== null && _overview$totalDonati !== void 0 ? _overview$totalDonati : 0);
1551
+ var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 0);
1552
+ var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 0);
1553
+ var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 0);
1554
+ var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "0% pass-through";
1555
1555
  var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
1556
1556
  var newDonors = 0;
1557
1557
  var returningDonors = 0;
@@ -1575,18 +1575,18 @@ var buildReportData = function buildReportData() {
1575
1575
  var retPct = totalMix > 0 ? 100 - newPct : 0;
1576
1576
  var hero = {
1577
1577
  value: "$".concat(formatNumber(totalRaised)),
1578
- trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 18), " vs pp"),
1578
+ trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 0), " vs pp"),
1579
1579
  detail: "".concat(passThrough, " - ").concat(formatNumber(totalDonors), " donors - $").concat(formatNumber(Number(avgDonation).toFixed(2)), " avg - ").concat(formatNumber(totalVisits), " visits")
1580
1580
  };
1581
1581
  var metrics = [{
1582
1582
  title: "Net Raised",
1583
1583
  value: "$".concat(formatNumber(netRaised)),
1584
- trend: formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 17.4),
1584
+ trend: formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 0),
1585
1585
  detail: passThrough
1586
1586
  }, {
1587
1587
  title: "Total Donors",
1588
1588
  value: formatNumber(totalDonors),
1589
- trend: formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 16.8),
1589
+ trend: formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 0),
1590
1590
  detail: "".concat(formatNumber(newDonors), " new - ").concat(formatNumber(returningDonors), " returning")
1591
1591
  }, {
1592
1592
  title: "Avg Donation",
@@ -1601,7 +1601,7 @@ var buildReportData = function buildReportData() {
1601
1601
  }, {
1602
1602
  title: "Conversion",
1603
1603
  value: "".concat(formatNumber(convRate), "%"),
1604
- trend: formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0.21, "pp"),
1604
+ trend: formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0, "pp"),
1605
1605
  detail: "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
1606
1606
  }, {
1607
1607
  title: "Refund Rate",
@@ -1616,7 +1616,7 @@ var buildReportData = function buildReportData() {
1616
1616
  label: "Total revenue trend",
1617
1617
  subtitle: "Last 30 days - daily aggregation",
1618
1618
  value: "$".concat(formatNumber(totalRaised)),
1619
- trend: "".concat(formatTrend((_growth$totalRevenue2 = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue2 !== void 0 ? _growth$totalRevenue2 : 18), " vs pp"),
1619
+ trend: "".concat(formatTrend((_growth$totalRevenue2 = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue2 !== void 0 ? _growth$totalRevenue2 : 0), " vs pp"),
1620
1620
  hideControls: true,
1621
1621
  stacked: true,
1622
1622
  colors: ["#6366F1", "#10B981", "#06B6D4"],
@@ -1649,60 +1649,21 @@ var buildReportData = function buildReportData() {
1649
1649
  categories: categories
1650
1650
  });
1651
1651
  } else {
1652
- var _categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || ["Apr 5", "Apr 11", "Apr 17", "Apr 23", "Apr 29", "May 4"];
1653
- var base = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [3000, 4500, 5200, 5800, 6200, 7100, 8500, 9200, 9500];
1654
1652
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
1655
1653
  series: [{
1656
1654
  name: "Paid Ads",
1657
- data: base.map(function (v) {
1658
- return v * 0.55;
1659
- })
1655
+ data: []
1660
1656
  }, {
1661
1657
  name: "Organic",
1662
- data: base.map(function (v) {
1663
- return v * 0.28;
1664
- })
1658
+ data: []
1665
1659
  }, {
1666
1660
  name: "Email",
1667
- data: base.map(function (v) {
1668
- return v * 0.17;
1669
- })
1661
+ data: []
1670
1662
  }],
1671
- categories: _categories
1663
+ categories: (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || []
1672
1664
  });
1673
1665
  }
1674
- var sampleCampaigns = [{
1675
- title: "Orphan sponsorship — Yemen",
1676
- collectedAmount: 78400,
1677
- usdTargetAmount: 100000,
1678
- uniqueDonationsCount: 82,
1679
- status: "Active"
1680
- }, {
1681
- title: "Emergency food — Gaza",
1682
- collectedAmount: 62100,
1683
- usdTargetAmount: 75000,
1684
- uniqueDonationsCount: 61,
1685
- status: "Active"
1686
- }, {
1687
- title: "Masjid build — Somalia",
1688
- collectedAmount: 38200,
1689
- usdTargetAmount: 83000,
1690
- uniqueDonationsCount: 34,
1691
- status: "Slow"
1692
- }, {
1693
- title: "Water wells — Pakistan",
1694
- collectedAmount: 29800,
1695
- usdTargetAmount: 30000,
1696
- uniqueDonationsCount: 28,
1697
- status: "Closing"
1698
- }, {
1699
- title: "Ramadan packs — Egypt",
1700
- collectedAmount: 18400,
1701
- usdTargetAmount: 23500,
1702
- uniqueDonationsCount: 10,
1703
- status: "Active"
1704
- }];
1705
- var campaignSource = ((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : sampleCampaigns;
1666
+ var campaignSource = (apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || [];
1706
1667
  var activeCampaigns = campaignSource.map(function (campaign) {
1707
1668
  return {
1708
1669
  id: campaign.campaignName ? campaign.campaignName.split(" ").filter(Boolean).map(function (w) {
@@ -1749,18 +1710,19 @@ var W = 794;
1749
1710
  var MIN_H = 1123;
1750
1711
  var MX = 32; // horizontal margin
1751
1712
  var THEME = {
1752
- pageBg: "#F8FAFC",
1713
+ pageBg: "#F9FAFB",
1753
1714
  panelBg: "#FFFFFF",
1754
- panelBorder: "#DDE3EA",
1755
- kpiBgPrimary: "#EEF2FF",
1715
+ panelBorder: "#E5E7EB",
1716
+ brand: "#6366F1",
1756
1717
  kpiBorderPrimary: "#C7D2FE",
1757
- kpiBgSecondary: "#F8FAFF",
1758
- kpiBorderSecondary: "#DDE3EA",
1759
1718
  tableHeadBg: "#EEF2FF",
1760
1719
  tableAltBg: "#F8FAFF",
1761
- muted: "#94A3B8",
1762
- text: "#111827"
1720
+ muted: "#9CA3AF",
1721
+ text: "#111827",
1722
+ trendUpBg: "#D1FAE5",
1723
+ trendUpText: "#059669"
1763
1724
  };
1725
+ var BULLET = " · ";
1764
1726
 
1765
1727
  // ─── Number helpers ───────────────────────────────────────────────────────────
1766
1728
  var d$ = function d$(v) {
@@ -1773,7 +1735,7 @@ var kpiPct = function kpiPct(v) {
1773
1735
  return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "%");
1774
1736
  };
1775
1737
  var kpiRoas = function kpiRoas(v) {
1776
- return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "\xD7");
1738
+ return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(1), "\xD7");
1777
1739
  };
1778
1740
  var d$Compact = function d$Compact(v) {
1779
1741
  var n = Number(v !== null && v !== void 0 ? v : 0);
@@ -1785,11 +1747,6 @@ var pct = function pct(v) {
1785
1747
  var dp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
1786
1748
  return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(dp), "%");
1787
1749
  };
1788
- var signed = function signed(v) {
1789
- var suffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "%";
1790
- var n = Number(v !== null && v !== void 0 ? v : 0);
1791
- return "".concat(n >= 0 ? "+" : "").concat(n.toFixed(2)).concat(suffix);
1792
- };
1793
1750
  var TREND_UP = "#0B8F61";
1794
1751
  var TREND_DOWN = "#ef4444";
1795
1752
  var resolveTrendColor = function resolveTrendColor(trendText) {
@@ -2597,70 +2554,302 @@ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref10) {
2597
2554
  })
2598
2555
  });
2599
2556
  };
2600
- var KpiCard = function KpiCard(_ref11) {
2601
- var title = _ref11.title,
2602
- value = _ref11.value,
2603
- trend = _ref11.trend,
2604
- detail = _ref11.detail,
2605
- _ref11$variant = _ref11.variant,
2606
- variant = _ref11$variant === void 0 ? "secondary" : _ref11$variant,
2607
- _ref11$trendPositiveW = _ref11.trendPositiveWhenNegative,
2608
- trendPositiveWhenNegative = _ref11$trendPositiveW === void 0 ? false : _ref11$trendPositiveW;
2609
- var displayTrend = withTrendArrow(trend);
2610
- var isPrimary = variant === "primary";
2557
+ var TrendPill$1 = function TrendPill(_ref12) {
2558
+ var children = _ref12.children,
2559
+ _ref12$positive = _ref12.positive,
2560
+ positive = _ref12$positive === void 0 ? true : _ref12$positive;
2561
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
2562
+ style: {
2563
+ display: "inline-flex",
2564
+ alignItems: "center",
2565
+ background: positive ? THEME.trendUpBg : "#FEE2E2",
2566
+ color: positive ? THEME.trendUpText : "#DC2626",
2567
+ padding: "3px 10px",
2568
+ borderRadius: 100,
2569
+ fontSize: 9,
2570
+ fontWeight: 600,
2571
+ whiteSpace: "nowrap",
2572
+ lineHeight: 1.35
2573
+ },
2574
+ children: children
2575
+ });
2576
+ };
2577
+ var isTrendPositive = function isTrendPositive(trendText) {
2578
+ var invert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2579
+ var n = Number(String(trendText !== null && trendText !== void 0 ? trendText : "").replace(/[^0-9.\-+]/g, ""));
2580
+ if (Number.isNaN(n)) return true;
2581
+ return invert ? n <= 0 : n >= 0;
2582
+ };
2583
+ var PageOneHeader = function PageOneHeader(_ref13) {
2584
+ var dateLabel = _ref13.dateLabel,
2585
+ generatedLabel = _ref13.generatedLabel,
2586
+ windowLabel = _ref13.windowLabel;
2587
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
2588
+ style: {
2589
+ padding: "36px ".concat(MX, "px 0"),
2590
+ flexShrink: 0
2591
+ },
2592
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
2593
+ style: {
2594
+ display: "flex",
2595
+ justifyContent: "space-between",
2596
+ alignItems: "flex-start"
2597
+ },
2598
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2599
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2600
+ style: {
2601
+ fontSize: 22,
2602
+ fontWeight: 700,
2603
+ color: THEME.brand,
2604
+ letterSpacing: "-0.3px",
2605
+ lineHeight: 1.1
2606
+ },
2607
+ children: "Madinah"
2608
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
2609
+ style: {
2610
+ fontSize: 9,
2611
+ fontWeight: 600,
2612
+ letterSpacing: "1.2px",
2613
+ color: THEME.muted,
2614
+ textTransform: "uppercase",
2615
+ marginTop: 3
2616
+ },
2617
+ children: "Performance Report"
2618
+ })]
2619
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2620
+ style: {
2621
+ textAlign: "right"
2622
+ },
2623
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2624
+ style: {
2625
+ fontSize: 11,
2626
+ color: "#6B7280",
2627
+ lineHeight: 1.2
2628
+ },
2629
+ children: "Dashboard overview \u2014 Overall"
2630
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
2631
+ style: {
2632
+ fontSize: 18,
2633
+ fontWeight: 700,
2634
+ color: THEME.text,
2635
+ marginTop: 4,
2636
+ lineHeight: 1.15
2637
+ },
2638
+ children: dateLabel
2639
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2640
+ style: {
2641
+ fontSize: 9,
2642
+ color: THEME.muted,
2643
+ marginTop: 3,
2644
+ lineHeight: 1.35
2645
+ },
2646
+ children: [windowLabel, BULLET, "Generated ", generatedLabel]
2647
+ })]
2648
+ })]
2649
+ })
2650
+ });
2651
+ };
2652
+ var ActiveFiltersBar = function ActiveFiltersBar(_ref14) {
2653
+ var _ref14$pills = _ref14.pills,
2654
+ pills = _ref14$pills === void 0 ? [] : _ref14$pills;
2655
+ if (!pills.length) return null;
2611
2656
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
2612
2657
  style: {
2613
- border: "1px solid ".concat(isPrimary ? THEME.kpiBorderPrimary : THEME.kpiBorderSecondary),
2614
- borderRadius: 8,
2615
- padding: "10px 12px 9px",
2616
- background: isPrimary ? THEME.kpiBgPrimary : THEME.kpiBgSecondary,
2617
- width: "100%",
2618
- minWidth: 0,
2619
- boxSizing: "border-box",
2620
2658
  display: "flex",
2621
- flexDirection: "column",
2622
- gap: 2
2659
+ alignItems: "center",
2660
+ flexWrap: "wrap",
2661
+ gap: 8,
2662
+ background: "#EEF2FF",
2663
+ borderRadius: 10,
2664
+ padding: "10px 14px",
2665
+ marginTop: 18
2623
2666
  },
2624
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2667
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
2625
2668
  style: {
2626
2669
  fontSize: 8,
2627
2670
  fontWeight: 700,
2628
- letterSpacing: "0.7px",
2629
- color: "#64748B"
2671
+ letterSpacing: "0.8px",
2672
+ color: THEME.muted,
2673
+ textTransform: "uppercase",
2674
+ flexShrink: 0
2630
2675
  },
2631
- children: title
2676
+ children: "Active Filters"
2677
+ }), pills.map(function (pill, i) {
2678
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
2679
+ style: {
2680
+ display: "inline-flex",
2681
+ alignItems: "center",
2682
+ background: "#FFFFFF",
2683
+ border: "1px solid ".concat(THEME.kpiBorderPrimary),
2684
+ borderRadius: 100,
2685
+ padding: "4px 11px",
2686
+ fontSize: 9,
2687
+ fontWeight: 500,
2688
+ color: THEME.brand,
2689
+ lineHeight: 1.3
2690
+ },
2691
+ children: pill
2692
+ }, i);
2693
+ })]
2694
+ });
2695
+ };
2696
+ var HeroRaisedCard = function HeroRaisedCard(_ref15) {
2697
+ var value = _ref15.value,
2698
+ trend = _ref15.trend,
2699
+ detail = _ref15.detail;
2700
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
2701
+ style: {
2702
+ display: "flex",
2703
+ background: "#FFFFFF",
2704
+ border: "1px solid ".concat(THEME.panelBorder),
2705
+ borderRadius: 12,
2706
+ overflow: "hidden",
2707
+ boxSizing: "border-box"
2708
+ },
2709
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2710
+ style: {
2711
+ width: 5,
2712
+ flexShrink: 0,
2713
+ background: THEME.brand
2714
+ }
2715
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2716
+ style: {
2717
+ flex: 1,
2718
+ padding: "16px 18px 14px"
2719
+ },
2720
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2721
+ style: {
2722
+ fontSize: 9,
2723
+ fontWeight: 700,
2724
+ letterSpacing: "0.8px",
2725
+ color: THEME.brand,
2726
+ textTransform: "uppercase"
2727
+ },
2728
+ children: "Total Raised"
2729
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2730
+ style: {
2731
+ display: "flex",
2732
+ alignItems: "center",
2733
+ gap: 10,
2734
+ marginTop: 6,
2735
+ flexWrap: "wrap"
2736
+ },
2737
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
2738
+ style: {
2739
+ fontSize: 28,
2740
+ fontWeight: 700,
2741
+ color: THEME.text,
2742
+ lineHeight: 1.05,
2743
+ letterSpacing: "-0.5px"
2744
+ },
2745
+ children: value
2746
+ }), trend && /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
2747
+ positive: isTrendPositive(trend),
2748
+ children: trend
2749
+ })]
2750
+ }), detail && /*#__PURE__*/jsxRuntime.jsx("div", {
2751
+ style: {
2752
+ fontSize: 9,
2753
+ color: THEME.muted,
2754
+ marginTop: 8,
2755
+ lineHeight: 1.4
2756
+ },
2757
+ children: detail
2758
+ })]
2759
+ })]
2760
+ });
2761
+ };
2762
+ var MetricGridCard = function MetricGridCard(_ref16) {
2763
+ var title = _ref16.title,
2764
+ value = _ref16.value,
2765
+ trend = _ref16.trend,
2766
+ detail = _ref16.detail,
2767
+ _ref16$trendPositiveW = _ref16.trendPositiveWhenNegative,
2768
+ trendPositiveWhenNegative = _ref16$trendPositiveW === void 0 ? false : _ref16$trendPositiveW;
2769
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
2770
+ style: {
2771
+ position: "relative",
2772
+ background: "#FFFFFF",
2773
+ border: "1px solid ".concat(THEME.panelBorder),
2774
+ borderRadius: 12,
2775
+ padding: "12px 14px 11px",
2776
+ boxSizing: "border-box",
2777
+ minWidth: 0
2778
+ },
2779
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
2780
+ style: {
2781
+ display: "flex",
2782
+ justifyContent: "space-between",
2783
+ alignItems: "flex-start",
2784
+ gap: 6
2785
+ },
2786
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2787
+ style: {
2788
+ fontSize: 8,
2789
+ fontWeight: 700,
2790
+ letterSpacing: "0.7px",
2791
+ color: THEME.muted,
2792
+ textTransform: "uppercase",
2793
+ lineHeight: 1.2
2794
+ },
2795
+ children: title
2796
+ }), trend && /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
2797
+ positive: isTrendPositive(trend, trendPositiveWhenNegative),
2798
+ children: trend
2799
+ })]
2632
2800
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
2633
2801
  style: {
2634
- fontSize: 17,
2635
- fontWeight: 800,
2802
+ fontSize: 20,
2803
+ fontWeight: 700,
2636
2804
  color: THEME.text,
2637
2805
  lineHeight: 1.1,
2638
- marginTop: 2
2806
+ marginTop: 10
2639
2807
  },
2640
2808
  children: value
2641
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2642
- style: {
2643
- fontSize: 10.5,
2644
- fontWeight: 600,
2645
- color: resolveTrendColor(displayTrend, trendPositiveWhenNegative)
2646
- },
2647
- children: displayTrend
2648
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2809
+ }), detail && /*#__PURE__*/jsxRuntime.jsx("div", {
2649
2810
  style: {
2650
2811
  fontSize: 8.5,
2651
2812
  color: THEME.muted,
2652
- lineHeight: 1.4
2813
+ marginTop: 5,
2814
+ lineHeight: 1.35
2653
2815
  },
2654
2816
  children: detail
2655
2817
  })]
2656
2818
  });
2657
2819
  };
2658
- var PageHeader = function PageHeader(_ref12) {
2659
- var dateLabel = _ref12.dateLabel,
2660
- generatedLabel = _ref12.generatedLabel,
2661
- activeFilters = _ref12.activeFilters,
2662
- page = _ref12.page,
2663
- windowLabel = _ref12.windowLabel;
2820
+ var PageOneFooter = function PageOneFooter(_ref17) {
2821
+ var generatedBy = _ref17.generatedBy,
2822
+ generatedLabel = _ref17.generatedLabel;
2823
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
2824
+ style: {
2825
+ padding: "14px ".concat(MX, "px 28px"),
2826
+ borderTop: "1px solid ".concat(THEME.panelBorder),
2827
+ marginTop: "auto",
2828
+ flexShrink: 0
2829
+ },
2830
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
2831
+ style: {
2832
+ display: "flex",
2833
+ justifyContent: "space-between",
2834
+ alignItems: "center",
2835
+ fontSize: 8,
2836
+ color: THEME.muted,
2837
+ lineHeight: 1.4
2838
+ },
2839
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
2840
+ children: ["Confidential", BULLET, "Generated by ", generatedBy, BULLET, generatedLabel]
2841
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
2842
+ children: ["Page 1 of 2", BULLET, "madinah.com"]
2843
+ })]
2844
+ })
2845
+ });
2846
+ };
2847
+ var PageHeader = function PageHeader(_ref18) {
2848
+ var dateLabel = _ref18.dateLabel,
2849
+ generatedLabel = _ref18.generatedLabel,
2850
+ activeFilters = _ref18.activeFilters,
2851
+ page = _ref18.page,
2852
+ windowLabel = _ref18.windowLabel;
2664
2853
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
2665
2854
  style: {
2666
2855
  padding: "22px ".concat(MX, "px 12px"),
@@ -2766,10 +2955,10 @@ var PageHeader = function PageHeader(_ref12) {
2766
2955
  })]
2767
2956
  });
2768
2957
  };
2769
- var PageFooter = function PageFooter(_ref13) {
2770
- var generatedBy = _ref13.generatedBy,
2771
- generatedLabel = _ref13.generatedLabel,
2772
- page = _ref13.page;
2958
+ var PageFooter = function PageFooter(_ref19) {
2959
+ var generatedBy = _ref19.generatedBy,
2960
+ generatedLabel = _ref19.generatedLabel,
2961
+ page = _ref19.page;
2773
2962
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2774
2963
  style: {
2775
2964
  padding: "9px ".concat(MX, "px 54px"),
@@ -2796,32 +2985,33 @@ var PageFooter = function PageFooter(_ref13) {
2796
2985
  };
2797
2986
 
2798
2987
  // ─── Main component ───────────────────────────────────────────────────────────
2799
- var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2800
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _growth$overallAVGDon, _metricByTitle$AvgDo2, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _metricByTitle$Refund3, _mainChart$stacked, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2801
- var _ref14$name = _ref14.name,
2802
- name = _ref14$name === void 0 ? "" : _ref14$name,
2803
- _ref14$apiData = _ref14.apiData,
2804
- apiData = _ref14$apiData === void 0 ? {} : _ref14$apiData,
2805
- _ref14$dateName = _ref14.dateName,
2806
- dateName = _ref14$dateName === void 0 ? "Last Period" : _ref14$dateName,
2807
- _ref14$numberOfDays = _ref14.numberOfDays,
2808
- numberOfDays = _ref14$numberOfDays === void 0 ? 30 : _ref14$numberOfDays,
2809
- _ref14$activeFilters = _ref14.activeFilters,
2810
- activeFilters = _ref14$activeFilters === void 0 ? [] : _ref14$activeFilters;
2988
+ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
2989
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _growth$totalRevenue, _metricByTitle$AvgDo, _avgDonationDetail$me, _avgDonationDetail$to, _metricByTitle$NetRa, _growth$netRevenue, _metricByTitle$Total, _metricByTitle$Total2, _growth$totalDonation, _metricByTitle$Total3, _metricByTitle$AvgDo2, _growth$overallAVGDon, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _growth$conversionRat, _metricByTitle$Conver2, _metricByTitle$Refund, _refunds$growthPercen, _metricByTitle$Refund2, _mainChart$stacked, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2990
+ var _ref20$name = _ref20.name,
2991
+ name = _ref20$name === void 0 ? "" : _ref20$name,
2992
+ _ref20$apiData = _ref20.apiData,
2993
+ apiData = _ref20$apiData === void 0 ? {} : _ref20$apiData,
2994
+ _ref20$dateName = _ref20.dateName,
2995
+ dateName = _ref20$dateName === void 0 ? "Last Period" : _ref20$dateName,
2996
+ _ref20$numberOfDays = _ref20.numberOfDays,
2997
+ numberOfDays = _ref20$numberOfDays === void 0 ? 30 : _ref20$numberOfDays,
2998
+ _ref20$activeFilters = _ref20.activeFilters,
2999
+ activeFilters = _ref20$activeFilters === void 0 ? [] : _ref20$activeFilters;
2811
3000
  var now = new Date();
2812
3001
  var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
2813
3002
  var windowLabel = "".concat(numberOfDays, "-day window");
2814
- var estOptions = {
2815
- timeZone: "America/New_York"
3003
+ var gmtOptions = {
3004
+ timeZone: "UTC"
2816
3005
  };
2817
3006
  var generatedLabel = now.toLocaleDateString("en-US", _objectSpread2({
2818
3007
  month: "short",
2819
3008
  day: "numeric",
2820
3009
  year: "numeric"
2821
- }, estOptions)) + " - " + now.toLocaleTimeString("en-US", _objectSpread2({
3010
+ }, gmtOptions)) + BULLET + now.toLocaleTimeString("en-US", _objectSpread2({
2822
3011
  hour: "2-digit",
2823
- minute: "2-digit"
2824
- }, estOptions)) + " EST";
3012
+ minute: "2-digit",
3013
+ hour12: false
3014
+ }, gmtOptions)) + " GMT";
2825
3015
  var dateLabel = dateName;
2826
3016
  var _normalizeFiltersText = function normalizeFiltersText(filtersInput) {
2827
3017
  if (typeof filtersInput === "string") {
@@ -2859,21 +3049,46 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2859
3049
  return "";
2860
3050
  };
2861
3051
  var formattedActiveFilters = _normalizeFiltersText(activeFilters);
3052
+ var parseFilterPills = function parseFilterPills(filtersInput) {
3053
+ if (Array.isArray(filtersInput)) {
3054
+ var fromObjects = filtersInput.filter(function (item) {
3055
+ return item && _typeof(item) === "object" && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
3056
+ }).map(function (item) {
3057
+ return "".concat(item.label || item.id || "Filter", ": ").concat(item.value);
3058
+ });
3059
+ if (fromObjects.length) return fromObjects;
3060
+ var fromStrings = filtersInput.map(function (item) {
3061
+ return typeof item === "string" ? item.trim() : "";
3062
+ }).filter(Boolean);
3063
+ if (fromStrings.length) return fromStrings;
3064
+ }
3065
+ if (typeof filtersInput === "string" && filtersInput.trim()) {
3066
+ var str = filtersInput.trim();
3067
+ if (str.includes("·")) return str.split("·").map(function (s) {
3068
+ return s.trim();
3069
+ }).filter(Boolean);
3070
+ if (str.includes("|")) return str.split("|").map(function (s) {
3071
+ return s.trim();
3072
+ }).filter(Boolean);
3073
+ return [str];
3074
+ }
3075
+ return [];
3076
+ };
3077
+ var filterPills = parseFilterPills(activeFilters);
2862
3078
  var report = buildReportData(apiData, dateName);
2863
- var hero = report.hero,
2864
- metrics = report.metrics,
3079
+ var metrics = report.metrics,
2865
3080
  mainChart = report.mainChart,
2866
3081
  growth = report.growth,
2867
3082
  totalDonors = report.totalDonors,
2868
3083
  donorMix = report.donorMix,
2869
3084
  activeCampaigns = report.activeCampaigns;
2870
3085
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
2871
- var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 240938);
2872
- var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 222300);
2873
- var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 130.58);
2874
- var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 1.7);
2875
- var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
2876
- var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
3086
+ var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 0);
3087
+ var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 0);
3088
+ var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 0);
3089
+ var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 0);
3090
+ var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 0);
3091
+ var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "0% pass-through";
2877
3092
  var avgDonationDetail = parseAvgDonationDetail(apiData);
2878
3093
  var refunds = parseRefundsChargebacks(apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks);
2879
3094
  var refundRate = refunds.refundRate,
@@ -2893,7 +3108,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2893
3108
  var geoList = report.donorGeographyList;
2894
3109
  var trafficItems = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc = apiData.trafficSourceData) === null || _apiData$trafficSourc === void 0 ? void 0 : _apiData$trafficSourc.data) ? apiData.trafficSourceData.data : [];
2895
3110
  var trafficTotal = Number((_apiData$trafficSourc2 = apiData === null || apiData === void 0 || (_apiData$trafficSourc3 = apiData.trafficSourceData) === null || _apiData$trafficSourc3 === void 0 ? void 0 : _apiData$trafficSourc3.totalRevenue) !== null && _apiData$trafficSourc2 !== void 0 ? _apiData$trafficSourc2 : 0);
2896
- var revSeries = (mainChart.series || []).length ? mainChart.series : [{
3111
+ var revSeries = mainChart.series || [{
2897
3112
  name: "Paid Ads",
2898
3113
  data: []
2899
3114
  }, {
@@ -2904,42 +3119,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2904
3119
  data: []
2905
3120
  }];
2906
3121
  var revCats = mainChart.categories || [];
2907
- ((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : [{
2908
- title: "Orphan sponsorship — Yemen",
2909
- collectedAmount: 78400,
2910
- usdTargetAmount: 100000,
2911
- uniqueDonationsCount: 82,
2912
- averageDonation: 956,
2913
- status: "Active"
2914
- }, {
2915
- title: "Emergency food — Gaza",
2916
- collectedAmount: 62100,
2917
- usdTargetAmount: 75000,
2918
- uniqueDonationsCount: 61,
2919
- averageDonation: 1018,
2920
- status: "Active"
2921
- }, {
2922
- title: "Masjid build — Somalia",
2923
- collectedAmount: 38200,
2924
- usdTargetAmount: 83000,
2925
- uniqueDonationsCount: 34,
2926
- averageDonation: 1124,
2927
- status: "Slow"
2928
- }, {
2929
- title: "Water wells — Pakistan",
2930
- collectedAmount: 29800,
2931
- usdTargetAmount: 30000,
2932
- uniqueDonationsCount: 28,
2933
- averageDonation: 1064,
2934
- status: "Closing"
2935
- }, {
2936
- title: "Ramadan packs — Egypt",
2937
- collectedAmount: 18400,
2938
- usdTargetAmount: 23500,
2939
- uniqueDonationsCount: 10,
2940
- averageDonation: 1940,
2941
- status: "Active"
2942
- }];
2943
3122
  var ob = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || {};
2944
3123
  var obData = ((ob === null || ob === void 0 ? void 0 : ob.chart) || []).map(function (i) {
2945
3124
  return Number(i.revenue || 0);
@@ -2968,13 +3147,16 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2968
3147
  label: "Email",
2969
3148
  color: C.cyan
2970
3149
  }];
2971
- var revenueTrendText = mainChart.trend || "";
2972
- var revenueTrendColor = getTrendColor(revenueTrendText, {
2973
- up: "#054835ff",
2974
- down: "#EF4444"
2975
- });
2976
- var revenueTrendBadgeBg = revenueTrendColor === "#EF4444" ? "#fee2e2" : "#8df3be9a";
2977
- var revenueTrendArrow = getTrendArrow(revenueTrendText);
3150
+ var revenueTrendText = "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 0), " vs last month");
3151
+ var heroTrendText = revenueTrendText;
3152
+ var heroDetailText = [passThrough, "".concat(formatNumber(totalDonors), " donors"), "$".concat(formatNumber(Number(avgDonation).toFixed(2)), " avg"), "".concat(formatNumber(totalVisits), " visits")].join(BULLET);
3153
+ var formatMetricDetail = function formatMetricDetail(detail) {
3154
+ return String(detail !== null && detail !== void 0 ? detail : "").replace(/\s-\s/g, BULLET);
3155
+ };
3156
+ var formatRoasTrend = function formatRoasTrend(trend) {
3157
+ return String(trend !== null && trend !== void 0 ? trend : "").replace(/x$/, "×");
3158
+ };
3159
+ var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail || "Median $".concat(formatNumber((_avgDonationDetail$me = avgDonationDetail.median) !== null && _avgDonationDetail$me !== void 0 ? _avgDonationDetail$me : 0), " \xB7 top decile $").concat(formatNumber((_avgDonationDetail$to = avgDonationDetail.topDecile) !== null && _avgDonationDetail$to !== void 0 ? _avgDonationDetail$to : 0)));
2978
3160
  var headerProps = {
2979
3161
  dateLabel: dateLabel,
2980
3162
  generatedLabel: generatedLabel,
@@ -2997,189 +3179,187 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2997
3179
  background: THEME.pageBg,
2998
3180
  display: "flex",
2999
3181
  flexDirection: "column",
3000
- fontFamily: "'Helvetica Neue', Helvetica, Arial, sans-serif",
3182
+ fontFamily: "'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif",
3001
3183
  boxSizing: "border-box"
3002
3184
  },
3003
- children: [/*#__PURE__*/jsxRuntime.jsx(PageHeader, _objectSpread2(_objectSpread2({}, headerProps), {}, {
3004
- page: 1
3005
- })), /*#__PURE__*/jsxRuntime.jsxs("div", {
3185
+ children: [/*#__PURE__*/jsxRuntime.jsx(PageOneHeader, {
3186
+ dateLabel: dateLabel,
3187
+ generatedLabel: generatedLabel,
3188
+ windowLabel: windowLabel
3189
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3006
3190
  style: {
3007
3191
  flex: 1,
3008
- padding: "12px ".concat(MX, "px 10px"),
3192
+ padding: "0 ".concat(MX, "px 0"),
3009
3193
  display: "flex",
3010
- flexDirection: "column",
3011
- gap: 10
3194
+ flexDirection: "column"
3012
3195
  },
3013
- children: [/*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3014
- title: "Total Raised",
3015
- value: kpi$(totalRaised),
3016
- trend: hero.trend,
3017
- detail: hero.detail,
3018
- variant: "primary"
3019
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3020
- style: {
3021
- display: "grid",
3022
- gridTemplateColumns: "repeat(3, 1fr)",
3023
- gap: 7
3024
- },
3025
- children: [/*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3026
- title: "Net Raised",
3027
- value: kpi$(netRaised),
3028
- trend: ((_metricByTitle$NetRa = metricByTitle["Net Raised"]) === null || _metricByTitle$NetRa === void 0 ? void 0 : _metricByTitle$NetRa.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.netRevenue) || 17.4),
3029
- detail: passThrough
3030
- }), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3031
- title: "Total Donors",
3032
- value: ((_metricByTitle$Total = metricByTitle["Total Donors"]) === null || _metricByTitle$Total === void 0 ? void 0 : _metricByTitle$Total.value) || "".concat(formatNumber(totalDonors)),
3033
- trend: ((_metricByTitle$Total2 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total2 === void 0 ? void 0 : _metricByTitle$Total2.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.totalDonations) || 16.8),
3034
- detail: ((_metricByTitle$Total3 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total3 === void 0 ? void 0 : _metricByTitle$Total3.detail) || "".concat(formatNumber(newDonors), " new - ").concat(formatNumber(returningDonors), " returning")
3035
- }), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3036
- title: "Avg Donation",
3037
- value: kpi$(avgDonation),
3038
- trend: ((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.trend) || signed((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0),
3039
- detail: ((_metricByTitle$AvgDo2 = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo2 === void 0 ? void 0 : _metricByTitle$AvgDo2.detail) || avgDonationDetail.detail
3040
- })]
3196
+ children: [/*#__PURE__*/jsxRuntime.jsx(ActiveFiltersBar, {
3197
+ pills: filterPills
3041
3198
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3042
3199
  style: {
3043
- display: "grid",
3044
- gridTemplateColumns: "repeat(3, 1fr)",
3045
- gap: 7
3046
- },
3047
- children: [/*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3048
- title: "ROAS",
3049
- value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0),
3050
- trend: ((_metricByTitle$ROAS = metricByTitle.ROAS) === null || _metricByTitle$ROAS === void 0 ? void 0 : _metricByTitle$ROAS.trend) || signed((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0, "×"),
3051
- detail: ((_metricByTitle$ROAS2 = metricByTitle.ROAS) === null || _metricByTitle$ROAS2 === void 0 ? void 0 : _metricByTitle$ROAS2.detail) || "".concat(d$((_apiData$adSpend = apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) !== null && _apiData$adSpend !== void 0 ? _apiData$adSpend : 0), " spend - ").concat(d$((_apiData$attributedRe = apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) !== null && _apiData$attributedRe !== void 0 ? _apiData$attributedRe : 0), " attrib.")
3052
- }), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3053
- title: "Conversion",
3054
- value: kpiPct(convRate),
3055
- trend: ((_metricByTitle$Conver = metricByTitle.Conversion) === null || _metricByTitle$Conver === void 0 ? void 0 : _metricByTitle$Conver.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.conversionRate) || 0.21, "pp"),
3056
- detail: ((_metricByTitle$Conver2 = metricByTitle.Conversion) === null || _metricByTitle$Conver2 === void 0 ? void 0 : _metricByTitle$Conver2.detail) || "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
3057
- }), /*#__PURE__*/jsxRuntime.jsx(KpiCard, {
3058
- title: "Refund Rate",
3059
- value: pct(refundRate, 2),
3060
- trend: ((_metricByTitle$Refund = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund === void 0 ? void 0 : _metricByTitle$Refund.trend) || signed(growthPercentage),
3061
- detail: ((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber(totalRefunds), " refunds this period"),
3062
- trendPositiveWhenNegative: (_metricByTitle$Refund3 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund3 === void 0 ? void 0 : _metricByTitle$Refund3.trendPositiveWhenNegative
3063
- })]
3064
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3065
- style: {
3066
- border: "1px solid #E5E7EB",
3067
- borderRadius: 8,
3068
- background: "#fff",
3069
- padding: "12px 14px 10px",
3200
+ display: "flex",
3201
+ flexDirection: "column",
3202
+ gap: 10,
3203
+ marginTop: 14,
3070
3204
  flex: 1
3071
3205
  },
3072
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3206
+ children: [/*#__PURE__*/jsxRuntime.jsx(HeroRaisedCard, {
3207
+ value: kpi$(totalRaised),
3208
+ trend: heroTrendText,
3209
+ detail: heroDetailText
3210
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3073
3211
  style: {
3074
- display: "flex",
3075
- justifyContent: "space-between",
3076
- alignItems: "flex-start",
3077
- marginBottom: 8
3212
+ display: "grid",
3213
+ gridTemplateColumns: "repeat(3, 1fr)",
3214
+ gap: 10
3215
+ },
3216
+ children: [/*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3217
+ title: "Net Raised",
3218
+ value: d$Compact(netRaised),
3219
+ trend: ((_metricByTitle$NetRa = metricByTitle["Net Raised"]) === null || _metricByTitle$NetRa === void 0 ? void 0 : _metricByTitle$NetRa.trend) || formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 0),
3220
+ detail: passThrough
3221
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3222
+ title: "Total Donors",
3223
+ value: ((_metricByTitle$Total = metricByTitle["Total Donors"]) === null || _metricByTitle$Total === void 0 ? void 0 : _metricByTitle$Total.value) || "".concat(formatNumber(totalDonors)),
3224
+ trend: ((_metricByTitle$Total2 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total2 === void 0 ? void 0 : _metricByTitle$Total2.trend) || formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 0),
3225
+ detail: formatMetricDetail(((_metricByTitle$Total3 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total3 === void 0 ? void 0 : _metricByTitle$Total3.detail) || "".concat(formatNumber(newDonors), " new \xB7 ").concat(formatNumber(returningDonors), " returning"))
3226
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3227
+ title: "Avg Donation",
3228
+ value: kpi$(avgDonation),
3229
+ trend: ((_metricByTitle$AvgDo2 = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo2 === void 0 ? void 0 : _metricByTitle$AvgDo2.trend) || formatTrend((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0),
3230
+ detail: avgDonationDetailText
3231
+ })]
3232
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3233
+ style: {
3234
+ display: "grid",
3235
+ gridTemplateColumns: "repeat(3, 1fr)",
3236
+ gap: 10
3237
+ },
3238
+ children: [/*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3239
+ title: "ROAS",
3240
+ value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0),
3241
+ trend: formatRoasTrend(((_metricByTitle$ROAS = metricByTitle.ROAS) === null || _metricByTitle$ROAS === void 0 ? void 0 : _metricByTitle$ROAS.trend) || formatTrend((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0, "x")),
3242
+ detail: formatMetricDetail(((_metricByTitle$ROAS2 = metricByTitle.ROAS) === null || _metricByTitle$ROAS2 === void 0 ? void 0 : _metricByTitle$ROAS2.detail) || "".concat(d$Compact((_apiData$adSpend = apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) !== null && _apiData$adSpend !== void 0 ? _apiData$adSpend : 0), " spend \xB7 ").concat(d$Compact((_apiData$attributedRe = apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) !== null && _apiData$attributedRe !== void 0 ? _apiData$attributedRe : 0), " attrib."))
3243
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3244
+ title: "Conversion",
3245
+ value: kpiPct(convRate),
3246
+ trend: ((_metricByTitle$Conver = metricByTitle.Conversion) === null || _metricByTitle$Conver === void 0 ? void 0 : _metricByTitle$Conver.trend) || formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0, "pp"),
3247
+ detail: formatMetricDetail(((_metricByTitle$Conver2 = metricByTitle.Conversion) === null || _metricByTitle$Conver2 === void 0 ? void 0 : _metricByTitle$Conver2.detail) || "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits"))
3248
+ }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3249
+ title: "Refund Rate",
3250
+ value: pct(refundRate, 2),
3251
+ trend: ((_metricByTitle$Refund = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund === void 0 ? void 0 : _metricByTitle$Refund.trend) || formatTrend((_refunds$growthPercen = refunds.growthPercentage) !== null && _refunds$growthPercen !== void 0 ? _refunds$growthPercen : 0, "pp"),
3252
+ detail: formatMetricDetail(((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber(totalRefunds), " refunds this period")),
3253
+ trendPositiveWhenNegative: true
3254
+ })]
3255
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3256
+ style: {
3257
+ border: "1px solid ".concat(THEME.panelBorder),
3258
+ borderRadius: 12,
3259
+ background: "#fff",
3260
+ padding: "14px 16px 12px",
3261
+ flex: 1
3078
3262
  },
3079
3263
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3080
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3081
- style: {
3082
- fontSize: 13,
3083
- fontWeight: 700,
3084
- color: "#111827",
3085
- lineHeight: 1.15
3086
- },
3087
- children: "Total revenue trend"
3088
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3089
- style: {
3090
- fontSize: 9.5,
3091
- color: "rgba(0, 0, 0, 0.4)",
3092
- marginTop: 2,
3093
- lineHeight: 1.15
3094
- },
3095
- children: ["Last ", daysLabel, " - daily aggregation"]
3096
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3097
- style: {
3098
- display: "flex",
3099
- alignItems: "center",
3100
- gap: 6,
3101
- marginTop: 8
3102
- },
3103
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
3264
+ style: {
3265
+ display: "flex",
3266
+ justifyContent: "space-between",
3267
+ alignItems: "flex-start",
3268
+ marginBottom: 6
3269
+ },
3270
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3271
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3104
3272
  style: {
3105
- fontSize: 22,
3273
+ fontSize: 13,
3106
3274
  fontWeight: 700,
3107
- color: "#111827"
3275
+ color: THEME.text,
3276
+ lineHeight: 1.15
3108
3277
  },
3109
- children: kpi$(totalRaised)
3110
- }), revenueTrendText && /*#__PURE__*/jsxRuntime.jsxs("span", {
3278
+ children: "Total revenue trend"
3279
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3111
3280
  style: {
3112
- display: "inline-flex",
3113
- alignItems: "center",
3114
- gap: 3,
3115
- background: revenueTrendBadgeBg,
3116
- color: revenueTrendColor,
3117
- padding: "2px 8px",
3118
- borderRadius: 100,
3119
- fontSize: 9.5,
3120
- fontWeight: 600
3281
+ fontSize: 9,
3282
+ color: THEME.muted,
3283
+ marginTop: 3,
3284
+ lineHeight: 1.15
3121
3285
  },
3122
- children: [revenueTrendArrow && /*#__PURE__*/jsxRuntime.jsx("span", {
3123
- children: revenueTrendArrow
3124
- }), revenueTrendText]
3125
- })]
3126
- })]
3127
- }), revSeries.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
3128
- style: {
3129
- display: "flex",
3130
- gap: 10,
3131
- alignItems: "center",
3132
- flexShrink: 0,
3133
- paddingTop: 2
3134
- },
3135
- children: revenueLegend.map(function (leg) {
3136
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
3286
+ children: ["Last ", daysLabel, BULLET, "daily aggregation"]
3287
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3137
3288
  style: {
3138
3289
  display: "flex",
3139
3290
  alignItems: "center",
3140
- gap: 4
3291
+ gap: 8,
3292
+ marginTop: 10
3141
3293
  },
3142
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3294
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
3143
3295
  style: {
3144
- width: 8,
3145
- height: 8,
3146
- borderRadius: "50%",
3147
- background: leg.color,
3148
- flexShrink: 0
3149
- }
3150
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
3151
- style: {
3152
- fontSize: 9.5,
3153
- color: "rgba(0, 0, 0, 0.6)",
3154
- fontWeight: 500
3296
+ fontSize: 22,
3297
+ fontWeight: 700,
3298
+ color: THEME.text,
3299
+ letterSpacing: "-0.3px"
3155
3300
  },
3156
- children: leg.label
3301
+ children: kpi$(totalRaised)
3302
+ }), revenueTrendText && /*#__PURE__*/jsxRuntime.jsx(TrendPill$1, {
3303
+ positive: isTrendPositive(revenueTrendText),
3304
+ children: revenueTrendText
3157
3305
  })]
3158
- }, leg.label);
3306
+ })]
3307
+ }), revSeries.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
3308
+ style: {
3309
+ display: "flex",
3310
+ gap: 12,
3311
+ alignItems: "center",
3312
+ flexShrink: 0,
3313
+ paddingTop: 2
3314
+ },
3315
+ children: revenueLegend.map(function (leg) {
3316
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3317
+ style: {
3318
+ display: "flex",
3319
+ alignItems: "center",
3320
+ gap: 5
3321
+ },
3322
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3323
+ style: {
3324
+ width: 7,
3325
+ height: 7,
3326
+ borderRadius: "50%",
3327
+ background: leg.color,
3328
+ flexShrink: 0
3329
+ }
3330
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3331
+ style: {
3332
+ fontSize: 9,
3333
+ color: "#6B7280",
3334
+ fontWeight: 500
3335
+ },
3336
+ children: leg.label
3337
+ })]
3338
+ }, leg.label);
3339
+ })
3340
+ })]
3341
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
3342
+ style: {
3343
+ width: "100%",
3344
+ minHeight: 280
3345
+ },
3346
+ children: /*#__PURE__*/jsxRuntime.jsx(RevenueChart, {
3347
+ id: "pdf-total-revenue-trend",
3348
+ metric: "Revenue",
3349
+ series: revSeries,
3350
+ categories: revCats,
3351
+ height: 280,
3352
+ stacked: (_mainChart$stacked = mainChart.stacked) !== null && _mainChart$stacked !== void 0 ? _mainChart$stacked : true,
3353
+ type: "area",
3354
+ colors: mainChart.colors || ["#6366F1", "#10B981", "#06B6D4"],
3355
+ showLegend: false
3159
3356
  })
3160
3357
  })]
3161
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
3162
- style: {
3163
- width: "100%",
3164
- minHeight: 300
3165
- },
3166
- children: /*#__PURE__*/jsxRuntime.jsx(RevenueChart, {
3167
- id: "pdf-total-revenue-trend",
3168
- metric: "Revenue",
3169
- series: revSeries,
3170
- categories: revCats,
3171
- height: 300,
3172
- stacked: (_mainChart$stacked = mainChart.stacked) !== null && _mainChart$stacked !== void 0 ? _mainChart$stacked : true,
3173
- type: "area",
3174
- colors: mainChart.colors || ["#6366F1", "#10B981", "#06B6D4"],
3175
- showLegend: false
3176
- })
3177
3358
  })]
3178
3359
  })]
3179
- }), /*#__PURE__*/jsxRuntime.jsx(PageFooter, {
3360
+ }), /*#__PURE__*/jsxRuntime.jsx(PageOneFooter, {
3180
3361
  generatedBy: name,
3181
- generatedLabel: generatedLabel,
3182
- page: 1
3362
+ generatedLabel: generatedLabel
3183
3363
  })]
3184
3364
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3185
3365
  "data-export-page": "2",
@@ -3485,7 +3665,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3485
3665
  })
3486
3666
  })
3487
3667
  }), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
3488
- data: obData.length ? obData : [0, 1],
3668
+ data: obData.length ? obData : [0, 0],
3489
3669
  color: C.indigo,
3490
3670
  width: 110,
3491
3671
  height: 34
@@ -3497,10 +3677,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3497
3677
  display: "flex",
3498
3678
  gap: 12
3499
3679
  },
3500
- children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref15) {
3501
- var _ref16 = _slicedToArray(_ref15, 2),
3502
- l = _ref16[0],
3503
- v = _ref16[1];
3680
+ children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref21) {
3681
+ var _ref22 = _slicedToArray(_ref21, 2),
3682
+ l = _ref22[0],
3683
+ v = _ref22[1];
3504
3684
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3505
3685
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3506
3686
  style: {
@@ -3561,7 +3741,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3561
3741
  })
3562
3742
  })
3563
3743
  }), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
3564
- data: refData.length ? refData : [0, 1],
3744
+ data: refData.length ? refData : [0, 0],
3565
3745
  color: C.emerald,
3566
3746
  width: 110,
3567
3747
  height: 34
@@ -3573,10 +3753,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3573
3753
  display: "flex",
3574
3754
  gap: 12
3575
3755
  },
3576
- children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref17) {
3577
- var _ref18 = _slicedToArray(_ref17, 2),
3578
- l = _ref18[0],
3579
- v = _ref18[1];
3756
+ children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref23) {
3757
+ var _ref24 = _slicedToArray(_ref23, 2),
3758
+ l = _ref24[0],
3759
+ v = _ref24[1];
3580
3760
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3581
3761
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3582
3762
  style: {