@ammarkhalidfarooq/dashboard-package 0.6.93 → 0.6.95
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 +39 -114
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +39 -114
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1533,7 +1533,7 @@ var getActiveFilterChips = function getActiveFilterChips(apiData) {
|
|
|
1533
1533
|
return s.trim();
|
|
1534
1534
|
}).filter(Boolean);
|
|
1535
1535
|
}
|
|
1536
|
-
return [
|
|
1536
|
+
return [];
|
|
1537
1537
|
};
|
|
1538
1538
|
var buildReportData = function buildReportData() {
|
|
1539
1539
|
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;
|
|
@@ -1543,13 +1543,13 @@ var buildReportData = function buildReportData() {
|
|
|
1543
1543
|
var refundsRaw = (apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || {};
|
|
1544
1544
|
var refunds = parseRefundsChargebacks(refundsRaw);
|
|
1545
1545
|
var avgDonationDetail = parseAvgDonationDetail(apiData);
|
|
1546
|
-
var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu :
|
|
1547
|
-
var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue :
|
|
1548
|
-
var totalDonors = Number((_overview$totalDonati = overview === null || overview === void 0 ? void 0 : overview.totalDonations) !== null && _overview$totalDonati !== void 0 ? _overview$totalDonati :
|
|
1549
|
-
var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD :
|
|
1550
|
-
var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR :
|
|
1551
|
-
var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits :
|
|
1552
|
-
var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "
|
|
1546
|
+
var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 0);
|
|
1547
|
+
var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 0);
|
|
1548
|
+
var totalDonors = Number((_overview$totalDonati = overview === null || overview === void 0 ? void 0 : overview.totalDonations) !== null && _overview$totalDonati !== void 0 ? _overview$totalDonati : 0);
|
|
1549
|
+
var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 0);
|
|
1550
|
+
var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 0);
|
|
1551
|
+
var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 0);
|
|
1552
|
+
var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "0% pass-through";
|
|
1553
1553
|
var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
|
|
1554
1554
|
var newDonors = 0;
|
|
1555
1555
|
var returningDonors = 0;
|
|
@@ -1573,18 +1573,18 @@ var buildReportData = function buildReportData() {
|
|
|
1573
1573
|
var retPct = totalMix > 0 ? 100 - newPct : 0;
|
|
1574
1574
|
var hero = {
|
|
1575
1575
|
value: "$".concat(formatNumber(totalRaised)),
|
|
1576
|
-
trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue :
|
|
1576
|
+
trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 0), " vs pp"),
|
|
1577
1577
|
detail: "".concat(passThrough, " - ").concat(formatNumber(totalDonors), " donors - $").concat(formatNumber(Number(avgDonation).toFixed(2)), " avg - ").concat(formatNumber(totalVisits), " visits")
|
|
1578
1578
|
};
|
|
1579
1579
|
var metrics = [{
|
|
1580
1580
|
title: "Net Raised",
|
|
1581
1581
|
value: "$".concat(formatNumber(netRaised)),
|
|
1582
|
-
trend: formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue :
|
|
1582
|
+
trend: formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 0),
|
|
1583
1583
|
detail: passThrough
|
|
1584
1584
|
}, {
|
|
1585
1585
|
title: "Total Donors",
|
|
1586
1586
|
value: formatNumber(totalDonors),
|
|
1587
|
-
trend: formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation :
|
|
1587
|
+
trend: formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 0),
|
|
1588
1588
|
detail: "".concat(formatNumber(newDonors), " new - ").concat(formatNumber(returningDonors), " returning")
|
|
1589
1589
|
}, {
|
|
1590
1590
|
title: "Avg Donation",
|
|
@@ -1599,7 +1599,7 @@ var buildReportData = function buildReportData() {
|
|
|
1599
1599
|
}, {
|
|
1600
1600
|
title: "Conversion",
|
|
1601
1601
|
value: "".concat(formatNumber(convRate), "%"),
|
|
1602
|
-
trend: formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0
|
|
1602
|
+
trend: formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0, "pp"),
|
|
1603
1603
|
detail: "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
|
|
1604
1604
|
}, {
|
|
1605
1605
|
title: "Refund Rate",
|
|
@@ -1614,7 +1614,7 @@ var buildReportData = function buildReportData() {
|
|
|
1614
1614
|
label: "Total revenue trend",
|
|
1615
1615
|
subtitle: "Last 30 days - daily aggregation",
|
|
1616
1616
|
value: "$".concat(formatNumber(totalRaised)),
|
|
1617
|
-
trend: "".concat(formatTrend((_growth$totalRevenue2 = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue2 !== void 0 ? _growth$totalRevenue2 :
|
|
1617
|
+
trend: "".concat(formatTrend((_growth$totalRevenue2 = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue2 !== void 0 ? _growth$totalRevenue2 : 0), " vs pp"),
|
|
1618
1618
|
hideControls: true,
|
|
1619
1619
|
stacked: true,
|
|
1620
1620
|
colors: ["#6366F1", "#10B981", "#06B6D4"],
|
|
@@ -1647,60 +1647,21 @@ var buildReportData = function buildReportData() {
|
|
|
1647
1647
|
categories: categories
|
|
1648
1648
|
});
|
|
1649
1649
|
} else {
|
|
1650
|
-
var _categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || ["Apr 5", "Apr 11", "Apr 17", "Apr 23", "Apr 29", "May 4"];
|
|
1651
|
-
var base = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [3000, 4500, 5200, 5800, 6200, 7100, 8500, 9200, 9500];
|
|
1652
1650
|
mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
|
|
1653
1651
|
series: [{
|
|
1654
1652
|
name: "Paid Ads",
|
|
1655
|
-
data:
|
|
1656
|
-
return v * 0.55;
|
|
1657
|
-
})
|
|
1653
|
+
data: []
|
|
1658
1654
|
}, {
|
|
1659
1655
|
name: "Organic",
|
|
1660
|
-
data:
|
|
1661
|
-
return v * 0.28;
|
|
1662
|
-
})
|
|
1656
|
+
data: []
|
|
1663
1657
|
}, {
|
|
1664
1658
|
name: "Email",
|
|
1665
|
-
data:
|
|
1666
|
-
return v * 0.17;
|
|
1667
|
-
})
|
|
1659
|
+
data: []
|
|
1668
1660
|
}],
|
|
1669
|
-
categories:
|
|
1661
|
+
categories: (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || []
|
|
1670
1662
|
});
|
|
1671
1663
|
}
|
|
1672
|
-
var
|
|
1673
|
-
title: "Orphan sponsorship — Yemen",
|
|
1674
|
-
collectedAmount: 78400,
|
|
1675
|
-
usdTargetAmount: 100000,
|
|
1676
|
-
uniqueDonationsCount: 82,
|
|
1677
|
-
status: "Active"
|
|
1678
|
-
}, {
|
|
1679
|
-
title: "Emergency food — Gaza",
|
|
1680
|
-
collectedAmount: 62100,
|
|
1681
|
-
usdTargetAmount: 75000,
|
|
1682
|
-
uniqueDonationsCount: 61,
|
|
1683
|
-
status: "Active"
|
|
1684
|
-
}, {
|
|
1685
|
-
title: "Masjid build — Somalia",
|
|
1686
|
-
collectedAmount: 38200,
|
|
1687
|
-
usdTargetAmount: 83000,
|
|
1688
|
-
uniqueDonationsCount: 34,
|
|
1689
|
-
status: "Slow"
|
|
1690
|
-
}, {
|
|
1691
|
-
title: "Water wells — Pakistan",
|
|
1692
|
-
collectedAmount: 29800,
|
|
1693
|
-
usdTargetAmount: 30000,
|
|
1694
|
-
uniqueDonationsCount: 28,
|
|
1695
|
-
status: "Closing"
|
|
1696
|
-
}, {
|
|
1697
|
-
title: "Ramadan packs — Egypt",
|
|
1698
|
-
collectedAmount: 18400,
|
|
1699
|
-
usdTargetAmount: 23500,
|
|
1700
|
-
uniqueDonationsCount: 10,
|
|
1701
|
-
status: "Active"
|
|
1702
|
-
}];
|
|
1703
|
-
var campaignSource = ((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : sampleCampaigns;
|
|
1664
|
+
var campaignSource = (apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || [];
|
|
1704
1665
|
var activeCampaigns = campaignSource.map(function (campaign) {
|
|
1705
1666
|
return {
|
|
1706
1667
|
id: campaign.campaignName ? campaign.campaignName.split(" ").filter(Boolean).map(function (w) {
|
|
@@ -3109,7 +3070,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3109
3070
|
}).filter(Boolean);
|
|
3110
3071
|
return [str];
|
|
3111
3072
|
}
|
|
3112
|
-
return
|
|
3073
|
+
return [];
|
|
3113
3074
|
};
|
|
3114
3075
|
var filterPills = parseFilterPills(activeFilters);
|
|
3115
3076
|
var report = buildReportData(apiData, dateName);
|
|
@@ -3120,12 +3081,12 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3120
3081
|
donorMix = report.donorMix,
|
|
3121
3082
|
activeCampaigns = report.activeCampaigns;
|
|
3122
3083
|
var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
|
|
3123
|
-
var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu :
|
|
3124
|
-
var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue :
|
|
3125
|
-
var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD :
|
|
3126
|
-
var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR :
|
|
3127
|
-
var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits :
|
|
3128
|
-
var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "
|
|
3084
|
+
var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 0);
|
|
3085
|
+
var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 0);
|
|
3086
|
+
var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 0);
|
|
3087
|
+
var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 0);
|
|
3088
|
+
var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 0);
|
|
3089
|
+
var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "0% pass-through";
|
|
3129
3090
|
var avgDonationDetail = parseAvgDonationDetail(apiData);
|
|
3130
3091
|
var refunds = parseRefundsChargebacks(apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks);
|
|
3131
3092
|
var refundRate = refunds.refundRate,
|
|
@@ -3145,7 +3106,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3145
3106
|
var geoList = report.donorGeographyList;
|
|
3146
3107
|
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 : [];
|
|
3147
3108
|
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);
|
|
3148
|
-
var revSeries =
|
|
3109
|
+
var revSeries = mainChart.series || [{
|
|
3149
3110
|
name: "Paid Ads",
|
|
3150
3111
|
data: []
|
|
3151
3112
|
}, {
|
|
@@ -3156,42 +3117,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3156
3117
|
data: []
|
|
3157
3118
|
}];
|
|
3158
3119
|
var revCats = mainChart.categories || [];
|
|
3159
|
-
((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : [{
|
|
3160
|
-
title: "Orphan sponsorship — Yemen",
|
|
3161
|
-
collectedAmount: 78400,
|
|
3162
|
-
usdTargetAmount: 100000,
|
|
3163
|
-
uniqueDonationsCount: 82,
|
|
3164
|
-
averageDonation: 956,
|
|
3165
|
-
status: "Active"
|
|
3166
|
-
}, {
|
|
3167
|
-
title: "Emergency food — Gaza",
|
|
3168
|
-
collectedAmount: 62100,
|
|
3169
|
-
usdTargetAmount: 75000,
|
|
3170
|
-
uniqueDonationsCount: 61,
|
|
3171
|
-
averageDonation: 1018,
|
|
3172
|
-
status: "Active"
|
|
3173
|
-
}, {
|
|
3174
|
-
title: "Masjid build — Somalia",
|
|
3175
|
-
collectedAmount: 38200,
|
|
3176
|
-
usdTargetAmount: 83000,
|
|
3177
|
-
uniqueDonationsCount: 34,
|
|
3178
|
-
averageDonation: 1124,
|
|
3179
|
-
status: "Slow"
|
|
3180
|
-
}, {
|
|
3181
|
-
title: "Water wells — Pakistan",
|
|
3182
|
-
collectedAmount: 29800,
|
|
3183
|
-
usdTargetAmount: 30000,
|
|
3184
|
-
uniqueDonationsCount: 28,
|
|
3185
|
-
averageDonation: 1064,
|
|
3186
|
-
status: "Closing"
|
|
3187
|
-
}, {
|
|
3188
|
-
title: "Ramadan packs — Egypt",
|
|
3189
|
-
collectedAmount: 18400,
|
|
3190
|
-
usdTargetAmount: 23500,
|
|
3191
|
-
uniqueDonationsCount: 10,
|
|
3192
|
-
averageDonation: 1940,
|
|
3193
|
-
status: "Active"
|
|
3194
|
-
}];
|
|
3195
3120
|
var ob = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || {};
|
|
3196
3121
|
var obData = ((ob === null || ob === void 0 ? void 0 : ob.chart) || []).map(function (i) {
|
|
3197
3122
|
return Number(i.revenue || 0);
|
|
@@ -3220,7 +3145,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3220
3145
|
label: "Email",
|
|
3221
3146
|
color: C.cyan
|
|
3222
3147
|
}];
|
|
3223
|
-
var revenueTrendText = "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue :
|
|
3148
|
+
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");
|
|
3224
3149
|
var heroTrendText = revenueTrendText;
|
|
3225
3150
|
var heroDetailText = [passThrough, "".concat(formatNumber(totalDonors), " donors"), "$".concat(formatNumber(Number(avgDonation).toFixed(2)), " avg"), "".concat(formatNumber(totalVisits), " visits")].join(BULLET);
|
|
3226
3151
|
var formatMetricDetail = function formatMetricDetail(detail) {
|
|
@@ -3229,7 +3154,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3229
3154
|
var formatRoasTrend = function formatRoasTrend(trend) {
|
|
3230
3155
|
return String(trend !== null && trend !== void 0 ? trend : "").replace(/x$/, "×");
|
|
3231
3156
|
};
|
|
3232
|
-
var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail
|
|
3157
|
+
var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail);
|
|
3233
3158
|
var headerProps = {
|
|
3234
3159
|
dateLabel: dateLabel,
|
|
3235
3160
|
generatedLabel: generatedLabel,
|
|
@@ -3289,17 +3214,17 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3289
3214
|
children: [/*#__PURE__*/jsx(MetricGridCard, {
|
|
3290
3215
|
title: "Net Raised",
|
|
3291
3216
|
value: d$Compact(netRaised),
|
|
3292
|
-
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 :
|
|
3217
|
+
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),
|
|
3293
3218
|
detail: passThrough
|
|
3294
3219
|
}), /*#__PURE__*/jsx(MetricGridCard, {
|
|
3295
3220
|
title: "Total Donors",
|
|
3296
3221
|
value: ((_metricByTitle$Total = metricByTitle["Total Donors"]) === null || _metricByTitle$Total === void 0 ? void 0 : _metricByTitle$Total.value) || "".concat(formatNumber(totalDonors)),
|
|
3297
|
-
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 :
|
|
3222
|
+
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),
|
|
3298
3223
|
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"))
|
|
3299
3224
|
}), /*#__PURE__*/jsx(MetricGridCard, {
|
|
3300
3225
|
title: "Avg Donation",
|
|
3301
3226
|
value: kpi$(avgDonation),
|
|
3302
|
-
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 :
|
|
3227
|
+
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),
|
|
3303
3228
|
detail: avgDonationDetailText
|
|
3304
3229
|
})]
|
|
3305
3230
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -3310,18 +3235,18 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3310
3235
|
},
|
|
3311
3236
|
children: [/*#__PURE__*/jsx(MetricGridCard, {
|
|
3312
3237
|
title: "ROAS",
|
|
3313
|
-
value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard :
|
|
3314
|
-
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
|
|
3315
|
-
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 :
|
|
3238
|
+
value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0),
|
|
3239
|
+
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")),
|
|
3240
|
+
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."))
|
|
3316
3241
|
}), /*#__PURE__*/jsx(MetricGridCard, {
|
|
3317
3242
|
title: "Conversion",
|
|
3318
3243
|
value: kpiPct(convRate),
|
|
3319
|
-
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
|
|
3244
|
+
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"),
|
|
3320
3245
|
detail: formatMetricDetail(((_metricByTitle$Conver2 = metricByTitle.Conversion) === null || _metricByTitle$Conver2 === void 0 ? void 0 : _metricByTitle$Conver2.detail) || "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits"))
|
|
3321
3246
|
}), /*#__PURE__*/jsx(MetricGridCard, {
|
|
3322
3247
|
title: "Refund Rate",
|
|
3323
3248
|
value: pct(refundRate, 2),
|
|
3324
|
-
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 :
|
|
3249
|
+
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"),
|
|
3325
3250
|
detail: formatMetricDetail(((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber(totalRefunds), " refunds this period")),
|
|
3326
3251
|
trendPositiveWhenNegative: true
|
|
3327
3252
|
})]
|
|
@@ -3431,7 +3356,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3431
3356
|
})]
|
|
3432
3357
|
})]
|
|
3433
3358
|
}), /*#__PURE__*/jsx(PageOneFooter, {
|
|
3434
|
-
generatedBy: name
|
|
3359
|
+
generatedBy: name,
|
|
3435
3360
|
generatedLabel: generatedLabel
|
|
3436
3361
|
})]
|
|
3437
3362
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -3738,7 +3663,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3738
3663
|
})
|
|
3739
3664
|
})
|
|
3740
3665
|
}), /*#__PURE__*/jsx(Sparkline, {
|
|
3741
|
-
data: obData.length ? obData : [0,
|
|
3666
|
+
data: obData.length ? obData : [0, 0],
|
|
3742
3667
|
color: C.indigo,
|
|
3743
3668
|
width: 110,
|
|
3744
3669
|
height: 34
|
|
@@ -3814,7 +3739,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
|
|
|
3814
3739
|
})
|
|
3815
3740
|
})
|
|
3816
3741
|
}), /*#__PURE__*/jsx(Sparkline, {
|
|
3817
|
-
data: refData.length ? refData : [0,
|
|
3742
|
+
data: refData.length ? refData : [0, 0],
|
|
3818
3743
|
color: C.emerald,
|
|
3819
3744
|
width: 110,
|
|
3820
3745
|
height: 34
|