@saasquatch/mint-components 2.3.0-7 → 2.3.0-9

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 (60) hide show
  1. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +25 -25
  2. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +2 -2
  3. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +2 -1
  4. package/dist/cjs/{sqm-partner-info-modal-view-65cc677a.js → sqm-partner-info-modal-view-2b6fee0f.js} +1 -1
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +3 -3
  6. package/dist/cjs/{sqm-user-info-form-view-42323dc5.js → sqm-user-info-form-view-374a3f01.js} +20 -980
  7. package/dist/cjs/subregions-984e30d7.js +1505 -0
  8. package/dist/cjs/{useIndirectTaxForm-d1cd23f7.js → useIndirectTaxForm-112914a0.js} +1 -1
  9. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +1 -1
  10. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +1 -0
  11. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +18 -7
  12. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +22 -19
  13. package/dist/collection/components/tax-and-cash/utils.js +55 -0
  14. package/dist/esm/sqm-banking-info-form_10.entry.js +25 -25
  15. package/dist/esm/sqm-big-stat_47.entry.js +2 -2
  16. package/dist/esm/sqm-email-verification_2.entry.js +2 -1
  17. package/dist/esm/{sqm-partner-info-modal-view-136c443d.js → sqm-partner-info-modal-view-bc843d7d.js} +1 -1
  18. package/dist/esm/sqm-stencilbook.entry.js +3 -3
  19. package/dist/esm/{sqm-user-info-form-view-dc473cb8.js → sqm-user-info-form-view-5322525c.js} +18 -978
  20. package/dist/esm/subregions-7c9778d0.js +1492 -0
  21. package/dist/esm/{useIndirectTaxForm-27668ad4.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  22. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  23. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  24. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  25. package/dist/esm-es5/{sqm-partner-info-modal-view-136c443d.js → sqm-partner-info-modal-view-bc843d7d.js} +1 -1
  26. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  27. package/dist/esm-es5/sqm-user-info-form-view-5322525c.js +1 -0
  28. package/dist/esm-es5/subregions-7c9778d0.js +1 -0
  29. package/dist/esm-es5/{useIndirectTaxForm-27668ad4.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  30. package/dist/mint-components/mint-components.esm.js +1 -1
  31. package/dist/mint-components/{p-4c6ab282.js → p-13e439bc.js} +1 -1
  32. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  33. package/dist/mint-components/{p-b24bb1ee.system.js → p-24a867ab.system.js} +1 -1
  34. package/dist/mint-components/{p-2e462dd9.js → p-2d4132fb.js} +5 -5
  35. package/dist/mint-components/p-5623f1e0.js +1 -0
  36. package/dist/mint-components/{p-3c052d3d.entry.js → p-5bc707cf.entry.js} +1 -1
  37. package/dist/mint-components/{p-c2903e7d.entry.js → p-6eebbc59.entry.js} +2 -2
  38. package/dist/mint-components/{p-ed945efe.system.js → p-6ef373ed.system.js} +1 -1
  39. package/dist/mint-components/p-7f29622d.js +1 -0
  40. package/dist/mint-components/{p-4575f71b.system.entry.js → p-8a08cec6.system.entry.js} +1 -1
  41. package/dist/mint-components/{p-547f8243.system.entry.js → p-90200f08.system.entry.js} +1 -1
  42. package/dist/mint-components/{p-d30c8cb3.entry.js → p-a8cfa8fd.entry.js} +1 -1
  43. package/dist/mint-components/{p-459c4251.entry.js → p-b3e1f2fa.entry.js} +3 -3
  44. package/dist/mint-components/{p-b21c53cb.system.entry.js → p-b7188d47.system.entry.js} +1 -1
  45. package/dist/mint-components/{p-df74f653.system.entry.js → p-b9509a55.system.entry.js} +1 -1
  46. package/dist/mint-components/p-bd03efe0.system.js +1 -0
  47. package/dist/mint-components/p-c13c20b2.system.js +1 -0
  48. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +1 -0
  49. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -0
  50. package/dist/types/components/tax-and-cash/utils.d.ts +5 -0
  51. package/docs/docs.docx +0 -0
  52. package/package.json +1 -1
  53. package/dist/cjs/subregions-e7273457.js +0 -478
  54. package/dist/esm/subregions-24c1c137.js +0 -467
  55. package/dist/esm-es5/sqm-user-info-form-view-dc473cb8.js +0 -1
  56. package/dist/esm-es5/subregions-24c1c137.js +0 -1
  57. package/dist/mint-components/p-3f68e4e3.js +0 -1
  58. package/dist/mint-components/p-66cb8bec.system.js +0 -1
  59. package/dist/mint-components/p-cb58a2c6.js +0 -1
  60. package/dist/mint-components/p-ec58628f.system.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-e7273457.js');
6
+ const subregions = require('./subregions-984e30d7.js');
7
7
  const data = require('./data-89ac73dd.js');
8
8
  const eventKeys = require('./eventKeys-7af4df4d.js');
9
9
 
@@ -141,7 +141,7 @@ export function PartnerInfoModalView(props) {
141
141
  if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === "SL-DIALOG") {
142
142
  e.preventDefault();
143
143
  }
144
- } },
144
+ }, "onSl-initial-focus": callbacks.onInitialFocus },
145
145
  h("h2", { class: sheet.classes.DialogTitle }, states.isExistingPartner
146
146
  ? text.modalHeaderExistingPartner
147
147
  : text.modalHeader),
