@saasquatch/mint-components 2.1.9-2 → 2.1.9-21

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 (360) hide show
  1. package/dist/cjs/{ShadowViewAddon-d679ec76.js → ShadowViewAddon-2b3f51be.js} +1 -1
  2. package/dist/cjs/{data-e83f8a41.js → data-6b5095f8.js} +1 -90
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mint-components.cjs.js +1 -1
  5. package/dist/cjs/parseStates-d1effc19.js +16 -0
  6. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +85 -33
  7. package/dist/cjs/{sqm-big-stat_45.cjs.entry.js → sqm-big-stat_46.cjs.entry.js} +388 -19
  8. package/dist/cjs/sqm-code-verification.cjs.entry.js +4 -5
  9. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +133 -38
  10. package/dist/cjs/sqm-partner-info-modal-view-464c52c9.js +135 -0
  11. package/dist/cjs/sqm-partner-info-modal.cjs.entry.js +493 -0
  12. package/dist/cjs/{sqm-portal-email-verification-view-2b4b92da.js → sqm-portal-email-verification-view-60f8e0a7.js} +1 -1
  13. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
  14. package/dist/cjs/sqm-portal-forgot-password_6.cjs.entry.js +3 -3
  15. package/dist/cjs/{sqm-portal-profile-view-bfdbb98d.js → sqm-portal-profile-view-2bfd7afd.js} +1 -1
  16. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  17. package/dist/cjs/{sqm-portal-registration-form-view-020f661c.js → sqm-portal-registration-form-view-fd48f1d3.js} +1 -1
  18. package/dist/cjs/{sqm-portal-reset-password-view-6b1acd90.js → sqm-portal-reset-password-view-d90d77f9.js} +1 -1
  19. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +2 -2
  20. package/dist/cjs/{sqm-portal-verify-email-view-90cd89e3.js → sqm-portal-verify-email-view-b31638f8.js} +1 -1
  21. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
  22. package/dist/cjs/sqm-rewards-table-customer-note-cell.cjs.entry.js +1 -1
  23. package/dist/cjs/sqm-stencilbook.cjs.entry.js +80 -49
  24. package/dist/cjs/{sqm-text-span-view-f274fdf2.js → sqm-text-span-view-8a32dd8c.js} +1 -1
  25. package/dist/cjs/sqm-text-span.cjs.entry.js +1 -1
  26. package/dist/cjs/{sqm-user-info-form-view-e7260d61.js → sqm-user-info-form-view-01bf2f41.js} +28 -32
  27. package/dist/cjs/utils-a8e0bd9b.js +93 -0
  28. package/dist/collection/collection-manifest.json +1 -1
  29. package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +8 -3
  30. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +72 -46
  31. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +168 -10
  32. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +90 -33
  33. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
  34. package/dist/collection/components/sqm-text-span/sqm-text-span-view.js +1 -1
  35. package/dist/collection/components/sqm-widget-verification/WidgetVerification.stories.js +16 -0
  36. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +3 -4
  37. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +0 -2
  38. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +91 -13
  39. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +14 -4
  40. package/dist/collection/components/tax-and-cash/data.js +1 -0
  41. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +49 -11
  42. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +3 -8
  43. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +5 -10
  44. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +27 -14
  45. package/dist/esm/{ShadowViewAddon-d382a63e.js → ShadowViewAddon-78b791d2.js} +6 -6
  46. package/dist/{mint-components/p-9fa6606e.js → esm/data-33c16dff.js} +24 -5
  47. package/dist/esm/{global-b2ee3a12.js → global-39f55ec2.js} +1 -1
  48. package/dist/esm/{index.module-e266b4d7.js → index.module-cede12c6.js} +1 -1
  49. package/dist/esm/{keys-406491dc.js → keys-db1897ae.js} +1 -1
  50. package/dist/esm/loader.js +3 -3
  51. package/dist/esm/mint-components.js +3 -3
  52. package/dist/esm/parseStates-ed75e224.js +14 -0
  53. package/dist/esm/{re-render-4f4bd4da.js → re-render-7a0c7976.js} +1 -1
  54. package/dist/esm/sqm-banking-info-form_10.entry.js +85 -33
  55. package/dist/esm/{sqm-big-stat_45.entry.js → sqm-big-stat_46.entry.js} +393 -25
  56. package/dist/esm/sqm-close-button.entry.js +1 -1
  57. package/dist/esm/sqm-code-verification.entry.js +8 -9
  58. package/dist/esm/sqm-context-router.entry.js +1 -1
  59. package/dist/esm/sqm-email-verification_2.entry.js +138 -43
  60. package/dist/esm/sqm-empty_4.entry.js +2 -2
  61. package/dist/esm/sqm-google-sign-in.entry.js +1 -1
  62. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  63. package/dist/esm/sqm-instant-access-registration.entry.js +3 -3
  64. package/dist/esm/{sqm-lead-checkbox-field-view-00d76ba1.js → sqm-lead-checkbox-field-view-7cee2b4e.js} +1 -1
  65. package/dist/esm/sqm-lead-checkbox-field.entry.js +4 -4
  66. package/dist/esm/{sqm-lead-input-field-view-d8f76a9d.js → sqm-lead-input-field-view-11a4f9a9.js} +1 -1
  67. package/dist/esm/sqm-lead-input-field.entry.js +4 -4
  68. package/dist/esm/sqm-leaderboard-rank.entry.js +2 -2
  69. package/dist/esm/sqm-logout-current-user.entry.js +1 -1
  70. package/dist/esm/{sqm-navigation-sidebar-item-view-7f966119.js → sqm-navigation-sidebar-item-view-48e7e0d3.js} +1 -1
  71. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  72. package/dist/esm/sqm-navigation-sidebar.entry.js +1 -1
  73. package/dist/esm/sqm-pagination_3.entry.js +3 -3
  74. package/dist/esm/sqm-partner-info-modal-view-a6324934.js +132 -0
  75. package/dist/esm/sqm-partner-info-modal.entry.js +489 -0
  76. package/dist/esm/sqm-password-field.entry.js +2 -2
  77. package/dist/esm/sqm-popup-container.entry.js +1 -1
  78. package/dist/esm/{sqm-portal-email-verification-view-13e25037.js → sqm-portal-email-verification-view-33f5c108.js} +2 -2
  79. package/dist/esm/sqm-portal-email-verification.entry.js +4 -4
  80. package/dist/esm/sqm-portal-forgot-password_6.entry.js +6 -6
  81. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  82. package/dist/esm/{sqm-portal-profile-view-a172bdcc.js → sqm-portal-profile-view-88fd6a93.js} +2 -2
  83. package/dist/esm/sqm-portal-profile.entry.js +5 -5
  84. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  85. package/dist/esm/{sqm-portal-registration-form-view-2f4936ef.js → sqm-portal-registration-form-view-9bf30b56.js} +1 -1
  86. package/dist/esm/{sqm-portal-reset-password-view-cfbc0eb0.js → sqm-portal-reset-password-view-f8d1689c.js} +1 -1
  87. package/dist/esm/sqm-portal-reset-password.entry.js +3 -3
  88. package/dist/esm/{sqm-portal-verify-email-view-c1a72c4f.js → sqm-portal-verify-email-view-0b70c1b1.js} +2 -2
  89. package/dist/esm/sqm-qr-code.entry.js +2 -2
  90. package/dist/esm/sqm-referral-table_11.entry.js +6 -6
  91. package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  92. package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +2 -2
  93. package/dist/esm/sqm-rewards-table_9.entry.js +5 -5
  94. package/dist/esm/sqm-stencilbook.entry.js +54 -23
  95. package/dist/esm/sqm-tab.entry.js +2 -2
  96. package/dist/esm/sqm-tabs.entry.js +3 -3
  97. package/dist/esm/{sqm-text-span-view-738acfb3.js → sqm-text-span-view-4db9e33f.js} +1 -1
  98. package/dist/esm/sqm-text-span.entry.js +1 -1
  99. package/dist/esm/{sqm-user-info-form-view-a18d6b15.js → sqm-user-info-form-view-365cef98.js} +8 -12
  100. package/dist/esm/sqm-widget-verification-controller.entry.js +2 -2
  101. package/dist/esm/{useChildElements-31ba3daf.js → useChildElements-c26d7347.js} +1 -1
  102. package/dist/esm/{useInstantAccessRegistration-1388dace.js → useInstantAccessRegistration-e2392f42.js} +2 -2
  103. package/dist/esm/{useLeadFormState-cec544ea.js → useLeadFormState-9099c8d4.js} +2 -2
  104. package/dist/esm/{usePayoutStatus-24145412.js → usePayoutStatus-fa504d49.js} +1 -1
  105. package/dist/esm/{usePortalRegistrationForm-6d562bf8.js → usePortalRegistrationForm-5844032a.js} +2 -2
  106. package/dist/esm/{useReferralCodes-1ca1fda0.js → useReferralCodes-3cde72d4.js} +1 -1
  107. package/dist/esm/{useReferralTable-456931fd.js → useReferralTable-35e6d4c1.js} +3 -3
  108. package/dist/esm/{useRegistrationFormState-0cee2d21.js → useRegistrationFormState-1813bdef.js} +1 -1
  109. package/dist/esm/{useVerificationEmail-5c6cd733.js → useVerificationEmail-cb3d51e3.js} +1 -1
  110. package/dist/esm/{utilities-f05633da.js → utilities-c9e730ed.js} +1 -1
  111. package/dist/esm/utils-8267d3d8.js +85 -0
  112. package/dist/esm-es5/{ShadowViewAddon-d382a63e.js → ShadowViewAddon-78b791d2.js} +1 -1
  113. package/dist/esm-es5/data-33c16dff.js +1 -0
  114. package/dist/esm-es5/{global-b2ee3a12.js → global-39f55ec2.js} +1 -1
  115. package/dist/esm-es5/{index.module-e266b4d7.js → index.module-cede12c6.js} +1 -1
  116. package/dist/esm-es5/{keys-406491dc.js → keys-db1897ae.js} +1 -1
  117. package/dist/esm-es5/loader.js +1 -1
  118. package/dist/esm-es5/mint-components.js +1 -1
  119. package/dist/esm-es5/parseStates-ed75e224.js +1 -0
  120. package/dist/esm-es5/{re-render-4f4bd4da.js → re-render-7a0c7976.js} +1 -1
  121. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  122. package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -0
  123. package/dist/esm-es5/sqm-close-button.entry.js +1 -1
  124. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  125. package/dist/esm-es5/sqm-context-router.entry.js +1 -1
  126. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  127. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  128. package/dist/esm-es5/sqm-google-sign-in.entry.js +1 -1
  129. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  130. package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
  131. package/dist/esm-es5/{sqm-lead-checkbox-field-view-00d76ba1.js → sqm-lead-checkbox-field-view-7cee2b4e.js} +1 -1
  132. package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
  133. package/dist/esm-es5/{sqm-lead-input-field-view-d8f76a9d.js → sqm-lead-input-field-view-11a4f9a9.js} +1 -1
  134. package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
  135. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  136. package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
  137. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-7f966119.js → sqm-navigation-sidebar-item-view-48e7e0d3.js} +1 -1
  138. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  139. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  140. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  141. package/dist/esm-es5/sqm-partner-info-modal-view-a6324934.js +1 -0
  142. package/dist/esm-es5/sqm-partner-info-modal.entry.js +1 -0
  143. package/dist/esm-es5/sqm-password-field.entry.js +1 -1
  144. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  145. package/dist/esm-es5/{sqm-portal-email-verification-view-13e25037.js → sqm-portal-email-verification-view-33f5c108.js} +1 -1
  146. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  147. package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
  148. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  149. package/dist/esm-es5/{sqm-portal-profile-view-a172bdcc.js → sqm-portal-profile-view-88fd6a93.js} +1 -1
  150. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  151. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  152. package/dist/esm-es5/{sqm-portal-registration-form-view-2f4936ef.js → sqm-portal-registration-form-view-9bf30b56.js} +1 -1
  153. package/dist/esm-es5/{sqm-portal-reset-password-view-cfbc0eb0.js → sqm-portal-reset-password-view-f8d1689c.js} +1 -1
  154. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  155. package/dist/esm-es5/{sqm-portal-verify-email-view-c1a72c4f.js → sqm-portal-verify-email-view-0b70c1b1.js} +1 -1
  156. package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
  157. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  158. package/dist/esm-es5/sqm-rewards-table-customer-note-cell.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-text-span-view-738acfb3.js → sqm-text-span-view-4db9e33f.js} +1 -1
  165. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  166. package/dist/esm-es5/sqm-user-info-form-view-365cef98.js +1 -0
  167. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
  168. package/dist/esm-es5/{useChildElements-31ba3daf.js → useChildElements-c26d7347.js} +1 -1
  169. package/dist/esm-es5/{useInstantAccessRegistration-1388dace.js → useInstantAccessRegistration-e2392f42.js} +1 -1
  170. package/dist/esm-es5/{useLeadFormState-cec544ea.js → useLeadFormState-9099c8d4.js} +1 -1
  171. package/dist/esm-es5/{usePayoutStatus-24145412.js → usePayoutStatus-fa504d49.js} +1 -1
  172. package/dist/esm-es5/{usePortalRegistrationForm-6d562bf8.js → usePortalRegistrationForm-5844032a.js} +1 -1
  173. package/dist/esm-es5/{useReferralCodes-1ca1fda0.js → useReferralCodes-3cde72d4.js} +1 -1
  174. package/dist/esm-es5/{useReferralTable-456931fd.js → useReferralTable-35e6d4c1.js} +1 -1
  175. package/dist/esm-es5/{useRegistrationFormState-0cee2d21.js → useRegistrationFormState-1813bdef.js} +1 -1
  176. package/dist/esm-es5/{useVerificationEmail-5c6cd733.js → useVerificationEmail-cb3d51e3.js} +1 -1
  177. package/dist/esm-es5/{utilities-f05633da.js → utilities-c9e730ed.js} +1 -1
  178. package/dist/esm-es5/utils-8267d3d8.js +1 -0
  179. package/dist/mint-components/mint-components.esm.js +1 -1
  180. package/dist/mint-components/mint-components.js +1 -1
  181. package/dist/mint-components/{p-5d79c8a0.system.js → p-00463c83.system.js} +1 -1
  182. package/dist/mint-components/p-037c1a4f.system.entry.js +1 -0
  183. package/dist/mint-components/{p-c7cac01e.entry.js → p-038d0b8f.entry.js} +32 -7
  184. package/dist/mint-components/{p-97b8c481.js → p-0553e659.js} +1 -1
  185. package/dist/mint-components/{p-30967f75.js → p-092db51a.js} +1 -1
  186. package/dist/mint-components/{p-bd804f4c.js → p-095b7128.js} +1 -1
  187. package/dist/mint-components/{p-504ed1f2.entry.js → p-0c43b6ff.entry.js} +1 -1
  188. package/dist/mint-components/{p-ab678644.js → p-0d75a207.js} +1 -1
  189. package/dist/mint-components/{p-5e106c95.system.js → p-0fec43e8.system.js} +1 -1
  190. package/dist/mint-components/p-115dfc03.system.js +1 -0
  191. package/dist/mint-components/p-13f3a647.js +1 -0
  192. package/dist/mint-components/{p-473562fc.system.js → p-140e6a15.system.js} +1 -1
  193. package/dist/mint-components/{p-b9652150.entry.js → p-160828b4.entry.js} +1 -1
  194. package/dist/mint-components/{p-878bb2cf.system.entry.js → p-16deb1a9.system.entry.js} +1 -1
  195. package/dist/mint-components/{p-5450693e.entry.js → p-19293c16.entry.js} +1 -1
  196. package/dist/mint-components/{p-1435edd4.entry.js → p-1b0cbbae.entry.js} +1 -1
  197. package/dist/mint-components/p-1c413a06.system.js +1 -0
  198. package/dist/mint-components/{p-c2c01ab5.entry.js → p-1d49dddc.entry.js} +1 -1
  199. package/dist/mint-components/p-1e35f151.system.js +1 -0
  200. package/dist/mint-components/{p-2774c704.system.entry.js → p-21e7079a.system.entry.js} +1 -1
  201. package/dist/mint-components/{p-fa32d8eb.system.entry.js → p-247cfbdc.system.entry.js} +1 -1
  202. package/dist/mint-components/{p-695ec086.system.js → p-28e0062c.system.js} +1 -1
  203. package/dist/mint-components/{p-bae7d6b5.system.entry.js → p-28fe7357.system.entry.js} +1 -1
  204. package/dist/mint-components/{p-7c0255ad.entry.js → p-2d3a12f2.entry.js} +2 -2
  205. package/dist/mint-components/{p-c8060ef5.system.entry.js → p-2f4d8ab8.system.entry.js} +1 -1
  206. package/dist/mint-components/{p-dfb50245.entry.js → p-3181e54a.entry.js} +1 -1
  207. package/dist/mint-components/{p-fb5c9802.entry.js → p-3218bb1d.entry.js} +1 -1
  208. package/dist/mint-components/{p-d863acaa.js → p-32d078a3.js} +1 -1
  209. package/dist/mint-components/{p-7528770e.entry.js → p-3461a8cb.entry.js} +1 -1
  210. package/dist/mint-components/{p-6e816a17.system.entry.js → p-357040e6.system.entry.js} +1 -1
  211. package/dist/mint-components/{p-452f644f.system.js → p-36395228.system.js} +1 -1
  212. package/dist/mint-components/{p-dece706f.js → p-370e0d75.js} +1 -1
  213. package/dist/mint-components/{p-5245e4ce.system.entry.js → p-3756d0d1.system.entry.js} +1 -1
  214. package/dist/mint-components/{p-5f6d617a.entry.js → p-37658fec.entry.js} +1 -1
  215. package/dist/mint-components/{p-7b909aa5.system.js → p-379cb9f1.system.js} +1 -1
  216. package/dist/mint-components/{p-47f594c3.entry.js → p-38dc2f60.entry.js} +1 -1
  217. package/dist/mint-components/p-39840341.js +1 -0
  218. package/dist/mint-components/{p-5126508b.js → p-3c333076.js} +1 -1
  219. package/dist/mint-components/{p-6684e9ad.js → p-3c555674.js} +1 -1
  220. package/dist/mint-components/{p-21851092.js → p-3c88d2ed.js} +2 -2
  221. package/dist/mint-components/{p-e7a9ce16.js → p-438f6702.js} +1 -1
  222. package/dist/mint-components/{p-fe0eceba.system.entry.js → p-45475cf9.system.entry.js} +1 -1
  223. package/dist/mint-components/{p-56ca7e3c.js → p-45e2a83a.js} +1 -1
  224. package/dist/mint-components/{p-7a7ebf08.js → p-4723526d.js} +1 -1
  225. package/dist/mint-components/{p-cabf6326.js → p-50d959bd.js} +1 -1
  226. package/dist/mint-components/{p-f7948b16.system.entry.js → p-52748a87.system.entry.js} +1 -1
  227. package/dist/mint-components/p-52eca331.js +1 -0
  228. package/dist/mint-components/{p-44afc747.entry.js → p-55627a5c.entry.js} +1 -1
  229. package/dist/mint-components/{p-ad017a39.js → p-567a5ded.js} +1 -1
  230. package/dist/mint-components/{p-96cbca52.system.entry.js → p-5c9d030a.system.entry.js} +1 -1
  231. package/dist/mint-components/{p-1b7b65ef.entry.js → p-5dc9e95b.entry.js} +2 -2
  232. package/dist/mint-components/p-5e26014d.system.js +1 -0
  233. package/dist/mint-components/{p-82be3d10.system.entry.js → p-60085f20.system.entry.js} +1 -1
  234. package/dist/mint-components/{p-cc0fe4a3.entry.js → p-608da224.entry.js} +1 -1
  235. package/dist/mint-components/{p-5825aee6.system.entry.js → p-6194855b.system.entry.js} +1 -1
  236. package/dist/mint-components/{p-b8766db9.entry.js → p-62212b9a.entry.js} +1 -1
  237. package/dist/mint-components/{p-f3ddbe2f.system.entry.js → p-62e1c8b2.system.entry.js} +1 -1
  238. package/dist/mint-components/p-63c299f1.system.js +1 -0
  239. package/dist/mint-components/p-64041ee1.entry.js +291 -0
  240. package/dist/mint-components/{p-1b9705fd.system.js → p-64f56cc9.system.js} +1 -1
  241. package/dist/mint-components/p-6530c3f1.entry.js +9 -0
  242. package/dist/mint-components/{p-20280398.system.entry.js → p-691d34f1.system.entry.js} +1 -1
  243. package/dist/mint-components/{p-2ad9470d.system.entry.js → p-6a4496b3.system.entry.js} +1 -1
  244. package/dist/mint-components/{p-79854479.system.js → p-6b1a6b0c.system.js} +1 -1
  245. package/dist/mint-components/{p-1775cb0c.system.js → p-70e34ae1.system.js} +2 -2
  246. package/dist/mint-components/{p-b9f57e84.system.entry.js → p-71561bb2.system.entry.js} +1 -1
  247. package/dist/mint-components/{p-d65991d0.entry.js → p-731c4d33.entry.js} +1 -1
  248. package/dist/mint-components/{p-59644ef8.system.js → p-7547180f.system.js} +1 -1
  249. package/dist/mint-components/{p-f84605ec.system.js → p-77117f6c.system.js} +1 -1
  250. package/dist/mint-components/{p-93cb9438.system.entry.js → p-7a08d288.system.entry.js} +1 -1
  251. package/dist/mint-components/p-7d5956ec.system.entry.js +1 -0
  252. package/dist/mint-components/{p-a03189bd.js → p-7e36a1ff.js} +1 -1
  253. package/dist/mint-components/{p-320b306b.js → p-8474aa63.js} +1 -1
  254. package/dist/mint-components/{p-33a6ab09.js → p-857a2d77.js} +1 -1
  255. package/dist/mint-components/{p-b179621d.system.js → p-86381dc7.system.js} +1 -1
  256. package/dist/mint-components/{p-e502fd80.entry.js → p-86a70151.entry.js} +1 -1
  257. package/dist/mint-components/{p-a30f0ffd.entry.js → p-886fb141.entry.js} +1 -1
  258. package/dist/mint-components/{p-b6fc53c9.entry.js → p-88c9cc1b.entry.js} +1 -1
  259. package/dist/mint-components/{p-6d444f3f.system.js → p-8b258a3e.system.js} +1 -1
  260. package/dist/mint-components/p-8ecc8875.js +116 -0
  261. package/dist/mint-components/{p-fca34d77.js → p-8f9c1387.js} +1 -1
  262. package/dist/mint-components/{p-9c381424.system.entry.js → p-95aaf35a.system.entry.js} +1 -1
  263. package/dist/mint-components/{p-f6fc7569.entry.js → p-96e4e6a4.entry.js} +1 -1
  264. package/dist/mint-components/{p-ed17e1b8.entry.js → p-991f60fc.entry.js} +1 -1
  265. package/dist/mint-components/{p-353ab6db.entry.js → p-996eb820.entry.js} +1 -1
  266. package/dist/mint-components/{p-b8288385.system.entry.js → p-998c989a.system.entry.js} +1 -1
  267. package/dist/mint-components/{p-82905fda.system.js → p-9b33e2a7.system.js} +1 -1
  268. package/dist/mint-components/p-9b790948.system.entry.js +1 -0
  269. package/dist/mint-components/{p-7767314d.system.entry.js → p-9bd53e4d.system.entry.js} +1 -1
  270. package/dist/mint-components/{p-89f8ab67.entry.js → p-9c1b0c8b.entry.js} +1 -1
  271. package/dist/mint-components/{p-2c0bb139.entry.js → p-9d6984e7.entry.js} +2 -2
  272. package/dist/mint-components/{p-07f3b868.entry.js → p-9e43f1eb.entry.js} +1 -1
  273. package/dist/mint-components/p-a0986077.system.entry.js +1 -0
  274. package/dist/mint-components/p-a1e1c42a.js +1 -0
  275. package/dist/mint-components/p-a2db4345.system.js +1 -0
  276. package/dist/mint-components/{p-669d52c4.js → p-a7f72a66.js} +1 -1
  277. package/dist/mint-components/{p-83277c69.system.js → p-a86ce218.system.js} +1 -1
  278. package/dist/mint-components/p-a8891ebd.js +1 -0
  279. package/dist/mint-components/{p-d6c1e876.system.js → p-a8ecdc44.system.js} +1 -1
  280. package/dist/mint-components/{p-f3b21df2.system.js → p-b1b8e629.system.js} +1 -1
  281. package/dist/mint-components/p-b2a99637.system.js +1 -0
  282. package/dist/mint-components/p-b2bde2f5.entry.js +1 -0
  283. package/dist/mint-components/{p-d2448c85.system.entry.js → p-b451970a.system.entry.js} +1 -1
  284. package/dist/mint-components/{p-4da8028d.system.entry.js → p-b5c0bad5.system.entry.js} +1 -1
  285. package/dist/mint-components/{p-80174c14.entry.js → p-b5fed7c6.entry.js} +1 -1
  286. package/dist/mint-components/p-b6ac3080.system.entry.js +1 -0
  287. package/dist/mint-components/p-bc4b2728.entry.js +122 -0
  288. package/dist/mint-components/{p-d5375baf.js → p-bcadd021.js} +1 -1
  289. package/dist/mint-components/{p-07da0ddd.system.entry.js → p-c7535e70.system.entry.js} +1 -1
  290. package/dist/mint-components/{p-d42aba0e.system.js → p-c84a2512.system.js} +1 -1
  291. package/dist/mint-components/{p-55b1be64.system.entry.js → p-c8e45671.system.entry.js} +1 -1
  292. package/dist/mint-components/{p-e5e8e13e.js → p-ce11858c.js} +1 -1
  293. package/dist/mint-components/{p-f95952a0.system.entry.js → p-d01949f7.system.entry.js} +1 -1
  294. package/dist/mint-components/{p-1d450b85.js → p-d20188db.js} +1 -1
  295. package/dist/mint-components/{p-e4d3b7a9.system.js → p-d355336b.system.js} +1 -1
  296. package/dist/mint-components/{p-5822a43f.system.entry.js → p-d5a1c979.system.entry.js} +1 -1
  297. package/dist/mint-components/p-d6714617.entry.js +1 -0
  298. package/dist/mint-components/{p-7333d103.system.entry.js → p-dbdb2a46.system.entry.js} +1 -1
  299. package/dist/mint-components/{p-3c46b4dd.system.js → p-df88dcaa.system.js} +1 -1
  300. package/dist/mint-components/{p-18133026.system.entry.js → p-e1292288.system.entry.js} +1 -1
  301. package/dist/mint-components/{p-c756bc32.system.js → p-e4dbca9a.system.js} +1 -1
  302. package/dist/mint-components/{p-8f5b316e.js → p-e95402dc.js} +1 -1
  303. package/dist/mint-components/{p-0a900fb1.system.entry.js → p-e9e05970.system.entry.js} +1 -1
  304. package/dist/mint-components/p-ee0f1cf1.system.js +1 -0
  305. package/dist/mint-components/{p-84866680.entry.js → p-f11d29fd.entry.js} +1 -1
  306. package/dist/mint-components/{p-dac20392.system.js → p-f368f04a.system.js} +1 -1
  307. package/dist/mint-components/{p-06ca4346.entry.js → p-f4a57aed.entry.js} +1 -1
  308. package/dist/mint-components/{p-2e2c5ec4.entry.js → p-f972e5c9.entry.js} +1 -1
  309. package/dist/mint-components/{p-91c4b8d5.system.entry.js → p-fb4ab5ba.system.entry.js} +1 -1
  310. package/dist/mint-components/sqm-partner-info-modal.entry.js +489 -0
  311. package/dist/mint-components/sqm-partner-info-modal.system.entry.js +1 -0
  312. package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +0 -1
  313. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +8 -0
  314. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +31 -3
  315. package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +1 -0
  316. package/dist/types/components/sqm-widget-verification/WidgetVerification.stories.d.ts +8 -0
  317. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +6 -1
  318. package/dist/types/components/tax-and-cash/data.d.ts +1 -0
  319. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +7 -0
  320. package/dist/types/components.d.ts +71 -5
  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 +1 -1
  325. package/dist/cjs/extractProps-e9c55ba8.js +0 -35
  326. package/dist/cjs/sqm-partner-info-modal-view-e3faede9.js +0 -108
  327. package/dist/cjs/sqm-widget-verification.cjs.entry.js +0 -304
  328. package/dist/esm/data-a6752028.js +0 -216
  329. package/dist/esm/extractProps-54064fb0.js +0 -32
  330. package/dist/esm/sqm-partner-info-modal-view-77c231af.js +0 -106
  331. package/dist/esm/sqm-widget-verification.entry.js +0 -300
  332. package/dist/esm-es5/data-a6752028.js +0 -1
  333. package/dist/esm-es5/extractProps-54064fb0.js +0 -1
  334. package/dist/esm-es5/sqm-big-stat_45.entry.js +0 -1
  335. package/dist/esm-es5/sqm-partner-info-modal-view-77c231af.js +0 -1
  336. package/dist/esm-es5/sqm-user-info-form-view-a18d6b15.js +0 -1
  337. package/dist/esm-es5/sqm-widget-verification.entry.js +0 -1
  338. package/dist/mint-components/p-0797a946.js +0 -1
  339. package/dist/mint-components/p-094edc0b.entry.js +0 -9
  340. package/dist/mint-components/p-1a0b9f0f.entry.js +0 -16
  341. package/dist/mint-components/p-1b0d7020.js +0 -1
  342. package/dist/mint-components/p-237a21c1.system.entry.js +0 -1
  343. package/dist/mint-components/p-35724e1c.entry.js +0 -1
  344. package/dist/mint-components/p-38c7775a.js +0 -1
  345. package/dist/mint-components/p-4b365f1f.system.js +0 -1
  346. package/dist/mint-components/p-4ea9b7ec.system.entry.js +0 -1
  347. package/dist/mint-components/p-4fbfb954.system.entry.js +0 -1
  348. package/dist/mint-components/p-57dd28bd.system.js +0 -1
  349. package/dist/mint-components/p-614630a8.system.js +0 -1
  350. package/dist/mint-components/p-66c070e2.entry.js +0 -105
  351. package/dist/mint-components/p-6e6f19ea.system.entry.js +0 -1
  352. package/dist/mint-components/p-71c585b7.entry.js +0 -1
  353. package/dist/mint-components/p-725c542a.js +0 -1
  354. package/dist/mint-components/p-78909fc0.system.js +0 -1
  355. package/dist/mint-components/p-a9855b29.system.entry.js +0 -1
  356. package/dist/mint-components/p-debe7d04.system.js +0 -1
  357. package/dist/mint-components/p-e44c816e.system.js +0 -1
  358. package/dist/mint-components/p-e55aafe9.system.js +0 -1
  359. package/dist/mint-components/p-e6924adb.entry.js +0 -273
  360. package/dist/mint-components/p-e9a596d6.system.entry.js +0 -1
