@saasquatch/mint-components 1.12.0-1 → 1.12.0-11

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 (159) hide show
  1. package/dist/cjs/{ShadowViewAddon-88821c64.js → ShadowViewAddon-040cffad.js} +6 -3
  2. package/dist/cjs/extractProps-fd93ba62.js +21 -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_16.cjs.entry.js +92 -78
  6. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +128 -63
  7. package/dist/cjs/sqm-code-verification.cjs.entry.js +67 -77
  8. package/dist/cjs/sqm-email-verification.cjs.entry.js +158 -12
  9. package/dist/cjs/{sqm-invoice-table-view-ce9a34ac.js → sqm-invoice-table-view-c58966f8.js} +79 -0
  10. package/dist/cjs/sqm-stencilbook.cjs.entry.js +56 -14
  11. package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +81 -11
  12. package/dist/cjs/sqm-widget-verification.cjs.entry.js +102 -19
  13. package/dist/cjs/usePayoutStatus-b9fb7399.js +70 -0
  14. package/dist/cjs/useVerificationEmail-6aacdb71.js +169 -0
  15. package/dist/collection/collection-manifest.json +1 -1
  16. package/dist/collection/components/sqm-big-stat/useBigStat.js +6 -3
  17. package/dist/collection/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.js +1 -2
  18. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.js +1 -0
  19. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +16 -3
  20. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.js +9 -2
  21. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +20 -10
  22. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +34 -63
  23. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +38 -29
  24. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.js +23 -3
  25. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +17 -4
  26. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.js +65 -11
  27. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +77 -21
  28. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +327 -15
  29. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +447 -22
  30. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +165 -0
  31. package/dist/collection/components/tax-and-cash/BankingForm.stories.js +1 -0
  32. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +78 -0
  33. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +2 -1
  34. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +7 -0
  35. package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +0 -1
  36. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +10 -0
  37. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +72 -13
  38. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +146 -9
  39. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +30 -15
  40. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +6 -0
  41. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +8 -8
  42. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -2
  43. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +22 -16
  44. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +99 -88
  45. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +8 -1
  46. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +1 -6
  47. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +16 -11
  48. package/dist/esm/{ShadowViewAddon-65c8679e.js → ShadowViewAddon-69b61037.js} +6 -3
  49. package/dist/esm/extractProps-ae1afbb3.js +19 -0
  50. package/dist/esm/{keys-a1496e39.js → keys-db1897ae.js} +1 -1
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/mint-components.js +1 -1
  53. package/dist/esm/sqm-banking-info-form_16.entry.js +92 -78
  54. package/dist/esm/sqm-big-stat_39.entry.js +127 -62
  55. package/dist/esm/sqm-code-verification.entry.js +69 -79
  56. package/dist/esm/sqm-email-verification.entry.js +159 -13
  57. package/dist/esm/{sqm-invoice-table-view-08c03ba7.js → sqm-invoice-table-view-d1cfdaf4.js} +79 -0
  58. package/dist/esm/sqm-stencilbook.entry.js +56 -14
  59. package/dist/esm/sqm-widget-verification-internal.entry.js +84 -14
  60. package/dist/esm/sqm-widget-verification.entry.js +104 -21
  61. package/dist/esm/usePayoutStatus-1a635054.js +67 -0
  62. package/dist/esm/useVerificationEmail-c32696ba.js +167 -0
  63. package/dist/esm-es5/ShadowViewAddon-69b61037.js +1 -0
  64. package/dist/esm-es5/extractProps-ae1afbb3.js +1 -0
  65. package/dist/esm-es5/{keys-a1496e39.js → keys-db1897ae.js} +1 -1
  66. package/dist/esm-es5/loader.js +1 -1
  67. package/dist/esm-es5/mint-components.js +1 -1
  68. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  69. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  70. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  71. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  72. package/dist/esm-es5/sqm-invoice-table-view-d1cfdaf4.js +1 -0
  73. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  74. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +1 -1
  75. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  76. package/dist/esm-es5/usePayoutStatus-1a635054.js +1 -0
  77. package/dist/esm-es5/useVerificationEmail-c32696ba.js +1 -0
  78. package/dist/mint-components/mint-components.esm.js +1 -1
  79. package/dist/mint-components/p-0e45bc0e.system.entry.js +1 -0
  80. package/dist/mint-components/p-1712a9fd.entry.js +11 -0
  81. package/dist/mint-components/p-1e616d45.system.js +1 -0
  82. package/dist/mint-components/{p-721a89c6.entry.js → p-24092973.entry.js} +2 -2
  83. package/dist/mint-components/p-26468242.js +1 -0
  84. package/dist/mint-components/p-282a7d85.entry.js +195 -0
  85. package/dist/mint-components/p-331d060e.entry.js +223 -0
  86. package/dist/mint-components/p-39840341.js +1 -0
  87. package/dist/mint-components/p-4364001c.entry.js +12 -0
  88. package/dist/mint-components/p-4bd7a472.js +1 -0
  89. package/dist/mint-components/p-517224ef.js +19 -0
  90. package/dist/mint-components/p-5f766d09.entry.js +25 -0
  91. package/dist/mint-components/p-8300d8c8.system.js +1 -0
  92. package/dist/mint-components/p-8bddb468.system.entry.js +1 -0
  93. package/dist/mint-components/p-9596e97c.system.entry.js +1 -0
  94. package/dist/mint-components/p-974070c4.system.entry.js +1 -0
  95. package/dist/mint-components/{p-b651706a.js → p-9eae245f.js} +6 -3
  96. package/dist/mint-components/p-a8645c1b.system.js +1 -0
  97. package/dist/mint-components/p-aabab609.system.entry.js +1 -0
  98. package/dist/mint-components/p-b2a99637.system.js +1 -0
  99. package/dist/mint-components/{p-66a04cca.system.entry.js → p-b62faaa5.system.entry.js} +1 -1
  100. package/dist/mint-components/p-c510fb88.entry.js +1 -0
  101. package/dist/mint-components/p-ca809fdd.system.js +1 -1
  102. package/dist/mint-components/p-d7806f31.js +48 -0
  103. package/dist/mint-components/p-e01ac27c.system.js +1 -0
  104. package/dist/mint-components/p-e45a8501.system.entry.js +1 -0
  105. package/dist/mint-components/p-e990dc21.system.js +1 -0
  106. package/dist/types/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.d.ts +0 -1
  107. package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll.d.ts +7 -0
  108. package/dist/types/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.d.ts +1 -0
  109. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.d.ts +3 -3
  110. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +4 -10
  111. package/dist/types/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.d.ts +2 -0
  112. package/dist/types/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.d.ts +4 -1
  113. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.d.ts +6 -1
  114. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.d.ts +10 -2
  115. package/dist/types/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.d.ts +3 -2
  116. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-internal.d.ts +15 -0
  117. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +79 -0
  118. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +14 -0
  119. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +1 -0
  120. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +1 -0
  121. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +2 -0
  122. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +12 -0
  123. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +41 -0
  124. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +12 -0
  125. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/data.d.ts +6 -0
  126. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +2 -2
  127. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +10 -3
  128. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +19 -18
  129. package/dist/types/components.d.ts +366 -92
  130. package/docs/docs.docx +0 -0
  131. package/docs/raisins.json +1 -1
  132. package/grapesjs/grapesjs.js +1 -1
  133. package/package.json +1 -1
  134. package/dist/cjs/useEmailVerification-30a1c7f6.js +0 -75
  135. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +0 -3
  136. package/dist/esm/useEmailVerification-7135732c.js +0 -72
  137. package/dist/esm-es5/ShadowViewAddon-65c8679e.js +0 -1
  138. package/dist/esm-es5/sqm-invoice-table-view-08c03ba7.js +0 -1
  139. package/dist/esm-es5/useEmailVerification-7135732c.js +0 -1
  140. package/dist/mint-components/p-117b4705.system.js +0 -1
  141. package/dist/mint-components/p-1bd0cda8.system.entry.js +0 -1
  142. package/dist/mint-components/p-1ee62d9f.system.entry.js +0 -1
  143. package/dist/mint-components/p-1f9a9b70.system.entry.js +0 -1
  144. package/dist/mint-components/p-23fdd44e.entry.js +0 -1
  145. package/dist/mint-components/p-36f7caec.system.entry.js +0 -1
  146. package/dist/mint-components/p-39397731.entry.js +0 -1
  147. package/dist/mint-components/p-39af4acd.entry.js +0 -240
  148. package/dist/mint-components/p-4c9b6fbe.system.js +0 -1
  149. package/dist/mint-components/p-65e2c043.system.js +0 -1
  150. package/dist/mint-components/p-663303b7.entry.js +0 -8
  151. package/dist/mint-components/p-6cae44d7.js +0 -1
  152. package/dist/mint-components/p-7f5c7bf7.system.entry.js +0 -1
  153. package/dist/mint-components/p-8a337864.js +0 -7
  154. package/dist/mint-components/p-a02afa72.system.js +0 -1
  155. package/dist/mint-components/p-a5a9aa07.entry.js +0 -189
  156. package/dist/mint-components/p-c763c0b2.js +0 -1
  157. package/dist/mint-components/p-e93e5740.entry.js +0 -1
  158. package/dist/mint-components/p-e9ca48fc.system.entry.js +0 -1
  159. package/dist/types/components/sqm-widget-verification/useWidgetVerification.d.ts +0 -1
