@saasquatch/mint-components 2.2.0 → 2.3.0-2

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 (375) hide show
  1. package/dist/cjs/{data-8c8a08f6.js → data-89ac73dd.js} +2 -90
  2. package/dist/cjs/eventKeys-7af4df4d.js +5 -0
  3. package/dist/cjs/{keys-cff24974.js → keys-5a2c9ed2.js} +4 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/mint-components.cjs.js +1 -1
  6. package/dist/cjs/parseStates-d1effc19.js +16 -0
  7. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +461 -339
  8. package/dist/cjs/{sqm-big-stat_46.cjs.entry.js → sqm-big-stat_47.cjs.entry.js} +450 -16
  9. package/dist/cjs/sqm-code-verification.cjs.entry.js +4 -5
  10. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +893 -0
  11. package/dist/cjs/sqm-partner-info-modal-view-f6faecf5.js +149 -0
  12. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +27 -9
  13. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +30 -9
  14. package/dist/cjs/sqm-stencilbook.cjs.entry.js +732 -326
  15. package/dist/cjs/{sqm-user-info-form-view-53306f6e.js → sqm-user-info-form-view-0e1ddbe4.js} +34 -426
  16. package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +1 -1
  17. package/dist/cjs/{usePayoutStatus-0192fccd.js → useIndirectTaxForm-c3c1ec56.js} +294 -5
  18. package/dist/cjs/utils-a3b3d05b.js +478 -0
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +171 -0
  21. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +143 -0
  22. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +670 -0
  23. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +276 -0
  24. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +1 -0
  25. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +1 -0
  26. package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTable.stories.js +2 -2
  27. package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.js +209 -145
  28. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +30 -10
  29. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +1 -0
  30. package/dist/collection/components/sqm-rewards-table/TaxAndCashRewardsTable.stories.js +2 -2
  31. package/dist/collection/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.js +223 -137
  32. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +30 -10
  33. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +1 -0
  34. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
  35. package/dist/collection/components/sqm-widget-verification/WidgetVerification.stories.js +16 -0
  36. package/dist/collection/components/sqm-widget-verification/keys.js +2 -0
  37. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +3 -4
  38. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +0 -2
  39. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +19 -9
  40. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +486 -46
  41. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +43 -11
  42. package/dist/collection/components/tax-and-cash/data.js +2 -0
  43. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +93 -37
  44. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +738 -13
  45. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +95 -1
  46. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +51 -12
  47. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +59 -30
  48. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +51 -2
  49. package/dist/collection/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.js +0 -1
  50. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +10 -18
  51. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +0 -25
  52. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +34 -17
  53. package/dist/esm/{ShadowViewAddon-0b980200.js → ShadowViewAddon-e115fa1c.js} +5 -5
  54. package/dist/{mint-components/p-0c0d4065.js → esm/data-8698cbc6.js} +25 -5
  55. package/dist/esm/eventKeys-f76b6a03.js +3 -0
  56. package/dist/esm/{global-96c14d63.js → global-75e96214.js} +1 -1
  57. package/dist/esm/{index.module-b23fdad8.js → index.module-02cb914c.js} +1 -1
  58. package/dist/esm/keys-1054056a.js +8 -0
  59. package/dist/esm/loader.js +3 -3
  60. package/dist/esm/mint-components.js +3 -3
  61. package/dist/esm/parseStates-ed75e224.js +14 -0
  62. package/dist/esm/{re-render-f30aeb6b.js → re-render-bf46ba54.js} +1 -1
  63. package/dist/esm/sqm-banking-info-form_10.entry.js +448 -326
  64. package/dist/esm/{sqm-big-stat_46.entry.js → sqm-big-stat_47.entry.js} +454 -21
  65. package/dist/esm/sqm-close-button.entry.js +1 -1
  66. package/dist/esm/sqm-code-verification.entry.js +7 -8
  67. package/dist/esm/sqm-context-router.entry.js +1 -1
  68. package/dist/esm/sqm-email-verification_2.entry.js +888 -0
  69. package/dist/esm/sqm-empty_4.entry.js +2 -2
  70. package/dist/esm/sqm-google-sign-in.entry.js +1 -1
  71. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  72. package/dist/esm/sqm-instant-access-registration.entry.js +3 -3
  73. package/dist/esm/{sqm-lead-checkbox-field-view-7928db07.js → sqm-lead-checkbox-field-view-bfafee56.js} +1 -1
  74. package/dist/esm/sqm-lead-checkbox-field.entry.js +4 -4
  75. package/dist/esm/{sqm-lead-input-field-view-d1b91650.js → sqm-lead-input-field-view-b945edf4.js} +1 -1
  76. package/dist/esm/sqm-lead-input-field.entry.js +4 -4
  77. package/dist/esm/sqm-leaderboard-rank.entry.js +2 -2
  78. package/dist/esm/sqm-logout-current-user.entry.js +1 -1
  79. package/dist/esm/{sqm-navigation-sidebar-item-view-b3beac5a.js → sqm-navigation-sidebar-item-view-8d98fcf3.js} +1 -1
  80. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  81. package/dist/esm/sqm-navigation-sidebar.entry.js +1 -1
  82. package/dist/esm/sqm-pagination_3.entry.js +3 -3
  83. package/dist/esm/sqm-partner-info-modal-view-d6f3a215.js +146 -0
  84. package/dist/esm/sqm-password-field.entry.js +2 -2
  85. package/dist/esm/sqm-popup-container.entry.js +1 -1
  86. package/dist/esm/{sqm-portal-email-verification-view-04528277.js → sqm-portal-email-verification-view-fde1eb35.js} +1 -1
  87. package/dist/esm/sqm-portal-email-verification.entry.js +3 -3
  88. package/dist/esm/sqm-portal-forgot-password_6.entry.js +4 -4
  89. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  90. package/dist/esm/{sqm-portal-profile-view-b5ea620f.js → sqm-portal-profile-view-2018590a.js} +1 -1
  91. package/dist/esm/sqm-portal-profile.entry.js +4 -4
  92. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  93. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  94. package/dist/esm/{sqm-portal-verify-email-view-c61536b7.js → sqm-portal-verify-email-view-590f964b.js} +1 -1
  95. package/dist/esm/sqm-qr-code.entry.js +2 -2
  96. package/dist/esm/sqm-referral-table_11.entry.js +32 -14
  97. package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +2 -2
  98. package/dist/esm/sqm-rewards-table_9.entry.js +35 -14
  99. package/dist/esm/sqm-stencilbook.entry.js +708 -302
  100. package/dist/esm/sqm-tab.entry.js +2 -2
  101. package/dist/esm/sqm-tabs.entry.js +3 -3
  102. package/dist/esm/{sqm-user-info-form-view-19d81a2b.js → sqm-user-info-form-view-e1ba6009.js} +14 -403
  103. package/dist/esm/sqm-widget-verification-controller.entry.js +2 -2
  104. package/dist/esm/{useChildElements-9bccfb72.js → useChildElements-06937df7.js} +1 -1
  105. package/dist/esm/{usePayoutStatus-46c0c289.js → useIndirectTaxForm-b2888ea5.js} +292 -5
  106. package/dist/esm/{useInstantAccessRegistration-69fefed0.js → useInstantAccessRegistration-69c9ffe0.js} +2 -2
  107. package/dist/esm/{useLeadFormState-dd4e8b08.js → useLeadFormState-332b2796.js} +2 -2
  108. package/dist/esm/{usePortalRegistrationForm-62de6fb1.js → usePortalRegistrationForm-3a1f36a2.js} +2 -2
  109. package/dist/esm/{useReferralCodes-52ca720f.js → useReferralCodes-25f8b792.js} +1 -1
  110. package/dist/esm/{useReferralTable-92af4133.js → useReferralTable-03d32c6f.js} +3 -3
  111. package/dist/esm/{useRegistrationFormState-2c090c38.js → useRegistrationFormState-aa44cfff.js} +1 -1
  112. package/dist/esm/{useVerificationEmail-c13c3b51.js → useVerificationEmail-9f2c0bab.js} +1 -1
  113. package/dist/esm/{utilities-77b1e0cc.js → utilities-cbd8f2eb.js} +1 -1
  114. package/dist/esm/utils-4f5cd04c.js +467 -0
  115. package/dist/esm-es5/{ShadowViewAddon-0b980200.js → ShadowViewAddon-e115fa1c.js} +1 -1
  116. package/dist/esm-es5/data-8698cbc6.js +1 -0
  117. package/dist/esm-es5/eventKeys-f76b6a03.js +1 -0
  118. package/dist/esm-es5/{global-96c14d63.js → global-75e96214.js} +1 -1
  119. package/dist/esm-es5/{index.module-b23fdad8.js → index.module-02cb914c.js} +1 -1
  120. package/dist/esm-es5/keys-1054056a.js +1 -0
  121. package/dist/esm-es5/loader.js +1 -1
  122. package/dist/esm-es5/mint-components.js +1 -1
  123. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  124. package/dist/esm-es5/{re-render-f30aeb6b.js → re-render-bf46ba54.js} +1 -1
  125. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  126. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -0
  127. package/dist/esm-es5/sqm-close-button.entry.js +1 -1
  128. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  129. package/dist/esm-es5/sqm-context-router.entry.js +1 -1
  130. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -0
  131. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  132. package/dist/esm-es5/sqm-google-sign-in.entry.js +1 -1
  133. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  134. package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
  135. package/dist/esm-es5/{sqm-lead-checkbox-field-view-7928db07.js → sqm-lead-checkbox-field-view-bfafee56.js} +1 -1
  136. package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
  137. package/dist/esm-es5/{sqm-lead-input-field-view-d1b91650.js → sqm-lead-input-field-view-b945edf4.js} +1 -1
  138. package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
  139. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  140. package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
  141. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-b3beac5a.js → sqm-navigation-sidebar-item-view-8d98fcf3.js} +1 -1
  142. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  143. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  144. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  145. package/dist/esm-es5/sqm-partner-info-modal-view-d6f3a215.js +1 -0
  146. package/dist/esm-es5/sqm-password-field.entry.js +1 -1
  147. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  148. package/dist/esm-es5/{sqm-portal-email-verification-view-04528277.js → sqm-portal-email-verification-view-fde1eb35.js} +1 -1
  149. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  150. package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
  151. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  152. package/dist/esm-es5/{sqm-portal-profile-view-b5ea620f.js → sqm-portal-profile-view-2018590a.js} +1 -1
  153. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  154. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  155. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  156. package/dist/esm-es5/{sqm-portal-verify-email-view-c61536b7.js → sqm-portal-verify-email-view-590f964b.js} +1 -1
  157. package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
  158. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  159. package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
  160. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  161. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  162. package/dist/esm-es5/sqm-tab.entry.js +1 -1
  163. package/dist/esm-es5/sqm-tabs.entry.js +1 -1
  164. package/dist/esm-es5/sqm-user-info-form-view-e1ba6009.js +1 -0
  165. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
  166. package/dist/esm-es5/{useChildElements-9bccfb72.js → useChildElements-06937df7.js} +1 -1
  167. package/dist/esm-es5/useIndirectTaxForm-b2888ea5.js +6 -0
  168. package/dist/esm-es5/{useInstantAccessRegistration-69fefed0.js → useInstantAccessRegistration-69c9ffe0.js} +1 -1
  169. package/dist/esm-es5/{useLeadFormState-dd4e8b08.js → useLeadFormState-332b2796.js} +1 -1
  170. package/dist/esm-es5/{usePortalRegistrationForm-62de6fb1.js → usePortalRegistrationForm-3a1f36a2.js} +1 -1
  171. package/dist/esm-es5/{useReferralCodes-52ca720f.js → useReferralCodes-25f8b792.js} +1 -1
  172. package/dist/esm-es5/{useReferralTable-92af4133.js → useReferralTable-03d32c6f.js} +1 -1
  173. package/dist/esm-es5/{useRegistrationFormState-2c090c38.js → useRegistrationFormState-aa44cfff.js} +1 -1
  174. package/dist/esm-es5/{useVerificationEmail-c13c3b51.js → useVerificationEmail-9f2c0bab.js} +1 -1
  175. package/dist/esm-es5/{utilities-77b1e0cc.js → utilities-cbd8f2eb.js} +1 -1
  176. package/dist/esm-es5/utils-4f5cd04c.js +1 -0
  177. package/dist/mint-components/mint-components.esm.js +1 -1
  178. package/dist/mint-components/mint-components.js +1 -1
  179. package/dist/mint-components/{p-626b31cb.system.entry.js → p-025ddad2.system.entry.js} +1 -1
  180. package/dist/mint-components/{p-5b871e38.system.entry.js → p-02c0f88e.system.entry.js} +1 -1
  181. package/dist/mint-components/{p-f55ecf35.system.js → p-02e2b13b.system.js} +1 -1
  182. package/dist/mint-components/{p-a4f8abad.js → p-0766438e.js} +1 -1
  183. package/dist/mint-components/{p-205cfdcd.system.js → p-0815b973.system.js} +1 -1
  184. package/dist/mint-components/{p-db0a2afd.entry.js → p-092c2606.entry.js} +1 -1
  185. package/dist/mint-components/{p-fe1d3cf8.system.entry.js → p-099ce3d5.system.entry.js} +1 -1
  186. package/dist/mint-components/p-0a6489fa.entry.js +1 -0
  187. package/dist/mint-components/p-0afa6148.js +1 -0
  188. package/dist/mint-components/{p-fc284f91.system.entry.js → p-0b32e1d4.system.entry.js} +1 -1
  189. package/dist/mint-components/p-115dfc03.system.js +1 -0
  190. package/dist/mint-components/{p-7b59e13c.system.js → p-1317cc92.system.js} +1 -1
  191. package/dist/mint-components/{p-2b4af8e8.system.entry.js → p-13bb56a8.system.entry.js} +1 -1
  192. package/dist/mint-components/{p-f8a09b0f.js → p-13d8ecad.js} +1 -1
  193. package/dist/mint-components/p-13f3a647.js +1 -0
  194. package/dist/mint-components/{p-61897e72.entry.js → p-14183edc.entry.js} +1 -1
  195. package/dist/mint-components/{p-8f2d03c7.entry.js → p-1599a178.entry.js} +1 -1
  196. package/dist/mint-components/{p-02499e08.entry.js → p-1b0326d1.entry.js} +1 -1
  197. package/dist/mint-components/p-1d398dbc.entry.js +11 -0
  198. package/dist/mint-components/p-1d86895f.system.js +1 -0
  199. package/dist/mint-components/p-1e6a2945.js +1 -0
  200. package/dist/mint-components/{p-c8a3f3b0.js → p-1efb42e2.js} +1 -1
  201. package/dist/mint-components/p-1f387c7b.system.js +1 -0
  202. package/dist/mint-components/{p-a96c9bbb.system.entry.js → p-209157a9.system.entry.js} +1 -1
  203. package/dist/mint-components/{p-30c1ef36.system.js → p-2190dc73.system.js} +1 -1
  204. package/dist/mint-components/{p-80e116ec.system.entry.js → p-24f1d342.system.entry.js} +1 -1
  205. package/dist/mint-components/{p-6668f9f0.entry.js → p-27daf264.entry.js} +1 -1
  206. package/dist/mint-components/p-28ed2ae9.js +1 -0
  207. package/dist/mint-components/{p-09f7aacd.entry.js → p-29bc5f50.entry.js} +2 -2
  208. package/dist/mint-components/{p-738dce27.system.entry.js → p-2d3f7b76.system.entry.js} +1 -1
  209. package/dist/mint-components/p-2ed13619.entry.js +1 -0
  210. package/dist/mint-components/{p-c45a929a.system.entry.js → p-30cfe3e3.system.entry.js} +1 -1
  211. package/dist/mint-components/{p-d55c50af.system.js → p-31815fb6.system.js} +1 -1
  212. package/dist/mint-components/{p-c8bcbf8b.system.entry.js → p-3354cc75.system.entry.js} +1 -1
  213. package/dist/mint-components/{p-5bc5c61e.entry.js → p-335a5736.entry.js} +1 -1
  214. package/dist/mint-components/{p-e9485160.system.entry.js → p-33ca28ba.system.entry.js} +1 -1
  215. package/dist/mint-components/p-3596e241.entry.js +116 -0
  216. package/dist/mint-components/{p-8583ce0c.system.js → p-376c7608.system.js} +1 -1
  217. package/dist/mint-components/p-37e24621.system.entry.js +1 -0
  218. package/dist/mint-components/{p-95510f27.entry.js → p-38d04e4b.entry.js} +1 -1
  219. package/dist/mint-components/{p-e84b874c.js → p-3a41b39c.js} +1 -1
  220. package/dist/mint-components/{p-e5ea43b1.entry.js → p-3bbc0db2.entry.js} +2 -2
  221. package/dist/mint-components/{p-982d1f6f.entry.js → p-432a44de.entry.js} +3 -2
  222. package/dist/mint-components/{p-bab4929e.js → p-45230a44.js} +1 -1
  223. package/dist/mint-components/p-4691e9d5.system.js +1 -0
  224. package/dist/mint-components/{p-1d92c169.entry.js → p-4d73a616.entry.js} +1 -1
  225. package/dist/mint-components/{p-3bc62ca6.entry.js → p-4e3db52b.entry.js} +1 -1
  226. package/dist/mint-components/{p-3286ef38.js → p-4eaa3eb7.js} +1 -1
  227. package/dist/mint-components/{p-013564b3.entry.js → p-4eadbd5b.entry.js} +1 -1
  228. package/dist/mint-components/p-4f9dc974.js +1 -0
  229. package/dist/mint-components/{p-f7ca4cc4.system.entry.js → p-51ae6716.system.entry.js} +1 -1
  230. package/dist/mint-components/p-56b33268.system.entry.js +1 -0
  231. package/dist/mint-components/p-58c24352.system.js +6 -0
  232. package/dist/mint-components/p-5c52100b.js +117 -0
  233. package/dist/mint-components/{p-77b9cde8.system.js → p-5fdf0286.system.js} +1 -1
  234. package/dist/mint-components/{p-09348341.entry.js → p-60b1f3d9.entry.js} +1 -1
  235. package/dist/mint-components/{p-d005df28.system.entry.js → p-623a0a0b.system.entry.js} +1 -1
  236. package/dist/mint-components/{p-c30d0049.system.entry.js → p-6b4e5d94.system.entry.js} +1 -1
  237. package/dist/mint-components/{p-f4e36adf.system.entry.js → p-6f6c3ac6.system.entry.js} +1 -1
  238. package/dist/mint-components/p-6f8dde97.system.js +1 -0
  239. package/dist/mint-components/{p-43c31fd5.system.js → p-7628e56f.system.js} +1 -1
  240. package/dist/mint-components/{p-653db72e.entry.js → p-78e6dc8d.entry.js} +1 -1
  241. package/dist/mint-components/{p-f581aac7.js → p-7a091fa7.js} +1 -1
  242. package/dist/mint-components/{p-40bad95a.entry.js → p-7cbdf341.entry.js} +2 -2
  243. package/dist/mint-components/{p-044f930a.system.js → p-7d2d9ef9.system.js} +1 -1
  244. package/dist/mint-components/{p-5c4ba8a0.entry.js → p-7ea3f49c.entry.js} +1 -1
  245. package/dist/mint-components/{p-5ce78407.system.entry.js → p-81bc6dca.system.entry.js} +1 -1
  246. package/dist/mint-components/{p-f6528f8a.entry.js → p-84495fb8.entry.js} +1 -1
  247. package/dist/mint-components/{p-b96e90a2.system.entry.js → p-86d20b47.system.entry.js} +1 -1
  248. package/dist/mint-components/p-87f86492.js +1 -0
  249. package/dist/mint-components/{p-d0993bb9.js → p-8a6531d2.js} +1 -1
  250. package/dist/mint-components/p-8ae8968c.js +1 -0
  251. package/dist/mint-components/{p-7265bbcb.system.js → p-8e148cb0.system.js} +1 -1
  252. package/dist/mint-components/p-8f15bf17.entry.js +1 -0
  253. package/dist/mint-components/{p-b66f45d1.entry.js → p-921eb024.entry.js} +1 -1
  254. package/dist/mint-components/{p-f1374258.system.entry.js → p-925aa740.system.entry.js} +1 -1
  255. package/dist/mint-components/p-99eecdcb.system.entry.js +1 -0
  256. package/dist/mint-components/{p-e12754f5.system.entry.js → p-9a15cd5a.system.entry.js} +1 -1
  257. package/dist/mint-components/p-9c1f5317.system.js +1 -0
  258. package/dist/mint-components/{p-832aea99.js → p-9f48640d.js} +1 -1
  259. package/dist/mint-components/p-a38eece5.system.entry.js +1 -0
  260. package/dist/mint-components/p-a49d9288.entry.js +1 -0
  261. package/dist/mint-components/{p-90833864.system.entry.js → p-ab59c5eb.system.entry.js} +1 -1
  262. package/dist/mint-components/{p-e6240c72.js → p-abd717d4.js} +1 -1
  263. package/dist/mint-components/p-abe9f5b1.js +99 -0
  264. package/dist/mint-components/p-ae2f610e.system.js +1 -0
  265. package/dist/mint-components/p-b222bace.system.entry.js +1 -0
  266. package/dist/mint-components/{p-19c441b2.system.js → p-b2ad3fca.system.js} +1 -1
  267. package/dist/mint-components/{p-c8a8d231.entry.js → p-b3309d9b.entry.js} +2 -2
  268. package/dist/mint-components/p-b419f9ac.entry.js +299 -0
  269. package/dist/mint-components/{p-8962e023.js → p-b871d158.js} +1 -1
  270. package/dist/mint-components/p-b96ed8eb.js +1 -0
  271. package/dist/mint-components/p-badf28bb.system.js +1 -0
  272. package/dist/mint-components/{p-035d9b65.js → p-bb0b5e4b.js} +1 -1
  273. package/dist/mint-components/{p-52674798.entry.js → p-bcfdb510.entry.js} +1 -1
  274. package/dist/mint-components/p-be6a0dee.system.js +1 -0
  275. package/dist/mint-components/{p-642f2c89.js → p-bf9ab2d3.js} +1 -1
  276. package/dist/mint-components/{p-bc386a7b.js → p-c0a85e22.js} +1 -1
  277. package/dist/mint-components/p-c0f8f977.system.entry.js +1 -0
  278. package/dist/mint-components/p-c41d536d.entry.js +1 -0
  279. package/dist/mint-components/{p-a0c5631b.system.js → p-c66e5217.system.js} +1 -1
  280. package/dist/mint-components/p-cdabd9de.system.js +1 -0
  281. package/dist/mint-components/p-cfc35705.system.entry.js +1 -0
  282. package/dist/mint-components/{p-0d83907e.js → p-cfea215d.js} +1 -1
  283. package/dist/mint-components/p-d08408b3.entry.js +1 -0
  284. package/dist/mint-components/{p-172675ca.system.js → p-d284ae70.system.js} +1 -1
  285. package/dist/mint-components/{p-027fc3be.system.entry.js → p-d34564f8.system.entry.js} +1 -1
  286. package/dist/mint-components/{p-1021a49f.system.entry.js → p-db6bf7cf.system.entry.js} +1 -1
  287. package/dist/mint-components/{p-4da5a3fe.system.entry.js → p-df897432.system.entry.js} +1 -1
  288. package/dist/mint-components/{p-036a2617.system.js → p-e651593c.system.js} +1 -1
  289. package/dist/mint-components/{p-f39cf252.system.entry.js → p-e6de31a7.system.entry.js} +1 -1
  290. package/dist/mint-components/{p-2668335b.js → p-e8e7af06.js} +1 -1
  291. package/dist/mint-components/{p-85721089.system.js → p-e920c95c.system.js} +1 -1
  292. package/dist/mint-components/{p-3366b81e.js → p-eae44b42.js} +2 -2
  293. package/dist/mint-components/p-ebc519bc.system.js +1 -0
  294. package/dist/mint-components/{p-af407cce.entry.js → p-ef32fa8f.entry.js} +1 -1
  295. package/dist/mint-components/{p-7efb8782.system.js → p-f32050f6.system.js} +1 -1
  296. package/dist/mint-components/{p-782af7ae.system.entry.js → p-f6de2e5c.system.entry.js} +1 -1
  297. package/dist/mint-components/{p-9390586b.system.entry.js → p-fa85ea51.system.entry.js} +1 -1
  298. package/dist/mint-components/p-ff013776.entry.js +9 -0
  299. package/dist/mint-components/p-ffcebe78.entry.js +83 -0
  300. package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +15 -0
  301. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +50 -0
  302. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +123 -0
  303. package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +17 -0
  304. package/dist/types/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.d.ts +18 -1
  305. package/dist/types/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.d.ts +19 -7
  306. package/dist/types/components/sqm-widget-verification/WidgetVerification.stories.d.ts +8 -0
  307. package/dist/types/components/sqm-widget-verification/keys.d.ts +2 -0
  308. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +75 -7
  309. package/dist/types/components/sqm-widget-verification/useWidgetVerification.d.ts +2 -0
  310. package/dist/types/components/tax-and-cash/data.d.ts +3 -0
  311. package/dist/types/components/tax-and-cash/sqm-banking-info-form/formDefinitions.d.ts +8 -0
  312. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +4 -0
  313. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +173 -0
  314. package/dist/types/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.d.ts +2 -0
  315. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +7 -0
  316. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +10 -5
  317. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -1
  318. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.d.ts +0 -4
  319. package/dist/types/components.d.ts +644 -32
  320. package/dist/types/saasquatch.d.ts +2 -0
  321. package/docs/docs.docx +0 -0
  322. package/docs/raisins.json +1 -1
  323. package/grapesjs/grapesjs.js +1 -1
  324. package/package.json +2 -4
  325. package/dist/cjs/extractProps-e9c55ba8.js +0 -35
  326. package/dist/cjs/sqm-email-verification.cjs.entry.js +0 -418
  327. package/dist/cjs/sqm-widget-verification.cjs.entry.js +0 -214
  328. package/dist/esm/data-12e6aae1.js +0 -216
  329. package/dist/esm/extractProps-54064fb0.js +0 -32
  330. package/dist/esm/keys-406491dc.js +0 -6
  331. package/dist/esm/sqm-email-verification.entry.js +0 -414
  332. package/dist/esm/sqm-widget-verification.entry.js +0 -210
  333. package/dist/esm-es5/data-12e6aae1.js +0 -1
  334. package/dist/esm-es5/extractProps-54064fb0.js +0 -1
  335. package/dist/esm-es5/keys-406491dc.js +0 -1
  336. package/dist/esm-es5/sqm-big-stat_46.entry.js +0 -1
  337. package/dist/esm-es5/sqm-email-verification.entry.js +0 -1
  338. package/dist/esm-es5/sqm-user-info-form-view-19d81a2b.js +0 -1
  339. package/dist/esm-es5/sqm-widget-verification.entry.js +0 -1
  340. package/dist/esm-es5/usePayoutStatus-46c0c289.js +0 -6
  341. package/dist/mint-components/p-00b235c5.system.entry.js +0 -1
  342. package/dist/mint-components/p-0706cf9e.system.entry.js +0 -1
  343. package/dist/mint-components/p-0797a946.js +0 -1
  344. package/dist/mint-components/p-13292317.entry.js +0 -11
  345. package/dist/mint-components/p-2d5c2bd4.system.entry.js +0 -1
  346. package/dist/mint-components/p-38c7775a.js +0 -1
  347. package/dist/mint-components/p-3adbfd0b.system.js +0 -6
  348. package/dist/mint-components/p-3af3e2c1.entry.js +0 -25
  349. package/dist/mint-components/p-5492dd51.system.entry.js +0 -1
  350. package/dist/mint-components/p-57dd28bd.system.js +0 -1
  351. package/dist/mint-components/p-5b1d2866.system.js +0 -1
  352. package/dist/mint-components/p-6c4ad51a.js +0 -1
  353. package/dist/mint-components/p-77fa2383.entry.js +0 -1
  354. package/dist/mint-components/p-7939e4af.entry.js +0 -1
  355. package/dist/mint-components/p-8285869e.entry.js +0 -9
  356. package/dist/mint-components/p-892797eb.system.entry.js +0 -1
  357. package/dist/mint-components/p-91a96e98.entry.js +0 -1
  358. package/dist/mint-components/p-b2b85238.entry.js +0 -1
  359. package/dist/mint-components/p-b395470f.entry.js +0 -16
  360. package/dist/mint-components/p-bba16a46.system.entry.js +0 -1
  361. package/dist/mint-components/p-be12607e.entry.js +0 -281
  362. package/dist/mint-components/p-bf188b72.system.entry.js +0 -1
  363. package/dist/mint-components/p-ca098be1.system.js +0 -1
  364. package/dist/mint-components/p-d18dedd4.js +0 -1
  365. package/dist/mint-components/p-d4f332a7.entry.js +0 -106
  366. package/dist/mint-components/p-d6193876.system.js +0 -1
  367. package/dist/mint-components/p-de0d6fd7.js +0 -49
  368. package/dist/mint-components/p-e00ec007.js +0 -1
  369. package/dist/mint-components/p-e55aafe9.system.js +0 -1
  370. package/dist/mint-components/p-ea03e50e.system.js +0 -1
  371. package/dist/mint-components/p-ec0b649a.entry.js +0 -1
  372. package/dist/mint-components/p-f8026ed6.system.js +0 -1
  373. package/dist/mint-components/p-fb804001.system.entry.js +0 -1
  374. package/dist/mint-components/p-fe70e20c.entry.js +0 -1
  375. package/dist/mint-components/p-ff118a19.system.js +0 -1