@@ -1,7 +1,9 @@
1
- import { useLocale, useMutation, useQuery, } from "@saasquatch/component-boilerplate";
2
- import { useEffect, useState } from "@saasquatch/universal-hooks";
1
+ import { useLocale, useMutation, useQuery, useSetParent, } from "@saasquatch/component-boilerplate";
2
+ import { useEffect, useMemo, useState } from "@saasquatch/universal-hooks";
3
3
  import { gql } from "graphql-request";
4
4
  import { TAX_FORM_UPDATED_EVENT_KEY } from "../tax-and-cash/eventKeys";
5
+ import { VERIFICATION_PARENT_NAMESPACE } from "../sqm-widget-verification/keys";
6
+ import { GET_FINANCE_NETWORK_SETTINGS, } from "../tax-and-cash/data";
5
7
  // new field under impactConnection:{ resolvedByEmail: boolean } - determines if connection came from managed identity
6
8
  export const GET_USER_PARTNER_INFO = gql `
7
9
  query getUserPartnerInfo {
@@ -16,19 +18,11 @@ export const GET_USER_PARTNER_INFO = gql `
16
18
  customFields
17
19
  impactConnection {
18
20
  connected
21
+ connectionStatus
19
22
  publisher {
20
- phoneNumber
21
- phoneNumberCountryCode
23
+ id
22
24
  countryCode
23
25
  currency
24
- requiredTaxDocumentType
25
- currentTaxDocument {
26
- type
27
- status
28
- }
29
- withdrawalSettings {
30
- paymentMethod
31
- }
32
26
  }
33
27
  }
