@driveflux/pdf 2.0.5 → 2.0.7
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/__mocks__/quotation.js +10 -11
- package/dist/__mocks__/subscription.js +381 -123
- package/dist/__mocks__/tou.js +10 -11
- package/dist/__mocks__/tou.js.map +1 -1
- package/dist/components/FluxLogo.js +62 -3
- package/dist/components/StandardPage.d.ts.map +1 -1
- package/dist/components/StandardPage.js +107 -8
- package/dist/components/StandardPage.js.map +1 -1
- package/dist/debug.js +205 -26
- package/dist/index.js +0 -1
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +145 -27
- package/dist/templates/QuotationPdf/GFV.js +49 -12
- package/dist/templates/QuotationPdf/Header.js +63 -5
- package/dist/templates/QuotationPdf/Pricing.js +573 -201
- package/dist/templates/QuotationPdf/QuotationPdfPage.js +23 -3
- package/dist/templates/QuotationPdf/SectionBoxNew.js +34 -4
- package/dist/templates/QuotationPdf/TermsSection.js +42 -5
- package/dist/templates/QuotationPdf/VehiclePhotos.js +54 -24
- package/dist/templates/QuotationPdf/index.js +189 -10
- package/dist/templates/QuotationPdf/translations.js +34 -22
- package/dist/templates/QuotationPdf/utils.js +59 -29
- package/dist/templates/SubscriptionAgreement/Confirmation.js +65 -10
- package/dist/templates/SubscriptionAgreement/CoverPage.js +93 -10
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +16 -5
- package/dist/templates/SubscriptionAgreement/Details.js +129 -51
- package/dist/templates/SubscriptionAgreement/Footer.js +48 -6
- package/dist/templates/SubscriptionAgreement/Header.js +35 -5
- package/dist/templates/SubscriptionAgreement/LabelValue.js +25 -3
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +26 -3
- package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +95 -10
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +98 -9
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/index.js +245 -15
- package/dist/templates/SubscriptionAgreement/translations.js +195 -194
- package/dist/templates/SubscriptionAgreement/types.js +1 -2
- package/dist/templates/SubscriptionAgreement/utils.d.ts +3 -0
- package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/utils.js +36 -5
- package/dist/templates/SubscriptionAgreement/utils.js.map +1 -1
- package/dist/templates/index.js +0 -1
- package/dist/theme/colors.js +44 -63
- package/dist/theme/index.js +0 -1
- package/dist/types.js +1 -2
- package/dist/utils.js +159 -16
- package/dist/watch.js +3 -4
- package/package.json +2 -2
|
@@ -3,8 +3,31 @@ import { View } from '@react-pdf/renderer';
|
|
|
3
3
|
import StandardPage from '../../components/StandardPage.js';
|
|
4
4
|
import Footer from './Footer.js';
|
|
5
5
|
import Header from './Header.js';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var SubscriptionAgreementPage = function(param) {
|
|
7
|
+
var t = param.t, userId = param.userId, subscriptionId = param.subscriptionId, children = param.children;
|
|
8
|
+
return /*#__PURE__*/ _jsxs(StandardPage, {
|
|
9
|
+
style: {
|
|
10
|
+
padding: 40,
|
|
11
|
+
fontSize: 10
|
|
12
|
+
},
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsx(Header, {
|
|
15
|
+
tTitle: t.title,
|
|
16
|
+
userId: userId,
|
|
17
|
+
subscriptionId: subscriptionId
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ _jsx(View, {
|
|
20
|
+
style: {
|
|
21
|
+
flex: 1
|
|
22
|
+
},
|
|
23
|
+
children: children
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ _jsx(Footer, {
|
|
26
|
+
tComputerGenerated: t.computerGenerated,
|
|
27
|
+
tPage: t.page,
|
|
28
|
+
tOf: t.of
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
8
32
|
};
|
|
9
33
|
export default SubscriptionAgreementPage;
|
|
10
|
-
//# sourceMappingURL=SubscriptionAgreementPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermsOfUse.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,kBAAkB,EAClB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TermsOfUse.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,kBAAkB,EAClB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,KAAK,KAAK,GAAG;IACZ,UAAU,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CAoCzB,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,16 +1,101 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
|
+
}
|
|
12
|
+
function _non_iterable_spread() {
|
|
13
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
|
+
}
|
|
15
|
+
function _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
|
+
}
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
|
+
if (!o) return;
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
21
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
|
+
}
|
|
1
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
27
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
28
|
+
import { renderMarkdown } from './utils.js';
|
|
29
|
+
var TermsOfUse = function(param) {
|
|
30
|
+
var termsOfUse = param.termsOfUse;
|
|
31
|
+
var getTerms = function(items) {
|
|
32
|
+
var indices = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
33
|
+
return items.map(function(item, i) {
|
|
34
|
+
var _item_items;
|
|
35
|
+
var currentIndices = _to_consumable_array(indices).concat([
|
|
36
|
+
i + 1
|
|
37
|
+
]);
|
|
38
|
+
var indicesString = currentIndices.join('.');
|
|
39
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
40
|
+
style: {
|
|
41
|
+
rowGap: 16
|
|
42
|
+
},
|
|
43
|
+
children: [
|
|
44
|
+
item.content && /*#__PURE__*/ _jsxs(View, {
|
|
45
|
+
style: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
columnGap: 16
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
51
|
+
style: {
|
|
52
|
+
fontWeight: 'bold'
|
|
53
|
+
},
|
|
54
|
+
children: indicesString
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
57
|
+
style: {
|
|
58
|
+
textAlign: 'justify',
|
|
59
|
+
flex: 1
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
renderMarkdown(item.content),
|
|
63
|
+
' '
|
|
64
|
+
]
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
((_item_items = item.items) === null || _item_items === void 0 ? void 0 : _item_items.length) > 0 && /*#__PURE__*/ _jsx(View, {
|
|
69
|
+
style: {
|
|
70
|
+
paddingLeft: 16,
|
|
71
|
+
rowGap: 16
|
|
72
|
+
},
|
|
73
|
+
children: getTerms(item.items, currentIndices)
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
}, indicesString);
|
|
11
77
|
});
|
|
12
78
|
};
|
|
13
|
-
return
|
|
79
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
80
|
+
style: {
|
|
81
|
+
rowGap: 16
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
85
|
+
style: {
|
|
86
|
+
fontWeight: 'bold',
|
|
87
|
+
textTransform: 'uppercase'
|
|
88
|
+
},
|
|
89
|
+
children: 'Terms of Use'
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ _jsx(View, {
|
|
92
|
+
style: {
|
|
93
|
+
rowGap: 16,
|
|
94
|
+
lineHeight: 1.4
|
|
95
|
+
},
|
|
96
|
+
children: getTerms(termsOfUse.items)
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
});
|
|
14
100
|
};
|
|
15
101
|
export default TermsOfUse;
|
|
16
|
-
//# sourceMappingURL=TermsOfUse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermsOfUse.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUse.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"TermsOfUse.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUse.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAM3C,MAAM,UAAU,GAAc,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IAChD,MAAM,QAAQ,GAAG,CAAC,KAAuB,EAAE,UAAoB,EAAE,EAAE,EAAE;QACpE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YAC5B,MAAM,cAAc,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC1C,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAE9C,OAAO,CACN,MAAC,IAAI,IAAqB,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAC7C,IAAI,CAAC,OAAO,IAAI,CAChB,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,aACnD,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAG,aAAa,GAAQ,EAC3D,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,aAC5C,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAC5B,IACD,CACP,EACA,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,IAAI,CAC1B,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,YAC1C,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,GAC/B,CACP,KAbS,aAAa,CAcjB,CACP,CAAA;QACF,CAAC,CAAC,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACN,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAC1B,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,YAC7D,cAAc,GACT,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAC1C,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,GACrB,IACD,CACP,CAAA;AACF,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermsOfUseSubSection.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TermsOfUseSubSection.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,KAAK,wBAAwB,GAC1B,MAAM,GACN;IACA,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,wBAAwB,EAAE,CAAA;CACtC,CAAA;AAEJ,KAAK,KAAK,GAAG;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,wBAAwB,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA8CnC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -1,14 +1,103 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
|
+
}
|
|
12
|
+
function _non_iterable_spread() {
|
|
13
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
|
+
}
|
|
15
|
+
function _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
|
+
}
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
|
+
if (!o) return;
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
21
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
|
+
}
|
|
1
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
27
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
28
|
import { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
29
|
+
import { renderMarkdown } from './utils.js';
|
|
30
|
+
var TermsOfUseSubSection = function(param) {
|
|
31
|
+
var indices = param.indices, subSection = param.subSection;
|
|
32
|
+
var _useMemo = useMemo(function() {
|
|
33
|
+
return {
|
|
34
|
+
indicesString: indices.reduce(function(prev, curr, i) {
|
|
35
|
+
return "".concat(prev).concat(curr).concat(i === indices.length - 1 ? '' : '.');
|
|
36
|
+
}, ''),
|
|
37
|
+
paddingLeft: Math.max(indices.length - 2, 0) * 16
|
|
38
|
+
};
|
|
39
|
+
}, [
|
|
40
|
+
indices.length,
|
|
41
|
+
indices.reduce
|
|
42
|
+
]), indicesString = _useMemo.indicesString, paddingLeft = _useMemo.paddingLeft;
|
|
43
|
+
return typeof subSection === 'string' ? /*#__PURE__*/ _jsxs(View, {
|
|
44
|
+
style: {
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
paddingLeft: paddingLeft,
|
|
47
|
+
columnGap: 16
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
51
|
+
style: {
|
|
52
|
+
fontWeight: 'bold'
|
|
53
|
+
},
|
|
54
|
+
children: indicesString
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
57
|
+
style: {
|
|
58
|
+
textAlign: 'justify',
|
|
59
|
+
flex: 1
|
|
60
|
+
},
|
|
61
|
+
children: subSection
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}, indicesString) : 'subSections' in subSection ? /*#__PURE__*/ _jsxs(View, {
|
|
65
|
+
style: {
|
|
66
|
+
gap: 16
|
|
67
|
+
},
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
70
|
+
style: {
|
|
71
|
+
flexDirection: 'row',
|
|
72
|
+
paddingLeft: paddingLeft,
|
|
73
|
+
columnGap: 16
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
77
|
+
style: {
|
|
78
|
+
fontWeight: 'bold'
|
|
79
|
+
},
|
|
80
|
+
children: indicesString
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
83
|
+
style: {
|
|
84
|
+
textAlign: 'justify',
|
|
85
|
+
flex: 1
|
|
86
|
+
},
|
|
87
|
+
children: typeof subSection === 'string' ? renderMarkdown(subSection) : renderMarkdown(subSection.paragraph)
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}, indicesString),
|
|
91
|
+
subSection.subSections.map(function(subSection, i) {
|
|
92
|
+
return /*#__PURE__*/ _jsx(TermsOfUseSubSection, {
|
|
93
|
+
indices: _to_consumable_array(indices).concat([
|
|
94
|
+
i + 1
|
|
95
|
+
]),
|
|
96
|
+
subSection: subSection
|
|
97
|
+
}, "".// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
98
|
+
concat(indices, ".").concat(i));
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}, indicesString) : null;
|
|
12
102
|
};
|
|
13
103
|
export default TermsOfUseSubSection;
|
|
14
|
-
//# sourceMappingURL=TermsOfUseSubSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermsOfUseSubSection.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TermsOfUseSubSection.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAc3C,MAAM,oBAAoB,GAAc,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;IACnE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACN,aAAa,EAAE,OAAO,CAAC,MAAM,CAC5B,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CACjB,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,EACvD,EAAE,CACF;QACD,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;KACjD,CAAC,EACF,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAChC,CAAA;IAED,OAAO,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CACvC,MAAC,IAAI,IACJ,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,aAG3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAG,aAAa,GAAQ,EAC3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAAG,UAAU,GAAQ,KAH9D,aAAa,CAIZ,CACP,CAAC,CAAC,CAAC,aAAa,IAAI,UAAU,CAAC,CAAC,CAAC,CACjC,MAAC,IAAI,IAAqB,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,aAC3C,MAAC,IAAI,IACJ,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,aAG3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAG,aAAa,GAAQ,EAC3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAC5C,OAAO,UAAU,KAAK,QAAQ;4BAC9B,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC;4BAC5B,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,GACjC,KAPF,aAAa,CAQZ,EACN,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,CAC9C,KAAC,oBAAoB,IAKpB,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,EAC5B,UAAU,EAAE,UAAU,IALjB,GAAG,OAAO,IAAI;YAClB,8DAA8D;YAC9D,CACD,EAAE,CAGD,CACF,CAAC,KArBQ,aAAa,CAsBjB,CACP,CAAC,CAAC,CAAC,IAAI,CAAA;AACT,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -1,3 +1,175 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread(target) {
|
|
44
|
+
for(var i = 1; i < arguments.length; i++){
|
|
45
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
46
|
+
var ownKeys = Object.keys(source);
|
|
47
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
48
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
49
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
ownKeys.forEach(function(key) {
|
|
53
|
+
_define_property(target, key, source[key]);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return target;
|
|
57
|
+
}
|
|
58
|
+
function ownKeys(object, enumerableOnly) {
|
|
59
|
+
var keys = Object.keys(object);
|
|
60
|
+
if (Object.getOwnPropertySymbols) {
|
|
61
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
62
|
+
if (enumerableOnly) {
|
|
63
|
+
symbols = symbols.filter(function(sym) {
|
|
64
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
keys.push.apply(keys, symbols);
|
|
68
|
+
}
|
|
69
|
+
return keys;
|
|
70
|
+
}
|
|
71
|
+
function _object_spread_props(target, source) {
|
|
72
|
+
source = source != null ? source : {};
|
|
73
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
74
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
75
|
+
} else {
|
|
76
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
77
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return target;
|
|
81
|
+
}
|
|
82
|
+
function _ts_generator(thisArg, body) {
|
|
83
|
+
var f, y, t, _ = {
|
|
84
|
+
label: 0,
|
|
85
|
+
sent: function() {
|
|
86
|
+
if (t[0] & 1) throw t[1];
|
|
87
|
+
return t[1];
|
|
88
|
+
},
|
|
89
|
+
trys: [],
|
|
90
|
+
ops: []
|
|
91
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
92
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
93
|
+
return this;
|
|
94
|
+
}), g;
|
|
95
|
+
function verb(n) {
|
|
96
|
+
return function(v) {
|
|
97
|
+
return step([
|
|
98
|
+
n,
|
|
99
|
+
v
|
|
100
|
+
]);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function step(op) {
|
|
104
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
105
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
106
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
107
|
+
if (y = 0, t) op = [
|
|
108
|
+
op[0] & 2,
|
|
109
|
+
t.value
|
|
110
|
+
];
|
|
111
|
+
switch(op[0]){
|
|
112
|
+
case 0:
|
|
113
|
+
case 1:
|
|
114
|
+
t = op;
|
|
115
|
+
break;
|
|
116
|
+
case 4:
|
|
117
|
+
_.label++;
|
|
118
|
+
return {
|
|
119
|
+
value: op[1],
|
|
120
|
+
done: false
|
|
121
|
+
};
|
|
122
|
+
case 5:
|
|
123
|
+
_.label++;
|
|
124
|
+
y = op[1];
|
|
125
|
+
op = [
|
|
126
|
+
0
|
|
127
|
+
];
|
|
128
|
+
continue;
|
|
129
|
+
case 7:
|
|
130
|
+
op = _.ops.pop();
|
|
131
|
+
_.trys.pop();
|
|
132
|
+
continue;
|
|
133
|
+
default:
|
|
134
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
135
|
+
_ = 0;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
139
|
+
_.label = op[1];
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
143
|
+
_.label = t[1];
|
|
144
|
+
t = op;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
if (t && _.label < t[2]) {
|
|
148
|
+
_.label = t[2];
|
|
149
|
+
_.ops.push(op);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
if (t[2]) _.ops.pop();
|
|
153
|
+
_.trys.pop();
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
op = body.call(thisArg, _);
|
|
157
|
+
} catch (e) {
|
|
158
|
+
op = [
|
|
159
|
+
6,
|
|
160
|
+
e
|
|
161
|
+
];
|
|
162
|
+
y = 0;
|
|
163
|
+
} finally{
|
|
164
|
+
f = t = 0;
|
|
165
|
+
}
|
|
166
|
+
if (op[0] & 5) throw op[1];
|
|
167
|
+
return {
|
|
168
|
+
value: op[0] ? op[1] : void 0,
|
|
169
|
+
done: true
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
1
173
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
174
|
import { Document } from '@react-pdf/renderer';
|
|
3
175
|
import { useMemo } from 'react';
|
|
@@ -8,26 +180,84 @@ import Details from './Details.js';
|
|
|
8
180
|
import SubscriptionAgreementPage from './SubscriptionAgreementPage.js';
|
|
9
181
|
import TermsOfUse from './TermsOfUse.js';
|
|
10
182
|
import { useTranslations } from './translations.js';
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
183
|
+
export var generateSubscriptionAgreementPdf = function(param, fileName) {
|
|
184
|
+
var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, subscription = param.subscription, termsOfUse = param.termsOfUse, signature = param.signature;
|
|
185
|
+
return _async_to_generator(function() {
|
|
186
|
+
return _ts_generator(this, function(_state) {
|
|
187
|
+
switch(_state.label){
|
|
188
|
+
case 0:
|
|
189
|
+
if (!signature) {
|
|
190
|
+
throw new Error('Signature not found');
|
|
191
|
+
}
|
|
192
|
+
return [
|
|
193
|
+
4,
|
|
194
|
+
toPdf(/*#__PURE__*/ _jsx(SubscriptionAgreement, {
|
|
195
|
+
locale: locale,
|
|
196
|
+
signature: signature,
|
|
197
|
+
subscription: subscription,
|
|
198
|
+
termsOfUse: termsOfUse
|
|
199
|
+
}), fileName)
|
|
200
|
+
];
|
|
201
|
+
case 1:
|
|
202
|
+
return [
|
|
203
|
+
2,
|
|
204
|
+
_state.sent()
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
})();
|
|
16
209
|
};
|
|
17
|
-
|
|
210
|
+
var SubscriptionAgreement = function(param) {
|
|
211
|
+
var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, signature = param.signature, subscription = param.subscription, termsOfUse = param.termsOfUse;
|
|
18
212
|
if (!signature.signedAt) {
|
|
19
|
-
throw new Error(
|
|
213
|
+
throw new Error("Missing 'signature.signedAt'");
|
|
20
214
|
}
|
|
21
|
-
|
|
22
|
-
|
|
215
|
+
var useT = useTranslations(locale);
|
|
216
|
+
var pageProps = useMemo(function() {
|
|
23
217
|
return {
|
|
24
218
|
t: useT,
|
|
25
219
|
userId: subscription.userId,
|
|
26
|
-
subscriptionId: subscription.id
|
|
220
|
+
subscriptionId: subscription.id
|
|
27
221
|
};
|
|
28
|
-
}, [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
222
|
+
}, [
|
|
223
|
+
subscription.userId,
|
|
224
|
+
subscription.id,
|
|
225
|
+
useT
|
|
226
|
+
]);
|
|
227
|
+
var payerType = subscription.payerType;
|
|
228
|
+
var t = pageProps.t;
|
|
229
|
+
return /*#__PURE__*/ _jsxs(Document, {
|
|
230
|
+
title: t.title,
|
|
231
|
+
language: locale,
|
|
232
|
+
children: [
|
|
233
|
+
/*#__PURE__*/ _jsx(SubscriptionAgreementPage, _object_spread_props(_object_spread({}, pageProps), {
|
|
234
|
+
children: /*#__PURE__*/ _jsx(CoverPage, {
|
|
235
|
+
tTitle: t.title,
|
|
236
|
+
tCover: t.cover,
|
|
237
|
+
signedAt: signature.signedAt,
|
|
238
|
+
user: subscription.user,
|
|
239
|
+
business: subscription.business,
|
|
240
|
+
payerType: payerType
|
|
241
|
+
})
|
|
242
|
+
})),
|
|
243
|
+
/*#__PURE__*/ _jsx(SubscriptionAgreementPage, _object_spread_props(_object_spread({}, pageProps), {
|
|
244
|
+
children: /*#__PURE__*/ _jsx(TermsOfUse, {
|
|
245
|
+
termsOfUse: termsOfUse
|
|
246
|
+
})
|
|
247
|
+
})),
|
|
248
|
+
/*#__PURE__*/ _jsxs(SubscriptionAgreementPage, _object_spread_props(_object_spread({}, pageProps), {
|
|
249
|
+
children: [
|
|
250
|
+
/*#__PURE__*/ _jsx(Details, {
|
|
251
|
+
tDetails: t.details,
|
|
252
|
+
subscription: subscription
|
|
253
|
+
}),
|
|
254
|
+
/*#__PURE__*/ _jsx(Confirmation, {
|
|
255
|
+
tConfirmation: t.confirmation,
|
|
256
|
+
subscription: subscription,
|
|
257
|
+
signature: signature
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
}))
|
|
261
|
+
]
|
|
262
|
+
});
|
|
32
263
|
};
|
|
33
|
-
//# sourceMappingURL=index.js.map
|