@@ -28,9 +28,9 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-d97086bc.js');
28
28
  require('./utilities-f7de6c04.js');
29
29
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-96f329ed.js');
30
30
  const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7ffcc0d4.js');
31
- const ShadowViewAddon = require('./ShadowViewAddon-88821c64.js');
31
+ const ShadowViewAddon = require('./ShadowViewAddon-040cffad.js');
32
32
  const sqmPortalContainerView = require('./sqm-portal-container-view-990a85a3.js');
33
- const sqmInvoiceTableView = require('./sqm-invoice-table-view-ce9a34ac.js');
33
+ const sqmInvoiceTableView = require('./sqm-invoice-table-view-c58966f8.js');
34
34
 
35
35
  /**
36
36
  * lodash (Custom Build) <https://lodash.com/>
@@ -14412,6 +14412,7 @@ const bankingFormProps = {
14412
14412
  loadingError: false,
14413
14413
  },
14414
14414
  callbacks: {
14415
+ onVerification: () => { },
14415
14416
  onSubmit: async () => console.log("Submit"),
14416
14417
  setPaymentMethodChecked: () => { },
14417
14418
  setPaymentScheduleChecked: () => { },
@@ -14999,20 +15000,40 @@ const WidgetEmailVerification_stories = {
14999
15000
  };
15000
15001
  const defaultProps$k = {
15001
15002
  email: "",
15002
- error: "",
15003
+ error: false,
15003
15004
  loading: false,
15005
+ initialLoading: false,
15006
+ sendCodeError: false,
15004
15007
  };
15005
15008
  const Default$i = () => (index.h("sqm-email-verification", { demoData: {} }));
15009
+ const EmailIsPrefilled = () => (index.h("sqm-email-verification", { demoData: {
15010
+ states: {
15011
+ ...defaultProps$k,
15012
+ email: "test@example.com",
15013
+ },
15014
+ } }));
15006
15015
  const Loading$7 = () => (index.h("sqm-email-verification", { demoData: {
15016
+ states: {
15017
+ ...defaultProps$k,
15018
+ initialLoading: true,
15019
+ },
15020
+ } }));
15021
+ const SaveLoading = () => (index.h("sqm-email-verification", { demoData: {
15007
15022
  states: {
15008
15023
  ...defaultProps$k,
15009
15024
  loading: true,
15010
15025
  },
15011
15026
  } }));
15012
- const Error$a = () => (index.h("sqm-email-verification", { demoData: {
15027
+ const InvalidEmail = () => (index.h("sqm-email-verification", { demoData: {
15028
+ states: {
15029
+ ...defaultProps$k,
15030
+ error: true,
15031
+ },
15032
+ } }));
15033
+ const SendCodeError = () => (index.h("sqm-email-verification", { demoData: {
15013
15034
  states: {
15014
15035
  ...defaultProps$k,
15015
- error: "Email is invalid",
15036
+ sendCodeError: true,
15016
15037
  },
15017
15038
  } }));
15018
15039
 
@@ -15020,20 +15041,30 @@ const WidgetEmailVerification = /*#__PURE__*/Object.freeze({
15020
15041
  __proto__: null,
15021
15042
  'default': WidgetEmailVerification_stories,
15022
15043
  Default: Default$i,
15044
+ EmailIsPrefilled: EmailIsPrefilled,
15023
15045
  Loading: Loading$7,
15024
- Error: Error$a
15046
+ SaveLoading: SaveLoading,
15047
+ InvalidEmail: InvalidEmail,
15048
+ SendCodeError: SendCodeError
15025
15049
  });
