@ammarkhalidfarooq/dashboard-package 0.6.93 → 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) {
@@ -3025,7 +2986,7 @@ var PageFooter = function PageFooter(_ref19) {
3025
2986
 
3026
2987
  // ─── Main component ───────────────────────────────────────────────────────────
3027
2988
  var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3028
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _growth$totalRevenue, _metricByTitle$AvgDo, _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;
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;
3029
2990
  var _ref20$name = _ref20.name,
3030
2991
  name = _ref20$name === void 0 ? "" : _ref20$name,
3031
2992
  _ref20$apiData = _ref20.apiData,
@@ -3111,7 +3072,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3111
3072
  }).filter(Boolean);
3112
3073
  return [str];
3113
3074
  }
3114
- return getActiveFilterChips(apiData);
3075
+ return [];
3115
3076
  };
3116
3077
  var filterPills = parseFilterPills(activeFilters);
3117
3078
  var report = buildReportData(apiData, dateName);
@@ -3122,12 +3083,12 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3122
3083
  donorMix = report.donorMix,
3123
3084
  activeCampaigns = report.activeCampaigns;
3124
3085
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
3125
- var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 240938);
3126
- var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 222300);
3127
- var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 130.58);
3128
- var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 1.7);
3129
- var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
3130
- 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";
3131
3092
  var avgDonationDetail = parseAvgDonationDetail(apiData);
3132
3093
  var refunds = parseRefundsChargebacks(apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks);
3133
3094
  var refundRate = refunds.refundRate,
@@ -3147,7 +3108,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3147
3108
  var geoList = report.donorGeographyList;