34
28
  }
@@ -81,6 +75,32 @@ export const CONNECT_PARTNER = gql `
81
75
  }
82
76
  }
83
77
  `;
78
+ const START_IMPACT_CONNECTION = gql `
79
+ mutation startImpactConnection($vars: ImpactConnectionInput!) {
80
+ startImpactConnection(impactConnectionInput: $vars) {
81
+ success
82
+ validationErrors {
83
+ field
84
+ message
85
+ }
86
+ user {
87
+ id
88
+ accountId
89
+ impactConnection {
90
+ connected
91
+ publisher {
92
+ brandedSignup
93
+ requiredTaxDocumentType
94
+ currentTaxDocument {
95
+ type
96
+ status
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ `;
84
104
  const GET_BRAND_NAME = gql `
85
105
  query getTenantSettings {
86
106
  tenantSettings {
@@ -89,33 +109,56 @@ const GET_BRAND_NAME = gql `
89
109
  }
90
110
  `;
91
111
  export function usePartnerInfoModal(props) {
92
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
112
+ var _a, _b, _c, _d, _e, _f, _g;
93
113
  const locale = useLocale();
114
+ const setVerificationContext = useSetParent(VERIFICATION_PARENT_NAMESPACE);
94
115
  const { data: userData, loading: userLoading, refetch, } = useQuery(GET_USER_PARTNER_INFO, {});
95
116
  const user = userData === null || userData === void 0 ? void 0 : userData.user;
96
117
  const { data: currenciesData, loading: currenciesLoading } = useQuery(GET_CURRENCIES, { variables: { locale } });
97
118
  const { data: countriesData, loading: countriesLoading } = useQuery(GET_COUNTRIES, {});
98
119
  const { data: tenantSettingsData } = useQuery(GET_BRAND_NAME, {});
99
- const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = useMutation(CONNECT_PARTNER);
100
- 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) || "");
120
+ const { data: financeNetworkData } = useQuery(GET_FINANCE_NETWORK_SETTINGS, {
121
+ variables: { filter: {} },
122
+ });
123
+ const [startImpactConnection, { loading: connectLoading, errors: connectErrors },] = useMutation(START_IMPACT_CONNECTION);
124
+ const [allowBankingCollection, setAllowBankingCollection] = useState(false);
125
+ const [checkboxError, setCheckboxError] = useState("");
126
+ // No pre-filled country, use locale to determine countryCode instead
127
+ 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) ||
128
+ locale.replace(/^.*_/, ""));
101
129
  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) || "");
102
- console.log(countryCode, currency, "initial country and currency state"); // TEMP
130
+ const countries = ((_e = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _e === void 0 ? void 0 : _e.data) || [];
131
+ // copied from useTaxAndCash for displaying currencies based on country - could be in helper?
132
+ const currencies = useMemo(() => {
133
+ var _a, _b;
134
+ const allValidCurrencies = (_b = (_a = financeNetworkData === null || financeNetworkData === void 0 ? void 0 : financeNetworkData.impactFinanceNetworkSettings) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.reduce((agg, settings) => {
135
+ var _a, _b;
136
+ const currency = (_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((c) => c.currencyCode === settings.currency);
137
+ if (!currency)
138
+ return agg;
139
+ if (agg.find((c) => c.currencyCode === settings.currency))
140
+ return agg;
141
+ if (countryCode && settings.countryCode !== countryCode)
142
+ return agg;
143
+ return [...agg, currency];
144
+ }, []);
145
+ return (allValidCurrencies || []).sort((a, b) => a.displayName.localeCompare(b.displayName));
146
+ }, [financeNetworkData, currenciesData, countryCode]);
103
147
  const [countrySearch, setCountrySearch] = useState("");
104
148
  const [currencySearch, setCurrencySearch] = useState("");
105
- const [filteredCountries, setFilteredCountries] = useState(((_e = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _e === void 0 ? void 0 : _e.data) || []);
106
- const [filteredCurrencies, setFilteredCurrencies] = useState(((_f = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _f === void 0 ? void 0 : _f.data) || []);
149
+ const [filteredCountries, setFilteredCountries] = useState(((_f = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _f === void 0 ? void 0 : _f.data) || []);
150
+ const [filteredCurrencies, setFilteredCurrencies] = useState(currencies || []);
151
+ console.log(userData, "userData partner info modal");
107
152
  const [error, setError] = useState("");
108
153
  const [success, setSuccess] = useState(false);
109
- const countries = ((_g = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _g === void 0 ? void 0 : _g.data) || [];
110
- const currencies = ((_h = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _h === void 0 ? void 0 : _h.data) || [];
111
- console.log(user, "user data from partner info query"); // TEMP
112
154
  useEffect(() => {
113
155
  var _a;
114
- if (userData && ((_a = user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher)) {
115
- setCountryCode(user.impactConnection.publisher.countryCode);
116
- setCurrency(user.impactConnection.publisher.currency);
117
- }
118
- }, [userData]);
156
+ const publisher = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher;
157
+ if (!userData || !publisher)
158
+ return;
159
+ setCountryCode(publisher.countryCode);
160
+ setCurrency(publisher.currency);
161
+ }, [userData, user]);
119
162
  useEffect(() => {
120
163
  if (!(countries === null || countries === void 0 ? void 0 : countries.length))
121
164
  return;
@@ -154,13 +197,24 @@ export function usePartnerInfoModal(props) {
154
197
  setCurrency(value);
155
198
  setError("");
156
199
  }
200
+ function onCheckboxChange(e) {
201
+ const checked = e.target.checked;
202
+ setAllowBankingCollection(checked);
203
+ if (checked)
204
+ setCheckboxError("");
205
+ }
157
206
  async function onSubmit() {
158
207
  var _a, _b;
208
+ if (!allowBankingCollection) {
209
+ setCheckboxError(props.missingFieldsErrorText);
210
+ return;
211
+ }
159
212
  if (!countryCode || !currency) {
160
213
  setError(props.missingFieldsErrorText);
161
214
  return;
162
215
  }
163
216
  setError("");
217
+ setCheckboxError("");
164
218
  try {
165
219
  const vars = {
166
220
  user: {
@@ -174,13 +228,13 @@ export function usePartnerInfoModal(props) {
174
228
  countryCode,
175
229
  currency,
176
230
  };
177
- const result = await connectImpactPartner({ vars });
231
+ const result = await startImpactConnection({ vars });
178
232
  if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message)) {
179
233
  setError(props.networkErrorText);
180
234
  return;
181
235
  }
182
236
  const connectionResult = result
183
- .createImpactConnection;
237
+ .startImpactConnection;
184
238
  console.log(result, connectionResult, "result and connectionResult from creating partner from modal");
185
239
  if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
186
240
  const validationMsg = (_b = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors) === null || _b === void 0 ? void 0 : _b.map((e) => e.message).join(". ");
@@ -191,34 +245,37 @@ export function usePartnerInfoModal(props) {
191
245
  window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
192
246
  await refetch();
193
247
  setSuccess(true);
248
+ setVerificationContext(true);
194
249
  }
195
250
  catch (e) {
196
251
  console.error("Partner creation error:", e);
197
252
  setError(props.networkErrorText);
198
253
  }
199
254
  }
200
- console.log(success, "success state in partner info modal");
201
255
  const showModal = !success &&
202
256
  !userLoading &&
203
- (!(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected) || !(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.publisher));
204
- console.log(showModal, "showModal condition in partner info modal"); // TEMP
257
+ (impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connectionStatus) === "NOT_STARTED";
205
258
  return {
206
259
  states: {
207
260
  open: showModal,
208
261
  loading: userLoading || countriesLoading || currenciesLoading,
209
262
  submitting: connectLoading,
210
- isExistingPartner: (impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected) || (impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.publisher),
263
+ isExistingPartner: impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.publisher,
211
264
  countryCode,
212
265
  currency,
213
266
  error,
214
267
  success,
215
- brandName: ((_j = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _j === void 0 ? void 0 : _j.companyName) || "",
268
+ brandName: ((_g = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _g === void 0 ? void 0 : _g.companyName) || "",
216
269
  filteredCountries: filteredCountries || [],
217
270
  filteredCurrencies: filteredCurrencies || [],
271
+ allowBankingCollection,
272
+ checkboxError,
273
+ disabled: userLoading || connectLoading,
218
274
  },
219
275
  callbacks: {
220
276
  onCountryChange,
221
277
  onCurrencyChange,
278
+ onCheckboxChange,
222
279
  setCurrencySearch,
223
280
  setCountrySearch,
224
281
  onSubmit,
@@ -108,6 +108,7 @@ import * as LeadCheckboxField from "../sqm-lead-form/LeadCheckboxField.stories";
108
108
  import * as Skeleton from "../sqm-skeleton/Skeleton.stories";
109
109
  import * as UserInfoFormView from "../tax-and-cash/sqm-user-info-form/UserInfoFormView.stories";
110
110
  import * as PartnerInfoModal from "../sqm-partner-info-modal/PartnerInfoModal.stories";
111
+ import * as WidgetVerification from "../sqm-widget-verification/WidgetVerification.stories";
111
112
  import { ShadowViewAddon } from "../../ShadowViewAddon";
112
113
  import { CucumberAddon } from "./CucumberAddon";
113
114
  import { HookStoryAddon } from "./HookStoryAddon";
@@ -220,6 +221,7 @@ const stories = [
220
221
  TaxAndCashReferralTableRewardsCell,
221
222
  TaxAndCashReferralTable,
222
223
  PartnerInfoModal,
224
+ WidgetVerification,
223
225
  ];
224
226
  /**
225
227
  * For internal documentation
@@ -50,7 +50,7 @@ export function TextSpanView(props, children) {
50
50
  display: inline;
51
51
  }
52
52
  `;
