@saasquatch/mint-components 1.13.5-0 → 1.14.0-0

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 (147) hide show
  1. package/dist/cjs/{ShadowViewAddon-14a02da4.js → AutoColor-3b59126f.js} +1137 -1137
  2. package/dist/cjs/ErrorView-b2fcf954.js +35 -0
  3. package/dist/cjs/IndirectTaxDetailsView-409dae6f.js +646 -0
  4. package/dist/cjs/data-6d96b89c.js +137 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/mint-components.cjs.js +1 -1
  7. package/dist/cjs/parseStates-d1effc19.js +16 -0
  8. package/dist/cjs/{sqm-banking-info-form_17.cjs.entry.js → sqm-banking-info-form_10.cjs.entry.js} +209 -1885
  9. package/dist/cjs/sqm-big-stat_41.cjs.entry.js +30 -30
  10. package/dist/cjs/sqm-code-verification.cjs.entry.js +349 -0
  11. package/dist/cjs/sqm-invoice-table-data-cell_5.cjs.entry.js +84 -0
  12. package/dist/cjs/sqm-stencilbook.cjs.entry.js +12390 -11094
  13. package/dist/cjs/sqm-tax-and-cash.cjs.entry.js +1221 -0
  14. package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +11 -3
  15. package/dist/cjs/sqm-widget-verification.cjs.entry.js +17 -6
  16. package/dist/cjs/utils-8257e7ab.js +105 -0
  17. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +78 -78
  18. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +37 -3
  19. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-controller.js +39 -5
  20. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +41 -6
  21. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +12 -8
  22. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +1 -1
  23. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +2 -2
  24. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -1
  25. package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.js +1 -1
  26. package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +1 -1
  27. package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +2 -2
  28. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.js +2 -2
  29. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +1 -1
  30. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +2 -2
  31. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +26 -1
  32. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/usePayoutDetailsCard.js +2 -2
  33. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +75 -41
  34. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +1 -1
  35. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +62 -3
  36. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +3 -3
  37. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +5 -4
  38. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +49 -11
  39. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +3 -3
  40. package/dist/collection/utils/parseStates.js +12 -0
  41. package/dist/esm/{ShadowViewAddon-23a6afab.js → AutoColor-d8d7f31d.js} +1141 -1141
  42. package/dist/esm/ErrorView-48e2b969.js +33 -0
  43. package/dist/esm/IndirectTaxDetailsView-c321099a.js +639 -0
  44. package/dist/esm/data-a05c78ae.js +121 -0
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/mint-components.js +1 -1
  47. package/dist/esm/parseStates-ed75e224.js +14 -0
  48. package/dist/esm/{sqm-banking-info-form_17.entry.js → sqm-banking-info-form_10.entry.js} +133 -1802
  49. package/dist/esm/sqm-big-stat_41.entry.js +1 -1
  50. package/dist/esm/sqm-code-verification.entry.js +345 -0
  51. package/dist/esm/sqm-invoice-table-data-cell_5.entry.js +76 -0
  52. package/dist/esm/sqm-stencilbook.entry.js +10501 -9205
  53. package/dist/esm/sqm-tax-and-cash.entry.js +1217 -0
  54. package/dist/esm/sqm-widget-verification-controller.entry.js +12 -4
  55. package/dist/esm/sqm-widget-verification.entry.js +17 -6
  56. package/dist/esm/utils-7c96856c.js +97 -0
  57. package/dist/esm-es5/AutoColor-d8d7f31d.js +1 -0
  58. package/dist/esm-es5/ErrorView-48e2b969.js +1 -0
  59. package/dist/esm-es5/IndirectTaxDetailsView-c321099a.js +1 -0
  60. package/dist/esm-es5/data-a05c78ae.js +1 -0
  61. package/dist/esm-es5/loader.js +1 -1
  62. package/dist/esm-es5/mint-components.js +1 -1
  63. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  64. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -0
  65. package/dist/esm-es5/sqm-big-stat_41.entry.js +1 -1
  66. package/dist/esm-es5/sqm-code-verification.entry.js +1 -0
  67. package/dist/esm-es5/sqm-invoice-table-data-cell_5.entry.js +1 -0
  68. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  69. package/dist/esm-es5/sqm-tax-and-cash.entry.js +1 -0
  70. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
  71. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  72. package/dist/esm-es5/utils-7c96856c.js +1 -0
  73. package/dist/mint-components/mint-components.esm.js +1 -1
  74. package/dist/mint-components/p-0603a39f.js +1 -0
  75. package/dist/mint-components/p-0a37a288.system.entry.js +1 -0
  76. package/dist/mint-components/p-0b8f6a39.entry.js +11 -0
  77. package/dist/mint-components/p-115dfc03.system.js +1 -0
  78. package/dist/mint-components/p-13f3a647.js +1 -0
  79. package/dist/mint-components/p-1a7453c6.system.js +1 -0
  80. package/dist/mint-components/p-33d79be3.entry.js +93 -0
  81. package/dist/mint-components/p-37996351.system.js +1 -1
  82. package/dist/mint-components/p-3a62a7e2.system.js +1 -0
  83. package/dist/mint-components/p-4a46897f.system.js +1 -0
  84. package/dist/mint-components/p-4d11920f.entry.js +1 -0
  85. package/dist/mint-components/p-5510be1e.system.entry.js +1 -0
  86. package/dist/mint-components/p-6ef506ba.entry.js +16 -0
  87. package/dist/mint-components/{p-33ed6f1c.system.entry.js → p-70adcf4f.system.entry.js} +1 -1
  88. package/dist/mint-components/p-70d3d873.system.entry.js +1 -0
  89. package/dist/mint-components/p-7e0bf3de.system.entry.js +1 -0
  90. package/dist/mint-components/p-83acd617.js +1 -0
  91. package/dist/mint-components/p-84a78d09.entry.js +1 -0
  92. package/dist/mint-components/{p-01010af0.entry.js → p-84ed9923.entry.js} +5 -5
  93. package/dist/mint-components/p-889ec1df.system.entry.js +1 -0
  94. package/dist/mint-components/p-8a784f2a.system.entry.js +1 -0
  95. package/dist/mint-components/p-93e4a3c3.system.js +1 -0
  96. package/dist/mint-components/p-98a48fc4.system.entry.js +1 -0
  97. package/dist/mint-components/p-9acb5038.js +1 -0
  98. package/dist/mint-components/p-a38ca165.entry.js +9 -0
  99. package/dist/mint-components/p-c75a3b4a.js +103 -0
  100. package/dist/mint-components/p-d75c462c.entry.js +1 -0
  101. package/dist/mint-components/p-ea7f379d.js +394 -0
  102. package/dist/mint-components/p-f8175201.system.js +1 -0
  103. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +6 -0
  104. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-controller.d.ts +5 -0
  105. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +5 -0
  106. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +0 -1
  107. package/dist/types/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.d.ts +1 -1
  108. package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +2 -2
  109. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.d.ts +4 -0
  110. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -1
  111. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +11 -10
  112. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.d.ts +1 -1
  113. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +1 -1
  114. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +10 -0
  115. package/dist/types/components/tax-and-cash/sqm-user-info-form/small-views/IndirectTaxDetailsView.d.ts +1 -1
  116. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.d.ts +7 -0
  117. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -1
  118. package/dist/types/components/tax-and-cash/utils.d.ts +1 -1
  119. package/dist/types/components.d.ts +96 -89
  120. package/dist/types/global/android.d.ts +7 -0
  121. package/dist/types/global/demo.d.ts +2 -0
  122. package/dist/types/stories/features.d.ts +4 -0
  123. package/dist/types/stories/templates.d.ts +4 -0
  124. package/dist/types/utils/parseStates.d.ts +1 -0
  125. package/docs/docs.docx +0 -0
  126. package/docs/raisins.json +1 -1
  127. package/grapesjs/grapesjs.js +1 -1
  128. package/package.json +2 -1
  129. package/dist/cjs/sqm-invoice-table-view-baded4af.js +0 -2067
  130. package/dist/esm/sqm-invoice-table-view-af69cd33.js +0 -2050
  131. package/dist/esm-es5/ShadowViewAddon-23a6afab.js +0 -1
  132. package/dist/esm-es5/sqm-banking-info-form_17.entry.js +0 -1
  133. package/dist/esm-es5/sqm-invoice-table-view-af69cd33.js +0 -1
  134. package/dist/mint-components/p-33c96e14.entry.js +0 -16
  135. package/dist/mint-components/p-38b5f028.system.entry.js +0 -1
  136. package/dist/mint-components/p-6427e963.entry.js +0 -1
  137. package/dist/mint-components/p-7e7cbccf.system.js +0 -1
  138. package/dist/mint-components/p-9320582e.system.js +0 -1
  139. package/dist/mint-components/p-962f3200.js +0 -1
  140. package/dist/mint-components/p-9cf80e85.system.entry.js +0 -1
  141. package/dist/mint-components/p-b93fd99c.system.entry.js +0 -1
  142. package/dist/mint-components/p-c36506f6.system.entry.js +0 -1
  143. package/dist/mint-components/p-d3d74266.js +0 -394
  144. package/dist/mint-components/p-f29eda2f.entry.js +0 -205
  145. package/dist/mint-components/p-f2cc6a6f.entry.js +0 -9
  146. /package/dist/collection/components/tax-and-cash/{sqm-tax-and-cash/data.js → data.js} +0 -0
  147. /package/dist/types/components/tax-and-cash/{sqm-tax-and-cash/data.d.ts → data.d.ts} +0 -0
@@ -16,6 +16,41 @@ const index$1 = require('./index-8c6255f5.js');
16
16
  const utilities = require('./utilities-78f5e169.js');
17
17
  const sqmPortalContainerView = require('./sqm-portal-container-view-4f15143a.js');
18
18
 
19
+ function BigStatView(props) {
20
+ const { statvalue, flexReverse, alignment } = props;
21
+ // Dependent on props, not feasiable to move out
22
+ const style = {
23
+ Container: {
24
+ display: "flex",
25
+ height: "inherit",
26
+ "justify-content": "space-between",
27
+ "flex-direction": `${flexReverse ? "column-reverse" : "column"}`,
28
+ "align-items": `${alignment === "left"
29
+ ? "flex-start"
30
+ : alignment === "right"
31
+ ? "flex-end"
32
+ : "center"}`,
33
+ },
34
+ Stat: {
35
+ "font-size": "var(--sl-font-size-x-large)",
36
+ "text-align": alignment,
37
+ },
38
+ Description: {
39
+ "font-size": "var(--sl-font-size-small)",
40
+ "font-weight": "var(--sl-font-weight-normal)",
41
+ color: "var(--sl-color-gray-600)",
42
+ "text-transform": "uppercase",
43
+ "text-align": alignment,
44
+ },
45
+ };
46
+ const sheet = JSS.createStyleSheet(style);
47
+ const styleString = sheet.toString();
48
+ return (index.h("div", { part: "stat-wrapper", class: sheet.classes.Container },
49
+ index.h("style", { type: "text/css" }, styleString),
50
+ index.h("div", { part: "stat-value", class: sheet.classes.Stat }, statvalue),
51
+ index.h("div", { part: "stat-description", class: sheet.classes.Description }, props.labelSlot)));
52
+ }
53
+
19
54
  const medium = {
20
55
  facebook: { color: "#1877f2", text: "#fff", icon: "facebook" },
21
56
  twitter: { color: "#000000", text: "#fff", icon: "twitter-x" },
@@ -91,428 +126,159 @@ function ShareButtonView(props, children) {
91
126
  !props.hidetext && children)));
92
127
  }
93
128
 
