@saasquatch/mint-components 2.3.0-13 → 2.3.0-14

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 (37) hide show
  1. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +6 -4
  2. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +14 -7
  3. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +4 -7
  4. package/dist/cjs/{sqm-partner-info-modal-view-2b6fee0f.js → sqm-partner-info-modal-view-b0e8044f.js} +5 -6
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
  6. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +5 -6
  7. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +3 -6
  8. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +2 -0
  9. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +3 -3
  10. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +12 -7
  11. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +3 -1
  12. package/dist/esm/sqm-banking-info-form_10.entry.js +6 -4
  13. package/dist/esm/sqm-big-stat_47.entry.js +14 -7
  14. package/dist/esm/sqm-email-verification_2.entry.js +4 -7
  15. package/dist/esm/{sqm-partner-info-modal-view-bc843d7d.js → sqm-partner-info-modal-view-6b9c512f.js} +5 -6
  16. package/dist/esm/sqm-stencilbook.entry.js +1 -1
  17. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  18. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  19. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  20. package/dist/esm-es5/{sqm-partner-info-modal-view-bc843d7d.js → sqm-partner-info-modal-view-6b9c512f.js} +1 -1
  21. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  22. package/dist/mint-components/mint-components.esm.js +1 -1
  23. package/dist/mint-components/{p-af8b8c06.system.entry.js → p-1e6b92d0.system.entry.js} +1 -1
  24. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  25. package/dist/mint-components/{p-b3f25c0e.entry.js → p-3970cbf5.entry.js} +1 -1
  26. package/dist/mint-components/{p-24a867ab.system.js → p-3caa6a0e.system.js} +1 -1
  27. package/dist/mint-components/{p-dd5c1db9.entry.js → p-4b449def.entry.js} +1 -1
  28. package/dist/mint-components/{p-4065ae93.entry.js → p-6afa9d3a.entry.js} +1 -1
  29. package/dist/mint-components/p-6b1c9506.system.entry.js +1 -0
  30. package/dist/mint-components/{p-13e439bc.js → p-8ab30adc.js} +1 -1
  31. package/dist/mint-components/p-9c4a5b43.system.entry.js +1 -0
  32. package/dist/mint-components/{p-c31966e3.system.entry.js → p-b617ffe0.system.entry.js} +1 -1
  33. package/dist/mint-components/{p-b3e1f2fa.entry.js → p-ff476ab5.entry.js} +2 -2
  34. package/docs/docs.docx +0 -0
  35. package/package.json +3 -1
  36. package/dist/mint-components/p-6fd8981d.system.entry.js +0 -1
  37. package/dist/mint-components/p-b7188d47.system.entry.js +0 -1
@@ -870,10 +870,10 @@ const API_FIELD_TO_FORM_FIELD = {
870
870
  bankProvinceState: "bankState",
871
871
  };
872
872
  /**
873
- * Maps Impact API error code paths (from validationErrors[].errorPath) to short,
873
+ * Maps Impact API error codes (from validationErrors[].code) to short,
874
874
  * readable frontend error codes used in the ICU select props.
875
875
  */
