@saasquatch/mint-components 1.7.0-21 → 1.7.0-22

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/cjs/{ShadowViewAddon-fe9ec093.js → ShadowViewAddon-c22f6811.js} +3 -2
  2. package/dist/cjs/sqm-big-stat_35.cjs.entry.js +4 -4
  3. package/dist/cjs/sqm-empty_5.cjs.entry.js +1 -1
  4. package/dist/cjs/{sqm-portal-container-view-568c3323.js → sqm-portal-container-view-04d8d5fb.js} +0 -6
  5. package/dist/cjs/{sqm-portal-profile-view-fe307419.js → sqm-portal-profile-view-07e46db4.js} +1 -1
  6. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  7. package/dist/cjs/sqm-stencilbook.cjs.entry.js +3 -3
  8. package/dist/collection/components/sqm-divided-layout/sqm-divided-layout-view.js +2 -2
  9. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +0 -6
  10. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +2 -1
  11. package/dist/esm/{ShadowViewAddon-fa7da0c3.js → ShadowViewAddon-53f4aee6.js} +3 -2
  12. package/dist/esm/sqm-big-stat_35.entry.js +4 -4
  13. package/dist/esm/sqm-empty_5.entry.js +1 -1
  14. package/dist/esm/{sqm-portal-container-view-3b2ef743.js → sqm-portal-container-view-1cfa5910.js} +0 -6
  15. package/dist/esm/{sqm-portal-profile-view-3dbfa33e.js → sqm-portal-profile-view-fb195ecc.js} +1 -1
  16. package/dist/esm/sqm-portal-profile.entry.js +2 -2
  17. package/dist/esm/sqm-stencilbook.entry.js +3 -3
  18. package/dist/esm-es5/ShadowViewAddon-53f4aee6.js +1 -0
  19. package/dist/esm-es5/sqm-big-stat_35.entry.js +1 -1
  20. package/dist/esm-es5/sqm-empty_5.entry.js +1 -1
  21. package/dist/esm-es5/sqm-portal-container-view-1cfa5910.js +1 -0
  22. package/dist/esm-es5/{sqm-portal-profile-view-3dbfa33e.js → sqm-portal-profile-view-fb195ecc.js} +1 -1
  23. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  24. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  25. package/dist/mint-components/mint-components.esm.js +1 -1
  26. package/dist/mint-components/p-135c9a4d.system.js +1 -1
  27. package/dist/mint-components/{p-dad6846b.entry.js → p-2dc3d839.entry.js} +1 -1
  28. package/dist/mint-components/p-373812c5.js +1 -0
  29. package/dist/mint-components/{p-8da0d48c.js → p-3a31df86.js} +1 -1
  30. package/dist/mint-components/p-5821d265.system.entry.js +1 -0
  31. package/dist/mint-components/{p-03effc55.entry.js → p-7a31a5b5.entry.js} +1 -1
  32. package/dist/mint-components/p-901fde3d.system.entry.js +1 -0
  33. package/dist/mint-components/p-96a1aaea.system.js +1 -0
  34. package/dist/mint-components/p-bca9396b.system.js +1 -0
  35. package/dist/mint-components/{p-e3739efd.system.js → p-be701695.system.js} +1 -1
  36. package/dist/mint-components/{p-3108ca60.system.entry.js → p-d5ed0e63.system.entry.js} +1 -1
  37. package/dist/mint-components/{p-a8ce19ce.entry.js → p-d9454622.entry.js} +1 -1
  38. package/dist/mint-components/{p-12bca74a.system.entry.js → p-da4fe9fc.system.entry.js} +1 -1
  39. package/dist/mint-components/{p-e2a9fdb2.entry.js → p-e6d287e0.entry.js} +1 -1
  40. package/dist/mint-components/{p-1e83fbf7.js → p-f1ebd018.js} +2 -2
  41. package/docs/docs.docx +0 -0
  42. package/package.json +1 -1
  43. package/dist/cjs/RewardExchangeListData-d8bc23ef.js +0 -1120
  44. package/dist/cjs/sqm-reward-exchange-list.cjs.entry.js +0 -1005
  45. package/dist/cjs/sqm-share-code.cjs.entry.js +0 -104
  46. package/dist/cjs/sqm-share-link-view-213b1c2e.js +0 -23
  47. package/dist/cjs/sqm-share-link.cjs.entry.js +0 -58
  48. package/dist/esm/RewardExchangeListData-f21f3227.js +0 -1099
  49. package/dist/esm/sqm-reward-exchange-list.entry.js +0 -1001
  50. package/dist/esm/sqm-share-code.entry.js +0 -100
  51. package/dist/esm/sqm-share-link-view-4ef22db8.js +0 -21
  52. package/dist/esm/sqm-share-link.entry.js +0 -54
  53. package/dist/esm-es5/RewardExchangeListData-f21f3227.js +0 -1
  54. package/dist/esm-es5/ShadowViewAddon-fa7da0c3.js +0 -1
  55. package/dist/esm-es5/sqm-portal-container-view-3b2ef743.js +0 -1
  56. package/dist/esm-es5/sqm-reward-exchange-list.entry.js +0 -1
  57. package/dist/esm-es5/sqm-share-code.entry.js +0 -1
  58. package/dist/esm-es5/sqm-share-link-view-4ef22db8.js +0 -1
  59. package/dist/esm-es5/sqm-share-link.entry.js +0 -1
  60. package/dist/mint-components/RewardExchangeListData-d9c05a74.system.js +0 -1
  61. package/dist/mint-components/RewardExchangeListData-f21f3227.js +0 -1099
  62. package/dist/mint-components/p-00eddba2.system.js +0 -1
  63. package/dist/mint-components/p-33a20a59.js +0 -1
  64. package/dist/mint-components/p-459bb185.system.js +0 -1
  65. package/dist/mint-components/p-51c402e5.system.entry.js +0 -1
  66. package/dist/mint-components/p-b3ffe9ed.system.entry.js +0 -1
  67. package/dist/mint-components/sqm-reward-exchange-list.entry.js +0 -1001
  68. package/dist/mint-components/sqm-reward-exchange-list.system.entry.js +0 -1
  69. package/dist/mint-components/sqm-share-code.entry.js +0 -100
  70. package/dist/mint-components/sqm-share-code.system.entry.js +0 -1
  71. package/dist/mint-components/sqm-share-link-view-4ef22db8.js +0 -21
  72. package/dist/mint-components/sqm-share-link-view-c226ff41.system.js +0 -1
  73. package/dist/mint-components/sqm-share-link.entry.js +0 -54
  74. package/dist/mint-components/sqm-share-link.system.entry.js +0 -1
  75. package/dist/mint-components/sqm-stencilbook.entry.js +0 -16099
  76. package/dist/mint-components/sqm-stencilbook.system.entry.js +0 -1