@@ -651,6 +651,7 @@ function useDemoPartnerInfoModal(props) {
651
651
  setError("");
652
652
  },
653
653
  onClose: () => { },
654
+ onInitialFocus: (e) => e.preventDefault(),
654
655
  },
655
656
  text: {
656
657
  modalHeader: props.modalHeader,
@@ -4,7 +4,7 @@ import { createStyleSheet } from "../../../styling/JSS";
4
4
  import { FORM_STEPS } from "../data";
5
5
  import { PHONE_EXTENSIONS } from "../phoneExtensions";
6
6
  import LoadingView from "../sqm-tax-and-cash/LoadingView";
7
- import { formatErrorMessage, validateBillingField } from "../utils";
7
+ import { formatErrorMessage, isValidI18nPhoneNumber, validateBillingField, } from "../utils";
8
8
  const style = {
9
9
  FormWrapper: {},
10
10
  ErrorInput: {
@@ -289,12 +289,18 @@ export const UserInfoFormView = (props) => {
289
289
  }
290
290
  // when creating an impact connection without sending phoneNumber data, the impactAPI defaults the value to "0000000" and the phoneNumberCountryCode to "DZ"
291
291
  function isDisabledPartnerInput(field) {
292
- var _a, _b;
292
+ var _a, _b, _c, _d;
293
293
  if (((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a.phoneNumber) === "0000000" &&
294
294
  (field === "phoneNumber" || field === "phoneNumberCountryCode")) {
295
295
  return false;
296
296
  }
297
- return states.isPartner && !!((_b = data.partnerData) === null || _b === void 0 ? void 0 : _b[field]);
297
+ // if bad phone number was previously saved, unlock the field so user can correct it
298
+ if ((field === "phoneNumber" || field === "phoneNumberCountryCode") &&
299
+ states.isPartner &&
300
+ !isValidI18nPhoneNumber((_b = data.partnerData) === null || _b === void 0 ? void 0 : _b.phoneNumberCountryCode, (_c = data.partnerData) === null || _c === void 0 ? void 0 : _c.phoneNumber)) {
301
+ return false;
302
+ }
303
+ return states.isPartner && !!((_d = data.partnerData) === null || _d === void 0 ? void 0 : _d[field]);
298
304
  }
299
305
  function isDisabledUserInput(field) {
300
306
  var _a;
@@ -382,10 +388,15 @@ export const UserInfoFormView = (props) => {
382
388
  h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
383
389
  _b.dial_code));
384
390
  })),
385
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, validationError: ({ value }) => {
386
- // Naive phone number validation
387
- validateBillingField(/[a-zA-Z]+/, value) &&
388
- formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
391
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, validationError: ({ control, value, formData }) => {
392
+ // skip validation for values the user can't edit
393
+ if (control === null || control === void 0 ? void 0 : control.disabled)
394
+ return undefined;
395
+ if (!(value === null || value === void 0 ? void 0 : value.trim()))
396
+ return undefined;
397
+ return isValidI18nPhoneNumber(formData.phoneNumberCountryCode, value)
398
+ ? undefined
399
+ : formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
389
400
  }, disabled: states.disabled || isDisabledPartnerInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
390
401
  class: classes.ErrorInput,
391
402
  helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
@@ -122,9 +122,7 @@ export function useUserInfoForm(props) {
122
122
  setFilteredPhoneCountries(countries || []);
123
123
  }
124
124
  else {
125
- setFilteredPhoneCountries(countries.filter((c) => c.displayName
126
- .toLowerCase()
127
- .includes(phoneCountrySearch.toLowerCase())) || []);
125
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
128
126
  }
129
127
  }, [phoneCountrySearch, countries]);
