@saasquatch/mint-components 2.3.0-9 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/{esm/usePortalRegistrationForm-3a1f36a2.js → cjs/AsYouType-d15caac8.js} +267 -222
  2. package/dist/cjs/{ShadowViewAddon-3b477e58.js → ShadowViewAddon-05c6968d.js} +4 -4
  3. package/dist/cjs/{global-b7b1b8fe.js → global-258c36b8.js} +7 -3
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/mint-components.cjs.js +1 -1
  6. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +49 -36
  7. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +38 -25
  8. package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
  9. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +6 -9
  10. package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
  11. package/dist/cjs/{sqm-lead-checkbox-field-view-0af2a157.js → sqm-lead-checkbox-field-view-b3a85029.js} +1 -1
  12. package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
  13. package/dist/cjs/{sqm-lead-input-field-view-0cd7ebdb.js → sqm-lead-input-field-view-88de1b78.js} +1 -1
  14. package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
  15. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
  16. package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
  17. package/dist/cjs/{sqm-partner-info-modal-view-2b6fee0f.js → sqm-partner-info-modal-view-243aad7b.js} +6 -7
  18. package/dist/cjs/{sqm-portal-email-verification-view-abb773a7.js → sqm-portal-email-verification-view-6cc7ef05.js} +1 -1
  19. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
  20. package/dist/cjs/sqm-portal-forgot-password_6.cjs.entry.js +3 -2
  21. package/dist/cjs/{sqm-portal-profile-view-3515e1e5.js → sqm-portal-profile-view-a4ba4657.js} +1 -1
  22. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  23. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
  24. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -2
  25. package/dist/cjs/sqm-stencilbook.cjs.entry.js +69 -12
  26. package/dist/cjs/{sqm-user-info-form-view-374a3f01.js → sqm-user-info-form-view-c5f9b79b.js} +1007 -11
  27. package/dist/cjs/subregions-3d27e279.js +1068 -0
  28. package/dist/cjs/{useIndirectTaxForm-112914a0.js → useIndirectTaxForm-5211013b.js} +6 -2
  29. package/dist/cjs/{useLeadFormState-b4c2ab5b.js → useLeadFormState-bf49984b.js} +1 -1
  30. package/dist/cjs/usePortalRegistrationForm-8a3a14ac.js +215 -0
  31. package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field-view.js +1 -1
  32. package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +1 -1
  33. package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +1 -1
  34. package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +2 -2
  35. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +5 -6
  36. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +3 -6
  37. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +0 -1
  38. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +1 -1
  39. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +2 -0
  40. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +3 -0
  41. package/dist/collection/components/tax-and-cash/phoneExtensions.js +12 -0
  42. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +3 -3
  43. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.js +3 -3
  44. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +3 -2
  45. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +5 -1
  46. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +29 -19
  47. package/dist/collection/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.js +52 -0
  48. package/dist/collection/components/tax-and-cash/sqm-user-info-form/small-views/IndirectTaxDetailsView.js +2 -2
  49. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +18 -5
  50. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +3 -1
  51. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +34 -28
  52. package/dist/collection/components/tax-and-cash/utils.js +30 -27
  53. package/dist/collection/global/styles.js +7 -3
  54. package/dist/collection/global/styles.ts +7 -3
  55. package/dist/{cjs/usePortalRegistrationForm-23ee2d62.js → esm/AsYouType-2d56519e.js} +248 -226
  56. package/dist/esm/{ShadowViewAddon-e115fa1c.js → ShadowViewAddon-543f0fef.js} +4 -4
  57. package/dist/esm/{global-75e96214.js → global-32d00a6e.js} +7 -3
  58. package/dist/esm/loader.js +1 -1
  59. package/dist/esm/mint-components.js +1 -1
  60. package/dist/esm/sqm-banking-info-form_10.entry.js +49 -36
  61. package/dist/esm/sqm-big-stat_47.entry.js +37 -24
  62. package/dist/esm/sqm-code-verification.entry.js +1 -1
  63. package/dist/esm/sqm-email-verification_2.entry.js +6 -9
  64. package/dist/esm/sqm-empty_4.entry.js +1 -1
  65. package/dist/esm/{sqm-lead-checkbox-field-view-bfafee56.js → sqm-lead-checkbox-field-view-aa977b97.js} +1 -1
  66. package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
  67. package/dist/esm/{sqm-lead-input-field-view-b945edf4.js → sqm-lead-input-field-view-671ff96f.js} +1 -1
  68. package/dist/esm/sqm-lead-input-field.entry.js +3 -3
  69. package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
  70. package/dist/esm/sqm-pagination_3.entry.js +1 -1
  71. package/dist/esm/{sqm-partner-info-modal-view-bc843d7d.js → sqm-partner-info-modal-view-8f141a4f.js} +6 -7
  72. package/dist/esm/{sqm-portal-email-verification-view-fde1eb35.js → sqm-portal-email-verification-view-29ca7a13.js} +1 -1
  73. package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
  74. package/dist/esm/sqm-portal-forgot-password_6.entry.js +2 -1
  75. package/dist/esm/{sqm-portal-profile-view-2018590a.js → sqm-portal-profile-view-769aafeb.js} +1 -1
  76. package/dist/esm/sqm-portal-profile.entry.js +2 -2
  77. package/dist/esm/sqm-referral-table_11.entry.js +1 -1
  78. package/dist/esm/sqm-rewards-table_9.entry.js +1 -2
  79. package/dist/esm/sqm-stencilbook.entry.js +69 -12
  80. package/dist/esm/{sqm-user-info-form-view-5322525c.js → sqm-user-info-form-view-ceb3917a.js} +1005 -9
  81. package/dist/esm/subregions-810a5c2d.js +1055 -0
  82. package/dist/esm/{useIndirectTaxForm-a6ac7e7e.js → useIndirectTaxForm-4dc576f0.js} +6 -2
  83. package/dist/esm/{useLeadFormState-332b2796.js → useLeadFormState-6214b2d9.js} +1 -1
  84. package/dist/esm/usePortalRegistrationForm-78fdfd93.js +213 -0
  85. package/dist/esm-es5/AsYouType-2d56519e.js +1 -0
  86. package/dist/esm-es5/{ShadowViewAddon-e115fa1c.js → ShadowViewAddon-543f0fef.js} +1 -1
  87. package/dist/esm-es5/{global-75e96214.js → global-32d00a6e.js} +1 -1
  88. package/dist/esm-es5/loader.js +1 -1
  89. package/dist/esm-es5/mint-components.js +1 -1
  90. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  91. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  92. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  93. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  94. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  95. package/dist/esm-es5/{sqm-lead-checkbox-field-view-bfafee56.js → sqm-lead-checkbox-field-view-aa977b97.js} +1 -1
  96. package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
  97. package/dist/esm-es5/{sqm-lead-input-field-view-b945edf4.js → sqm-lead-input-field-view-671ff96f.js} +1 -1
  98. package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
  99. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  100. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  101. package/dist/esm-es5/{sqm-partner-info-modal-view-bc843d7d.js → sqm-partner-info-modal-view-8f141a4f.js} +1 -1
  102. package/dist/esm-es5/{sqm-portal-email-verification-view-fde1eb35.js → sqm-portal-email-verification-view-29ca7a13.js} +1 -1
  103. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  104. package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
  105. package/dist/esm-es5/{sqm-portal-profile-view-2018590a.js → sqm-portal-profile-view-769aafeb.js} +1 -1
  106. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  107. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  108. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  109. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  110. package/dist/esm-es5/sqm-user-info-form-view-ceb3917a.js +1 -0
  111. package/dist/esm-es5/subregions-810a5c2d.js +1 -0
  112. package/dist/esm-es5/{useIndirectTaxForm-a6ac7e7e.js → useIndirectTaxForm-4dc576f0.js} +2 -2
  113. package/dist/esm-es5/{useLeadFormState-332b2796.js → useLeadFormState-6214b2d9.js} +1 -1
  114. package/dist/esm-es5/usePortalRegistrationForm-78fdfd93.js +1 -0
  115. package/dist/mint-components/global/styles.ts +7 -3
  116. package/dist/mint-components/mint-components.esm.js +1 -1
  117. package/dist/mint-components/mint-components.js +1 -1
  118. package/dist/mint-components/{p-ef32fa8f.entry.js → p-0436b138.entry.js} +1 -1
  119. package/dist/mint-components/{p-24f1d342.system.entry.js → p-058e5447.system.entry.js} +1 -1
  120. package/dist/mint-components/{p-8e148cb0.system.js → p-0607b068.system.js} +1 -1
  121. package/dist/mint-components/{p-2d4132fb.js → p-0ad64881.js} +7 -5
  122. package/dist/mint-components/{p-3354cc75.system.entry.js → p-141c5bdb.system.entry.js} +1 -1
  123. package/dist/mint-components/{p-37e24621.system.entry.js → p-241e7226.system.entry.js} +1 -1
  124. package/dist/mint-components/p-2a2332a6.entry.js +83 -0
  125. package/dist/mint-components/{p-3bbc0db2.entry.js → p-3ada35f5.entry.js} +1 -1
  126. package/dist/mint-components/{p-7d2d9ef9.system.js → p-3e7fb8a7.system.js} +1 -1
  127. package/dist/mint-components/{p-1d398dbc.entry.js → p-4f364438.entry.js} +1 -1
  128. package/dist/mint-components/p-55847fc2.system.entry.js +1 -0
  129. package/dist/mint-components/p-5c3bff99.entry.js +1 -0
  130. package/dist/mint-components/{p-7cbdf341.entry.js → p-5d3d0e0b.entry.js} +2 -2
  131. package/dist/mint-components/{p-b2ad3fca.system.js → p-5fa706cf.system.js} +1 -1
  132. package/dist/mint-components/{p-b3e1f2fa.entry.js → p-61f7bf8a.entry.js} +3 -3
  133. package/dist/mint-components/{p-b3309d9b.entry.js → p-62610658.entry.js} +2 -2
  134. package/dist/mint-components/{p-6ef373ed.system.js → p-6cd93ea3.system.js} +2 -2
  135. package/dist/mint-components/{p-c0f8f977.system.entry.js → p-6e92460d.system.entry.js} +1 -1
  136. package/dist/mint-components/{p-13d8ecad.js → p-6f8a3436.js} +1 -1
  137. package/dist/mint-components/{p-4d73a616.entry.js → p-714bf981.entry.js} +1 -1
  138. package/dist/mint-components/p-765e3379.js +1 -0
  139. package/dist/mint-components/p-76ad156b.entry.js +9 -0
  140. package/dist/mint-components/{p-51ae6716.system.entry.js → p-7727662f.system.entry.js} +1 -1
  141. package/dist/mint-components/{p-4eaa3eb7.js → p-7c0f5891.js} +1 -1
  142. package/dist/mint-components/{p-c0a85e22.js → p-7c482564.js} +1 -1
  143. package/dist/mint-components/{p-2ed13619.entry.js → p-7c657e1f.entry.js} +1 -1
  144. package/dist/mint-components/p-8dcd72fe.system.entry.js +1 -0
  145. package/dist/mint-components/{p-1efb42e2.js → p-92e81c72.js} +3 -3
  146. package/dist/mint-components/p-92f520c9.js +1 -0
  147. package/dist/mint-components/{p-99eecdcb.system.entry.js → p-933bae53.system.entry.js} +1 -1
  148. package/dist/mint-components/{p-c66e5217.system.js → p-989437c5.system.js} +1 -1
  149. package/dist/mint-components/p-990e73ba.system.js +1 -0
  150. package/dist/mint-components/{p-e8e7af06.js → p-9c982f7e.js} +1 -1
  151. package/dist/mint-components/p-a08157c4.js +1 -0
  152. package/dist/mint-components/{p-13e439bc.js → p-a094da68.js} +1 -1
  153. package/dist/mint-components/p-a779e577.js +13 -0
  154. package/dist/mint-components/p-aef2db59.system.js +1 -0
  155. package/dist/mint-components/p-b0d49a64.system.entry.js +1 -0
  156. package/dist/mint-components/{p-0815b973.system.js → p-b111d5d7.system.js} +1 -1
  157. package/dist/mint-components/{p-5bc707cf.entry.js → p-b1536972.entry.js} +23 -23
  158. package/dist/mint-components/{p-b871d158.js → p-b8e46769.js} +1 -1
  159. package/dist/mint-components/{p-1f387c7b.system.js → p-bfb00685.system.js} +1 -1
  160. package/dist/mint-components/{p-7628e56f.system.js → p-c05a4b0c.system.js} +1 -1
  161. package/dist/mint-components/{p-9a15cd5a.system.entry.js → p-c51ea96f.system.entry.js} +1 -1
  162. package/dist/mint-components/p-d463fa82.system.js +1 -0
  163. package/dist/mint-components/p-d47d0862.entry.js +1 -0
  164. package/dist/mint-components/{p-abd717d4.js → p-db45be67.js} +1 -1
  165. package/dist/mint-components/{p-86d20b47.system.entry.js → p-dc196a22.system.entry.js} +1 -1
  166. package/dist/mint-components/{p-432a44de.entry.js → p-e2fb11af.entry.js} +2 -2
  167. package/dist/mint-components/{p-24a867ab.system.js → p-e7f45f18.system.js} +1 -1
  168. package/dist/mint-components/{p-d08408b3.entry.js → p-e87d9982.entry.js} +1 -1
  169. package/dist/mint-components/{p-33ca28ba.system.entry.js → p-ee685659.system.entry.js} +1 -1
  170. package/dist/mint-components/p-ee91aeac.system.js +1 -0
  171. package/dist/mint-components/{p-025ddad2.system.entry.js → p-f194f4e5.system.entry.js} +1 -1
  172. package/dist/mint-components/p-f7218609.system.entry.js +1 -0
  173. package/dist/mint-components/p-fa477f5f.system.entry.js +1 -0
  174. package/dist/mint-components/p-fd231c49.system.js +1 -0
  175. package/dist/types/components/tax-and-cash/phoneExtensions.d.ts +12 -0
  176. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.d.ts +1 -0
  177. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +1 -0
  178. package/dist/types/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.d.ts +1 -0
  179. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +2 -0
  180. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +2 -0
  181. package/dist/types/components/tax-and-cash/utils.d.ts +8 -2
  182. package/docs/docs.docx +0 -0
  183. package/grapesjs/grapesjs.js +1 -1
  184. package/package.json +4 -2
  185. package/dist/cjs/subregions-984e30d7.js +0 -1505
  186. package/dist/esm/subregions-7c9778d0.js +0 -1492
  187. package/dist/esm-es5/sqm-user-info-form-view-5322525c.js +0 -1
  188. package/dist/esm-es5/subregions-7c9778d0.js +0 -1
  189. package/dist/esm-es5/usePortalRegistrationForm-3a1f36a2.js +0 -1
  190. package/dist/mint-components/p-335a5736.entry.js +0 -1
  191. package/dist/mint-components/p-3a41b39c.js +0 -13
  192. package/dist/mint-components/p-5623f1e0.js +0 -1
  193. package/dist/mint-components/p-5fdf0286.system.js +0 -1
  194. package/dist/mint-components/p-6eebbc59.entry.js +0 -83
  195. package/dist/mint-components/p-7f29622d.js +0 -1
  196. package/dist/mint-components/p-8a08cec6.system.entry.js +0 -1
  197. package/dist/mint-components/p-90200f08.system.entry.js +0 -1
  198. package/dist/mint-components/p-a8cfa8fd.entry.js +0 -9
  199. package/dist/mint-components/p-ae2f610e.system.js +0 -1
  200. package/dist/mint-components/p-b7188d47.system.entry.js +0 -1
  201. package/dist/mint-components/p-b9509a55.system.entry.js +0 -1
  202. package/dist/mint-components/p-bd03efe0.system.js +0 -1
  203. package/dist/mint-components/p-c13c20b2.system.js +0 -1
  204. package/dist/mint-components/p-c41d536d.entry.js +0 -1
  205. package/dist/mint-components/p-db6bf7cf.system.entry.js +0 -1