876
- const API_ERROR_PATH_TO_FRONTEND = {
876
+ const API_ERROR_CODE_TO_FRONTEND = {
877
877
  // Beneficiary account name
878
878
  "withdrawal.settings.error.empty_beneficiaryname": "empty",
879
879
  "withdrawal.settings.error.invalid_character_beneficiaryname": "invalidCharacters",
@@ -1164,7 +1164,7 @@ function useBankingInfoForm(props) {
1164
1164
  console.error("Validation failed: ", validationErrors);
1165
1165
  const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
1166
1166
  const formField = API_FIELD_TO_FORM_FIELD[error.field] || error.field;
1167
- const errorCode = API_ERROR_PATH_TO_FRONTEND[error.errorPath] || error.errorPath;
1167
+ const errorCode = API_ERROR_CODE_TO_FRONTEND[error.code] || error.code;
1168
1168
  return {
1169
1169
  ...agg,
1170
1170
  [formField]: {
@@ -4551,7 +4551,9 @@ function useUserInfoForm(props) {
4551
4551
  setFilteredPhoneCountries(countries || []);
4552
4552
  }
4553
4553
  else {
4554
- setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
4554
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName
4555
+ .toLowerCase()
4556
+ .includes(phoneCountrySearch.toLowerCase())) || []);
4555
4557
  }
4556
4558
  }, [phoneCountrySearch, countries]);
4557
4559
  domContextHooks_module.useEffect(() => {
@@ -6801,7 +6801,6 @@ function useTaxAndCash() {
6801
6801
  setCurrenciesContext(supportedCurrencies);
6802
6802
  }, [supportedCurrencies]);
6803
6803
  domContextHooks_module.useEffect(() => {
6804
- var _a;
6805
6804
  if (errors) {
6806
6805
  setStep("/error");
6807
6806
  return;
@@ -6845,13 +6844,19 @@ function useTaxAndCash() {
6845
6844
  const user = data$1 === null || data$1 === void 0 ? void 0 : data$1.user;
6846
6845
  if (!user || step !== "/loading")
6847
6846
  return;
6848
- if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
6849
- (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
6850
- completeConnection(user);
6851
- refetch();
6847
+ async function routeAfterMaybeCompleting() {
6848
+ var _a;
6849
+ if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
6850
+ (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
6851
+ // Finish the early-created connection before routing so the next
6852
+ // step sees the completed status
6853
+ await completeConnection(user);
6854
+ await refetch();
6855
+ }
6856
+ const currentStep = getCurrentStep(user);
6857
+ setStep(currentStep);
6852
6858
  }
6853
- const currentStep = getCurrentStep(user);
6854
- setStep(currentStep);
6859
+ routeAfterMaybeCompleting();
6855
6860
  }
6856
6861
  }, [host, user, (_e = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _e === void 0 ? void 0 : _e.email, errors]);
6857
6862
  function getFinanceNetworkFilter() {
@@ -8396,9 +8401,11 @@ function useWidgetVerification() {
8396
8401
  };
8397
8402
  const onPartnerModalComplete = () => {
8398
8403
  setShowPartnerModal(false);
8404
+ // Reset the latch so a later partner creation can re-trigger this effect
8399
8405
  setPartnerCreated(false);
8400
8406
  setContext(true);
8401
8407
  };
8408
+ // The modal signals completion by flipping partnerCreated; advance the flow here
8402
8409
  domContextHooks_module.useEffect(() => {
8403
8410
  if (partnerCreated)
8404
8411
  onPartnerModalComplete();
@@ -11,7 +11,7 @@ const utils = require('./utils-6847bc06.js');
11
11
  const JSS = require('./JSS-8503a151.js');
12
12
  const sqmTextSpanView = require('./sqm-text-span-view-b9e10f5d.js');
13
13
  const data = require('./data-89ac73dd.js');
14
- const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-2b6fee0f.js');
14
+ const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-b0e8044f.js');
15
15
  const keys = require('./keys-5a2c9ed2.js');
16
16
  const eventKeys = require('./eventKeys-7af4df4d.js');
17
17
  const parseStates = require('./parseStates-d1effc19.js');
@@ -506,7 +506,8 @@ function usePartnerInfoModal(props) {
506
506
  const { data: currenciesData, loading: currenciesLoading } = index_module.wn(GET_CURRENCIES, { variables: { locale } });
507
507
  const { data: countriesData, loading: countriesLoading } = index_module.wn(GET_COUNTRIES, {});
508
508
  // No pre-filled country, use locale to determine countryCode instead
509
- const [countryCode, setCountryCode] = domContextHooks_module.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(/^.*_/, ""));
509
+ const [countryCode, setCountryCode] = domContextHooks_module.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) ||
510
+ locale.replace(/^.*_/, ""));
510
511
  const [currency, setCurrency] = domContextHooks_module.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) || "");
511
512
  const { data: financeNetworkData } = index_module.wn(data.GET_FINANCE_NETWORK_SETTINGS, {
512
513
  variables: { filter: countryCode ? { countryCode_eq: countryCode } : {} },
@@ -605,11 +606,7 @@ function usePartnerInfoModal(props) {
605
606
  }
606
607
  async function onSubmit() {
607
608
  var _a, _b;
608
- if (!allowBankingCollection) {
609
- setError(props.missingFieldsErrorText);
610
- return;
611
- }
612
- if (!countryCode || !currency) {
609
+ if (!allowBankingCollection || !countryCode || !currency) {
613
610
  setError(props.missingFieldsErrorText);
614
611
  return;
615
612
  }
@@ -131,13 +131,14 @@ function PartnerInfoModalView(props) {
131
131
  const styleString = sheet.toString();
132
132
  if (!states.open)
133
133
  return index.h("div", null);
134
+ const modalHeader = states.isExistingPartner
135
+ ? text.modalHeaderExistingPartner
136
+ : text.modalHeader;
134
137
  return (index.h("div", null,
135
138
  index.h("style", { type: "text/css" },
136
139
  " ",
137
140
  styleString),
138
- index.h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: true, label: states.isExistingPartner
139
- ? text.modalHeaderExistingPartner
140
- : text.modalHeader, "onSl-request-close": (e) => {
141
+ index.h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: true, label: modalHeader, "onSl-request-close": (e) => {
141
142
  e.preventDefault();
142
143
  }, "onSl-hide": (e) => {
143
144
  var _a;
@@ -145,9 +146,7 @@ function PartnerInfoModalView(props) {
145
146
  e.preventDefault();
146
147
  }
147
148
  }, "onSl-initial-focus": callbacks.onInitialFocus },
148
- index.h("h2", { class: sheet.classes.DialogTitle }, states.isExistingPartner
149
- ? text.modalHeaderExistingPartner
150
- : text.modalHeader),
149
+ index.h("h2", { class: sheet.classes.DialogTitle }, modalHeader),
151
150
  index.h(PartnerInfoModalContentView, Object.assign({}, props)))));
152
151
  }
153
152
 
@@ -40,7 +40,7 @@ const sqmPortalContainerView = require('./sqm-portal-container-view-757f921b.js'
40
40
  const sqmUserInfoFormView = require('./sqm-user-info-form-view-60e09262.js');
41
41
  const sqmLeadInputFieldView = require('./sqm-lead-input-field-view-0cd7ebdb.js');
42
42
  require('./data-89ac73dd.js');
43
- const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-2b6fee0f.js');
43
+ const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-b0e8044f.js');
44
44
 
45
45
  /**
46
46
  * lodash (Custom Build) <https://lodash.com/>
@@ -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
  }
@@ -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();
@@ -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]: {
@@ -147,7 +147,6 @@ export function useTaxAndCash() {
147
147
  setCurrenciesContext(supportedCurrencies);
148
148
  }, [supportedCurrencies]);
149
149
  useEffect(() => {
150
- var _a;
151
150
  if (errors) {
152
151
  setStep("/error");
153
152
  return;
@@ -191,13 +190,19 @@ export function useTaxAndCash() {
191
190
  const user = data === null || data === void 0 ? void 0 : data.user;
192
191
  if (!user || step !== "/loading")
193
192
  return;
194
- if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
195
- (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
196
- completeConnection(user);
197
- 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);
198
204
  }
199
- const currentStep = getCurrentStep(user);
200
- setStep(currentStep);
205
+ routeAfterMaybeCompleting();
201
206
  }
202
207
  }, [host, user, (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.email, errors]);
203
208
  function getFinanceNetworkFilter() {
@@ -122,7 +122,9 @@ export function useUserInfoForm(props) {
122
122
  setFilteredPhoneCountries(countries || []);
123
123
  }
124
124
  else {
125
- setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
125
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName
126
+ .toLowerCase()
127
+ .includes(phoneCountrySearch.toLowerCase())) || []);
126
128
  }
127
129
  }, [phoneCountrySearch, countries]);
128
130
  useEffect(() => {
@@ -866,10 +866,10 @@ const API_FIELD_TO_FORM_FIELD = {
866
866
  bankProvinceState: "bankState",
867
867
  };
868
868
  /**
869
- * Maps Impact API error code paths (from validationErrors[].errorPath) to short,
869
+ * Maps Impact API error codes (from validationErrors[].code) to short,
870
870
  * readable frontend error codes used in the ICU select props.
871
871
  */
872
- const API_ERROR_PATH_TO_FRONTEND = {
872
+ const API_ERROR_CODE_TO_FRONTEND = {
873
873
  // Beneficiary account name
874
874
  "withdrawal.settings.error.empty_beneficiaryname": "empty",
875
875
  "withdrawal.settings.error.invalid_character_beneficiaryname": "invalidCharacters",
@@ -1160,7 +1160,7 @@ function useBankingInfoForm(props) {
1160
1160
  console.error("Validation failed: ", validationErrors);
1161
1161
  const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
1162
1162
  const formField = API_FIELD_TO_FORM_FIELD[error.field] || error.field;
1163
- const errorCode = API_ERROR_PATH_TO_FRONTEND[error.errorPath] || error.errorPath;
1163
+ const errorCode = API_ERROR_CODE_TO_FRONTEND[error.code] || error.code;
1164
1164
  return {
1165
1165
  ...agg,
1166
1166
  [formField]: {
@@ -4547,7 +4547,9 @@ function useUserInfoForm(props) {
4547
4547
  setFilteredPhoneCountries(countries || []);
4548
4548
  }
4549
4549
  else {
4550
- setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
4550
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName
4551
+ .toLowerCase()
4552
+ .includes(phoneCountrySearch.toLowerCase())) || []);
4551
4553
  }
4552
4554
  }, [phoneCountrySearch, countries]);
4553
4555
  useEffect(() => {
@@ -6797,7 +6797,6 @@ function useTaxAndCash() {
6797
6797
  setCurrenciesContext(supportedCurrencies);
6798
6798
  }, [supportedCurrencies]);
6799
6799
  useEffect(() => {
6800
- var _a;
6801
6800
  if (errors) {
6802
6801
  setStep("/error");
6803
6802
  return;
@@ -6841,13 +6840,19 @@ function useTaxAndCash() {
6841
6840
  const user = data === null || data === void 0 ? void 0 : data.user;
6842
6841
  if (!user || step !== "/loading")
6843
6842
  return;
6844
- if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
6845
- (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
6846
- completeConnection(user);
6847
- refetch();
6843
+ async function routeAfterMaybeCompleting() {
6844
+ var _a;
6845
+ if (((_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) &&
6846
+ (user === null || user === void 0 ? void 0 : user.impactConnection.connectionStatus) === "STARTED") {
6847
+ // Finish the early-created connection before routing so the next
6848
+ // step sees the completed status
6849
+ await completeConnection(user);
6850
+ await refetch();
6851
+ }
6852
+ const currentStep = getCurrentStep(user);
6853
+ setStep(currentStep);
6848
6854
  }
6849
- const currentStep = getCurrentStep(user);
6850
- setStep(currentStep);
6855
+ routeAfterMaybeCompleting();
6851
6856
  }
6852
6857
  }, [host, user, (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.email, errors]);
6853
6858
  function getFinanceNetworkFilter() {
@@ -8392,9 +8397,11 @@ function useWidgetVerification() {
8392
8397
  };
8393
8398
  const onPartnerModalComplete = () => {
8394
8399
  setShowPartnerModal(false);
8400
+ // Reset the latch so a later partner creation can re-trigger this effect
8395
8401
  setPartnerCreated(false);
8396
8402
  setContext(true);
8397
8403
  };
8404
+ // The modal signals completion by flipping partnerCreated; advance the flow here
8398
8405
  useEffect(() => {
8399
8406
  if (partnerCreated)
8400
8407
  onPartnerModalComplete();
@@ -7,7 +7,7 @@ import { g as getProps } from './utils-334c1e34.js';
7
7
  import { c as createStyleSheet } from './JSS-67b5cff8.js';
8
8
  import { T as TextSpanView } from './sqm-text-span-view-72f43dff.js';
9
9
  import { g as GET_FINANCE_NETWORK_SETTINGS } from './data-8698cbc6.js';
10
- import { a as PartnerInfoModalContentView, P as PartnerInfoModalView } from './sqm-partner-info-modal-view-bc843d7d.js';
10
+ import { a as PartnerInfoModalContentView, P as PartnerInfoModalView } from './sqm-partner-info-modal-view-6b9c512f.js';
11
11
  import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, P as PARTNER_CREATED_NAMESPACE } from './keys-1054056a.js';
12
12
  import { T as TAX_FORM_UPDATED_EVENT_KEY } from './eventKeys-f76b6a03.js';
13
13
  import { p as parseStates } from './parseStates-ed75e224.js';
@@ -502,7 +502,8 @@ function usePartnerInfoModal(props) {
502
502
  const { data: currenciesData, loading: currenciesLoading } = wn(GET_CURRENCIES, { variables: { locale } });
503
503
  const { data: countriesData, loading: countriesLoading } = wn(GET_COUNTRIES, {});
504
504
  // No pre-filled country, use locale to determine countryCode instead
505
- 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(/^.*_/, ""));
505
+ 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) ||
506
+ locale.replace(/^.*_/, ""));
506
507
  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) || "");
507
508
  const { data: financeNetworkData } = wn(GET_FINANCE_NETWORK_SETTINGS, {
508
509
  variables: { filter: countryCode ? { countryCode_eq: countryCode } : {} },
@@ -601,11 +602,7 @@ function usePartnerInfoModal(props) {
601
602
  }
602
603
  async function onSubmit() {
603
604
  var _a, _b;
604
- if (!allowBankingCollection) {
605
- setError(props.missingFieldsErrorText);
606
- return;
607
- }
608
- if (!countryCode || !currency) {
605
+ if (!allowBankingCollection || !countryCode || !currency) {
609
606
  setError(props.missingFieldsErrorText);
610
607
  return;
611
608
  }
@@ -129,13 +129,14 @@ function PartnerInfoModalView(props) {
129
129
  const styleString = sheet.toString();
130
130
  if (!states.open)
131
131
  return h("div", null);
132
+ const modalHeader = states.isExistingPartner
133
+ ? text.modalHeaderExistingPartner
134
+ : text.modalHeader;
132
135
  return (h("div", null,
133
136
  h("style", { type: "text/css" },
134
137
  " ",
135
138
  styleString),
136
- h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: true, label: states.isExistingPartner
137
- ? text.modalHeaderExistingPartner
138
- : text.modalHeader, "onSl-request-close": (e) => {
139
+ h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: true, label: modalHeader, "onSl-request-close": (e) => {
139
140
  e.preventDefault();
140
141
  }, "onSl-hide": (e) => {
141
142
  var _a;
@@ -143,9 +144,7 @@ function PartnerInfoModalView(props) {
143
144
  e.preventDefault();
144
145
  }
145
146
  }, "onSl-initial-focus": callbacks.onInitialFocus },
146
- h("h2", { class: sheet.classes.DialogTitle }, states.isExistingPartner
147
- ? text.modalHeaderExistingPartner
148
- : text.modalHeader),
147
+ h("h2", { class: sheet.classes.DialogTitle }, modalHeader),
149
148
  h(PartnerInfoModalContentView, Object.assign({}, props)))));
150
149
  }
151
150
 
@@ -36,7 +36,7 @@ import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-c
36
36
  import { I as InvoiceTableView, T as TaxAndCashDashboardView$1, O as OtherRegionSlotView, U as UserInfoFormView$1 } from './sqm-user-info-form-view-647a2bd5.js';
37
37
  import { L as LeadInputFieldView } from './sqm-lead-input-field-view-b945edf4.js';
38
38
  import './data-8698cbc6.js';
39
- import { P as PartnerInfoModalView } from './sqm-partner-info-modal-view-bc843d7d.js';
39
+ import { P as PartnerInfoModalView } from './sqm-partner-info-modal-view-6b9c512f.js';
40
40
 
41
41
  /**
42
42
  * lodash (Custom Build) <https://lodash.com/>