94
- const style$1 = {
95
- Leaderboard: {
96
- "& table": {
129
+ function StatContainerView(props, children) {
130
+ const divideSpace = () => {
131
+ const spaceValue = getComputedStyle(document.documentElement).getPropertyValue(`--sl-spacing-${props.space}`);
132
+ return `${Math.floor(parseInt(spaceValue) / 2)}rem`;
133
+ };
134
+ // Dependent on props, not feasiable to move out
135
+ const style = {
136
+ StatContainer: {
97
137
  width: "100%",
98
- borderCollapse: "collapse",
99
- },
100
- "& th": {
101
- textAlign: "left",
102
- padding: "var(--sl-spacing-medium)",
103
- paddingTop: "0",
104
- fontSize: "var(--sl-font-size-medium)",
105
- fontWeight: "var(--sl-font-weight-semibold)",
138
+ display: props.display || "grid",
139
+ "grid-template-columns": "repeat(auto-fill, minmax(130px, auto))",
140
+ gap: divideSpace(),
141
+ // First set of styles applies when shadow DOM is disabled, second set applies when shadow DOM is enabled
142
+ "& > *": {
143
+ "border-right": "1px solid #EAEAEA",
144
+ "padding-right": divideSpace(),
145
+ },
146
+ "& > :last-child": {
147
+ "border-right": "none",
148
+ },
149
+ "& > ::slotted(*)": {
150
+ "border-right": "1px solid #EAEAEA",
151
+ "padding-right": divideSpace(),
152
+ height: "100%",
153
+ },
154
+ "& > ::slotted(*:last-child)": {
155
+ "border-right": "none",
156
+ },
157
+ "@media screen and (max-width: 430px)": {
158
+ "& > ::slotted(*)": {
159
+ borderRight: "none",
160
+ },
161
+ },
106
162
  },
107
- "& tr:not(:first-child)": {
108
- borderTop: "1px solid var(--sl-color-neutral-200)",
163
+ StatFrame: {
164
+ display: "flex",
109
165
  },
110
- "& td": {
111
- fontSize: "var(--sl-font-size-medium)",
112
- fontWeight: "var(--sl-font-weight-normal)",
166
+ BorderFix: {
167
+ "border-right": "1px solid transparent",
168
+ width: "0px",
169
+ "margin-left": "-1px",
113
170
  },
114
- "& .ellipses": {
115
- textAlign: "left",
171
+ };
172
+ const sheet = JSS.createStyleSheet(style);
173
+ const styleString = sheet.toString();
174
+ return (index.h("div", { class: sheet.classes.StatFrame, part: "sqm-base" },
175
+ index.h("div", { class: sheet.classes.StatContainer, part: "sqm-inner-container" },
176
+ index.h("style", { type: "text/css" }, styleString),
177
+ children),
178
+ index.h("div", { class: sheet.classes.BorderFix, part: "sqm-border" })));
179
+ }
180
+
181
+ function PortalChangePasswordView(props) {
182
+ const { states, callbacks } = props;
183
+ const style = {
184
+ Dialog: {
116
185
  padding: "0",
117
- color: "var(--sl-color-neutral-500)",
118
- paddingLeft: "25%",
119
- },
120
- "& .highlight": {
121
- background: "var(--sl-color-primary-50)",
122
- },
123
- "& td, th": {
124
- color: "var(--sl-color-gray-800)",
125
- padding: "var(--sl-spacing-medium)",
126
- },
127
- "& .User": {
128
- width: "100%",
186
+ "&::part(close-button)": {
187
+ "margin-top": "var(--sl-spacing-medium)",
188
+ },
189
+ "&::part(body)": {
190
+ padding: "0 var(--sl-spacing-x-large) var(--sl-spacing-x-large) var(--sl-spacing-x-large)",
191
+ },
129
192
  },
130
- "& .Score": {
131
- width: "auto",
132
- whiteSpace: "nowrap",
193
+ Error: {
194
+ "&::part(erroralert-base)": {
195
+ "margin-bottom": "15px",
196
+ },
133
197
  },
134
- "& .Rank": {
135
- whiteSpace: "nowrap",
198
+ Success: {
199
+ "&::part(successalert-base)": {
200
+ "margin-bottom": "15px",
201
+ },
136
202
  },
137
- "& .fullWidth": {
138
- width: "100%",
203
+ InputContainer: {
204
+ "& > :not(:last-child)": {
205
+ "margin-bottom": "var(--sl-spacing-x-large)",
206
+ },
139
207
  },
140
- },
141
- };
142
- const sheet$1 = JSS.createStyleSheet(style$1);
143
- const styleString$1 = sheet$1.toString();
144
- const vanillaStyle = `
145
- :host{
146
- display: block;
147
- }
148
- `;
149
- function LeaderboardView(props) {
150
- var _a, _b, _c;
151
- const { states, data, elements } = props;
152
- const { styles } = states;
153
- if (states.isEssentials) {
154
- return (index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" }));
155
- }
156
- if (states.loading) {
157
- return (index.h("div", { class: sheet$1.classes.Leaderboard, style: { width: styles.width || "100%" } },
158
- index.h("style", { type: "text/css" },
159
- styleString$1,
160
- vanillaStyle),
161
- index.h("table", null, [...Array(10)].map(() => {
162
- return (index.h("tr", null,
163
- index.h("td", null,
164
- index.h("sl-skeleton", null))));
165
- }))));
166
- }
167
- if (!states.hasLeaders)
168
- return elements.empty;
169
- let userSeenFlag = false;
170
- const getUsersName = (user) => {
171
- if (!user.firstName && !user.lastInitial)
172
- return styles.anonymousUser;
173
- const { firstName, lastInitial } = user;
174
- if (firstName && lastInitial)
175
- return `${firstName} ${lastInitial}`;
176
- if (firstName || lastInitial)
177
- return firstName || lastInitial;
178
- return styles.anonymousUser;
179
- };
180
- const getRankCellText = (userRank, isViewingUsersRow) => {
181
- if (!userRank) {
182
- return styles.hideNames ? `${styles.viewingUserText}` : "-";
183
- }
184
- const viewingUserText = ` - ${styles.viewingUserText}`;
185
- return styles.rankSuffix
186
- ? global.intl.formatMessage({
187
- id: "rank",
188
- defaultMessage: styles.rankSuffix,
189
- }, {
190
- rank: userRank,
191
- }) + `${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`
192
- : `${userRank} ${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`;
193
- };
194
- return (index.h("div", { class: sheet$1.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
195
- index.h("style", { type: "text/css" },
196
- styleString$1,
197
- vanillaStyle),
198
- index.h("table", { part: "sqm-table" },
199
- index.h("tr", null,
200
- styles.showRank && (index.h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
201
- !styles.hideNames && index.h("th", { class: "User" }, styles.usersheading),
202
- index.h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
203
- _a.map((user) => {
204
- var _a, _b;
205
- if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
206
- userSeenFlag = true;
207
- const isViewingUsersRow = !styles.hideViewer && user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber);
208
- return (index.h("tr", { class: isViewingUsersRow ? "highlight" : "" },
209
- styles.showRank && (index.h("td", { class: "Rank" }, getRankCellText(user.rank, isViewingUsersRow))),
210
- !styles.hideNames && index.h("td", { class: "User" }, getUsersName(user)),
211
- index.h("td", { class: "Score" }, user.textValue)));
212
- }),
213
- !userSeenFlag && !styles.hideViewer && (index.h("tr", null,
214
- index.h("td", { colSpan: 100, class: "ellipses" },
215
- index.h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
216
- !userSeenFlag && !styles.hideViewer && (index.h("tr", { class: "highlight" },
217
- styles.showRank && (index.h("td", { class: "Rank" }, getRankCellText((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank, true))),
218
- !styles.hideNames && (index.h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
219
- index.h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
220
- }
221
-
222
- function BigStatView(props) {
223
- const { statvalue, flexReverse, alignment } = props;
224
- // Dependent on props, not feasiable to move out
225
- const style = {
226
- Container: {
227
- display: "flex",
228
- height: "inherit",
229
- "justify-content": "space-between",
230
- "flex-direction": `${flexReverse ? "column-reverse" : "column"}`,
231
- "align-items": `${alignment === "left"
232
- ? "flex-start"
233
- : alignment === "right"
234
- ? "flex-end"
235
- : "center"}`,
208
+ CancelButton: {
209
+ width: "25%",
210
+ margin: "var(--sl-spacing-large) auto",
236
211
  },
237
- Stat: {
238
- "font-size": "var(--sl-font-size-x-large)",
239
- "text-align": alignment,
212
+ PasswordField: {
213
+ marginBottom: "var(--sl-spacing-large) !important",
214
+ display: "block",
240
215
  },
241
- Description: {
242
- "font-size": "var(--sl-font-size-small)",
243
- "font-weight": "var(--sl-font-weight-normal)",
244
- color: "var(--sl-color-gray-600)",
245
- "text-transform": "uppercase",
246
- "text-align": alignment,
216
+ ChangePasswordButton: {
217
+ paddingTop: "var(--sl-spacing-x-large)",
247
218
  },
248
219
  };
249
220
  const sheet = JSS.createStyleSheet(style);
250
221
  const styleString = sheet.toString();
251
- return (index.h("div", { part: "stat-wrapper", class: sheet.classes.Container },
222
+ return (index.h("div", null,
252
223
  index.h("style", { type: "text/css" }, styleString),
253
- index.h("div", { part: "stat-value", class: sheet.classes.Stat }, statvalue),
254
- index.h("div", { part: "stat-description", class: sheet.classes.Description }, props.labelSlot)));
255
- }
256
-
257
- const style$2 = {
258
- HostBlock: mixins.HostBlock,
259
- Frame: {
260
- display: "flex",
261
- "flex-direction": "column",
262
- "box-sizing": "border-box",
263
- },
264
- FooterWrapper: {
265
- width: "100%",
266
- "max-width": "100%",
267
- padding: "var(--sl-spacing-medium) var(--sl-spacing-x-large)",
268
- background: "var(--sqm-footer-background)",
269
- display: "flex",
270
- "justify-content": "flex-end",
271
- "align-items": "center",
272
- "box-sizing": "border-box",
273
- "margin-top": "auto",
274
- },
275
- HeaderWrapper: {
276
- width: "100%",
277
- "max-width": "100%",
278
- "box-sizing": "border-box",
279
- display: "flex",
280
- "justify-content": "space-between",
281
- padding: "var(--sl-spacing-small) var(--sl-spacing-large)",
282
- "align-items": "center",
283
- "background-color": "var(--sqm-header-background)",
284
- "@media screen and (max-width: 499px)": {
285
- "flex-direction": "row-reverse",
286
- "justify-content": "flex-end",
287
- padding: "0",
288
- },
289
- },
290
- };
291
- const sheet$2 = JSS.createStyleSheet(style$2);
292
- const styleString$2 = sheet$2.toString();
293
- function PortalFrameView(props, children) {
294
- const { data, notFullScreen } = props;
295
- return (index.h("div", { style: { minHeight: notFullScreen ? "100%" : "100vh" }, class: sheet$2.classes.Frame, part: "sqm-base" },
296
- index.h("style", { type: "text/css" }, styleString$2),
297
- index.h("div", { class: sheet$2.classes.HeaderWrapper, part: "sqm-header" },
298
- data.header,
299
- index.h("slot", { name: "sqm-navigation-menu" })),
300
- children,
301
- index.h("div", { class: sheet$2.classes.FooterWrapper, part: "sqm-footer" }, data.footer)));
302
- }
303
-
304
- const EditProfileView = (props) => {
305
- var _a, _b, _c, _d;
306
- const { states, callbacks } = props;
307
- const { text } = states;
308
- const { errors } = states.formState;
309
- if (states.showEdit) {
310
- return (index.h("div", { class: `CardWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
311
- index.h("h2", { part: "sqm-header", style: {
312
- fontSize: "var(--sl-font-size-x-large)",
313
- margin: "0px",
314
- textAlign: "center",
315
- } }, text.editprofileheader),
316
- index.h("form", { class: "FormWrapper", onSubmit: callbacks.onSubmit },
317
- index.h("div", { class: "FormSection" },
318
- states.formState.error && (index.h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
319
- index.h("div", { part: "erroralert-text" }, states.formState.error))),
320
- index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.firstName, onInput: callbacks.onChange, label: text.firstnametext, disabled: states.loading }, (errors.firstName && errors.firstName.status !== "valid"
321
- ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
322
- : []), { id: "firstName", name: "firstName", error: errors.firstName && errors.firstName.status !== "valid"
323
- ? errors.firstName.message
324
- : undefined })),
325
- index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.lastName, onInput: callbacks.onChange, label: text.lastnametext, disabled: states.loading, id: "lastName", name: "lastName" }, (errors.lastName && errors.lastName.status !== "valid"
326
- ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
327
- : []), { error: errors.lastName && errors.lastName.status !== "valid"
328
- ? errors.lastName.message
329
- : undefined }))),
330
- text.showregion && states.formState.currentRegion && (index.h("sl-input", { exportparts: "label: input-label, base: input-base", disabled: true, value: states.formState.currentRegion, label: text.currentregiontext, id: "currentRegion", name: "currentRegion" })),
331
- index.h("div", { class: "ButtonWrapper" },
332
- index.h("sl-button", { type: "primary", loading: states.loading, disabled: states.submitDisabled, onClick: (e) => {
333
- callbacks.onSubmit(e);
334
- }, submit: true, exportparts: "base: primarybutton-base" }, text.updatetext),
335
- index.h("sl-button", { onClick: () => {
336
- callbacks.setShowEdit(false);
337
- }, exportparts: "base: defaultbutton-base" }, text.canceltext)))));
338
- }
339
- return (index.h("div", { class: `CardWrapper FormWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
340
- index.h("div", { class: "FormSection" },
341
- index.h("h2", { part: "sqm-header", style: {
342
- fontSize: "var(--sl-font-size-x-large)",
343
- marginBottom: "0px",
344
- textAlign: "center",
345
- } }, text.editprofileheader),
346
- index.h("div", null,
347
- index.h("p", { style: { fontSize: "var(--sl-font-size-medium)" } }, (_a = states.user) === null || _a === void 0 ? void 0 :
348
- _a.firstName,
349
- " ", (_b = states.user) === null || _b === void 0 ? void 0 :
350
- _b.lastName),
351
- index.h("p", { style: { fontSize: "var(--sl-font-size-medium)" }, title: (_c = states.user) === null || _c === void 0 ? void 0 : _c.email }, (_d = states.user) === null || _d === void 0 ? void 0 : _d.email))),
352
- index.h("sl-button", { type: "primary", loading: states.loading, onClick: () => {
353
- callbacks.resetForm();
354
- callbacks.setShowEdit(true);
355
- }, exportparts: "base: primarybutton-base" }, text.editprofiletext)));
356
- };
357
-
358
- const MessageLinkQuery = index_module.dist.gql `
359
- query ($programId: ID, $engagementMedium: UserEngagementMedium!) {
360
- user: viewer {
361
- ... on User {
362
- shareLink(
363
- programId: $programId
364
- engagementMedium: $engagementMedium
365
- shareMedium: DIRECT
366
- )
367
- }
368
- }
369
- }
370
- `;
371
- const WIDGET_ENGAGEMENT_EVENT = index_module.dist.gql `
372
- mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
373
- createUserAnalyticsEvent(eventMeta: $eventMeta)
374
- }
375
- `;
376
- function useShareLink(props) {
377
- var _a, _b;
378
- const { programId = index_module.H() } = props;
379
- const user = index_module.J();
380
- const engagementMedium = index_module.B();
381
- const contextData = index_module.Fn(copyTextView.REFERRAL_CODES_NAMESPACE);
382
- const { data } = index_module.wn(MessageLinkQuery, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
383
- const [sendLoadEvent] = index_module.$e(WIDGET_ENGAGEMENT_EVENT);
384
- const [setCopied, copiedRes] = index_module.$e(copyTextView.SET_CODE_COPIED);
385
- const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
386
- // Shown during loading
387
- "...";
388
- const [open, setOpen] = stencilHooks_module.useState(false);
389
- async function onClick() {
390
- if (contextData) {
391
- await setCopied({ referralCode: contextData.referralCode });
392
- contextData.refresh();
393
- }
394
- // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
395
- // Only if called from a user-initiated event
396
- navigator.clipboard.writeText(copyString);
397
- setOpen(true);
398
- setTimeout(() => setOpen(false), props.tooltiplifespan);
399
- sendLoadEvent({
400
- eventMeta: {
401
- programId,
402
- id: user === null || user === void 0 ? void 0 : user.id,
403
- accountId: user === null || user === void 0 ? void 0 : user.accountId,
404
- type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
405
- meta: {
406
- engagementMedium,
407
- shareMedium: "DIRECT",
408
- },
409
- },
410
- });
411
- }
412
- return { ...props, onClick, open, copyString: copyString };
224
+ index.h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, "onSl-hide": () => callbacks.setOpen(false) },
225
+ index.h(sqmPortalContainerView.PortalSectionView, Object.assign({}, {
226
+ labelMargin: "x-large",
227
+ padding: "none",
228
+ label: (index.h(sqmTextSpanView.TextSpanView, Object.assign({}, { type: "h2" }), states.content.modalChangePasswordHeader)),
229
+ content: (index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "none", gap: "32px" }),
230
+ states.error && (index.h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
231
+ index.h("div", { part: "erroralert-text" }, states.error))),
232
+ states.success && (index.h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
233
+ index.h("div", { part: "successalert-text" }, states.content.successMessage))),
234
+ index.h("sl-form", { "onSl-submit": callbacks.submit },
235
+ index.h("div", { class: sheet.classes.InputContainer },
236
+ index.h("sqm-password-field", { exportparts: "input-label: input-label", class: sheet.classes.PasswordField, fieldLabel: states.content.passwordFieldLabel, meetsRequirementsText: states.content.meetsRequirementsText, doesNotMeetRequirementsText: states.content.doesNotMeetRequirementsText, minErrorText: states.content.minErrorText, uppercaseErrorText: states.content.uppercaseErrorText, lowercaseErrorText: states.content.lowercaseErrorText, hasErrorText: states.content.hasErrorText }),
237
+ index.h("sl-input", { exportparts: "label: input-label, base: input-base", name: "/confirmPassword", label: states.content.confirmPasswordFieldLabel, required: true, togglePassword: true, disabled: states.loading, type: "password" })),
238
+ index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "row", padding: "none", gap: "20px" }),
239
+ index.h("sl-button", { class: sheet.classes.ChangePasswordButton, type: "primary", submit: true, loading: states.loading }, states.content.changePasswordButtonText),
240
+ index.h("sl-button", { class: sheet.classes.CancelButton, type: "text", onClick: () => callbacks.setOpen(false) }, states.content.cancelText))))),
241
+ }))),
242
+ index.h(sqmPortalContainerView.PortalSectionView, Object.assign({}, {
243
+ labelMargin: "x-large",
244
+ padding: "xxx-large",
245
+ label: (index.h(sqmTextSpanView.TextSpanView, Object.assign({}, { type: "h2" }), states.content.portalChangePasswordHeader)),
246
+ content: (index.h("sl-button", { onClick: () => callbacks.setOpen(true) }, states.content.portalChangePasswordButtonText)),
247
+ }),
248
+ index.h("style", { type: "text/css" }, styleString))));
413
249
  }
414
250
 
415
- const MessageLinkQuery$1 = index_module.dist.gql `
416
- query (
417
- $programId: ID
418
- $engagementMedium: UserEngagementMedium!
419
- $shareMedium: ReferralShareMedium!
420
- ) {
421
- viewer {
422
- ... on User {
423
- messageLink(
424
- programId: $programId
425
- engagementMedium: $engagementMedium
426
- shareMedium: $shareMedium
427
- )
428
- shareLink(programId: $programId, engagementMedium: $engagementMedium)
429
- }
430
- }
431
- }
432
- `;
433
- function NativeShare(props, directLink, undefinedErrorText, unsupportedPlatformText) {
434
- const title = props.sharetitle || "Share title";
435
- const text = props.sharetext || "Share text";
436
- if (directLink === "undefined") {
437
- return alert(undefinedErrorText);
438
- }
439
- if (window.navigator.share) {
440
- window.navigator
441
- .share({
442
- title,
443
- text,
444
- url: directLink,
445
- })
446
- .catch((error) => console.error("Error on web share", error));
447
- }
448
- else {
449
- alert(unsupportedPlatformText);
450
- }
451
- }
452
- function FacebookShare(directLink, messageLink, errorText) {
453
- if (messageLink === "undefined" || directLink === "undefined") {
454
- return alert(errorText);
455
- }
456
- if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
457
- return SquatchAndroid.shareOnFacebook(directLink, messageLink);
458
- }
459
- else {
460
- return GenericShare(messageLink, errorText);
461
- }
462
- }
463
- function GenericShare(messageLink, errorText) {
464
- return messageLink ? (window.location.href = messageLink) : alert(errorText);
465
- }
466
- function useShareButton(props) {
467
- var _a, _b, _c, _d;
468
- const { sharetitle, sharetext, medium } = props;
469
- const programId = props.programId ? props.programId : index_module.H();
470
- const user = index_module.J();
471
- const engagementMedium = index_module.B();
472
- const variables = {
473
- engagementMedium,
474
- programId: programId,
475
- shareMedium: medium.toUpperCase(),
476
- };
477
- const contextData = index_module.Fn(copyTextView.REFERRAL_CODES_NAMESPACE);
478
- const overrideData = contextData === null || contextData === void 0 ? void 0 : contextData[medium];
479
- // only queries if a programId is available
480
- const res = index_module.wn(MessageLinkQuery$1, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId || overrideData !== undefined);
481
- const [setCopied, copiedRes] = index_module.$e(copyTextView.SET_CODE_COPIED);
482
- const directLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.shareLink) || ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink);
483
- const environment = index_module.getEnvironmentSDK();
484
- const hide = (medium.toLocaleUpperCase() === "SMS" &&
485
- window.orientation === undefined) ||
486
- (medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
487
- const messageLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink) || ((_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.viewer) === null || _d === void 0 ? void 0 : _d.messageLink);
488
- async function onClick() {
489
- if (overrideData) {
490
- await setCopied({ referralCode: contextData.referralCode });
491
- contextData.refresh();
492
- }
493
- if (medium.toLocaleUpperCase() === "FACEBOOK" &&
494
- environment.type === "SquatchAndroid") {
495
- FacebookShare(directLink, messageLink, props.errorText);
496
- }
497
- else if (medium.toLocaleUpperCase() === "DIRECT") {
498
- NativeShare({ sharetitle, sharetext }, directLink, props.errorText, props.unsupportedPlatformText);
499
- }
500
- }
501
- const isPlainLink = !(medium.toLocaleUpperCase() === "FACEBOOK" &&
502
- environment.type === "SquatchAndroid") &&
503
- medium.toLocaleUpperCase() !== "DIRECT" &&
504
- messageLink;
505
- const userAgent = window.navigator.userAgent.toLowerCase(), safari = /safari/.test(userAgent), ios = /iphone|ipod|ipad/.test(userAgent);
506
- const openInSameTab = ios && !safari;
507
- return {
508
- ...props,
509
- loading: res.loading && !(overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink),
510
- messageLink,
511
- isPlainLink,
512
- onClick,
513
- openInSameTab,
514
- hide,
515
- };
251
+ function PoweredByImg({ color = "#A6A6A6", width = 120, height = 16, }) {
252
+ return (index.h("svg", { width: width, height: height, viewBox: "0 0 1662 254", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
253
+ index.h("path", { d: "M801.082 253.58L869.382 1.67969", stroke: color, "stroke-width": "3" }),
254
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M125.682 42.48C123.882 42.48 121.982 42.78 120.382 43.48C118.682 44.18 117.182 45.18 115.882 46.48C114.582 47.68 113.582 49.28 112.882 50.98C112.182 52.68 111.882 54.48 111.982 56.28C112.282 59.68 113.882 63.08 116.382 65.38C118.982 67.78 122.382 68.98 125.782 68.98C129.282 68.98 132.682 67.58 135.182 65.38C137.782 62.98 139.382 59.78 139.582 56.28C139.582 54.38 139.282 52.68 138.682 50.98C137.982 49.28 136.982 47.78 135.682 46.48C134.382 45.18 132.882 44.18 131.182 43.48C129.282 42.78 127.582 42.48 125.682 42.48Z", fill: color }),
255
+ index.h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
256
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
257
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
258
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
259
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M551.282 239.88C549.982 239.88 548.782 240.28 547.682 240.88C546.682 241.58 545.782 242.58 545.382 243.68C544.882 244.78 544.782 246.08 545.082 247.28C545.282 248.58 545.882 249.68 546.882 250.48C547.782 251.38 548.882 251.98 550.082 252.28C551.382 252.48 552.582 252.38 553.782 251.98C554.882 251.48 555.982 250.78 556.582 249.68C557.282 248.68 557.582 247.38 557.582 246.18C557.582 244.48 556.982 242.88 555.682 241.68C554.482 240.48 552.882 239.88 551.282 239.88Z", fill: color }),
260
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M586.182 210.78C592.282 210.78 597.582 213.08 601.082 217.18L601.482 217.68L596.282 223.08L595.782 222.58C594.482 221.18 593.082 220.18 591.382 219.48C589.682 218.78 587.882 218.38 586.082 218.48C578.882 218.48 573.682 224.08 573.682 231.58C573.682 239.18 578.882 244.78 586.082 244.78C589.782 244.68 593.282 243.18 595.882 240.58L596.382 240.08L601.382 245.68L600.982 246.08C597.182 250.18 591.982 252.18 586.082 252.18C574.082 252.18 565.382 243.58 565.382 231.58C565.582 219.48 574.182 210.78 586.182 210.78Z", fill: color }),
261
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M633.782 210.78C621.682 210.78 612.582 219.68 612.582 231.38C612.582 243.08 621.682 251.98 633.782 251.98C645.882 251.98 654.882 243.08 654.882 231.38C655.082 219.78 645.982 210.78 633.782 210.78ZM633.782 244.78C626.382 244.78 620.782 239.28 620.782 231.58C620.782 223.88 626.182 218.48 633.782 218.48C641.182 218.48 646.782 224.08 646.782 231.58C646.782 238.98 641.382 244.78 633.782 244.78Z", fill: color }),
262
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M723.982 228.78C723.982 222.18 720.382 218.28 714.082 218.28C707.682 218.28 703.382 222.78 702.982 228.98V252.18H695.082V228.68C695.082 222.08 691.482 218.18 685.182 218.18C680.082 218.18 674.482 221.48 674.482 228.88V252.08H666.582V211.38H674.482V214.78L676.682 213.28C679.582 211.38 683.082 210.48 686.582 210.48C692.082 210.48 696.782 212.48 699.882 216.08L700.882 217.28L701.882 216.08C704.782 212.48 709.582 210.48 715.182 210.48C725.082 210.48 731.982 217.08 731.982 226.38V251.88H724.082V228.68H723.982V228.78Z", fill: color }),
263
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
264
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
265
+ index.h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
266
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
267
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
268
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
269
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
270
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
271
+ index.h("path", { d: "M34.6815 112.78C40.6815 112.78 46.5815 114.18 51.8815 116.68C57.2815 119.18 62.0815 122.78 65.9815 127.28C67.9815 122.68 69.0815 117.78 69.0815 112.88C69.0815 108.38 68.1815 103.88 66.4815 99.8799C64.6815 95.6799 62.1815 91.9799 58.9815 88.8799C55.7815 85.7799 51.9815 83.2799 47.7815 81.4799C43.5815 79.7799 39.0815 78.8799 34.5815 78.8799C30.0815 78.8799 25.5815 79.6799 21.3815 81.4799C17.1815 83.1799 13.3815 85.7799 10.1815 88.8799C6.98154 91.9799 4.48154 95.7799 2.68154 99.8799C0.881541 104.08 0.081543 108.38 0.081543 112.88C0.181543 117.88 1.18154 122.78 3.18154 127.28C7.08154 122.68 11.8815 119.18 17.1815 116.68C22.7815 113.98 28.7815 112.68 34.6815 112.78Z", fill: color }),
272
+ index.h("path", { d: "M69.1817 153.48C69.1817 146.68 67.1817 140.18 63.2817 134.48C59.4817 128.88 54.0817 124.48 47.7817 121.88C41.4817 119.28 34.4817 118.68 27.7817 119.88C21.0817 121.28 14.8817 124.48 10.0817 129.28C5.28166 134.08 1.88166 140.08 0.681661 146.78C-0.718339 153.48 0.0816607 160.18 2.68166 166.48C5.28166 172.78 9.68166 178.08 15.4817 181.78C21.0817 185.58 27.7817 187.48 34.6817 187.48C43.7817 187.38 52.5817 183.88 59.0817 177.38C65.6817 170.98 69.1817 162.58 69.1817 153.48Z", fill: color }),
273
+ index.h("path", { d: "M69.1817 34.9799C69.1817 28.1799 67.1817 21.6799 63.2817 15.9799C59.4817 10.3799 54.1817 5.9799 47.7817 3.3799C41.4817 0.779901 34.4817 0.1799 27.7817 1.3799C21.0817 2.7799 14.8817 5.97986 10.0817 10.7799C5.28166 15.5799 1.88166 21.5799 0.681661 28.2799C-0.718339 34.9799 0.0816607 41.6799 2.68166 47.9799C5.28166 54.2799 9.68166 59.5799 15.4817 63.2799C21.0817 67.0799 27.7817 68.9799 34.6817 68.9799C43.8817 68.9799 52.6817 65.3799 59.1817 58.9799C65.5817 52.6799 69.1817 43.8799 69.1817 34.9799Z", fill: color }),
274
+ index.h("path", { d: "M962.664 203.95C953.044 203.95 945.244 201.285 939.264 195.955C933.284 190.495 930.294 183.41 930.294 174.7C930.294 165.08 933.739 157.605 940.629 152.275C947.649 146.945 957.464 144.28 970.074 144.28H993.864V138.43C993.864 129.72 991.589 123.09 987.039 118.54C982.619 113.86 976.184 111.52 967.734 111.52C962.014 111.52 956.749 112.885 951.939 115.615C947.129 118.345 943.229 122.18 940.239 127.12L933.999 120.295C937.639 114.575 942.384 110.22 948.234 107.23C954.214 104.11 960.974 102.55 968.514 102.55C979.694 102.55 988.404 105.605 994.644 111.715C1001.01 117.695 1004.2 126.015 1004.2 136.675V184.255C1004.2 188.805 1004.98 194.72 1006.54 202H997.569C996.399 199.14 995.554 194.07 995.034 186.79H994.644C990.874 192.25 986.259 196.475 980.799 199.465C975.339 202.455 969.294 203.95 962.664 203.95ZM962.664 195.175C968.124 195.175 973.259 194.07 978.069 191.86C982.879 189.52 986.714 186.465 989.574 182.695C992.434 178.795 993.864 174.7 993.864 170.41V152.665H969.489C960.389 152.665 953.239 154.615 948.039 158.515C942.969 162.415 940.434 167.81 940.434 174.7C940.434 180.68 942.514 185.62 946.674 189.52C950.834 193.29 956.164 195.175 962.664 195.175Z", fill: color }),
275
+ index.h("path", { d: "M1067.55 203.95C1055.07 203.95 1045.25 199.27 1038.1 189.91C1030.95 180.55 1027.38 167.745 1027.38 151.495C1027.38 136.415 1031.02 124.52 1038.3 115.81C1045.71 106.97 1055.72 102.55 1068.33 102.55C1074.7 102.55 1080.55 104.045 1085.88 107.035C1091.21 110.025 1095.5 114.25 1098.75 119.71H1099.14V57.3101H1109.67V178.21C1109.67 189.13 1109.86 197.06 1110.25 202H1100.89C1100.63 197.84 1100.5 192.12 1100.5 184.84H1100.11C1097.12 190.69 1092.7 195.37 1086.85 198.88C1081 202.26 1074.57 203.95 1067.55 203.95ZM1068.13 195.175C1077.23 195.175 1084.64 192.185 1090.36 186.205C1096.21 180.225 1099.14 172.49 1099.14 163V146.815C1099.14 135.895 1096.41 127.25 1090.95 120.88C1085.49 114.38 1078.08 111.13 1068.72 111.13C1059.1 111.13 1051.49 114.77 1045.9 122.05C1040.44 129.2 1037.71 139.145 1037.71 151.885C1037.71 165.275 1040.44 175.87 1045.9 183.67C1051.36 191.34 1058.77 195.175 1068.13 195.175Z", fill: color }),
276
+ index.h("path", { d: "M1208.57 104.5L1172.3 202H1161.96L1125.5 104.5H1136.61L1167.03 189.715L1197.45 104.5H1208.57Z", fill: color }),
277
+ index.h("path", { d: "M1261.51 203.95C1252.54 203.95 1244.61 201.87 1237.72 197.71C1230.96 193.55 1225.7 187.635 1221.93 179.965C1218.29 172.295 1216.47 163.39 1216.47 153.25C1216.47 143.11 1218.29 134.205 1221.93 126.535C1225.7 118.865 1230.96 112.95 1237.72 108.79C1244.61 104.63 1252.54 102.55 1261.51 102.55C1270.48 102.55 1278.35 104.63 1285.11 108.79C1292 112.95 1297.33 118.865 1301.1 126.535C1304.87 134.205 1306.75 143.11 1306.75 153.25C1306.75 163.39 1304.87 172.295 1301.1 179.965C1297.33 187.635 1292 193.55 1285.11 197.71C1278.35 201.87 1270.48 203.95 1261.51 203.95ZM1261.51 195.37C1268.4 195.37 1274.45 193.615 1279.65 190.105C1284.98 186.595 1289.07 181.655 1291.93 175.285C1294.79 168.915 1296.22 161.57 1296.22 153.25C1296.22 144.93 1294.79 137.585 1291.93 131.215C1289.07 124.845 1284.98 119.905 1279.65 116.395C1274.45 112.885 1268.4 111.13 1261.51 111.13C1254.75 111.13 1248.71 112.885 1243.38 116.395C1238.18 119.905 1234.15 124.845 1231.29 131.215C1228.43 137.585 1227 144.93 1227 153.25C1227 161.57 1228.43 168.915 1231.29 175.285C1234.15 181.655 1238.18 186.595 1243.38 190.105C1248.71 193.615 1254.75 195.37 1261.51 195.37Z", fill: color }),
278
+ index.h("path", { d: "M1366.03 203.95C1352.25 203.95 1341.52 199.53 1333.85 190.69C1326.31 181.72 1322.54 169.24 1322.54 153.25C1322.54 137.39 1326.38 124.975 1334.05 116.005C1341.72 107.035 1352.38 102.55 1366.03 102.55C1373.57 102.55 1380.26 104.11 1386.11 107.23C1391.96 110.22 1396.77 114.575 1400.54 120.295L1394.3 126.34C1391.31 121.66 1387.28 118.02 1382.21 115.42C1377.27 112.69 1371.88 111.325 1366.03 111.325C1355.76 111.325 1347.63 115.03 1341.65 122.44C1335.8 129.85 1332.88 140.12 1332.88 153.25C1332.88 166.38 1335.8 176.65 1341.65 184.06C1347.63 191.47 1355.76 195.175 1366.03 195.175C1371.88 195.175 1377.27 193.875 1382.21 191.275C1387.28 188.545 1391.31 184.84 1394.3 180.16L1400.54 186.205C1396.77 191.925 1391.96 196.345 1386.11 199.465C1380.26 202.455 1373.57 203.95 1366.03 203.95Z", fill: color }),
279
+ index.h("path", { d: "M1446.55 203.95C1436.93 203.95 1429.13 201.285 1423.15 195.955C1417.17 190.495 1414.18 183.41 1414.18 174.7C1414.18 165.08 1417.62 157.605 1424.51 152.275C1431.53 146.945 1441.35 144.28 1453.96 144.28H1477.75V138.43C1477.75 129.72 1475.47 123.09 1470.92 118.54C1466.5 113.86 1460.07 111.52 1451.62 111.52C1445.9 111.52 1440.63 112.885 1435.82 115.615C1431.01 118.345 1427.11 122.18 1424.12 127.12L1417.88 120.295C1421.52 114.575 1426.27 110.22 1432.12 107.23C1438.1 104.11 1444.86 102.55 1452.4 102.55C1463.58 102.55 1472.29 105.605 1478.53 111.715C1484.9 117.695 1488.08 126.015 1488.08 136.675V184.255C1488.08 188.805 1488.86 194.72 1490.42 202H1481.45C1480.28 199.14 1479.44 194.07 1478.92 186.79H1478.53C1474.76 192.25 1470.14 196.475 1464.68 199.465C1459.22 202.455 1453.18 203.95 1446.55 203.95ZM1446.55 195.175C1452.01 195.175 1457.14 194.07 1461.95 191.86C1466.76 189.52 1470.6 186.465 1473.46 182.695C1476.32 178.795 1477.75 174.7 1477.75 170.41V152.665H1453.37C1444.27 152.665 1437.12 154.615 1431.92 158.515C1426.85 162.415 1424.32 167.81 1424.32 174.7C1424.32 180.68 1426.4 185.62 1430.56 189.52C1434.72 193.29 1440.05 195.175 1446.55 195.175Z", fill: color }),
280
+ index.h("path", { d: "M1547.14 203.95C1539.08 203.95 1532.97 201.48 1528.81 196.54C1524.65 191.47 1522.57 184.19 1522.57 174.7V113.275H1505.02V104.5H1522.57V77.9801L1532.32 74.6651H1533.1V104.5H1560.59V113.275H1533.1V172.555C1533.1 180.355 1534.33 186.01 1536.8 189.52C1539.27 193.03 1543.17 194.785 1548.5 194.785C1553.83 194.785 1558.06 194.005 1561.18 192.445L1562.35 200.83C1558.19 202.91 1553.12 203.95 1547.14 203.95Z", fill: color }),
281
+ index.h("path", { d: "M1661.53 157.54H1589.77C1590.42 169.37 1593.54 178.535 1599.13 185.035C1604.85 191.535 1612.65 194.785 1622.53 194.785C1628.51 194.785 1633.97 193.485 1638.91 190.885C1643.98 188.285 1647.95 184.645 1650.81 179.965L1657.24 186.4C1653.34 192.12 1648.4 196.475 1642.42 199.465C1636.57 202.455 1629.94 203.95 1622.53 203.95C1609.01 203.95 1598.35 199.465 1590.55 190.495C1582.88 181.525 1579.05 169.175 1579.05 153.445C1579.05 137.585 1582.82 125.17 1590.36 116.2C1597.9 107.1 1608.23 102.55 1621.36 102.55C1633.84 102.55 1643.66 106.84 1650.81 115.42C1657.96 124 1661.53 135.895 1661.53 151.105V157.54ZM1651.39 147.4C1651.39 136.48 1648.66 127.77 1643.2 121.27C1637.74 114.77 1630.46 111.52 1621.36 111.52C1611.74 111.52 1604.2 114.77 1598.74 121.27C1593.28 127.77 1590.29 137.065 1589.77 149.155H1651.39V147.4Z", fill: color })));
516
282
  }
517
283
 
518
284
  const debug = stencilHooks_module.browser("sq:useBigStat");
@@ -1399,372 +1165,100 @@ function useBigStat(props) {
1399
1165
  value: 0,
1400
1166
  statvalue: "!!!",
1401
1167
  flexReverse,
1402
- alignment,
1403
- loading: false,
1404
- },
1405
- label: "BAD PROP TYPE",
1406
- };
1407
- }
1408
- const result = re.exec(statType);
1409
- const queryName = result[1];
1410
- const statPath = StatPaths.find((pattern) => pattern.name === queryName);
1411
- // Get a list all possible keys in path
1412
- const keys = [];
1413
- const regex = index$1.pathToRegexp(statPath === null || statPath === void 0 ? void 0 : statPath.route, keys, {
1414
- strict: false,
1415
- sensitive: false,
1416
- end: true,
1417
- });
1418
- const allQueryArgs = regex.exec(statType);
1419
- // Retrieve all key values in order including undefined
1420
- const queryArgs = keys.map((_, i) => allQueryArgs[i + 1] ? decodeURIComponent(allQueryArgs[i + 1]) : undefined);
1421
- // remove query name from list
1422
- queryArgs.shift();
1423
- const label = queries[queryName].label;
1424
- const stat = (userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt) && queries[queryName].query(programId, locale, ...queryArgs);
1425
- debug("stat:", stat);
1426
- return {
1427
- props: {
1428
- value: stat === null || stat === void 0 ? void 0 : stat.value,
1429
- statvalue: (_a = stat === null || stat === void 0 ? void 0 : stat.statvalue) !== null && _a !== void 0 ? _a : LOADING,
1430
- loading: stat === null || stat === void 0 ? void 0 : stat.loading,
1431
- flexReverse,
1432
- alignment,
1433
- },
1434
- label,
1435
- };
1436
- }
1437
-
1438
- function useDemoBigStat(props) {
1439
- const { statType } = props;
1440
- const re = stencilHooks_module.useMemo(() => StatPatterns.find((re) => re.exec(statType)), [statType]);
1441
- // triggers a re-render if the label is manually changed
1442
- useChildElements.useChildElements();
1443
- if (!(re === null || re === void 0 ? void 0 : re.exec(statType))) {
1444
- return {
1445
- props: {
1446
- value: 0,
1447
- statvalue: "!!!",
1168
+ alignment,
1448
1169
  loading: false,
1449
- flexReverse: false,
1450
- alignment: "center",
1451
1170
  },
1452
1171
  label: "BAD PROP TYPE",
1453
1172
  };
1454
1173
  }
1455
1174
  const result = re.exec(statType);
1456
1175
  const queryName = result[1];
1176
+ const statPath = StatPaths.find((pattern) => pattern.name === queryName);
1177
+ // Get a list all possible keys in path
1178
+ const keys = [];
1179
+ const regex = index$1.pathToRegexp(statPath === null || statPath === void 0 ? void 0 : statPath.route, keys, {
1180
+ strict: false,
1181
+ sensitive: false,
1182
+ end: true,
1183
+ });
1184
+ const allQueryArgs = regex.exec(statType);
1185
+ // Retrieve all key values in order including undefined
1186
+ const queryArgs = keys.map((_, i) => allQueryArgs[i + 1] ? decodeURIComponent(allQueryArgs[i + 1]) : undefined);
1187
+ // remove query name from list
1188
+ queryArgs.shift();
1457
1189
  const label = queries[queryName].label;
1190
+ const stat = (userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt) && queries[queryName].query(programId, locale, ...queryArgs);
1191
+ debug("stat:", stat);
1458
1192
  return {
1459
- props: cjs.cjs({
1460
- statvalue: "12345",
1461
- value: 0,
1462
- flexReverse: false,
1463
- alignment: "center",
1464
- }, props.demoData || {}, { arrayMerge: (_, a) => a }),
1465
- label: label !== null && label !== void 0 ? label : "Demo Label",
1466
- };
1467
- }
1468
-
1469
- function StatContainerView(props, children) {
1470
- const divideSpace = () => {
1471
- const spaceValue = getComputedStyle(document.documentElement).getPropertyValue(`--sl-spacing-${props.space}`);
1472
- return `${Math.floor(parseInt(spaceValue) / 2)}rem`;
1473
- };
1474
- // Dependent on props, not feasiable to move out
1475
- const style = {
1476
- StatContainer: {
1477
- width: "100%",
1478
- display: props.display || "grid",
1479
- "grid-template-columns": "repeat(auto-fill, minmax(130px, auto))",
1480
- gap: divideSpace(),
1481
- // First set of styles applies when shadow DOM is disabled, second set applies when shadow DOM is enabled
1482
- "& > *": {
1483
- "border-right": "1px solid #EAEAEA",
1484
- "padding-right": divideSpace(),
1485
- },
1486
- "& > :last-child": {
1487
- "border-right": "none",
1488
- },
1489
- "& > ::slotted(*)": {
1490
- "border-right": "1px solid #EAEAEA",
1491
- "padding-right": divideSpace(),
1492
- height: "100%",
1493
- },
1494
- "& > ::slotted(*:last-child)": {
1495
- "border-right": "none",
1496
- },
1497
- "@media screen and (max-width: 430px)": {
1498
- "& > ::slotted(*)": {
1499
- borderRight: "none",
1500
- },
1501
- },
1502
- },
1503
- StatFrame: {
1504
- display: "flex",
1505
- },
1506
- BorderFix: {
1507
- "border-right": "1px solid transparent",
1508
- width: "0px",
1509
- "margin-left": "-1px",
1510
- },
1511
- };
1512
- const sheet = JSS.createStyleSheet(style);
1513
- const styleString = sheet.toString();
1514
- return (index.h("div", { class: sheet.classes.StatFrame, part: "sqm-base" },
1515
- index.h("div", { class: sheet.classes.StatContainer, part: "sqm-inner-container" },
1516
- index.h("style", { type: "text/css" }, styleString),
1517
- children),
1518
- index.h("div", { class: sheet.classes.BorderFix, part: "sqm-border" })));
1519
- }
1520
-
1521
- function PortalChangePasswordView(props) {
1522
- const { states, callbacks } = props;
1523
- const style = {
1524
- Dialog: {
1525
- padding: "0",
1526
- "&::part(close-button)": {
1527
- "margin-top": "var(--sl-spacing-medium)",
1528
- },
1529
- "&::part(body)": {
1530
- padding: "0 var(--sl-spacing-x-large) var(--sl-spacing-x-large) var(--sl-spacing-x-large)",
1531
- },
1532
- },
1533
- Error: {
1534
- "&::part(erroralert-base)": {
1535
- "margin-bottom": "15px",
1536
- },
1537
- },
1538
- Success: {
1539
- "&::part(successalert-base)": {
1540
- "margin-bottom": "15px",
1541
- },
1542
- },
1543
- InputContainer: {
1544
- "& > :not(:last-child)": {
1545
- "margin-bottom": "var(--sl-spacing-x-large)",
1546
- },
1547
- },
1548
- CancelButton: {
1549
- width: "25%",
1550
- margin: "var(--sl-spacing-large) auto",
1551
- },
1552
- PasswordField: {
1553
- marginBottom: "var(--sl-spacing-large) !important",
1554
- display: "block",
1555
- },
1556
- ChangePasswordButton: {
1557
- paddingTop: "var(--sl-spacing-x-large)",
1558
- },
1559
- };
1560
- const sheet = JSS.createStyleSheet(style);
1561
- const styleString = sheet.toString();
1562
- return (index.h("div", null,
1563
- index.h("style", { type: "text/css" }, styleString),
1564
- index.h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, "onSl-hide": () => callbacks.setOpen(false) },
1565
- index.h(sqmPortalContainerView.PortalSectionView, Object.assign({}, {
1566
- labelMargin: "x-large",
1567
- padding: "none",
1568
- label: (index.h(sqmTextSpanView.TextSpanView, Object.assign({}, { type: "h2" }), states.content.modalChangePasswordHeader)),
1569
- content: (index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "none", gap: "32px" }),
1570
- states.error && (index.h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
1571
- index.h("div", { part: "erroralert-text" }, states.error))),
1572
- states.success && (index.h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
1573
- index.h("div", { part: "successalert-text" }, states.content.successMessage))),
1574
- index.h("sl-form", { "onSl-submit": callbacks.submit },
1575
- index.h("div", { class: sheet.classes.InputContainer },
1576
- index.h("sqm-password-field", { exportparts: "input-label: input-label", class: sheet.classes.PasswordField, fieldLabel: states.content.passwordFieldLabel, meetsRequirementsText: states.content.meetsRequirementsText, doesNotMeetRequirementsText: states.content.doesNotMeetRequirementsText, minErrorText: states.content.minErrorText, uppercaseErrorText: states.content.uppercaseErrorText, lowercaseErrorText: states.content.lowercaseErrorText, hasErrorText: states.content.hasErrorText }),
1577
- index.h("sl-input", { exportparts: "label: input-label, base: input-base", name: "/confirmPassword", label: states.content.confirmPasswordFieldLabel, required: true, togglePassword: true, disabled: states.loading, type: "password" })),
1578
- index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "row", padding: "none", gap: "20px" }),
1579
- index.h("sl-button", { class: sheet.classes.ChangePasswordButton, type: "primary", submit: true, loading: states.loading }, states.content.changePasswordButtonText),
1580
- index.h("sl-button", { class: sheet.classes.CancelButton, type: "text", onClick: () => callbacks.setOpen(false) }, states.content.cancelText))))),
1581
- }))),
1582
- index.h(sqmPortalContainerView.PortalSectionView, Object.assign({}, {
1583
- labelMargin: "x-large",
1584
- padding: "xxx-large",
1585
- label: (index.h(sqmTextSpanView.TextSpanView, Object.assign({}, { type: "h2" }), states.content.portalChangePasswordHeader)),
1586
- content: (index.h("sl-button", { onClick: () => callbacks.setOpen(true) }, states.content.portalChangePasswordButtonText)),
1587
- }),
1588
- index.h("style", { type: "text/css" }, styleString))));
1589
- }
1590
-
1591
- const style$3 = {
1592
- Wrapper: { ...mixins.AuthWrapper, "max-width": "600px" },
1593
- Column: mixins.AuthColumn,
1594
- HostBlock: mixins.HostBlock,
1595
- ":host": {
1596
- margin: "0 auto",
1597
- width: "100%",
1598
- },
1599
- ButtonsContainer: mixins.AuthButtonsContainer,
1600
- ErrorStyle: mixins.ErrorStyles,
1601
- };
1602
- const vanillaStyle$1 = `
1603
- sqm-portal-register {
1604
- margin: 0 auto;
1605
- width: 100%;
1606
- display: block;
1607
- }
1608
-
1609
- :host{
1610
- display: block;
1611
- }
1612
-
1613
- :host([hidden]) {
1614
- display: none;
1615
- }
1616
- `;
1617
- const sheet$3 = JSS.createStyleSheet(style$3);
1618
- const styleString$3 = sheet$3.toString();
1619
- function PortalRegisterView(props) {
1620
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1621
- const { states, refs, callbacks, content } = props;
1622
- if (states.error) {
1623
- window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
1624
- }
1625
- return (index.h("div", { class: sheet$3.classes.Wrapper, part: "sqm-base" },
1626
- index.h("style", { type: "text/css" },
1627
- vanillaStyle$1,
1628
- styleString$3),
1629
- index.h(sqmTextSpanView.TextSpanView, { type: "h3" }, content.pageLabel),
1630
- index.h("sl-form", { class: sheet$3.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
1631
- states.error && (index.h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
1632
- index.h("div", { part: "erroralert-text" }, props.states.error))),
1633
- content.formData,
1634
- !states.hideInputs && (index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true, validationError: ({ value }) => {
1635
- if (!value) {
1636
- return content.requiredFieldErrorMessage;
1637
- }
1638
- // this matches shoelace validation, but could be better
1639
- if (!value.includes("@")) {
1640
- return content.invalidEmailErrorMessage;
1641
- }
1642
- } }, (((_b = (_a = states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
1643
- class: sheet$3.classes.ErrorStyle,
1644
- helpText: ((_d = (_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
1645
- content.requiredFieldErrorMessage,
1646
- }
1647
- : [])))),
1648
- !states.hideInputs && (index.h("sqm-password-field", { fieldLabel: content.passwordLabel, "disable-validation": states.disablePasswordValidation, meetsRequirementsText: content.meetsRequirementsText, doesNotMeetRequirementsText: content.doesNotMeetRequirementsText, minErrorText: content.minErrorText, uppercaseErrorText: content.uppercaseErrorText, lowercaseErrorText: content.lowercaseErrorText, hasErrorText: content.hasErrorText })),
1649
- content.passwordField,
1650
- !states.hideInputs && states.confirmPassword && (index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "password", name: "/confirmPassword", label: content.confirmPasswordLabel, disabled: states.loading || ((_e = states.registrationFormState) === null || _e === void 0 ? void 0 : _e.disabled), required: true }, (((_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.confirmPassword) ? {
1651
- value: (_j = (_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.initialData) === null || _j === void 0 ? void 0 : _j.confirmPassword,
1652
- }
1653
- : {}), (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.validationErrors) === null || _l === void 0 ? void 0 : _l.confirmPassword) ? {
1654
- class: sheet$3.classes.ErrorStyle,
1655
- helpText: ((_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.validationErrors) === null || _o === void 0 ? void 0 : _o.confirmPassword) || content.requiredFieldErrorMessage,
1656
- }
1657
- : [])))),
1658
- content.terms,
1659
- index.h("div", { class: sheet$3.classes.ButtonsContainer },
1660
- index.h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"),
1661
- content.secondaryButton))));
1662
- }
1663
-
1664
- const style$4 = {
1665
- ErrorStyle: {
1666
- "&::part(control)": {
1667
- background: "var(--sl-color-danger-10)",
1668
- borderColor: "var(--sl-color-danger-500)",
1669
- outline: "var(--sl-color-danger-500)",
1670
- },
1671
- "&:host": {
1672
- "--focus-ring": "0 0 0 var(--sl-focus-ring-width) red !important",
1673
- },
1674
- },
1675
- ErrorMessageStyle: {
1676
- margin: 0,
1677
- marginTop: "5px",
1678
- color: "var(--sl-color-danger-500)",
1679
- fontSize: "var(--sl-input-help-text-font-size-medium)",
1680
- fontFamily: "var(--sl-font-sans)",
1681
- fontWeight: "var(--sl-font-weight-normal)",
1682
- },
1683
- FieldContainer: {
1684
- "margin-bottom": "var(--sl-spacing-large)",
1685
- },
1686
- };
1687
- const vanillaStyle$2 = `
1688
- :host {
1689
- margin: 0 auto;
1690
- width: 100%;
1691
- display: block;
1692
- }
1693
- sl-checkbox::part(label){
1694
- font-size: var(--sl-input-label-font-size-small);
1695
- font-weight: var(--sl-font-weight-normal);
1696
- line-height: 20px;
1697
- }
1698
- sl-checkbox::part(base){
1699
- align-items: start;
1193
+ props: {
1194
+ value: stat === null || stat === void 0 ? void 0 : stat.value,
1195
+ statvalue: (_a = stat === null || stat === void 0 ? void 0 : stat.statvalue) !== null && _a !== void 0 ? _a : LOADING,
1196
+ loading: stat === null || stat === void 0 ? void 0 : stat.loading,
1197
+ flexReverse,
1198
+ alignment,
1199
+ },
1200
+ label,
1201
+ };
1700
1202
  }
1701
- `;
1702
- JSS.jss.setup(JSS.create());
1703
- const sheet$4 = JSS.jss.createStyleSheet(style$4);
1704
- const styleString$4 = sheet$4.toString();
1705
- function CheckboxFieldView(props) {
1706
- var _b, _c;
1707
- const { states, content, callbacks } = props;
1708
- return (index.h("div", { class: sheet$4.classes.FieldContainer, part: "sqm-base" },
1709
- index.h("style", { type: "text/css" },
1710
- vanillaStyle$2,
1711
- styleString$4),
1712
- index.h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
1713
- e.target.value = e.target.checked;
1714
- callbacks.setChecked(e.target.value);
1715
- } }, (!content.checkboxOptional ? { required: false } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled), required: false }), global.intl.formatMessage({
1716
- id: content.checkboxName + "-message",
1717
- defaultMessage: content.checkboxLabel,
1718
- }, {
1719
- labelLink: (index.h("a", { href: content.checkboxLabelLink, target: "_blank" }, content.checkboxLabelLinkText || content.checkboxLabelLink)),
1720
- }))));
1203
+
1204
+ function useDemoBigStat(props) {
1205
+ const { statType } = props;
1206
+ const re = stencilHooks_module.useMemo(() => StatPatterns.find((re) => re.exec(statType)), [statType]);
1207
+ // triggers a re-render if the label is manually changed
1208
+ useChildElements.useChildElements();
1209
+ if (!(re === null || re === void 0 ? void 0 : re.exec(statType))) {
1210
+ return {
1211
+ props: {
1212
+ value: 0,
1213
+ statvalue: "!!!",
1214
+ loading: false,
1215
+ flexReverse: false,
1216
+ alignment: "center",
1217
+ },
1218
+ label: "BAD PROP TYPE",
1219
+ };
1220
+ }
1221
+ const result = re.exec(statType);
1222
+ const queryName = result[1];
1223
+ const label = queries[queryName].label;
1224
+ return {
1225
+ props: cjs.cjs({
1226
+ statvalue: "12345",
1227
+ value: 0,
1228
+ flexReverse: false,
1229
+ alignment: "center",
1230
+ }, props.demoData || {}, { arrayMerge: (_, a) => a }),
1231
+ label: label !== null && label !== void 0 ? label : "Demo Label",
1232
+ };
1721
1233
  }