53
- return (h("span", { class: sheet.classes[type], part: "sqm-base" },
53
+ return (h("span", { class: sheet.classes[type], part: "sqm-text-span-base" },
54
54
  h("style", { type: "text/css" },
55
55
  vanillaStyle,
56
56
  styleString),
@@ -0,0 +1,16 @@
1
+ import { h } from "@stencil/core";
2
+ export default {
3
+ title: "Components/Widget Verification",
4
+ };
5
+ export const Step1Email = () => (h("sqm-widget-verification", { stateController: JSON.stringify({
6
+ "sqm-widget-verification": { showCode: false },
7
+ }) }));
8
+ export const Step2Code = () => (h("sqm-widget-verification", { stateController: JSON.stringify({
9
+ "sqm-widget-verification": { showCode: true },
10
+ }) }));
11
+ export const Step3PartnerModal = () => (h("sqm-widget-verification", { stateController: JSON.stringify({
12
+ "sqm-widget-verification": { showPartnerModal: true },
13
+ }) }));
14
+ export const Loading = () => (h("sqm-widget-verification", { stateController: JSON.stringify({
15
+ "sqm-widget-verification": { loading: true },
16
+ }) }));
@@ -54,7 +54,6 @@ const style = {
54
54
  },
55
55
  ContinueButton: {
56
56
  width: "100%",
57
- maxWidth: "100px",
58
57
  },
59
58
  FooterContainer: {
60
59
  display: "flex",
@@ -132,7 +131,7 @@ export function WidgetCodeVerificationView(props) {
132
131
  h("sl-input", { class: inputClass, name: "code" }),
133
132
  h("sl-input", { class: inputClass, name: "code" })),
134
133
  states.verifyFailed && (h("p", { class: sheet.classes.ErrorText }, text.invalidCodeText)),
135
- h("sl-button", { class: sheet.classes.ContinueButton, onClick: callbacks.submitCode, disabled: states.loading || states.initialiseLoading, loading: states.loading || states.initialiseLoading, exportparts: "base: primarybutton-base", type: "primary" }, text.verifyText)),
136
- h("div", { class: sheet.classes.FooterContainer },
137
- h(TextSpanView, { type: "p" }, resendCodeText)))));
134
+ h("div", { class: sheet.classes.FooterContainer },
135
+ h(TextSpanView, { type: "p" }, resendCodeText)),
136
+ h("sl-button", { class: sheet.classes.ContinueButton, onClick: callbacks.submitCode, disabled: states.loading || states.initialiseLoading, loading: states.loading || states.initialiseLoading, exportparts: "base: primarybutton-base", type: "primary" }, text.verifyText)))));
138
137
  }