@@ -3,7 +3,7 @@
3
3
  const domContextHooks_module = require('./dom-context-hooks.module-e7b6727c.js');
4
4
  const index_module = require('./index.module-f8c8495f.js');
5
5
  const jsonpointer = require('./jsonpointer-11327262.js');
6
- const subregions = require('./subregions-984e30d7.js');
6
+ const subregions = require('./subregions-3d27e279.js');
7
7
  const data = require('./data-89ac73dd.js');
8
8
  const eventKeys = require('./eventKeys-7af4df4d.js');
9
9
 
@@ -1151,6 +1151,8 @@ const COMPLETE_PARTNER = index_module.dist.gql `
1151
1151
  impactConnection {
1152
1152
  connected
1153
1153
  publisher {
1154
+ phoneNumber
1155
+ phoneNumberCountryCode
1154
1156
  brandedSignup
1155
1157
  requiredTaxDocumentType
1156
1158
  currentTaxDocument {
@@ -1174,7 +1176,7 @@ function getOption(countries, countryCode) {
1174
1176
  }
1175
1177
  }
1176
1178
  function useIndirectTaxForm(props) {
1177
- var _a, _b, _c, _d, _e;
1179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1178
1180
  const user = index_module.J();
1179
1181
  const locale = index_module.L();
1180
1182
  const formRef = domContextHooks_module.useRef(null);
@@ -1359,6 +1361,8 @@ function useIndirectTaxForm(props) {
1359
1361
  disabled: loading || countriesLoading || connectLoading || completeLoading,
1360
1362
  loading: loading || connectLoading || countriesLoading || completeLoading,
1361
1363
  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),
1364
+ isPartnerLegacy: !!((_g = (_f = userData === null || userData === void 0 ? void 0 : userData.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.publisher) &&
1365
+ ((_j = (_h = userData === null || userData === void 0 ? void 0 : userData.user) === null || _h === void 0 ? void 0 : _h.impactConnection) === null || _j === void 0 ? void 0 : _j.connectionStatus) !== "STARTED",
1362
1366
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
1363
1367
  formState: {
1364
1368
  checked: option,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index-8277cbb3.js');
4
- const global = require('./global-b7b1b8fe.js');
4
+ const global = require('./global-258c36b8.js');
5
5
  const domContextHooks_module = require('./dom-context-hooks.module-e7b6727c.js');
6
6
  const index_module = require('./index.module-f8c8495f.js');
7
7
  const JSS = require('./JSS-8503a151.js');
@@ -0,0 +1,215 @@
1
+ 'use strict';
2
+
3
+ const domContextHooks_module = require('./dom-context-hooks.module-e7b6727c.js');
4
+ const index_module = require('./index.module-f8c8495f.js');
5
+ const jsonpointer = require('./jsonpointer-11327262.js');
6
+ const AsYouType = require('./AsYouType-d15caac8.js');
7
+ const useRegistrationFormState = require('./useRegistrationFormState-4fe5b770.js');
8
+
9
+ const RegistrationFormQuery = index_module.dist.gql `
10
+ query RegistrationFormQuery($key: String!) {
11
+ form(key: $key) {
12
+ key
13
+ type
14
+ initialData {
15
+ initialData
16
+ isEnabled
17
+ isEnabledErrorMessage
18
+ }
19
+ }
20
+ }
21
+ `;
22
+ function usePortalRegistrationForm(props) {
23
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
24
+ const formRef = domContextHooks_module.useRef(null);
25
+ const locale = index_module.L();
26
+ const { registrationFormState, setRegistrationFormState } = useRegistrationFormState.useRegistrationFormState({});
27
+ const [request, { loading, errors, data, formError }] = index_module.Oe();
28
+ const queryResponse = index_module.wn(RegistrationFormQuery, { key: props.formKey });
29
+ const formLoading = loading || queryResponse.loading;
30
+ domContextHooks_module.useEffect(() => {
31
+ var _a, _b, _c;
32
+ const initialData = (_a = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.data) === null || _a === void 0 ? void 0 : _a.form.initialData.initialData;
33
+ const disabled = ((_b = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.data) === null || _b === void 0 ? void 0 : _b.form.initialData.isEnabled) === false;
34
+ const disabledMessage = ((_c = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.data) === null || _c === void 0 ? void 0 : _c.form.initialData.isEnabledErrorMessage) ||
35
+ props.formDisabledErrorMessage;
36
+ const formState = {
37
+ loading: formLoading,
38
+ disabled,
39
+ disabledMessage,
40
+ initialData,
41
+ };
42
+ setRegistrationFormState(formState);
43
+ }, [(_a = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.data) === null || _a === void 0 ? void 0 : _a.form.initialData]);
44
+ domContextHooks_module.useEffect(() => {
45
+ if (!formRef.current)
46
+ return;
47
+ const form = formRef.current;
48
+ form.addEventListener("sl-input", inputFunction);
49
+ return () => {
50
+ form.removeEventListener("sl-input", inputFunction);
51
+ };
52
+ }, [formRef.current]);
53
+ const submit = async (event) => {
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
55
+ let formControls = event.target.getFormControls();
56
+ let formData = {};
57
+ let validationErrors = {};
58
+ formControls === null || formControls === void 0 ? void 0 : formControls.forEach((control) => {
59
+ if (!control.name)
60
+ return;
61
+ const key = control.name;
62
+ const value = control.value;
63
+ // control.value = initialData[key] || control.value;
64
+ jsonpointer.jsonpointer.set(formData, key, value);
65
+ // required validation
66
+ if (control.required && !value) {
67
+ jsonpointer.jsonpointer.set(validationErrors, key, props.requiredFieldErrorMessage);
68
+ }
69
+ // custom validation
70
+ if (typeof control.validationError === "function") {
71
+ const validate = control.validationError;
72
+ const validationError = validate({ control, key, value });
73
+ if (validationError)
74
+ jsonpointer.jsonpointer.set(validationErrors, key, validationError);
75
+ }
76
+ });
77
+ if ((props.confirmPassword || formData.confirmPassword) &&
78
+ formData.password !== formData.confirmPassword) {
79
+ validationErrors = {
80
+ ...validationErrors,
81
+ confirmPassword: props.passwordMismatchErrorMessage,
82
+ };
83
+ }
84
+ if (Object.keys(validationErrors).length) {
85
+ // early return for validation errors
86
+ setRegistrationFormState({
87
+ ...registrationFormState,
88
+ loading: false,
89
+ error: "",
90
+ validationErrors,
91
+ });
92
+ return;
93
+ }
94
+ setRegistrationFormState({
95
+ ...registrationFormState,
96
+ loading: true,
97
+ error: "",
98
+ validationErrors: {},
99
+ });
100
+ const { email, password } = formData;
101
+ delete formData.email;
102
+ delete formData.password;
103
+ delete formData.confirmPassword;
104
+ const redirectPath = props.redirectPath;
105
+ const _googleOAuthIdToken = registrationFormState._googleOAuthIdToken;
106
+ const variables = {
107
+ key: props.formKey,
108
+ formData: {
109
+ ...(_googleOAuthIdToken ? { _googleOAuthIdToken } : {}),
110
+ locale,
111
+ email,
112
+ password,
113
+ redirectPath,
114
+ ...formData,
115
+ },
116
+ };
117
+ try {
118
+ const result = await request(variables);
119
+ if (result instanceof Error) {
120
+ throw result;
121
+ }
122
+ setRegistrationFormState({
123
+ ...registrationFormState,
124
+ loading: false,
125
+ error: "",
126
+ validationErrors: {},
127
+ });
128
+ const managedIdentityResponse = (_a = result.submitForm) === null || _a === void 0 ? void 0 : _a.results.find((result) => { var _a; return ((_a = result === null || result === void 0 ? void 0 : result.formHandler) === null || _a === void 0 ? void 0 : _a.namespace) === "identity"; });
129
+ if (managedIdentityResponse &&
130
+ managedIdentityResponse.result.results.length &&
131
+ managedIdentityResponse.result.results[0].success &&
132
+ managedIdentityResponse.result.results[0].data.token) {
133
+ index_module.jn.push(props.nextPage);
134
+ }
135
+ else if (
136
+ // check for blocked email error response
137
+ ((_b = result.submitForm) === null || _b === void 0 ? void 0 : _b.results.length) === 1 &&
138
+ ((_f = (_e = (_d = (_c = result.submitForm) === null || _c === void 0 ? void 0 : _c.results[0]) === null || _d === void 0 ? void 0 : _d.result) === null || _e === void 0 ? void 0 : _e.results) === null || _f === void 0 ? void 0 : _f.length) === 1 &&
139
+ ((_l = (_k = (_j = (_h = (_g = result.submitForm) === null || _g === void 0 ? void 0 : _g.results[0]) === null || _h === void 0 ? void 0 : _h.result) === null || _j === void 0 ? void 0 : _j.results) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.success) ===
140
+ false && ((_s = (_r = (_q = (_p = (_o = (_m = result.submitForm) === null || _m === void 0 ? void 0 : _m.results[0]) === null || _o === void 0 ? void 0 : _o.result) === null || _p === void 0 ? void 0 : _p.results) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.message) === null || _s === void 0 ? void 0 : _s.startsWith("Blocked email"))) {
141
+ setRegistrationFormState({
142
+ ...registrationFormState,
143
+ loading: false,
144
+ error: "",
145
+ validationErrors: {
146
+ email: props.invalidEmailErrorMessage,
147
+ },
148
+ });
149
+ }
150
+ }
151
+ catch (error) {
152
+ // check for invalid email
153
+ if ((_t = error === null || error === void 0 ? void 0 : error.message) === null || _t === void 0 ? void 0 : _t.includes("is not a valid email address")) {
154
+ setRegistrationFormState({
155
+ ...registrationFormState,
156
+ loading: false,
157
+ error: "",
158
+ validationErrors: { email: props.invalidEmailErrorMessage },
159
+ });
160
+ }
161
+ else {
162
+ setRegistrationFormState({
163
+ ...registrationFormState,
164
+ loading: false,
165
+ error: props.networkErrorMessage,
166
+ validationErrors: {},
167
+ });
168
+ }
169
+ }
170
+ };
171
+ const inputFunction = index_module.useCallback((e) => {
172
+ var _a, _b;
173
+ const name = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.toLowerCase();
174
+ if (name !== "tel")
175
+ return;
176
+ const asYouType = new AsYouType.AsYouType("US");
177
+ e.target.value = asYouType.input(e.target.value);
178
+ }, []);
179
+ let errorMessage = "";
180
+ if (((_b = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.data) === null || _b === void 0 ? void 0 : _b.form.initialData.isEnabled) === false) {
181
+ errorMessage =
182
+ ((_c = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.data) === null || _c === void 0 ? void 0 : _c.form.initialData.isEnabledErrorMessage) ||
183
+ props.formDisabledErrorMessage;
184
+ }
185
+ else if ((_d = errors === null || errors === void 0 ? void 0 : errors.response) === null || _d === void 0 ? void 0 : _d["error"]) {
186
+ errorMessage = props.networkErrorMessage;
187
+ }
188
+ else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_e = errors === null || errors === void 0 ? void 0 : errors.response) === null || _e === void 0 ? void 0 : _e.errors.length)) {
189
+ errorMessage = props.networkErrorMessage;
190
+ }
191
+ else {
192
+ errorMessage =
193
+ formError || ((_j = (_h = (_g = (_f = queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.errors) === null || _f === void 0 ? void 0 : _f.response) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.message) || (registrationFormState === null || registrationFormState === void 0 ? void 0 : registrationFormState.error);
194
+ }
195
+ return {
196
+ states: {
197
+ loading: loading || queryResponse.loading,
198
+ error: errorMessage,
199
+ registrationFormState,
200
+ confirmPassword: props.confirmPassword,
201
+ hideInputs: props.hideInputs,
202
+ loginPath: props.loginPath,
203
+ enablePasswordValidation: !props.disablePasswordValidation,
204
+ },
205
+ callbacks: {
206
+ submit,
207
+ inputFunction,
208
+ },
209
+ refs: {
210
+ formRef,
211
+ },
212
+ };
213
+ }
214
+
215
+ exports.usePortalRegistrationForm = usePortalRegistrationForm;
@@ -26,7 +26,7 @@ const vanillaStyle = `
26
26
  }
