@driveflux/pdf 1.6.70 → 1.7.1

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.
Files changed (76) hide show
  1. package/dist/__mocks__/quotation.js +11 -10
  2. package/dist/__mocks__/subscription.d.ts +0 -2
  3. package/dist/__mocks__/subscription.d.ts.map +1 -1
  4. package/dist/__mocks__/subscription.js +140 -408
  5. package/dist/__mocks__/subscription.js.map +1 -1
  6. package/dist/components/FluxLogo.js +3 -62
  7. package/dist/components/StandardPage.d.ts.map +1 -1
  8. package/dist/components/StandardPage.js +8 -107
  9. package/dist/components/StandardPage.js.map +1 -1
  10. package/dist/debug.js +30 -223
  11. package/dist/debug.js.map +1 -1
  12. package/dist/index.js +1 -0
  13. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +27 -145
  14. package/dist/templates/QuotationPdf/GFV.js +12 -49
  15. package/dist/templates/QuotationPdf/Header.js +5 -63
  16. package/dist/templates/QuotationPdf/Pricing.d.ts.map +1 -1
  17. package/dist/templates/QuotationPdf/Pricing.js +208 -574
  18. package/dist/templates/QuotationPdf/Pricing.js.map +1 -1
  19. package/dist/templates/QuotationPdf/QuotationPdfPage.js +3 -23
  20. package/dist/templates/QuotationPdf/SectionBoxNew.js +4 -34
  21. package/dist/templates/QuotationPdf/TermsSection.js +5 -42
  22. package/dist/templates/QuotationPdf/VehiclePhotos.js +24 -54
  23. package/dist/templates/QuotationPdf/index.js +11 -198
  24. package/dist/templates/QuotationPdf/translations.d.ts.map +1 -1
  25. package/dist/templates/QuotationPdf/translations.js +23 -34
  26. package/dist/templates/QuotationPdf/translations.js.map +1 -1
  27. package/dist/templates/QuotationPdf/utils.js +29 -59
  28. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +0 -2
  29. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +1 -1
  30. package/dist/templates/SubscriptionAgreement/Confirmation.js +11 -66
  31. package/dist/templates/SubscriptionAgreement/Confirmation.js.map +1 -1
  32. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +1 -3
  33. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +1 -1
  34. package/dist/templates/SubscriptionAgreement/CoverPage.js +11 -94
  35. package/dist/templates/SubscriptionAgreement/CoverPage.js.map +1 -1
  36. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +5 -16
  37. package/dist/templates/SubscriptionAgreement/Details.d.ts.map +1 -1
  38. package/dist/templates/SubscriptionAgreement/Details.js +46 -140
  39. package/dist/templates/SubscriptionAgreement/Details.js.map +1 -1
  40. package/dist/templates/SubscriptionAgreement/Footer.js +6 -48
  41. package/dist/templates/SubscriptionAgreement/Header.js +5 -35
  42. package/dist/templates/SubscriptionAgreement/LabelValue.js +3 -25
  43. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +3 -26
  44. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +2 -2
  45. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +1 -1
  46. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +4 -97
  47. package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +1 -1
  48. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +1 -1
  49. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +9 -98
  50. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +1 -1
  51. package/dist/templates/SubscriptionAgreement/index.d.ts +1 -5
  52. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
  53. package/dist/templates/SubscriptionAgreement/index.js +15 -254
  54. package/dist/templates/SubscriptionAgreement/index.js.map +1 -1
  55. package/dist/templates/SubscriptionAgreement/translations.d.ts +0 -6
  56. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
  57. package/dist/templates/SubscriptionAgreement/translations.js +192 -199
  58. package/dist/templates/SubscriptionAgreement/translations.js.map +1 -1
  59. package/dist/templates/SubscriptionAgreement/types.d.ts +1 -2
  60. package/dist/templates/SubscriptionAgreement/types.d.ts.map +1 -1
  61. package/dist/templates/SubscriptionAgreement/types.js +2 -1
  62. package/dist/templates/SubscriptionAgreement/utils.d.ts +0 -3
  63. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  64. package/dist/templates/SubscriptionAgreement/utils.js +5 -36
  65. package/dist/templates/SubscriptionAgreement/utils.js.map +1 -1
  66. package/dist/templates/index.js +1 -0
  67. package/dist/theme/colors.js +63 -44
  68. package/dist/theme/index.js +1 -0
  69. package/dist/types.js +2 -1
  70. package/dist/utils.js +16 -166
  71. package/dist/watch.js +4 -3
  72. package/package.json +19 -19
  73. package/dist/__mocks__/tou.d.ts +0 -10
  74. package/dist/__mocks__/tou.d.ts.map +0 -1
  75. package/dist/__mocks__/tou.js +0 -22
  76. package/dist/__mocks__/tou.js.map +0 -1
@@ -3,77 +3,53 @@ import { formatMoney } from '@driveflux/format-money';
3
3
  import { Text, View } from '@react-pdf/renderer';
4
4
  import { colors } from '../../theme/colors.js';
5
5
  import SectionBoxNew from './SectionBoxNew.js';
