@saasquatch/mint-components 1.15.0-115 → 1.15.0-117
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/cjs/RewardExchangeListData-a787ce54.js +1144 -0
- package/dist/cjs/{ShadowViewAddon-74752e56.js → ShadowViewAddon-f1bd9b26.js} +1 -1
- package/dist/cjs/{copy-text-view-c13907f9.js → copy-text-view-44dfefc7.js} +5 -7
- package/dist/cjs/copy-text-view-f0313f78.js +121 -0
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +2 -2
- package/dist/cjs/sqm-coupon-code-view-a869384e.js +35 -0
- package/dist/cjs/sqm-coupon-code.cjs.entry.js +285 -0
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-code.cjs.entry.js +177 -0
- package/dist/cjs/sqm-reward-exchange-list.cjs.entry.js +1018 -0
- package/dist/cjs/sqm-share-code.cjs.entry.js +147 -0
- package/dist/cjs/sqm-share-link.cjs.entry.js +102 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +3 -3
- package/dist/collection/components/sqm-share-link/ShareLink.stories.js +1 -1
- package/dist/collection/components/views/copy-text-view.js +5 -7
- package/dist/esm/RewardExchangeListData-11c043e3.js +1122 -0
- package/dist/esm/{ShadowViewAddon-ee0c8c4b.js → ShadowViewAddon-c0600f22.js} +1 -1
- package/dist/esm/copy-text-view-3129fb22.js +119 -0
- package/dist/esm/{copy-text-view-61bd1ac1.js → copy-text-view-a319c261.js} +5 -7
- package/dist/esm/sqm-big-stat_43.entry.js +2 -2
- package/dist/esm/sqm-coupon-code-view-af016712.js +33 -0
- package/dist/esm/sqm-coupon-code.entry.js +281 -0
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/sqm-referral-code.entry.js +173 -0
- package/dist/esm/sqm-reward-exchange-list.entry.js +1014 -0
- package/dist/esm/sqm-share-code.entry.js +143 -0
- package/dist/esm/sqm-share-link.entry.js +98 -0
- package/dist/esm/sqm-stencilbook.entry.js +3 -3
- package/dist/esm-es5/RewardExchangeListData-11c043e3.js +1 -0
- package/dist/esm-es5/{ShadowViewAddon-ee0c8c4b.js → ShadowViewAddon-c0600f22.js} +1 -1
- package/dist/esm-es5/copy-text-view-3129fb22.js +1 -0
- package/dist/esm-es5/copy-text-view-a319c261.js +1 -0
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm-es5/sqm-coupon-code-view-af016712.js +1 -0
- package/dist/esm-es5/sqm-coupon-code.entry.js +1 -0
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-code.entry.js +1 -0
- package/dist/esm-es5/sqm-reward-exchange-list.entry.js +1 -0
- package/dist/esm-es5/sqm-share-code.entry.js +1 -0
- package/dist/esm-es5/sqm-share-link.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/RewardExchangeListData-11c043e3.js +1122 -0
- package/dist/mint-components/RewardExchangeListData-546ffbb9.system.js +1 -0
- package/dist/mint-components/copy-text-view-3129fb22.js +119 -0
- package/dist/mint-components/copy-text-view-33cac657.system.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-2bf5998b.entry.js → p-1276830a.entry.js} +1 -1
- package/dist/mint-components/p-1de49f76.js +1 -0
- package/dist/mint-components/{p-94952e33.js → p-6b904749.js} +1 -1
- package/dist/mint-components/p-a89baf7b.system.js +1 -1
- package/dist/mint-components/{p-ba0c9f88.system.entry.js → p-aa77d858.system.entry.js} +1 -1
- package/dist/mint-components/{p-45736fa8.system.js → p-bdc86ee3.system.js} +1 -1
- package/dist/mint-components/{p-680894bd.system.entry.js → p-be770d69.system.entry.js} +1 -1
- package/dist/mint-components/{p-0bac31a6.entry.js → p-e34b460e.entry.js} +1 -1
- package/dist/mint-components/{p-4e3ec053.system.entry.js → p-ed69dc98.system.entry.js} +1 -1
- package/dist/mint-components/p-f4f57363.system.js +1 -0
- package/dist/mint-components/{p-dba96a48.entry.js → p-f9f67437.entry.js} +2 -2
- package/dist/mint-components/sqm-coupon-code-view-40fd8d8b.system.js +1 -0
- package/dist/mint-components/sqm-coupon-code-view-af016712.js +33 -0
- package/dist/mint-components/sqm-coupon-code.entry.js +281 -0
- package/dist/mint-components/sqm-coupon-code.system.entry.js +1 -0
- package/dist/mint-components/sqm-referral-code.entry.js +173 -0
- package/dist/mint-components/sqm-referral-code.system.entry.js +1 -0
- package/dist/mint-components/sqm-reward-exchange-list.entry.js +1014 -0
- package/dist/mint-components/sqm-reward-exchange-list.system.entry.js +1 -0
- package/dist/mint-components/sqm-share-code.entry.js +143 -0
- package/dist/mint-components/sqm-share-code.system.entry.js +1 -0
- package/dist/mint-components/sqm-share-link.entry.js +98 -0
- package/dist/mint-components/sqm-share-link.system.entry.js +1 -0
- package/dist/mint-components/sqm-stencilbook.entry.js +20330 -0
- package/dist/mint-components/sqm-stencilbook.system.entry.js +1 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/copy-text-view-61bd1ac1.js +0 -1
- package/dist/mint-components/p-c5ca5b5f.js +0 -1
- package/dist/mint-components/p-efeab858.system.js +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { r as registerInstance, h as h$1 } from './index-bfb7f924.js';
|
|
2
|
+
import { i as useState, o as h } from './dom-context-hooks.module-01c1b885.js';
|
|
3
|
+
import { d as dist, H, J, B, w as wn, $ as $e, i as isDemo } from './index.module-83586215.js';
|
|
4
|
+
import './jss-preset-default.esm-c36417f8.js';
|
|
5
|
+
import './JSS-8c381d8b.js';
|
|
6
|
+
import './mixins-acc245cc.js';
|
|
7
|
+
import { g as getProps } from './utils-93e14db3.js';
|
|
8
|
+
import { c as cjs } from './cjs-e829b75b.js';
|
|
9
|
+
import { C as CopyTextView } from './copy-text-view-3129fb22.js';
|
|
10
|
+
|
|
11
|
+
const MessageLinkQuery = dist.gql `
|
|
12
|
+
query ($programId: ID) {
|
|
13
|
+
user: viewer {
|
|
14
|
+
... on User {
|
|
15
|
+
referralCode(programId: $programId)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const WIDGET_ENGAGEMENT_EVENT = dist.gql `
|
|
21
|
+
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
22
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
function useShareCode(props) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const { programId = H() } = props;
|
|
28
|
+
const user = J();
|
|
29
|
+
const engagementMedium = B();
|
|
30
|
+
const { data } = wn(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
31
|
+
const [sendLoadEvent] = $e(WIDGET_ENGAGEMENT_EVENT);
|
|
32
|
+
const copyString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.referralCode) !== null && _b !== void 0 ? _b :
|
|
33
|
+
// Shown during loading
|
|
34
|
+
"...";
|
|
35
|
+
const [open, setOpen] = useState(false);
|
|
36
|
+
function onClick() {
|
|
37
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
38
|
+
// Only if called from a user-initiated event
|
|
39
|
+
navigator.clipboard.writeText(copyString);
|
|
40
|
+
setOpen(true);
|
|
41
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
42
|
+
sendLoadEvent({
|
|
43
|
+
eventMeta: {
|
|
44
|
+
programId,
|
|
45
|
+
id: user === null || user === void 0 ? void 0 : user.id,
|
|
46
|
+
accountId: user === null || user === void 0 ? void 0 : user.accountId,
|
|
47
|
+
type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
|
|
48
|
+
meta: {
|
|
49
|
+
engagementMedium,
|
|
50
|
+
shareMedium: "DIRECT",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return { ...props, onClick, open, copyString: copyString };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const ShareCode = class {
|
|
59
|
+
constructor(hostRef) {
|
|
60
|
+
registerInstance(this, hostRef);
|
|
61
|
+
/**
|
|
62
|
+
* Shown inside a tooltip after someone has successfully copied the link to their clipboard
|
|
63
|
+
*
|
|
64
|
+
* @uiName Tooltip text
|
|
65
|
+
*/
|
|
66
|
+
this.tooltiptext = "Copied to Clipboard";
|
|
67
|
+
/**
|
|
68
|
+
* The number of milliseconds that the tooltip appears for
|
|
69
|
+
*
|
|
70
|
+
* @uiName Tooltip lifespan
|
|
71
|
+
*/
|
|
72
|
+
this.tooltiplifespan = 1000;
|
|
73
|
+
/**
|
|
74
|
+
* Change the text alignment
|
|
75
|
+
*
|
|
76
|
+
* @uiName Share code alignment
|
|
77
|
+
* @uiType string
|
|
78
|
+
* @uiEnum ["left", "center", "right"]
|
|
79
|
+
* @uiEnumNames ["Left", "Center", "Right"]
|
|
80
|
+
* @uiGroup Style
|
|
81
|
+
*/
|
|
82
|
+
this.textAlign = "left";
|
|
83
|
+
/**
|
|
84
|
+
* @uiName Copy button label
|
|
85
|
+
*/
|
|
86
|
+
this.copyButtonLabel = "Copy Code";
|
|
87
|
+
/**
|
|
88
|
+
* Set the copy button style and placement
|
|
89
|
+
*
|
|
90
|
+
* @uiName Style
|
|
91
|
+
* @uiType string
|
|
92
|
+
* @uiEnum ["icon", "button-outside", "button-below"]
|
|
93
|
+
* @uiEnumNames ["Icon", "Button outside", "Button below"]
|
|
94
|
+
* @uiGroup Style
|
|
95
|
+
*/
|
|
96
|
+
this.buttonStyle = "icon";
|
|
97
|
+
/**
|
|
98
|
+
* The type of the button that is used (primary or secondary).
|
|
99
|
+
* @uiName Button Type
|
|
100
|
+
* @uiType string
|
|
101
|
+
* @uiEnum ["primary", "secondary"]
|
|
102
|
+
* @uiEnumNames ["Primary", "Secondary"]
|
|
103
|
+
* @uiGroup Style
|
|
104
|
+
*/
|
|
105
|
+
this.buttonType = "primary";
|
|
106
|
+
h(this);
|
|
107
|
+
}
|
|
108
|
+
disconnectedCallback() { }
|
|
109
|
+
render() {
|
|
110
|
+
const thisProps = getProps(this);
|
|
111
|
+
const props = isDemo()
|
|
112
|
+
? useDemoShareCode(thisProps)
|
|
113
|
+
: useShareCode(thisProps);
|
|
114
|
+
return h$1(CopyTextView, Object.assign({}, props));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
function useDemoShareCode(props) {
|
|
118
|
+
const [open, setOpen] = useState(false);
|
|
119
|
+
const copyString = "SHARECODE001";
|
|
120
|
+
return cjs({
|
|
121
|
+
copyString: copyString,
|
|
122
|
+
tooltiptext: props.tooltiptext,
|
|
123
|
+
textAlign: props.textAlign,
|
|
124
|
+
copyButtonLabel: props.copyButtonLabel,
|
|
125
|
+
buttonStyle: props.buttonStyle,
|
|
126
|
+
backgroundColor: props.backgroundColor,
|
|
127
|
+
textColor: props.textColor,
|
|
128
|
+
borderRadius: props.borderRadius,
|
|
129
|
+
borderColor: props.borderColor,
|
|
130
|
+
buttonType: props.buttonType,
|
|
131
|
+
rewardStatus: "AVAILABLE",
|
|
132
|
+
open,
|
|
133
|
+
onClick: () => {
|
|
134
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
135
|
+
// Only if called from a user-initiated event
|
|
136
|
+
navigator.clipboard.writeText(copyString);
|
|
137
|
+
setOpen(true);
|
|
138
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
139
|
+
},
|
|
140
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { ShareCode as sqm_share_code };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { r as registerInstance, h as h$1 } from './index-bfb7f924.js';
|
|
2
|
+
import { o as h, i as useState } from './dom-context-hooks.module-01c1b885.js';
|
|
3
|
+
import { i as isDemo } from './index.module-83586215.js';
|
|
4
|
+
import './jss-preset-default.esm-c36417f8.js';
|
|
5
|
+
import './JSS-8c381d8b.js';
|
|
6
|
+
import './mixins-acc245cc.js';
|
|
7
|
+
import { g as getProps } from './utils-93e14db3.js';
|
|
8
|
+
import { c as cjs } from './cjs-e829b75b.js';
|
|
9
|
+
import './useReferralCodes-ec892d5c.js';
|
|
10
|
+
import { C as CopyTextView } from './copy-text-view-3129fb22.js';
|
|
11
|
+
import { u as useShareLink } from './useShareLink-d31795c1.js';
|
|
12
|
+
|
|
13
|
+
const ShareLink = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
registerInstance(this, hostRef);
|
|
16
|
+
/**
|
|
17
|
+
* Shown inside a tooltip after someone has successfully copied the link to their clipboard
|
|
18
|
+
*
|
|
19
|
+
* @uiName Tooltip text
|
|
20
|
+
*/
|
|
21
|
+
this.tooltiptext = "Copied to Clipboard";
|
|
22
|
+
/**
|
|
23
|
+
* The number of milliseconds that the tooltip appears for
|
|
24
|
+
*
|
|
25
|
+
* @uiName Tooltip lifespan
|
|
26
|
+
*/
|
|
27
|
+
this.tooltiplifespan = 1000;
|
|
28
|
+
/**
|
|
29
|
+
* Change the text alignment
|
|
30
|
+
*
|
|
31
|
+
* @uiName Share link alignment
|
|
32
|
+
* @uiType string
|
|
33
|
+
* @uiEnum ["left", "center", "right"]
|
|
34
|
+
* @uiEnumNames ["Left", "Center", "Right"]
|
|
35
|
+
* @uiGroup Style
|
|
36
|
+
*/
|
|
37
|
+
this.textAlign = "left";
|
|
38
|
+
/**
|
|
39
|
+
* @uiName Copy button label
|
|
40
|
+
*/
|
|
41
|
+
this.copyButtonLabel = "Copy Link";
|
|
42
|
+
/**
|
|
43
|
+
* The type of the button that is used (primary or secondary).
|
|
44
|
+
* @uiName Button Type
|
|
45
|
+
* @uiType string
|
|
46
|
+
* @uiEnum ["primary", "secondary"]
|
|
47
|
+
* @uiEnumNames ["Primary", "Secondary"]
|
|
48
|
+
* @uiGroup Style
|
|
49
|
+
*/
|
|
50
|
+
this.buttonType = "primary";
|
|
51
|
+
/**
|
|
52
|
+
* Set the copy button style and placement
|
|
53
|
+
*
|
|
54
|
+
* @uiName Button style
|
|
55
|
+
* @uiType string
|
|
56
|
+
* @uiEnum ["icon", "button-outside", "button-below"]
|
|
57
|
+
* @uiEnumNames ["Icon", "Button outside", "Button below"]
|
|
58
|
+
* @uiGroup Style
|
|
59
|
+
*/
|
|
60
|
+
this.buttonStyle = "icon";
|
|
61
|
+
h(this);
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() { }
|
|
64
|
+
render() {
|
|
65
|
+
const thisProps = getProps(this);
|
|
66
|
+
const props = isDemo()
|
|
67
|
+
? useDemoShareLink(thisProps)
|
|
68
|
+
: useShareLink(thisProps);
|
|
69
|
+
return h$1(CopyTextView, Object.assign({}, props));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function useDemoShareLink(props) {
|
|
73
|
+
const [open, setOpen] = useState(false);
|
|
74
|
+
const copyString = "https://www.example.com/sharelink/abc";
|
|
75
|
+
return cjs({
|
|
76
|
+
copyString: copyString,
|
|
77
|
+
tooltiptext: props.tooltiptext,
|
|
78
|
+
textAlign: props.textAlign,
|
|
79
|
+
buttonStyle: props.buttonStyle,
|
|
80
|
+
backgroundColor: props.backgroundColor,
|
|
81
|
+
textColor: props.textColor,
|
|
82
|
+
borderRadius: props.borderRadius,
|
|
83
|
+
buttonType: props.buttonType,
|
|
84
|
+
copyButtonLabel: props.copyButtonLabel,
|
|
85
|
+
borderColor: props.borderColor,
|
|
86
|
+
rewardStatus: "AVAILABLE",
|
|
87
|
+
open,
|
|
88
|
+
onClick: () => {
|
|
89
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
90
|
+
// Only if called from a user-initiated event
|
|
91
|
+
navigator.clipboard.writeText(copyString);
|
|
92
|
+
setOpen(true);
|
|
93
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
94
|
+
},
|
|
95
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { ShareLink as sqm_share_link };
|
|
@@ -7,7 +7,7 @@ import './utils-03188de2.js';
|
|
|
7
7
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
8
8
|
import './useReferralCodes-311e6d72.js';
|
|
9
9
|
import './mixins-f750863a.js';
|
|
10
|
-
import { C as CopyTextView } from './copy-text-view-
|
|
10
|
+
import { C as CopyTextView } from './copy-text-view-a319c261.js';
|
|
11
11
|
import { G as GenericTableView } from './GenericTableView-e43d310f.js';
|
|
12
12
|
import './useChildElements-4e70ac0e.js';
|
|
13
13
|
import { l as luxon } from './luxon-bbf75a9d.js';
|
|
@@ -29,7 +29,7 @@ import './utilities-ad9c2893.js';
|
|
|
29
29
|
import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-abef7286.js';
|
|
30
30
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-33805220.js';
|
|
31
31
|
import { Q as QrCodeView } from './sqm-qr-code-view-97124a66.js';
|
|
32
|
-
import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, c as CheckboxFieldView, d as PortalRegisterView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as useShareLink, K as ProgressBarView, M as ProgressBar$2, O as ShadowViewAddon } from './ShadowViewAddon-
|
|
32
|
+
import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, c as CheckboxFieldView, d as PortalRegisterView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as useShareLink, K as ProgressBarView, M as ProgressBar$2, O as ShadowViewAddon } from './ShadowViewAddon-c0600f22.js';
|
|
33
33
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-176e92e3.js';
|
|
34
34
|
import { I as InvoiceTableView, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView } from './IndirectTaxDetailsView-084314d5.js';
|
|
35
35
|
import { t as taxTypeToName, L as LoadingView } from './utils-27b2ed4b.js';
|
|
@@ -13391,7 +13391,7 @@ const Default$m = () => {
|
|
|
13391
13391
|
open: false,
|
|
13392
13392
|
tooltiptext: "Copied!",
|
|
13393
13393
|
};
|
|
13394
|
-
return h(CopyTextView, Object.assign({
|
|
13394
|
+
return h(CopyTextView, Object.assign({}, props));
|
|
13395
13395
|
};
|
|
13396
13396
|
const Tooltip = () => {
|
|
13397
13397
|
const props = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var a,s=1,t=arguments.length;s<t;s++){a=arguments[s];for(var i in a)if(Object.prototype.hasOwnProperty.call(a,i))e[i]=a[i]}return e};return __assign.apply(this,arguments)};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,a=0,s=arguments.length;a<s;a++)e+=arguments[a].length;for(var t=Array(e),i=0,a=0;a<s;a++)for(var n=arguments[a],r=0,o=n.length;r<o;r++,i++)t[i]=n[r];return t};import{h,j as getAssetPath}from"./index-bfb7f924.js";import{i as intl}from"./global-c7169457.js";import{c as createStyleSheet}from"./JSS-8c381d8b.js";import{H as HostBlock}from"./mixins-acc245cc.js";import{C as CopyTextView}from"./copy-text-view-3129fb22.js";var LeftArrow=function(){return 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"}},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"}))};var ExchangeArrows=function(){return h("svg",{width:19,height:15,fill:"none",xmlns:"http://www.w3.org/2000/svg"},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"}))};var CheckMark=function(){return h("svg",{width:12,height:10,fill:"none",xmlns:"http://www.w3.org/2000/svg"},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"}))};var CheckmarkFilled=function(){return h("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},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"}),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"}))};var Gift=function(){return h("svg",{width:156,height:157,fill:"none",xmlns:"http://www.w3.org/2000/svg"},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"}),h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M37.18 73.862v7.966h89.663v-7.966H37.18Z",fill:"#E9BB30"}),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"}),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"}),h("path",{d:"M75.086 74.224h13.85v7.604h-13.85v-7.604Z",fill:"#DD4747"}),h("g",{filter:"url(#a)"},h("ellipse",{cx:82.008,cy:141.207,rx:36.813,ry:5.793,fill:"#E0DDDD","fill-opacity":.8})),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"}),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"}),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"}),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"}),h("defs",null,h("filter",{id:"a",x:35.195,y:125.414,width:93.625,height:31.586,filterUnits:"userSpaceOnUse","color-interpolation-filters":"s-rGB"},h("feFlood",{"flood-opacity":0,result:"BackgroundImageFix"}),h("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),h("feGaussianBlur",{stdDeviation:5,result:"effect1_foregroundBlur_653_17907"}))))};function Dot(e){var a=e.active,s=e.completed,t=e.incomplete,i=e.stage;return h("div",{style:{display:"flex"}},h("div",{style:{backgroundColor:s?"var(--sqm-success-color-icon)":t?"var(--sqm-border-color)":"white",border:a?"1px solid var(--sqm-success-color-border)":t?"1px solid var(--sqm-border-color)":"1px solid var(--sqm-success-color-border)",borderRadius:"50%",width:"23px",height:"23px",margin:"-11px",zIndex:"1",boxSizing:"content-box"}},s?h("div",{style:{top:"-10.5%",left:"23.5%",position:"relative"}},h(CheckMark,null)):h("div",{style:{color:a?"var(--sqm-success-color-border)":"var(--sqm-text-subdued)",width:"23px",lineHeight:"24px",textAlign:"center",position:"relative"}},i+1)))}function ProgressLine(e){var a=e.incomplete,s=a===void 0?false:a,t=e.active,i=t===void 0?false:t,n=e.invisible,r=n===void 0?false:n;return h("div",{style:{content:"''",flex:"0.5 0.5 0",height:"4px",borderRadius:"4px",background:s||i?"var(--sqm-border-color)":"var(--sqm-success-color-icon)",position:"relative",bottom:"0",left:"0",display:"flex",justifyContent:"center",columnGap:"50px",marginRight:"-2px",boxSizing:"content-box",opacity:r?"0":"1"}})}function Progress(e){var a=e.active,s=e.completed,t=e.incomplete,i=e.stage;return[h(ProgressLine,{incomplete:t,invisible:i===0}),h(Dot,{active:a,completed:s,incomplete:t,stage:i}),h(ProgressLine,{incomplete:t,active:a,invisible:i===2})]}function ProgressBar(e){var a=e.stageCount,s=e.currentStage;return h("div",{style:{display:"flex",columnGap:"-2px"}},Array.from(Array(a).keys()).map((function(e){return h(Progress,{active:s===e,completed:s>e,incomplete:s<e,stage:e})})))}var style={HostBlock:HostBlock,Container:{minWidth:"300px",position:"relative"},FullImage:{objectFit:"contain",maxWidth:"100%",height:"250px",display:"flex",margin:"0 auto"},Select:{"&::part(base)":{borderRadius:"var(--sqm-input-border-radius)"},"&::part(label)":{color:"var(--sqm-input-label-color)"},"&::part(menu)":{maxHeight:"450px"},"& sl-menu-item::part(checked-icon)":{top:"8px",color:"var(--sqm-text)"},"& sl-menu-item::part(base)":{flexDirection:"column"},"& sl-menu-item::part(base):focus":{background:"var(--sqm-accent-color-background)",color:"var(--sqm-text)"}},ProgressBar:{maxWidth:"350px",width:"100%",margin:"auto",marginBottom:"var(--sl-spacing-xxx-large)","& .text-area":{marginTop:"5px",display:"flex",justifyContent:"center",textAlign:"center",whiteSpace:"nowrap",marginBottom:"6px","& .text":{marginBottom:"var(--sl-spacing-x-small)",flex:"1 1 0"},"& .text.subdued":{color:"var(--sqm-text-subdued)"}}},CardLayout:{display:"flex",width:"100%",borderRadius:"3px",background:"rgba(0, 0, 0, 0)"},Card:{display:"flex",userSelect:"none",height:"120px","&::part(base)":{background:"var(--sqm-portal-background)",border:"var(--sqm-border-thickness) solid var(--sqm-border-color)",borderRadius:"var(--sqm-border-radius-normal)",boxShadow:"none",width:"100%"},"&::part(body)":{display:"flex",padding:0},"& .selected":{borderRadius:"var(--sqm-border-radius-normal)",position:"relative",top:"-2%",left:"100%",color:"var(--sqm-primary-color)",margin:"-9px"}},Title:{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-semibold)",margin:"var(--sl-spacing-large) 0"},Image:{padding:"var(--sl-spacing-small)",minWidth:"96px",maxWidth:"96px","& .image":{width:"100%",height:"100%",objectFit:"contain",borderRadius:"4px"},"& .image.subdued":{filter:"brightness(0.95)",opacity:"0.5"}},TextArea:{textAlign:"left",padding:"var(--sl-spacing-small)",paddingLeft:"0","& .title":{fontSize:"var(--sl-font-size-medium)",lineHeight:"var(--sl-line-height-dense)",fontWeight:"600",color:"var(--sqm-text)",display:"-webkit-box","-webkit-line-clamp":"1","-webkit-box-orient":"vertical",overflow:"hidden"},"& .amount":{fontSize:"var(--sl-font-size-small)",lineHeight:"var(--sl-line-height-dense)",marginTop:"var(--sl-spacing-x-small)",color:"var(--sqm-text-subdued)",display:"-webkit-box","-webkit-line-clamp":"1","-webkit-box-orient":"vertical",overflow:"hidden"},"& .error":{fontSize:"var(--sl-font-size-small)",lineHeight:"var(--sl-line-height-dense)",marginTop:"var(--sl-spacing-x-small)",fontWeight:"600",color:"var(--sqm-warning-color-icon)",display:"-webkit-box","-webkit-line-clamp":"1","-webkit-box-orient":"vertical",overflow:"hidden","& .icon":{position:"relative",top:"0.1em",marginRight:"var(--sl-spacing-xx-small)"}}},ChooseAmount:{maxWidth:"800px",margin:"auto","& .wrapper":{display:"flex",gap:"var(--sl-spacing-xx-large)","@media (max-width: 799px)":{flexDirection:"column"}},"& .image":{width:"50%",objectFit:"contain",maxWidth:"100%",height:"250px",display:"flex","@media (max-width: 799px)":{width:"auto"}},"& .text":{width:"50%",maxWidth:"400px","@media (max-width: 799px)":{width:"auto",margin:"auto"}},"& .title":{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-semibold)",color:"var(--sqm-text)"},"& .points":{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-semibold)",color:"var(--sqm-accent-color-text)"},"& .description":{fontSize:"var(--sl-font-size-medium)",fontWeight:"var(--sl-font-weight-normal)",color:"var(--sqm-text-subdued)",margin:"var(--sl-spacing-medium) 0",lineHeight:"var(--sl-line-height-dense)",marginTop:"var(--sl-spacing-xx-small)"},"& .space":{marginBottom:"var(--sl-spacing-xxx-large)"},"& sl-menu-item[disabled]::part(label)":{color:"var(sqm-text-subdued)"},"& sl-menu-item[disabled]":{"& .step-cost":{color:"var(sqm-text-subdued)"},"& .step-value":{color:"var(sqm-text-subdued)"}}},SelectItem:{display:"flex",flexDirection:"column","&::part(label)":{color:"var(--sqm-text)",margin:"0"},"& .step-cost":{color:"var(--sqm-text-subdued)",marginBottom:"var(--sl-spacing-x-small)"},"& .step-unavailable":{fontSize:"var(--sl-font-size-small)",color:"var(--sqm-warning-color-text)",margin:"0"}},Success:{textAlign:"center","& .title":{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-semibold)",color:"var(--sqm-text)"},"& .description":{color:"var(--sqm-text-subued)",maxWidth:"350px",margin:"0 auto",lineHeight:"var(--sl-line-height-dense)",marginBottom:"var(--sl-spacing-xx-large)",marginTop:"var(--sl-spacing-xx-small)"},"& .promo":{maxWidth:"350px",margin:"-30px auto var(--sl-spacing-xxx-large) auto",textAlign:"left",color:"var(--sqm-text-subdued)"}},Grid:{display:"grid",justifyContent:"center",gap:"20px",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},Confirmation:{maxWidth:"800px",margin:"auto","& .wrapper":{display:"flex","@media (max-width: 499px)":{flexDirection:"column"}},"& .reward-item-container":{"@media (max-width: 499px)":{display:"flex",flexDirection:"row-reverse",justifyContent:"flex-end",alignItems:"center"}},"& .reward-item-container .reward-title":{paddingBottom:"var(--sl-spacing-medium)",lineHeight:"20px","@media (max-width: 499px)":{paddingBottom:"none",paddingLeft:"var(--sl-spacing-small)"}},"& .padding":{padding:"var(--sl-spacing-medium) 0","@media (max-width: 499px)":{padding:"var(--sl-spacing-small) 0"}},"& .field":{width:"30%",fontSize:"var(--sl-font-size-medium)",fontWeight:"var(--sl-font-weight-normal)",color:"var(--sqm-text-subdued)",textAlign:"left",paddingRight:"var(--sl-spacing-xxx-large)","@media (max-width: 499px)":{width:"100%",paddingRight:"0",paddingBottom:"0"}},"& .value":{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-semibold)"},"& .top-border":{borderTop:"var(--sqm-border-thickness) solid var(--sqm-border-color)"},"& .image":{width:"200px","@media (max-width: 499px)":{width:"100px"}}},Button:{display:"flex",flexWrap:"wrap-reverse",margin:"var(--sl-spacing-medium) 0","& .cancel":{marginLeft:"auto",marginRight:"var(--sl-spacing-medium)","@media (max-width: 499px)":{width:"100%",marginRight:"0",marginTop:"var(--sl-spacing-small)"}},"& .continue":{"@media (max-width: 499px)":{width:"100%"}},"& .continue.right":{marginLeft:"auto"},"& .continue.center":{margin:"0 auto"}},Confetti:{pointerEvents:"none",position:"absolute",width:"100%",height:"100%",top:"0%",left:"0%",zIndex:"1"}};var sheet=createStyleSheet(style);var styleString=sheet.toString();var stageList=["chooseReward","chooseAmount","confirmation","success"];function RewardExchangeView(e){var a=e.states,s=e.data,t=e.callbacks,i=e.refs;var n=a.selectedItem,r=a.selectedStep;var o={chooseReward:a.content.text.chooseRewardTitle,chooseAmount:a.content.text.chooseAmountTitle,confirmation:a.content.text.confirmationTitle};function l(){var e,s,i;var n=a.selectedItem;if(!n||(n===null||n===void 0?void 0:n.ruleType)==="FIXED_GLOBAL_REWARD")return h("span",{class:"points"},n===null||n===void 0?void 0:n.prettySourceValue);if(!((e=n.steps)===null||e===void 0?void 0:e.length)){return h("p",null,intl.formatMessage({id:"notEnoughError",defaultMessage:a.content.text.notEnoughError},{sourceUnit:n.sourceUnit}))}return h("sl-select",{style:{width:"auto"},label:(s=a===null||a===void 0?void 0:a.content)===null||s===void 0?void 0:s.text.selectText,class:sheet.classes.Select,value:a.selectedStep,"onSl-select":function(e){var a,s,i,n,r;return t.setExchangeState({amount:(i=(s=(a=e.detail)===null||a===void 0?void 0:a.item)===null||s===void 0?void 0:s.value)===null||i===void 0?void 0:i.sourceValue,selectedStep:(r=(n=e.detail)===null||n===void 0?void 0:n.item)===null||r===void 0?void 0:r.value})}},(i=n.steps)===null||i===void 0?void 0:i.map((function(e){var s,t;return h("sl-menu-item",{value:e,disabled:!e.available,class:sheet.classes.SelectItem},e.prettyDestinationValue,h("br",null),h("div",{class:"step-cost",slot:"suffix"},e.prettySourceValue,e.unavailableReasonCode&&h("p",{class:"step-unavailable"},intl.formatMessage({id:"unavailableCode",defaultMessage:(t=(s=a.content)===null||s===void 0?void 0:s.text)===null||t===void 0?void 0:t.notAvailableError},{unavailableReasonCode:e.unavailableReasonCode,sourceUnit:n.sourceUnit,sourceValue:e.prettySourceValue||n.prettySourceMinValue}))))})))}function d(){var e;return[h("div",{part:"choose-reward-container"},h("div",{class:sheet.classes.Title},a.content.text.rewardTitle),a.loading||a.queryError?_():h("div",{class:sheet.classes.Grid},(e=s.exchangeList)===null||e===void 0?void 0:e.map((function(e){var s,i,r,o,l;var d={boxShadow:e.key===(n===null||n===void 0?void 0:n.key)?"0 0 0 2px var(--sqm-primary-color)":"none",borderRadius:"var(--sqm-border-radius-normal)",borderColor:"none"};return h("div",{key:e.key,style:d},h("sl-card",{exportparts:"base: exchange-card-container",class:sheet.classes.Card,style:{cursor:e.unavailableReasonCode?"not-allowed":"pointer"},onClick:function(){return e.available&&t.setExchangeState({selectedItem:e})}},e.key===(n===null||n===void 0?void 0:n.key)&&h("div",{class:"selected"},h(CheckmarkFilled,null)),h("div",{style:{display:"flex",width:"100%",height:"120px",borderRadius:"3px",background:e.unavailableReasonCode?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0)"}},h("div",{class:sheet.classes.Image,style:{opacity:e.unavailableReasonCode?"0.5":"1"}},h("img",{class:e.unavailableReasonCode?"image subdued":"image",src:(e===null||e===void 0?void 0:e.imageUrl)||getAssetPath("./assets/Reward-image.png")})),h("div",{class:sheet.classes.TextArea,style:{opacity:e.unavailableReasonCode?"0.5":"1"}},h("div",{class:"title",style:{"-webkit-line-clamp":e.unavailableReasonCode?"1":"2"}},(s=e.name)!==null&&s!==void 0?s:""),h("div",{class:"amount",style:{"-webkit-line-clamp":e.unavailableReasonCode?"1":"2"}},intl.formatMessage({id:"sourceAmountMessage",defaultMessage:(r=(i=a.content)===null||i===void 0?void 0:i.text)===null||r===void 0?void 0:r.sourceAmountMessage},{ruleType:e.ruleType,sourceValue:e.prettySourceValue,sourceMinValue:e.prettySourceMinValue,sourceMaxValue:e.prettySourceMaxValue})),e.unavailableReasonCode&&h("div",{class:"error"},h("sl-icon",{class:"icon",name:"exclamation-triangle-fill"}),intl.formatMessage({id:"unavailableCode",defaultMessage:(l=(o=a.content)===null||o===void 0?void 0:o.text)===null||l===void 0?void 0:l.notAvailableError},{unavailableReasonCode:e.unavailableReasonCode,sourceUnit:e.sourceUnit,sourceValue:e.prettySourceValue||e.prettySourceMinValue}))))))}))),h("div",{class:sheet.classes.Button},h("sl-button",{exportparts:"base: primarybutton-base",type:"primary",class:"continue right",size:"large",onClick:function(){return t.setStage("chooseAmount")},loading:a.loading,disabled:!a.selectedItem},a.content.text.continueText)))]}function c(){var e,s,i,r;var o=l();var d=((e=a.selectedItem)===null||e===void 0?void 0:e.ruleType)==="FIXED_GLOBAL_REWARD"?false:o&&!a.amount;return h("div",null,h("div",{class:sheet.classes.ChooseAmount,part:"choose-amount-container"},h("div",{class:"wrapper"},h("img",{class:"image",src:(n===null||n===void 0?void 0:n.imageUrl)||getAssetPath("./assets/Reward-image.png")}),h("div",{class:"text"},h("div",{class:"title"},(s=n===null||n===void 0?void 0:n.name)!==null&&s!==void 0?s:""),((i=a.selectedItem)===null||i===void 0?void 0:i.ruleType)==="FIXED_GLOBAL_REWARD"?h("div",{class:"points"},o):h("div",{class:"description"},n===null||n===void 0?void 0:n.description),((r=a.selectedItem)===null||r===void 0?void 0:r.ruleType)==="FIXED_GLOBAL_REWARD"?h("div",{class:"description"},n===null||n===void 0?void 0:n.description):h("div",null,o),h("div",{class:"space"}))),h("div",{class:sheet.classes.Button},h("sl-button",{exportparts:"base: secondarybutton-base",class:"cancel",size:"large",type:"secondary",onClick:function(){return t.resetState()}},a.content.text.cancelText),h("sl-button",{exportparts:"base: primarybutton-base",class:"continue",size:"large",type:"primary",onClick:function(){return t.setStage("confirmation")},disabled:d},a.content.text.continueToConfirmationText))))}function u(){var e=(r===null||r===void 0?void 0:r.prettySourceValue)||n.prettySourceValue;var s=r===null||r===void 0?void 0:r.prettyDestinationValue;return h("div",null,h("div",{class:sheet.classes.Confirmation,part:"confirmation-container"},h("div",{class:sheet.classes.Title},a.content.text.redeemTitle),h("div",{class:"wrapper"},h("div",{class:"field"},a.content.text.rewardNameTitle),h("div",{class:"reward-item-container"},h("div",{class:"reward-title"},n.name),h("img",{class:"image",src:(n===null||n===void 0?void 0:n.imageUrl)||getAssetPath("./assets/Reward-image.png")}))),h("div",{class:"wrapper padding"},h("div",{class:"field"})),s&&h("div",{class:"wrapper top-border padding"},h("div",{class:"field"},a.content.text.rewardAmountTitle),h("div",null,s)),h("div",{class:"wrapper top-border padding"},h("div",{class:"field"},a.content.text.costTitle),h("div",{class:"value"},e)),h("div",{class:sheet.classes.Button},h("sl-button",{class:"cancel",type:"secondary",size:"large",onClick:function(){return t.setStage("chooseAmount")}},a.content.text.backText),h("sl-button",{class:"continue",size:"large",type:"primary",loading:a.loading,onClick:t.exchangeReward},a.content.text.redeemText))))}function g(){var e,i,n,r,o,l;return h("div",{class:sheet.classes.Success,part:"success-container"},h(Gift,null),h(b,null),h("div",{class:"title"},(e=a.content.text)===null||e===void 0?void 0:e.rewardRedeemedText),h("div",{class:"description"},intl.formatMessage({id:"successMessage",defaultMessage:a.content.text.redemptionSuccessText},{sourceValue:(i=a.selectedItem.prettySourceValue)!==null&&i!==void 0?i:(n=a.selectedStep)===null||n===void 0?void 0:n.prettySourceValue,destinationValue:((r=a.selectedStep)===null||r===void 0?void 0:r.prettyDestinationValue)||((o=a.selectedItem)===null||o===void 0?void 0:o.name)||a.selectedItem.globalRewardKey})),(s===null||s===void 0?void 0:s.fuelTankCode)&&h("div",{class:"promo"},a.content.text.promoCode,h(CopyTextView,{copyString:s.fuelTankCode,tooltiptext:(l=a===null||a===void 0?void 0:a.content)===null||l===void 0?void 0:l.text.tooltipText,open:a.open,onClick:t.copyFuelTankCode})),h("div",{class:sheet.classes.Button},h("sl-button",{class:"continue center",type:"primary",size:"large",onClick:function(){return t.resetState(true)}},a.content.text.doneText)))}var p={chooseReward:function(){return d()},chooseAmount:function(){return c()},confirmation:function(){return u()},success:function(){return g()}};var m=p[a.redeemStage];function v(){var e=stageList.indexOf(a.redeemStage);return h("div",{class:sheet.classes.ProgressBar},h("div",{class:"text-area"},Object.keys(o).map((function(a){if(stageList.indexOf(a)<=e){return h("span",{class:"text"},o[a])}else{return h("span",{class:"text subdued"},o[a])}}))),h(ProgressBar,{stageCount:3,currentStage:e}))}function _(){return h("div",{class:sheet.classes.Grid,part:"loading-container"},__spreadArrays(Array(a.content.text.skeletonCardNum)).map((function(){return h("div",null,h("sl-card",{class:sheet.classes.Card},h("div",{class:sheet.classes.CardLayout},h("div",null,h("sl-skeleton",{style:{width:"100px",height:"100px",margin:"9px","--border-radius":"var(--sqm-border-radius-normal)"}})),h("div",{style:{margin:"var(--sl-spacing-small) var(--sl-spacing-small) 0 0",width:"100%"}},h("sl-skeleton",{style:{marginBottom:"var(--sl-spacing-small)"}}),h("sl-skeleton",{style:{marginBottom:"var(--sl-spacing-small)"}}),h("sl-skeleton",{style:{width:"45%"}})))))})))}function x(){return h("sl-alert",{type:"danger",open:true},h("sl-icon",{slot:"icon",name:"exclamation-octagon"}),a.content.text.redemptionError)}function f(){return h("sl-alert",{type:"danger",open:true},h("sl-icon",{slot:"icon",name:"exclamation-octagon"}),a.content.text.queryError)}function b(){return h("canvas",{ref:function(e){if(!(i===null||i===void 0?void 0:i.canvasRef))return;i.canvasRef.current=e},id:"my-canvas",class:sheet.classes.Confetti})}if(a.noExchangeOptions)return a.content.text.empty;return h("div",{class:sheet.classes.Container,part:"sqm-base"},h("style",{type:"text/css"},styleString),h("div",null,v(),a.exchangeError&&x(),a.queryError&&!a.exchangeError&&f(),m&&m(),a.redeemStage==="success"))}var baseResponse=function(e,a,s,t,i,n,r,o,l){if(a===void 0){a="chooseReward"}if(s===void 0){s=null}if(t===void 0){t=null}if(i===void 0){i=false}if(n===void 0){n=false}if(r===void 0){r=null}if(o===void 0){o=false}if(l===void 0){l=false}return{states:{content:{text:{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} }",chooseRewardTitle:"Rewards",chooseAmountTitle:"Select",confirmationTitle:"Confirm",rewardTitle:"Choose a reward",cancelText:"Cancel",backText:"Back",continueText:"Continue",continueToConfirmationText:"Continue to confirmation",redeemText:"Redeem",redeemTitle:"Confirm and redeem",redemptionSuccessText:"Redeemed {sourceValue} for {destinationValue}",doneText:"Done",tooltipText:"Copied!",selectText:"Select amount to receive",sourceAmountMessage:"{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",rewardRedeemedText:"Reward redeemed",redemptionError:"An error occured trying to redeem this reward. Please try again",queryError:"Unable to load reward exchange list. Please try again",promoCode:"Promo code",skeletonCardNum:8,rewardNameTitle:"Reward Name",rewardAmountTitle:"Reward Amount",costTitle:"Cost",notEnoughError:"Sorry not enough!",empty: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"})}},queryError:l,redeemStage:a,amount:0,exchangeError:i,loading:n,selectedItem:s,selectedStep:t,noExchangeOptions:o,open:false},data:{exchangeList:e,fuelTankCode:r},callbacks:{exchangeReward:null,resetState:null,setStage:null,setExchangeState:null,copyFuelTankCode:null},refs:null}};var baseReward={key:"reward",name:"Demo Reward",description:"Description of reward. Lorem ipsum dolor sit amet, consectetur adipiscing. Id nec semper sapien dignissim rhoncus nunc.",imageUrl:"https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png",available:true,unavailableReasonCode:null,ruleType:"FIXED_GLOBAL_REWARD",sourceUnit:"POINT",sourceValue:10,prettySourceValue:"10 SaaSquatch Points",sourceMinValue:null,prettySourceMinValue:null,sourceMaxValue:null,prettySourceMaxValue:null,destinationMinValue:null,prettyDestinationMinValue:null,destinationMaxValue:null,prettyDestinationMaxValue:null,globalRewardKey:"",destinationUnit:null,steps:[{prettyDestinationValue:"Reward Step 1",prettySourceValue:"50 Points",available:true,unavailableReasonCode:null,destinationValue:10,sourceValue:1,globalRewardKey:"reward1",rewardInput:{accountId:"zach",userId:"zach"}},{prettyDestinationValue:"Reward Step 2",prettySourceValue:"100 Points",available:false,unavailableReasonCode:"Not enough points",destinationValue:10,sourceValue:1,globalRewardKey:"reward1",rewardInput:{accountId:"zach",userId:"zach"}}]};var notEnoughPoints={available:false,unavailableReasonCode:"INSUFFICIENT_REDEEMABLE_CREDIT"};var usTax={available:false,unavailableReasonCode:"US_TAX"};var customError={available:false,unavailableReasonCode:"NOT_CHAMPION"};var selected={key:"r1"};var imageUrl=function(e){return{imageUrl:e}};var name=function(e){return{name:e}};var description=function(e){return{description:e}};var fixedValue=function(e){return{prettySourceValue:e}};var variableValue=function(e,a,s){return{ruleType:"VARIABLE_CREDIT_REWARD",sourceMinValue:e,prettySourceMinValue:e+" "+s,sourceMaxValue:a,prettySourceMaxValue:a+" "+s}};var demoData=[__assign(__assign(__assign(__assign({},baseReward),name("Free swag with a promo code")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png")),fixedValue("40 Points")),__assign(__assign(__assign(__assign(__assign({},baseReward),selected),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),__assign(__assign(__assign(__assign({},baseReward),name("$50 Store credit")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png")),fixedValue("100 Points")),__assign(__assign(__assign(__assign({},baseReward),name("Variable amount of store credit")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000240/squatch-assets/Jn2fE0s.png")),variableValue(20,100,"Points"))];var data=[__assign(__assign(__assign(__assign({},baseReward),name("Free swag with a promo code")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png")),fixedValue("40 SaaSquatch Points")),__assign(__assign(__assign(__assign(__assign({},baseReward),selected),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),__assign(__assign(__assign(__assign({},baseReward),name("A very exclusive gift box")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/93BvEgH.png")),fixedValue("30 SaaSquatch Points")),__assign(__assign(__assign(__assign({},baseReward),name("$50 Store credit")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png")),fixedValue("100 SaaSquatch Points")),__assign(__assign(__assign(__assign({},baseReward),name("Variable amount of store credit")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000240/squatch-assets/Jn2fE0s.png")),variableValue(20,100,"Points")),__assign(__assign(__assign(__assign(__assign({},baseReward),notEnoughPoints),name("A very rare cactus")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000224/squatch-assets/hhlF2Ey.png")),fixedValue("2000 SaaSquatch Points")),__assign(__assign(__assign(__assign(__assign({},baseReward),usTax),name("$1000 Store credit with a really super long name in the front page")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000273/squatch-assets/y9HSls1.png")),fixedValue("2000 SaaSquatch Long Points")),__assign(__assign(__assign(__assign(__assign({},baseReward),notEnoughPoints),name("A holiday gift box")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/dWEdB3p.png")),fixedValue("100 SaaSquatch Points"))];var rewardExchange=__assign({},baseResponse(data));var demoRewardExchange=__assign({},baseResponse(demoData));var rewardExchangeLongText=__assign({},baseResponse(__spreadArrays([__assign(__assign(__assign(__assign(__assign({},baseReward),notEnoughPoints),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.")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/dWEdB3p.png")),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.")),__assign(__assign(__assign(__assign({},baseReward),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.")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000273/squatch-assets/y9HSls1.png")),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.")),__assign(__assign(__assign(__assign({},baseReward),name("Suuuuuuuuper aweeeeesssssoooommme reward!!!!!!")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png")),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."))],data)));var rewardExchangeCustomErrorMsg=__assign({},baseResponse(__spreadArrays([__assign(__assign(__assign(__assign(__assign({},baseReward),customError),name("A very rare cactus")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000224/squatch-assets/hhlF2Ey.png")),fixedValue("2000 SaaSquatch Points"))],data)));var rewardExchangeSelected=__assign({},baseResponse(data,"chooseReward",__assign(__assign(__assign(__assign(__assign({},baseReward),selected),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points"))));var stepsData=function(e,a,s){var t=[];for(var i=e;i<=a;i+=s){t.push({sourceValue:i,prettySourceValue:i+" SaaSquatch Points",destinationValue:i,prettyDestinationValue:"$"+i,available:true,unavailableReasonCode:null})}return t};var baseStep=function(e,a,s,t,i,n){if(i===void 0){i=true}if(n===void 0){n=null}return{destinationValue:e,prettyDestinationValue:a+e,sourceValue:s,prettySourceValue:s+" "+t,available:i,unavailableReasonCode:n}};var chooseAmountVariable=__assign({},baseResponse(data,"chooseAmount",__assign(__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),{steps:[baseStep(20,"$",40,"Points"),baseStep(30,"$",60,"Points"),baseStep(40,"$",80,"Points"),baseStep(50,"$",100,"Points"),baseStep(60,"$",120,"Points")]})));var chooseAmountVariableNoDescription=__assign({},baseResponse(data,"chooseAmount",__assign(__assign(__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),description("")),imageUrl("https://i.imgur.com/veHErQX.png")),variableValue(20,80,"Points")),{steps:[baseStep(20,"$",40,"Points"),baseStep(30,"$",60,"Points"),baseStep(40,"$",80,"Points"),baseStep(50,"$",100,"Points"),baseStep(60,"$",120,"Points")]})));var chooseAmountVariableDisabled=__assign({},baseResponse(data,"chooseAmount",__assign(__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),{steps:[baseStep(20,"$",40,"Points"),baseStep(30,"$",60,"Points"),baseStep(40,"$",80,"Points",false,"INSUFFICIENT_REDEEMABLE_CREDIT"),baseStep(50,"$",100,"Points",false,"INSUFFICIENT_REDEEMABLE_CREDIT"),baseStep(60,"$",120,"Points",false,"INSUFFICIENT_REDEEMABLE_CREDIT")]})));var chooseAmountVariableUnavailable=__assign({},baseResponse(data,"chooseAmount",__assign(__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),{steps:[baseStep(20,"$",40,"Points"),baseStep(30,"$",60,"Points"),baseStep(40,"$",80,"Points",false,"US_TAX"),baseStep(50,"$",100,"Points",false,"US_TAX"),baseStep(60,"$",120,"Points",false,"US_TAX")]})));var chooseAmountFixed=__assign({},baseResponse(data,"chooseAmount",__assign(__assign(__assign(__assign({},baseReward),name("Free swag with a promo code")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png")),fixedValue("40 SaaSquatch Points"))));var chooseAmountFixedNoDescription=__assign({},baseResponse(data,"chooseAmount",__assign(__assign(__assign(__assign(__assign({},baseReward),description("")),name("Free swag with a promo code")),imageUrl("https://i.imgur.com/n7vC4BR.png")),fixedValue("40 SaaSquatch Points"))));var confirmFixed=__assign({},baseResponse(data,"confirmation",__assign(__assign(__assign(__assign({},baseReward),name("Free swag with a promo code")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png")),fixedValue("40 SaaSquatch Points"))));var confirmVariable=__assign({},baseResponse(data,"confirmation",__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),baseStep(20,"$",40,"Points")));var redemptionError=__assign({},baseResponse(data,"confirmation",__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png")),variableValue(20,80,"Points")),baseStep(20,"$",40,"Points"),true));var queryError=__assign({},baseResponse(undefined,"chooseReward",undefined,undefined,undefined,undefined,undefined,undefined,true));var success=__assign({},baseResponse(data,"success",__assign(__assign(__assign(__assign({},baseReward),name("Free swag with a promo code")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png")),fixedValue("40 SaaSquatch Points")),undefined,undefined,undefined,"4ah2-hh46-gk7r"));var successVariable=__assign({},baseResponse(data,"success",__assign(__assign(__assign(__assign({},baseReward),name("Visa® Prepaid Card USD")),imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/93BvEgH.png")),variableValue(20,80,"Points")),baseStep(20,"$",40,"Points")));var loading=__assign({},baseResponse(null,"chooseReward",null,null,false,true));var empty=__assign({},baseResponse(null,"chooseReward",null,null,false,false,null,true));export{ProgressBar as P,RewardExchangeView as R,rewardExchangeCustomErrorMsg as a,rewardExchangeLongText as b,rewardExchangeSelected as c,chooseAmountFixed as d,chooseAmountFixedNoDescription as e,chooseAmountVariable as f,chooseAmountVariableNoDescription as g,chooseAmountVariableDisabled as h,chooseAmountVariableUnavailable as i,confirmFixed as j,confirmVariable as k,redemptionError as l,successVariable as m,loading as n,empty as o,demoRewardExchange as p,queryError as q,rewardExchange as r,success as s};
|