130
128
  useEffect(() => {
@@ -138,7 +136,7 @@ export function useUserInfoForm(props) {
138
136
  }
139
137
  }, [currencySearch, currencies]);
140
138
  async function connectPartner(formData) {
141
- var _a, _b, _c, _d, _e, _f;
139
+ var _a, _b, _c, _d;
142
140
  const vars = {
143
141
  user: {
144
142
  id: user.id,
@@ -160,26 +158,31 @@ export function useUserInfoForm(props) {
160
158
  const userData = data === null || data === void 0 ? void 0 : data.user;
161
159
  let result = null;
162
160
  let connectionResult;
163
- if (((_a = userData === null || userData === void 0 ? void 0 : userData.impactConnection) === null || _a === void 0 ? void 0 : _a.connectionStatus) === "STARTED") {
164
- result = await completeImpactPartner({
165
- vars,
166
- });
167
- connectionResult = (_b = result) === null || _b === void 0 ? void 0 : _b.completeImpactConnection;
168
- }
169
- else {
170
- result = await connectImpactPartner({
171
- vars,
172
- });
173
- connectionResult = (_c = result) === null || _c === void 0 ? void 0 : _c.createImpactConnection;
174
- }
175
- if (!result || ((_d = result) === null || _d === void 0 ? void 0 : _d.message))
161
+ result = await completeImpactPartner({
162
+ vars,
163
+ });
164
+ connectionResult = (_a = result) === null || _a === void 0 ? void 0 : _a.completeImpactConnection;
165
+ // if (userData?.impactConnection?.connectionStatus === "STARTED") {
166
+ // result = await completeImpactPartner({
167
+ // vars,
168
+ // });
169
+ // connectionResult = (result as CompletePartnerResult)
170
+ // ?.completeImpactConnection;
171
+ // } else {
172
+ // result = await connectImpactPartner({
173
+ // vars,
174
+ // });
175
+ // connectionResult = (result as ConnectPartnerResult)
176
+ // ?.createImpactConnection;
177
+ // }
178
+ if (!result || ((_b = result) === null || _b === void 0 ? void 0 : _b.message))
176
179
  throw new Error();
177
180
  if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
178
181
  console.error("Failed to create Impact connection: ", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
179
182
  throw new Error();
180
183
  }
181
184
  await refetch();
182
- const resultPublisher = (_f = (_e = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher;
185
+ const resultPublisher = (_d = (_c = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.publisher;
183
186
  const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
184
187
  // Fire form change event
185
188
  window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
@@ -200,7 +203,7 @@ export function useUserInfoForm(props) {
200
203
  // custom validation
201
204
  if (typeof control.validationError === "function") {
202
205
  const validate = control.validationError;
203
- const validationError = validate({ control, key, value });
206
+ const validationError = validate({ control, key, value, formData });
204
207
  if (validationError)
205
208
  jsonpointer.set(errors, key, validationError);
206
209
  }
@@ -1,4 +1,59 @@
1
1
  import { intl } from "../../global/global";
2
+ import { PHONE_EXTENSIONS } from "./phoneExtensions";
3
+ function stripLeadingZero(d) {
4
+ return d.startsWith("0") ? d.slice(1) : d;
5
+ }
6
+ /**
7
+ * Mirrors Impact's I18nPhoneNumberParams validation rules per country.
8
+ * Returns true when the phone number is valid for the given the phoneNumberCountryCode country.
9
+ */
10
+ export function isValidI18nPhoneNumber(phoneCountryCode, phoneNumber) {
11
+ var _a, _b;
12
+ if (!phoneCountryCode || !(phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.trim()))
13
+ return false;
14
+ const country = phoneCountryCode.toUpperCase();
15
+ const digits = phoneNumber.replace(/\D/g, "");
16
+ switch (country) {
17
+ case "US":
18
+ case "CA": {
19
+ // strip a single leading "1", then exactly 10 digits
20
+ const n = digits.startsWith("1") ? digits.slice(1) : digits;
21
+ return n.length === 10;
22
+ }
23
+ case "AU":
24
+ // 9 or 10 digits
25
+ return digits.length === 9 || digits.length === 10;
26
+ case "NZ": {
27
+ // trim "640" country prefix or leading "0" (only when >9 digits),
28
+ // then 8–10 digits
29
+ let n = digits;
30
+ if (n.length > 9) {
31
+ if (n.startsWith("640"))
32
+ n = n.slice(3);
33
+ else if (n.startsWith("0"))
34
+ n = n.slice(1);
35
+ }
36
+ return n.length >= 8 && n.length <= 10;
37
+ }
38
+ case "GB":
39
+ // >= 6 digits after stripping a single leading "0", no dialing-code check
40
+ return stripLeadingZero(digits).length >= 6;
41
+ default: {
42
+ // All other countries: strip a single leading "0", then >= 6 digits
43
+ if (stripLeadingZero(digits).length < 6)
44
+ return false;
45
+ // If input starts with "+", the dialing code (first whitespace-split
46
+ // token) must match the selected country exactly. Splits on first
47
+ // whitespace, so "+4420 7946 0958" supplies "4420" (not "44") and fails.
48
+ if (phoneNumber.trim().startsWith("+")) {
49
+ const supplied = phoneNumber.trim().split(/\s/)[0].slice(1);
50
+ const expected = (_b = (_a = PHONE_EXTENSIONS[country]) === null || _a === void 0 ? void 0 : _a.dial_code) === null || _b === void 0 ? void 0 : _b.replace(/^\+/, "");
51
+ return expected === supplied;
52
+ }
53
+ return true;
54
+ }
55
+ }
56
+ }
2
57
  export function validTaxDocument(requiredType) {
3
58
  const validTypes = ["W9", "W8BENE", "W8BEN"];
4
59
  if (validTypes.includes(requiredType))
@@ -12,12 +12,12 @@ import { u as useRerenderListener, a as useRequestRerender } from './re-render-b
12
12
  import { u as useChildElements } from './useChildElements-06937df7.js';
13
13
  import { l as luxon } from './luxon-1be92a8e.js';
14
14
  import { g as generateUserError } from './useReferralTable-03d32c6f.js';
15
- import { O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, T as TaxAndCashDashboardView, U as UserInfoFormView } from './sqm-user-info-form-view-dc473cb8.js';
16
- import { t as taxTypeToName, b as validTaxDocument, I as INDIRECT_TAX_SPAIN_REGIONS, a as INDIRECT_TAX_PROVINCES, o as objectIsFull, A as ADDRESS_REGIONS } from './subregions-24c1c137.js';
15
+ import { O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, T as TaxAndCashDashboardView, U as UserInfoFormView } from './sqm-user-info-form-view-5322525c.js';
16
+ import { t as taxTypeToName, b as validTaxDocument, I as INDIRECT_TAX_SPAIN_REGIONS, a as INDIRECT_TAX_PROVINCES, o as objectIsFull, A as ADDRESS_REGIONS } from './subregions-7c9778d0.js';
17
17
  import { F as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, f as FINANCE_NETWORK_SETTINGS_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, C as CURRENCIES_NAMESPACE, U as USER_FORM_CONTEXT_NAMESPACE } from './data-8698cbc6.js';
18
18
  import { c as VERIFICATION_EVENT_KEY } from './keys-1054056a.js';
19
19
  import { T as TAX_FORM_UPDATED_EVENT_KEY } from './eventKeys-f76b6a03.js';
20
- import { a as useIndirectTaxForm, b as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, c as CONNECT_PARTNER, C as COMPLETE_PARTNER } from './useIndirectTaxForm-27668ad4.js';
20
+ import { a as useIndirectTaxForm, b as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, c as CONNECT_PARTNER, C as COMPLETE_PARTNER } from './useIndirectTaxForm-a6ac7e7e.js';
21
21
 
22
22
  function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
23
23
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76;
@@ -4545,9 +4545,7 @@ function useUserInfoForm(props) {
4545
4545
  setFilteredPhoneCountries(countries || []);
4546
4546
  }
4547
4547
  else {
4548
- setFilteredPhoneCountries(countries.filter((c) => c.displayName
4549
- .toLowerCase()
4550
- .includes(phoneCountrySearch.toLowerCase())) || []);
4548
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
4551
4549
  }
4552
4550
  }, [phoneCountrySearch, countries]);
4553
4551
  useEffect(() => {
@@ -4561,7 +4559,7 @@ function useUserInfoForm(props) {
4561
4559
  }
4562
4560
  }, [currencySearch, currencies]);
4563
4561
  async function connectPartner(formData) {
4564
- var _a, _b, _c, _d, _e, _f;
4562
+ var _a, _b, _c, _d;
4565
4563
  const vars = {
4566
4564
  user: {
4567
4565
  id: user.id,
@@ -4578,31 +4576,33 @@ function useUserInfoForm(props) {
4578
4576
  phoneNumber: formData.phoneNumber,
4579
4577
  phoneNumberCountryCode: formData.phoneNumberCountryCode,
4580
4578
  };
4581
- // If the partner has already been started call completeImpactPartner to
4582
- // update the remaining details. Otherwise create a new connection.
4583
- const userData = data === null || data === void 0 ? void 0 : data.user;
4584
4579
  let result = null;
4585
4580
  let connectionResult;
4586
- if (((_a = userData === null || userData === void 0 ? void 0 : userData.impactConnection) === null || _a === void 0 ? void 0 : _a.connectionStatus) === "STARTED") {
4587
- result = await completeImpactPartner({
4588
- vars,
4589
- });
4590
- connectionResult = (_b = result) === null || _b === void 0 ? void 0 : _b.completeImpactConnection;
4591
- }
4592
- else {
4593
- result = await connectImpactPartner({
4594
- vars,
4595
- });
4596
- connectionResult = (_c = result) === null || _c === void 0 ? void 0 : _c.createImpactConnection;
4597
- }
4598
- if (!result || ((_d = result) === null || _d === void 0 ? void 0 : _d.message))
4581
+ result = await completeImpactPartner({
4582
+ vars,
4583
+ });
4584
+ connectionResult = (_a = result) === null || _a === void 0 ? void 0 : _a.completeImpactConnection;
4585
+ // if (userData?.impactConnection?.connectionStatus === "STARTED") {
4586
+ // result = await completeImpactPartner({
4587
+ // vars,
4588
+ // });
4589
+ // connectionResult = (result as CompletePartnerResult)
4590
+ // ?.completeImpactConnection;
4591
+ // } else {
4592
+ // result = await connectImpactPartner({
4593
+ // vars,
4594
+ // });
4595
+ // connectionResult = (result as ConnectPartnerResult)
4596
+ // ?.createImpactConnection;
4597
+ // }
4598
+ if (!result || ((_b = result) === null || _b === void 0 ? void 0 : _b.message))
4599
4599
  throw new Error();
4600
4600
  if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
4601
4601
  console.error("Failed to create Impact connection: ", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
4602
4602
  throw new Error();
4603
4603
  }
4604
4604
  await refetch();
4605
- const resultPublisher = (_f = (_e = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher;
4605
+ const resultPublisher = (_d = (_c = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.publisher;
4606
4606
  const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
4607
4607
  // Fire form change event
4608
4608
  window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
@@ -4623,7 +4623,7 @@ function useUserInfoForm(props) {
4623
4623
  // custom validation
4624
4624
  if (typeof control.validationError === "function") {
4625
4625
  const validate = control.validationError;
4626
- const validationError = validate({ control, key, value });
4626
+ const validationError = validate({ control, key, value, formData });
4627
4627
  if (validationError)
4628
4628
  jsonpointer.set(errors, key, validationError);
4629
4629
  }
@@ -25,11 +25,11 @@ import { i as isEmpty } from './utilities-cbd8f2eb.js';
25
25
  import { E as ErrorView } from './ErrorView-74cb3af8.js';
26
26
  import { u as useDemoBigStat, W as useBigStat, B as BigStatView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, U as LeadDropdownFieldView, Q as LeadFormView, X as withShadowView, L as LeaderboardView, N as NameFieldsView, f as ChangeMarktingView, P as PortalChangePasswordView, g as PortalFooterView, h as PortalFrameView, c as BaseRegistrationFormView, R as ReferralIframeView, i as RewardExchangeView, Y as demoRewardExchange, G as useShareButton, a as ShareButtonView, K as useShareLink, J as ShareLinkView, S as StatContainerView, T as TaskCardView } from './ShadowViewAddon-e115fa1c.js';
27
27
  import './sqm-portal-container-view-200c9df8.js';
28
- import { g as getCountryObj, L as LoadingView } from './subregions-24c1c137.js';
28
+ import { g as getCountryObj, L as LoadingView } from './subregions-7c9778d0.js';
29
29
  import { T as TAX_CONTEXT_NAMESPACE, a as TAX_FORM_CONTEXT_NAMESPACE, U as USER_FORM_CONTEXT_NAMESPACE, C as CURRENCIES_NAMESPACE, b as COUNTRIES_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, G as GET_USER$2, d as COUNTRIES_QUERY_NAMESPACE, e as GET_COUNTRIES, f as FINANCE_NETWORK_SETTINGS_NAMESPACE, g as GET_FINANCE_NETWORK_SETTINGS, h as CURRENCIES_QUERY_NAMESPACE, i as GET_CURRENCIES } from './data-8698cbc6.js';
30
30
  import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, b as SHOW_PARTNER_MODAL_NAMESPACE, P as PARTNER_CREATED_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-1054056a.js';
31
31
  import './eventKeys-f76b6a03.js';
32
- import { u as usePayoutStatus, C as COMPLETE_PARTNER } from './useIndirectTaxForm-27668ad4.js';
32
+ import { u as usePayoutStatus, C as COMPLETE_PARTNER } from './useIndirectTaxForm-a6ac7e7e.js';
33
33
  import { p as parseStates } from './parseStates-ed75e224.js';
34
34
 
35
35
  /**
@@ -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-136c443d.js';
10
+ import { a as PartnerInfoModalContentView, P as PartnerInfoModalView } from './sqm-partner-info-modal-view-bc843d7d.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';
@@ -852,6 +852,7 @@ function useDemoPartnerInfoModal(props) {
852
852
  setError("");
853
853
  },
854
854
  onClose: () => { },
855
+ onInitialFocus: (e) => e.preventDefault(),
855
856
  },
856
857
  text: {
857
858
  modalHeader: props.modalHeader,
@@ -142,7 +142,7 @@ function PartnerInfoModalView(props) {
142
142
  if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === "SL-DIALOG") {
143
143
  e.preventDefault();
144
144
  }
145
- } },
145
+ }, "onSl-initial-focus": callbacks.onInitialFocus },
146
146
  h("h2", { class: sheet.classes.DialogTitle }, states.isExistingPartner
147
147
  ? text.modalHeaderExistingPartner
148
148
  : text.modalHeader),
@@ -31,11 +31,11 @@ import './ErrorView-74cb3af8.js';
31
31
  import { Q as QrCodeView } from './sqm-qr-code-view-ce476721.js';
32
32
  import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, c as BaseRegistrationFormView, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as ShareLinkView, K as useShareLink, M as ProgressBarView, O as ProgressBar$2, Q as LeadFormView, U as LeadDropdownFieldView, V as ShadowViewAddon } from './ShadowViewAddon-e115fa1c.js';
33
33
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-200c9df8.js';
34
- import { I as InvoiceTableView, T as TaxAndCashDashboardView$1, O as OtherRegionSlotView, U as UserInfoFormView$1 } from './sqm-user-info-form-view-dc473cb8.js';
35
- import { t as taxTypeToName, L as LoadingView, I as INDIRECT_TAX_SPAIN_REGIONS, a as INDIRECT_TAX_PROVINCES } from './subregions-24c1c137.js';
34
+ import { I as InvoiceTableView, T as TaxAndCashDashboardView$1, O as OtherRegionSlotView, U as UserInfoFormView$1 } from './sqm-user-info-form-view-5322525c.js';
35
+ import { t as taxTypeToName, L as LoadingView, I as INDIRECT_TAX_SPAIN_REGIONS, a as INDIRECT_TAX_PROVINCES } from './subregions-7c9778d0.js';
36
36
  import { L as LeadInputFieldView } from './sqm-lead-input-field-view-b945edf4.js';
37
37
  import './data-8698cbc6.js';
38
- import { P as PartnerInfoModalView } from './sqm-partner-info-modal-view-136c443d.js';
38
+ import { P as PartnerInfoModalView } from './sqm-partner-info-modal-view-bc843d7d.js';
39
39
 
40
40
  /**
41
41
  * lodash (Custom Build) <https://lodash.com/>