1722
1234
 
1723
- function ChangeMarktingView(props) {
1724
- const { states, callbacks } = props;
1725
- const { text, formState } = states;
1726
- const { error } = formState;
1235
+ function CardFeedView(props, children) {
1236
+ // Dependent on props, not feasiable to move out
1727
1237
  const style = {
1728
1238
  Container: {
1729
- display: "flex",
1730
- flexDirection: "column",
1731
- gap: "var(--sl-spacing-x-small)",
1732
- padding: "0 var(--sl-spacing-xxx-large) var(--sl-spacing-xxx-large)",
1733
- },
1734
- SubmitButton: { marginBottom: "var(--sl-spacing-medium)" },
1735
- Error: {
1736
- "&::part(erroralert-base)": {
1737
- "margin-bottom": "15px",
1738
- },
1739
- },
1740
- Success: {
1741
- "&::part(successalert-base)": {
1742
- "margin-bottom": "15px",
1239
+ columnGap: props.gap + "px",
1240
+ columnWidth: props.width + "px",
1241
+ "& > div": {
1242
+ marginBottom: "24px",
1743
1243
  },
1744
1244
  },
1745
1245
  };
1746
1246
  const sheet = JSS.createStyleSheet(style);
1747
1247
  const styleString = sheet.toString();
1748
- return (index.h("div", { class: sheet.classes.Container, part: "sqm-base" },
1749
- index.h("style", { type: "text/css" }, styleString),
1750
- index.h(sqmTextSpanView.TextSpanView, Object.assign({}, { type: "h2" }), text.emailPreferencesHeader),
1751
- index.h("sl-form", { "onSl-submit": callbacks.onSubmit },
1752
- index.h(CheckboxFieldView, { states: {
1753
- checked: states.formState.marketingEmailOptIn,
1754
- }, content: {
1755
- checkboxLabel: text.marketingCheckboxLabel,
1756
- checkboxName: "marketingEmailOptIn",
1757
- }, callbacks: {
1758
- setChecked: callbacks.setChecked,
1759
- } }),
1760
- index.h("sl-button", { class: sheet.classes.SubmitButton, type: "primary", submit: true, loading: states.loading, disabled: states.submitDisabled }, text.submitChangeButtonText),
1761
- error && (index.h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
1762
- index.h("div", { part: "erroralert-text" }, error))),
1763
- states.success && (index.h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
1764
- index.h("div", { part: "successalert-text" }, states.text.successMessage))))));
1248
+ const vanillaStyle = `
1249
+ :host{
1250
+ display: block;
1251
+ }
1252
+
1253
+ `;
1254
+ return (index.h("div", null,
1255
+ index.h("style", { type: "text/css" },
1256
+ styleString,
1257
+ vanillaStyle),
1258
+ index.h("div", { class: sheet.classes.Container, part: "sqm-base" }, children)));
1765
1259
  }
