@saasquatch/mint-components 1.13.3-9 → 1.13.4

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 (156) hide show
  1. package/dist/cjs/{ShadowViewAddon-3ddee92b.js → ShadowViewAddon-14a02da4.js} +138 -104
  2. package/dist/cjs/{useReferralCodes-82e8797b.js → copy-text-view-a5524c20.js} +93 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mint-components.cjs.js +1 -1
  5. package/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +2 -3
  6. package/dist/cjs/{sqm-big-stat_39.cjs.entry.js → sqm-big-stat_41.cjs.entry.js} +221 -4
  7. package/dist/cjs/{sqm-invoice-table-view-16ac73d0.js → sqm-invoice-table-view-baded4af.js} +31 -2
  8. package/dist/cjs/sqm-pagination_3.cjs.entry.js +5 -6
  9. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +1 -1
  10. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +1 -1
  11. package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +1 -1
  12. package/dist/cjs/{sqm-portal-registration-form-view-ebf355a6.js → sqm-portal-registration-form-view-637a4bf4.js} +1 -0
  13. package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +2 -1
  14. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
  15. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
  16. package/dist/cjs/sqm-stencilbook.cjs.entry.js +470 -431
  17. package/dist/collection/collection-manifest.json +2 -1
  18. package/dist/collection/components/sqm-checkbox-field/CheckboxField.stories.js +1 -1
  19. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field-view.js +6 -15
  20. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +5 -5
  21. package/dist/collection/components/sqm-marketing-emails-checkbox/MarketingEmailsCheckbox.stories.js +11 -0
  22. package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +129 -0
  23. package/dist/collection/components/sqm-portal-change-marketing/ChangeMarketing.stories.js +54 -0
  24. package/dist/collection/components/sqm-portal-change-marketing/sqm-portal-change-marketing-view.js +47 -0
  25. package/dist/collection/components/sqm-portal-change-marketing/sqm-portal-change-marketing.js +217 -0
  26. package/dist/collection/components/sqm-portal-change-marketing/usePortalChangeMarketing.js +115 -0
  27. package/dist/collection/components/sqm-portal-email-verification/sqm-portal-email-verification.js +3 -3
  28. package/dist/collection/components/sqm-portal-forgot-password/sqm-portal-forgot-password.js +3 -3
  29. package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +2 -2
  30. package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +3 -3
  31. package/dist/collection/components/sqm-portal-registration-form/PortalRegistrationForm.stories.js +4 -0
  32. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js +1 -0
  33. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form.js +3 -2
  34. package/dist/collection/components/sqm-portal-reset-password/sqm-portal-reset-password.js +3 -3
  35. package/dist/collection/components/sqm-portal-verify-email/sqm-portal-verify-email.js +3 -3
  36. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +6 -2
  37. package/dist/collection/components/sqm-titled-section/sqm-titled-section.js +3 -0
  38. package/dist/esm/{ShadowViewAddon-499b1f86.js → ShadowViewAddon-23a6afab.js} +134 -101
  39. package/dist/esm/{useReferralCodes-8f75921a.js → copy-text-view-459a2e35.js} +93 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/mint-components.js +1 -1
  42. package/dist/esm/sqm-banking-info-form_17.entry.js +1 -2
  43. package/dist/esm/{sqm-big-stat_39.entry.js → sqm-big-stat_41.entry.js} +220 -5
  44. package/dist/esm/{sqm-invoice-table-view-2c726568.js → sqm-invoice-table-view-af69cd33.js} +30 -2
  45. package/dist/esm/sqm-pagination_3.entry.js +1 -2
  46. package/dist/esm/sqm-portal-email-verification.entry.js +1 -1
  47. package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
  48. package/dist/esm/sqm-portal-google-registration-form.entry.js +1 -1
  49. package/dist/esm/{sqm-portal-registration-form-view-32c4b488.js → sqm-portal-registration-form-view-3c1f6000.js} +1 -0
  50. package/dist/esm/sqm-portal-registration-form.entry.js +2 -1
  51. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  52. package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
  53. package/dist/esm/sqm-stencilbook.entry.js +470 -431
  54. package/dist/esm-es5/ShadowViewAddon-23a6afab.js +1 -0
  55. package/dist/esm-es5/copy-text-view-459a2e35.js +1 -0
  56. package/dist/esm-es5/loader.js +1 -1
  57. package/dist/esm-es5/mint-components.js +1 -1
  58. package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
  59. package/dist/esm-es5/sqm-big-stat_41.entry.js +1 -0
  60. package/dist/esm-es5/sqm-invoice-table-view-af69cd33.js +1 -0
  61. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  62. package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
  63. package/dist/esm-es5/{sqm-portal-registration-form-view-32c4b488.js → sqm-portal-registration-form-view-3c1f6000.js} +1 -1
  64. package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
  65. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  66. package/dist/mint-components/mint-components.esm.js +1 -1
  67. package/dist/mint-components/p-01010af0.entry.js +258 -0
  68. package/dist/mint-components/{p-079405ff.entry.js → p-0d2d0b6d.entry.js} +1 -1
  69. package/dist/mint-components/p-33ed6f1c.system.entry.js +1 -0
  70. package/dist/mint-components/p-37996351.system.js +1 -1
  71. package/dist/mint-components/p-38b5f028.system.entry.js +1 -0
  72. package/dist/mint-components/p-717cc8ac.system.js +1 -0
  73. package/dist/mint-components/p-71bc04d2.system.entry.js +1 -0
  74. package/dist/mint-components/p-7e7cbccf.system.js +1 -0
  75. package/dist/mint-components/p-7f2d4212.js +52 -0
  76. package/dist/mint-components/{p-e6045498.entry.js → p-7f80a9d7.entry.js} +1 -1
  77. package/dist/mint-components/{p-793d2130.js → p-91ab3da1.js} +1 -1
  78. package/dist/mint-components/p-9320582e.system.js +1 -0
  79. package/dist/mint-components/{p-51d3cde7.system.entry.js → p-9386ad84.system.entry.js} +1 -1
  80. package/dist/mint-components/p-962f3200.js +1 -0
  81. package/dist/mint-components/{p-54adee71.system.entry.js → p-9bfd9bed.system.entry.js} +1 -1
  82. package/dist/mint-components/{p-7846937e.entry.js → p-b51e79b3.entry.js} +2 -2
  83. package/dist/mint-components/p-b93fd99c.system.entry.js +1 -0
  84. package/dist/mint-components/p-d3d74266.js +394 -0
  85. package/dist/mint-components/{p-bb0f585c.system.js → p-e5d0375e.system.js} +1 -1
  86. package/dist/mint-components/{p-012af236.entry.js → p-f29eda2f.entry.js} +4 -4
  87. package/dist/mint-components/p-f2cc6a6f.entry.js +9 -0
  88. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field-view.d.ts +1 -1
  89. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +4 -4
  90. package/dist/types/components/sqm-marketing-emails-checkbox/MarketingEmailsCheckbox.stories.d.ts +8 -0
  91. package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +27 -0
  92. package/dist/types/components/{sqm-qr-code/QRCode.stories.d.ts → sqm-portal-change-marketing/ChangeMarketing.stories.d.ts} +2 -2
  93. package/dist/types/components/sqm-portal-change-marketing/sqm-portal-change-marketing-view.d.ts +28 -0
  94. package/dist/types/components/sqm-portal-change-marketing/sqm-portal-change-marketing.d.ts +39 -0
  95. package/dist/types/components/sqm-portal-change-marketing/usePortalChangeMarketing.d.ts +3 -0
  96. package/dist/types/components/sqm-portal-email-verification/sqm-portal-email-verification.d.ts +1 -1
  97. package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password.d.ts +1 -1
  98. package/dist/types/components/sqm-portal-login/sqm-portal-login.d.ts +1 -1
  99. package/dist/types/components/sqm-portal-registration-form/PortalRegistrationForm.stories.d.ts +1 -0
  100. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form-view.d.ts +1 -0
  101. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form.d.ts +1 -1
  102. package/dist/types/components/sqm-portal-reset-password/sqm-portal-reset-password.d.ts +1 -1
  103. package/dist/types/components/sqm-portal-verify-email/sqm-portal-verify-email.d.ts +1 -1
  104. package/dist/types/components/sqm-titled-section/sqm-titled-section.d.ts +1 -0
  105. package/dist/types/components.d.ts +132 -85
  106. package/docs/docs.docx +0 -0
  107. package/docs/raisins.json +1 -1
  108. package/grapesjs/grapesjs.js +1 -1
  109. package/package.json +1 -1
  110. package/dist/cjs/ErrorView-b2fcf954.js +0 -35
  111. package/dist/cjs/copy-text-view-c85acaaa.js +0 -96
  112. package/dist/cjs/sqm-qr-code-view-82b14685.js +0 -89
  113. package/dist/cjs/sqm-qr-code.cjs.entry.js +0 -199
  114. package/dist/collection/components/sqm-qr-code/QRCode.stories.js +0 -37
  115. package/dist/collection/components/sqm-qr-code/sqm-qr-code-view.js +0 -84
  116. package/dist/collection/components/sqm-qr-code/sqm-qr-code.js +0 -229
  117. package/dist/collection/components/sqm-qr-code/useQRCode.js +0 -129
  118. package/dist/esm/ErrorView-48e2b969.js +0 -33
  119. package/dist/esm/copy-text-view-782137ba.js +0 -94
  120. package/dist/esm/sqm-qr-code-view-2dff1823.js +0 -87
  121. package/dist/esm/sqm-qr-code.entry.js +0 -195
  122. package/dist/esm-es5/ErrorView-48e2b969.js +0 -1
  123. package/dist/esm-es5/ShadowViewAddon-499b1f86.js +0 -1
  124. package/dist/esm-es5/copy-text-view-782137ba.js +0 -1
  125. package/dist/esm-es5/sqm-big-stat_39.entry.js +0 -1
  126. package/dist/esm-es5/sqm-invoice-table-view-2c726568.js +0 -1
  127. package/dist/esm-es5/sqm-qr-code-view-2dff1823.js +0 -1
  128. package/dist/esm-es5/sqm-qr-code.entry.js +0 -1
  129. package/dist/esm-es5/useReferralCodes-8f75921a.js +0 -1
  130. package/dist/mint-components/p-31015791.js +0 -1
  131. package/dist/mint-components/p-31c73e3a.system.entry.js +0 -1
  132. package/dist/mint-components/p-3a62a7e2.system.js +0 -1
  133. package/dist/mint-components/p-3b90e01b.system.js +0 -1
  134. package/dist/mint-components/p-3edc9c8a.entry.js +0 -9
  135. package/dist/mint-components/p-3f067fd5.js +0 -1
  136. package/dist/mint-components/p-3f7b81b8.js +0 -52
  137. package/dist/mint-components/p-4f6bb357.system.js +0 -1
  138. package/dist/mint-components/p-5afd7e38.system.entry.js +0 -1
  139. package/dist/mint-components/p-5cb7f9fc.system.entry.js +0 -1
  140. package/dist/mint-components/p-7c434c65.js +0 -1
  141. package/dist/mint-components/p-97038074.system.entry.js +0 -1
  142. package/dist/mint-components/p-9acb5038.js +0 -1
  143. package/dist/mint-components/p-a7746488.system.js +0 -1
  144. package/dist/mint-components/p-d78298a5.entry.js +0 -17
  145. package/dist/mint-components/p-da4ff3b4.system.js +0 -1
  146. package/dist/mint-components/p-dbc0e4f8.system.js +0 -1
  147. package/dist/mint-components/p-e2d5cd22.js +0 -394
  148. package/dist/mint-components/p-f15c1a53.entry.js +0 -241
  149. package/dist/mint-components/p-f4ba6e2b.system.entry.js +0 -1
  150. package/dist/types/components/sqm-qr-code/sqm-qr-code-view.d.ts +0 -17
  151. package/dist/types/components/sqm-qr-code/sqm-qr-code.d.ts +0 -41
  152. package/dist/types/components/sqm-qr-code/useQRCode.d.ts +0 -3
  153. package/dist/types/global/android.d.ts +0 -7
  154. package/dist/types/global/demo.d.ts +0 -2
  155. package/dist/types/stories/features.d.ts +0 -4
  156. package/dist/types/stories/templates.d.ts +0 -4
