@ammarkhalidfarooq/dashboard-package 0.6.68 → 0.6.69

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
@@ -1488,8 +1488,8 @@ var buildReportData = function buildReportData() {
1488
1488
  var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
1489
1489
  var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
1490
1490
  var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
1491
- var newDonors = 31;
1492
- var returningDonors = 184;
1491
+ var newDonors = 0;
1492
+ var returningDonors = 0;
1493
1493
  if (Array.isArray(donorMixRaw)) {
1494
1494
  var nd = donorMixRaw.find(function (d) {
1495
1495
  return /new/i.test(d.type);
@@ -1505,9 +1505,9 @@ var buildReportData = function buildReportData() {
1505
1505
  }
1506
1506
  var avgGift = Number(((_overview$overallAVGD2 = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD2 !== void 0 ? _overview$overallAVGD2 : 0).toFixed(2));
1507
1507
  var donorMixPrev = Number(((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0).toFixed(2));
1508
- var totalMix = newDonors + returningDonors || 1;
1509
- var newPct = Math.round(newDonors / totalMix * 100);
1510
- var retPct = 100 - newPct;
1508
+ var totalMix = newDonors + returningDonors;
1509
+ var newPct = totalMix > 0 ? Math.round(newDonors / totalMix * 100) : 0;
1510
+ var retPct = totalMix > 0 ? 100 - newPct : 0;
1511
1511
  var hero = {
1512
1512
  value: "$".concat(formatNumber(totalRaised)),
1513
1513
  trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 18), " vs ").concat(dateName || "last month"),
@@ -2631,7 +2631,7 @@ var PageFooter = function PageFooter(_ref12) {
2631
2631
 
2632
2632
  // ─── Main component ───────────────────────────────────────────────────────────
2633
2633
  var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2634
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2634
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2635
2635
  var _ref13$apiData = _ref13.apiData,
2636
2636
  apiData = _ref13$apiData === void 0 ? {} : _ref13$apiData,
2637
2637
  _ref13$dateName = _ref13.dateName,
@@ -2714,28 +2714,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2714
2714
  mixAvgGift = donorMix.avgGift,
2715
2715
  donorMixPrev = donorMix.donorMixPrev;
2716
2716
  var geoList = report.donorGeographyList;
2717
- var trafficItems = function (_apiData$trafficSourc) {
2718
- var items = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc = apiData.trafficSourceData) === null || _apiData$trafficSourc === void 0 ? void 0 : _apiData$trafficSourc.data) ? apiData.trafficSourceData.data : [];
2719
- if (items.length) return items;
2720
- return [{
2721
- source: "Paid Ads",
2722
- revenue: 98400,
2723
- share: 41
2724
- }, {
2725
- source: "Organic",
2726
- revenue: 62100,
2727
- share: 26
2728
- }, {
2729
- source: "Email",
2730
- revenue: 38600,
2731
- share: 16
2732
- }, {
2733
- source: "Direct",
2734
- revenue: 15500,
2735
- share: 6
2736
- }];
2737
- }();
2738
- var trafficTotal = Number((apiData === null || apiData === void 0 || (_apiData$trafficSourc2 = apiData.trafficSourceData) === null || _apiData$trafficSourc2 === void 0 ? void 0 : _apiData$trafficSourc2.totalRevenue) || 240900);
2717
+ 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 : [];
2718
+ 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);
2739
2719
  var revSeries = (mainChart.series || []).length ? mainChart.series : [{
2740
2720
  name: "Paid Ads",
2741
2721
  data: []