1766
1260
 
1767
- const style$5 = {
1261
+ const style$1 = {
1768
1262
  Description: {
1769
1263
  "& input[type=checkbox]": {
1770
1264
  display: "none",
@@ -1803,13 +1297,13 @@ const style$5 = {
1803
1297
  },
1804
1298
  },
1805
1299
  };
1806
- const sheet$5 = JSS.createStyleSheet(style$5);
1807
- const styleString$5 = sheet$5.toString();
1300
+ const sheet$1 = JSS.createStyleSheet(style$1);
1301
+ const styleString$1 = sheet$1.toString();
1808
1302
  function Details(props) {
1809
1303
  const rid = Math.random().toString(36).slice(2);
1810
1304
  return (index.h("div", { style: { opacity: props.opacity } },
1811
- index.h("style", { type: "text/css" }, styleString$5),
1812
- index.h("span", { class: sheet$5.classes.Description },
1305
+ index.h("style", { type: "text/css" }, styleString$1),
1306
+ index.h("span", { class: sheet$1.classes.Description },
1813
1307
  index.h("input", { type: "checkbox", id: "details-" + rid }),
1814
1308
  index.h("label", { class: "details", htmlFor: "details-" + rid },
1815
1309
  index.h("sl-icon", { exportparts: "base: chevron-icon", name: "chevron-down" })),
@@ -1831,7 +1325,7 @@ const GreyGift = () => {
1831
1325
  index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.70949C14 3.59565 12.6694 4.93746 12 5H9V16H7.00179V5H4.58792C3.21247 4.70182 2 3.64537 2 2.52072C2 1.42474 2.47603 0.556701 3.34184 0.182041C4.16921 -0.175986 5.12452 0.0203328 5.87976 0.544666C6.80676 1.18825 7.32679 2.3963 7.79856 3.49226C7.83996 3.58845 7.88099 3.68378 7.9219 3.77778C7.96173 3.68865 8.00186 3.59793 8.0425 3.50608C8.50995 2.44948 9.04359 1.24325 9.9404 0.59563C10.7332 0.0231438 11.741 -0.193157 12.6121 0.198945C13.5129 0.604397 14 1.53453 14 2.70949ZM10.6123 1.5C11.0928 1.15305 11.668 1.09012 12.1597 1.5C12.5879 1.85694 12.6108 2.02497 12.6658 2.42926L12.6755 2.5C12.6755 3.09851 12.1597 4 11.6439 4C11.2785 4 10.9914 3.99691 10.7224 3.99402C10.2319 3.98875 9.80131 3.98412 9.06496 4C9.20533 3.72786 9.31743 3.46669 9.42434 3.21761C9.71026 2.55143 9.95907 1.97176 10.6123 1.5ZM4.93861 1.5C4.70607 1.33855 4.17281 1.4106 3.95166 1.5063C3.76894 1.58537 3.49602 1.82658 3.49602 2.52072C3.49602 3.19524 4.58792 3.77778 4.58792 3.77778C4.58792 3.77778 5.45441 4 7.00179 4C6.47506 2.69451 5.7289 2.04867 4.93861 1.5Z", fill: "#828282" })));
1832
1326
  };
1833
1327
 
1834
- const style$6 = {
1328
+ const style$2 = {
1835
1329
  ProgressBar: {
1836
1330
  "& .progress-bar": {
1837
1331
  height: "0",
@@ -1943,14 +1437,14 @@ const style$6 = {
1943
1437
  },
1944
1438
  },
1945
1439
  };
1946
- const sheet$6 = JSS.createStyleSheet(style$6, { classNamePrefix: "sqm-prog-bar" });
1947
- const styleString$6 = sheet$6.toString();
1440
+ const sheet$2 = JSS.createStyleSheet(style$2, { classNamePrefix: "sqm-prog-bar" });
1441
+ const styleString$2 = sheet$2.toString();
1948
1442
  function ProgressBarView(props) {
1949
1443
  const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, expired = false, finite = 0, opacity = "1", } = props;
1950
1444
  let aggregate = buildProgressBar(repeatable, steps, props);
1951
1445
  const { columns, items } = aggregate;
1952
- return (index.h("div", { class: sheet$6.classes.ProgressBar, "data-expired": expired, "data-complete": complete, "data-steps": steps, "data-done": goal <= progress, style: { opacity: opacity } },
1953
- index.h("style", { type: "text/css" }, styleString$6),
1446
+ return (index.h("div", { class: sheet$2.classes.ProgressBar, "data-expired": expired, "data-complete": complete, "data-steps": steps, "data-done": goal <= progress, style: { opacity: opacity } },
1447
+ index.h("style", { type: "text/css" }, styleString$2),
1954
1448
  index.h("div", { class: (!Boolean(finite) && progress >= 2 * goal) ||
1955
1449
  (Boolean(finite) && progress > 2 * goal)
1956
1450
  ? "progress-bar repeatable-steps"
@@ -2241,7 +1735,7 @@ const arrow_left_right = () => {
2241
1735
  index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.265 2.789a.346.346 0 000-.489L8.066.101a.346.346 0 10-.489.489l1.61 1.609H2.073a.691.691 0 00-.69.691v1.728a.346.346 0 00.69 0V2.89h7.114L7.577 4.5a.346.346 0 10.49.488l2.198-2.2zM.101 9.21a.346.346 0 000 .489l2.2 2.199a.346.346 0 00.488-.489l-1.61-1.609h7.114c.382 0 .691-.31.691-.691V7.382a.346.346 0 00-.691 0V9.11H1.18L2.789 7.5a.346.346 0 10-.489-.488l-2.199 2.2z", fill: "currentColor" })));
2242
1736
  };
2243
1737
 
2244
- const style$7 = {
1738
+ const style$3 = {
2245
1739
  TaskCard: {
2246
1740
  display: "inline-block",
2247
1741
  width: "100%",
@@ -2395,8 +1889,8 @@ const style$7 = {
2395
1889
  },
2396
1890
  },
2397
1891
  };
2398
- const sheet$7 = JSS.createStyleSheet(style$7);
2399
- const styleString$7 = sheet$7.toString();
1892
+ const sheet$3 = JSS.createStyleSheet(style$3);
1893
+ const styleString$3 = sheet$3.toString();
2400
1894
  function TaskCardView(props) {
2401
1895
  var _a, _b;
2402
1896
  const { callbacks, states, content } = props;
@@ -2432,11 +1926,11 @@ function TaskCardView(props) {
2432
1926
  }
2433
1927
 
2434
1928
  `;
2435
- return (index.h("div", { class: sheet$7.classes.TaskCard, part: "sqm-base" },
1929
+ return (index.h("div", { class: sheet$3.classes.TaskCard, part: "sqm-base" },
2436
1930
  index.h("style", { type: "text/css" },
2437
- styleString$7,
1931
+ styleString$3,
2438
1932
  vanillaStyle),
2439
- !states.loading && taskNotStarted && (index.h("div", { class: sheet$7.classes.NotStarted },
1933
+ !states.loading && taskNotStarted && (index.h("div", { class: sheet$3.classes.NotStarted },
2440
1934
  index.h("span", { class: "icon" },
2441
1935
  index.h("sl-icon", { name: "info-circle-fill" })),
2442
1936
  global.intl.formatMessage({
@@ -2447,7 +1941,7 @@ function TaskCardView(props) {
2447
1941
  .setLocale(utils.luxonLocale(states.locale))
2448
1942
  .toLocaleString(luxon.luxon.DateTime.DATETIME_MED),
2449
1943
  }))),
2450
- !states.loading && taskEnded && (index.h("div", { class: sheet$7.classes.Ended },
1944
+ !states.loading && taskEnded && (index.h("div", { class: sheet$3.classes.Ended },
2451
1945
  index.h("span", { class: "icon" },
2452
1946
  index.h("sl-icon", { exportparts: "base: task-card-icon", name: "exclamation-triangle-fill" })),
2453
1947
  global.intl.formatMessage({
@@ -2467,7 +1961,7 @@ function TaskCardView(props) {
2467
1961
  ? "main complete"
2468
1962
  : "main" },
2469
1963
  index.h("div", { class: "container", part: "sqm-card-container", "data-subdue": taskComplete || taskUnavailable },
2470
- index.h("div", { class: sheet$7.classes.Header, style: { opacity: taskComplete || taskUnavailable ? "0.45" : "1" } }, states.loading ? (index.h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (index.h("div", null,
1964
+ index.h("div", { class: sheet$3.classes.Header, style: { opacity: taskComplete || taskUnavailable ? "0.45" : "1" } }, states.loading ? (index.h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (index.h("div", null,
2471
1965
  showComplete && (index.h("span", { class: taskUnavailable ? "icon neutral" : "icon" }, taskComplete ? checkmark_filled$1 : checkmark_circle$1)),
2472
1966
  index.h("span", { part: "sqm-value", class: "value" }, content.rewardAmount),
2473
1967
  index.h("span", { part: "sqm-unit", class: "text" }, content.rewardUnit)))),
@@ -2483,7 +1977,7 @@ function TaskCardView(props) {
2483
1977
  } }, content.cardTitle)),
2484
1978
  states.loading ? (index.h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (content.description && (index.h(Details, Object.assign({}, props, { opacity: taskComplete || taskUnavailable ? "0.45" : "1" })))),
2485
1979
  content.showProgressBar && states.loading ? (index.h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (content.showProgressBar && (index.h(ProgressBarView, Object.assign({}, props.content, props.states, { opacity: taskComplete || taskUnavailable ? "0.45" : "1", complete: taskComplete, expired: taskUnavailable })))),
2486
- index.h("div", { class: sheet$7.classes.Footer, "data-subdue": taskComplete || taskUnavailable }, states.loading ? (index.h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (index.h("div", { style: { display: "contents" } },
1980
+ index.h("div", { class: sheet$3.classes.Footer, "data-subdue": taskComplete || taskUnavailable }, states.loading ? (index.h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (index.h("div", { style: { display: "contents" } },
2487
1981
  index.h("span", { class: "text" },
2488
1982
  content.repeatable && (index.h("div", null,
2489
1983
  index.h("span", { class: repetitions > 0
@@ -2521,109 +2015,396 @@ function TaskCardView(props) {
2521
2015
  } }, content.buttonText)))))))));
2522
2016
  }
2523
2017
 
2524
- function PoweredByImg({ color = "#A6A6A6", width = 120, height = 16, }) {
2525
- return (index.h("svg", { width: width, height: height, viewBox: "0 0 1662 254", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
2526
- index.h("path", { d: "M801.082 253.58L869.382 1.67969", stroke: color, "stroke-width": "3" }),
2527
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M125.682 42.48C123.882 42.48 121.982 42.78 120.382 43.48C118.682 44.18 117.182 45.18 115.882 46.48C114.582 47.68 113.582 49.28 112.882 50.98C112.182 52.68 111.882 54.48 111.982 56.28C112.282 59.68 113.882 63.08 116.382 65.38C118.982 67.78 122.382 68.98 125.782 68.98C129.282 68.98 132.682 67.58 135.182 65.38C137.782 62.98 139.382 59.78 139.582 56.28C139.582 54.38 139.282 52.68 138.682 50.98C137.982 49.28 136.982 47.78 135.682 46.48C134.382 45.18 132.882 44.18 131.182 43.48C129.282 42.78 127.582 42.48 125.682 42.48Z", fill: color }),
2528
- index.h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
2529
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
2530
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
2531
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
2532
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M551.282 239.88C549.982 239.88 548.782 240.28 547.682 240.88C546.682 241.58 545.782 242.58 545.382 243.68C544.882 244.78 544.782 246.08 545.082 247.28C545.282 248.58 545.882 249.68 546.882 250.48C547.782 251.38 548.882 251.98 550.082 252.28C551.382 252.48 552.582 252.38 553.782 251.98C554.882 251.48 555.982 250.78 556.582 249.68C557.282 248.68 557.582 247.38 557.582 246.18C557.582 244.48 556.982 242.88 555.682 241.68C554.482 240.48 552.882 239.88 551.282 239.88Z", fill: color }),
2533
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M586.182 210.78C592.282 210.78 597.582 213.08 601.082 217.18L601.482 217.68L596.282 223.08L595.782 222.58C594.482 221.18 593.082 220.18 591.382 219.48C589.682 218.78 587.882 218.38 586.082 218.48C578.882 218.48 573.682 224.08 573.682 231.58C573.682 239.18 578.882 244.78 586.082 244.78C589.782 244.68 593.282 243.18 595.882 240.58L596.382 240.08L601.382 245.68L600.982 246.08C597.182 250.18 591.982 252.18 586.082 252.18C574.082 252.18 565.382 243.58 565.382 231.58C565.582 219.48 574.182 210.78 586.182 210.78Z", fill: color }),
2534
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M633.782 210.78C621.682 210.78 612.582 219.68 612.582 231.38C612.582 243.08 621.682 251.98 633.782 251.98C645.882 251.98 654.882 243.08 654.882 231.38C655.082 219.78 645.982 210.78 633.782 210.78ZM633.782 244.78C626.382 244.78 620.782 239.28 620.782 231.58C620.782 223.88 626.182 218.48 633.782 218.48C641.182 218.48 646.782 224.08 646.782 231.58C646.782 238.98 641.382 244.78 633.782 244.78Z", fill: color }),
2535
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M723.982 228.78C723.982 222.18 720.382 218.28 714.082 218.28C707.682 218.28 703.382 222.78 702.982 228.98V252.18H695.082V228.68C695.082 222.08 691.482 218.18 685.182 218.18C680.082 218.18 674.482 221.48 674.482 228.88V252.08H666.582V211.38H674.482V214.78L676.682 213.28C679.582 211.38 683.082 210.48 686.582 210.48C692.082 210.48 696.782 212.48 699.882 216.08L700.882 217.28L701.882 216.08C704.782 212.48 709.582 210.48 715.182 210.48C725.082 210.48 731.982 217.08 731.982 226.38V251.88H724.082V228.68H723.982V228.78Z", fill: color }),
2536
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
2537
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
2538
- index.h("path", { d: "M135.882 89.2798H115.582V187.58H135.882V89.2798Z", fill: color }),
2539
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M231.481 104.18C238.781 93.4799 251.181 87.3799 266.281 87.3799C290.981 87.3799 307.581 103.28 307.381 127.08V187.48H286.781V132.38C286.781 116.38 278.281 107.18 263.381 107.18C248.481 107.18 237.981 117.68 237.981 132.68V187.48H217.281V132.38C217.281 116.38 208.781 107.18 193.881 107.18C178.981 107.18 168.481 117.68 168.481 132.68V187.48H147.981V89.3799H168.681V97.8799C178.081 88.8799 190.181 87.4799 197.081 87.4799C211.881 87.4799 224.381 93.5799 231.481 104.18Z", fill: color }),
2540
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M370.781 87.48C358.581 87.48 347.981 91.38 339.981 98.38V89.28H319.481V226.08H339.981V177.78C347.881 185.08 358.581 188.78 370.781 188.78C398.781 188.78 419.881 166.88 419.881 138.08C419.981 109.28 398.781 87.48 370.781 87.48ZM368.881 169.58C351.481 169.58 338.881 156.38 338.881 138.28C338.881 120.38 351.381 106.98 368.881 106.98C386.281 106.98 398.881 120.08 398.881 138.28C398.881 156.48 386.381 169.58 368.881 169.58Z", fill: color }),
2541
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M701.782 169.88C707.682 169.88 714.082 167.58 719.582 163.98L721.482 162.88L731.482 178.68L729.782 179.88C721.282 186.28 710.982 189.58 700.382 189.58C678.082 189.58 665.782 176.38 665.782 152.28V108.68H645.682V89.3799H665.782V59.8799H686.482V89.2798H725.682V108.48H686.482V151.88C686.482 163.38 691.982 169.88 701.782 169.88Z", fill: color }),
2542
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M511.681 89.4797V98.7797C503.681 91.4797 493.181 87.6797 480.981 87.6797C452.981 87.6797 431.981 109.68 431.981 138.68C431.981 167.78 453.081 189.68 480.981 189.68C493.181 189.68 503.681 185.78 511.681 178.38V187.68H532.381V89.4797H511.681ZM482.881 169.88C465.481 169.88 452.781 156.58 452.781 138.48C452.781 120.48 465.281 106.98 482.881 106.98C500.481 106.98 512.781 120.08 512.781 138.48C512.781 156.68 500.181 169.88 482.881 169.88Z", fill: color }),
2543
- index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M595.281 107.08C604.181 107.08 611.781 110.38 618.781 116.98L620.481 118.68L633.981 104.58L632.581 102.98C623.781 92.98 610.781 87.48 595.781 87.48C565.981 87.48 544.481 109.08 544.481 138.48C544.481 167.98 565.981 189.48 595.781 189.48C610.481 189.48 623.681 183.98 632.581 174.08L633.981 172.58L620.981 158.18L619.281 159.88C612.481 166.48 603.981 169.98 595.481 169.98C578.381 169.98 565.681 156.68 565.681 138.58C565.581 120.58 577.881 107.08 595.281 107.08Z", fill: color }),
2544
- index.h("path", { d: "M34.6815 112.78C40.6815 112.78 46.5815 114.18 51.8815 116.68C57.2815 119.18 62.0815 122.78 65.9815 127.28C67.9815 122.68 69.0815 117.78 69.0815 112.88C69.0815 108.38 68.1815 103.88 66.4815 99.8799C64.6815 95.6799 62.1815 91.9799 58.9815 88.8799C55.7815 85.7799 51.9815 83.2799 47.7815 81.4799C43.5815 79.7799 39.0815 78.8799 34.5815 78.8799C30.0815 78.8799 25.5815 79.6799 21.3815 81.4799C17.1815 83.1799 13.3815 85.7799 10.1815 88.8799C6.98154 91.9799 4.48154 95.7799 2.68154 99.8799C0.881541 104.08 0.081543 108.38 0.081543 112.88C0.181543 117.88 1.18154 122.78 3.18154 127.28C7.08154 122.68 11.8815 119.18 17.1815 116.68C22.7815 113.98 28.7815 112.68 34.6815 112.78Z", fill: color }),
2545
- index.h("path", { d: "M69.1817 153.48C69.1817 146.68 67.1817 140.18 63.2817 134.48C59.4817 128.88 54.0817 124.48 47.7817 121.88C41.4817 119.28 34.4817 118.68 27.7817 119.88C21.0817 121.28 14.8817 124.48 10.0817 129.28C5.28166 134.08 1.88166 140.08 0.681661 146.78C-0.718339 153.48 0.0816607 160.18 2.68166 166.48C5.28166 172.78 9.68166 178.08 15.4817 181.78C21.0817 185.58 27.7817 187.48 34.6817 187.48C43.7817 187.38 52.5817 183.88 59.0817 177.38C65.6817 170.98 69.1817 162.58 69.1817 153.48Z", fill: color }),
2546
- index.h("path", { d: "M69.1817 34.9799C69.1817 28.1799 67.1817 21.6799 63.2817 15.9799C59.4817 10.3799 54.1817 5.9799 47.7817 3.3799C41.4817 0.779901 34.4817 0.1799 27.7817 1.3799C21.0817 2.7799 14.8817 5.97986 10.0817 10.7799C5.28166 15.5799 1.88166 21.5799 0.681661 28.2799C-0.718339 34.9799 0.0816607 41.6799 2.68166 47.9799C5.28166 54.2799 9.68166 59.5799 15.4817 63.2799C21.0817 67.0799 27.7817 68.9799 34.6817 68.9799C43.8817 68.9799 52.6817 65.3799 59.1817 58.9799C65.5817 52.6799 69.1817 43.8799 69.1817 34.9799Z", fill: color }),
2547
- index.h("path", { d: "M962.664 203.95C953.044 203.95 945.244 201.285 939.264 195.955C933.284 190.495 930.294 183.41 930.294 174.7C930.294 165.08 933.739 157.605 940.629 152.275C947.649 146.945 957.464 144.28 970.074 144.28H993.864V138.43C993.864 129.72 991.589 123.09 987.039 118.54C982.619 113.86 976.184 111.52 967.734 111.52C962.014 111.52 956.749 112.885 951.939 115.615C947.129 118.345 943.229 122.18 940.239 127.12L933.999 120.295C937.639 114.575 942.384 110.22 948.234 107.23C954.214 104.11 960.974 102.55 968.514 102.55C979.694 102.55 988.404 105.605 994.644 111.715C1001.01 117.695 1004.2 126.015 1004.2 136.675V184.255C1004.2 188.805 1004.98 194.72 1006.54 202H997.569C996.399 199.14 995.554 194.07 995.034 186.79H994.644C990.874 192.25 986.259 196.475 980.799 199.465C975.339 202.455 969.294 203.95 962.664 203.95ZM962.664 195.175C968.124 195.175 973.259 194.07 978.069 191.86C982.879 189.52 986.714 186.465 989.574 182.695C992.434 178.795 993.864 174.7 993.864 170.41V152.665H969.489C960.389 152.665 953.239 154.615 948.039 158.515C942.969 162.415 940.434 167.81 940.434 174.7C940.434 180.68 942.514 185.62 946.674 189.52C950.834 193.29 956.164 195.175 962.664 195.175Z", fill: color }),
2548
- index.h("path", { d: "M1067.55 203.95C1055.07 203.95 1045.25 199.27 1038.1 189.91C1030.95 180.55 1027.38 167.745 1027.38 151.495C1027.38 136.415 1031.02 124.52 1038.3 115.81C1045.71 106.97 1055.72 102.55 1068.33 102.55C1074.7 102.55 1080.55 104.045 1085.88 107.035C1091.21 110.025 1095.5 114.25 1098.75 119.71H1099.14V57.3101H1109.67V178.21C1109.67 189.13 1109.86 197.06 1110.25 202H1100.89C1100.63 197.84 1100.5 192.12 1100.5 184.84H1100.11C1097.12 190.69 1092.7 195.37 1086.85 198.88C1081 202.26 1074.57 203.95 1067.55 203.95ZM1068.13 195.175C1077.23 195.175 1084.64 192.185 1090.36 186.205C1096.21 180.225 1099.14 172.49 1099.14 163V146.815C1099.14 135.895 1096.41 127.25 1090.95 120.88C1085.49 114.38 1078.08 111.13 1068.72 111.13C1059.1 111.13 1051.49 114.77 1045.9 122.05C1040.44 129.2 1037.71 139.145 1037.71 151.885C1037.71 165.275 1040.44 175.87 1045.9 183.67C1051.36 191.34 1058.77 195.175 1068.13 195.175Z", fill: color }),
2549
- index.h("path", { d: "M1208.57 104.5L1172.3 202H1161.96L1125.5 104.5H1136.61L1167.03 189.715L1197.45 104.5H1208.57Z", fill: color }),
2550
- index.h("path", { d: "M1261.51 203.95C1252.54 203.95 1244.61 201.87 1237.72 197.71C1230.96 193.55 1225.7 187.635 1221.93 179.965C1218.29 172.295 1216.47 163.39 1216.47 153.25C1216.47 143.11 1218.29 134.205 1221.93 126.535C1225.7 118.865 1230.96 112.95 1237.72 108.79C1244.61 104.63 1252.54 102.55 1261.51 102.55C1270.48 102.55 1278.35 104.63 1285.11 108.79C1292 112.95 1297.33 118.865 1301.1 126.535C1304.87 134.205 1306.75 143.11 1306.75 153.25C1306.75 163.39 1304.87 172.295 1301.1 179.965C1297.33 187.635 1292 193.55 1285.11 197.71C1278.35 201.87 1270.48 203.95 1261.51 203.95ZM1261.51 195.37C1268.4 195.37 1274.45 193.615 1279.65 190.105C1284.98 186.595 1289.07 181.655 1291.93 175.285C1294.79 168.915 1296.22 161.57 1296.22 153.25C1296.22 144.93 1294.79 137.585 1291.93 131.215C1289.07 124.845 1284.98 119.905 1279.65 116.395C1274.45 112.885 1268.4 111.13 1261.51 111.13C1254.75 111.13 1248.71 112.885 1243.38 116.395C1238.18 119.905 1234.15 124.845 1231.29 131.215C1228.43 137.585 1227 144.93 1227 153.25C1227 161.57 1228.43 168.915 1231.29 175.285C1234.15 181.655 1238.18 186.595 1243.38 190.105C1248.71 193.615 1254.75 195.37 1261.51 195.37Z", fill: color }),
2551
- index.h("path", { d: "M1366.03 203.95C1352.25 203.95 1341.52 199.53 1333.85 190.69C1326.31 181.72 1322.54 169.24 1322.54 153.25C1322.54 137.39 1326.38 124.975 1334.05 116.005C1341.72 107.035 1352.38 102.55 1366.03 102.55C1373.57 102.55 1380.26 104.11 1386.11 107.23C1391.96 110.22 1396.77 114.575 1400.54 120.295L1394.3 126.34C1391.31 121.66 1387.28 118.02 1382.21 115.42C1377.27 112.69 1371.88 111.325 1366.03 111.325C1355.76 111.325 1347.63 115.03 1341.65 122.44C1335.8 129.85 1332.88 140.12 1332.88 153.25C1332.88 166.38 1335.8 176.65 1341.65 184.06C1347.63 191.47 1355.76 195.175 1366.03 195.175C1371.88 195.175 1377.27 193.875 1382.21 191.275C1387.28 188.545 1391.31 184.84 1394.3 180.16L1400.54 186.205C1396.77 191.925 1391.96 196.345 1386.11 199.465C1380.26 202.455 1373.57 203.95 1366.03 203.95Z", fill: color }),
2552
- index.h("path", { d: "M1446.55 203.95C1436.93 203.95 1429.13 201.285 1423.15 195.955C1417.17 190.495 1414.18 183.41 1414.18 174.7C1414.18 165.08 1417.62 157.605 1424.51 152.275C1431.53 146.945 1441.35 144.28 1453.96 144.28H1477.75V138.43C1477.75 129.72 1475.47 123.09 1470.92 118.54C1466.5 113.86 1460.07 111.52 1451.62 111.52C1445.9 111.52 1440.63 112.885 1435.82 115.615C1431.01 118.345 1427.11 122.18 1424.12 127.12L1417.88 120.295C1421.52 114.575 1426.27 110.22 1432.12 107.23C1438.1 104.11 1444.86 102.55 1452.4 102.55C1463.58 102.55 1472.29 105.605 1478.53 111.715C1484.9 117.695 1488.08 126.015 1488.08 136.675V184.255C1488.08 188.805 1488.86 194.72 1490.42 202H1481.45C1480.28 199.14 1479.44 194.07 1478.92 186.79H1478.53C1474.76 192.25 1470.14 196.475 1464.68 199.465C1459.22 202.455 1453.18 203.95 1446.55 203.95ZM1446.55 195.175C1452.01 195.175 1457.14 194.07 1461.95 191.86C1466.76 189.52 1470.6 186.465 1473.46 182.695C1476.32 178.795 1477.75 174.7 1477.75 170.41V152.665H1453.37C1444.27 152.665 1437.12 154.615 1431.92 158.515C1426.85 162.415 1424.32 167.81 1424.32 174.7C1424.32 180.68 1426.4 185.62 1430.56 189.52C1434.72 193.29 1440.05 195.175 1446.55 195.175Z", fill: color }),
2553
- index.h("path", { d: "M1547.14 203.95C1539.08 203.95 1532.97 201.48 1528.81 196.54C1524.65 191.47 1522.57 184.19 1522.57 174.7V113.275H1505.02V104.5H1522.57V77.9801L1532.32 74.6651H1533.1V104.5H1560.59V113.275H1533.1V172.555C1533.1 180.355 1534.33 186.01 1536.8 189.52C1539.27 193.03 1543.17 194.785 1548.5 194.785C1553.83 194.785 1558.06 194.005 1561.18 192.445L1562.35 200.83C1558.19 202.91 1553.12 203.95 1547.14 203.95Z", fill: color }),
2554
- index.h("path", { d: "M1661.53 157.54H1589.77C1590.42 169.37 1593.54 178.535 1599.13 185.035C1604.85 191.535 1612.65 194.785 1622.53 194.785C1628.51 194.785 1633.97 193.485 1638.91 190.885C1643.98 188.285 1647.95 184.645 1650.81 179.965L1657.24 186.4C1653.34 192.12 1648.4 196.475 1642.42 199.465C1636.57 202.455 1629.94 203.95 1622.53 203.95C1609.01 203.95 1598.35 199.465 1590.55 190.495C1582.88 181.525 1579.05 169.175 1579.05 153.445C1579.05 137.585 1582.82 125.17 1590.36 116.2C1597.9 107.1 1608.23 102.55 1621.36 102.55C1633.84 102.55 1643.66 106.84 1650.81 115.42C1657.96 124 1661.53 135.895 1661.53 151.105V157.54ZM1651.39 147.4C1651.39 136.48 1648.66 127.77 1643.2 121.27C1637.74 114.77 1630.46 111.52 1621.36 111.52C1611.74 111.52 1604.2 114.77 1598.74 121.27C1593.28 127.77 1590.29 137.065 1589.77 149.155H1651.39V147.4Z", fill: color })));
2018
+ const style$4 = {
2019
+ Wrapper: { ...mixins.AuthWrapper, "max-width": "600px" },
2020
+ Column: mixins.AuthColumn,
2021
+ HostBlock: mixins.HostBlock,
2022
+ ":host": {
2023
+ margin: "0 auto",
2024
+ width: "100%",
2025
+ },
2026
+ ButtonsContainer: mixins.AuthButtonsContainer,
2027
+ ErrorStyle: mixins.ErrorStyles,
2028
+ };
2029
+ const vanillaStyle = `
2030
+ sqm-portal-register {
2031
+ margin: 0 auto;
2032
+ width: 100%;
2033
+ display: block;
2034
+ }
2035
+
2036
+ :host{
2037
+ display: block;
2038
+ }
2039
+
2040
+ :host([hidden]) {
2041
+ display: none;
2042
+ }
2043
+ `;
2044
+ const sheet$4 = JSS.createStyleSheet(style$4);
2045
+ const styleString$4 = sheet$4.toString();
2046
+ function PortalRegisterView(props) {
2047
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2048
+ const { states, refs, callbacks, content } = props;
2049
+ if (states.error) {
2050
+ window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
2051
+ }
2052
+ return (index.h("div", { class: sheet$4.classes.Wrapper, part: "sqm-base" },
2053
+ index.h("style", { type: "text/css" },
2054
+ vanillaStyle,
2055
+ styleString$4),
2056
+ index.h(sqmTextSpanView.TextSpanView, { type: "h3" }, content.pageLabel),
2057
+ index.h("sl-form", { class: sheet$4.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
2058
+ states.error && (index.h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
2059
+ index.h("div", { part: "erroralert-text" }, props.states.error))),
2060
+ content.formData,
2061
+ !states.hideInputs && (index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true, validationError: ({ value }) => {
2062
+ if (!value) {
2063
+ return content.requiredFieldErrorMessage;
2064
+ }
2065
+ // this matches shoelace validation, but could be better
2066
+ if (!value.includes("@")) {
2067
+ return content.invalidEmailErrorMessage;
2068
+ }
2069
+ } }, (((_b = (_a = states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
2070
+ class: sheet$4.classes.ErrorStyle,
2071
+ helpText: ((_d = (_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
2072
+ content.requiredFieldErrorMessage,
2073
+ }
2074
+ : [])))),
2075
+ !states.hideInputs && (index.h("sqm-password-field", { fieldLabel: content.passwordLabel, "disable-validation": states.disablePasswordValidation, meetsRequirementsText: content.meetsRequirementsText, doesNotMeetRequirementsText: content.doesNotMeetRequirementsText, minErrorText: content.minErrorText, uppercaseErrorText: content.uppercaseErrorText, lowercaseErrorText: content.lowercaseErrorText, hasErrorText: content.hasErrorText })),
2076
+ content.passwordField,
2077
+ !states.hideInputs && states.confirmPassword && (index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "password", name: "/confirmPassword", label: content.confirmPasswordLabel, disabled: states.loading || ((_e = states.registrationFormState) === null || _e === void 0 ? void 0 : _e.disabled), required: true }, (((_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.confirmPassword) ? {
2078
+ value: (_j = (_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.initialData) === null || _j === void 0 ? void 0 : _j.confirmPassword,
2079
+ }
2080
+ : {}), (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.validationErrors) === null || _l === void 0 ? void 0 : _l.confirmPassword) ? {
2081
+ class: sheet$4.classes.ErrorStyle,
2082
+ helpText: ((_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.validationErrors) === null || _o === void 0 ? void 0 : _o.confirmPassword) || content.requiredFieldErrorMessage,
2083
+ }
2084
+ : [])))),
2085
+ content.terms,
2086
+ index.h("div", { class: sheet$4.classes.ButtonsContainer },
2087
+ index.h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"),
2088
+ content.secondaryButton))));
2089
+ }
2090
+
2091
+ const style$5 = {
2092
+ ErrorStyle: {
2093
+ "&::part(control)": {
2094
+ background: "var(--sl-color-danger-10)",
2095
+ borderColor: "var(--sl-color-danger-500)",
2096
+ outline: "var(--sl-color-danger-500)",
2097
+ },
2098
+ "&:host": {
2099
+ "--focus-ring": "0 0 0 var(--sl-focus-ring-width) red !important",
2100
+ },
2101
+ },
2102
+ ErrorMessageStyle: {
2103
+ margin: 0,
2104
+ marginTop: "5px",
2105
+ color: "var(--sl-color-danger-500)",
2106
+ fontSize: "var(--sl-input-help-text-font-size-medium)",
2107
+ fontFamily: "var(--sl-font-sans)",
2108
+ fontWeight: "var(--sl-font-weight-normal)",
2109
+ },
2110
+ FieldContainer: {
2111
+ "margin-bottom": "var(--sl-spacing-large)",
2112
+ },
2113
+ };
2114
+ const vanillaStyle$1 = `
2115
+ :host {
2116
+ margin: 0 auto;
2117
+ width: 100%;
2118
+ display: block;
2119
+ }
2120
+ sl-checkbox::part(label){
2121
+ font-size: var(--sl-input-label-font-size-small);
2122
+ font-weight: var(--sl-font-weight-normal);
2123
+ line-height: 20px;
2124
+ }
2125
+ sl-checkbox::part(base){
2126
+ align-items: start;
2127
+ }
2128
+ `;
2129
+ JSS.jss.setup(JSS.create());
2130
+ const sheet$5 = JSS.jss.createStyleSheet(style$5);
2131
+ const styleString$5 = sheet$5.toString();
2132
+ function CheckboxFieldView(props) {
2133
+ var _b, _c;
2134
+ const { states, content, callbacks } = props;
2135
+ return (index.h("div", { class: sheet$5.classes.FieldContainer, part: "sqm-base" },
2136
+ index.h("style", { type: "text/css" },
2137
+ vanillaStyle$1,
2138
+ styleString$5),
2139
+ index.h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
2140
+ e.target.value = e.target.checked;
2141
+ callbacks.setChecked(e.target.value);
2142
+ } }, (!content.checkboxOptional ? { required: false } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled), required: false }), global.intl.formatMessage({
2143
+ id: content.checkboxName + "-message",
2144
+ defaultMessage: content.checkboxLabel,
2145
+ }, {
2146
+ labelLink: (index.h("a", { href: content.checkboxLabelLink, target: "_blank" }, content.checkboxLabelLinkText || content.checkboxLabelLink)),
2147
+ }))));
2555
2148
  }
2556
2149
 
2557
- const vanillaStyle$3 = `
2150
+ const style$6 = {
2151
+ HostBlock: mixins.HostBlock,
2152
+ couponCodeLabel: {
2153
+ margin: "var(--sl-spacing-x-small) 0",
2154
+ color: "var(--sl-color-gray-500)",
2155
+ fontSize: "var(--sl-font-size-small)",
2156
+ },
2157
+ };
2158
+ const vanillaStyle$2 = `
2558
2159
  :host{
2559
- margin: 0 auto;
2160
+ display: block;
2560
2161
  width: 100%;
2561
2162
  }
2562
- a{
2563
- cursor:pointer;
2564
- color: inherit;
2565
- text-decoration: none;
2566
- }
2567
2163
  `;
2568
- function PortalFooterView(props) {
2569
- const style = {
2570
- RowContainer: {
2571
- display: "flex",
2572
- "& > :not(:last-child)": {
2573
- "margin-right": "var(--sl-spacing-large)",
2574
- },
2164
+ const sheet$6 = JSS.createStyleSheet(style$6);
2165
+ const styleString$6 = sheet$6.toString();
2166
+ function CouponCodeView(props) {
2167
+ const error = !props.loading && props.error;
2168
+ return (index.h("div", null,
2169
+ index.h("style", { type: "text/css" },
2170
+ styleString$6,
2171
+ vanillaStyle$2),
2172
+ index.h("p", { class: sheet$6.classes.couponCodeLabel, style: { textAlign: props.textAlign } }, props.couponCodeLabel),
2173
+ error ? (index.h("sqm-form-message", { type: props.errorType, exportparts: "erroralert-icon" },
2174
+ index.h("div", { part: "erroralert-text" }, props.errorText))) : (index.h(copyTextView.CopyTextView, Object.assign({}, props)))));
2175
+ }
2176
+
2177
+ const style$7 = {
2178
+ ErrorStyle: {
2179
+ "--sl-input-border-color": "var(--sl-color-danger-500)",
2180
+ "--sl-input-background-color": "var(--sl-color-danger-10)",
2181
+ "--sl-input-border-color-focus": "var(--sl-color-danger-500)",
2182
+ "--sl-input-border-color-hover": "var(--sl-color-danger-500)",
2183
+ },
2184
+ ErrorMessageStyle: {
2185
+ margin: 0,
2186
+ color: "var(--sl-color-danger-500)",
2187
+ fontSize: "var(--sl-input-help-text-font-size-medium)",
2188
+ },
2189
+ FieldContainer: {
2190
+ "margin-bottom": "var(--sl-spacing-large)",
2191
+ },
2192
+ };
2193
+ const vanillaStyle$3 = `
2194
+ :host {
2195
+ margin: 0 auto;
2196
+ width: 100%;
2197
+ display: block;
2198
+ }
2199
+ sl-select::part(label){
2200
+ font-size: var(--sl-input-label-font-size-small);
2201
+ font-weight: var(--sl-font-weight-semibold);
2202
+ }
2203
+ `;
2204
+ JSS.jss.setup(JSS.create());
2205
+ const sheet$7 = JSS.jss.createStyleSheet(style$7);
2206
+ const styleString$7 = sheet$7.toString();
2207
+ function DropdownFieldView(props) {
2208
+ var _a, _b, _c, _d, _e, _f, _g;
2209
+ const { states, content } = props;
2210
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2211
+ return (index.h("div", { class: sheet$7.classes.FieldContainer, part: "sqm-base" },
2212
+ index.h("style", { type: "text/css" },
2213
+ vanillaStyle$3,
2214
+ styleString$7),
2215
+ index.h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.dropdownName]) ? {
2216
+ value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.dropdownName],
2217
+ }
2218
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) ? {
2219
+ class: sheet$7.classes.ErrorStyle,
2220
+ }
2221
+ : [])), content.selectOptions),
2222
+ (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (index.h("p", { class: sheet$7.classes.ErrorMessageStyle }, global.intl.formatMessage({
2223
+ id: `errorMessage-${content.dropdownName}`,
2224
+ defaultMessage: content.errorMessage,
2225
+ })))));
2226
+ }
2227
+
2228
+ const EditProfileView = (props) => {
2229
+ var _a, _b, _c, _d;
2230
+ const { states, callbacks } = props;
2231
+ const { text } = states;
2232
+ const { errors } = states.formState;
2233
+ if (states.showEdit) {
2234
+ return (index.h("div", { class: `CardWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
2235
+ index.h("h2", { part: "sqm-header", style: {
2236
+ fontSize: "var(--sl-font-size-x-large)",
2237
+ margin: "0px",
2238
+ textAlign: "center",
2239
+ } }, text.editprofileheader),
2240
+ index.h("form", { class: "FormWrapper", onSubmit: callbacks.onSubmit },
2241
+ index.h("div", { class: "FormSection" },
2242
+ states.formState.error && (index.h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
2243
+ index.h("div", { part: "erroralert-text" }, states.formState.error))),
2244
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.firstName, onInput: callbacks.onChange, label: text.firstnametext, disabled: states.loading }, (errors.firstName && errors.firstName.status !== "valid"
2245
+ ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
2246
+ : []), { id: "firstName", name: "firstName", error: errors.firstName && errors.firstName.status !== "valid"
2247
+ ? errors.firstName.message
2248
+ : undefined })),
2249
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: states.formState.lastName, onInput: callbacks.onChange, label: text.lastnametext, disabled: states.loading, id: "lastName", name: "lastName" }, (errors.lastName && errors.lastName.status !== "valid"
2250
+ ? { class: "ErrorStyles", helpText: text.fieldEmptyText }
2251
+ : []), { error: errors.lastName && errors.lastName.status !== "valid"
2252
+ ? errors.lastName.message
2253
+ : undefined }))),
2254
+ text.showregion && states.formState.currentRegion && (index.h("sl-input", { exportparts: "label: input-label, base: input-base", disabled: true, value: states.formState.currentRegion, label: text.currentregiontext, id: "currentRegion", name: "currentRegion" })),
2255
+ index.h("div", { class: "ButtonWrapper" },
2256
+ index.h("sl-button", { type: "primary", loading: states.loading, disabled: states.submitDisabled, onClick: (e) => {
2257
+ callbacks.onSubmit(e);
2258
+ }, submit: true, exportparts: "base: primarybutton-base" }, text.updatetext),
2259
+ index.h("sl-button", { onClick: () => {
2260
+ callbacks.setShowEdit(false);
2261
+ }, exportparts: "base: defaultbutton-base" }, text.canceltext)))));
2262
+ }
2263
+ return (index.h("div", { class: `CardWrapper FormWrapper ${!states.showEdit && "ShowEdit"}`, part: "sqm-base" },
2264
+ index.h("div", { class: "FormSection" },
2265
+ index.h("h2", { part: "sqm-header", style: {
2266
+ fontSize: "var(--sl-font-size-x-large)",
2267
+ marginBottom: "0px",
2268
+ textAlign: "center",
2269
+ } }, text.editprofileheader),
2270
+ index.h("div", null,
2271
+ index.h("p", { style: { fontSize: "var(--sl-font-size-medium)" } }, (_a = states.user) === null || _a === void 0 ? void 0 :
2272
+ _a.firstName,
2273
+ " ", (_b = states.user) === null || _b === void 0 ? void 0 :
2274
+ _b.lastName),
2275
+ index.h("p", { style: { fontSize: "var(--sl-font-size-medium)" }, title: (_c = states.user) === null || _c === void 0 ? void 0 : _c.email }, (_d = states.user) === null || _d === void 0 ? void 0 : _d.email))),
2276
+ index.h("sl-button", { type: "primary", loading: states.loading, onClick: () => {
2277
+ callbacks.resetForm();
2278
+ callbacks.setShowEdit(true);
2279
+ }, exportparts: "base: primarybutton-base" }, text.editprofiletext)));
2280
+ };
2281
+
2282
+ const style$8 = {
2283
+ Leaderboard: {
2284
+ "& table": {
2285
+ width: "100%",
2286
+ borderCollapse: "collapse",
2575
2287
  },
2576
- Container: {
2577
- display: "flex",
2578
- "flex-direction": "column",
2579
- "align-items": "center",
2580
- "font-size": "var(--sl-font-size-small)",
2581
- color: "var(--sl-color-gray-600)",
2582
- "padding-top": `var(--sl-spacing-${props.paddingTop})`,
2583
- "padding-right": `var(--sl-spacing-${props.paddingRight})`,
2584
- "padding-bottom": `var(--sl-spacing-${props.paddingBottom})`,
2585
- "padding-left": `var(--sl-spacing-${props.paddingLeft})`,
2586
- "row-gap": `var(--sl-spacing-small)`,
2587
- "& a:hover": {
2588
- color: "var(--sl-color-gray-900)",
2589
- },
2288
+ "& th": {
2289
+ textAlign: "left",
2290
+ padding: "var(--sl-spacing-medium)",
2291
+ paddingTop: "0",
2292
+ fontSize: "var(--sl-font-size-medium)",
2293
+ fontWeight: "var(--sl-font-weight-semibold)",
2590
2294
  },
2591
- SupportText: {
2592
- textAlign: "center",
2593
- margin: 0,
2295
+ "& tr:not(:first-child)": {
2296
+ borderTop: "1px solid var(--sl-color-neutral-200)",
2594
2297
  },
2595
- PoweredByLink: {
2596
- color: "var(--sl-color-gray-400)",
2597
- "font-size": "var(--sl-font-size-small)",
2598
- display: "flex",
2599
- alignItems: "center",
2600
- svg: {
2601
- marginTop: "2px",
2602
- shapeRendering: "geometricprecision",
2603
- },
2604
- "&:hover, &:hover *": {
2605
- color: "var(--sl-color-gray-900)",
2606
- },
2298
+ "& td": {
2299
+ fontSize: "var(--sl-font-size-medium)",
2300
+ fontWeight: "var(--sl-font-weight-normal)",
2301
+ },
2302
+ "& .ellipses": {
2303
+ textAlign: "left",
2304
+ padding: "0",
2305
+ color: "var(--sl-color-neutral-500)",
2306
+ paddingLeft: "25%",
2307
+ },
2308
+ "& .highlight": {
2309
+ background: "var(--sl-color-primary-50)",
2310
+ },
2311
+ "& td, th": {
2312
+ color: "var(--sl-color-gray-800)",
2313
+ padding: "var(--sl-spacing-medium)",
2314
+ },
2315
+ "& .User": {
2316
+ width: "100%",
2317
+ },
2318
+ "& .Score": {
2319
+ width: "auto",
2320
+ whiteSpace: "nowrap",
2321
+ },
2322
+ "& .Rank": {
2323
+ whiteSpace: "nowrap",
2324
+ },
2325
+ "& .fullWidth": {
2326
+ width: "100%",
2607
2327
  },
2328
+ },
2329
+ };
2330
+ const sheet$8 = JSS.createStyleSheet(style$8);
2331
+ const styleString$8 = sheet$8.toString();
2332
+ const vanillaStyle$4 = `
2333
+ :host{
2334
+ display: block;
2335
+ }
2336
+ `;
2337
+ function LeaderboardView(props) {
2338
+ var _a, _b, _c;
2339
+ const { states, data, elements } = props;
2340
+ const { styles } = states;
2341
+ if (states.isEssentials) {
2342
+ return (index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" }));
2343
+ }
2344
+ if (states.loading) {
2345
+ return (index.h("div", { class: sheet$8.classes.Leaderboard, style: { width: styles.width || "100%" } },
2346
+ index.h("style", { type: "text/css" },
2347
+ styleString$8,
2348
+ vanillaStyle$4),
2349
+ index.h("table", null, [...Array(10)].map(() => {
2350
+ return (index.h("tr", null,
2351
+ index.h("td", null,
2352
+ index.h("sl-skeleton", null))));
2353
+ }))));
2354
+ }
2355
+ if (!states.hasLeaders)
2356
+ return elements.empty;
2357
+ let userSeenFlag = false;
2358
+ const getUsersName = (user) => {
2359
+ if (!user.firstName && !user.lastInitial)
2360
+ return styles.anonymousUser;
2361
+ const { firstName, lastInitial } = user;
2362
+ if (firstName && lastInitial)
2363
+ return `${firstName} ${lastInitial}`;
2364
+ if (firstName || lastInitial)
2365
+ return firstName || lastInitial;
2366
+ return styles.anonymousUser;
2608
2367
  };
2609
- const sheet = JSS.createStyleSheet(style);
2610
- const styleString = sheet.toString();
2611
- return (index.h("div", { class: sheet.classes.Container, part: "sqm-base" },
2368
+ const getRankCellText = (userRank, isViewingUsersRow) => {
2369
+ if (!userRank) {
2370
+ return styles.hideNames ? `${styles.viewingUserText}` : "-";
2371
+ }
2372
+ const viewingUserText = ` - ${styles.viewingUserText}`;
2373
+ return styles.rankSuffix
2374
+ ? global.intl.formatMessage({
2375
+ id: "rank",
2376
+ defaultMessage: styles.rankSuffix,
2377
+ }, {
2378
+ rank: userRank,
2379
+ }) + `${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`
2380
+ : `${userRank} ${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`;
2381
+ };
2382
+ return (index.h("div", { class: sheet$8.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
2612
2383
  index.h("style", { type: "text/css" },
2613
- vanillaStyle$3,
2614
- styleString),
2615
- index.h("div", { class: sheet.classes.RowContainer },
2616
- props.faqLink && (index.h("a", { target: "_blank", href: props.faqLink }, props.faqText)),
2617
- props.termsLink && (index.h("a", { target: "_blank", href: props.termsLink }, props.termsText))),
2618
- !props.hideSupportText && (index.h("p", { class: sheet.classes.SupportText }, global.intl.formatMessage({
2619
- id: "supportFooter",
2620
- defaultMessage: props.supportText,
2621
- }, {
2622
- email: (index.h("a", { target: "_blank", href: `mailto:${props.supportEmail}` }, props.supportEmail)),
2623
- }))),
2624
- !props.hidePoweredBy && (index.h("a", { class: sheet.classes.PoweredByLink, target: "_blank", href: props.poweredByLink },
2625
- "Powered by ",
2626
- index.h(PoweredByImg, { color: "currentColor" })))));
2384
+ styleString$8,
2385
+ vanillaStyle$4),
2386
+ index.h("table", { part: "sqm-table" },
2387
+ index.h("tr", null,
2388
+ styles.showRank && (index.h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
2389
+ !styles.hideNames && index.h("th", { class: "User" }, styles.usersheading),
2390
+ index.h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
2391
+ _a.map((user) => {
2392
+ var _a, _b;
2393
+ if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
2394
+ userSeenFlag = true;
2395
+ const isViewingUsersRow = !styles.hideViewer && user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber);
2396
+ return (index.h("tr", { class: isViewingUsersRow ? "highlight" : "" },
2397
+ styles.showRank && (index.h("td", { class: "Rank" }, getRankCellText(user.rank, isViewingUsersRow))),
2398
+ !styles.hideNames && index.h("td", { class: "User" }, getUsersName(user)),
2399
+ index.h("td", { class: "Score" }, user.textValue)));
2400
+ }),
2401
+ !userSeenFlag && !styles.hideViewer && (index.h("tr", null,
2402
+ index.h("td", { colSpan: 100, class: "ellipses" },
2403
+ index.h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
2404
+ !userSeenFlag && !styles.hideViewer && (index.h("tr", { class: "highlight" },
2405
+ styles.showRank && (index.h("td", { class: "Rank" }, getRankCellText((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank, true))),
2406
+ !styles.hideNames && (index.h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
2407
+ index.h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
2627
2408
  }
2628
2409
 
2629
2410
  const paddingList = [
@@ -2709,49 +2490,297 @@ function HeroView(props) {
2709
2490
  "&:last-of-type": {
2710
2491
  background: `no-repeat center/cover ${parseBackground(states.secondaryBackground)}`,
2711
2492
  },
2712
- "@media screen and (min-width: 1023px)": { flex: "1 1 0" },
2713
- minHeight: `${states.minHeight}px`,
2714
- display: "block",
2493
+ "@media screen and (min-width: 1023px)": { flex: "1 1 0" },
2494
+ minHeight: `${states.minHeight}px`,
2495
+ display: "block",
2496
+ },
2497
+ SingleColumnContainer: {
2498
+ background: `no-repeat center/cover ${parseBackground(states.background)}`,
2499
+ minHeight: `${states.minHeight}px`,
2500
+ },
2501
+ Container: {
2502
+ width: "100%",
2503
+ maxWidth: "var(--sqm-max-width)",
2504
+ margin: "0 auto",
2505
+ flex: 1,
2506
+ display: "flex",
2507
+ flexDirection: "column",
2508
+ minHeight: "100%",
2509
+ },
2510
+ };
2511
+ const sheet = JSS.createStyleSheet(style);
2512
+ const styleString = sheet.toString();
2513
+ const vanillaStyle = `
2514
+ :host{
2515
+ height: 100%;
2516
+ display: contents;
2517
+ }
2518
+ sqm-hero{
2519
+ height: 100%;
2520
+ display: contents;
2521
+ }
2522
+ img{
2523
+ max-width: 100%;
2524
+ height: auto;
2525
+ }
2526
+
2527
+ `;
2528
+ // NOTE: Spacing on the columns is controlled on the slots itself. For example using inline styling
2529
+ return (index.h("div", { class: sheet.classes.Container, part: "sqm-base" },
2530
+ index.h("style", { type: "text/css" },
2531
+ vanillaStyle,
2532
+ styleString),
2533
+ states.columns == 2 ? (index.h("div", { class: sheet.classes.TwoColumnContainer, part: "sqm-two-col-container" },
2534
+ index.h("div", { part: "sqm-two-col-primary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.primaryColumn),
2535
+ index.h("div", { part: "sqm-two-col-secondary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.secondaryColumn))) : (index.h("div", { part: "sqm-single-col", class: `${sheet.classes.SingleColumnContainer} ${sheet.classes.ColumnPadding}` }, content.primaryColumn))));
2536
+ }
2537
+
2538
+ const style$9 = {
2539
+ ErrorStyle: mixins.ErrorStyles,
2540
+ FieldContainer: {
2541
+ "margin-bottom": "var(--sl-spacing-large)",
2542
+ },
2543
+ };
2544
+ const vanillaStyle$5 = `
2545
+ :host {
2546
+ margin: 0 auto;
2547
+ width: 100%;
2548
+ display: block;
2549
+ }
2550
+ `;
2551
+ JSS.jss.setup(JSS.create());
2552
+ const sheet$9 = JSS.jss.createStyleSheet(style$9);
2553
+ const styleString$9 = sheet$9.toString();
2554
+ function InputFieldView(props) {
2555
+ var _a, _b, _c, _d, _e, _f, _g;
2556
+ const { states, content } = props;
2557
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2558
+ return (index.h("div", { class: sheet$9.classes.FieldContainer, part: "sqm-base" },
2559
+ index.h("style", { type: "text/css" },
2560
+ vanillaStyle$5,
2561
+ styleString$9),
2562
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: content.fieldLabel }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.fieldName]) ? {
2563
+ value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.fieldName],
2564
+ }
2565
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]) ? {
2566
+ class: sheet$9.classes.ErrorStyle,
2567
+ helpText: global.intl.formatMessage({
2568
+ id: `errorMessage-${content.fieldName}`,
2569
+ defaultMessage: content.errorMessage || (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]),
2570
+ }),
2571
+ }
2572
+ : [])))));
2573
+ }
2574
+
2575
+ const style$a = {
2576
+ ErrorStyle: mixins.ErrorStyles,
2577
+ FieldsContainer: {
2578
+ "& sl-input": {
2579
+ "margin-bottom": "var(--sl-spacing-large)",
2580
+ },
2581
+ },
2582
+ };
2583
+ const vanillaStyle$6 = `
2584
+ :host {
2585
+ margin: 0 auto;
2586
+ width: 100%;
2587
+ display: block;
2588
+ }
2589
+
2590
+ sl-input::part(label){
2591
+ font-size: var(--sl-input-label-font-size-small);
2592
+ font-weight: var(--sl-font-weight-semibold);
2593
+ }
2594
+ `;
2595
+ const sheet$a = JSS.createStyleSheet(style$a);
2596
+ const styleString$a = sheet$a.toString();
2597
+ function NameFieldsView(props) {
2598
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2599
+ const { states } = props;
2600
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2601
+ return (index.h("div", { class: sheet$a.classes.FieldsContainer },
2602
+ index.h("style", { type: "text/css" },
2603
+ vanillaStyle$6,
2604
+ styleString$a),
2605
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/firstName", type: "text", label: states.content.firstNameLabel, required: true, disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e.firstName) ? {
2606
+ value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.firstName,
2607
+ }
2608
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) ? {
2609
+ class: sheet$a.classes.ErrorStyle,
2610
+ helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) || "Cannot be empty",
2611
+ }
2612
+ : []))),
2613
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/lastName", type: "text", label: states.content.lastNameLabel, required: true, disabled: ((_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.loading) || ((_j = states.registrationFormState) === null || _j === void 0 ? void 0 : _j.disabled) }, (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.initialData) === null || _l === void 0 ? void 0 : _l.lastName) ? {
2614
+ value: (_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.initialData) === null || _o === void 0 ? void 0 : _o.lastName,
2615
+ }
2616
+ : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) ? {
2617
+ class: sheet$a.classes.ErrorStyle,
2618
+ helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) || "Cannot be empty",
2619
+ }
2620
+ : [])))));
2621
+ }
2622
+
2623
+ function ChangeMarktingView(props) {
2624
+ const { states, callbacks } = props;
2625
+ const { text, formState } = states;
2626
+ const { error } = formState;
2627
+ const style = {
2628
+ Container: {
2629
+ display: "flex",
2630
+ flexDirection: "column",
2631
+ gap: "var(--sl-spacing-x-small)",
2632
+ padding: "0 var(--sl-spacing-xxx-large) var(--sl-spacing-xxx-large)",
2633
+ },
2634
+ SubmitButton: { marginBottom: "var(--sl-spacing-medium)" },
2635
+ Error: {
2636
+ "&::part(erroralert-base)": {
2637
+ "margin-bottom": "15px",
2638
+ },
2639
+ },
2640
+ Success: {
2641
+ "&::part(successalert-base)": {
2642
+ "margin-bottom": "15px",
2643
+ },
2644
+ },
2645
+ };
2646
+ const sheet = JSS.createStyleSheet(style);
2647
+ const styleString = sheet.toString();
2648
+ return (index.h("div", { class: sheet.classes.Container, part: "sqm-base" },
2649
+ index.h("style", { type: "text/css" }, styleString),
2650
+ index.h(sqmTextSpanView.TextSpanView, Object.assign({}, { type: "h2" }), text.emailPreferencesHeader),
2651
+ index.h("sl-form", { "onSl-submit": callbacks.onSubmit },
2652
+ index.h(CheckboxFieldView, { states: {
2653
+ checked: states.formState.marketingEmailOptIn,
2654
+ }, content: {
2655
+ checkboxLabel: text.marketingCheckboxLabel,
2656
+ checkboxName: "marketingEmailOptIn",
2657
+ }, callbacks: {
2658
+ setChecked: callbacks.setChecked,
2659
+ } }),
2660
+ index.h("sl-button", { class: sheet.classes.SubmitButton, type: "primary", submit: true, loading: states.loading, disabled: states.submitDisabled }, text.submitChangeButtonText),
2661
+ error && (index.h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
2662
+ index.h("div", { part: "erroralert-text" }, error))),
2663
+ states.success && (index.h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
2664
+ index.h("div", { part: "successalert-text" }, states.text.successMessage))))));
2665
+ }
2666
+
2667
+ const vanillaStyle$7 = `
2668
+ :host{
2669
+ margin: 0 auto;
2670
+ width: 100%;
2671
+ }
2672
+ a{
2673
+ cursor:pointer;
2674
+ color: inherit;
2675
+ text-decoration: none;
2676
+ }
2677
+ `;
2678
+ function PortalFooterView(props) {
2679
+ const style = {
2680
+ RowContainer: {
2681
+ display: "flex",
2682
+ "& > :not(:last-child)": {
2683
+ "margin-right": "var(--sl-spacing-large)",
2684
+ },
2685
+ },
2686
+ Container: {
2687
+ display: "flex",
2688
+ "flex-direction": "column",
2689
+ "align-items": "center",
2690
+ "font-size": "var(--sl-font-size-small)",
2691
+ color: "var(--sl-color-gray-600)",
2692
+ "padding-top": `var(--sl-spacing-${props.paddingTop})`,
2693
+ "padding-right": `var(--sl-spacing-${props.paddingRight})`,
2694
+ "padding-bottom": `var(--sl-spacing-${props.paddingBottom})`,
2695
+ "padding-left": `var(--sl-spacing-${props.paddingLeft})`,
2696
+ "row-gap": `var(--sl-spacing-small)`,
2697
+ "& a:hover": {
2698
+ color: "var(--sl-color-gray-900)",
2699
+ },
2715
2700
  },
2716
- SingleColumnContainer: {
2717
- background: `no-repeat center/cover ${parseBackground(states.background)}`,
2718
- minHeight: `${states.minHeight}px`,
2701
+ SupportText: {
2702
+ textAlign: "center",
2703
+ margin: 0,
2719
2704
  },
2720
- Container: {
2721
- width: "100%",
2722
- maxWidth: "var(--sqm-max-width)",
2723
- margin: "0 auto",
2724
- flex: 1,
2705
+ PoweredByLink: {
2706
+ color: "var(--sl-color-gray-400)",
2707
+ "font-size": "var(--sl-font-size-small)",
2725
2708
  display: "flex",
2726
- flexDirection: "column",
2727
- minHeight: "100%",
2709
+ alignItems: "center",
2710
+ svg: {
2711
+ marginTop: "2px",
2712
+ shapeRendering: "geometricprecision",
2713
+ },
2714
+ "&:hover, &:hover *": {
2715
+ color: "var(--sl-color-gray-900)",
2716
+ },
2728
2717
  },
2729
2718
  };
2730
2719
  const sheet = JSS.createStyleSheet(style);
2731
2720
  const styleString = sheet.toString();
2732
- const vanillaStyle = `
2733
- :host{
2734
- height: 100%;
2735
- display: contents;
2736
- }
2737
- sqm-hero{
2738
- height: 100%;
2739
- display: contents;
2740
- }
2741
- img{
2742
- max-width: 100%;
2743
- height: auto;
2744
- }
2745
-
2746
- `;
2747
- // NOTE: Spacing on the columns is controlled on the slots itself. For example using inline styling
2748
2721
  return (index.h("div", { class: sheet.classes.Container, part: "sqm-base" },
2749
2722
  index.h("style", { type: "text/css" },
2750
- vanillaStyle,
2723
+ vanillaStyle$7,
2751
2724
  styleString),
2752
- states.columns == 2 ? (index.h("div", { class: sheet.classes.TwoColumnContainer, part: "sqm-two-col-container" },
2753
- index.h("div", { part: "sqm-two-col-primary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.primaryColumn),
2754
- index.h("div", { part: "sqm-two-col-secondary-col", class: `${sheet.classes.ColumnWrapper} ${sheet.classes.ColumnPadding}` }, content.secondaryColumn))) : (index.h("div", { part: "sqm-single-col", class: `${sheet.classes.SingleColumnContainer} ${sheet.classes.ColumnPadding}` }, content.primaryColumn))));
2725
+ index.h("div", { class: sheet.classes.RowContainer },
2726
+ props.faqLink && (index.h("a", { target: "_blank", href: props.faqLink }, props.faqText)),
2727
+ props.termsLink && (index.h("a", { target: "_blank", href: props.termsLink }, props.termsText))),
2728
+ !props.hideSupportText && (index.h("p", { class: sheet.classes.SupportText }, global.intl.formatMessage({
2729
+ id: "supportFooter",
2730
+ defaultMessage: props.supportText,
2731
+ }, {
2732
+ email: (index.h("a", { target: "_blank", href: `mailto:${props.supportEmail}` }, props.supportEmail)),
2733
+ }))),
2734
+ !props.hidePoweredBy && (index.h("a", { class: sheet.classes.PoweredByLink, target: "_blank", href: props.poweredByLink },
2735
+ "Powered by ",
2736
+ index.h(PoweredByImg, { color: "currentColor" })))));
2737
+ }
2738
+
2739
+ const style$b = {
2740
+ HostBlock: mixins.HostBlock,
2741
+ Frame: {
2742
+ display: "flex",
2743
+ "flex-direction": "column",
2744
+ "box-sizing": "border-box",
2745
+ },
2746
+ FooterWrapper: {
2747
+ width: "100%",
2748
+ "max-width": "100%",
2749
+ padding: "var(--sl-spacing-medium) var(--sl-spacing-x-large)",
2750
+ background: "var(--sqm-footer-background)",
2751
+ display: "flex",
2752
+ "justify-content": "flex-end",
2753
+ "align-items": "center",
2754
+ "box-sizing": "border-box",
2755
+ "margin-top": "auto",
2756
+ },
2757
+ HeaderWrapper: {
2758
+ width: "100%",
2759
+ "max-width": "100%",
2760
+ "box-sizing": "border-box",
2761
+ display: "flex",
2762
+ "justify-content": "space-between",
2763
+ padding: "var(--sl-spacing-small) var(--sl-spacing-large)",
2764
+ "align-items": "center",
2765
+ "background-color": "var(--sqm-header-background)",
2766
+ "@media screen and (max-width: 499px)": {
2767
+ "flex-direction": "row-reverse",
2768
+ "justify-content": "flex-end",
2769
+ padding: "0",
2770
+ },
2771
+ },
2772
+ };
2773
+ const sheet$b = JSS.createStyleSheet(style$b);
2774
+ const styleString$b = sheet$b.toString();
2775
+ function PortalFrameView(props, children) {
2776
+ const { data, notFullScreen } = props;
2777
+ return (index.h("div", { style: { minHeight: notFullScreen ? "100%" : "100vh" }, class: sheet$b.classes.Frame, part: "sqm-base" },
2778
+ index.h("style", { type: "text/css" }, styleString$b),
2779
+ index.h("div", { class: sheet$b.classes.HeaderWrapper, part: "sqm-header" },
2780
+ data.header,
2781
+ index.h("slot", { name: "sqm-navigation-menu" })),
2782
+ children,
2783
+ index.h("div", { class: sheet$b.classes.FooterWrapper, part: "sqm-footer" }, data.footer)));
2755
2784
  }
2756
2785
 
2757
2786
  function ReferralIframeView(props) {
@@ -2782,142 +2811,6 @@ function ReferralIframeView(props) {
2782
2811
  index.h("iframe", { class: sheet.classes.IFrame, src: `${content.iframeSrc}?rsCode=${data.shareCode}` })));
2783
2812
  }
2784
2813
 
2785
- const style$8 = {
2786
- ErrorStyle: mixins.ErrorStyles,
2787
- FieldsContainer: {
2788
- "& sl-input": {
2789
- "margin-bottom": "var(--sl-spacing-large)",
2790
- },
2791
- },
2792
- };
2793
- const vanillaStyle$4 = `
2794
- :host {
2795
- margin: 0 auto;
2796
- width: 100%;
2797
- display: block;
2798
- }
2799
-
2800
- sl-input::part(label){
2801
- font-size: var(--sl-input-label-font-size-small);
2802
- font-weight: var(--sl-font-weight-semibold);
2803
- }
2804
- `;
2805
- const sheet$8 = JSS.createStyleSheet(style$8);
2806
- const styleString$8 = sheet$8.toString();
2807
- function NameFieldsView(props) {
2808
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2809
- const { states } = props;
2810
- const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2811
- return (index.h("div", { class: sheet$8.classes.FieldsContainer },
2812
- index.h("style", { type: "text/css" },
2813
- vanillaStyle$4,
2814
- styleString$8),
2815
- index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/firstName", type: "text", label: states.content.firstNameLabel, required: true, disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e.firstName) ? {
2816
- value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g.firstName,
2817
- }
2818
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) ? {
2819
- class: sheet$8.classes.ErrorStyle,
2820
- helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.firstName) || "Cannot be empty",
2821
- }
2822
- : []))),
2823
- index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: "/lastName", type: "text", label: states.content.lastNameLabel, required: true, disabled: ((_h = states.registrationFormState) === null || _h === void 0 ? void 0 : _h.loading) || ((_j = states.registrationFormState) === null || _j === void 0 ? void 0 : _j.disabled) }, (((_l = (_k = states.registrationFormState) === null || _k === void 0 ? void 0 : _k.initialData) === null || _l === void 0 ? void 0 : _l.lastName) ? {
2824
- value: (_o = (_m = states.registrationFormState) === null || _m === void 0 ? void 0 : _m.initialData) === null || _o === void 0 ? void 0 : _o.lastName,
2825
- }
2826
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) ? {
2827
- class: sheet$8.classes.ErrorStyle,
2828
- helpText: (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.lastName) || "Cannot be empty",
2829
- }
2830
- : [])))));
2831
- }
2832
-
2833
- const style$9 = {
2834
- ErrorStyle: {
2835
- "--sl-input-border-color": "var(--sl-color-danger-500)",
2836
- "--sl-input-background-color": "var(--sl-color-danger-10)",
2837
- "--sl-input-border-color-focus": "var(--sl-color-danger-500)",
2838
- "--sl-input-border-color-hover": "var(--sl-color-danger-500)",
2839
- },
2840
- ErrorMessageStyle: {
2841
- margin: 0,
2842
- color: "var(--sl-color-danger-500)",
2843
- fontSize: "var(--sl-input-help-text-font-size-medium)",
2844
- },
2845
- FieldContainer: {
2846
- "margin-bottom": "var(--sl-spacing-large)",
2847
- },
2848
- };
2849
- const vanillaStyle$5 = `
2850
- :host {
2851
- margin: 0 auto;
2852
- width: 100%;
2853
- display: block;
2854
- }
2855
- sl-select::part(label){
2856
- font-size: var(--sl-input-label-font-size-small);
2857
- font-weight: var(--sl-font-weight-semibold);
2858
- }
2859
- `;
2860
- JSS.jss.setup(JSS.create());
2861
- const sheet$9 = JSS.jss.createStyleSheet(style$9);
2862
- const styleString$9 = sheet$9.toString();
2863
- function DropdownFieldView(props) {
2864
- var _a, _b, _c, _d, _e, _f, _g;
2865
- const { states, content } = props;
2866
- const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2867
- return (index.h("div", { class: sheet$9.classes.FieldContainer, part: "sqm-base" },
2868
- index.h("style", { type: "text/css" },
2869
- vanillaStyle$5,
2870
- styleString$9),
2871
- index.h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.dropdownName]) ? {
2872
- value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.dropdownName],
2873
- }
2874
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) ? {
2875
- class: sheet$9.classes.ErrorStyle,
2876
- }
2877
- : [])), content.selectOptions),
2878
- (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (index.h("p", { class: sheet$9.classes.ErrorMessageStyle }, global.intl.formatMessage({
2879
- id: `errorMessage-${content.dropdownName}`,
2880
- defaultMessage: content.errorMessage,
2881
- })))));
2882
- }
2883
-
2884
- const style$a = {
2885
- ErrorStyle: mixins.ErrorStyles,
2886
- FieldContainer: {
2887
- "margin-bottom": "var(--sl-spacing-large)",
2888
- },
2889
- };
2890
- const vanillaStyle$6 = `
2891
- :host {
2892
- margin: 0 auto;
2893
- width: 100%;
2894
- display: block;
2895
- }
2896
- `;
2897
- JSS.jss.setup(JSS.create());
2898
- const sheet$a = JSS.jss.createStyleSheet(style$a);
2899
- const styleString$a = sheet$a.toString();
2900
- function InputFieldView(props) {
2901
- var _a, _b, _c, _d, _e, _f, _g;
2902
- const { states, content } = props;
2903
- const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.registrationFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
2904
- return (index.h("div", { class: sheet$a.classes.FieldContainer, part: "sqm-base" },
2905
- index.h("style", { type: "text/css" },
2906
- vanillaStyle$6,
2907
- styleString$a),
2908
- index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: content.fieldLabel }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.registrationFormState) === null || _d === void 0 ? void 0 : _d.initialData) === null || _e === void 0 ? void 0 : _e[content.fieldName]) ? {
2909
- value: (_g = (_f = states.registrationFormState) === null || _f === void 0 ? void 0 : _f.initialData) === null || _g === void 0 ? void 0 : _g[content.fieldName],
2910
- }
2911
- : {}), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]) ? {
2912
- class: sheet$a.classes.ErrorStyle,
2913
- helpText: global.intl.formatMessage({
2914
- id: `errorMessage-${content.fieldName}`,
2915
- defaultMessage: content.errorMessage || (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.fieldName]),
2916
- }),
2917
- }
2918
- : [])))));
2919
- }
2920
-
2921
2814
  const CheckMark = () => (index.h("svg", { width: 12, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
2922
2815
  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" })));
2923
2816
  const CheckmarkFilled = () => (index.h("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -3004,7 +2897,7 @@ function ProgressBar({ stageCount, currentStage, }) {
3004
2897
  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 })))));
3005
2898
  }
3006
2899
 
3007
- const style$b = {
2900
+ const style$c = {
3008
2901
  HostBlock: mixins.HostBlock,
3009
2902
  Container: {
3010
2903
  minWidth: "300px",
@@ -3355,8 +3248,8 @@ const style$b = {
3355
3248
  },
3356
3249
  };
3357
3250
  // JSS config
3358
- const sheet$b = JSS.createStyleSheet(style$b);
3359
- const styleString$b = sheet$b.toString();
3251
+ const sheet$c = JSS.createStyleSheet(style$c);
3252
+ const styleString$c = sheet$c.toString();
3360
3253
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
3361
3254
  function RewardExchangeView(props) {
3362
3255
  const { states, data, callbacks, refs } = props;
@@ -3379,7 +3272,7 @@ function RewardExchangeView(props) {
3379
3272
  sourceUnit: item.sourceUnit,
3380
3273
  })));
3381
3274
  }
3382
- 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$b.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
3275
+ 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$c.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
3383
3276
  var _a, _b, _c, _d, _e;
3384
3277
  return callbacks.setExchangeState({
3385
3278
  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,
@@ -3387,7 +3280,7 @@ function RewardExchangeView(props) {
3387
3280
  });
3388
3281
  } }, (_c = item.steps) === null || _c === void 0 ? void 0 : _c.map((step) => {
3389
3282
  var _a, _b;
3390
- return (index.h("sl-menu-item", { value: step, disabled: !step.available, class: sheet$b.classes.SelectItem },
3283
+ return (index.h("sl-menu-item", { value: step, disabled: !step.available, class: sheet$c.classes.SelectItem },
3391
3284
  step.prettyDestinationValue,
3392
3285
  index.h("br", null),
3393
3286
  index.h("div", { class: "step-cost", slot: "suffix" },
@@ -3406,8 +3299,8 @@ function RewardExchangeView(props) {
3406
3299
  var _a;
3407
3300
  return [
3408
3301
  index.h("div", { part: "choose-reward-container" },
3409
- index.h("div", { class: sheet$b.classes.Title }, states.content.text.rewardTitle),
3410
- states.loading || states.queryError ? (loading()) : (index.h("div", { class: sheet$b.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
3302
+ index.h("div", { class: sheet$c.classes.Title }, states.content.text.rewardTitle),
3303
+ states.loading || states.queryError ? (loading()) : (index.h("div", { class: sheet$c.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
3411
3304
  var _a, _b, _c, _d, _e;
3412
3305
  const style = {
3413
3306
  boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
@@ -3416,7 +3309,7 @@ function RewardExchangeView(props) {
3416
3309
  borderRadius: "4px",
3417
3310
  };
3418
3311
  return (index.h("div", { key: item.key, style: style },
3419
- index.h("sl-card", { exportparts: "base: exchange-card-container", class: sheet$b.classes.Card, style: {
3312
+ index.h("sl-card", { exportparts: "base: exchange-card-container", class: sheet$c.classes.Card, style: {
3420
3313
  cursor: item.unavailableReasonCode
3421
3314
  ? "not-allowed"
3422
3315
  : "pointer",
@@ -3433,14 +3326,14 @@ function RewardExchangeView(props) {
3433
3326
  ? "rgba(0, 0, 0, 0.05)"
3434
3327
  : "rgba(0, 0, 0, 0)",
3435
3328
  } },
3436
- index.h("div", { class: sheet$b.classes.Image, style: {
3329
+ index.h("div", { class: sheet$c.classes.Image, style: {
3437
3330
  opacity: item.unavailableReasonCode ? "0.5" : "1",
3438
3331
  } },
3439
3332
  index.h("img", { class: item.unavailableReasonCode
3440
3333
  ? "image subdued"
3441
3334
  : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
3442
3335
  index.getAssetPath("./assets/Reward-image.png") })),
3443
- index.h("div", { class: sheet$b.classes.TextArea, style: {
3336
+ index.h("div", { class: sheet$c.classes.TextArea, style: {
3444
3337
  opacity: item.unavailableReasonCode ? "0.5" : "1",
3445
3338
  } },
3446
3339
  index.h("div", { class: "title", style: {
@@ -3473,7 +3366,7 @@ function RewardExchangeView(props) {
3473
3366
  item.prettySourceMinValue,
3474
3367
  }))))))));
3475
3368
  }))),
3476
- index.h("div", { class: sheet$b.classes.Button },
3369
+ index.h("div", { class: sheet$c.classes.Button },
3477
3370
  index.h("sl-button", { exportparts: "base: primarybutton-base", class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText))),
3478
3371
  ];
3479
3372
  }
@@ -3484,7 +3377,7 @@ function RewardExchangeView(props) {
3484
3377
  ? false
3485
3378
  : input && !states.amount;
3486
3379
  return (index.h("div", null,
3487
- index.h("div", { class: sheet$b.classes.ChooseAmount, part: "choose-amount-container" },
3380
+ index.h("div", { class: sheet$c.classes.ChooseAmount, part: "choose-amount-container" },
3488
3381
  index.h("div", { class: "wrapper" },
3489
3382
  index.h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
3490
3383
  index.getAssetPath("./assets/Reward-image.png") }),
@@ -3493,7 +3386,7 @@ function RewardExchangeView(props) {
3493
3386
  ((_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)),
3494
3387
  ((_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)),
3495
3388
  index.h("div", { class: "space" }))),
3496
- index.h("div", { class: sheet$b.classes.Button },
3389
+ index.h("div", { class: sheet$c.classes.Button },
3497
3390
  index.h("sl-button", { exportparts: "base: secondarybutton-base", class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
3498
3391
  index.h("sl-button", { exportparts: "base: primarybutton-base", class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText)))));
3499
3392
  }
@@ -3501,8 +3394,8 @@ function RewardExchangeView(props) {
3501
3394
  const cost = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue) || selectedItem.prettySourceValue;
3502
3395
  const amount = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue;
3503
3396
  return (index.h("div", null,
3504
- index.h("div", { class: sheet$b.classes.Confirmation, part: "confirmation-container" },
3505
- index.h("div", { class: sheet$b.classes.Title }, states.content.text.redeemTitle),
3397
+ index.h("div", { class: sheet$c.classes.Confirmation, part: "confirmation-container" },
3398
+ index.h("div", { class: sheet$c.classes.Title }, states.content.text.redeemTitle),
3506
3399
  index.h("div", { class: "wrapper" },
3507
3400
  index.h("div", { class: "field" }, states.content.text.rewardNameTitle),
3508
3401
  index.h("div", { class: "reward-item-container" },
@@ -3517,13 +3410,13 @@ function RewardExchangeView(props) {
3517
3410
  index.h("div", { class: "wrapper top-border padding" },
3518
3411
  index.h("div", { class: "field" }, states.content.text.costTitle),
3519
3412
  index.h("div", { class: "value" }, cost)),
3520
- index.h("div", { class: sheet$b.classes.Button },
3413
+ index.h("div", { class: sheet$c.classes.Button },
3521
3414
  index.h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
3522
3415
  index.h("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText)))));
3523
3416
  }
3524
3417
  function success() {
3525
3418
  var _a, _b, _c, _d, _e, _f;
3526
- return (index.h("div", { class: sheet$b.classes.Success, part: "success-container" },
3419
+ return (index.h("div", { class: sheet$c.classes.Success, part: "success-container" },
3527
3420
  index.h(Gift$1, null),
3528
3421
  index.h(Confetti, null),
3529
3422
  index.h("div", { class: "title" }, (_a = states.content.text) === null || _a === void 0 ? void 0 : _a.rewardRedeemedText),
@@ -3538,7 +3431,7 @@ function RewardExchangeView(props) {
3538
3431
  (data === null || data === void 0 ? void 0 : data.fuelTankCode) && (index.h("div", { class: "promo" },
3539
3432
  states.content.text.promoCode,
3540
3433
  index.h(copyTextView.CopyTextView, { copyString: 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 }))),
3541
- index.h("div", { class: sheet$b.classes.Button },
3434
+ index.h("div", { class: sheet$c.classes.Button },
3542
3435
  index.h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
3543
3436
  }
3544
3437
  const stages = {
@@ -3550,7 +3443,7 @@ function RewardExchangeView(props) {
3550
3443
  const currentStage = stages[states.redeemStage];
3551
3444
  function stageMap() {
3552
3445
  const stageNumber = stageList.indexOf(states.redeemStage);
3553
- return (index.h("div", { class: sheet$b.classes.ProgressBar },
3446
+ return (index.h("div", { class: sheet$c.classes.ProgressBar },
3554
3447
  index.h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
3555
3448
  if (stageList.indexOf(stage) <= stageNumber) {
3556
3449
  return index.h("span", { class: "text" }, stageProgressList[stage]);
@@ -3562,10 +3455,10 @@ function RewardExchangeView(props) {
3562
3455
  index.h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
3563
3456
  }
3564
3457
  function loading() {
3565
- return (index.h("div", { class: sheet$b.classes.Grid, part: "loading-container" }, [...Array(states.content.text.skeletonCardNum)].map(() => {
3458
+ return (index.h("div", { class: sheet$c.classes.Grid, part: "loading-container" }, [...Array(states.content.text.skeletonCardNum)].map(() => {
3566
3459
  return (index.h("div", null,
3567
- index.h("sl-card", { class: sheet$b.classes.Card },
3568
- index.h("div", { class: sheet$b.classes.CardLayout },
3460
+ index.h("sl-card", { class: sheet$c.classes.Card },
3461
+ index.h("div", { class: sheet$c.classes.CardLayout },
3569
3462
  index.h("div", null,
3570
3463
  index.h("sl-skeleton", { style: {
3571
3464
  width: "100px",
@@ -3597,12 +3490,12 @@ function RewardExchangeView(props) {
3597
3490
  if (!(refs === null || refs === void 0 ? void 0 : refs.canvasRef))
3598
3491
  return;
3599
3492
  refs.canvasRef.current = canvas;
3600
- }, id: "my-canvas", class: sheet$b.classes.Confetti }));
3493
+ }, id: "my-canvas", class: sheet$c.classes.Confetti }));
3601
3494
  }
3602
3495
  if (states.noExchangeOptions)
3603
3496
  return states.content.text.empty;
3604
- return (index.h("div", { class: sheet$b.classes.Container, part: "sqm-base" },
3605
- index.h("style", { type: "text/css" }, styleString$b),
3497
+ return (index.h("div", { class: sheet$c.classes.Container, part: "sqm-base" },
3498
+ index.h("style", { type: "text/css" }, styleString$c),
3606
3499
  index.h("div", null,
3607
3500
  stageMap(),
3608
3501
  states.exchangeError && errorMessage(),
@@ -3986,64 +3879,205 @@ const successVariable = {
3986
3879
  }, baseStep(20, "$", 40, "Points")),
3987
3880
  };
3988
3881
  const loading = {
3989
- ...baseResponse(null, "chooseReward", null, null, false, true),
3990
- };
3991
- const empty = {
3992
- ...baseResponse(null, "chooseReward", null, null, false, false, null, true),
3993
- };
3994
-
3995
- function CardFeedView(props, children) {
3996
- // Dependent on props, not feasiable to move out
3997
- const style = {
3998
- Container: {
3999
- columnGap: props.gap + "px",
4000
- columnWidth: props.width + "px",
4001
- "& > div": {
4002
- marginBottom: "24px",
4003
- },
4004
- },
3882
+ ...baseResponse(null, "chooseReward", null, null, false, true),
3883
+ };
3884
+ const empty = {
3885
+ ...baseResponse(null, "chooseReward", null, null, false, false, null, true),
3886
+ };
3887
+
3888
+ const MessageLinkQuery = index_module.dist.gql `
3889
+ query (
3890
+ $programId: ID
3891
+ $engagementMedium: UserEngagementMedium!
3892
+ $shareMedium: ReferralShareMedium!
3893
+ ) {
3894
+ viewer {
3895
+ ... on User {
3896
+ messageLink(
3897
+ programId: $programId
3898
+ engagementMedium: $engagementMedium
3899
+ shareMedium: $shareMedium
3900
+ )
3901
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
3902
+ }
3903
+ }
3904
+ }
3905
+ `;
3906
+ function NativeShare(props, directLink, undefinedErrorText, unsupportedPlatformText) {
3907
+ const title = props.sharetitle || "Share title";
3908
+ const text = props.sharetext || "Share text";
3909
+ if (directLink === "undefined") {
3910
+ return alert(undefinedErrorText);
3911
+ }
3912
+ if (window.navigator.share) {
3913
+ window.navigator
3914
+ .share({
3915
+ title,
3916
+ text,
3917
+ url: directLink,
3918
+ })
3919
+ .catch((error) => console.error("Error on web share", error));
3920
+ }
3921
+ else {
3922
+ alert(unsupportedPlatformText);
3923
+ }
3924
+ }
3925
+ function FacebookShare(directLink, messageLink, errorText) {
3926
+ if (messageLink === "undefined" || directLink === "undefined") {
3927
+ return alert(errorText);
3928
+ }
3929
+ if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
3930
+ return SquatchAndroid.shareOnFacebook(directLink, messageLink);
3931
+ }
3932
+ else {
3933
+ return GenericShare(messageLink, errorText);
3934
+ }
3935
+ }
3936
+ function GenericShare(messageLink, errorText) {
3937
+ return messageLink ? (window.location.href = messageLink) : alert(errorText);
3938
+ }
3939
+ function useShareButton(props) {
3940
+ var _a, _b, _c, _d;
3941
+ const { sharetitle, sharetext, medium } = props;
3942
+ const programId = props.programId ? props.programId : index_module.H();
3943
+ const user = index_module.J();
3944
+ const engagementMedium = index_module.B();
3945
+ const variables = {
3946
+ engagementMedium,
3947
+ programId: programId,
3948
+ shareMedium: medium.toUpperCase(),
4005
3949
  };
4006
- const sheet = JSS.createStyleSheet(style);
4007
- const styleString = sheet.toString();
4008
- const vanillaStyle = `
4009
- :host{
4010
- display: block;
3950
+ const contextData = index_module.Fn(copyTextView.REFERRAL_CODES_NAMESPACE);
3951
+ const overrideData = contextData === null || contextData === void 0 ? void 0 : contextData[medium];
3952
+ // only queries if a programId is available
3953
+ const res = index_module.wn(MessageLinkQuery, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId || overrideData !== undefined);
3954
+ const [setCopied, copiedRes] = index_module.$e(copyTextView.SET_CODE_COPIED);
3955
+ const directLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.shareLink) || ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink);
3956
+ const environment = index_module.getEnvironmentSDK();
3957
+ const hide = (medium.toLocaleUpperCase() === "SMS" &&
3958
+ window.orientation === undefined) ||
3959
+ (medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
3960
+ const messageLink = (overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink) || ((_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.viewer) === null || _d === void 0 ? void 0 : _d.messageLink);
3961
+ async function onClick() {
3962
+ if (overrideData) {
3963
+ await setCopied({ referralCode: contextData.referralCode });
3964
+ contextData.refresh();
4011
3965
  }
4012
-
4013
- `;
4014
- return (index.h("div", null,
4015
- index.h("style", { type: "text/css" },
4016
- styleString,
4017
- vanillaStyle),
4018
- index.h("div", { class: sheet.classes.Container, part: "sqm-base" }, children)));
3966
+ if (medium.toLocaleUpperCase() === "FACEBOOK" &&
3967
+ environment.type === "SquatchAndroid") {
3968
+ FacebookShare(directLink, messageLink, props.errorText);
3969
+ }
3970
+ else if (medium.toLocaleUpperCase() === "DIRECT") {
3971
+ NativeShare({ sharetitle, sharetext }, directLink, props.errorText, props.unsupportedPlatformText);
3972
+ }
3973
+ }
3974
+ const isPlainLink = !(medium.toLocaleUpperCase() === "FACEBOOK" &&
3975
+ environment.type === "SquatchAndroid") &&
3976
+ medium.toLocaleUpperCase() !== "DIRECT" &&
3977
+ messageLink;
3978
+ const userAgent = window.navigator.userAgent.toLowerCase(), safari = /safari/.test(userAgent), ios = /iphone|ipod|ipad/.test(userAgent);
3979
+ const openInSameTab = ios && !safari;
3980
+ return {
3981
+ ...props,
3982
+ loading: res.loading && !(overrideData === null || overrideData === void 0 ? void 0 : overrideData.messageLink),
3983
+ messageLink,
3984
+ isPlainLink,
3985
+ onClick,
3986
+ openInSameTab,
3987
+ hide,
3988
+ };
4019
3989
  }
4020
3990
 
4021
- const style$c = {
4022
- HostBlock: mixins.HostBlock,
4023
- couponCodeLabel: {
4024
- margin: "var(--sl-spacing-x-small) 0",
4025
- color: "var(--sl-color-gray-500)",
4026
- fontSize: "var(--sl-font-size-small)",
4027
- },
4028
- };
4029
- const vanillaStyle$7 = `
4030
- :host{
4031
- display: block;
4032
- width: 100%;
3991
+ const MessageLinkQuery$1 = index_module.dist.gql `
3992
+ query ($programId: ID, $engagementMedium: UserEngagementMedium!) {
3993
+ user: viewer {
3994
+ ... on User {
3995
+ shareLink(
3996
+ programId: $programId
3997
+ engagementMedium: $engagementMedium
3998
+ shareMedium: DIRECT
3999
+ )
4000
+ }
4001
+ }
4033
4002
  }
4034
4003
  `;
4035
- const sheet$c = JSS.createStyleSheet(style$c);
4036
- const styleString$c = sheet$c.toString();
4037
- function CouponCodeView(props) {
4038
- const error = !props.loading && props.error;
4039
- return (index.h("div", null,
4040
- index.h("style", { type: "text/css" },
4041
- styleString$c,
4042
- vanillaStyle$7),
4043
- index.h("p", { class: sheet$c.classes.couponCodeLabel, style: { textAlign: props.textAlign } }, props.couponCodeLabel),
4044
- error ? (index.h("sqm-form-message", { type: props.errorType, exportparts: "erroralert-icon" },
4045
- index.h("div", { part: "erroralert-text" }, props.errorText))) : (index.h(copyTextView.CopyTextView, Object.assign({}, props)))));
4004
+ const WIDGET_ENGAGEMENT_EVENT = index_module.dist.gql `
4005
+ mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
4006
+ createUserAnalyticsEvent(eventMeta: $eventMeta)
4007
+ }
4008
+ `;
4009
+ function useShareLink(props) {
4010
+ var _a, _b;
4011
+ const { programId = index_module.H() } = props;
4012
+ const user = index_module.J();
4013
+ const engagementMedium = index_module.B();
4014
+ const contextData = index_module.Fn(copyTextView.REFERRAL_CODES_NAMESPACE);
4015
+ const { data } = index_module.wn(MessageLinkQuery$1, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
4016
+ const [sendLoadEvent] = index_module.$e(WIDGET_ENGAGEMENT_EVENT);
4017
+ const [setCopied, copiedRes] = index_module.$e(copyTextView.SET_CODE_COPIED);
4018
+ const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4019
+ // Shown during loading
4020
+ "...";
4021
+ const [open, setOpen] = stencilHooks_module.useState(false);
4022
+ async function onClick() {
4023
+ if (contextData) {
4024
+ await setCopied({ referralCode: contextData.referralCode });
4025
+ contextData.refresh();
4026
+ }
4027
+ // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
4028
+ // Only if called from a user-initiated event
4029
+ navigator.clipboard.writeText(copyString);
4030
+ setOpen(true);
4031
+ setTimeout(() => setOpen(false), props.tooltiplifespan);
4032
+ sendLoadEvent({
4033
+ eventMeta: {
4034
+ programId,
4035
+ id: user === null || user === void 0 ? void 0 : user.id,
4036
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
4037
+ type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
4038
+ meta: {
4039
+ engagementMedium,
4040
+ shareMedium: "DIRECT",
4041
+ },
4042
+ },
4043
+ });
4044
+ }
4045
+ return { ...props, onClick, open, copyString: copyString };
4046
+ }
4047
+
4048
+ const map = new Map();
4049
+ function withShadowView(component) {
4050
+ // TODO: Could only do this if rendered in a Stencilbook environment to prevent unintended side-effects
4051
+ const element = index.getElement(component);
4052
+ let renderFn = component["render"].bind(component);
4053
+ const newRenderFn = () => {
4054
+ const key = element.getAttribute("stencilbook-shadow-view");
4055
+ if (key) {
4056
+ const value = map.get(key);
4057
+ if (value) {
4058
+ return value;
4059
+ }
4060
+ }
4061
+ return renderFn();
4062
+ };
4063
+ component["render"] = newRenderFn;
4046
4064
  }
4065
+ /**
4066
+ * Any story that defines `parameters.tagname` will be used as a wrapper component around the view
4067
+ */
4068
+ const ShadowViewAddon = ({ story }, children) => {
4069
+ var _a;
4070
+ let TagName = (_a = story.parent.parameters) === null || _a === void 0 ? void 0 : _a.tagname;
4071
+ if (!TagName)
4072
+ return children;
4073
+ const randomInt = Math.round(Math.random() * 100000);
4074
+ map.set(randomInt + "", children);
4075
+ const RandomTagName = "stencilbook-shawdow-view-" + randomInt;
4076
+ // This will only re-render when the tag name changes, so we use a random tag name every time.
4077
+ // Altneratively we could try to trick Stencil to call `forceUpdate` every time.
4078
+ return (index.h(RandomTagName, null,
4079
+ index.h(TagName, { "stencilbook-shadow-view": randomInt })));
4080
+ };
4047
4081
 
4048
4082
  function t(t,n,r){return Math.min(Math.max(t,r),n)}class n extends Error{constructor(t){super(`Failed to parse color: "${t}"`);}}function r(r){if("string"!=typeof r)throw new n(r);if("transparent"===r.trim().toLowerCase())return [0,0,0,0];let e=r.trim();e=u.test(r)?function(t){const r=t.toLowerCase().trim(),e=o[function(t){let n=5381,r=t.length;for(;r;)n=33*n^t.charCodeAt(--r);return (n>>>0)%2341}(r)];if(!e)throw new n(t);return `#${e}`}(r):r;const f=s.exec(e);if(f){const t=Array.from(f).slice(1);return [...t.slice(0,3).map(t=>parseInt(_(t,2),16)),parseInt(_(t[3]||"f",2),16)/255]}const p=i.exec(e);if(p){const t=Array.from(p).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,16)),parseInt(t[3]||"ff",16)/255]}const z=a.exec(e);if(z){const t=Array.from(z).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,10)),parseFloat(t[3]||"1")]}const h=c.exec(e);if(h){const[e,o,_,s]=Array.from(h).slice(1).map(parseFloat);if(t(0,100,o)!==o)throw new n(r);if(t(0,100,_)!==_)throw new n(r);return [...l(e,o,_),s||1]}throw new n(r)}const e=t=>parseInt(t.replace(/_/g,""),36),o="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const r=e(n.substring(0,3)),o=e(n.substring(3)).toString(16);let _="";for(let t=0;t<6-o.length;t++)_+="0";return t[r]=`${_}${o}`,t},{}),_=(t,n)=>Array.from(Array(n)).map(()=>t).join(""),s=new RegExp(`^#${_("([a-f0-9])",3)}([a-f0-9])?$`,"i"),i=new RegExp(`^#${_("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),a=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),c=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,u=/^[a-z]+$/i,f=t=>Math.round(255*t),l=(t,n,r)=>{let e=r/100;if(0===n)return [e,e,e].map(f);const o=(t%360+360)%360/60,_=(1-Math.abs(2*e-1))*(n/100),s=_*(1-Math.abs(o%2-1));let i=0,a=0,c=0;o>=0&&o<1?(i=_,a=s):o>=1&&o<2?(i=s,a=_):o>=2&&o<3?(a=_,c=s):o>=3&&o<4?(a=s,c=_):o>=4&&o<5?(i=s,c=_):o>=5&&o<6&&(i=_,c=s);const u=e-_/2;return [i+u,a+u,c+u].map(f)};function p(t){const[n,e,o,_]=r(t).map((t,n)=>3===n?t:t/255),s=Math.max(n,e,o),i=Math.min(n,e,o),a=(s+i)/2;if(s===i)return [0,0,a,_];const c=s-i;return [60*(n===s?(e-o)/c+(e<o?6:0):e===s?(o-n)/c+2:(n-e)/c+4),a>.5?c/(2-s-i):c/(s+i),a,_]}function z(n,r,e,o){return `hsla(${(n%360).toFixed()}, ${t(0,100,100*r).toFixed()}%, ${t(0,100,100*e).toFixed()}%, ${parseFloat(t(0,1,o).toFixed(3))})`}
4049
4083
 
@@ -4096,40 +4130,6 @@ function autoColorScaleCss(color, name = "primary") {
4096
4130
  return generateScale(color, name).join("\n");
4097
4131
  }
4098
4132
 
4099
- const map = new Map();
4100
- function withShadowView(component) {
4101
- // TODO: Could only do this if rendered in a Stencilbook environment to prevent unintended side-effects
4102
- const element = index.getElement(component);
4103
- let renderFn = component["render"].bind(component);
4104
- const newRenderFn = () => {
4105
- const key = element.getAttribute("stencilbook-shadow-view");
4106
- if (key) {
4107
- const value = map.get(key);
4108
- if (value) {
4109
- return value;
4110
- }
4111
- }
4112
- return renderFn();
4113
- };
4114
- component["render"] = newRenderFn;
4115
- }
4116
- /**
4117
- * Any story that defines `parameters.tagname` will be used as a wrapper component around the view
4118
- */
4119
- const ShadowViewAddon = ({ story }, children) => {
4120
- var _a;
4121
- let TagName = (_a = story.parent.parameters) === null || _a === void 0 ? void 0 : _a.tagname;
4122
- if (!TagName)
4123
- return children;
4124
- const randomInt = Math.round(Math.random() * 100000);
4125
- map.set(randomInt + "", children);
4126
- const RandomTagName = "stencilbook-shawdow-view-" + randomInt;
4127
- // This will only re-render when the tag name changes, so we use a random tag name every time.
4128
- // Altneratively we could try to trick Stencil to call `forceUpdate` every time.
4129
- return (index.h(RandomTagName, null,
4130
- index.h(TagName, { "stencilbook-shadow-view": randomInt })));
4131
- };
4132
-
4133
4133
  exports.BigStatView = BigStatView;
4134
4134
  exports.CardFeedView = CardFeedView;
4135
4135
  exports.ChangeMarktingView = ChangeMarktingView;