@@ -0,0 +1,888 @@
1
+ import { h, r as registerInstance } from './index-38ad4957.js';
2
+ import { i as intl } from './global-75e96214.js';
3
+ import { k as useState, f as useEffect, n as h$1, u as useMemo } from './dom-context-hooks.module-50442785.js';
4
+ import { d as dist, q as Pn, w as wn, J, $ as $e, i as isDemo, p as En, L } from './index.module-02cb914c.js';
5
+ import { c as cjs } from './cjs-bdfb4486.js';
6
+ import { g as getProps } from './utils-334c1e34.js';
7
+ import { c as createStyleSheet } from './JSS-67b5cff8.js';
8
+ import { T as TextSpanView } from './sqm-text-span-view-72f43dff.js';
9
+ import { g as GET_FINANCE_NETWORK_SETTINGS } from './data-8698cbc6.js';
10
+ import { a as PartnerInfoModalContentView, P as PartnerInfoModalView } from './sqm-partner-info-modal-view-d6f3a215.js';
11
+ import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, P as PARTNER_CREATED_NAMESPACE } from './keys-1054056a.js';
12
+ import { T as TAX_FORM_UPDATED_EVENT_KEY } from './eventKeys-f76b6a03.js';
13
+ import { p as parseStates } from './parseStates-ed75e224.js';
14
+ import { u as useVerificationEmail } from './useVerificationEmail-9f2c0bab.js';
15
+
16
+ const UpsertUserEmailMutation = dist.gql `
17
+ mutation upsertUser($userInput: UserInput!) {
18
+ upsertUser(userInput: $userInput) {
19
+ id
20
+ accountId
21
+ email
22
+ }
23
+ }
24
+ `;
25
+ const UserLookupQuery = dist.gql `
26
+ query user {
27
+ viewer {
28
+ ... on User {
29
+ id
30
+ accountId
31
+ email
32
+ impactConnection {
33
+ user {
34
+ id
35
+ email
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ `;
42
+ function useUpsertUserEmail() {
43
+ const user = J();
44
+ const [request, { loading: loading, data, errors }] = $e(UpsertUserEmailMutation);
45
+ const upsertUserEmail = async (email) => {
46
+ try {
47
+ const result = await request({
48
+ userInput: {
49
+ id: user.id,
50
+ accountId: user.accountId,
51
+ email,
52
+ },
53
+ });
54
+ if (result instanceof Error || !result)
55
+ throw new Error();
56
+ return result;
57
+ }
58
+ catch (e) {
59
+ console.error("Could not set email on user", e);
60
+ return undefined;
61
+ }
62
+ };
63
+ return [
64
+ upsertUserEmail,
65
+ {
66
+ loading,
67
+ data,
68
+ errors,
69
+ },
70
+ ];
71
+ }
72
+ function useWidgetEmailVerification(props) {
73
+ const [_, setShowCode] = Pn(SHOW_CODE_NAMESPACE);
74
+ const [_email, setEmail] = Pn(VERIFICATION_EMAIL_NAMESPACE);
75
+ const [emailExists, setEmailExists] = useState(false);
76
+ const [error, setError] = useState(false);
77
+ const [mutationError, setMutationError] = useState(false);
78
+ const { initialized, send: [sendEmail, { loading: sendLoading, errors }], } = useVerificationEmail();
79
+ const [upsertUserEmail] = useUpsertUserEmail();
80
+ const [loading, setLoading] = useState(true);
81
+ const { data, loading: initialLoading } = wn(UserLookupQuery, {});
82
+ const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
83
+ useEffect(() => {
84
+ if (!(data === null || data === void 0 ? void 0 : data.viewer))
85
+ return;
86
+ setEmailExists(!!data.viewer.email);
87
+ }, [data]);
88
+ useEffect(() => {
89
+ if (initialized)
90
+ setLoading(false);
91
+ }, [initialized]);
92
+ const submitEmail = async (e) => {
93
+ var _a, _b, _c, _d;
94
+ e.preventDefault();
95
+ if (!(data === null || data === void 0 ? void 0 : data.viewer))
96
+ return;
97
+ setLoading(true);
98
+ setMutationError(false);
99
+ setError(false);
100
+ let toAddress = data.viewer.email;
101
+ if (!toAddress) {
102
+ const formData = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.formData;
103
+ const newEmail = (_c = (_b = formData === null || formData === void 0 ? void 0 : formData.get("email")) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "";
104
+ if (!emailRegex.test(newEmail)) {
105
+ setError(true);
106
+ setLoading(false);
107
+ return;
108
+ }
109
+ const upsertResult = await upsertUserEmail(newEmail);
110
+ if (!upsertResult || !((_d = upsertResult.upsertUser) === null || _d === void 0 ? void 0 : _d.email)) {
111
+ setError(true);
112
+ setLoading(false);
113
+ return;
114
+ }
115
+ toAddress = upsertResult.upsertUser.email;
116
+ }
117
+ // UI should not allow this call til initialisation is done
118
+ if (!initialized) {
119
+ setLoading(false);
120
+ return;
121
+ }
122
+ const result = await sendEmail();
123
+ if (!result || !result.success) {
124
+ setMutationError(true);
125
+ }
126
+ else {
127
+ // This is used to let the code verification widget know an email was already sent
128
+ setEmail(toAddress);
129
+ setShowCode(true);
130
+ }
131
+ setLoading(false);
132
+ };
133
+ return {
134
+ callbacks: {
135
+ submitEmail,
136
+ },
137
+ states: {
138
+ loading,
139
+ initialLoading: initialLoading && !initialized,
140
+ error,
141
+ email: data === null || data === void 0 ? void 0 : data.viewer.email,
142
+ sendCodeError: mutationError,
143
+ },
144
+ text: props.getTextProps(),
145
+ };
146
+ }
147
+
148
+ const style = {
149
+ Wrapper: {
150
+ display: "flex",
151
+ flexDirection: "column",
152
+ gap: "var(--sl-spacing-medium)",
153
+ marginTop: "var(--sl-spacing-medium)",
154
+ },
155
+ InputsContainer: {
156
+ display: "flex",
157
+ gap: "var(--sl-spacing-medium)",
158
+ position: "relative",
159
+ flexDirection: "column",
160
+ },
161
+ ContinueButton: {
162
+ width: "100%",
163
+ },
164
+ SkeletonOne: {
165
+ width: "50%",
166
+ height: "16px",
167
+ },
168
+ SkeletonTwo: {
169
+ width: "30%",
170
+ height: "34px",
171
+ },
172
+ SkeletonThree: {
173
+ width: "15%",
174
+ height: "24px",
175
+ },
176
+ ErrorInput: {
177
+ "&::part(base)": {
178
+ border: "var(--sqm-border-thickness) solid var(--sqm-danger-color-border)",
179
+ borderRadius: "var(--sqm-input-border-radius)",
180
+ },
181
+ "&::part(help-text)": {
182
+ color: "var(--sqm-danger-color-text)",
183
+ },
184
+ },
185
+ };
186
+ const vanillaStyle = `
187
+ :host {
188
+ display: block;
189
+ }
190
+ :host([hidden]): {
191
+ display: none;
192
+ }
193
+
194
+ a {
195
+ color: inherit;
196
+ text-decoration: underline;
197
+ cursor: pointer;
198
+ }
199
+
200
+ *::part(primarybutton-base),
201
+ sl-button[type="primary"]::part(base) {
202
+ font-family: var(--sqm-primary-font);
203
+ width: 100%;
204
+ background-color: var(--sqm-primary-button-background);
205
+ color: var(--sqm-primary-button-color);
206
+ border-color: var(--sqm-primary-button-color-border);
207
+ border-radius: var(--sqm-primary-button-radius);
208
+ }
209
+
210
+ *::part(primarybutton-base):hover,
211
+ sl-button[type="primary"]::part(base):hover{
212
+ background-color: var(--sqm-primary-button-background-hover);
213
+ border-color: var(--sqm-primary-button-border-color-hover);
214
+ color: var(--sqm-primary-button-color-hover);
215
+ }
216
+
217
+
218
+ *::part(primarybutton-base):focus,
219
+ sl-button[type="primary"]::part(base):focus {
220
+ box-shadow: none;
221
+ }
222
+
223
+ *::part(secondarybutton-base),
224
+ sl-button[type="secondary"]::part(base) {
225
+ font-family: var(--sqm-primary-font);
226
+ background-color: var(--sqm-secondary-button-background);
227
+ color: var(--sqm-secondary-button-color);
228
+ border-color: var(--sqm-secondary-button-color-border);
229
+ border-radius: var(--sqm-secondary-button-radius);
230
+ }
231
+
232
+ *::part(secondarybutton-base):hover,
233
+ sl-button[type="secondary"]::part(base):hover {
234
+ background-color: var(--sqm-secondary-button-background-hover);
235
+ color: var(--sqm-secondary-button-color-hover);
236
+ border-color: var(--sqm-secondary-button-border-color-hover);
237
+ }
238
+
239
+ *::part(input-label), *::part(select-label), *::part(textarea-label){
240
+ font-family: var(--sqm-primary-font);
241
+ font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
242
+ font-weight: var(--sl-font-weight-semibold);
243
+ color: var(--sqm-input-label-color, var(--sqm-text), black);
244
+ }
245
+
246
+ *::part(input-base), *::part(select-base), *::part(textarea-base){
247
+ font-family: var(--sqm-primary-font);
248
+ background-color: var(--sqm-input-background, #fff);
249
+ border-radius: var(--sqm-input-border-radius, var(--sl-input-border-radius-large), 0.25rem);
250
+ color: var(--sqm-input-color, white);
251
+ border-width: var(--sqm-border-thickness, 1px);
252
+ }
253
+
254
+ *::part(input-base):hover, *::part(select-base):hover, *::part(textarea-base):hover{
255
+ border-color: var(--sqm-border-color-hover);
256
+ }
257
+
258
+ *::part(input-base):focus, *::part(select-base):focus, *::part(textarea-base):focus{
259
+ border-color: var(--sqm-border-color-focus);
260
+ }
261
+
262
+ sqm-name-fields::part(input-base) {
263
+ font-family: var(--sqm-primary-font);
264
+ background-color: var(--sqm-input-background, #fff);
265
+ border-radius: var(--sqm-input-border-radius, var(--sl-input-border-radius-large), 0.25rem);
266
+ color: var(--sqm-input-color, white);
267
+ border-width: var(--sqm-border-thickness, 1px);
268
+ }
269
+
270
+ sl-input::part(base):focus,
271
+ sl-select::part(form-control-wrapper):focus,
272
+ sl-textarea::part(textarea-label):focus {
273
+ border-color: var(--sqm-border-color-focus);
274
+ }
275
+
276
+ *::part(input-label):disabled, *::part(select-label):disabled, *::part(textarea-label):disabled{
277
+ background: var(--sqm-input-disabled-background, #f5f5f5);
278
+ color: var(--sqm-input-disabled-color, var(--sl-color-gray-600));
279
+ }
280
+
281
+ *::part(input):-webkit-autofill {
282
+ box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
283
+ -webkit-text-fill-color: var(--sqm-input-color, white) !important;
284
+ }
285
+
286
+ *::part(input):-webkit-autofill:hover {
287
+ box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
288
+ -webkit-text-fill-color: var(--sqm-input-color, white) !important;
289
+ }
290
+
291
+ *::part(input):-webkit-autofill:focus {
292
+ box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
293
+ -webkit-text-fill-color: var(--sqm-input-color, white) !important;
294
+ }
295
+
296
+ *::part(input)::placeholder,
297
+ *::part(select)::placeholder,
298
+ *::part(textarea)::placeholder {
299
+ font-family: var(--sqm-primary-font);
300
+ color: var(--sqm-text-subdued);
301
+ }
302
+
303
+ *::part(input)::-webkit-input-placeholder,
304
+ *::part(select)::-webkit-input-placeholder,
305
+ *::part(textarea)::-webkit-input-placeholder {
306
+ font-family: var(--sqm-primary-font);
307
+ color: var(--sqm-text-subdued);
308
+ }
309
+
310
+ *::part(input)::-moz-placeholder,
311
+ *::part(select)::-moz-placeholder,
312
+ *::part(textarea)::-moz-placeholder {
313
+ font-family: var(--sqm-primary-font);
314
+ opacity: 1; /* Firefox adds an opacity to placeholders by default */
315
+ color: var(--sqm-text-subdued);
316
+ }
317
+
318
+ *::part(input)::-ms-input-placeholder,
319
+ *::part(select)::-ms-input-placeholder,
320
+ *::part(textarea)::-ms-input-placeholder {
321
+ font-family: var(--sqm-primary-font);
322
+ color: var(--sqm-text-subdued);
323
+ }
324
+
325
+
326
+ `;
327
+ const sheet = createStyleSheet(style);
328
+ const styleString = sheet.toString();
329
+ function WidgetEmailVerificationView(props) {
330
+ const { states, callbacks, text } = props;
331
+ const renderLoadingSkeleton = () => {
332
+ return (h("div", { class: sheet.classes.Wrapper },
333
+ h("sqm-skeleton", { height: "16px", width: "50%" }),
334
+ h("sqm-skeleton", { height: "16px", width: "50%" }),
335
+ h("sqm-skeleton", { height: "16px", width: "50%" }),
336
+ h("sqm-skeleton", { height: "34px", width: "30%" }),
337
+ h("sqm-skeleton", { height: "24px", width: "15%" }),
338
+ h("sl-button", { submit: true, class: sheet.classes.ContinueButton, loading: true, exportparts: "base: primarybutton-base", type: "primary" }, text.sendCodeText)));
339
+ };
340
+ return (h("div", { part: "sqm-base" },
341
+ h("style", { type: "text/css" },
342
+ vanillaStyle,
343
+ styleString),
344
+ states.sendCodeError && (h("sqm-form-message", { type: "error" },
345
+ h("p", { part: "alert-title" }, text.sendCodeErrorHeader),
346
+ intl.formatMessage({
347
+ id: "sendCodeErrorDescription",
348
+ defaultMessage: text.sendCodeErrorDescription,
349
+ }, {
350
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
351
+ }))),
352
+ states.initialLoading ? (renderLoadingSkeleton()) : (h("div", { class: sheet.classes.Wrapper },
353
+ h(TextSpanView, { type: "p" }, text.verifyEmailHeaderText),
354
+ h("sl-form", { "onSl-submit": callbacks.submitEmail },
355
+ h("div", { class: sheet.classes.InputsContainer },
356
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.emailLabel, value: states.email || "", type: "email", id: "email", name: "email", disabled: !!states.email || states.loading }, (states.error
357
+ ? {
358
+ class: sheet.classes.ErrorInput,
359
+ helpText: text.emailValidationErrorText,
360
+ }
361
+ : {}))),
362
+ h("sl-button", { submit: true, class: sheet.classes.ContinueButton, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, text.sendCodeText)))))));
363
+ }
364
+
365
+ const WidgetEmailVerification = class {
366
+ constructor(hostRef) {
367
+ registerInstance(this, hostRef);
368
+ /**
369
+ * @uiName Verify email widget header text
370
+ */
371
+ this.verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
372
+ /**
373
+ * @uiName Send code to email alert header
374
+ */
375
+ this.sendCodeErrorHeader = "There was an error sending your code";
376
+ /**
377
+ * @uiName Support link text
378
+ */
379
+ this.supportLink = "support team";
380
+ /**
381
+ * @uiName Send code to email alert description
382
+ */
383
+ this.sendCodeErrorDescription = "Please try again. If this problem continues, contact our program {supportLink}.";
384
+ /**
385
+ * @uiName Email input label
386
+ */
387
+ this.emailLabel = "Email";
388
+ /**
389
+ * @uiName Send code button text
390
+ */
391
+ this.sendCodeText = "Send code";
392
+ /**
393
+ * @uiName Send code button text
394
+ */
395
+ this.emailValidationErrorText = "Please enter a valid email";
396
+ h$1(this);
397
+ }
398
+ disconnectedCallback() { }
399
+ getTextProps() {
400
+ return getProps(this);
401
+ }
402
+ render() {
403
+ const props = isDemo()
404
+ ? useDemoWidgetEmailVerification(this)
405
+ : useWidgetEmailVerification(this);
406
+ return h(WidgetEmailVerificationView, Object.assign({}, props));
407
+ }
408
+ };
409
+ function useDemoWidgetEmailVerification(props) {
410
+ const setShowCode = En(SHOW_CODE_NAMESPACE);
411
+ return cjs({
412
+ states: {
413
+ error: true,
414
+ initialLoading: false,
415
+ loading: false,
416
+ email: "test@example.com",
417
+ sendCodeError: true,
418
+ },
419
+ callbacks: {
420
+ submitEmail: async () => setShowCode(true),
421
+ },
422
+ text: props.getTextProps(),
423
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
424
+ }
425
+
426
+ const GET_USER_PARTNER_INFO = dist.gql `
427
+ query getUserPartnerInfo {
428
+ user: viewer {
429
+ ... on User {
430
+ id
431
+ accountId
432
+ firstName
433
+ lastName
434
+ email
435
+ countryCode
436
+ customFields
437
+ impactConnection {
438
+ connected
439
+ connectionStatus
440
+ publisher {
441
+ id
442
+ countryCode
443
+ currency
444
+ }
445
+ }
446
+ }
447
+ }
448
+ }
449
+ `;
450
+ const GET_COUNTRIES = dist.gql `
451
+ query getCountries {
452
+ impactPayoutCountries(limit: 1000) {
453
+ data {
454
+ countryCode
455
+ displayName
456
+ }
457
+ }
458
+ }
459
+ `;
460
+ const GET_CURRENCIES = dist.gql `
461
+ query currencies($locale: RSLocale) {
462
+ currencies(limit: 300) {
463
+ data {
464
+ displayName(locale: $locale)
465
+ currencyCode
466
+ }
467
+ }
468
+ }
469
+ `;
470
+ const CONNECT_PARTNER = dist.gql `
471
+ mutation createImpactConnection($vars: ImpactConnectionInput!) {
472
+ createImpactConnection(impactConnectionInput: $vars) {
473
+ success
474
+ validationErrors {
475
+ field
476
+ message
477
+ }
478
+ user {
479
+ id
480
+ accountId
481
+ impactConnection {
482
+ connected
483
+ publisher {
484
+ brandedSignup
485
+ requiredTaxDocumentType
486
+ currentTaxDocument {
487
+ type
488
+ status
489
+ }
490
+ }
491
+ }
492
+ }
493
+ }
494
+ }
495
+ `;
496
+ const START_IMPACT_CONNECTION = dist.gql `
497
+ mutation startImpactConnection($vars: ImpactConnectionInput!) {
498
+ startImpactConnection(impactConnectionInput: $vars) {
499
+ success
500
+ validationErrors {
501
+ field
502
+ message
503
+ }
504
+ user {
505
+ id
506
+ accountId
507
+ impactConnection {
508
+ connected
509
+ publisher {
510
+ brandedSignup
511
+ requiredTaxDocumentType
512
+ currentTaxDocument {
513
+ type
514
+ status
515
+ }
516
+ }
517
+ }
518
+ }
519
+ }
520
+ }
521
+ `;
522
+ function usePartnerInfoModal(props) {
523
+ var _a, _b, _c, _d, _e, _f, _g;
524
+ const locale = L();
525
+ const setPartnerCreated = En(PARTNER_CREATED_NAMESPACE);
526
+ const { data: userData, loading: userLoading, refetch, } = wn(GET_USER_PARTNER_INFO, {});
527
+ const user = userData === null || userData === void 0 ? void 0 : userData.user;
528
+ const { data: currenciesData, loading: currenciesLoading } = wn(GET_CURRENCIES, { variables: { locale } });
529
+ const { data: countriesData, loading: countriesLoading } = wn(GET_COUNTRIES, {});
530
+ // No pre-filled country, use locale to determine countryCode instead
531
+ const [countryCode, setCountryCode] = useState(((_b = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.countryCode) || locale.replace(/^.*_/, ""));
532
+ const [currency, setCurrency] = useState(((_d = (_c = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher) === null || _d === void 0 ? void 0 : _d.currency) || "");
533
+ const { data: financeNetworkData } = wn(GET_FINANCE_NETWORK_SETTINGS, {
534
+ variables: { filter: countryCode ? { countryCode_eq: countryCode } : {} },
535
+ });
536
+ const [startImpactConnection, { loading: connectLoading }] = $e(START_IMPACT_CONNECTION);
537
+ const [allowBankingCollection, setAllowBankingCollection] = useState(false);
538
+ const countries = ((_e = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _e === void 0 ? void 0 : _e.data) || [];
539
+ const isExistingPartner = !!((_f = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher);
540
+ const _currencies = useMemo(() => {
541
+ var _a, _b, _c;
542
+ // if isExistingPartner, grab all currencies since select is disabled anyways
543
+ if (isExistingPartner) {
544
+ return ((_a = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _a === void 0 ? void 0 : _a.data) || [];
545
+ }
546
+ const allValidCurrencies = (_c = (_b = financeNetworkData === null || financeNetworkData === void 0 ? void 0 : financeNetworkData.impactFinanceNetworkSettings) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.reduce((agg, settings) => {
547
+ var _a, _b;
548
+ if (countryCode && settings.countryCode !== countryCode)
549
+ return agg;
550
+ const c = (_b = (_a = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.find((cur) => cur.currencyCode === settings.currency);
551
+ if (!c)
552
+ return agg;
553
+ if (agg.find((cur) => cur.currencyCode === settings.currency))
554
+ return agg;
555
+ return [...agg, c];
556
+ }, []);
557
+ return allValidCurrencies || [];
558
+ }, [financeNetworkData, currenciesData, countryCode, isExistingPartner]);
559
+ const currencies = useMemo(() => [..._currencies].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
560
+ const [countrySearch, setCountrySearch] = useState("");
561
+ const [currencySearch, setCurrencySearch] = useState("");
562
+ const [filteredCountries, setFilteredCountries] = useState(((_g = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _g === void 0 ? void 0 : _g.data) || []);
563
+ const [filteredCurrencies, setFilteredCurrencies] = useState(currencies || []);
564
+ const [error, setError] = useState("");
565
+ const [success, setSuccess] = useState(false);
566
+ useEffect(() => {
567
+ var _a;
568
+ const publisher = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher;
569
+ if (!userData || !publisher)
570
+ return;
571
+ setCountryCode(publisher.countryCode);
572
+ setCurrency(publisher.currency);
573
+ }, [userData, user]);
574
+ useEffect(() => {
575
+ if (!(countries === null || countries === void 0 ? void 0 : countries.length))
576
+ return;
577
+ if (countrySearch.trim() === "") {
578
+ setFilteredCountries(countries || []);
579
+ }
580
+ else {
581
+ setFilteredCountries(countries.filter((c) => c.displayName.toLowerCase().includes(countrySearch.toLowerCase())) || []);
582
+ }
583
+ }, [countrySearch, countries]);
584
+ useEffect(() => {
585
+ if (!(currencies === null || currencies === void 0 ? void 0 : currencies.length))
586
+ return;
587
+ if (currencySearch.trim() === "") {
588
+ setFilteredCurrencies(currencies || []);
589
+ }
590
+ else {
591
+ setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
592
+ }
593
+ }, [currencySearch, currencies]);
594
+ const impactConnection = user === null || user === void 0 ? void 0 : user.impactConnection;
595
+ function onCountryChange(e) {
596
+ var _a, _b;
597
+ const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
598
+ if (!value)
599
+ return;
600
+ setCountryCode(value);
601
+ setCurrency("");
602
+ setError("");
603
+ }
604
+ function onCurrencyChange(e) {
605
+ var _a, _b;
606
+ const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
607
+ if (!value)
608
+ return;
609
+ setCurrency(value);
610
+ setError("");
611
+ }
612
+ function onCheckboxChange(e) {
613
+ const checked = e.target.checked;
614
+ setAllowBankingCollection(checked);
615
+ }
616
+ async function onSubmit() {
617
+ var _a, _b;
618
+ if (!allowBankingCollection) {
619
+ setError(props.missingFieldsErrorText);
620
+ return;
621
+ }
622
+ if (!countryCode || !currency) {
623
+ setError(props.missingFieldsErrorText);
624
+ return;
625
+ }
626
+ setError("");
627
+ if (!user) {
628
+ setError(props.networkErrorText);
629
+ return;
630
+ }
631
+ try {
632
+ const vars = {
633
+ user: {
634
+ id: user.id,
635
+ accountId: user.accountId,
636
+ },
637
+ firstName: user.firstName,
638
+ lastName: user.lastName,
639
+ countryCode,
640
+ currency,
641
+ };
642
+ const result = await startImpactConnection({ vars });
643
+ if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message)) {
644
+ setError(props.networkErrorText);
645
+ return;
646
+ }
647
+ const connectionResult = result
648
+ .startImpactConnection;
649
+ if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
650
+ const validationMsg = (_b = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors) === null || _b === void 0 ? void 0 : _b.map((e) => e.message).join(". ");
651
+ setError(validationMsg || props.networkErrorText);
652
+ console.error("Failed to create Impact connection:", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
653
+ return;
654
+ }
655
+ window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
656
+ await refetch();
657
+ setPartnerCreated === null || setPartnerCreated === void 0 ? void 0 : setPartnerCreated(true);
658
+ setSuccess(true);
659
+ }
660
+ catch (e) {
661
+ console.error("Partner creation error:", e);
662
+ setError(props.networkErrorText);
663
+ }
664
+ }
665
+ console.log(impactConnection, "impactConnection in partner modal");
666
+ const showModal = !success &&
667
+ !userLoading &&
668
+ (impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connectionStatus) === "NOT_STARTED";
669
+ return {
670
+ states: {
671
+ open: showModal,
672
+ loading: userLoading || countriesLoading || currenciesLoading,
673
+ submitting: connectLoading,
674
+ isExistingPartner,
675
+ countryCode,
676
+ currency,
677
+ error,
678
+ success,
679
+ filteredCountries: filteredCountries || [],
680
+ filteredCurrencies: filteredCurrencies || [],
681
+ allowBankingCollection,
682
+ disabled: userLoading || connectLoading,
683
+ },
684
+ callbacks: {
685
+ onCountryChange,
686
+ onCurrencyChange,
687
+ onCheckboxChange,
688
+ setCurrencySearch,
689
+ setCountrySearch,
690
+ onSubmit,
691
+ onClose: () => setSuccess(true),
692
+ },
693
+ text: props.getTextProps(),
694
+ };
695
+ }
696
+
697
+ const PartnerInfoModal = class {
698
+ constructor(hostRef) {
699
+ registerInstance(this, hostRef);
700
+ /**
701
+ * Header text when user has no existing partner
702
+ *
703
+ * @uiName New partner header
704
+ * @uiWidget textArea
705
+ */
706
+ this.modalHeader = "Let's get you ready for rewards";
707
+ /**
708
+ * Header text when user has an existing partner
709
+ *
710
+ * @uiName Existing partner header
711
+ * @uiWidget textArea
712
+ */
713
+ this.modalHeaderExistingPartner = "We found an existing account";
714
+ /**
715
+ * Description for new partner setup
716
+ *
717
+ * @uiName New partner description
718
+ * @uiWidget textArea
719
+ */
720
+ this.descriptionNewPartner = "Confirm your country and currency now to get your future rewards faster.";
721
+ /**
722
+ * Description for existing partner confirmation
723
+ *
724
+ * @uiName Existing partner description
725
+ * @uiWidget textArea
726
+ */
727
+ this.descriptionExistingPartner = "We found an account with this email on our referral program provider, impact.com. Please confirm your country and currency now to get your future rewards faster.";
728
+ /**
729
+ * Support description for existing partner confirmation
730
+ *
731
+ * @uiName Existing partner support description
732
+ * @uiWidget textArea
733
+ */
734
+ this.supportDescriptionExistingPartner = "If this is a mistake, please contact {supportLink} or sign up for this referral program with a different email.";
735
+ /**
736
+ * Support description for existing partner confirmation
737
+ *
738
+ * @uiName Existing partner support description
739
+ */
740
+ this.supportLink = "Support";
741
+ /**
742
+ * Edit the property called terms and conditions text to change what's displayed for {termsAndConditionsLink}.
743
+ * @uiName Terms and conditions checkbox
744
+ */
745
+ this.allowBankingCollection = "I have read the {termsAndConditionsLink} and allow impact.com to collect my tax and banking information";
746
+ /**
747
+ * The link text that appears in the terms and conditions checkbox
748
+ * @uiName Terms and conditions text
749
+ * @uiWidget textArea
750
+ */
751
+ this.termsAndConditionsLabel = "terms and conditions";
752
+ /**
753
+ * The link that appears in the terms and conditions checkbox
754
+ * @uiName Terms and conditions link
755
+ */
756
+ this.termsAndConditionsLink = "https://terms.advocate.impact.com/PayoutTermsAndConditions.html";
757
+ /**
758
+ * @uiName Country label
759
+ */
760
+ this.countryLabel = "Country";
761
+ /**
762
+ * @uiName Currency label
763
+ */
764
+ this.currencyLabel = "Currency";
765
+ /**
766
+ * @uiName Submit button label
767
+ */
768
+ this.submitButtonLabel = "Submit";
769
+ /**
770
+ * @uiName Confirm button label
771
+ */
772
+ this.confirmButtonLabel = "Confirm";
773
+ /**
774
+ * @uiName Search country placeholder
775
+ */
776
+ this.searchCountryPlaceholder = "Search for a country";
777
+ /**
778
+ * @uiName Search currency placeholder
779
+ */
780
+ this.searchCurrencyPlaceholder = "Search for a currency";
781
+ /**
782
+ * @uiName Network error text
783
+ * @uiWidget textArea
784
+ */
785
+ this.networkErrorText = "An error occurred. Please try again.";
786
+ /**
787
+ * @uiName Missing fields error text
788
+ * @uiWidget textArea
789
+ */
790
+ this.missingFieldsErrorText = "Please fill out all fields.";
791
+ /**
792
+ * Used to render in another modal.
793
+ * @undocumented
794
+ */
795
+ this.inModal = false;
796
+ /**
797
+ * @undocumented
798
+ * @componentState { "title": "Connected (hidden)", "default": true, "props": { "states": { "open": false } } }
799
+ * @componentState { "title": "New partner", "props": { "states": { "open": true, "isExistingPartner": false } } }
800
+ * @componentState { "title": "Existing partner", "props": { "states": { "open": true, "isExistingPartner": true, "countryCode": "US", "currency": "USD" } } }
801
+ */
802
+ this.stateController = '{"sqm-partner-info-modal":{"states":{"open":false}}}';
803
+ h$1(this);
804
+ }
805
+ disconnectedCallback() { }
806
+ getTextProps() {
807
+ return getProps(this);
808
+ }
809
+ render() {
810
+ const props = isDemo()
811
+ ? useDemoPartnerInfoModal(this)
812
+ : usePartnerInfoModal(this);
813
+ if (this.inModal) {
814
+ return h(PartnerInfoModalContentView, Object.assign({}, props));
815
+ }
816
+ return h(PartnerInfoModalView, Object.assign({}, props));
817
+ }
818
+ };
819
+ function useDemoPartnerInfoModal(props) {
820
+ const [countryCode, setCountryCode] = useState("US");
821
+ const [currency, setCurrency] = useState("");
822
+ const [error, setError] = useState("");
823
+ const [allowBankingCollection, setAllowBankingCollection] = useState(false);
824
+ const parsed = parseStates(props.stateController);
825
+ const stateOverride = (parsed === null || parsed === void 0 ? void 0 : parsed["sqm-partner-info-modal"]) || parsed || {};
826
+ // @ts-ignore
827
+ return cjs({
828
+ states: {
829
+ open: false,
830
+ loading: false,
831
+ submitting: false,
832
+ isExistingPartner: false,
833
+ countryCode,
834
+ currency,
835
+ error,
836
+ success: false,
837
+ filteredCountries: [],
838
+ filteredCurrencies: [],
839
+ allowBankingCollection,
840
+ disabled: false,
841
+ },
842
+ callbacks: {
843
+ onCountryChange: (e) => {
844
+ var _a, _b;
845
+ const value = (_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
846
+ if (value) {
847
+ setCountryCode(value);
848
+ setCurrency("");
849
+ }
850
+ },
851
+ onCurrencyChange: (e) => {
852
+ var _a, _b;
853
+ const value = (_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
854
+ if (value)
855
+ setCurrency(value);
856
+ },
857
+ onCheckboxChange: (e) => {
858
+ setAllowBankingCollection(e.target.checked);
859
+ },
860
+ setCountrySearch: () => { },
861
+ setCurrencySearch: () => { },
862
+ onSubmit: () => {
863
+ if (!countryCode || !currency) {
864
+ setError(props.missingFieldsErrorText);
865
+ return;
866
+ }
867
+ setError("");
868
+ },
869
+ onClose: () => { },
870
+ },
871
+ text: {
872
+ modalHeader: props.modalHeader,
873
+ descriptionNewPartner: props.descriptionNewPartner,
874
+ descriptionExistingPartner: props.descriptionExistingPartner,
875
+ countryLabel: props.countryLabel,
876
+ currencyLabel: props.currencyLabel,
877
+ submitButtonLabel: props.submitButtonLabel,
878
+ confirmButtonLabel: props.confirmButtonLabel,
879
+ searchCountryPlaceholder: props.searchCountryPlaceholder,
880
+ searchCurrencyPlaceholder: props.searchCurrencyPlaceholder,
881
+ supportDescriptionExistingPartner: props.supportDescriptionExistingPartner,
882
+ supportLink: props.supportLink,
883
+ modalHeaderExistingPartner: props.modalHeaderExistingPartner,
884
+ },
885
+ }, props.demoData || stateOverride, { arrayMerge: (_, a) => a });
886
+ }
887
+
888
+ export { WidgetEmailVerification as sqm_email_verification, PartnerInfoModal as sqm_partner_info_modal };