@@ -14,11 +14,9 @@ const style = {
14
14
  gap: "var(--sl-spacing-medium)",
15
15
  position: "relative",
16
16
  flexDirection: "column",
17
- maxWidth: "320px",
18
17
  },
19
18
  ContinueButton: {
20
19
  width: "100%",
21
- maxWidth: "100px",
22
20
  },
23
21
  SkeletonOne: {
24
22
  width: "50%",
@@ -7,6 +7,35 @@ import { getProps } from "../../utils/utils";
7
7
  import { extractProps } from "../tax-and-cash/sqm-tax-and-cash/extractProps";
8
8
  import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE, VERIFICATION_PARENT_NAMESPACE, } from "./keys";
9
9
  import { useWidgetVerification } from "./useWidgetVerification";
10
+ import { createStyleSheet } from "../../styling/JSS";
11
+ const style = {
12
+ Dialog: {
13
+ "&::part(panel)": {
14
+ maxWidth: "480px",
15
+ },
16
+ "&::part(body)": {
17
+ padding: "0 var(--sl-spacing-x-large)",
18
+ fontSize: "var(--sl-font-size-small)",
19
+ overflow: "visible",
20
+ },
21
+ "&::part(footer)": {
22
+ display: "flex",
23
+ flexDirection: "column",
24
+ gap: "var(--sl-spacing-small)",
25
+ },
26
+ "&::part(overlay)": {
27
+ background: "rgba(0, 0, 0, 0.5)",
28
+ },
29
+ },
30
+ DialogTitle: {
31
+ fontSize: "var(--sl-font-size-x-large)",
32
+ fontWeight: "600",
33
+ padding: "var(--sl-spacing-x-large) 0 0 0",
34
+ margin: "0",
35
+ },
36
+ };
37
+ const sheet = createStyleSheet(style);
38
+ const styleString = sheet.toString();
10
39
  /**
11
40
  * @uiName Widget Verification Flow
12
41
  * @exampleGroup Widget Verification
@@ -14,10 +43,15 @@ import { useWidgetVerification } from "./useWidgetVerification";
14
43
  */