@@ -1,1120 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-adc13217.js');
4
- const global = require('./global-32ac7e33.js');
5
- const JSS = require('./JSS-fd7a626a.js');
6
- const mixins = require('./mixins-67961507.js');
7
- const sqmShareLinkView = require('./sqm-share-link-view-213b1c2e.js');
8
-
9
- const LeftArrow = () => (index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
10
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
11
- const ExchangeArrows = () => (index.h("svg", { width: 19, height: 15, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5.125 14.783a.6.6 0 0 1-.851 0l-3.9-3.923a.6.6 0 1 1 .85-.846L4.1 12.905V1.52a.6.6 0 0 1 1.2 0v11.385l2.875-2.891a.6.6 0 1 1 .85.846l-3.9 3.923Zm9.6-13.686a.6.6 0 0 0-.851 0l-3.9 3.923a.6.6 0 0 0 .85.846L13.7 2.975V14.36a.6.6 0 1 0 1.2 0V2.975l2.875 2.891a.6.6 0 1 0 .85-.846l-3.9-3.923Z", fill: "#333" })));
13
- const CheckMark = () => (index.h("svg", { width: 12, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.58.23c.475.371.56 1.057.19 1.532L5.69 9.554a1.091 1.091 0 0 1-1.631.1L.32 5.915a1.09 1.09 0 1 1 1.542-1.542L4.73 7.239 10.049.42A1.09 1.09 0 0 1 11.58.23Z", fill: "#fff" })));
15
- const CheckmarkFilled = () => (index.h("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
16
- index.h("path", { d: "M0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9Z", fill: "currentColor" }),
17
- index.h("path", { d: "M5.68394 8.77046C5.28103 8.39273 4.64819 8.41315 4.27046 8.81606C3.89273 9.21897 3.91315 9.85181 4.31606 10.2295L5.68394 8.77046ZM7.66667 12L6.98273 12.7295C7.36738 13.0902 7.96595 13.0902 8.35061 12.7295L7.66667 12ZM13.6839 7.72954C14.0869 7.35181 14.1073 6.71897 13.7295 6.31606C13.3518 5.91315 12.719 5.89273 12.3161 6.27046L13.6839 7.72954ZM4.31606 10.2295L6.98273 12.7295L8.35061 11.2705L5.68394 8.77046L4.31606 10.2295ZM8.35061 12.7295L13.6839 7.72954L12.3161 6.27046L6.98273 11.2705L8.35061 12.7295Z", fill: "white" })));
18
- const Gift = () => (index.h("svg", { width: 156, height: 157, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
19
- index.h("path", { d: "M40.18 126h83.663a3 3 0 0 0 3-3V73.966a3 3 0 0 0-3-3H40.18a3 3 0 0 0-3 3V123a3 3 0 0 0 3 3Z", fill: "#FFD34F" }),
20
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M37.18 73.862v7.966h89.663v-7.966H37.18Z", fill: "#E9BB30" }),
21
- index.h("path", { d: "M133.039 74.224a2.18 2.18 0 0 0 2.187-2.172v-19.19c0-1.2-.98-2.172-2.187-2.172H31.347a2.18 2.18 0 0 0-2.187 2.172v19.19c0 1.2.98 2.172 2.187 2.172H133.04Z", fill: "#FFC000" }),
22
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M123.287 35.172c0 6.056-9.155 15.226-13.76 15.654H88.888V126H75.141V50.826H58.534c-9.462-2.038-17.803-9.258-17.803-16.944 0-7.49 3.274-13.422 9.23-15.983 5.693-2.446 12.265-1.105 17.46 2.479 6.378 4.398 9.956 12.654 13.202 20.144.284.657.567 1.308.848 1.95.274-.608.55-1.228.83-1.856 3.216-7.22 6.887-15.464 13.057-19.89 5.454-3.913 12.387-5.39 18.38-2.711 6.197 2.77 9.549 9.127 9.549 17.157Zm-23.306-8.266c3.305-2.37 7.262-2.8 10.645 0 2.946 2.44 3.103 3.588 3.482 6.351l.067.483c0 4.09-3.549 10.252-7.097 10.252-2.515 0-4.489-.022-6.34-.041-3.375-.036-6.337-.068-11.403.04.966-1.86 1.737-3.644 2.473-5.346 1.967-4.553 3.678-8.515 8.173-11.739Zm-39.034 0c-1.6-1.103-5.268-.61-6.79.043-1.257.54-3.134 2.19-3.134 6.933 0 4.61 7.511 8.59 7.511 8.59s5.962 1.52 16.607 1.52c-3.624-8.922-8.757-13.336-14.194-17.086Z", fill: "#EB5757" }),
23
- index.h("path", { d: "M75.086 74.224h13.85v7.604h-13.85v-7.604Z", fill: "#DD4747" }),
24
- index.h("g", { filter: "url(#a)" },
25
- index.h("ellipse", { cx: 82.008, cy: 141.207, rx: 36.813, ry: 5.793, fill: "#E0DDDD", "fill-opacity": 0.8 })),
26
- index.h("path", { d: "M150.446 79.134a.5.5 0 0 1 .9 0l1.133 2.336c.05.102.132.184.234.233l2.344 1.122a.5.5 0 0 1 0 .902l-2.344 1.122a.503.503 0 0 0-.234.233l-1.133 2.336a.5.5 0 0 1-.9 0l-1.134-2.336a.499.499 0 0 0-.234-.233l-2.343-1.122a.5.5 0 0 1 0-.902l2.343-1.122a.499.499 0 0 0 .234-.233l1.134-2.336Z", fill: "#FAB6B6" }),
27
- index.h("path", { d: "M14.86 29.168a.5.5 0 0 1 .9 0l1.133 2.336a.5.5 0 0 0 .234.233l2.344 1.122a.5.5 0 0 1 0 .902l-2.344 1.122a.5.5 0 0 0-.234.233l-1.133 2.336a.5.5 0 0 1-.9 0l-1.134-2.336a.5.5 0 0 0-.234-.233l-2.343-1.122a.5.5 0 0 1 0-.902l2.344-1.122a.5.5 0 0 0 .233-.233l1.134-2.336Z", fill: "#F4EFBC" }),
28
- index.h("path", { d: "m125.382 0 .712 1.466 1.475.706-1.475.707-.712 1.466-.711-1.466-1.476-.707 1.476-.706.711-1.466Z", fill: "#FDA802" }),
29
- index.h("path", { d: "m2.187 103.552.711 1.466 1.476.706-1.476.707-.711 1.466-.711-1.466L0 105.724l1.476-.706.71-1.466Z", fill: "#E4599C" }),
30
- index.h("defs", null,
31
- index.h("filter", { id: "a", x: 35.195, y: 125.414, width: 93.625, height: 31.586, filterUnits: "userSpaceOnUse", "color-interpolation-filters": "s-rGB" },
32
- index.h("feFlood", { "flood-opacity": 0, result: "BackgroundImageFix" }),
33
- index.h("feBlend", { in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
34
- index.h("feGaussianBlur", { stdDeviation: 5, result: "effect1_foregroundBlur_653_17907" })))));
35
-
36
- function Dot({ active, completed, incomplete, stage, }) {
37
- return (index.h("div", { style: {
38
- display: "flex",
39
- } },
40
- index.h("div", { style: {
41
- backgroundColor: completed
42
- ? "var(--sl-color-success-500)"
43
- : incomplete
44
- ? "var(--sl-color-neutral-200)"
45
- : "var(--sl-color-neutral-0)",
46
- border: active
47
- ? "1px solid var(--sl-color-success-500)"
48
- : incomplete
49
- ? "1px solid var(--sl-color-neutral-200)"
50
- : "1px solid var(--sl-color-success-500)",
51
- borderRadius: "50%",
52
- width: "23px",
53
- height: "23px",
54
- margin: "-11px",
55
- zIndex: "1",
56
- boxSizing: "content-box",
57
- } }, completed ? (index.h("div", { style: { top: "-10.5%", left: "23.5%", position: "relative" } },
58
- index.h(CheckMark, null))) : (index.h("div", { style: {
59
- color: active
60
- ? "var(--sl-color-success-500)"
61
- : "var(--sl-color-neutral-50)",
62
- width: "23px",
63
- lineHeight: "24px",
64
- textAlign: "center",
65
- position: "relative",
66
- } }, stage + 1)))));
67
- }
68
- function ProgressLine({ incomplete = false, active = false, invisible = false, }) {
69
- return (index.h("div", { style: {
70
- content: "''",
71
- flex: "0.5 0.5 0",
72
- height: "4px",
73
- borderRadius: "4px",
74
- background: incomplete || active
75
- ? "var(--sl-color-neutral-200)"
76
- : "var(--sl-color-success-500)",
77
- position: "relative",
78
- bottom: "0",
79
- left: "0",
80
- display: "flex",
81
- justifyContent: "center",
82
- columnGap: "50px",
83
- marginRight: "-2px",
84
- boxSizing: "content-box",
85
- opacity: invisible ? "0" : "1",
86
- } }));
87
- }
88
- function Progress({ active, completed, incomplete, stage }) {
89
- return [
90
- index.h(ProgressLine, { incomplete: incomplete, invisible: stage === 0 }),
91
- index.h(Dot, { active: active, completed: completed, incomplete: incomplete, stage: stage }),
92
- index.h(ProgressLine, { incomplete: incomplete, active: active, invisible: stage === 2 }),
93
- ];
94
- }
95
- function ProgressBar({ stageCount, currentStage, }) {
96
- return (index.h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (index.h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage, stage: stage })))));
97
- }
98
-
99
- const style = {
100
- HostBlock: mixins.HostBlock,
101
- Container: {
102
- minWidth: "300px",
103
- position: "relative",
104
- },
105
- FullImage: {
106
- objectFit: "contain",
107
- maxWidth: "100%",
108
- height: "250px",
109
- display: "flex",
110
- margin: "0 auto",
111
- },
112
- Select: {
113
- "&::part(label)": {
114
- // color: "var(--sl-color-primary-500)",
115
- },
116
- "&::part(menu)": {
117
- maxHeight: "50vh",
118
- },
119
- "& sl-menu-item::part(checked-icon)": {
120
- top: "8px",
121
- },
122
- "& sl-menu-item::part(base)": {
123
- flexDirection: "column",
124
- },
125
- "& sl-menu-item::part(base):focus": {
126
- background: "transparent",
127
- color: "var(--sl-color-gray-700)",
128
- },
129
- },
130
- ProgressBar: {
131
- maxWidth: "350px",
132
- width: "100%",
133
- margin: "auto",
134
- marginBottom: "var(--sl-spacing-xxx-large)",
135
- "& .text-area": {
136
- marginTop: "5px",
137
- display: "flex",
138
- justifyContent: "center",
139
- textAlign: "center",
140
- whiteSpace: "nowrap",
141
- marginBottom: "6px",
142
- "& .text": {
143
- marginBottom: "var(--sl-spacing-x-small)",
144
- flex: "1 1 0",
145
- },
146
- "& .text.subdued": {
147
- color: "var(--sl-color-neutral-200)",
148
- },
149
- },
150
- },
151
- CardLayout: {
152
- display: "flex",
153
- width: "100%",
154
- borderRadius: "3px",
155
- background: "rgba(0, 0, 0, 0)",
156
- },
157
- Card: {
158
- display: "flex",
159
- userSelect: "none",
160
- height: "120px",
161
- "&::part(base)": {
162
- boxShadow: "none",
163
- width: "100%",
164
- },
165
- "&::part(body)": {
166
- display: "flex",
167
- padding: 0,
168
- },
169
- "& .selected": {
170
- position: "relative",
171
- top: "-2%",
172
- left: "100%",
173
- color: "var(--sl-color-primary-500)",
174
- margin: "-9px",
175
- },
176
- },
177
- Title: {
178
- fontSize: "var(--sl-font-size-large)",
179
- fontWeight: "var(--sl-font-weight-semibold)",
180
- margin: "var(--sl-spacing-large) 0",
181
- },
182
- Image: {
183
- padding: "var(--sl-spacing-small)",
184
- minWidth: "96px",
185
- maxWidth: "96px",
186
- "& .image": {
187
- width: "100%",
188
- height: "100%",
189
- objectFit: "contain",
190
- borderRadius: "4px",
191
- },
192
- "& .image.subdued": {
193
- filter: "brightness(0.95)",
194
- opacity: "0.5",
195
- },
196
- },
197
- TextArea: {
198
- textAlign: "left",
199
- padding: "var(--sl-spacing-small)",
200
- paddingLeft: "0",
201
- "& .title": {
202
- fontSize: "var(--sl-font-size-medium)",
203
- lineHeight: "var(--sl-line-height-dense)",
204
- fontWeight: "600",
205
- color: "var(--sl-color-neutral-1000)",
206
- display: "-webkit-box",
207
- "-webkit-line-clamp": "1",
208
- "-webkit-box-orient": "vertical",
209
- overflow: "hidden",
210
- },
211
- "& .amount": {
212
- fontSize: "var(--sl-font-size-small)",
213
- lineHeight: "var(--sl-line-height-dense)",
214
- marginTop: "var(--sl-spacing-x-small)",
215
- color: "var(--sl-color-neutral-500)",
216
- display: "-webkit-box",
217
- "-webkit-line-clamp": "1",
218
- "-webkit-box-orient": "vertical",
219
- overflow: "hidden",
220
- },
221
- "& .error": {
222
- fontSize: "var(--sl-font-size-small)",
223
- lineHeight: "var(--sl-line-height-dense)",
224
- marginTop: "var(--sl-spacing-x-small)",
225
- fontWeight: "600",
226
- color: "var(--sl-color-warning-600)",
227
- display: "-webkit-box",
228
- "-webkit-line-clamp": "1",
229
- "-webkit-box-orient": "vertical",
230
- overflow: "hidden",
231
- "& .icon": {
232
- position: "relative",
233
- top: "0.1em",
234
- marginRight: "var(--sl-spacing-xx-small)",
235
- },
236
- },
237
- },
238
- ChooseAmount: {
239
- maxWidth: "800px",
240
- margin: "auto",
241
- "& .wrapper": {
242
- display: "flex",
243
- gap: "var(--sl-spacing-xx-large)",
244
- "@media (max-width: 799px)": {
245
- flexDirection: "column",
246
- },
247
- },
248
- "& .image": {
249
- width: "50%",
250
- objectFit: "contain",
251
- maxWidth: "100%",
252
- height: "250px",
253
- display: "flex",
254
- "@media (max-width: 799px)": {
255
- width: "auto",
256
- },
257
- },
258
- "& .text": {
259
- width: "50%",
260
- maxWidth: "400px",
261
- // minWidth: "330px",
262
- "@media (max-width: 799px)": {
263
- width: "auto",
264
- margin: "auto",
265
- },
266
- },
267
- "& .title": {
268
- fontSize: "var(--sl-font-size-large)",
269
- fontWeight: "var(--sl-font-weight-semibold)",
270
- color: "var(--sl-color-neutral-1000)",
271
- },
272
- "& .points": {
273
- fontSize: "var(--sl-font-size-large)",
274
- fontWeight: "var(--sl-font-weight-semibold)",
275
- color: "var(--sl-color-primary-500)",
276
- },
277
- "& .description": {
278
- fontSize: "var(--sl-font-size-medium)",
279
- fontWeight: "var(--sl-font-weight-normal)",
280
- color: "var(--sl-color-neutral-500)",
281
- margin: "var(--sl-spacing-medium) 0",
282
- lineHeight: "var(--sl-line-height-dense)",
283
- marginTop: "var(--sl-spacing-xx-small)",
284
- },
285
- "& .space": {
286
- marginBottom: "var(--sl-spacing-xxx-large)",
287
- },
288
- "& sl-menu-item[disabled]::part(label)": {
289
- color: "var(--sl-color-neutral-300)",
290
- },
291
- "& sl-menu-item[disabled]": {
292
- "& .step-cost": {
293
- color: "var(--sl-color-neutral-300)",
294
- },
295
- "& .step-value": {
296
- color: "var(--sl-color-neutral-300)",
297
- },
298
- },
299
- },
300
- SelectItem: {
301
- display: "flex",
302
- flexDirection: "column",
303
- "&::part(label)": {
304
- color: "var(--sl-color-neutral-900)",
305
- margin: "0",
306
- },
307
- "& .step-cost": {
308
- color: "var(--sl-color-neutral-500)",
309
- marginBottom: "var(--sl-spacing-x-small)",
310
- },
311
- "& .step-unavailable": {
312
- fontSize: "var(--sl-font-size-small)",
313
- color: "var(--sl-color-warning-500)",
314
- margin: "0",
315
- },
316
- },
317
- Success: {
318
- textAlign: "center",
319
- "& .title": {
320
- fontSize: "var(--sl-font-size-large)",
321
- fontWeight: "var(--sl-font-weight-semibold)",
322
- color: "var(--sl-color-neutral-1000)",
323
- },
324
- "& .description": {
325
- color: "var(--sl-color-neutral-400)",
326
- maxWidth: "350px",
327
- margin: "0 auto",
328
- lineHeight: "var(--sl-line-height-dense)",
329
- marginBottom: "var(--sl-spacing-xx-large)",
330
- marginTop: "var(--sl-spacing-xx-small)",
331
- },
332
- "& .promo": {
333
- maxWidth: "350px",
334
- margin: "-30px auto var(--sl-spacing-xxx-large) auto",
335
- textAlign: "left",
336
- color: "var(--sl-color-neutral-700)",
337
- },
338
- },
339
- Grid: {
340
- display: "grid",
341
- justifyContent: "center",
342
- gap: "20px",
343
- gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
344
- },
345
- Confirmation: {
346
- maxWidth: "800px",
347
- margin: "auto",
348
- "& .wrapper": {
349
- display: "flex",
350
- "@media (max-width: 499px)": {
351
- flexDirection: "column",
352
- },
353
- },
354
- "& .reward-item-container": {
355
- "@media (max-width: 499px)": {
356
- display: "flex",
357
- flexDirection: "row-reverse",
358
- justifyContent: "flex-end",
359
- alignItems: "center",
360
- },
361
- },
362
- "& .reward-item-container .reward-title": {
363
- paddingBottom: "var(--sl-spacing-medium)",
364
- lineHeight: "20px",
365
- "@media (max-width: 499px)": {
366
- paddingBottom: "none",
367
- paddingLeft: "var(--sl-spacing-small)",
368
- },
369
- },
370
- "& .padding": {
371
- padding: "var(--sl-spacing-medium) 0",
372
- "@media (max-width: 499px)": {
373
- padding: "var(--sl-spacing-small) 0",
374
- },
375
- },
376
- "& .field": {
377
- width: "30%",
378
- textTransform: "uppercase",
379
- fontSize: "var(--sl-font-size-medium)",
380
- fontWeight: "var(--sl-font-weight-normal)",
381
- color: "var(--sl-color-neutral-400)",
382
- textAlign: "left",
383
- paddingRight: "var(--sl-spacing-xxx-large)",
384
- "@media (max-width: 499px)": {
385
- width: "100%",
386
- paddingRight: "0",
387
- paddingBottom: "0",
388
- },
389
- },
390
- "& .value": {
391
- fontSize: "var(--sl-font-size-large)",
392
- fontWeight: "var(--sl-font-weight-semibold)",
393
- },
394
- "& .top-border": {
395
- borderTop: "1px solid var(--sl-color-neutral-200)",
396
- },
397
- "& .image": {
398
- width: "200px",
399
- "@media (max-width: 499px)": {
400
- width: "100px",
401
- },
402
- },
403
- },
404
- Button: {
405
- display: "flex",
406
- flexWrap: "wrap-reverse",
407
- margin: "var(--sl-spacing-medium) 0",
408
- "& .cancel": {
409
- marginLeft: "auto",
410
- marginRight: "var(--sl-spacing-medium)",
411
- "&::part(base)": {
412
- fontWeight: "var(--sl-font-weight-normal)",
413
- color: "var(--sl-color-neutral-1000)",
414
- },
415
- "@media (max-width: 499px)": {
416
- width: "100%",
417
- marginRight: "0",
418
- marginTop: "var(--sl-spacing-small)",
419
- },
420
- },
421
- "& .continue": {
422
- "&::part(base)": {
423
- background: "var(--sl-color-primary-500)",
424
- borderColor: "var(--sl-color-primary-500)",
425
- fontWeight: "var(--sl-font-weight-normal)",
426
- color: "var(--sl-color-neutral-0)",
427
- },
428
- "@media (max-width: 499px)": {
429
- width: "100%",
430
- },
431
- },
432
- "& .continue.right": {
433
- marginLeft: "auto",
434
- },
435
- "& .continue.center": {
436
- margin: "0 auto",
437
- },
438
- },
439
- Confetti: {
440
- pointerEvents: "none",
441
- position: "absolute",
442
- width: "100%",
443
- height: "100%",
444
- top: "0%",
445
- left: "0%",
446
- zIndex: "1",
447
- },
448
- };
449
- // JSS config
450
- const sheet = JSS.createStyleSheet(style);
451
- const styleString = sheet.toString();
452
- const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
453
- function RewardExchangeView(props) {
454
- const { states, data, callbacks, refs } = props;
455
- const { selectedItem, selectedStep } = states;
456
- const stageProgressList = {
457
- chooseReward: states.content.text.chooseRewardTitle,
458
- chooseAmount: states.content.text.chooseAmountTitle,
459
- confirmation: states.content.text.confirmationTitle,
460
- };
461
- function getInput() {
462
- var _a, _b, _c;
463
- const item = states.selectedItem;
464
- if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
465
- return index.h("span", { class: "points" }, item === null || item === void 0 ? void 0 : item.prettySourceValue);
466
- if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
467
- return (index.h("p", null, global.intl.formatMessage({
468
- id: "notEnoughError",
469
- defaultMessage: states.content.text.notEnoughError,
470
- }, {
471
- sourceUnit: item.sourceUnit,
472
- })));
473
- }
474
- return (index.h("sl-select", { style: { width: "auto" }, label: (_b = states === null || states === void 0 ? void 0 : states.content) === null || _b === void 0 ? void 0 : _b.text.selectText, class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
475
- var _a, _b, _c, _d, _e;
476
- return callbacks.setExchangeState({
477
- amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
478
- selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
479
- });
480
- } }, (_c = item.steps) === null || _c === void 0 ? void 0 : _c.map((step) => {
481
- var _a, _b;
482
- return (index.h("sl-menu-item", { value: step, disabled: !step.available, class: sheet.classes.SelectItem },
483
- step.prettyDestinationValue,
484
- index.h("br", null),
485
- index.h("div", { class: "step-cost", slot: "suffix" },
486
- step.prettySourceValue,
487
- step.unavailableReasonCode && (index.h("p", { class: "step-unavailable" }, global.intl.formatMessage({
488
- id: "unavailableCode",
489
- defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
490
- }, {
491
- unavailableReasonCode: step.unavailableReasonCode,
492
- sourceUnit: item.sourceUnit,
493
- sourceValue: step.prettySourceValue || item.prettySourceMinValue,
494
- }))))));
495
- })));
496
- }
497
- function chooseReward() {
498
- var _a;
499
- return [
500
- index.h("div", null,
501
- index.h("div", { class: sheet.classes.Title }, states.content.text.rewardTitle),
502
- states.loading || states.queryError ? (loading()) : (index.h("div", { class: sheet.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
503
- var _a, _b, _c, _d, _e;
504
- const style = {
505
- boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
506
- ? "0 0 0 2px var(--sl-color-primary-500)"
507
- : "none",
508
- borderRadius: "4px",
509
- };
510
- return (index.h("div", { key: item.key, style: style },
511
- index.h("sl-card", { class: sheet.classes.Card, style: {
512
- cursor: item.unavailableReasonCode
513
- ? "not-allowed"
514
- : "pointer",
515
- }, onClick: () => item.available &&
516
- callbacks.setExchangeState({ selectedItem: item }) },
517
- item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (index.h("div", { class: "selected" },
518
- index.h(CheckmarkFilled, null))),
519
- index.h("div", { style: {
520
- display: "flex",
521
- width: "100%",
522
- height: "120px",
523
- borderRadius: "3px",
524
- background: item.unavailableReasonCode
525
- ? "rgba(0, 0, 0, 0.05)"
526
- : "rgba(0, 0, 0, 0)",
527
- } },
528
- index.h("div", { class: sheet.classes.Image, style: {
529
- opacity: item.unavailableReasonCode ? "0.5" : "1",
530
- } },
531
- index.h("img", { class: item.unavailableReasonCode
532
- ? "image subdued"
533
- : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
534
- index.getAssetPath("./assets/Reward-image.png") })),
535
- index.h("div", { class: sheet.classes.TextArea, style: {
536
- opacity: item.unavailableReasonCode ? "0.5" : "1",
537
- } },
538
- index.h("div", { class: "title", style: {
539
- "-webkit-line-clamp": item.unavailableReasonCode
540
- ? "1"
541
- : "2",
542
- } }, (_a = item.name) !== null && _a !== void 0 ? _a : ""),
543
- index.h("div", { class: "amount", style: {
544
- "-webkit-line-clamp": item.unavailableReasonCode
545
- ? "1"
546
- : "2",
547
- } }, global.intl.formatMessage({
548
- id: "sourceAmountMessage",
549
- defaultMessage: (_c = (_b = states.content) === null || _b === void 0 ? void 0 : _b.text) === null || _c === void 0 ? void 0 : _c.sourceAmountMessage,
550
- }, {
551
- ruleType: item.ruleType,
552
- sourceValue: item.prettySourceValue,
553
- sourceMinValue: item.prettySourceMinValue,
554
- sourceMaxValue: item.prettySourceMaxValue,
555
- })),
556
- item.unavailableReasonCode && (index.h("div", { class: "error" },
557
- index.h("sl-icon", { class: "icon", name: "exclamation-triangle-fill" }),
558
- global.intl.formatMessage({
559
- id: "unavailableCode",
560
- defaultMessage: (_e = (_d = states.content) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.notAvailableError,
561
- }, {
562
- unavailableReasonCode: item.unavailableReasonCode,
563
- sourceUnit: item.sourceUnit,
564
- sourceValue: item.prettySourceValue ||
565
- item.prettySourceMinValue,
566
- }))))))));
567
- }))),
568
- index.h("div", { class: sheet.classes.Button },
569
- index.h("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText))),
570
- ];
571
- }
572
- function chooseAmount() {
573
- var _a, _b, _c, _d;
574
- const input = getInput();
575
- const isDisabled = ((_a = states.selectedItem) === null || _a === void 0 ? void 0 : _a.ruleType) === "FIXED_GLOBAL_REWARD"
576
- ? false
577
- : input && !states.amount;
578
- return (index.h("div", null,
579
- index.h("div", { class: sheet.classes.ChooseAmount },
580
- index.h("div", { class: "wrapper" },
581
- index.h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
582
- index.getAssetPath("./assets/Reward-image.png") }),
583
- index.h("div", { class: "text" },
584
- index.h("div", { class: "title" }, (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : ""),
585
- ((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (index.h("div", { class: "points" }, input)) : (index.h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
586
- ((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (index.h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (index.h("div", null, input)),
587
- index.h("div", { class: "space" }))),
588
- index.h("div", { class: sheet.classes.Button },
589
- index.h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
590
- index.h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText)))));
591
- }
592
- function confirmation() {
593
- const cost = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue) || selectedItem.prettySourceValue;
594
- const amount = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue;
595
- return (index.h("div", null,
596
- index.h("div", { class: sheet.classes.Confirmation },
597
- index.h("div", { class: sheet.classes.Title }, states.content.text.redeemTitle),
598
- index.h("div", { class: "wrapper" },
599
- index.h("div", { class: "field" }, states.content.text.rewardNameTitle),
600
- index.h("div", { class: "reward-item-container" },
601
- index.h("div", { class: "reward-title" }, selectedItem.name),
602
- index.h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
603
- index.getAssetPath("./assets/Reward-image.png") }))),
604
- index.h("div", { class: "wrapper padding" },
605
- index.h("div", { class: "field" })),
606
- amount && (index.h("div", { class: "wrapper top-border padding" },
607
- index.h("div", { class: "field" }, states.content.text.rewardAmountTitle),
608
- index.h("div", null, amount))),
609
- index.h("div", { class: "wrapper top-border padding" },
610
- index.h("div", { class: "field" }, states.content.text.costTitle),
611
- index.h("div", { class: "value" }, cost)),
612
- index.h("div", { class: sheet.classes.Button },
613
- index.h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
614
- index.h("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText)))));
615
- }
616
- function success() {
617
- var _a, _b, _c, _d, _e, _f;
618
- return (index.h("div", { class: sheet.classes.Success },
619
- index.h(Gift, null),
620
- index.h(Confetti, null),
621
- index.h("div", { class: "title" }, (_a = states.content.text) === null || _a === void 0 ? void 0 : _a.rewardRedeemedText),
622
- index.h("div", { class: "description" }, global.intl.formatMessage({
623
- id: "successMessage",
624
- defaultMessage: states.content.text.redemptionSuccessText,
625
- }, {
626
- sourceValue: (_b = states.selectedItem.prettySourceValue) !== null && _b !== void 0 ? _b : (_c = states.selectedStep) === null || _c === void 0 ? void 0 : _c.prettySourceValue,
627
- destinationValue: ((_d = states.selectedStep) === null || _d === void 0 ? void 0 : _d.prettyDestinationValue) || ((_e = states.selectedItem) === null || _e === void 0 ? void 0 : _e.name) ||
628
- states.selectedItem.globalRewardKey,
629
- })),
630
- (data === null || data === void 0 ? void 0 : data.fuelTankCode) && (index.h("div", { class: "promo" },
631
- states.content.text.promoCode,
632
- index.h(sqmShareLinkView.ShareLinkView, { shareString: data.fuelTankCode, tooltiptext: (_f = states === null || states === void 0 ? void 0 : states.content) === null || _f === void 0 ? void 0 : _f.text.tooltipText, open: states.open, onClick: callbacks.copyFuelTankCode }))),
633
- index.h("div", { class: sheet.classes.Button },
634
- index.h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
635
- }
636
- const stages = {
637
- chooseReward: () => chooseReward(),
638
- chooseAmount: () => chooseAmount(),
639
- confirmation: () => confirmation(),
640
- success: () => success(),
641
- };
642
- const currentStage = stages[states.redeemStage];
643
- function stageMap() {
644
- const stageNumber = stageList.indexOf(states.redeemStage);
645
- return (index.h("div", { class: sheet.classes.ProgressBar },
646
- index.h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
647
- if (stageList.indexOf(stage) <= stageNumber) {
648
- return index.h("span", { class: "text" }, stageProgressList[stage]);
649
- }
650
- else {
651
- return (index.h("span", { class: "text subdued" }, stageProgressList[stage]));
652
- }
653
- })),
654
- index.h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
655
- }
656
- function loading() {
657
- return (index.h("div", { class: sheet.classes.Grid }, [...Array(states.content.text.skeletonCardNum)].map(() => {
658
- return (index.h("div", null,
659
- index.h("sl-card", { class: sheet.classes.Card },
660
- index.h("div", { class: sheet.classes.CardLayout },
661
- index.h("div", null,
662
- index.h("sl-skeleton", { style: {
663
- width: "100px",
664
- height: "100px",
665
- margin: "9px",
666
- "--border-radius": "4px",
667
- } })),
668
- index.h("div", { style: {
669
- margin: "var(--sl-spacing-small) var(--sl-spacing-small) 0 0",
670
- width: "100%",
671
- } },
672
- index.h("sl-skeleton", { style: { marginBottom: "var(--sl-spacing-small)" } }),
673
- index.h("sl-skeleton", { style: { marginBottom: "var(--sl-spacing-small)" } }),
674
- index.h("sl-skeleton", { style: { width: "45%" } }))))));
675
- })));
676
- }
677
- function errorMessage() {
678
- return (index.h("sl-alert", { type: "danger", open: true },
679
- index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
680
- states.content.text.redemptionError));
681
- }
682
- function queryErrorMessage() {
683
- return (index.h("sl-alert", { type: "danger", open: true },
684
- index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
685
- states.content.text.queryError));
686
- }
687
- function Confetti() {
688
- return (index.h("canvas", { ref: (canvas) => {
689
- if (!(refs === null || refs === void 0 ? void 0 : refs.canvasRef))
690
- return;
691
- refs.canvasRef.current = canvas;
692
- }, id: "my-canvas", class: sheet.classes.Confetti }));
693
- }
694
- if (states.noExchangeOptions)
695
- return states.content.text.empty;
696
- return (index.h("div", { class: sheet.classes.Container },
697
- index.h("style", { type: "text/css" }, styleString),
698
- index.h("div", null,
699
- stageMap(),
700
- states.exchangeError && errorMessage(),
701
- states.queryError && !states.exchangeError && queryErrorMessage(),
702
- currentStage && currentStage(),
703
- states.redeemStage === "success")));
704
- }
705
-
706
- const baseResponse = (data, stage = "chooseReward", selectedItem = null, selectedStep = null, exchangeError = false, loading = false, fueltank = null, noExchangeOptions = false, queryError = false) => ({
707
- states: {
708
- content: {
709
- text: {
710
- notAvailableError: "{unavailableReasonCode, select, NOT_CHAMPION {CUSTOM ERROR MESSAGE } US_TAX {Exceeds tax limit for this year} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {unavailableReasonCode} }",
711
- chooseRewardTitle: "Rewards",
712
- chooseAmountTitle: "Select",
713
- confirmationTitle: "Confirm",
714
- rewardTitle: "Choose a reward",
715
- cancelText: "Cancel",
716
- backText: "Back",
717
- continueText: "Continue",
718
- continueToConfirmationText: "Continue to confirmation",
719
- redeemText: "Redeem",
720
- redeemTitle: "Confirm and redeem",
721
- redemptionSuccessText: "Redeemed {sourceValue} for {destinationValue}",
722
- doneText: "Done",
723
- tooltipText: "Copied!",
724
- selectText: "Select amount to receive",
725
- sourceAmountMessage: "{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",
726
- rewardRedeemedText: "Reward redeemed",
727
- redemptionError: "An error occured trying to redeem this reward. Please try again",
728
- queryError: "Unable to load reward exchange list. Please try again",
729
- promoCode: "Promo code",
730
- skeletonCardNum: 8,
731
- rewardNameTitle: "Reward Name",
732
- rewardAmountTitle: "Reward Amount",
733
- costTitle: "Cost",
734
- notEnoughError: "Sorry not enough!",
735
- empty: (index.h("sqm-empty", { emptyStateImage: "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png", emptyStateHeader: "Redeem rewards", emptyStateText: "Use your points to redeem rewards once they become available" })),
736
- },
737
- },
738
- queryError: queryError,
739
- redeemStage: stage,
740
- amount: 0,
741
- exchangeError: exchangeError,
742
- loading: loading,
743
- selectedItem: selectedItem,
744
- selectedStep: selectedStep,
745
- noExchangeOptions: noExchangeOptions,
746
- open: false,
747
- },
748
- data: {
749
- exchangeList: data,
750
- fuelTankCode: fueltank,
751
- },
752
- callbacks: {
753
- exchangeReward: null,
754
- resetState: null,
755
- setStage: null,
756
- setExchangeState: null,
757
- copyFuelTankCode: null,
758
- refs: null,
759
- },
760
- refs: null,
761
- });
762
- const baseReward = {
763
- key: "",
764
- name: "",
765
- description: "Description of reward. Lorem ipsum dolor sit amet, consectetur adipiscing. Id nec semper sapien dignissim rhoncus nunc.",
766
- imageUrl: "",
767
- available: true,
768
- unavailableReasonCode: null,
769
- ruleType: "FIXED_GLOBAL_REWARD",
770
- sourceUnit: "POINT",
771
- sourceValue: 10,
772
- prettySourceValue: "10 SaaSquatch Points",
773
- sourceMinValue: null,
774
- prettySourceMinValue: null,
775
- sourceMaxValue: null,
776
- prettySourceMaxValue: null,
777
- destinationMinValue: null,
778
- prettyDestinationMinValue: null,
779
- destinationMaxValue: null,
780
- prettyDestinationMaxValue: null,
781
- globalRewardKey: "",
782
- destinationUnit: null,
783
- steps: [],
784
- };
785
- const notEnoughPoints = {
786
- available: false,
787
- unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
788
- };
789
- const usTax = {
790
- available: false,
791
- unavailableReasonCode: "US_TAX",
792
- };
793
- const customError = {
794
- available: false,
795
- unavailableReasonCode: "NOT_CHAMPION",
796
- };
797
- const selected = {
798
- key: "r1",
799
- };
800
- const imageUrl = (props) => ({
801
- imageUrl: props,
802
- });
803
- const name = (props) => ({
804
- name: props,
805
- });
806
- const description = (props) => ({
807
- description: props,
808
- });
809
- const fixedValue = (props) => ({
810
- prettySourceValue: props,
811
- });
812
- const variableValue = (min, max, unit) => ({
813
- ruleType: "VARIABLE_CREDIT_REWARD",
814
- sourceMinValue: min,
815
- prettySourceMinValue: min + " " + unit,
816
- sourceMaxValue: max,
817
- prettySourceMaxValue: max + " " + unit,
818
- });
819
- const demoData = [
820
- {
821
- ...baseReward,
822
- ...name("Free swag with a promo code"),
823
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
824
- ...fixedValue("40 Points"),
825
- },
826
- {
827
- ...baseReward,
828
- ...selected,
829
- ...name("Visa® Prepaid Card USD"),
830
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
831
- ...variableValue(20, 80, "Points"),
832
- },
833
- {
834
- ...baseReward,
835
- ...name("$50 Store credit"),
836
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png"),
837
- ...fixedValue("100 Points"),
838
- },
839
- {
840
- ...baseReward,
841
- ...name("Variable amount of store credit"),
842
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000240/squatch-assets/Jn2fE0s.png"),
843
- ...variableValue(20, 100, "Points"),
844
- },
845
- ];
846
- const data = [
847
- {
848
- ...baseReward,
849
- ...name("Free swag with a promo code"),
850
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
851
- ...fixedValue("40 SaaSquatch Points"),
852
- },
853
- {
854
- ...baseReward,
855
- ...selected,
856
- ...name("Visa® Prepaid Card USD"),
857
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
858
- ...variableValue(20, 80, "Points"),
859
- },
860
- {
861
- ...baseReward,
862
- ...name("A very exclusive gift box"),
863
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/93BvEgH.png"),
864
- ...fixedValue("30 SaaSquatch Points"),
865
- },
866
- {
867
- ...baseReward,
868
- ...name("$50 Store credit"),
869
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png"),
870
- ...fixedValue("100 SaaSquatch Points"),
871
- },
872
- {
873
- ...baseReward,
874
- ...name("Variable amount of store credit"),
875
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000240/squatch-assets/Jn2fE0s.png"),
876
- ...variableValue(20, 100, "Points"),
877
- },
878
- {
879
- ...baseReward,
880
- ...notEnoughPoints,
881
- ...name("A very rare cactus"),
882
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000224/squatch-assets/hhlF2Ey.png"),
883
- ...fixedValue("2000 SaaSquatch Points"),
884
- },
885
- {
886
- ...baseReward,
887
- ...usTax,
888
- ...name("$1000 Store credit with a really super long name in the front page"),
889
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000273/squatch-assets/y9HSls1.png"),
890
- ...fixedValue("2000 SaaSquatch Long Points"),
891
- },
892
- {
893
- ...baseReward,
894
- ...notEnoughPoints,
895
- ...name("A holiday gift box"),
896
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/dWEdB3p.png"),
897
- ...fixedValue("100 SaaSquatch Points"),
898
- },
899
- ];
900
- const rewardExchange = {
901
- ...baseResponse(data),
902
- };
903
- const demoRewardExchange = {
904
- ...baseResponse(demoData),
905
- };
906
- const rewardExchangeLongText = {
907
- ...baseResponse([
908
- {
909
- ...baseReward,
910
- ...notEnoughPoints,
911
- ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
912
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/dWEdB3p.png"),
913
- ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
914
- },
915
- {
916
- ...baseReward,
917
- ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
918
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000273/squatch-assets/y9HSls1.png"),
919
- ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
920
- },
921
- {
922
- ...baseReward,
923
- ...name("Suuuuuuuuper aweeeeesssssoooommme reward!!!!!!"),
924
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png"),
925
- ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
926
- },
927
- ...data,
928
- ]),
929
- };
930
- const rewardExchangeCustomErrorMsg = {
931
- ...baseResponse([
932
- {
933
- ...baseReward,
934
- ...customError,
935
- ...name("A very rare cactus"),
936
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000224/squatch-assets/hhlF2Ey.png"),
937
- ...fixedValue("2000 SaaSquatch Points"),
938
- },
939
- ...data,
940
- ]),
941
- };
942
- const rewardExchangeSelected = {
943
- ...baseResponse(data, "chooseReward", {
944
- ...baseReward,
945
- ...selected,
946
- ...name("Visa® Prepaid Card USD"),
947
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
948
- ...variableValue(20, 80, "Points"),
949
- }),
950
- };
951
- const stepsData = (start, end, inc) => {
952
- const steps = [];
953
- for (let i = start; i <= end; i += inc) {
954
- steps.push({
955
- sourceValue: i,
956
- prettySourceValue: i + " SaaSquatch Points",
957
- destinationValue: i,
958
- prettyDestinationValue: "$" + i,
959
- available: true,
960
- unavailableReasonCode: null,
961
- });
962
- }
963
- return steps;
964
- };
965
- const baseStep = (dst, dstUnit, src, srcUnit, available = true, unavailableReason = null) => ({
966
- destinationValue: dst,
967
- prettyDestinationValue: dstUnit + dst,
968
- sourceValue: src,
969
- prettySourceValue: src + " " + srcUnit,
970
- available: available,
971
- unavailableReasonCode: unavailableReason,
972
- });
973
- const chooseAmountVariable = {
974
- ...baseResponse(data, "chooseAmount", {
975
- ...baseReward,
976
- ...name("Visa® Prepaid Card USD"),
977
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
978
- ...variableValue(20, 80, "Points"),
979
- steps: [
980
- baseStep(20, "$", 40, "Points"),
981
- baseStep(30, "$", 60, "Points"),
982
- baseStep(40, "$", 80, "Points"),
983
- baseStep(50, "$", 100, "Points"),
984
- baseStep(60, "$", 120, "Points"),
985
- ],
986
- }),
987
- };
988
- const chooseAmountVariableNoDescription = {
989
- ...baseResponse(data, "chooseAmount", {
990
- ...baseReward,
991
- ...name("Visa® Prepaid Card USD"),
992
- ...description(""),
993
- ...imageUrl("https://i.imgur.com/veHErQX.png"),
994
- ...variableValue(20, 80, "Points"),
995
- steps: [
996
- baseStep(20, "$", 40, "Points"),
997
- baseStep(30, "$", 60, "Points"),
998
- baseStep(40, "$", 80, "Points"),
999
- baseStep(50, "$", 100, "Points"),
1000
- baseStep(60, "$", 120, "Points"),
1001
- ],
1002
- }),
1003
- };
1004
- const chooseAmountVariableDisabled = {
1005
- ...baseResponse(data, "chooseAmount", {
1006
- ...baseReward,
1007
- ...name("Visa® Prepaid Card USD"),
1008
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1009
- ...variableValue(20, 80, "Points"),
1010
- steps: [
1011
- baseStep(20, "$", 40, "Points"),
1012
- baseStep(30, "$", 60, "Points"),
1013
- baseStep(40, "$", 80, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
1014
- baseStep(50, "$", 100, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
1015
- baseStep(60, "$", 120, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
1016
- ],
1017
- }),
1018
- };
1019
- const chooseAmountVariableUnavailable = {
1020
- ...baseResponse(data, "chooseAmount", {
1021
- ...baseReward,
1022
- ...name("Visa® Prepaid Card USD"),
1023
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1024
- ...variableValue(20, 80, "Points"),
1025
- steps: [
1026
- baseStep(20, "$", 40, "Points"),
1027
- baseStep(30, "$", 60, "Points"),
1028
- baseStep(40, "$", 80, "Points", false, "US_TAX"),
1029
- baseStep(50, "$", 100, "Points", false, "US_TAX"),
1030
- baseStep(60, "$", 120, "Points", false, "US_TAX"),
1031
- ],
1032
- }),
1033
- };
1034
- const chooseAmountFixed = {
1035
- ...baseResponse(data, "chooseAmount", {
1036
- ...baseReward,
1037
- ...name("Free swag with a promo code"),
1038
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png"),
1039
- ...fixedValue("40 SaaSquatch Points"),
1040
- }),
1041
- };
1042
- const chooseAmountFixedNoDescription = {
1043
- ...baseResponse(data, "chooseAmount", {
1044
- ...baseReward,
1045
- ...description(""),
1046
- ...name("Free swag with a promo code"),
1047
- ...imageUrl("https://i.imgur.com/n7vC4BR.png"),
1048
- ...fixedValue("40 SaaSquatch Points"),
1049
- }),
1050
- };
1051
- const confirmFixed = {
1052
- ...baseResponse(data, "confirmation", {
1053
- ...baseReward,
1054
- ...name("Free swag with a promo code"),
1055
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png"),
1056
- ...fixedValue("40 SaaSquatch Points"),
1057
- }),
1058
- };
1059
- const confirmVariable = {
1060
- ...baseResponse(data, "confirmation", {
1061
- ...baseReward,
1062
- ...name("Visa® Prepaid Card USD"),
1063
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1064
- ...variableValue(20, 80, "Points"),
1065
- }, baseStep(20, "$", 40, "Points")),
1066
- };
1067
- const redemptionError = {
1068
- ...baseResponse(data, "confirmation", {
1069
- ...baseReward,
1070
- ...name("Visa® Prepaid Card USD"),
1071
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1072
- ...variableValue(20, 80, "Points"),
1073
- }, baseStep(20, "$", 40, "Points"), true),
1074
- };
1075
- const queryError = {
1076
- ...baseResponse(undefined, "chooseReward", undefined, undefined, undefined, undefined, undefined, undefined, true),
1077
- };
1078
- const success = {
1079
- ...baseResponse(data, "success", {
1080
- ...baseReward,
1081
- ...name("Free swag with a promo code"),
1082
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png"),
1083
- ...fixedValue("40 SaaSquatch Points"),
1084
- }, undefined, undefined, undefined, "4ah2-hh46-gk7r"),
1085
- };
1086
- const successVariable = {
1087
- ...baseResponse(data, "success", {
1088
- ...baseReward,
1089
- ...name("Visa® Prepaid Card USD"),
1090
- ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/93BvEgH.png"),
1091
- ...variableValue(20, 80, "Points"),
1092
- }, baseStep(20, "$", 40, "Points")),
1093
- };
1094
- const loading = {
1095
- ...baseResponse(null, "chooseReward", null, null, false, true),
1096
- };
1097
- const empty = {
1098
- ...baseResponse(null, "chooseReward", null, null, false, false, null, true),
1099
- };
1100
-
1101
- exports.RewardExchangeView = RewardExchangeView;
1102
- exports.chooseAmountFixed = chooseAmountFixed;
1103
- exports.chooseAmountFixedNoDescription = chooseAmountFixedNoDescription;
1104
- exports.chooseAmountVariable = chooseAmountVariable;
1105
- exports.chooseAmountVariableDisabled = chooseAmountVariableDisabled;
1106
- exports.chooseAmountVariableNoDescription = chooseAmountVariableNoDescription;
1107
- exports.chooseAmountVariableUnavailable = chooseAmountVariableUnavailable;
1108
- exports.confirmFixed = confirmFixed;
1109
- exports.confirmVariable = confirmVariable;
1110
- exports.demoRewardExchange = demoRewardExchange;
1111
- exports.empty = empty;
1112
- exports.loading = loading;
1113
- exports.queryError = queryError;
1114
- exports.redemptionError = redemptionError;
1115
- exports.rewardExchange = rewardExchange;
1116
- exports.rewardExchangeCustomErrorMsg = rewardExchangeCustomErrorMsg;
1117
- exports.rewardExchangeLongText = rewardExchangeLongText;
1118
- exports.rewardExchangeSelected = rewardExchangeSelected;
1119
- exports.success = success;
1120
- exports.successVariable = successVariable;