27
27
  sl-select::part(label){
28
28
  font-size: var(--sl-input-label-font-size-small);
29
- font-weight: var(--sl-font-weight-semibold);
29
+ font-weight: var(--sl-font-weight-bold);
30
30
  }
31
31
  `;
32
32
  jss.setup(preset());
@@ -26,7 +26,7 @@ const vanillaStyle = `
26
26
  }
27
27
  sl-select::part(label){
28
28
  font-size: var(--sl-input-label-font-size-small);
29
- font-weight: var(--sl-font-weight-semibold);
29
+ font-weight: var(--sl-font-weight-bold);
30
30
  }
31
31
  sl-select::part(menu){
32
32
  max-height: 300px;
@@ -18,7 +18,7 @@ const vanillaStyle = `
18
18
 
19
19
  *::part(input-label), *::part(select-label), *::part(textarea-label){
20
20
  font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
21
- font-weight: var(--sl-font-weight-semibold);
21
+ font-weight: var(--sl-font-weight-bold);
22
22
  color: var(--sqm-input-label-color, var(--sqm-text), black);
23
23
  }
24
24
 
@@ -52,8 +52,8 @@ const defaultProps = {
52
52
  loading: false,
53
53
  submitting: false,
54
54
  isExistingPartner: false,
55
- countryCode: null,
56
- currency: null,
55
+ countryCode: "",
56
+ currency: "",
57
57
  error: "",
58
58
  success: false,
59
59
  filteredCountries: demoCountries,
@@ -128,13 +128,14 @@ export function PartnerInfoModalView(props) {
128
128
  const styleString = sheet.toString();
129
129
  if (!states.open)
130
130
  return h("div", null);
131
+ const modalHeader = states.isExistingPartner
132
+ ? text.modalHeaderExistingPartner
133
+ : text.modalHeader;
131
134
  return (h("div", null,
132
135
  h("style", { type: "text/css" },
133
136
  " ",
134
137
  styleString),
135
- h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: true, label: states.isExistingPartner
136
- ? text.modalHeaderExistingPartner
137
- : text.modalHeader, "onSl-request-close": (e) => {
138
+ h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: true, label: modalHeader, "onSl-request-close": (e) => {
138
139
  e.preventDefault();
139
140
  }, "onSl-hide": (e) => {
140
141
  var _a;
@@ -142,8 +143,6 @@ export function PartnerInfoModalView(props) {
142
143
  e.preventDefault();
143
144
  }
144
145
  }, "onSl-initial-focus": callbacks.onInitialFocus },
145
- h("h2", { class: sheet.classes.DialogTitle }, states.isExistingPartner
146
- ? text.modalHeaderExistingPartner
147
- : text.modalHeader),
146
+ h("h2", { class: sheet.classes.DialogTitle }, modalHeader),
148
147
  h(PartnerInfoModalContentView, Object.assign({}, props)))));
149
148
  }
@@ -83,7 +83,8 @@ export function usePartnerInfoModal(props) {
83
83
  const { data: currenciesData, loading: currenciesLoading } = useQuery(GET_CURRENCIES, { variables: { locale } });
84
84
  const { data: countriesData, loading: countriesLoading } = useQuery(GET_COUNTRIES, {});
85
85
  // No pre-filled country, use locale to determine countryCode instead
86
- 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(/^.*_/, ""));
86
+ 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) ||
87
+ locale.replace(/^.*_/, ""));
87
88
  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) || "");
88
89
  const { data: financeNetworkData } = useQuery(GET_FINANCE_NETWORK_SETTINGS, {
89
90
  variables: { filter: countryCode ? { countryCode_eq: countryCode } : {} },
@@ -182,11 +183,7 @@ export function usePartnerInfoModal(props) {
182
183
  }
183
184
  async function onSubmit() {
184
185
  var _a, _b;
185
- if (!allowBankingCollection) {
186
- setError(props.missingFieldsErrorText);
187
- return;
188
- }
189
- if (!countryCode || !currency) {
186
+ if (!allowBankingCollection || !countryCode || !currency) {
190
187
  setError(props.missingFieldsErrorText);
191
188
  return;
192
189
  }
@@ -90,7 +90,6 @@ export class RewardTableStatusCell {
90
90
  if (fraudStatus === "PENDING")
91
91
  return "PENDING_REVIEW";
92
92
  const isCashReward = reward.rewardedCash;
93
- console.log(this.reward, "reward in status cell");
94
93
  // pft can now be created before withdrawal settings exist
95
94
  if (isCashReward) {
96
95
  if (!((_e = this.taxConnection) === null || _e === void 0 ? void 0 : _e.connected) ||
@@ -96,7 +96,7 @@ sl-button[type="secondary"]::part(base):hover {
96
96
  *::part(input-label), *::part(select-label), *::part(textarea-label){
97
97
  font-family: var(--sqm-primary-font);
98
98
  font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
99
- font-weight: var(--sl-font-weight-semibold);
99
+ font-weight: var(--sl-font-weight-bold);
100
100
  color: var(--sqm-input-label-color, var(--sqm-text), black);
101
101
  }
102
102
 
@@ -75,9 +75,11 @@ export function useWidgetVerification() {
75
75
  };
76
76
  const onPartnerModalComplete = () => {
77
77
  setShowPartnerModal(false);
78
+ // Reset the latch so a later partner creation can re-trigger this effect
78
79
  setPartnerCreated(false);
79
80
  setContext(true);
80
81
  };
82
+ // The modal signals completion by flipping partnerCreated; advance the flow here
81
83
  useEffect(() => {
82
84
  if (partnerCreated)
83
85
  onPartnerModalComplete();
@@ -14,6 +14,8 @@ const stepOneProps = {
14
14
  disabled: false,
15
15
  isPartner: false,
16
16
  isUser: false,
17
+ isPartnerLegacy: false,
18
+ isUserLegacy: false,
17
19
  loadingError: false,
18
20
  formState: {
19
21
  firstName: "Bob",
@@ -134,6 +136,7 @@ const stepTwoProps = {
134
136
  disabled: false,
135
137
  loading: false,
136
138
  isPartner: false,
139
+ isPartnerLegacy: false,
137
140
  loadingError: false,
138
141
  formState: {
139
142
  checked: undefined,
@@ -219,6 +219,10 @@ export const PHONE_EXTENSIONS = {
219
219
  name: "Cuba",
220
220
  dial_code: "+53",
221
221
  },
222
+ CW: {
223
+ name: "Curaçao",
224
+ dial_code: "+599",
225
+ },
222
226
  CY: {
223
227
  name: "Cyprus",
224
228
  dial_code: "+357",
@@ -299,6 +303,10 @@ export const PHONE_EXTENSIONS = {
299
303
  name: "French Polynesia",
300
304
  dial_code: "+689",
301
305
  },
306
+ TF: {
307
+ name: "French Southern Territories",
308
+ dial_code: "+262",
309
+ },
302
310
  GA: {
303
311
  name: "Gabon",
304
312
  dial_code: "+241",
@@ -955,6 +963,10 @@ export const PHONE_EXTENSIONS = {
955
963
  name: "Wallis and Futuna",
956
964
  dial_code: "+681",
957
965
  },
966
+ EH: {
967
+ name: "Western Sahara",
968
+ dial_code: "+212",
969
+ },
958
970
  YE: {
959
971
  name: "Yemen",
960
972
  dial_code: "+967",
@@ -33,10 +33,10 @@ const API_FIELD_TO_FORM_FIELD = {
33
33
  bankProvinceState: "bankState",
34
34
  };
35
35
  /**
36
- * Maps Impact API error code paths (from validationErrors[].errorPath) to short,
36
+ * Maps Impact API error codes (from validationErrors[].code) to short,
37
37
  * readable frontend error codes used in the ICU select props.
38
38
  */
39
- const API_ERROR_PATH_TO_FRONTEND = {
39
+ const API_ERROR_CODE_TO_FRONTEND = {
40
40
  // Beneficiary account name
41
41
  "withdrawal.settings.error.empty_beneficiaryname": "empty",
42
42
  "withdrawal.settings.error.invalid_character_beneficiaryname": "invalidCharacters",
@@ -327,7 +327,7 @@ export function useBankingInfoForm(props) {
327
327
  console.error("Validation failed: ", validationErrors);
328
328
  const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
329
329
  const formField = API_FIELD_TO_FORM_FIELD[error.field] || error.field;
330
- const errorCode = API_ERROR_PATH_TO_FRONTEND[error.errorPath] || error.errorPath;
330
+ const errorCode = API_ERROR_CODE_TO_FRONTEND[error.code] || error.code;
331
331
  return {
332
332
  ...agg,
333
333
  [formField]: {
@@ -157,7 +157,7 @@ export const IndirectTaxFormView = (props) => {
157
157
  }, {
158
158
  supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
159
159
  }))),
160
- states.isPartner && (h("sqm-form-message", { loading: states.loading, type: "info" },
160
+ states.isPartnerLegacy && (h("sqm-form-message", { loading: states.loading, type: "info" },
161
161
  h("p", { part: "alert-title" }, text.isPartnerAlertHeader),
162
162
  intl.formatMessage({
163
163
  id: "isPartnerAlertDescription",
@@ -170,11 +170,11 @@ export const IndirectTaxFormView = (props) => {
170
170
  states.loading ? (h("sl-spinner", { style: { fontSize: "50px", margin: "40px" } })) : (h("div", null,
171
171
  h("div", { class: classes.RadioContainer },
172
172
  h("div", { class: classes.InnerRadioContainer },
173
- h("sl-radio", { exportparts: "base: radio-base", name: "/checked", value: "notRegistered", id: "notRegistered", checked: formState.checked === "notRegistered", onInput: () => callbacks.onChange("notRegistered"), disabled: states.disabled || states.isPartner },
173
+ h("sl-radio", { exportparts: "base: radio-base", name: "/checked", value: "notRegistered", id: "notRegistered", checked: formState.checked === "notRegistered", onInput: () => callbacks.onChange("notRegistered"), disabled: states.disabled },
174
174
  h("div", { class: classes.RadioContent },
175
175
  text.notRegistered,
176
176
  h("p", { class: classes.DescriptionText }, text.notRegisteredSubtext))),
177
- h("sl-radio", { exportparts: "base: radio-base", name: "/checked", value: "otherRegion", id: "otherRegion", checked: formState.checked === "otherRegion", onInput: () => callbacks.onChange("otherRegion"), disabled: states.disabled || states.isPartner },
177
+ h("sl-radio", { exportparts: "base: radio-base", name: "/checked", value: "otherRegion", id: "otherRegion", checked: formState.checked === "otherRegion", onInput: () => callbacks.onChange("otherRegion"), disabled: states.disabled },
178
178
  h("div", { class: classes.RadioContent },
179
179
  text.otherRegion,
180
180
  h("p", { class: classes.DescriptionText }, text.otherRegionSubtext))),
@@ -201,7 +201,7 @@ export class IndirectTaxForm {
201
201
  : useIndirectTaxForm(this);
202
202
  const registeredInDifferentCountryDetailsSlot = (h(OtherRegionSlotView, { states: {
203
203
  hide: props.states.formState.checked !== "otherRegion",
204
- disabled: props.states.disabled || props.states.isPartner,
204
+ disabled: props.states.disabled,
205
205
  formState: props.slotProps.formState,
206
206
  loading: props.states.loading,
207
207
  isPartner: props.states.isPartner,
@@ -887,7 +887,7 @@ export class IndirectTaxForm {
887
887
  "mutable": false,
888
888
  "complexType": {
889
889
  "original": "DemoData<UseIndirectTaxFormResult>",
890
- "resolved": "{ states?: { step: string; hideSteps: boolean; disabled: boolean; loading: boolean; isPartner: boolean; loadingError: boolean; formState: { checked: \"hstCanada\" | \"otherRegion\" | \"notRegistered\"; errors: {}; }; }; refs?: { formRef: Ref<HTMLFormElement>; }; data?: { esRegions: { regionCode: string; taxType: string; displayName: string; }[]; countries: { countryCode: string; displayName: any; }[]; allCountries: { countryCode: string; displayName: any; }[]; provinces: { regionCode: string; taxType: string; displayName: string; }[]; }; slotProps?: { formState: { selectedRegion?: string; subRegion?: string; subRegionTaxNumber?: string; qstNumber?: string; province?: string; indirectTaxNumber?: string; hasQst?: boolean; hasSubRegionTaxNumber?: boolean; errors?: any; error?: string; }; }; }",
890
+ "resolved": "{ states?: { step: string; hideSteps: boolean; disabled: boolean; loading: boolean; isPartner: boolean; isPartnerLegacy: boolean; loadingError: boolean; formState: { checked: \"hstCanada\" | \"otherRegion\" | \"notRegistered\"; errors: {}; }; }; refs?: { formRef: Ref<HTMLFormElement>; }; data?: { esRegions: { regionCode: string; taxType: string; displayName: string; }[]; countries: { countryCode: string; displayName: any; }[]; allCountries: { countryCode: string; displayName: any; }[]; provinces: { regionCode: string; taxType: string; displayName: string; }[]; }; slotProps?: { formState: { selectedRegion?: string; subRegion?: string; subRegionTaxNumber?: string; qstNumber?: string; province?: string; indirectTaxNumber?: string; hasQst?: boolean; hasSubRegionTaxNumber?: boolean; errors?: any; error?: string; }; }; }",
891
891
  "references": {
892
892
  "DemoData": {
893
893
  "location": "import",
@@ -921,6 +921,7 @@ function useDemoIndirectTaxForm(props) {
921
921
  disabled: false,
922
922
  loading: false,
923
923
  isPartner: false,
924
+ isPartnerLegacy: false,
924
925
  loadingError: false,
925
926
  errors: {},
926
927
  formState: {
@@ -46,6 +46,8 @@ export const COMPLETE_PARTNER = gql `
46
46
  impactConnection {
47
47
  connected
48
48
  publisher {
49
+ phoneNumber
50
+ phoneNumberCountryCode
49
51
  brandedSignup
50
52
  requiredTaxDocumentType
51
53
  currentTaxDocument {
@@ -69,7 +71,7 @@ function getOption(countries, countryCode) {
69
71
  }
70
72
  }
71
73
  export function useIndirectTaxForm(props) {
72
- var _a, _b, _c, _d, _e;
74
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
73
75
  const user = useUserIdentity();
74
76
  const locale = useLocale();
75
77
  const formRef = useRef(null);
@@ -254,6 +256,8 @@ export function useIndirectTaxForm(props) {
254
256
  disabled: loading || countriesLoading || connectLoading || completeLoading,
255
257
  loading: loading || connectLoading || countriesLoading || completeLoading,
256
258
  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),
259
+ isPartnerLegacy: !!((_g = (_f = userData === null || userData === void 0 ? void 0 : userData.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.publisher) &&
260
+ ((_j = (_h = userData === null || userData === void 0 ? void 0 : userData.user) === null || _h === void 0 ? void 0 : _h.impactConnection) === null || _j === void 0 ? void 0 : _j.connectionStatus) !== "STARTED",
257
261
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
258
262
  formState: {
259
263
  checked: option,
@@ -1,6 +1,6 @@
1
1
  import { getContextValueName, useHost, useLocale, useMutation, useParentQuery, useParentState, useUserIdentity, } from "@saasquatch/component-boilerplate";
2
2
  import { useEffect, useMemo } from "@saasquatch/universal-hooks";
3
- import { getCountryObj } from "../utils";
3
+ import { getCountryObj, isValidI18nPhoneNumber } from "../utils";
4
4
  import { COUNTRIES_NAMESPACE, COUNTRIES_QUERY_NAMESPACE, CURRENCIES_NAMESPACE, CURRENCIES_QUERY_NAMESPACE, FINANCE_NETWORK_SETTINGS_NAMESPACE, GET_COUNTRIES, GET_CURRENCIES, GET_FINANCE_NETWORK_SETTINGS, GET_USER, SORTED_COUNTRIES_NAMESPACE, TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../data";
5
5
  import { COMPLETE_PARTNER, } from "../sqm-indirect-tax-form/useIndirectTaxForm";
6
6
  function getCurrentStep(user) {
@@ -8,15 +8,19 @@ function getCurrentStep(user) {
8
8
  if (!((_a = user.impactConnection) === null || _a === void 0 ? void 0 : _a.connected) || !((_b = user.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher)) {
9
9
  return "/1";
10
10
  }
11
- const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, billingAddress, billingCity, billingCountryCode, billingPostalCode, billingState, phoneNumber, phoneNumberCountryCode, } = user.impactConnection.publisher;
12
- const hasBillingInfo = billingAddress &&
13
- billingCity &&
14
- billingCountryCode &&
15
- billingPostalCode &&
16
- phoneNumberCountryCode &&
17
- phoneNumber;
18
- if (!hasBillingInfo) {
19
- return "/1";
11
+ const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, billingAddress, billingCity, billingCountryCode, billingPostalCode, phoneNumber, phoneNumberCountryCode, } = user.impactConnection.publisher;
12
+ const isCompleted = user.impactConnection.connectionStatus === "COMPLETED";
13
+ if (!isCompleted) {
14
+ const hasBillingInfo = billingAddress &&
15
+ billingCity &&
16
+ billingCountryCode &&
17
+ billingPostalCode &&
18
+ phoneNumberCountryCode &&
19
+ phoneNumber &&
20
+ isValidI18nPhoneNumber(phoneNumberCountryCode, phoneNumber);
21
+ if (!hasBillingInfo) {
22
+ return "/1";
23
+ }
20
24
  }
21
25
  // If they do have a required document, look at current document
22
26
  if (requiredTaxDocumentType && !currentTaxDocument) {
@@ -35,7 +39,7 @@ export function useTaxAndCash() {
35
39
  const host = useHost();
36
40
  const user = useUserIdentity();
37
41
  const locale = useLocale();
38
- const [completeImpactPartner, { loading: completeLoading }] = useMutation(COMPLETE_PARTNER);
42
+ const [completeImpactPartner] = useMutation(COMPLETE_PARTNER);
39
43
  // State for current step of form
40
44
  const [step, setStep] = useParentState({
41
45
  namespace: TAX_CONTEXT_NAMESPACE,
@@ -143,7 +147,6 @@ export function useTaxAndCash() {
143
147
  setCurrenciesContext(supportedCurrencies);
144
148
  }, [supportedCurrencies]);
145
149
  useEffect(() => {
146
- var _a;
147
150
  if (errors) {
148
151
  setStep("/error");
149
152
  return;
@@ -158,7 +161,8 @@ export function useTaxAndCash() {
158
161
  publisher.billingCountryCode &&
159
162
  publisher.billingPostalCode &&
160
163
  publisher.phoneNumberCountryCode &&
161
- publisher.phoneNumber;
164
+ publisher.phoneNumber &&
165
+ isValidI18nPhoneNumber(publisher.phoneNumberCountryCode, publisher.phoneNumber);
162
166
  if (hasBillingInfo &&
163
167
  ((_b = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _b === void 0 ? void 0 : _b.connectionStatus) === "STARTED") {
164
168
  const vars = {
@@ -186,13 +190,19 @@ export function useTaxAndCash() {
186
190
  const user = data === null || data === void 0 ? void 0 : data.user;
187
191
  if (!user || step !== "/loading")
188
192
  return;
189
- if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
190
- (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
191
- completeConnection(user);
192
- refetch();
193
+ async function routeAfterMaybeCompleting() {
194
+ var _a;
195
+ if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
196
+ (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
197
+ // Finish the early-created connection before routing so the next
198
+ // step sees the completed status
199
+ await completeConnection(user);
200
+ await refetch();
201
+ }
202
+ const currentStep = getCurrentStep(user);
203
+ setStep(currentStep);
193
204
  }
194
- const currentStep = getCurrentStep(user);
195
- setStep(currentStep);
205
+ routeAfterMaybeCompleting();
196
206
  }
197
207
  }, [host, user, (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.email, errors]);
198
208
  function getFinanceNetworkFilter() {