15026
15050
 
15027
15051
  const WidgetCodeVerification_stories = {
15028
15052
  title: "Components/Widget Code Verification",
15029
15053
  };
15030
15054
  const defaultProps$l = {
15055
+ initialiseLoading: false,
15031
15056
  email: "testemail@example.com",
15032
15057
  loading: false,
15033
15058
  verifyFailed: false,
15034
- codeResent: false,
15059
+ emailResent: false,
15035
15060
  };
15036
15061
  const Default$j = () => (index.h("sqm-code-verification", { demoData: { states: defaultProps$l } }));
15062
+ const InitialLoading = () => (index.h("sqm-code-verification", { demoData: {
15063
+ states: {
15064
+ ...defaultProps$l,
15065
+ initialiseLoading: true,
15066
+ },
15067
+ } }));
15037
15068
  const Loading$8 = () => (index.h("sqm-code-verification", { demoData: {
15038
15069
  states: {
15039
15070
  ...defaultProps$l,
@@ -15043,7 +15074,7 @@ const Loading$8 = () => (index.h("sqm-code-verification", { demoData: {
15043
15074
  const CodeResent = () => (index.h("sqm-code-verification", { demoData: {
15044
15075
  states: {
15045
15076
  ...defaultProps$l,
15046
- codeResent: true,
15077
+ emailResent: true,
15047
15078
  },
15048
15079
  } }));
15049
15080
  const VerificationFailed = () => (index.h("sqm-code-verification", { demoData: {
@@ -15057,6 +15088,7 @@ const WidgetCodeVerification = /*#__PURE__*/Object.freeze({
15057
15088
  __proto__: null,
15058
15089
  'default': WidgetCodeVerification_stories,
15059
15090
  Default: Default$j,
15091
+ InitialLoading: InitialLoading,
15060
15092
  Loading: Loading$8,
15061
15093
  CodeResent: CodeResent,
15062
15094
  VerificationFailed: VerificationFailed
@@ -15066,15 +15098,13 @@ const PayoutButtonScroll_stories = {
15066
15098
  title: "Components/Payout Scroll Button",
15067
15099
  };
15068
15100
  const defaultProps$m = {
15069
- payoutSettingsComplete: false,
15101
+ payoutSettingsComplete: true,
15070
15102
  };
15071
- const Default$k = () => (index.h("sqm-payout-button-scroll", { demoData: { states: defaultProps$m } }));
15072
15103
  const CompletedTaxForm = () => (index.h("sqm-payout-button-scroll", { demoData: { states: { ...defaultProps$m, payoutSettingsComplete: true } } }));
15073
15104
 
15074
15105
  const PayoutButtonScroll = /*#__PURE__*/Object.freeze({
15075
15106
  __proto__: null,
15076
15107
  'default': PayoutButtonScroll_stories,
15077
- Default: Default$k,
15078
15108
  CompletedTaxForm: CompletedTaxForm
15079
15109
  });
15080
15110
 
@@ -15082,21 +15112,33 @@ const PayoutStatusAlert_stories = {
15082
15112
  title: "Components/Payout Status Alert",
15083
15113
  };
15084
15114
  const defaultProps$n = {
15115
+ error: false,
15085
15116
  status: "INFORMATION_REQUIRED",
15086
15117
  loading: false,
15118
+ showVerifyIdentity: false,
15087
15119
  };
15088
15120
  const InformationRequired = () => (index.h("sqm-payout-status-alert", { demoData: { states: defaultProps$n } }));
15089
15121
  const VerifyIdentity = () => (index.h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, status: "VERIFICATION_NEEDED" } } }));
15122
+ const VerifyIdentityOpen = () => (index.h("sqm-payout-status-alert", { demoData: {
15123
+ states: {
15124
+ ...defaultProps$n,
15125
+ status: "VERIFICATION_NEEDED",
15126
+ showVerifyIdentity: true,
15127
+ },
15128
+ } }));
15090
15129
  const Hold = () => (index.h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, status: "HOLD" } } }));
15091
15130
  const Loading$9 = () => (index.h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, loading: true } } }));
15131
+ const Error$a = () => (index.h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, error: true } } }));
15092
15132
 