3148
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 : [];
3149
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);
3150
- var revSeries = (mainChart.series || []).length ? mainChart.series : [{
3111
+ var revSeries = mainChart.series || [{
3151
3112
  name: "Paid Ads",
3152
3113
  data: []
3153
3114
  }, {
@@ -3158,42 +3119,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3158
3119
  data: []
3159
3120
  }];
3160
3121
  var revCats = mainChart.categories || [];
3161
- ((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : [{
3162
- title: "Orphan sponsorship — Yemen",
3163
- collectedAmount: 78400,
3164
- usdTargetAmount: 100000,
3165
- uniqueDonationsCount: 82,
3166
- averageDonation: 956,
3167
- status: "Active"
3168
- }, {
3169
- title: "Emergency food — Gaza",
3170
- collectedAmount: 62100,
3171
- usdTargetAmount: 75000,
3172
- uniqueDonationsCount: 61,
3173
- averageDonation: 1018,
3174
- status: "Active"
3175
- }, {
3176
- title: "Masjid build — Somalia",
3177
- collectedAmount: 38200,
3178
- usdTargetAmount: 83000,
3179
- uniqueDonationsCount: 34,
3180
- averageDonation: 1124,
3181
- status: "Slow"
3182
- }, {
3183
- title: "Water wells — Pakistan",
3184
- collectedAmount: 29800,
3185
- usdTargetAmount: 30000,
3186
- uniqueDonationsCount: 28,
3187
- averageDonation: 1064,
3188
- status: "Closing"
3189
- }, {
3190
- title: "Ramadan packs — Egypt",
3191
- collectedAmount: 18400,
3192
- usdTargetAmount: 23500,
3193
- uniqueDonationsCount: 10,
3194
- averageDonation: 1940,
3195
- status: "Active"
3196
- }];
3197
3122
  var ob = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || {};
3198
3123
  var obData = ((ob === null || ob === void 0 ? void 0 : ob.chart) || []).map(function (i) {
3199
3124
  return Number(i.revenue || 0);
@@ -3222,7 +3147,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3222
3147
  label: "Email",
3223
3148
  color: C.cyan
3224
3149
  }];
3225
- var revenueTrendText = "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 18), " vs last month");
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");
3226
3151
  var heroTrendText = revenueTrendText;
3227
3152
  var heroDetailText = [passThrough, "".concat(formatNumber(totalDonors), " donors"), "$".concat(formatNumber(Number(avgDonation).toFixed(2)), " avg"), "".concat(formatNumber(totalVisits), " visits")].join(BULLET);
3228
3153
  var formatMetricDetail = function formatMetricDetail(detail) {
@@ -3231,7 +3156,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3231
3156
  var formatRoasTrend = function formatRoasTrend(trend) {
3232
3157
  return String(trend !== null && trend !== void 0 ? trend : "").replace(/x$/, "×");
3233
3158
  };
3234
- var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail || "Median $".concat(formatNumber(avgDonationDetail.median || 75), " \xB7 top decile $").concat(formatNumber(avgDonationDetail.topDecile || 850)));
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)));
3235
3160
  var headerProps = {
3236
3161
  dateLabel: dateLabel,
3237
3162
  generatedLabel: generatedLabel,
@@ -3291,17 +3216,17 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3291
3216
  children: [/*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3292
3217
  title: "Net Raised",
3293
3218
  value: d$Compact(netRaised),
3294
- 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 : 17.4),
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),
3295
3220
  detail: passThrough
3296
3221
  }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3297
3222
  title: "Total Donors",
3298
3223
  value: ((_metricByTitle$Total = metricByTitle["Total Donors"]) === null || _metricByTitle$Total === void 0 ? void 0 : _metricByTitle$Total.value) || "".concat(formatNumber(totalDonors)),
3299
- 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 : 16.8),
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),
3300
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"))
3301
3226
  }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3302
3227
  title: "Avg Donation",
3303
3228
  value: kpi$(avgDonation),
3304
- 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 : 8.4),
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),
3305
3230
  detail: avgDonationDetailText
3306
3231
  })]
3307
3232
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -3312,18 +3237,18 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3312
3237
  },
3313
3238
  children: [/*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3314
3239
  title: "ROAS",
3315
- value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 3),
3316
- 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.4, "x")),
3317
- 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 : 72000), " spend \xB7 ").concat(d$Compact((_apiData$attributedRe = apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) !== null && _apiData$attributedRe !== void 0 ? _apiData$attributedRe : 215000), " attrib."))
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."))
3318
3243
  }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3319
3244
  title: "Conversion",
3320
3245
  value: kpiPct(convRate),
3321
- 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.21, "pp"),
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"),
3322
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"))
3323
3248
  }), /*#__PURE__*/jsxRuntime.jsx(MetricGridCard, {
3324
3249
  title: "Refund Rate",
3325
3250
  value: pct(refundRate, 2),
3326
- 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.3, "pp"),
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"),
3327
3252
  detail: formatMetricDetail(((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber(totalRefunds), " refunds this period")),
3328
3253
  trendPositiveWhenNegative: true
3329
3254
  })]
@@ -3433,7 +3358,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3433
3358
  })]
3434
3359
  })]
3435
3360
  }), /*#__PURE__*/jsxRuntime.jsx(PageOneFooter, {
3436
- generatedBy: name || "Ahmad Hassan",
3361
+ generatedBy: name,
3437
3362
  generatedLabel: generatedLabel
3438
3363
  })]
3439
3364
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -3740,7 +3665,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3740
3665
  })
3741
3666
  })
3742
3667
  }), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
3743
- data: obData.length ? obData : [0, 1],
3668
+ data: obData.length ? obData : [0, 0],
3744
3669
  color: C.indigo,
3745
3670
  width: 110,
3746
3671
  height: 34
@@ -3816,7 +3741,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3816
3741
  })
3817
3742
  })
3818
3743
  }), /*#__PURE__*/jsxRuntime.jsx(Sparkline, {
3819
- data: refData.length ? refData : [0, 1],
3744
+ data: refData.length ? refData : [0, 0],
3820
3745
  color: C.emerald,
3821
3746
  width: 110,
3822
3747
  height: 34