6
- var Pricing = function(param) {
7
- var quotation = param.quotation, t = param.t;
8
- var _quotation_fees_discountAmount, _quotation_fees_discountAmount1;
9
- var _quotation_fees = quotation.fees, reservationFee = _quotation_fees.reservationFee, deposit = _quotation_fees.deposit, subscriptionFee = _quotation_fees.subscriptionFee, extraCharges = _quotation_fees.extraCharges, couponType = _quotation_fees.couponType, discountAmount = _quotation_fees.discountAmount, quotedPrices = _quotation_fees.quotedPrices;
10
- var taxRate = quotation.fees.taxAmount / quotation.fees.amountBeforeTax;
11
- var taxPercentage = (taxRate * 100).toFixed(0);
12
- var hasDiscounts = quotedPrices !== null && quotedPrices !== undefined;
13
- var totalUpfrontFee = hasDiscounts ? (reservationFee || 0) + ((quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit) || 0) : (reservationFee || 0) + deposit;
14
- var totalMonthlyFee = hasDiscounts ? (quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.subscriptionFee) || 0 : subscriptionFee;
6
+ const Pricing = ({ quotation, t }) => {
7
+ const { startFee, reservationFee, deposit, subscriptionFee, extraCharges, couponType, discountAmount, quotedPrices, } = quotation.fees;
8
+ const taxRate = quotation.fees.taxAmount / quotation.fees.amountBeforeTax;
9
+ const taxPercentage = (taxRate * 100).toFixed(0);
10
+ const hasDiscounts = quotedPrices !== null && quotedPrices !== undefined;
11
+ let totalUpfrontFee = hasDiscounts
12
+ ? (quotedPrices?.startFee || 0) +
13
+ (reservationFee || 0) +
14
+ (quotedPrices?.deposit || 0)
15
+ : startFee + (reservationFee || 0) + deposit;
16
+ let totalMonthlyFee = hasDiscounts
17
+ ? quotedPrices?.subscriptionFee || 0
18
+ : subscriptionFee;
15
19
  if (hasDiscounts) {
16
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
17
- try {
18
- for(var _iterator = quotedPrices.extraCharges[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
19
- var charge = _step.value;
20
- if (charge.type === 'upfront') {
21
- totalUpfrontFee += charge.amount;
22
- } else if (charge.type === 'monthly') {
23
- totalMonthlyFee += charge.amount;
24
- }
20
+ for (const charge of quotedPrices.extraCharges) {
21
+ if (charge.type === 'upfront') {
22
+ totalUpfrontFee += charge.amount;
25
23
  }
26
- } catch (err) {
27
- _didIteratorError = true;
28
- _iteratorError = err;
29
- } finally{
30
- try {
31
- if (!_iteratorNormalCompletion && _iterator.return != null) {
32
- _iterator.return();
33
- }
34
- } finally{
35
- if (_didIteratorError) {
36
- throw _iteratorError;
37
- }
24
+ else if (charge.type === 'monthly') {
25
+ totalMonthlyFee += charge.amount;
38
26
  }
39
27
  }
40
- } else {
41
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
42
- try {
43
- for(var _iterator1 = extraCharges[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
44
- var charge1 = _step1.value;
45
- if (charge1.type === 'upfront') {
46
- totalUpfrontFee += charge1.amount;
47
- } else if (charge1.type === 'monthly') {
48
- totalMonthlyFee += charge1.amount;
49
- }
28
+ }
29
+ else {
30
+ for (const charge of extraCharges) {
31
+ if (charge.type === 'upfront') {
32
+ totalUpfrontFee += charge.amount;
50
33
  }
51
- } catch (err) {
52
- _didIteratorError1 = true;
53
- _iteratorError1 = err;
54
- } finally{
55
- try {
56
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
57
- _iterator1.return();
58
- }
59
- } finally{
60
- if (_didIteratorError1) {
61
- throw _iteratorError1;
62
- }
34
+ else if (charge.type === 'monthly') {
35
+ totalMonthlyFee += charge.amount;
63
36
  }
64
37
  }
65
38
  }
66
39
  if (quotation.couponCode) {
67
40
  if (couponType === 'upfront') {
68
41
  totalUpfrontFee -= discountAmount || 0;
69
- } else if (couponType === 'monthly') {
42
+ }
43
+ else if (couponType === 'monthly') {
70
44
  totalMonthlyFee -= discountAmount || 0;
71
45
  }
72
46
  }
73
- var serviceMonthlyFee = totalMonthlyFee * taxRate;
74
- var serviceUpfrontFee = (totalUpfrontFee * taxRate).toFixed(2);
75
- var getFeeValue = function(key) {
76
- switch(key){
47
+ const serviceMonthlyFee = totalMonthlyFee * taxRate;
48
+ const serviceUpfrontFee = (totalUpfrontFee * taxRate).toFixed(2);
49
+ const getFeeValue = (key) => {
50
+ switch (key) {
51
+ case 'startFee':
52
+ return startFee;
77
53
  case 'reservationFee':
78
54
  return reservationFee;
79
55
  case 'deposit':
@@ -84,640 +60,298 @@ var Pricing = function(param) {
84
60
  return null;
85
61
  }
86
62
  };
87
- var getQuotedFeeValue = function(key) {
88
- switch(key){
63
+ const getQuotedFeeValue = (key) => {
64
+ switch (key) {
65
+ case 'startFee':
66
+ return quotedPrices?.startFee;
89
67
  case 'deposit':
90
- return quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit;
68
+ return quotedPrices?.deposit;
91
69
  case 'subscriptionFee':
92
- return quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.subscriptionFee;
70
+ return quotedPrices?.subscriptionFee;
93
71
  case 'reservationFee':
94
72
  return reservationFee;
95
73
  default:
96
74
  return null;
97
75
  }
98
76
  };
99
- var upfrontTotalDiscount = function() {
100
- var _quotedPrices_extraCharges;
101
- // Calculate base fees total (deposit)
102
- var originalBaseTotal = deposit;
103
- var quotedBaseTotal = (quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.deposit) || 0;
77
+ const upfrontTotalDiscount = () => {
78
+ // Calculate base fees total (startFee + deposit)
79
+ const originalBaseTotal = startFee + deposit;
80
+ const quotedBaseTotal = (quotedPrices?.startFee || 0) + (quotedPrices?.deposit || 0);
104
81
  // Calculate original upfront extra charges
105
- var originalExtraCharges = extraCharges.filter(function(charge) {
106
- return charge.type === 'upfront';
107
- }).reduce(function(sum, charge) {
108
- return sum + charge.amount;
109
- }, 0);
82
+ const originalExtraCharges = extraCharges
83
+ .filter((charge) => charge.type === 'upfront')
84
+ .reduce((sum, charge) => sum + charge.amount, 0);
110
85
  // Calculate quoted upfront extra charges
111
- var quotedExtraCharges = (quotedPrices === null || quotedPrices === void 0 ? void 0 : (_quotedPrices_extraCharges = quotedPrices.extraCharges) === null || _quotedPrices_extraCharges === void 0 ? void 0 : _quotedPrices_extraCharges.filter(function(charge) {
112
- return charge.type === 'upfront';
113
- }).reduce(function(sum, charge) {
114
- return sum + charge.amount;
115
- }, 0)) || originalExtraCharges;
116
- var originalTotal = originalBaseTotal + originalExtraCharges;
117
- var quotedTotal = quotedBaseTotal + quotedExtraCharges;
86
+ const quotedExtraCharges = quotedPrices?.extraCharges
87
+ ?.filter((charge) => charge.type === 'upfront')
88
+ .reduce((sum, charge) => sum + charge.amount, 0) || originalExtraCharges;
89
+ const originalTotal = originalBaseTotal + originalExtraCharges;
90
+ const quotedTotal = quotedBaseTotal + quotedExtraCharges;
118
91
  // Calculate total discount (original - quoted)
119
- var totalDiscount = originalTotal - quotedTotal;
92
+ const totalDiscount = originalTotal - quotedTotal;
120
93
  return totalDiscount;
121
94
  };
122
- return /*#__PURE__*/ _jsx(View, {
123
- children: /*#__PURE__*/ _jsx(SectionBoxNew, {
124
- topContent: /*#__PURE__*/ _jsxs(_Fragment, {
125
- children: [
126
- /*#__PURE__*/ _jsx(Text, {
127
- style: {
95
+ return (_jsx(View, { children: _jsx(SectionBoxNew, { topContent: _jsxs(_Fragment, { children: [_jsx(Text, { style: {
128
96
  textTransform: 'uppercase',
129
97
  fontSize: 12,
130
- fontWeight: 'bold'
131
- },
132
- children: t === null || t === void 0 ? void 0 : t.title
133
- }),
134
- /*#__PURE__*/ _jsx(Text, {
135
- style: {
98
+ fontWeight: 'bold',
99
+ }, children: t?.title }), _jsx(Text, { style: {
136
100
  fontWeight: 'bold',
137
101
  color: colors.black,
138
- letterSpacing: 1
139
- },
140
- children: t === null || t === void 0 ? void 0 : t.fees.upfront.title
141
- }),
142
- t === null || t === void 0 ? void 0 : t.fees.upfront.content.map(function(fee) {
143
- var _getFeeValue, _getQuotedFeeValue;
144
- var feeValue = (_getFeeValue = getFeeValue(fee.key)) === null || _getFeeValue === void 0 ? void 0 : _getFeeValue.toFixed(2);
145
- var _getQuotedFeeValue_toFixed;
146
- var quotedFeeValue = (_getQuotedFeeValue_toFixed = (_getQuotedFeeValue = getQuotedFeeValue(fee.key)) === null || _getQuotedFeeValue === void 0 ? void 0 : _getQuotedFeeValue.toFixed(2)) !== null && _getQuotedFeeValue_toFixed !== void 0 ? _getQuotedFeeValue_toFixed : undefined;
102
+ letterSpacing: 1,
103
+ }, children: t?.fees.upfront.title }), t?.fees.upfront.content.map((fee) => {
104
+ const feeValue = getFeeValue(fee.key)?.toFixed(2);
105
+ const quotedFeeValue = getQuotedFeeValue(fee.key)?.toFixed(2) ?? undefined;
147
106
  if (feeValue === '0.00') {
148
107
  return null;
149
108
  }
150
- return /*#__PURE__*/ _jsxs(View, {
151
- style: {
109
+ return (_jsxs(View, { style: {
152
110
  justifyContent: 'space-between',
153
111
  flexDirection: 'row',
154
- rowGap: 8
155
- },
156
- children: [
157
- /*#__PURE__*/ _jsx(Text, {
158
- style: {
112
+ rowGap: 8,
113
+ }, children: [_jsx(Text, { style: {
159
114
  paddingRight: 4,
160
115
  letterSpacing: 1,
161
- color: colors.primary3
162
- },
163
- children: fee.title
164
- }),
165
- hasDiscounts && fee.key !== 'reservationFee' ? // Only show strikethrough if quoted value is different from original value
166
- feeValue !== quotedFeeValue ? /*#__PURE__*/ _jsxs(View, {
167
- style: {
116
+ color: colors.primary3,
117
+ }, children: fee.title }), hasDiscounts && fee.key !== 'reservationFee' ? (
118
+ // Only show strikethrough if quoted value is different from original value
119
+ feeValue !== quotedFeeValue ? (_jsxs(View, { style: {
168
120
  justifyContent: 'flex-end',
169
- flexDirection: 'row'
170
- },
171
- children: [
172
- /*#__PURE__*/ _jsx(Text, {
173
- style: {
121
+ flexDirection: 'row',
122
+ }, children: [_jsx(Text, { style: {
174
123
  color: colors.primary2,
175
124
  letterSpacing: 1,
176
125
  textDecoration: 'line-through',
177
- marginRight: 4
178
- },
179
- children: feeValue !== null ? feeValue : ''
180
- }),
181
- /*#__PURE__*/ _jsx(Text, {
182
- style: {
126
+ marginRight: 4,
127
+ }, children: feeValue !== null ? feeValue : '' }), _jsx(Text, { style: {
183
128
  color: colors.primary3,
184
- letterSpacing: 1
185
- },
186
- children: quotedFeeValue
187
- })
188
- ]
189
- }) : // When values are the same, just show the single value
190
- /*#__PURE__*/ _jsx(Text, {
191
- style: {
129
+ letterSpacing: 1,
130
+ }, children: quotedFeeValue })] })) : (
131
+ // When values are the same, just show the single value
132
+ _jsx(Text, { style: {
192
133
  color: colors.primary3,
193
- letterSpacing: 1
194
- },
195
- children: feeValue !== null ? feeValue : ''
196
- }) : // When no discounts or it's a reservation fee
197
- /*#__PURE__*/ _jsx(Text, {
198
- style: {
134
+ letterSpacing: 1,
135
+ }, children: feeValue !== null ? feeValue : '' }))) : (
136
+ // When no discounts or it's a reservation fee
137
+ _jsx(Text, { style: {
199
138
  color: colors.primary3,
200
- letterSpacing: 1
201
- },
202
- children: feeValue !== null ? feeValue : ''
203
- })
204
- ]
205
- }, fee.key);
206
- }),
207
- quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
208
- return charge.amount > 0;
209
- }).filter(function(charge) {
210
- return charge.type === 'upfront';
211
- }).map(function(charge, i) {
212
- return /*#__PURE__*/ _jsxs(View, {
213
- style: {
139
+ letterSpacing: 1,
140
+ }, children: feeValue !== null ? feeValue : '' }))] }, fee.key));
141
+ }), quotation.fees.extraCharges.length > 0 &&
142
+ quotation.fees.extraCharges
143
+ .filter((charge) => charge.amount > 0)
144
+ .filter((charge) => charge.type === 'upfront')
145
+ .map((charge, i) => (_jsxs(View
146
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
147
+ , { style: {
214
148
  justifyContent: 'space-between',
215
149
  flexDirection: 'row',
216
- rowGap: 8
217
- },
218
- children: [
219
- /*#__PURE__*/ _jsx(Text, {
220
- style: {
150
+ rowGap: 8,
151
+ }, children: [_jsx(Text, { style: {
221
152
  paddingRight: 4,
222
153
  letterSpacing: 1,
223
- color: colors.primary3
224
- },
225
- children: charge.description
226
- }),
227
- hasDiscounts ? function() {
228
- var quotedCharge = quotedPrices.extraCharges.find(function(extraCharge) {
229
- return extraCharge.description === charge.description;
230
- });
231
- var originalAmount = charge.amount.toFixed(2);
232
- var quotedAmount = quotedCharge === null || quotedCharge === void 0 ? void 0 : quotedCharge.amount.toFixed(2);
154
+ color: colors.primary3,
155
+ }, children: charge.description }), hasDiscounts ? ((() => {
156
+ const quotedCharge = quotedPrices.extraCharges.find((extraCharge) => extraCharge.description === charge.description);
157
+ const originalAmount = charge.amount.toFixed(2);
158
+ const quotedAmount = quotedCharge?.amount.toFixed(2);
233
159
  // Only show strikethrough if amounts are different
234
- return originalAmount !== quotedAmount ? /*#__PURE__*/ _jsxs(View, {
235
- style: {
160
+ return originalAmount !== quotedAmount ? (_jsxs(View, { style: {
236
161
  justifyContent: 'flex-end',
237
- flexDirection: 'row'
238
- },
239
- children: [
240
- /*#__PURE__*/ _jsx(Text, {
241
- style: {
162
+ flexDirection: 'row',
163
+ }, children: [_jsx(Text, { style: {
242
164
  color: colors.primary2,
243
165
  letterSpacing: 1,
244
166
  textDecoration: 'line-through',
245
- marginRight: 4
246
- },
247
- children: originalAmount
248
- }),
249
- /*#__PURE__*/ _jsx(Text, {
250
- style: {
167
+ marginRight: 4,
168
+ }, children: originalAmount }), _jsx(Text, { style: {
251
169
  color: colors.primary3,
252
- letterSpacing: 1
253
- },
254
- children: quotedAmount
255
- })
256
- ]
257
- }) : // When amounts are the same, show single value
258
- /*#__PURE__*/ _jsx(Text, {
259
- style: {
170
+ letterSpacing: 1,
171
+ }, children: quotedAmount })] })) : (
172
+ // When amounts are the same, show single value
173
+ _jsx(Text, { style: {
260
174
  color: colors.primary3,
261
- letterSpacing: 1
262
- },
263
- children: originalAmount
264
- });
265
- }() : /*#__PURE__*/ _jsx(Text, {
266
- style: {
175
+ letterSpacing: 1,
176
+ }, children: originalAmount }));
177
+ })()) : (_jsx(Text, { style: {
267
178
  color: colors.primary3,
268
- letterSpacing: 1
269
- },
270
- children: charge.amount.toFixed(2)
271
- })
272
- ]
273
- }, i);
274
- }),
275
- quotation.couponCode !== null && couponType === 'upfront' && /*#__PURE__*/ _jsxs(View, {
276
- style: {
179
+ letterSpacing: 1,
180
+ }, children: charge.amount.toFixed(2) }))] }, i))), quotation.couponCode !== null && couponType === 'upfront' && (_jsxs(View, { style: {
277
181
  justifyContent: 'space-between',
278
182
  flexDirection: 'row',
279
- rowGap: 8
280
- },
281
- children: [
282
- /*#__PURE__*/ _jsxs(Text, {
283
- style: {
183
+ rowGap: 8,
184
+ }, children: [_jsxs(Text, { style: {
284
185
  paddingRight: 4,
285
186
  letterSpacing: 1,
286
- color: colors.primary3
287
- },
288
- children: [
289
- t === null || t === void 0 ? void 0 : t.fees.promo,
290
- " - ",
291
- quotation.couponCode
292
- ]
293
- }),
294
- /*#__PURE__*/ _jsxs(Text, {
295
- style: {
187
+ color: colors.primary3,
188
+ }, children: [t?.fees.promo, " - ", quotation.couponCode] }), _jsxs(Text, { style: {
296
189
  color: colors.success4,
297
190
  letterSpacing: 1,
298
- fontWeight: 'bold'
299
- },
300
- children: [
301
- "- ",
302
- (_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
303
- ]
304
- })
305
- ]
306
- }),
307
- hasDiscounts && /*#__PURE__*/ _jsxs(View, {
308
- style: {
191
+ fontWeight: 'bold',
192
+ }, children: ["- ", quotation.fees.discountAmount?.toFixed(2)] })] })), hasDiscounts && (_jsxs(View, { style: {
309
193
  justifyContent: 'space-between',
310
194
  flexDirection: 'row',
311
- rowGap: 8
312
- },
313
- children: [
314
- /*#__PURE__*/ _jsx(Text, {
315
- style: {
195
+ rowGap: 8,
196
+ }, children: [_jsx(Text, { style: {
316
197
  color: colors.primary3,
317
198
  letterSpacing: 1,
318
- paddingRight: 4
319
- },
320
- children: t === null || t === void 0 ? void 0 : t.fees.totalDiscount
321
- }),
322
- /*#__PURE__*/ _jsxs(Text, {
323
- style: {
199
+ paddingRight: 4,
200
+ }, children: t?.fees.totalDiscount }), _jsxs(Text, { style: {
324
201
  color: colors.success4,
325
202
  fontWeight: 'bold',
326
- letterSpacing: 1
327
- },
328
- children: [
329
- "- ",
330
- upfrontTotalDiscount()
331
- ]
332
- })
333
- ]
334
- }),
335
- /*#__PURE__*/ _jsxs(View, {
336
- style: {
203
+ letterSpacing: 1,
204
+ }, children: ["- ", upfrontTotalDiscount()] })] })), _jsxs(View, { style: {
337
205
  justifyContent: 'space-between',
338
206
  flexDirection: 'row',
339
- rowGap: 8
340
- },
341
- children: [
342
- /*#__PURE__*/ _jsx(Text, {
343
- style: {
207
+ rowGap: 8,
208
+ }, children: [_jsx(Text, { style: {
344
209
  color: colors.primary3,
345
210
  letterSpacing: 1,
346
- paddingRight: 4
347
- },
348
- children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
349
- }),
350
- quotedPrices !== undefined ? /*#__PURE__*/ _jsx(Text, {
351
- style: {
352
- color: colors.primary3,
353
- letterSpacing: 1
354
- },
355
- children: serviceUpfrontFee
356
- }) : /*#__PURE__*/ _jsx(Text, {
357
- style: {
358
- color: colors.primary3,
359
- letterSpacing: 1
360
- },
361
- children: serviceUpfrontFee
362
- })
363
- ]
364
- }),
365
- /*#__PURE__*/ _jsxs(View, {
366
- style: {
211
+ paddingRight: 4,
212
+ }, children: `${t?.serviceFee} (${taxPercentage}%)` }), quotedPrices !== undefined ? (_jsx(Text, { style: { color: colors.primary3, letterSpacing: 1 }, children: serviceUpfrontFee })) : (_jsx(Text, { style: { color: colors.primary3, letterSpacing: 1 }, children: serviceUpfrontFee }))] }), _jsxs(View, { style: {
367
213
  backgroundColor: colors.primary1,
368
- borderTop: "1px solid ".concat(colors.primary1),
214
+ borderTop: `1px solid ${colors.primary1}`,
369
215
  justifyContent: 'space-between',
370
216
  flexDirection: 'row',
371
- padding: 4
372
- },
373
- children: [
374
- /*#__PURE__*/ _jsx(Text, {
375
- style: {
217
+ padding: 4,
218
+ }, children: [_jsx(Text, { style: {
376
219
  letterSpacing: 1,
377
220
  paddingRight: 4,
378
- fontWeight: 'bold'
379
- },
380
- children: "Total"
381
- }),
382
- /*#__PURE__*/ _jsx(Text, {
383
- style: {
384
- letterSpacing: 1,
385
- fontWeight: 'bold'
386
- },
387
- children: formatMoney(totalUpfrontFee + Number.parseFloat(serviceUpfrontFee))
388
- })
389
- ]
390
- }),
391
- /*#__PURE__*/ _jsx(View, {
392
- children: /*#__PURE__*/ _jsx(Text, {
393
- style: {
221
+ fontWeight: 'bold',
222
+ }, children: "Total" }), _jsx(Text, { style: { letterSpacing: 1, fontWeight: 'bold' }, children: formatMoney(totalUpfrontFee + Number.parseFloat(serviceUpfrontFee)) })] }), _jsx(View, { children: _jsx(Text, { style: {
394
223
  color: colors.primary3,
395
224
  letterSpacing: 1,
396
- fontSize: '9px'
397
- },
398
- children: t === null || t === void 0 ? void 0 : t.fees.upfront.depositDisclaimer
399
- })
400
- }),
401
- /*#__PURE__*/ _jsx(View, {
402
- style: {
403
- borderBottom: "1px solid ".concat(colors.primary2)
404
- }
405
- }),
406
- /*#__PURE__*/ _jsx(Text, {
407
- style: {
225
+ fontSize: '9px',
226
+ }, children: t?.fees.upfront.depositDisclaimer }) }), _jsx(View, { style: { borderBottom: `1px solid ${colors.primary2}` } }), _jsx(Text, { style: {
408
227
  fontWeight: 'bold',
409
228
  color: colors.black,
410
- letterSpacing: 1
411
- },
412
- children: t === null || t === void 0 ? void 0 : t.fees.monthly.title
413
- }),
414
- t === null || t === void 0 ? void 0 : t.fees.monthly.content.map(function(fee) {
415
- var _getFeeValue, _getQuotedFeeValue;
416
- var feeValue = (_getFeeValue = getFeeValue(fee.key)) === null || _getFeeValue === void 0 ? void 0 : _getFeeValue.toFixed(2);
417
- var _getQuotedFeeValue_toFixed;
418
- var quotedFeeValue = (_getQuotedFeeValue_toFixed = (_getQuotedFeeValue = getQuotedFeeValue(fee.key)) === null || _getQuotedFeeValue === void 0 ? void 0 : _getQuotedFeeValue.toFixed(2)) !== null && _getQuotedFeeValue_toFixed !== void 0 ? _getQuotedFeeValue_toFixed : undefined;
229
+ letterSpacing: 1,
230
+ }, children: t?.fees.monthly.title }), t?.fees.monthly.content.map((fee) => {
231
+ const feeValue = getFeeValue(fee.key)?.toFixed(2);
232
+ const quotedFeeValue = getQuotedFeeValue(fee.key)?.toFixed(2) ?? undefined;
419
233
  if (feeValue === '0.00') {
420
234
  return null;
421
235
  }
422
- return /*#__PURE__*/ _jsxs(View, {
423
- style: {
236
+ return (_jsxs(View, { style: {
424
237
  justifyContent: 'space-between',
425
238
  flexDirection: 'row',
426
- rowGap: 8
427
- },
428
- children: [
429
- /*#__PURE__*/ _jsx(Text, {
430
- style: {
239
+ rowGap: 8,
240
+ }, children: [_jsx(Text, { style: {
431
241
  paddingRight: 4,
432
242
  letterSpacing: 1,
433
- color: colors.primary3
434
- },
435
- children: fee.title
436
- }),
437
- hasDiscounts ? feeValue !== quotedFeeValue ? /*#__PURE__*/ _jsxs(View, {
438
- style: {
243
+ color: colors.primary3,
244
+ }, children: fee.title }), hasDiscounts ? (feeValue !== quotedFeeValue ? (_jsxs(View, { style: {
439
245
  justifyContent: 'flex-end',
440
- flexDirection: 'row'
441
- },
442
- children: [
443
- /*#__PURE__*/ _jsx(Text, {
444
- style: {
246
+ flexDirection: 'row',
247
+ }, children: [_jsx(Text, { style: {
445
248
  color: colors.primary2,
446
249
  letterSpacing: 1,
447
250
  textDecoration: 'line-through',
448
- marginRight: 4
449
- },
450
- children: feeValue !== null ? feeValue : ''
451
- }),
452
- /*#__PURE__*/ _jsx(Text, {
453
- style: {
251
+ marginRight: 4,
252
+ }, children: feeValue !== null ? feeValue : '' }), _jsx(Text, { style: {
454
253
  color: colors.primary3,
455
- letterSpacing: 1
456
- },
457
- children: quotedFeeValue
458
- })
459
- ]
460
- }) : // When values are the same, just show the single value
461
- /*#__PURE__*/ _jsx(Text, {
462
- style: {
463
- color: colors.primary3,
464
- letterSpacing: 1
465
- },
466
- children: feeValue !== null ? feeValue : ''
467
- }) : /*#__PURE__*/ _jsx(Text, {
468
- style: {
254
+ letterSpacing: 1,
255
+ }, children: quotedFeeValue })] })) : (
256
+ // When values are the same, just show the single value
257
+ _jsx(Text, { style: {
469
258
  color: colors.primary3,
470
- letterSpacing: 1
471
- },
472
- children: feeValue !== null ? feeValue : ''
473
- })
474
- ]
475
- }, fee.key);
476
- }),
477
- quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
478
- return charge.type === 'monthly';
479
- }).map(function(charge) {
480
- return /*#__PURE__*/ _jsxs(View, {
481
- style: {
259
+ letterSpacing: 1,
260
+ }, children: feeValue !== null ? feeValue : '' }))) : (_jsx(Text, { style: { color: colors.primary3, letterSpacing: 1 }, children: feeValue !== null ? feeValue : '' }))] }, fee.key));
261
+ }), quotation.fees.extraCharges.length > 0 &&
262
+ quotation.fees.extraCharges
263
+ .filter((charge) => charge.type === 'monthly')
264
+ .map((charge) => (_jsxs(View, { style: {
482
265
  justifyContent: 'space-between',
483
266
  flexDirection: 'row',
484
- rowGap: 8
485
- },
486
- children: [
487
- /*#__PURE__*/ _jsx(Text, {
488
- style: {
267
+ rowGap: 8,
268
+ }, children: [_jsx(Text, { style: {
489
269
  paddingRight: 4,
490
270
  letterSpacing: 1,
491
- color: colors.primary3
492
- },
493
- children: charge.description
494
- }),
495
- hasDiscounts ? function() {
496
- var quotedCharge = quotedPrices.extraCharges.find(function(extraCharge) {
497
- return extraCharge.description === charge.description;
498
- });
499
- var originalAmount = charge.amount.toFixed(2);
500
- var quotedAmount = quotedCharge === null || quotedCharge === void 0 ? void 0 : quotedCharge.amount.toFixed(2);
271
+ color: colors.primary3,
272
+ }, children: charge.description }), hasDiscounts ? ((() => {
273
+ const quotedCharge = quotedPrices.extraCharges.find((extraCharge) => extraCharge.description === charge.description);
274
+ const originalAmount = charge.amount.toFixed(2);
275
+ const quotedAmount = quotedCharge?.amount.toFixed(2);
501
276
  // Only show strikethrough if amounts are different
502
- return originalAmount !== quotedAmount ? /*#__PURE__*/ _jsxs(View, {
503
- style: {
277
+ return originalAmount !== quotedAmount ? (_jsxs(View, { style: {
504
278
  justifyContent: 'flex-end',
505
- flexDirection: 'row'
506
- },
507
- children: [
508
- /*#__PURE__*/ _jsx(Text, {
509
- style: {
279
+ flexDirection: 'row',
280
+ }, children: [_jsx(Text, { style: {
510
281
  color: colors.primary2,
511
282
  letterSpacing: 1,
512
283
  textDecoration: 'line-through',
513
- marginRight: 4
514
- },
515
- children: originalAmount
516
- }),
517
- /*#__PURE__*/ _jsx(Text, {
518
- style: {
284
+ marginRight: 4,
285
+ }, children: originalAmount }), _jsx(Text, { style: {
519
286
  color: colors.primary3,
520
- letterSpacing: 1
521
- },
522
- children: quotedAmount
523
- })
524
- ]
525
- }) : // When amounts are the same, show single value
526
- /*#__PURE__*/ _jsx(Text, {
527
- style: {
287
+ letterSpacing: 1,
288
+ }, children: quotedAmount })] })) : (
289
+ // When amounts are the same, show single value
290
+ _jsx(Text, { style: {
528
291
  color: colors.primary3,
529
- letterSpacing: 1
530
- },
531
- children: originalAmount
532
- });
533
- }() : /*#__PURE__*/ _jsx(Text, {
534
- style: {
292
+ letterSpacing: 1,
293
+ }, children: originalAmount }));
294
+ })()) : (_jsx(Text, { style: {
535
295
  color: colors.primary3,
536
- letterSpacing: 1
537
- },
538
- children: charge.amount.toFixed(2)
539
- })
540
- ]
541
- }, charge.description);
542
- }),
543
- quotation.couponCode !== null && couponType === 'monthly' && /*#__PURE__*/ _jsxs(View, {
544
- style: {
296
+ letterSpacing: 1,
297
+ }, children: charge.amount.toFixed(2) }))] }, charge.description))), quotation.couponCode !== null && couponType === 'monthly' && (_jsxs(View, { style: {
545
298
  justifyContent: 'space-between',
546
299
  flexDirection: 'row',
547
- rowGap: 8
548
- },
549
- children: [
550
- /*#__PURE__*/ _jsxs(Text, {
551
- style: {
300
+ rowGap: 8,
301
+ }, children: [_jsxs(Text, { style: {
552
302
  paddingRight: 4,
553
303
  letterSpacing: 1,
554
- color: colors.primary3
555
- },
556
- children: [
557
- t === null || t === void 0 ? void 0 : t.fees.promo,
558
- " - ",
559
- quotation.couponCode
560
- ]
561
- }),
562
- /*#__PURE__*/ _jsxs(Text, {
563
- style: {
304
+ color: colors.primary3,
305
+ }, children: [t?.fees.promo, " - ", quotation.couponCode] }), _jsxs(Text, { style: {
564
306
  color: colors.success4,
565
307
  letterSpacing: 1,
566
- fontWeight: 'bold'
567
- },
568
- children: [
569
- "- ",
570
- (_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
571
- ]
572
- })
573
- ]
574
- }),
575
- /*#__PURE__*/ _jsxs(View, {
576
- style: {
308
+ fontWeight: 'bold',
309
+ }, children: ["- ", quotation.fees.discountAmount?.toFixed(2)] })] })), _jsxs(View, { style: {
577
310
  justifyContent: 'space-between',
578
311
  flexDirection: 'row',
579
- rowGap: 8
580
- },
581
- children: [
582
- /*#__PURE__*/ _jsx(Text, {
583
- style: {
312
+ rowGap: 8,
313
+ }, children: [_jsx(Text, { style: {
584
314
  color: colors.primary3,
585
315
  letterSpacing: 1,
586
- paddingRight: 4
587
- },
588
- children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
589
- }),
590
- /*#__PURE__*/ _jsx(Text, {
591
- style: {
592
- color: colors.primary3,
593
- letterSpacing: 1
594
- },
595
- children: serviceMonthlyFee.toFixed(2)
596
- })
597
- ]
598
- }),
599
- /*#__PURE__*/ _jsxs(View, {
600
- style: {
316
+ paddingRight: 4,
317
+ }, children: `${t?.serviceFee} (${taxPercentage}%)` }), _jsx(Text, { style: { color: colors.primary3, letterSpacing: 1 }, children: serviceMonthlyFee.toFixed(2) })] }), _jsxs(View, { style: {
601
318
  backgroundColor: colors.primary1,
602
- borderTop: "1px solid ".concat(colors.primary1),
319
+ borderTop: `1px solid ${colors.primary1}`,
603
320
  justifyContent: 'space-between',
604
321
  flexDirection: 'row',
605
- padding: 4
606
- },
607
- children: [
608
- /*#__PURE__*/ _jsx(Text, {
609
- style: {
322
+ padding: 4,
323
+ }, children: [_jsx(Text, { style: {
610
324
  letterSpacing: 1,
611
325
  paddingRight: 4,
612
- fontWeight: 'bold'
613
- },
614
- children: "Total"
615
- }),
616
- /*#__PURE__*/ _jsx(Text, {
617
- style: {
618
- letterSpacing: 1,
619
- fontWeight: 'bold'
620
- },
621
- children: formatMoney(totalMonthlyFee + serviceMonthlyFee)
622
- })
623
- ]
624
- })
625
- ]
626
- }),
627
- bottomContent: /*#__PURE__*/ _jsxs(View, {
628
- style: {
629
- rowGap: 16
630
- },
631
- children: [
632
- /*#__PURE__*/ _jsx(Text, {
633
- style: {
326
+ fontWeight: 'bold',
327
+ }, children: "Total" }), _jsx(Text, { style: { letterSpacing: 1, fontWeight: 'bold' }, children: formatMoney(totalMonthlyFee + serviceMonthlyFee) })] })] }), bottomContent: _jsxs(View, { style: { rowGap: 16 }, children: [_jsx(Text, { style: {
634
328
  textTransform: 'uppercase',
635
329
  fontSize: 12,
636
330
  fontWeight: 'bold',
637
- letterSpacing: 1
638
- },
639
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
640
- }),
641
- /*#__PURE__*/ _jsx(Text, {
642
- style: {
643
- color: colors.primary3,
644
- letterSpacing: 1
645
- },
646
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
647
- }),
648
- /*#__PURE__*/ _jsxs(View, {
649
- style: {
331
+ letterSpacing: 1,
332
+ }, children: t?.fees.dueToday.title }), _jsx(Text, { style: { color: colors.primary3, letterSpacing: 1 }, children: t?.fees.dueToday.description }), _jsxs(View, { style: {
650
333
  justifyContent: 'space-between',
651
- flexDirection: 'row'
652
- },
653
- children: [
654
- /*#__PURE__*/ _jsx(Text, {
655
- style: {
656
- letterSpacing: 1,
657
- color: colors.primary3
658
- },
659
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
660
- }),
661
- /*#__PURE__*/ _jsx(Text, {
662
- style: {
663
- letterSpacing: 1,
664
- color: colors.primary3
665
- },
666
- children: hasDiscounts ? quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.amountBeforeTax.toFixed(2) : quotation.fees.amountBeforeTax.toFixed(2)
667
- })
668
- ]
669
- }),
670
- /*#__PURE__*/ _jsxs(View, {
671
- style: {
334
+ flexDirection: 'row',
335
+ }, children: [_jsx(Text, { style: { letterSpacing: 1, color: colors.primary3 }, children: t?.fees.dueToday.subTotal }), _jsx(Text, { style: { letterSpacing: 1, color: colors.primary3 }, children: hasDiscounts
336
+ ? quotedPrices?.amountBeforeTax.toFixed(2)
337
+ : quotation.fees.amountBeforeTax.toFixed(2) })] }), _jsxs(View, { style: {
672
338
  justifyContent: 'space-between',
673
- flexDirection: 'row'
674
- },
675
- children: [
676
- /*#__PURE__*/ _jsx(Text, {
677
- style: {
678
- letterSpacing: 1,
679
- color: colors.primary3
680
- },
681
- children: "".concat(t === null || t === void 0 ? void 0 : t.serviceFee, " (").concat(taxPercentage, "%)")
682
- }),
683
- /*#__PURE__*/ _jsx(Text, {
684
- style: {
685
- letterSpacing: 1,
686
- color: colors.primary3
687
- },
688
- children: hasDiscounts ? quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.taxAmount.toFixed(2) : quotation.fees.taxAmount.toFixed(2)
689
- })
690
- ]
691
- }),
692
- /*#__PURE__*/ _jsxs(View, {
693
- style: {
339
+ flexDirection: 'row',
340
+ }, children: [_jsx(Text, { style: { letterSpacing: 1, color: colors.primary3 }, children: `${t?.serviceFee} (${taxPercentage}%)` }), _jsx(Text, { style: { letterSpacing: 1, color: colors.primary3 }, children: hasDiscounts
341
+ ? quotedPrices?.taxAmount.toFixed(2)
342
+ : quotation.fees.taxAmount.toFixed(2) })] }), _jsxs(View, { style: {
694
343
  backgroundColor: colors.primary1,
695
- borderTop: "1px solid ".concat(colors.primary1),
344
+ borderTop: `1px solid ${colors.primary1}`,
696
345
  justifyContent: 'space-between',
697
346
  flexDirection: 'row',
698
- padding: 4
699
- },
700
- children: [
701
- /*#__PURE__*/ _jsx(Text, {
702
- style: {
347
+ padding: 4,
348
+ }, children: [_jsx(Text, { style: {
703
349
  letterSpacing: 1,
704
350
  paddingRight: 4,
705
- fontWeight: 'bold'
706
- },
707
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
708
- }),
709
- /*#__PURE__*/ _jsx(Text, {
710
- style: {
711
- letterSpacing: 1,
712
- fontWeight: 'bold'
713
- },
714
- children: hasDiscounts ? quotedPrices === null || quotedPrices === void 0 ? void 0 : quotedPrices.amountAfterTax.toFixed(2) : quotation.fees.amountAfterTax.toFixed(2)
715
- })
716
- ]
717
- })
718
- ]
719
- })
720
- })
721
- });
351
+ fontWeight: 'bold',
352
+ }, children: t?.fees.dueToday.grandTotal }), _jsx(Text, { style: { letterSpacing: 1, fontWeight: 'bold' }, children: hasDiscounts
353
+ ? quotedPrices?.amountAfterTax.toFixed(2)
354
+ : quotation.fees.amountAfterTax.toFixed(2) })] })] }) }) }));
722
355
  };
723
356
  export default Pricing;
357
+ //# sourceMappingURL=Pricing.js.map