@@ -6,9 +6,8 @@ import { j as jsonpointer } from './jsonpointer-388a7082.js';
6
6
  import { c as cjs } from './cjs-bdfb4486.js';
7
7
  import { g as getProps, a as getMissingProps } from './utils-334c1e34.js';
8
8
  import { c as createStyleSheet } from './JSS-67b5cff8.js';
9
- import './useReferralCodes-8f75921a.js';
9
+ import { C as CopyTextView } from './copy-text-view-459a2e35.js';
10
10
  import './mixins-83f90fa1.js';
11
- import { C as CopyTextView } from './copy-text-view-782137ba.js';
12
11
  import { a as useRequestRerender } from './re-render-cc945f38.js';
13
12
  import { u as useChildElements } from './useChildElements-7945ae56.js';
14
13
  import './luxon-8d51c92b.js';
@@ -19,7 +18,7 @@ import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
19
18
  import { u as usePortalLogin } from './usePortalLogin-ef647a50.js';
20
19
  import { A as AsYouType } from './AsYouType-46f67d0d.js';
21
20
  import { i as isEmpty } from './utilities-5b0ca040.js';
22
- import { b as useDemoBigStat, Q as useBigStat, B as BigStatView, M as autoColorScaleCss, G as CardFeedView, C as CheckboxFieldView, J as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, U as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, V as demoRewardExchange, i as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-499b1f86.js';
21
+ import { b as useDemoBigStat, U as useBigStat, B as BigStatView, O as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, V as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, W as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-23a6afab.js';
23
22
  import './sqm-portal-container-view-1683ae32.js';
24
23
  import { u as usePayoutStatus } from './usePayoutStatus-58aa56b4.js';
25
24
 
@@ -1604,6 +1603,44 @@ const LinkButton = class {
1604
1603
  }
1605
1604
  };
1606
1605
 
1606
+ const MarketingEmailsCheckbox = class {
1607
+ constructor(hostRef) {
1608
+ registerInstance(this, hostRef);
1609
+ this.ignored = true;
1610
+ /**
1611
+ * @uiName Checkbox label
1612
+ * @uiWidget textArea
1613
+ */
1614
+ this.checkboxLabel = "I would like to receive marketing and promotional emails for this referral program";
1615
+ /**
1616
+ * @undocumented
1617
+ */
1618
+ this.checkboxName = "marketingEmailOptIn";
1619
+ h(this);
1620
+ }
1621
+ disconnectedCallback() { }
1622
+ render() {
1623
+ const content = {
1624
+ ...getProps(this),
1625
+ };
1626
+ const { states, callbacks } = isDemo()
1627
+ ? useCheckboxFieldDemo$1(this)
1628
+ : useCheckboxField(this);
1629
+ return (h$1(CheckboxFieldView, { states: states, content: content, callbacks: callbacks }));
1630
+ }
1631
+ };
1632
+ function useCheckboxFieldDemo$1(props) {
1633
+ return cjs({
1634
+ states: {
1635
+ registrationFormState: {},
1636
+ checked: false,
1637
+ },
1638
+ callbacks: {
1639
+ setChecked: () => { },
1640
+ },
1641
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
1642
+ }
1643
+
1607
1644
  function useNameFields(props) {
1608
1645
  const registrationFormState = d(REGISTRATION_FORM_STATE_CONTEXT);
1609
1646
  return {
@@ -2093,6 +2130,184 @@ function useDemoPayoutStatusAlert(props) {
2093
2130
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
2094
2131
  }
2095
2132
 
2133
+ const GET_USER$1 = dist.gql `
2134
+ query {
2135
+ viewer {
2136
+ ... on User {
2137
+ id
2138
+ accountId
2139
+ marketingEmailOptIn
2140
+ }
2141
+ }
2142
+ }
2143
+ `;
2144
+ const UPSERT_USER$1 = dist.gql `
2145
+ mutation ($userInput: UserInput!) {
2146
+ upsertUser(userInput: $userInput) {
2147
+ id
2148
+ marketingEmailOptIn
2149
+ }
2150
+ }
2151
+ `;
2152
+ // view doesn't tolerate undefined, even when we're loading
2153
+ const defaultFormState$1 = {
2154
+ marketingEmailOptIn: false,
2155
+ errors: {},
2156
+ error: "",
2157
+ };
2158
+ function usePortalProfile(props) {
2159
+ const userIdent = J();
2160
+ const [success, setSuccess] = useState(false);
2161
+ const [userData, setUserData] = useState(undefined);
2162
+ const [formState, setFormState] = useState(defaultFormState$1);
2163
+ const userDataResponse = wn(GET_USER$1, {}, !(userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt));
2164
+ const [upsertUser, upsertUserResponse] = $e(UPSERT_USER$1);
2165
+ useEffect(() => {
2166
+ if (upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.loading)
2167
+ return;
2168
+ if (upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.errors) {
2169
+ setFormState((state) => {
2170
+ var _a, _b, _c;
2171
+ return ({
2172
+ ...state,
2173
+ error: (_c = (_b = (_a = upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.errors) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0].message,
2174
+ });
2175
+ });
2176
+ }
2177
+ else {
2178
+ setUserData((state) => {
2179
+ var _a;
2180
+ return ({
2181
+ ...state,
2182
+ ...(_a = upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.data) === null || _a === void 0 ? void 0 : _a.upsertUser,
2183
+ });
2184
+ });
2185
+ if (upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.data)
2186
+ setSuccess(true);
2187
+ }
2188
+ }, [upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.loading]);
2189
+ useEffect(() => {
2190
+ var _a, _b;
2191
+ setUserData((data) => { var _a; return ({ ...data, ...(_a = userDataResponse === null || userDataResponse === void 0 ? void 0 : userDataResponse.data) === null || _a === void 0 ? void 0 : _a.viewer }); });
2192
+ setFormState({
2193
+ ...defaultFormState$1,
2194
+ ...(_a = userDataResponse.data) === null || _a === void 0 ? void 0 : _a.viewer,
2195
+ ...(_b = upsertUserResponse.data) === null || _b === void 0 ? void 0 : _b.upsertUser,
2196
+ });
2197
+ }, [userDataResponse === null || userDataResponse === void 0 ? void 0 : userDataResponse.data]);
2198
+ useEffect(() => {
2199
+ var _a, _b;
2200
+ if ((_a = upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.errors) === null || _a === void 0 ? void 0 : _a.message) {
2201
+ setFormState({
2202
+ ...(_b = userDataResponse.data) === null || _b === void 0 ? void 0 : _b.viewer,
2203
+ error: props.networkRequestMessage,
2204
+ });
2205
+ }
2206
+ }, [upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.errors]);
2207
+ const onSubmit = (event) => {
2208
+ var _a;
2209
+ setSuccess(false);
2210
+ const formData = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.formData;
2211
+ formData === null || formData === void 0 ? void 0 : formData.forEach((value, key) => {
2212
+ jsonpointer.set(formData, key, value);
2213
+ });
2214
+ upsertUser({
2215
+ userInput: {
2216
+ id: userIdent === null || userIdent === void 0 ? void 0 : userIdent.id,
2217
+ accountId: userIdent === null || userIdent === void 0 ? void 0 : userIdent.accountId,
2218
+ marketingEmailOptIn: Boolean(formData.marketingEmailOptIn),
2219
+ },
2220
+ });
2221
+ setFormState((s) => ({ ...s, errors: {}, error: "" }));
2222
+ return;
2223
+ };
2224
+ return {
2225
+ states: {
2226
+ success,
2227
+ loading: (userDataResponse === null || userDataResponse === void 0 ? void 0 : userDataResponse.loading) || upsertUserResponse.loading,
2228
+ submitDisabled: false,
2229
+ formState,
2230
+ user: userData,
2231
+ text: {
2232
+ emailPreferencesHeader: props.emailPreferencesHeader,
2233
+ marketingCheckboxLabel: props.marketingCheckboxLabel,
2234
+ submitChangeButtonText: props.submitChangeButtonText,
2235
+ successMessage: props.successMessage,
2236
+ },
2237
+ },
2238
+ callbacks: {
2239
+ onSubmit,
2240
+ setChecked: (value) => setFormState({ ...formState, marketingEmailOptIn: value }),
2241
+ },
2242
+ };
2243
+ }
2244
+
2245
+ const PortalChangeMarketing = class {
2246
+ constructor(hostRef) {
2247
+ registerInstance(this, hostRef);
2248
+ this.ignored = true;
2249
+ /**
2250
+ * @uiName Email preferences header
2251
+ */
2252
+ this.emailPreferencesHeader = "Email preferences";
2253
+ /**
2254
+ * @uiName Marketing checkbox label
2255
+ */
2256
+ this.marketingCheckboxLabel = "I want to receive marketing emails and promotions for this referral program from impact.com";
2257
+ /**
2258
+ * @uiName Submit changes button text
2259
+ */
2260
+ this.submitChangeButtonText = "Save";
2261
+ /**
2262
+ * Displayed when the page fails to load due to a network error. The participant can try refreshing the page.
2263
+ *
2264
+ * @uiName Network request error message
2265
+ */
2266
+ this.networkRequestMessage = "An error occurred while loading this page. Please refresh the page.";
2267
+ /**
2268
+ * @uiName Successful update message
2269
+ */
2270
+ this.successMessage = "Opt-in preference has been changed.";
2271
+ h(this);
2272
+ }
2273
+ disconnectedCallback() { }
2274
+ render() {
2275
+ const props = isDemo()
2276
+ ? usePortalProfileDemo(getProps(this))
2277
+ : usePortalProfile(getProps(this));
2278
+ return h$1(ChangeMarktingView, Object.assign({}, props));
2279
+ }
2280
+ };
2281
+ function usePortalProfileDemo(props) {
2282
+ return cjs({
2283
+ states: {
2284
+ success: false,
2285
+ loading: false,
2286
+ submitDisabled: false,
2287
+ user: {
2288
+ id: "01",
2289
+ accountId: "111100000",
2290
+ marketingEmailOptIn: false,
2291
+ },
2292
+ text: {
2293
+ emailPreferencesHeader: props.emailPreferencesHeader,
2294
+ marketingCheckboxLabel: props.marketingCheckboxLabel,
2295
+ submitChangeButtonText: props.submitChangeButtonText,
2296
+ successMessage: props.successMessage,
2297
+ },
2298
+ formState: {
2299
+ marketingEmailOptIn: false,
2300
+ errors: null,
2301
+ error: "",
2302
+ },
2303
+ },
2304
+ callbacks: {
2305
+ onSubmit: (e) => console.log(e),
2306
+ setChecked: () => { },
2307
+ },
2308
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
2309
+ }
2310
+
2096
2311
  function usePortalChangePassword(props) {
2097
2312
  var _a, _b, _c, _d, _e, _f, _g;
2098
2313
  const [request, { loading, errors, data }] = Ue();
@@ -2438,8 +2653,8 @@ const PortalLogin = class {
2438
2653
  */
2439
2654
  this.pageLabel = "Sign in to your account";
2440
2655
  /**
2441
- * @uiName Network error message
2442
2656
  * Displayed when the login fails due to a network error. The participant can try refreshing the page.
2657
+ * @uiName Network error message
2443
2658
  */
2444
2659
  this.networkErrorMessage = "An error occurred while logging you in. Please refresh the page and try again.";
2445
2660
  /**
@@ -4888,4 +5103,4 @@ function useUserNameDemo(props) {
4888
5103
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
4889
5104
  }
4890
5105
 
4891
- export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
5106
+ export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
@@ -1,7 +1,6 @@
1
1
  import { h } from './index-91e7729f.js';
2
2
  import { i as intl } from './global-be1f9992.js';
3
3
  import { c as createStyleSheet } from './JSS-67b5cff8.js';
4
- import { E as ErrorView } from './ErrorView-48e2b969.js';
5
4
 
6
5
  const INDIRECT_TAX_PROVINCES = [
7
6
  { regionCode: "ALBERTA", taxType: "GST", displayName: "Alberta" },
@@ -477,6 +476,35 @@ function getCountryObj({ countryCode, locale, }) {
477
476
  };
478
477
  }
479
478
 
479
+ const styles = {
480
+ Alert: {
481
+ "&::part(base)": {
482
+ backgroundColor: "var(--sl-color-danger-100)",
483
+ border: "1px solid var(--sl-color-danger-200)",
484
+ padding: "0 16px",
485
+ },
486
+ "& sl-icon": {
487
+ margin: 0,
488
+ },
489
+ "& sl-icon::part(base)": {
490
+ color: "var(--sl-color-danger-500)",
491
+ margin: 0,
492
+ },
493
+ },
494
+ };
495
+ const ErrorView = (props) => {
496
+ const sheet = createStyleSheet(styles);
497
+ const styleString = sheet.toString();
498
+ const { classes } = sheet;
499
+ return (h("div", null,
500
+ h("style", null, styleString),
501
+ h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: classes.Alert },
502
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon", class: "Error" }),
503
+ h("strong", null, props.loadingErrorAlertHeader),
504
+ h("br", null),
505
+ props.loadingErrorAlertDescription)));
506
+ };
507
+
480
508
  const TaxForm_stories = {
481
509
  title: "Components/Tax Form",
482
510
  };
@@ -2019,4 +2047,4 @@ function InvoiceTableView(props, children) {
2019
2047
  children))));
2020
2048
  }
2021
2049
 
2022
- export { ADDRESS_REGIONS as A, GeneralLoadingView as G, InvoiceTableView as I, LoadingView as L, OtherRegionSlotView as O, TaxForm as T, INDIRECT_TAX_SPAIN_REGIONS as a, INDIRECT_TAX_PROVINCES as b, vatLabels as c, validateBillingField as d, formatErrorMessage as f, getCountryObj as g, objectIsFull as o, taxTypeToName as t, validTaxDocument as v };
2050
+ export { ADDRESS_REGIONS as A, ErrorView as E, GeneralLoadingView as G, InvoiceTableView as I, LoadingView as L, OtherRegionSlotView as O, TaxForm as T, INDIRECT_TAX_SPAIN_REGIONS as a, INDIRECT_TAX_PROVINCES as b, vatLabels as c, validateBillingField as d, formatErrorMessage as f, getCountryObj as g, objectIsFull as o, taxTypeToName as t, validTaxDocument as v };
@@ -5,9 +5,8 @@ import { F as Fn, i as isDemo, d as dist, H, J, w as wn, $ as $e, B } from './in
5
5
  import { c as cjs } from './cjs-bdfb4486.js';
6
6
  import { g as getProps } from './utils-334c1e34.js';
7
7
  import { c as createStyleSheet } from './JSS-67b5cff8.js';
8
- import { R as REFERRAL_CODES_PAGINATION_CONTEXT, a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED, u as useReferralCodes } from './useReferralCodes-8f75921a.js';
8
+ import { R as REFERRAL_CODES_PAGINATION_CONTEXT, a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED, C as CopyTextView, u as useReferralCodes } from './copy-text-view-459a2e35.js';
9
9
  import './mixins-83f90fa1.js';
10
- import { C as CopyTextView } from './copy-text-view-782137ba.js';
11
10
 
12
11
  const style = {
13
12
  Container: {
@@ -159,8 +159,8 @@ const PortalEmailVerification = class {
159
159
  */
160
160
  this.verificationResentMessage = "Your verification email has been resent successfully";
161
161
  /**
162
- * @uiName Network error message
163
162
  * Displayed when your verification email fails to send due to a network error. The participant can try refreshing the page.
163
+ * @uiName Network error message
164
164
  */
165
165
  this.networkErrorMessage = "An error occurred while verifying your password. Please refresh the page.";
166
166
  h(this);
@@ -86,8 +86,8 @@ const PortalForgotPassword = class {
86
86
  */
87
87
  this.loginText = "Sign In";
88
88
  /**
89
- * @uiName Network error message
90
89
  * Displayed when the forgot password action fails due to a network error. The participant can try refreshing the page.
90
+ * @uiName Network error message
91
91
  */
92
92
  this.networkErrorMessage = "An error occurred while loading this page. Please refresh the page.";
93
93
  /**
@@ -8,7 +8,7 @@ import './mixins-83f90fa1.js';
8
8
  import './sqm-text-span-view-ca32495e.js';
9
9
  import { a as useRegistrationForm } from './useRegistrationFormState-d6f33135.js';
10
10
  import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-593d4ac3.js';
11
- import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-32c4b488.js';
11
+ import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-3c1f6000.js';
12
12
  import './AsYouType-46f67d0d.js';
13
13
  import { u as usePortalRegistrationForm } from './usePortalRegistrationForm-4b35a357.js';
14
14
 
@@ -76,6 +76,7 @@ function PortalRegistrationFormView(props) {
76
76
  helpText: ((_u = (_t = states.registrationFormState) === null || _t === void 0 ? void 0 : _t.validationErrors) === null || _u === void 0 ? void 0 : _u.confirmPassword) || content.requiredFieldErrorMessage,
77
77
  }
78
78
  : [])))),
79
+ content.emailOptIn,
79
80
  content.terms,
80
81
  h("div", { class: sheet.classes.ButtonsContainer },
81
82
  h("sl-button", { submit: true, loading: states.loading, disabled: (_v = states.registrationFormState) === null || _v === void 0 ? void 0 : _v.disabled, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"),
@@ -7,7 +7,7 @@ import './JSS-67b5cff8.js';
7
7
  import './mixins-83f90fa1.js';
8
8
  import './sqm-text-span-view-ca32495e.js';
9
9
  import './useRegistrationFormState-d6f33135.js';
10
- import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-32c4b488.js';
10
+ import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-3c1f6000.js';
11
11
  import './AsYouType-46f67d0d.js';
12
12
  import { u as usePortalRegistrationForm } from './usePortalRegistrationForm-4b35a357.js';
13
13
 
@@ -144,6 +144,7 @@ const PortalRegistrationForm = class {
144
144
  formData: h$1("slot", { name: "formData" }),
145
145
  secondaryButton: (h$1("slot", { name: "secondaryButton" }, h$1("sl-button", { type: "text", disabled: states.loading, onClick: () => jn.push(states.loginPath) }, this.loginLabel))),
146
146
  terms: h$1("slot", { name: "terms" }),
147
+ emailOptIn: h$1("slot", { name: "emailOptIn" }),
147
148
  emailLabel: this.emailLabel,
148
149
  passwordLabel: this.passwordLabel,
149
150
  submitLabel: this.submitLabel,
@@ -181,8 +181,8 @@ const PortalResetPassword = class {
181
181
  */
182
182
  this.resetSuccessText = "Your password has been reset and you are being redirected. If you are not redirected, please click Continue.";
183
183
  /**
184
- * @uiName Network error message
185
184
  * Displayed when the password reset fails due to a network error. The participant can try refreshing the page.
185
+ * @uiName Network error message
186
186
  */
187
187
  this.networkErrorMessage = "An error occurred while resetting your password. Please refresh the page and try again.";
188
188
  h(this);
@@ -129,8 +129,8 @@ const PortalVerifyEmail = class {
129
129
  */
130
130
  this.continueText = "Continue";
131
131
  /**
132
- * @uiName Network error message
133
132
  * Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
133
+ * @uiName Network error message
134
134
  */
135
135
  this.networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
136
136
  h(this);