15
44
  export class WidgetVerification {
16
45
  constructor() {
17
- // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
46
+ // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification AND sqm-partner-info-modal
18
47
  /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
48
  GENERAL PROPS
20
49
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
50
+ /**
51
+ * @uiName General widget header text with partner creation
52
+ * @uiGroup General Text
53
+ */
54
+ this.general_widgetHeaderWithPartnerCreation = "Let's get you ready for rewards";
21
55
  /**
22
56
  * @uiName General verify widget header text
23
57
  * @uiGroup General Text
@@ -188,7 +222,7 @@ export class WidgetVerification {
188
222
  * @undocumented
189
223
  * @componentState { "title": "Step 1: Enter email", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"], "uiGroup": "Email Verification Step" }
190
224
  * @componentState { "title": "Step 2: Enter code", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"], "uiGroup": "Code Verification Step" }
191
- * @componentState { "title": "Step 3: Create Partner", "props": { "showCode": false }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
225
+ * @componentState { "title": "Step 3: Create Partner", "props": { "showPartnerModal": true }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
192
226
  */
193
227
  this.stateController = "{}";
194
228
  withHooks(this);
@@ -199,27 +233,71 @@ export class WidgetVerification {
199
233
  return extractProps(props, prefix);
200
234
  }
201
235
  render() {
236
+ var _a;
202
237
  const props = isDemo()
203
238
  ? useDemoWidgetVerificationInternal(this)
204
239
  : useWidgetVerification();
205
240
  if (props.loading)
206
241
  return h("sl-spinner", null);
207
- if (props.showPartnerModal) {
208
- return (h("sqm-partner-info-modal", Object.assign({}, this.getStepTextProps("createPartnerStep_"))));
242
+ // for handling state previews in content editor
243
+ const partnerState = typeof props["sqm-partner-info-modal_stateController"] === "string"
244
+ ? parseStates(props["sqm-partner-info-modal_stateController"])
245
+ : props["sqm-partner-info-modal_stateController"];
246
+ if (props.showPartnerModal && ((_a = partnerState === null || partnerState === void 0 ? void 0 : partnerState.states) === null || _a === void 0 ? void 0 : _a.open) === false) {
247
+ return h("div", null);
209
248
  }
210
- const generalText = this.getStepTextProps("general_");
249
+ // const generalText = this.getStepTextProps("general_");
250
+ const partnerText = this.getStepTextProps("createPartnerStep_");
251
+ const dialogLabel = this.general_widgetHeaderWithPartnerCreation;
252
+ const renderStepContent = () => {
253
+ if (props.showPartnerModal) {
254
+ return (h("sqm-partner-info-modal", Object.assign({ inModal: true }, partnerText, { stateController: props["sqm-partner-info-modal_stateController"] || "{}" })));
255
+ }
256
+ if (props.showCode) {
257
+ return (h("sqm-code-verification", Object.assign({ onVerification: props.onVerification }, this.getStepTextProps("codeStep_"), extractProps(props, "sqm-code-verification_"))));
258
+ }
259
+ return (h("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"), extractProps(props, "sqm-email-verification_"))));
260
+ };
211
261
  return (h("div", null,
212
- h("h3", { style: { fontSize: "24px", margin: "0" } }, generalText.verifyEmailHeader),
213
- h("p", { style: {
214
- color: "var(--sl-color-neutral-500)",
215
- fontSize: "var(--sl-font-size-medium)",
216
- margin: "0",
217
- } }, generalText.verifyEmailDescription),
218
- props.showCode ? (h("sqm-code-verification", Object.assign({ onVerification: props.onVerification }, this.getStepTextProps("codeStep_"), extractProps(props, "sqm-code-verification_")))) : (h("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"), extractProps(props, "sqm-email-verification_"))))));
262
+ h("style", { type: "text/css" }, styleString),
263
+ h("sl-dialog", { class: sheet.classes.Dialog, noHeader: true, open: true, label: dialogLabel, "onSl-request-close": (e) => {
264
+ e.preventDefault();
265
+ }, "onSl-hide": (e) => {
266
+ var _a;
267
+ if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === "SL-DIALOG") {
268
+ e.preventDefault();
269
+ }
270
+ } },
271
+ h("h2", { class: sheet.classes.DialogTitle }, dialogLabel),
272
+ renderStepContent())));
219
273
  }