15093
15133
  const PayoutStatusAlert = /*#__PURE__*/Object.freeze({
15094
15134
  __proto__: null,
15095
15135
  'default': PayoutStatusAlert_stories,
15096
15136
  InformationRequired: InformationRequired,
15097
15137
  VerifyIdentity: VerifyIdentity,
15138
+ VerifyIdentityOpen: VerifyIdentityOpen,
15098
15139
  Hold: Hold,
15099
- Loading: Loading$9
15140
+ Loading: Loading$9,
15141
+ Error: Error$a
15100
15142
  });
15101
15143
 
15102
15144
  /**
@@ -15111,7 +15153,7 @@ const PayoutStatusAlert = /*#__PURE__*/Object.freeze({
15111
15153
  *
15112
15154
  */
15113
15155
  //
15114
- const Default$l = `
15156
+ const Default$k = `
15115
15157
  // No CSS
15116
15158
  `;
15117
15159
  const Orangey = `
@@ -15145,7 +15187,7 @@ const Klip = `
15145
15187
 
15146
15188
  const Themes = /*#__PURE__*/Object.freeze({
15147
15189
  __proto__: null,
15148
- Default: Default$l,
15190
+ Default: Default$k,
15149
15191
  Orangey: Orangey,
15150
15192
  Netflix: Netflix,
15151
15193
  SaaSquatchCorporate: SaaSquatchCorporate,
@@ -5,29 +5,99 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-b0129cd6.js');
6
6
  const stencilHooks_module = require('./stencil-hooks.module-72742a0b.js');
7
7
  const index_module = require('./index.module-b8d9d0ba.js');
8
+ const utils = require('./utils-6847bc06.js');
8
9
  const keys = require('./keys-cff24974.js');
10
+ const extractProps = require('./extractProps-fd93ba62.js');
9
11
 
12
+ const USER_LOOKUP = index_module.dist.gql `
13
+ query checkUserVerification {
14
+ viewer {
15
+ ... on User {
16
+ id
17
+ accountId
18
+ email
19
+ emailVerified
20
+ }
21
+ }
22
+ }
23
+ `;
24
+ function useWidgetVerificationInternal() {
25
+ const userIdentity = index_module.K();
26
+ const [showCode, setShowCode] = index_module.Fn({
27
+ namespace: keys.SHOW_CODE_NAMESPACE,
28
+ initialValue: false,
29
+ });
30
+ const [email, setEmail] = index_module.Fn({
31
+ namespace: keys.VERIFICATION_EMAIL_NAMESPACE,
32
+ initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
33
+ });
34
+ const setContext = index_module.Sn(keys.VERIFICATION_PARENT_NAMESPACE);
35
+ const [loading, setLoading] = stencilHooks_module.useState(true);
36
+ const [fetch] = index_module.an(USER_LOOKUP);
37
+ stencilHooks_module.useEffect(() => {
38
+ const checkUser = async () => {
39
+ var _a;
40
+ try {
41
+ const res = await fetch({});
42
+ if (!res || res instanceof Error)
43
+ throw new Error();
44
+ if ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified)
45
+ setContext(true);
46
+ }
47
+ catch (e) {
48
+ console.error("Could not fetch user information:", e);
49
+ }
50
+ finally {
51
+ setLoading(false);
52
+ }
53
+ };
54
+ checkUser();
55
+ }, []);
56
+ const onVerification = () => {
57
+ setContext(true);
58
+ };
59
+ return { showCode, onVerification, loading };
60
+ }
10
61
  const WidgetVerificationInternal = class {
11
62
  constructor(hostRef) {
12
63
  index.registerInstance(this, hostRef);
13
64
  stencilHooks_module.h$1(this);
14
65
  }
15
66
  disconnectedCallback() { }
67
+ getStepTextProps(prefix) {
68
+ const props = utils.getProps(this);
69
+ return extractProps.extractProps(props, prefix);
70
+ }
16
71
  render() {
17
- const userIdentity = index_module.K();
18
- const [showCode, setShowCode] = index_module.Fn({
19
- namespace: keys.SHOW_CODE_NAMESPACE,
20
- initialValue: false,
21
- });
22
- const [email, setEmail] = index_module.Fn({
23
- namespace: keys.VERIFICATION_EMAIL_NAMESPACE,
24
- initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
25
- });
72
+ const { showCode, onVerification, loading } = index_module.isDemo()
73
+ ? useDemoWidgetVerificationInternal()
74
+ : useWidgetVerificationInternal();
75
+ // TODO: Shoelace spinner is throwing errors
76
+ if (loading)
77
+ return index.h("div", null);
78
+ // if (loading) {
79
+ // return <sl-spinner style="font-size: 2rem;"></sl-spinner>;
80
+ // }
26
81
  if (showCode) {
27
- return index.h("sqm-code-verification", null);
82
+ return (index.h("sqm-code-verification", Object.assign({ onVerification: onVerification }, this.getStepTextProps("codeStep_"))));
28
83
  }
29
- return index.h("sqm-email-verification", null);
84
+ return (index.h("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"))));
30
85
  }
31
86
  };
87
+ function useDemoWidgetVerificationInternal() {
88
+ const [showCode, setShowCode] = index_module.Fn({
89
+ namespace: keys.SHOW_CODE_NAMESPACE,
90
+ initialValue: false,
91
+ });
92
+ const [email, setEmail] = index_module.Fn({
93
+ namespace: keys.VERIFICATION_EMAIL_NAMESPACE,
94
+ initialValue: undefined,
95
+ });
96
+ const setContext = index_module.Sn(keys.VERIFICATION_PARENT_NAMESPACE);
97
+ const onVerification = () => {
98
+ setContext(true);
99
+ };
100
+ return { showCode, onVerification, loading: false };
101
+ }
32
102
 
33
103
  exports.sqm_widget_verification_internal = WidgetVerificationInternal;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-b0129cd6.js');
6
6
  const stencilHooks_module = require('./stencil-hooks.module-72742a0b.js');
7
7
  const index_module = require('./index.module-b8d9d0ba.js');
8
+ const utils = require('./utils-6847bc06.js');
8
9
  const keys = require('./keys-cff24974.js');
9
10
 
10
11
  const debug = stencilHooks_module.browser("sq:widget-verification");
@@ -35,23 +36,105 @@ function useTemplateChildren({ parent, callback }) {
35
36
  };
36
37
  }
37
38
  const WidgetVerification = class {
39
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
+ CODE STEP PROPS
41
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
38
42
  constructor(hostRef) {
39
43
  index.registerInstance(this, hostRef);
44
+ // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
45
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46
+ EMAIL STEP PROPS
47
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
48
+ /**
49
+ * @uiName Verify email widget header text
50
+ * @uiGroup Email Verification Step
51
+ */
52
+ this.emailStep_verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
53
+ /**
54
+ * @uiName Send code to email alert header
55
+ * @uiGroup Email Verification Step
56
+ */
57
+ this.emailStep_sendCodeErrorHeader = "There was an error sending your code.";
58
+ /**
59
+ * @uiName Send code to email alert description
60
+ * @uiGroup Email Verification Step
61
+ */
62
+ this.emailStep_sendCodeErrorDescription = "Please try again. If this problem continues, contact our program support team.";
63
+ /**
64
+ * @uiName Email input label
65
+ * @uiGroup Email Verification Step
66
+ */
67
+ this.emailStep_emailLabel = "Email";
68
+ /**
69
+ * @uiName Send code button text
70
+ * @uiGroup Email Verification Step
71
+ */
72
+ this.emailStep_sendCodeText = "Send code";
73
+ /**
74
+ * @uiName Send code button text
75
+ * @uiGroup Email Verification Step
76
+ */
77
+ this.emailStep_emailValidationErrorText = "Please enter a valid email";
78
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79
+ EMAIL STEP PROPS
80
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
81
+ /**
82
+ * @uiName Verify code widget header text
83
+ * @uiGroup Code Verification Step
84
+ */
85
+ this.codeStep_verifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
86
+ /**
87
+ * @uiName Reverify code widget header text
88
+ * @uiGroup Code Verification Step
89
+ */
90
+ this.codeStep_reverifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
91
+ /**
92
+ * Text displayed under verify button
93
+ * @uiName Resend code text
94
+ * @uiGroup Code Verification Step
95
+ */
96
+ this.codeStep_resendCodeText = "Didn't receive your code? {resendCodeLink}";
97
+ /**
98
+ * The link that appears in the resend code link
99
+ * @uiName Resend code label
100
+ * @uiGroup Code Verification Step
101
+ */
102
+ this.codeStep_resendCodeLabel = "Resend code";
103
+ /**
104
+ * Link text displayed under verify button
105
+ * @uiName Resend code text
106
+ * @uiGroup Code Verification Step
107
+ */
108
+ this.codeStep_codeResentSuccessfullyText = "Another code has been sent to {email}";
109
+ /**
110
+ * Error text displayed under verification input
111
+ * @uiName Invalid code text
112
+ * @uiGroup Code Verification Step
113
+ */
114
+ this.codeStep_invalidCodeText = "Please check your code and try again. If you’re still having trouble, try resending your code.";
115
+ /**
116
+ * @uiName Verify code button text
117
+ * @uiGroup Code Verification Step
118
+ */
119
+ this.codeStep_verifyText = "Verify";
120
+ /**
121
+ * Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
122
+ * @uiName Network error message
123
+ * @uiGroup Code Verification Step
124
+ */
125
+ this.codeStep_networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
40
126
  stencilHooks_module.h$1(this);
41
127
  }
42
128
  disconnectedCallback() { }
43
129
  render() {
44
130
  const [context, setContext] = index_module.Fn({
45
131
  namespace: keys.VERIFICATION_PARENT_NAMESPACE,
46
- initialValue: undefined,
132
+ initialValue: false,
47
133
  });
48
- const authToken = context === null || context === void 0 ? void 0 : context.token;
49
134
  const [container, setContainer] = stencilHooks_module.useState(undefined);
50
135
  const [slot, setSlot] = stencilHooks_module.useState(undefined);
51
- if (!authToken)
52
- debug("No user identity available");
53
136
  const updateTemplates = index_module.useCallback(() => {
54
- const isAuth = !!authToken;
137
+ const isAuth = context;
55
138
  const templates = slot.querySelectorAll(`template`);
56
139
  const template = Array.from(templates).find((t) => t.slot === (isAuth ? "verified" : "not-verified"));
57
140
  if (template) {
@@ -99,7 +182,7 @@ const WidgetVerification = class {
99
182
  target.style.height = "25px";
100
183
  });
101
184
  }
102
- }, [container, slot, authToken]);
185
+ }, [container, slot, context]);
103
186
  stencilHooks_module.useEffect(() => {
104
187
  if (!container || !slot) {
105
188
  debug("DOM not ready:");
@@ -108,19 +191,19 @@ const WidgetVerification = class {
108
191
  // Run on first render
109
192
  updateTemplates();
110
193
  return useTemplateChildren({ parent: slot, callback: updateTemplates });
111
- }, [slot, container, authToken]);
112
- stencilHooks_module.useEffect(() => {
113
- const host = stencilHooks_module.l();
114
- const callback = (e) => {
115
- e.stopPropagation();
116
- setContext({ token: e.detail.token });
117
- };
118
- host.addEventListener(keys.VERIFICATION_EVENT_KEY, callback);
119
- return () => {
120
- host.removeEventListener(keys.VERIFICATION_EVENT_KEY, callback);
121
- };
122
- }, []);
123
- return (index.h(index.Host, null, index.h("div", { ref: setSlot, style: { display: "contents" } }, index.h("template", { slot: "not-verified" }, index.h("sqm-widget-verification-internal", null)), index.h("slot", { name: "not-verified" }), index.h("slot", { name: "verified" })), index.h("div", { ref: setContainer }, index.h("slot", { name: "shown" }))));
194
+ }, [slot, container, context]);
195
+ // useEffect(() => {
196
+ // const host = useHost();
197
+ // const callback = (e: CustomEvent) => {
198
+ // e.stopPropagation();
199
+ // setContext({ token: e.detail.token });
200
+ // };
201
+ // host.addEventListener(VERIFICATION_EVENT_KEY, callback);
202
+ // return () => {
203
+ // host.removeEventListener(VERIFICATION_EVENT_KEY, callback);
204
+ // };
205
+ // }, []);
206
+ return (index.h(index.Host, null, index.h("div", { ref: setSlot, style: { display: "contents" } }, index.h("template", { slot: "not-verified" }, index.h("sqm-widget-verification-internal", Object.assign({}, utils.getProps(this)))), index.h("slot", { name: "not-verified" }), index.h("slot", { name: "verified" })), index.h("div", { ref: setContainer }, index.h("slot", { name: "shown" }))));
124
207
  }
125
208
  };
126
209
 
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ const stencilHooks_module = require('./stencil-hooks.module-72742a0b.js');
4
+ const index_module = require('./index.module-b8d9d0ba.js');
5
+
6
+ const GET_USER_STATUS = index_module.dist.gql `
7
+ query getUserStatus {
8
+ user: viewer {
9
+ ... on User {
10
+ id
11
+ impactConnection {
12
+ connected
13
+ publisher {
14
+ id
15
+ payoutsAccount {
16
+ hold
17
+ holdReasons
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ `;
25
+ function getStatus(data) {
26
+ var _a, _b, _c, _d, _e;
27
+ const account = (_b = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.payoutsAccount;
28
+ if (!((_d = (_c = data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.connected) || !account)
29
+ return "INFORMATION_REQUIRED";
30
+ if ((_e = account.holdReasons) === null || _e === void 0 ? void 0 : _e.includes("IDV_CHECK_REQUIRED"))
31
+ return "VERIFICATION_NEEDED";
32
+ if (account.hold)
33
+ return "HOLD";
34
+ return "DONE";
35
+ }
36
+ function usePayoutStatus(props) {
37
+ const { type } = index_module.getEnvironmentSDK();
38
+ const { loading, data, errors, refetch } = index_module.En(GET_USER_STATUS, {});
39
+ const [status, setStatus] = stencilHooks_module.useState(undefined);
40
+ const [showDialog, setShowDialog] = stencilHooks_module.useState(false);
41
+ stencilHooks_module.useEffect(() => {
42
+ if (!data)
43
+ return;
44
+ const s = getStatus(data);
45
+ setStatus(s);
46
+ }, [data]);
47
+ stencilHooks_module.useEffect(() => {
48
+ const cb = () => refetch();
49
+ window.addEventListener("sqm:tax-form-updated", cb);
50
+ return () => window.removeEventListener("sqm:tax-form-updated", cb);
51
+ }, []);
52
+ return {
53
+ states: {
54
+ loading,
55
+ status,
56
+ showVerifyIdentity: showDialog,
57
+ error: !!errors,
58
+ },
59
+ data: { type },
60
+ text: props.getTextProps(),
61
+ callbacks: {
62
+ onTermsClick: () => window.open(props.termsUrl, "_blank").focus(),
63
+ onClick: () => setShowDialog(true),
64
+ onCancel: () => setShowDialog(false),
65
+ },
66
+ };
67
+ }
68
+
69
+ exports.getStatus = getStatus;
70
+ exports.usePayoutStatus = usePayoutStatus;
@@ -0,0 +1,169 @@
1
+ 'use strict';
2
+
3
+ const stencilHooks_module = require('./stencil-hooks.module-72742a0b.js');
4
+ const index_module = require('./index.module-b8d9d0ba.js');
5
+
6
+ const UserLookupQuery = index_module.dist.gql `
7
+ query userLookup {
8
+ viewer {
9
+ ... on User {
10
+ id
11
+ accountId
12
+ email
13
+ impactConnection {
14
+ user {
15
+ id
16
+ email
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ `;
23
+ const ParticipantVerificationEmailMutation = index_module.dist.gql `
24
+ mutation requestUserEmailVerification($user: UserIdInput!) {
25
+ requestUserEmailVerification(user: $user) {
26
+ success
27
+ }
28
+ }
29
+ `;
30
+ const ImpactVerificationEmailMutation = index_module.dist.gql `
31
+ mutation requestImpactPublisherEmail2FA($user: UserIdInput!) {
32
+ requestImpactPublisherEmail2FA(user: $user) {
33
+ success
34
+ }
35
+ }
36
+ `;
37
+ const VerifyUserEmailMutation = index_module.dist.gql `
38
+ mutation verifyUserEmail($user: UserIdInput!, $code: String!) {
39
+ verifyUserEmail(user: $user, code: $code) {
40
+ id
41
+ accountId
42
+ email
43
+ emailVerified
44
+ }
45
+ }
46
+ `;
47
+ const SubmitImpactCodeMutation = index_module.dist.gql `
48
+ mutation submitImpactPublisherEmail2FACode(
49
+ $user: UserIdInput!
50
+ $code: String!
51
+ ) {
52
+ submitImpactPublisherEmail2FACode(user: $user, code: $code) {
53
+ verifiedEmail
54
+ accessKey
55
+ }
56
+ }
57
+ `;
58
+ // ! It's important when using this hook to ensure initialisation
59
+ // ! is done before calling any mutations
60
+ function useVerificationEmail() {
61
+ const userIdentity = index_module.K();
62
+ const [hasEmails, setHasEmails] = stencilHooks_module.useState({
63
+ participant: false,
64
+ impact: false,
65
+ });
66
+ const [fetch] = index_module.an(UserLookupQuery);
67
+ // Send mutations
68
+ const [sendParticipantEmail, { loading: participantEmailLoading, errors: participantEmailErrors },] = index_module.xe(ParticipantVerificationEmailMutation);
69
+ const [sendImpactEmail, { loading: impactEmailLoading, errors: impactEmailErrors },] = index_module.xe(ImpactVerificationEmailMutation);
70
+ const sendLoading = participantEmailLoading || impactEmailLoading;
71
+ const sendErrors = participantEmailErrors || impactEmailErrors;
72
+ // Verification mutations
73
+ const [verifyUserEmail, { loading: verifyMutationLoading, errors: verifyMutationErrors },] = index_module.xe(VerifyUserEmailMutation);
74
+ const [submitImpactCode, { loading: submitImpactCodeLoading, errors: submitImpactCodeErrors },] = index_module.xe(SubmitImpactCodeMutation);
75
+ const verifyLoading = verifyMutationLoading || submitImpactCodeLoading;
76
+ const verifyErrors = verifyMutationErrors || submitImpactCodeErrors;
77
+ const [initialized, setInitialized] = stencilHooks_module.useState(false);
78
+ const initialise = async () => {
79
+ var _a, _b, _c, _d;
80
+ try {
81
+ const lookup = await fetch({});
82
+ if (!lookup || lookup instanceof Error)
83
+ throw new Error();
84
+ setHasEmails({
85
+ participant: !!((_a = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _a === void 0 ? void 0 : _a.email),
86
+ impact: !!((_d = (_c = (_b = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.email),
87
+ });
88
+ setInitialized(true);
89
+ }
90
+ catch (e) {
91
+ console.error("Could not initialise verification", e);
92
+ }
93
+ };
94
+ const sendVerificationEmail = async () => {
95
+ let result = null;
96
+ if (!initialized)
97
+ return result;
98
+ if (!hasEmails.participant && !hasEmails.impact)
99
+ return result;
100
+ try {
101
+ const request = hasEmails.impact ? sendImpactEmail : sendParticipantEmail;
102
+ const res = await request({
103
+ user: {
104
+ id: userIdentity.id,
105
+ accountId: userIdentity.accountId,
106
+ },
107
+ });
108
+ if (res instanceof Error || !res)
109
+ throw new Error();
110
+ result = hasEmails.impact
111
+ ? res.requestImpactPublisherEmail2FA
112
+ : res.requestUserEmailVerification;
113
+ }
114
+ catch (e) {
115
+ console.error("Could not send verification email", e);
116
+ }
117
+ finally {
118
+ return result;
119
+ }
120
+ };
121
+ const verifyVerificationEmail = async (code) => {
122
+ var _a;
123
+ let result = null;
124
+ if (!initialized)
125
+ return result;
126
+ if (!hasEmails.participant && !hasEmails.impact)
127
+ return result;
128
+ try {
129
+ const request = hasEmails.impact ? submitImpactCode : verifyUserEmail;
130
+ const res = await request({
131
+ user: {
132
+ id: userIdentity.id,
133
+ accountId: userIdentity.accountId,
134
+ },
135
+ code,
136
+ });
137
+ if (res instanceof Error || !res)
138
+ throw new Error();
139
+ result = {
140
+ success: true,
141
+ accessKey: hasEmails.impact
142
+ ? (_a = res.submitImpactPublisherEmail2FACode) === null || _a === void 0 ? void 0 : _a.accessKey : undefined,
143
+ };
144
+ }
145
+ catch (e) {
146
+ console.error("Could not verify email", e);
147
+ }
148
+ finally {
149
+ return result;
150
+ }
151
+ };
152
+ stencilHooks_module.useEffect(() => {
153
+ if (!initialized)
154
+ initialise();
155
+ }, []);
156
+ return {
157
+ initialized,
158
+ send: [
159
+ sendVerificationEmail,
160
+ { loading: sendLoading, errors: sendErrors },
161
+ ],
162
+ verify: [
163
+ verifyVerificationEmail,
164
+ { loading: verifyLoading, errors: verifyErrors },
165
+ ],
166
+ };
167
+ }
168
+
169
+ exports.useVerificationEmail = useVerificationEmail;