220
274
  static get is() { return "sqm-widget-verification"; }
221
275
  static get encapsulation() { return "shadow"; }
222
276
  static get properties() { return {
277
+ "general_widgetHeaderWithPartnerCreation": {
278
+ "type": "string",
279
+ "mutable": false,
280
+ "complexType": {
281
+ "original": "string",
282
+ "resolved": "string",
283
+ "references": {}
284
+ },
285
+ "required": false,
286
+ "optional": false,
287
+ "docs": {
288
+ "tags": [{
289
+ "text": "General widget header text with partner creation",
290
+ "name": "uiName"
291
+ }, {
292
+ "text": "General Text",
293
+ "name": "uiGroup"
294
+ }],
295
+ "text": ""
296
+ },
297
+ "attribute": "general_widget-header-with-partner-creation",
298
+ "reflect": false,
299
+ "defaultValue": "\"Let's get you ready for rewards\""
300
+ },
223
301
  "general_verifyEmailHeader": {
224
302
  "type": "string",
225
303
  "mutable": false,
@@ -958,7 +1036,7 @@ export class WidgetVerification {
958
1036
  "text": "{ \"title\": \"Step 2: Enter code\", \"props\": { \"showCode\": true }, \"dependencies\": [\"sqm-code-verification\"], \"uiGroup\": \"Code Verification Step\" }",
959
1037
  "name": "componentState"
960
1038
  }, {
961
- "text": "{ \"title\": \"Step 3: Create Partner\", \"props\": { \"showCode\": false }, \"dependencies\": [\"sqm-partner-info-modal\"], \"uiGroup\": \"Partner Creation Step\" }",
1039
+ "text": "{ \"title\": \"Step 3: Create Partner\", \"props\": { \"showPartnerModal\": true }, \"dependencies\": [\"sqm-partner-info-modal\"], \"uiGroup\": \"Partner Creation Step\" }",
962
1040
  "name": "componentState"
963
1041
  }],
964
1042
  "text": ""
@@ -15,6 +15,9 @@ const USER_LOOKUP = gql `
15
15
  email
16
16
  emailVerified
17
17
  }
18
+ impactConnection {
19
+ connected
20
+ }
18
21
  }
19
22
  }
20
23
  }
@@ -35,15 +38,22 @@ export function useWidgetVerification() {
35
38
  const [fetch] = useLazyQuery(USER_LOOKUP);
36
39
  useEffect(() => {
37
40
  const checkUser = async () => {
38
- var _a, _b, _c;
41
+ var _a, _b, _c, _d, _e;
39
42
  try {
40
43
  const res = await fetch({});
41
44
  if (!res || res instanceof Error)
42
45
  throw new Error();
43
- if ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified)
44
- setContext(true);
45
- else if ((_c = (_b = res === null || res === void 0 ? void 0 : res.viewer) === null || _b === void 0 ? void 0 : _b.managedIdentity) === null || _c === void 0 ? void 0 : _c.emailVerified)
46
+ // Flow changed to send email -> verify code -> show early partner creation modal
47
+ const emailVerified = ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified) || ((_c = (_b = res === null || res === void 0 ? void 0 : res.viewer) === null || _b === void 0 ? void 0 : _b.managedIdentity) === null || _c === void 0 ? void 0 : _c.emailVerified);
48
+ const isConnected = (_e = (_d = res === null || res === void 0 ? void 0 : res.viewer) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.connected;
49
+ if (isConnected) {
50
+ // Partner already created, show widget content
46
51
  setContext(true);
52
+ }
53
+ else if (emailVerified) {
54
+ // Email verified but no partner yet, show partner modal
55
+ setShowPartnerModal(true);
56
+ }
47
57
  }
48
58
  catch (e) {
49
59
  console.error("Could not fetch user information:", e);
@@ -38,6 +38,7 @@ export const GET_USER = gql `
38
38
  }
39
39
  impactConnection {
40
40
  connected
41
+ connectionStatus
41
42
  user {
42
43
  firstName
43
44
  lastName
@@ -32,6 +32,32 @@ export const CONNECT_PARTNER = gql `
32
32
  }
33
33
  }
34
34
  `;
35
+ export const COMPLETE_PARTNER = gql `
36
+ mutation completeImpactConnection($vars: ImpactConnectionInput!) {
37
+ completeImpactConnection(impactConnectionInput: $vars) {
38
+ success
39
+ validationErrors {
40
+ field
41
+ message
42
+ }
43
+ user {
44
+ id
45
+ accountId
46
+ impactConnection {
47
+ connected
48
+ publisher {
49
+ brandedSignup
50
+ requiredTaxDocumentType
51
+ currentTaxDocument {
52
+ type
53
+ status
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ `;
35
61
  function getOption(countries, countryCode) {
36
62
  if (!countries)
37
63
  return;
@@ -50,6 +76,7 @@ export function useIndirectTaxForm(props) {
50
76
  const context = useParentValue(TAX_FORM_CONTEXT_NAMESPACE);
51
77
  const [step, setStep] = useParent(TAX_CONTEXT_NAMESPACE);
52
78
  const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = useMutation(CONNECT_PARTNER);
79
+ const [completeImpactPartner, { loading: completeLoading, errors: completeErrors },] = useMutation(COMPLETE_PARTNER);
53
80
  const userForm = useParentValue(USER_FORM_CONTEXT_NAMESPACE);
54
81
  const { data: userData, refetch, errors: userError, } = useParentQueryValue(USER_QUERY_NAMESPACE);
55
82
  const { data: _countriesRes, loading: countriesLoading } = useParentQueryValue(COUNTRIES_QUERY_NAMESPACE);
@@ -112,7 +139,7 @@ export function useIndirectTaxForm(props) {
112
139
  setFormState((p) => ({ ...p, [field]: value }));
113
140
  };
114
141
  async function connectPartner(formData) {
115
- var _a, _b, _c, _d, _e;
142
+ var _a, _b, _c, _d, _e, _f, _g;
116
143
  const vars = {
117
144
  user: {
118
145
  id: user.id,
@@ -134,19 +161,30 @@ export function useIndirectTaxForm(props) {
134
161
  additionalTaxId: formData.qstNumber,
135
162
  withholdingTaxId: formData.subRegionTaxNumber,
136
163
  };
137
- const result = await connectImpactPartner({
138
- vars,
139
- });
140
- if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
164
+ //AL: TODO completePartnerMutation might change
165
+ let result = null;
166
+ let connectionResult;
167
+ if ((_b = (_a = userData === null || userData === void 0 ? void 0 : userData.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.connected) {
168
+ result = await completeImpactPartner({
169
+ vars,
170
+ });
171
+ connectionResult = (_c = result) === null || _c === void 0 ? void 0 : _c.completeImpactConnection;
172
+ }
173
+ else {
174
+ result = await connectImpactPartner({
175
+ vars,
176
+ });
177
+ connectionResult = (_d = result) === null || _d === void 0 ? void 0 : _d.createImpactConnection;
178
+ }
179
+ if (!result || ((_e = result) === null || _e === void 0 ? void 0 : _e.message))
141
180
  throw new Error();
142
- if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
181
+ if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
143
182
  // Output backend errors to console for now
144
- console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
183
+ console.error("Failed to create Impact connection: ", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
145
184
  throw new Error();
146
185
  }
147
186
  await refetch();
148
- const resultPublisher = (_e = (_d = (_c = result
149
- .createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
187
+ const resultPublisher = (_g = (_f = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.publisher;
150
188
  const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
151
189
  // Fire form change event
152
190
  window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
@@ -212,8 +250,8 @@ export function useIndirectTaxForm(props) {
212
250
  states: {
213
251
  step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
214
252
  hideSteps: context.hideSteps,
215
- disabled: loading || countriesLoading || connectLoading,
216
- loading: loading || connectLoading || countriesLoading,
253
+ disabled: loading || countriesLoading || connectLoading || completeLoading,
254
+ loading: loading || connectLoading || countriesLoading || completeLoading,
217
255
  isPartner: !!((_e = (_d = userData === null || userData === void 0 ? void 0 : userData.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher),
218
256
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
219
257
  formState: {
@@ -7,14 +7,9 @@ function getCurrentStep(user) {
7
7
  if (!((_a = user.impactConnection) === null || _a === void 0 ? void 0 : _a.connected) || !((_b = user.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher)) {
8
8
  return "/1";
9
9
  }
10
- const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, billingAddress, phoneNumber, billingCity, billingPostalCode, billingState, } = user.impactConnection.publisher;
11
- console.log(phoneNumber, "phone number in getCurrentStep");
12
- // Early partner creation does not collect these fields
13
- if (!billingAddress ||
14
- !billingCity ||
15
- !billingPostalCode ||
16
- !billingState ||
17
- !phoneNumber) {
10
+ const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, } = user.impactConnection.publisher;
11
+ console.log(user.impactConnection, "publisher data in useTaxAndCash to determine step new new");
12
+ if (user.impactConnection.connectionStatus === "STARTED") {
18
13
  return "/1";
19
14
  }
20
15
  // If they do have a required document, look at current document