@saasquatch/mint-components 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/{ShadowViewAddon-7b5c40eb.js → ShadowViewAddon-a9bac47c.js} +2 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +1236 -36
  5. package/dist/cjs/sqm-big-stat_38.cjs.entry.js +1 -1
  6. package/dist/cjs/{sqm-invoice-table-view-035d5aed.js → sqm-invoice-table-view-2e93ac53.js} +368 -7
  7. package/dist/cjs/sqm-stencilbook.cjs.entry.js +3 -3
  8. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +16 -0
  9. package/dist/collection/components/tax-and-cash/phoneExtensions.js +970 -0
  10. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +1 -1
  11. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +33 -14
  12. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +10 -2
  13. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +234 -0
  14. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +1 -1
  15. package/dist/collection/components/tax-and-cash/sqm-user-info-form/small-views/IndirectTaxDetailsView.js +6 -6
  16. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +87 -12
  17. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +232 -1
  18. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +52 -7
  19. package/dist/collection/components/tax-and-cash/subregions.js +338 -0
  20. package/dist/collection/components/tax-and-cash/utils.js +6 -1
  21. package/dist/collection/components/views/copy-text-view.js +2 -2
  22. package/dist/esm/{ShadowViewAddon-d9424229.js → ShadowViewAddon-352dc73a.js} +2 -2
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/mint-components.js +1 -1
  25. package/dist/esm/sqm-banking-info-form_16.entry.js +1236 -36
  26. package/dist/esm/sqm-big-stat_38.entry.js +1 -1
  27. package/dist/esm/{sqm-invoice-table-view-1115795f.js → sqm-invoice-table-view-e925c4db.js} +366 -7
  28. package/dist/esm/sqm-stencilbook.entry.js +3 -3
  29. package/dist/esm-es5/ShadowViewAddon-352dc73a.js +1 -0
  30. package/dist/esm-es5/loader.js +1 -1
  31. package/dist/esm-es5/mint-components.js +1 -1
  32. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  33. package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
  34. package/dist/esm-es5/sqm-invoice-table-view-e925c4db.js +1 -0
  35. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  36. package/dist/mint-components/mint-components.esm.js +1 -1
  37. package/dist/mint-components/{p-f37b7296.entry.js → p-12c2757a.entry.js} +2 -2
  38. package/dist/mint-components/p-175ac756.entry.js +168 -0
  39. package/dist/mint-components/{p-89995fd0.js → p-26258333.js} +1 -1
  40. package/dist/mint-components/p-2ca2b028.system.js +1 -0
  41. package/dist/mint-components/p-4d45d92d.js +1 -0
  42. package/dist/mint-components/p-7eb6fab2.system.js +1 -1
  43. package/dist/mint-components/{p-2ee988c7.entry.js → p-8a174905.entry.js} +1 -1
  44. package/dist/mint-components/p-8e2274a8.system.js +1 -0
  45. package/dist/mint-components/{p-92b99bb2.system.entry.js → p-95a23c8f.system.entry.js} +1 -1
  46. package/dist/mint-components/p-c0c4abf6.system.entry.js +1 -0
  47. package/dist/mint-components/{p-f4a6e490.system.entry.js → p-d3d04e96.system.entry.js} +1 -1
  48. package/dist/types/components/tax-and-cash/phoneExtensions.d.ts +970 -0
  49. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/data.d.ts +16 -2
  50. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +42 -0
  51. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +39 -6
  52. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.d.ts +40 -0
  53. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +20 -0
  54. package/dist/types/components/tax-and-cash/subregions.d.ts +8 -0
  55. package/dist/types/components/tax-and-cash/utils.d.ts +2 -1
  56. package/dist/types/components.d.ts +158 -0
  57. package/docs/UserFormFastFollow--2024-04-26--14-31-04.xlsx +0 -0
  58. package/docs/docs.docx +0 -0
  59. package/docs/raisins.json +1 -1
  60. package/grapesjs/grapesjs.js +1 -1
  61. package/package.json +1 -1
  62. package/dist/esm-es5/ShadowViewAddon-d9424229.js +0 -1
  63. package/dist/esm-es5/sqm-invoice-table-view-1115795f.js +0 -1
  64. package/dist/mint-components/p-58d2e9cb.entry.js +0 -153
  65. package/dist/mint-components/p-5ff96052.system.entry.js +0 -1
  66. package/dist/mint-components/p-67b91751.system.js +0 -1
  67. package/dist/mint-components/p-79fc68b0.js +0 -1
  68. package/dist/mint-components/p-9755ab8f.system.js +0 -1
  69. package/docs/TaxAndCash--2024-03-14--14-20-26.xlsx +0 -0
@@ -16,7 +16,7 @@ const useChildElements = require('./useChildElements-ad37ecbf.js');
16
16
  const luxon = require('./luxon-a4661470.js');
17
17
  const useReferralTable = require('./useReferralTable-6cbd3b88.js');
18
18
  const utils = require('./utils-6847bc06.js');
19
- const sqmInvoiceTableView = require('./sqm-invoice-table-view-035d5aed.js');
19
+ const sqmInvoiceTableView = require('./sqm-invoice-table-view-2e93ac53.js');
20
20
 
21
21
  const TAX_CONTEXT_NAMESPACE = "sq:tax-and-cash";
22
22
  const TAX_FORM_CONTEXT_NAMESPACE = "sq:tax-form-context";
@@ -44,10 +44,17 @@ const GET_USER = index_module.dist.gql `
44
44
  lastName
45
45
  }
46
46
  publisher {
47
+ id
48
+ brandedSignup
47
49
  countryCode
48
50
  currency
49
- requiredTaxDocumentType
50
- brandedSignup
51
+ billingAddress
52
+ billingCity
53
+ billingState
54
+ billingCountryCode
55
+ billingPostalCode
56
+ phoneNumberCountryCode
57
+ phoneNumber
51
58
  taxInformation {
52
59
  indirectTaxId
53
60
  indirectTaxCountryCode
@@ -56,6 +63,7 @@ const GET_USER = index_module.dist.gql `
56
63
  withholdingTaxId
57
64
  withholdingTaxCountryCode
58
65
  }
66
+ requiredTaxDocumentType
59
67
  currentTaxDocument {
60
68
  status
61
69
  type
@@ -886,7 +894,7 @@ const BankingInfoFormView = (props) => {
886
894
  : slots.paymentFixedDaySelectSlot))))),
887
895
  index.h("div", { class: classes.BtnContainer },
888
896
  index.h("sl-button", { type: "primary", disabled: states.disabled || states.saveDisabled, loading: states.saveLoading, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton),
889
- !states.hideBackButton && (index.h("sl-button", { class: classes.SecondaryBtn, type: "text", onClick: callbacks.onBack }, text.backButton))))));
897
+ !states.hideBackButton && (index.h("sl-button", { exportparts: "base: secondarybutton-base", class: classes.SecondaryBtn, type: "text", onClick: callbacks.onBack }, text.backButton))))));
890
898
  };
891
899
 
892
900
  // Hardcoded in Impact backend
@@ -2412,16 +2420,23 @@ const IndirectTaxFormView = (props) => {
2412
2420
  const CONNECT_PARTNER = index_module.dist.gql `
2413
2421
  mutation createImpactConnection($vars: ImpactConnectionInput!) {
2414
2422
  createImpactConnection(impactConnectionInput: $vars) {
2415
- id
2416
- accountId
2417
- impactConnection {
2418
- connected
2419
- publisher {
2420
- brandedSignup
2421
- requiredTaxDocumentType
2422
- currentTaxDocument {
2423
- type
2424
- status
2423
+ success
2424
+ validationErrors {
2425
+ field
2426
+ message
2427
+ }
2428
+ user {
2429
+ id
2430
+ accountId
2431
+ impactConnection {
2432
+ connected
2433
+ publisher {
2434
+ brandedSignup
2435
+ requiredTaxDocumentType
2436
+ currentTaxDocument {
2437
+ type
2438
+ status
2439
+ }
2425
2440
  }
2426
2441
  }
2427
2442
  }
@@ -2504,7 +2519,7 @@ function useIndirectTaxForm(props) {
2504
2519
  setFormState((p) => ({ ...p, [field]: value }));
2505
2520
  };
2506
2521
  const onSubmit = async (event) => {
2507
- var _a, _b, _c, _d;
2522
+ var _a, _b, _c, _d, _e, _f;
2508
2523
  if (!option) {
2509
2524
  setErrors({ taxDetails: true });
2510
2525
  return;
@@ -2539,6 +2554,12 @@ function useIndirectTaxForm(props) {
2539
2554
  lastName: userForm.lastName,
2540
2555
  countryCode: userForm.countryCode,
2541
2556
  currency: userForm.currency,
2557
+ address: userForm.address,
2558
+ city: userForm.city,
2559
+ state: userForm.state,
2560
+ postalCode: userForm.postalCode,
2561
+ phoneNumber: userForm.phoneNumber,
2562
+ phoneNumberCountryCode: userForm.phoneNumberCountryCode,
2542
2563
  indirectTaxCountryCode: formData.selectedRegion,
2543
2564
  indirectTaxRegion: formData.province || formData.subRegion,
2544
2565
  indirectTaxId: formData.indirectTaxNumber,
@@ -2550,10 +2571,16 @@ function useIndirectTaxForm(props) {
2550
2571
  });
2551
2572
  if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
2552
2573
  throw new Error();
2574
+ if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
2575
+ // Output backend errors to console for now
2576
+ console.error("Failed to create Impact connection: ", result.createImpactConnection
2577
+ .validationErrors);
2578
+ throw new Error();
2579
+ }
2553
2580
  await refetch();
2554
- const resultPublisher = (_c = (_b = result
2555
- .createImpactConnection) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher;
2556
- const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType, (_d = resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument) === null || _d === void 0 ? void 0 : _d.type);
2581
+ const resultPublisher = (_e = (_d = (_c = result
2582
+ .createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
2583
+ const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType, (_f = resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.type);
2557
2584
  if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
2558
2585
  !hasValidCurrentDocument) {
2559
2586
  // Go to docusign form
@@ -3873,6 +3900,41 @@ const TaxAndCashMonolith = class {
3873
3900
  * @uiGroup Step 1 Properties
3874
3901
  */
3875
3902
  this.step1_country = "Country";
3903
+ /**
3904
+ * @uiName Phone number field label
3905
+ * @uiGroup Step 1 Properties
3906
+ */
3907
+ this.step1_phoneNumber = "Phone number";
3908
+ /**
3909
+ * @uiName Address field label
3910
+ * @uiGroup Step 1 Properties
3911
+ */
3912
+ this.step1_address = "Address";
3913
+ /**
3914
+ * @uiName City field label
3915
+ * @uiGroup Step 1 Properties
3916
+ */
3917
+ this.step1_city = "City";
3918
+ /**
3919
+ * @uiName State field label for states
3920
+ * @uiGroup Step 1 Properties
3921
+ */
3922
+ this.step1_state = "State";
3923
+ /**
3924
+ * @uiName State field label for provinces
3925
+ * @uiGroup Step 1 Properties
3926
+ */
3927
+ this.step1_province = "Province";
3928
+ /**
3929
+ * @uiName State field label for regions
3930
+ * @uiGroup Step 1 Properties
3931
+ */
3932
+ this.step1_region = "Region";
3933
+ /**
3934
+ * @uiName Postal code field label
3935
+ * @uiGroup Step 1 Properties
3936
+ */
3937
+ this.step1_postalCode = "Postal code";
3876
3938
  /**
3877
3939
  * @uiName Currency field label
3878
3940
  * @uiGroup Step 1 Properties
@@ -4617,6 +4679,12 @@ const TaxAndCashMonolith = class {
4617
4679
  * @uiGroup General Form Properties
4618
4680
  */
4619
4681
  this.fieldRequiredError = "{fieldName} is required";
4682
+ /**
4683
+ * Displayed under a field that includes invalid characters (non-ASCII).
4684
+ * @uiName Invalid character error message
4685
+ * @uiGroup General Form Properties
4686
+ */
4687
+ this.invalidCharacterError = "{fieldName} includes characters that aren't supported.";
4620
4688
  /**
4621
4689
  * Displayed under a field when it has an invalid entry.
4622
4690
  * @uiName Form field error message
@@ -4689,6 +4757,7 @@ const TaxAndCashMonolith = class {
4689
4757
  generalErrorTitle: props.generalErrorTitle,
4690
4758
  generalErrorDescription: props.generalErrorDescription,
4691
4759
  fieldRequiredError: props.fieldRequiredError,
4760
+ invalidCharacterError: props.invalidCharacterError,
4692
4761
  fieldInvalidError: props.fieldInvalidError,
4693
4762
  continueButton: props.continueButton,
4694
4763
  backButton: props.backButton,
@@ -5015,7 +5084,7 @@ const TaxAndCashDashboardView = (props) => {
5015
5084
  documentType: states.documentTypeString,
5016
5085
  })),
5017
5086
  index.h("span", { class: sheet$4.classes.StatusAlert }, statusMap[states.status]))),
5018
- index.h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet$4.classes.NewFormButton, exportparts: "base: secondarybutton-base" }, text.newFormButton))))))),
5087
+ index.h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet$4.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton))))))),
5019
5088
  index.h("div", { class: sheet$4.classes.IndirectTaxPreviewContainer }, states.loading ? (index.h("div", { class: sheet$4.classes.TaxSectionSkeletonContainer },
5020
5089
  index.h("sl-skeleton", { class: sheet$4.classes.SkeletonOne }),
5021
5090
  index.h("sl-skeleton", { class: sheet$4.classes.SkeletonTwo }))) : (index.h("div", null,
@@ -5470,6 +5539,977 @@ function useDemoTaxAndCashDashboard(props) {
5470
5539
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
5471
5540
  }
5472
5541
 
5542
+ const PHONE_EXTENSIONS = {
5543
+ AF: {
5544
+ name: "Afghanistan",
5545
+ dial_code: "+93",
5546
+ },
5547
+ AX: {
5548
+ name: "Aland Islands",
5549
+ dial_code: "+358",
5550
+ },
5551
+ AL: {
5552
+ name: "Albania",
5553
+ dial_code: "+355",
5554
+ },
5555
+ DZ: {
5556
+ name: "Algeria",
5557
+ dial_code: "+213",
5558
+ },
5559
+ AS: {
5560
+ name: "AmericanSamoa",
5561
+ dial_code: "+1684",
5562
+ },
5563
+ AD: {
5564
+ name: "Andorra",
5565
+ dial_code: "+376",
5566
+ },
5567
+ AO: {
5568
+ name: "Angola",
5569
+ dial_code: "+244",
5570
+ },
5571
+ AI: {
5572
+ name: "Anguilla",
5573
+ dial_code: "+1264",
5574
+ },
5575
+ AQ: {
5576
+ name: "Antarctica",
5577
+ dial_code: "+672",
5578
+ },
5579
+ AG: {
5580
+ name: "Antigua and Barbuda",
5581
+ dial_code: "+1268",
5582
+ },
5583
+ AR: {
5584
+ name: "Argentina",
5585
+ dial_code: "+54",
5586
+ },
5587
+ AM: {
5588
+ name: "Armenia",
5589
+ dial_code: "+374",
5590
+ },
5591
+ AW: {
5592
+ name: "Aruba",
5593
+ dial_code: "+297",
5594
+ },
5595
+ AU: {
5596
+ name: "Australia",
5597
+ dial_code: "+61",
5598
+ },
5599
+ AT: {
5600
+ name: "Austria",
5601
+ dial_code: "+43",
5602
+ },
5603
+ AZ: {
5604
+ name: "Azerbaijan",
5605
+ dial_code: "+994",
5606
+ },
5607
+ BS: {
5608
+ name: "Bahamas",
5609
+ dial_code: "+1242",
5610
+ },
5611
+ BH: {
5612
+ name: "Bahrain",
5613
+ dial_code: "+973",
5614
+ },
5615
+ BD: {
5616
+ name: "Bangladesh",
5617
+ dial_code: "+880",
5618
+ },
5619
+ BB: {
5620
+ name: "Barbados",
5621
+ dial_code: "+1246",
5622
+ },
5623
+ BY: {
5624
+ name: "Belarus",
5625
+ dial_code: "+375",
5626
+ },
5627
+ BE: {
5628
+ name: "Belgium",
5629
+ dial_code: "+32",
5630
+ },
5631
+ BZ: {
5632
+ name: "Belize",
5633
+ dial_code: "+501",
5634
+ },
5635
+ BJ: {
5636
+ name: "Benin",
5637
+ dial_code: "+229",
5638
+ },
5639
+ BM: {
5640
+ name: "Bermuda",
5641
+ dial_code: "+1441",
5642
+ },
5643
+ BT: {
5644
+ name: "Bhutan",
5645
+ dial_code: "+975",
5646
+ },
5647
+ BO: {
5648
+ name: "Bolivia, Plurinational State of",
5649
+ dial_code: "+591",
5650
+ },
5651
+ BA: {
5652
+ name: "Bosnia and Herzegovina",
5653
+ dial_code: "+387",
5654
+ },
5655
+ BW: {
5656
+ name: "Botswana",
5657
+ dial_code: "+267",
5658
+ },
5659
+ BR: {
5660
+ name: "Brazil",
5661
+ dial_code: "+55",
5662
+ },
5663
+ IO: {
5664
+ name: "British Indian Ocean Territory",
5665
+ dial_code: "+246",
5666
+ },
5667
+ BN: {
5668
+ name: "Brunei Darussalam",
5669
+ dial_code: "+673",
5670
+ },
5671
+ BG: {
5672
+ name: "Bulgaria",
5673
+ dial_code: "+359",
5674
+ },
5675
+ BF: {
5676
+ name: "Burkina Faso",
5677
+ dial_code: "+226",
5678
+ },
5679
+ BI: {
5680
+ name: "Burundi",
5681
+ dial_code: "+257",
5682
+ },
5683
+ KH: {
5684
+ name: "Cambodia",
5685
+ dial_code: "+855",
5686
+ },
5687
+ CM: {
5688
+ name: "Cameroon",
5689
+ dial_code: "+237",
5690
+ },
5691
+ CA: {
5692
+ name: "Canada",
5693
+ dial_code: "+1",
5694
+ },
5695
+ CV: {
5696
+ name: "Cape Verde",
5697
+ dial_code: "+238",
5698
+ },
5699
+ KY: {
5700
+ name: "Cayman Islands",
5701
+ dial_code: "+ 345",
5702
+ },
5703
+ CF: {
5704
+ name: "Central African Republic",
5705
+ dial_code: "+236",
5706
+ },
5707
+ TD: {
5708
+ name: "Chad",
5709
+ dial_code: "+235",
5710
+ },
5711
+ CL: {
5712
+ name: "Chile",
5713
+ dial_code: "+56",
5714
+ },
5715
+ CN: {
5716
+ name: "China",
5717
+ dial_code: "+86",
5718
+ },
5719
+ CX: {
5720
+ name: "Christmas Island",
5721
+ dial_code: "+61",
5722
+ },
5723
+ CC: {
5724
+ name: "Cocos (Keeling) Islands",
5725
+ dial_code: "+61",
5726
+ },
5727
+ CO: {
5728
+ name: "Colombia",
5729
+ dial_code: "+57",
5730
+ },
5731
+ KM: {
5732
+ name: "Comoros",
5733
+ dial_code: "+269",
5734
+ },
5735
+ CG: {
5736
+ name: "Congo",
5737
+ dial_code: "+242",
5738
+ },
5739
+ CD: {
5740
+ name: "Congo, The Democratic Republic of the Congo",
5741
+ dial_code: "+243",
5742
+ },
5743
+ CK: {
5744
+ name: "Cook Islands",
5745
+ dial_code: "+682",
5746
+ },
5747
+ CR: {
5748
+ name: "Costa Rica",
5749
+ dial_code: "+506",
5750
+ },
5751
+ CI: {
5752
+ name: "Cote d'Ivoire",
5753
+ dial_code: "+225",
5754
+ },
5755
+ HR: {
5756
+ name: "Croatia",
5757
+ dial_code: "+385",
5758
+ },
5759
+ CU: {
5760
+ name: "Cuba",
5761
+ dial_code: "+53",
5762
+ },
5763
+ CY: {
5764
+ name: "Cyprus",
5765
+ dial_code: "+357",
5766
+ },
5767
+ CZ: {
5768
+ name: "Czech Republic",
5769
+ dial_code: "+420",
5770
+ },
5771
+ DK: {
5772
+ name: "Denmark",
5773
+ dial_code: "+45",
5774
+ },
5775
+ DJ: {
5776
+ name: "Djibouti",
5777
+ dial_code: "+253",
5778
+ },
5779
+ DM: {
5780
+ name: "Dominica",
5781
+ dial_code: "+1767",
5782
+ },
5783
+ DO: {
5784
+ name: "Dominican Republic",
5785
+ dial_code: "+1849",
5786
+ },
5787
+ EC: {
5788
+ name: "Ecuador",
5789
+ dial_code: "+593",
5790
+ },
5791
+ EG: {
5792
+ name: "Egypt",
5793
+ dial_code: "+20",
5794
+ },
5795
+ SV: {
5796
+ name: "El Salvador",
5797
+ dial_code: "+503",
5798
+ },
5799
+ GQ: {
5800
+ name: "Equatorial Guinea",
5801
+ dial_code: "+240",
5802
+ },
5803
+ ER: {
5804
+ name: "Eritrea",
5805
+ dial_code: "+291",
5806
+ },
5807
+ EE: {
5808
+ name: "Estonia",
5809
+ dial_code: "+372",
5810
+ },
5811
+ ET: {
5812
+ name: "Ethiopia",
5813
+ dial_code: "+251",
5814
+ },
5815
+ FK: {
5816
+ name: "Falkland Islands (Malvinas)",
5817
+ dial_code: "+500",
5818
+ },
5819
+ FO: {
5820
+ name: "Faroe Islands",
5821
+ dial_code: "+298",
5822
+ },
5823
+ FJ: {
5824
+ name: "Fiji",
5825
+ dial_code: "+679",
5826
+ },
5827
+ FI: {
5828
+ name: "Finland",
5829
+ dial_code: "+358",
5830
+ },
5831
+ FR: {
5832
+ name: "France",
5833
+ dial_code: "+33",
5834
+ },
5835
+ GF: {
5836
+ name: "French Guiana",
5837
+ dial_code: "+594",
5838
+ },
5839
+ PF: {
5840
+ name: "French Polynesia",
5841
+ dial_code: "+689",
5842
+ },
5843
+ GA: {
5844
+ name: "Gabon",
5845
+ dial_code: "+241",
5846
+ },
5847
+ GM: {
5848
+ name: "Gambia",
5849
+ dial_code: "+220",
5850
+ },
5851
+ GE: {
5852
+ name: "Georgia",
5853
+ dial_code: "+995",
5854
+ },
5855
+ DE: {
5856
+ name: "Germany",
5857
+ dial_code: "+49",
5858
+ },
5859
+ GH: {
5860
+ name: "Ghana",
5861
+ dial_code: "+233",
5862
+ },
5863
+ GI: {
5864
+ name: "Gibraltar",
5865
+ dial_code: "+350",
5866
+ },
5867
+ GR: {
5868
+ name: "Greece",
5869
+ dial_code: "+30",
5870
+ },
5871
+ GL: {
5872
+ name: "Greenland",
5873
+ dial_code: "+299",
5874
+ },
5875
+ GD: {
5876
+ name: "Grenada",
5877
+ dial_code: "+1473",
5878
+ },
5879
+ GP: {
5880
+ name: "Guadeloupe",
5881
+ dial_code: "+590",
5882
+ },
5883
+ GU: {
5884
+ name: "Guam",
5885
+ dial_code: "+1671",
5886
+ },
5887
+ GT: {
5888
+ name: "Guatemala",
5889
+ dial_code: "+502",
5890
+ },
5891
+ GG: {
5892
+ name: "Guernsey",
5893
+ dial_code: "+44",
5894
+ },
5895
+ GN: {
5896
+ name: "Guinea",
5897
+ dial_code: "+224",
5898
+ },
5899
+ GW: {
5900
+ name: "Guinea-Bissau",
5901
+ dial_code: "+245",
5902
+ },
5903
+ GY: {
5904
+ name: "Guyana",
5905
+ dial_code: "+595",
5906
+ },
5907
+ HT: {
5908
+ name: "Haiti",
5909
+ dial_code: "+509",
5910
+ },
5911
+ VA: {
5912
+ name: "Holy See (Vatican City State)",
5913
+ dial_code: "+379",
5914
+ },
5915
+ HN: {
5916
+ name: "Honduras",
5917
+ dial_code: "+504",
5918
+ },
5919
+ HK: {
5920
+ name: "Hong Kong",
5921
+ dial_code: "+852",
5922
+ },
5923
+ HU: {
5924
+ name: "Hungary",
5925
+ dial_code: "+36",
5926
+ },
5927
+ IS: {
5928
+ name: "Iceland",
5929
+ dial_code: "+354",
5930
+ },
5931
+ IN: {
5932
+ name: "India",
5933
+ dial_code: "+91",
5934
+ },
5935
+ ID: {
5936
+ name: "Indonesia",
5937
+ dial_code: "+62",
5938
+ },
5939
+ IR: {
5940
+ name: "Iran, Islamic Republic of Persian Gulf",
5941
+ dial_code: "+98",
5942
+ },
5943
+ IQ: {
5944
+ name: "Iraq",
5945
+ dial_code: "+964",
5946
+ },
5947
+ IE: {
5948
+ name: "Ireland",
5949
+ dial_code: "+353",
5950
+ },
5951
+ IM: {
5952
+ name: "Isle of Man",
5953
+ dial_code: "+44",
5954
+ },
5955
+ IL: {
5956
+ name: "Israel",
5957
+ dial_code: "+972",
5958
+ },
5959
+ IT: {
5960
+ name: "Italy",
5961
+ dial_code: "+39",
5962
+ },
5963
+ JM: {
5964
+ name: "Jamaica",
5965
+ dial_code: "+1876",
5966
+ },
5967
+ JP: {
5968
+ name: "Japan",
5969
+ dial_code: "+81",
5970
+ },
5971
+ JE: {
5972
+ name: "Jersey",
5973
+ dial_code: "+44",
5974
+ },
5975
+ JO: {
5976
+ name: "Jordan",
5977
+ dial_code: "+962",
5978
+ },
5979
+ KZ: {
5980
+ name: "Kazakhstan",
5981
+ dial_code: "+77",
5982
+ },
5983
+ KE: {
5984
+ name: "Kenya",
5985
+ dial_code: "+254",
5986
+ },
5987
+ KI: {
5988
+ name: "Kiribati",
5989
+ dial_code: "+686",
5990
+ },
5991
+ KP: {
5992
+ name: "Korea, Democratic People's Republic of Korea",
5993
+ dial_code: "+850",
5994
+ },
5995
+ KR: {
5996
+ name: "Korea, Republic of South Korea",
5997
+ dial_code: "+82",
5998
+ },
5999
+ KW: {
6000
+ name: "Kuwait",
6001
+ dial_code: "+965",
6002
+ },
6003
+ KG: {
6004
+ name: "Kyrgyzstan",
6005
+ dial_code: "+996",
6006
+ },
6007
+ LA: {
6008
+ name: "Laos",
6009
+ dial_code: "+856",
6010
+ },
6011
+ LV: {
6012
+ name: "Latvia",
6013
+ dial_code: "+371",
6014
+ },
6015
+ LB: {
6016
+ name: "Lebanon",
6017
+ dial_code: "+961",
6018
+ },
6019
+ LS: {
6020
+ name: "Lesotho",
6021
+ dial_code: "+266",
6022
+ },
6023
+ LR: {
6024
+ name: "Liberia",
6025
+ dial_code: "+231",
6026
+ },
6027
+ LY: {
6028
+ name: "Libyan Arab Jamahiriya",
6029
+ dial_code: "+218",
6030
+ },
6031
+ LI: {
6032
+ name: "Liechtenstein",
6033
+ dial_code: "+423",
6034
+ },
6035
+ LT: {
6036
+ name: "Lithuania",
6037
+ dial_code: "+370",
6038
+ },
6039
+ LU: {
6040
+ name: "Luxembourg",
6041
+ dial_code: "+352",
6042
+ },
6043
+ MO: {
6044
+ name: "Macao",
6045
+ dial_code: "+853",
6046
+ },
6047
+ MK: {
6048
+ name: "Macedonia",
6049
+ dial_code: "+389",
6050
+ },
6051
+ MG: {
6052
+ name: "Madagascar",
6053
+ dial_code: "+261",
6054
+ },
6055
+ MW: {
6056
+ name: "Malawi",
6057
+ dial_code: "+265",
6058
+ },
6059
+ MY: {
6060
+ name: "Malaysia",
6061
+ dial_code: "+60",
6062
+ },
6063
+ MV: {
6064
+ name: "Maldives",
6065
+ dial_code: "+960",
6066
+ },
6067
+ ML: {
6068
+ name: "Mali",
6069
+ dial_code: "+223",
6070
+ },
6071
+ MT: {
6072
+ name: "Malta",
6073
+ dial_code: "+356",
6074
+ },
6075
+ MH: {
6076
+ name: "Marshall Islands",
6077
+ dial_code: "+692",
6078
+ },
6079
+ MQ: {
6080
+ name: "Martinique",
6081
+ dial_code: "+596",
6082
+ },
6083
+ MR: {
6084
+ name: "Mauritania",
6085
+ dial_code: "+222",
6086
+ },
6087
+ MU: {
6088
+ name: "Mauritius",
6089
+ dial_code: "+230",
6090
+ },
6091
+ YT: {
6092
+ name: "Mayotte",
6093
+ dial_code: "+262",
6094
+ },
6095
+ MX: {
6096
+ name: "Mexico",
6097
+ dial_code: "+52",
6098
+ },
6099
+ FM: {
6100
+ name: "Micronesia, Federated States of Micronesia",
6101
+ dial_code: "+691",
6102
+ },
6103
+ MD: {
6104
+ name: "Moldova",
6105
+ dial_code: "+373",
6106
+ },
6107
+ MC: {
6108
+ name: "Monaco",
6109
+ dial_code: "+377",
6110
+ },
6111
+ MN: {
6112
+ name: "Mongolia",
6113
+ dial_code: "+976",
6114
+ },
6115
+ ME: {
6116
+ name: "Montenegro",
6117
+ dial_code: "+382",
6118
+ },
6119
+ MS: {
6120
+ name: "Montserrat",
6121
+ dial_code: "+1664",
6122
+ },
6123
+ MA: {
6124
+ name: "Morocco",
6125
+ dial_code: "+212",
6126
+ },
6127
+ MZ: {
6128
+ name: "Mozambique",
6129
+ dial_code: "+258",
6130
+ },
6131
+ MM: {
6132
+ name: "Myanmar",
6133
+ dial_code: "+95",
6134
+ },
6135
+ NA: {
6136
+ name: "Namibia",
6137
+ dial_code: "+264",
6138
+ },
6139
+ NR: {
6140
+ name: "Nauru",
6141
+ dial_code: "+674",
6142
+ },
6143
+ NP: {
6144
+ name: "Nepal",
6145
+ dial_code: "+977",
6146
+ },
6147
+ NL: {
6148
+ name: "Netherlands",
6149
+ dial_code: "+31",
6150
+ },
6151
+ AN: {
6152
+ name: "Netherlands Antilles",
6153
+ dial_code: "+599",
6154
+ },
6155
+ NC: {
6156
+ name: "New Caledonia",
6157
+ dial_code: "+687",
6158
+ },
6159
+ NZ: {
6160
+ name: "New Zealand",
6161
+ dial_code: "+64",
6162
+ },
6163
+ NI: {
6164
+ name: "Nicaragua",
6165
+ dial_code: "+505",
6166
+ },
6167
+ NE: {
6168
+ name: "Niger",
6169
+ dial_code: "+227",
6170
+ },
6171
+ NG: {
6172
+ name: "Nigeria",
6173
+ dial_code: "+234",
6174
+ },
6175
+ NU: {
6176
+ name: "Niue",
6177
+ dial_code: "+683",
6178
+ },
6179
+ NF: {
6180
+ name: "Norfolk Island",
6181
+ dial_code: "+672",
6182
+ },
6183
+ MP: {
6184
+ name: "Northern Mariana Islands",
6185
+ dial_code: "+1670",
6186
+ },
6187
+ NO: {
6188
+ name: "Norway",
6189
+ dial_code: "+47",
6190
+ },
6191
+ OM: {
6192
+ name: "Oman",
6193
+ dial_code: "+968",
6194
+ },
6195
+ PK: {
6196
+ name: "Pakistan",
6197
+ dial_code: "+92",
6198
+ },
6199
+ PW: {
6200
+ name: "Palau",
6201
+ dial_code: "+680",
6202
+ },
6203
+ PS: {
6204
+ name: "Palestinian Territory, Occupied",
6205
+ dial_code: "+970",
6206
+ },
6207
+ PA: {
6208
+ name: "Panama",
6209
+ dial_code: "+507",
6210
+ },
6211
+ PG: {
6212
+ name: "Papua New Guinea",
6213
+ dial_code: "+675",
6214
+ },
6215
+ PY: {
6216
+ name: "Paraguay",
6217
+ dial_code: "+595",
6218
+ },
6219
+ PE: {
6220
+ name: "Peru",
6221
+ dial_code: "+51",
6222
+ },
6223
+ PH: {
6224
+ name: "Philippines",
6225
+ dial_code: "+63",
6226
+ },
6227
+ PN: {
6228
+ name: "Pitcairn",
6229
+ dial_code: "+872",
6230
+ },
6231
+ PL: {
6232
+ name: "Poland",
6233
+ dial_code: "+48",
6234
+ },
6235
+ PT: {
6236
+ name: "Portugal",
6237
+ dial_code: "+351",
6238
+ },
6239
+ PR: {
6240
+ name: "Puerto Rico",
6241
+ dial_code: "+1939",
6242
+ },
6243
+ QA: {
6244
+ name: "Qatar",
6245
+ dial_code: "+974",
6246
+ },
6247
+ RO: {
6248
+ name: "Romania",
6249
+ dial_code: "+40",
6250
+ },
6251
+ RU: {
6252
+ name: "Russia",
6253
+ dial_code: "+7",
6254
+ },
6255
+ RW: {
6256
+ name: "Rwanda",
6257
+ dial_code: "+250",
6258
+ },
6259
+ RE: {
6260
+ name: "Reunion",
6261
+ dial_code: "+262",
6262
+ },
6263
+ BL: {
6264
+ name: "Saint Barthelemy",
6265
+ dial_code: "+590",
6266
+ },
6267
+ SH: {
6268
+ name: "Saint Helena, Ascension and Tristan Da Cunha",
6269
+ dial_code: "+290",
6270
+ },
6271
+ KN: {
6272
+ name: "Saint Kitts and Nevis",
6273
+ dial_code: "+1869",
6274
+ },
6275
+ LC: {
6276
+ name: "Saint Lucia",
6277
+ dial_code: "+1758",
6278
+ },
6279
+ MF: {
6280
+ name: "Saint Martin",
6281
+ dial_code: "+590",
6282
+ },
6283
+ PM: {
6284
+ name: "Saint Pierre and Miquelon",
6285
+ dial_code: "+508",
6286
+ },
6287
+ VC: {
6288
+ name: "Saint Vincent and the Grenadines",
6289
+ dial_code: "+1784",
6290
+ },
6291
+ WS: {
6292
+ name: "Samoa",
6293
+ dial_code: "+685",
6294
+ },
6295
+ SM: {
6296
+ name: "San Marino",
6297
+ dial_code: "+378",
6298
+ },
6299
+ ST: {
6300
+ name: "Sao Tome and Principe",
6301
+ dial_code: "+239",
6302
+ },
6303
+ SA: {
6304
+ name: "Saudi Arabia",
6305
+ dial_code: "+966",
6306
+ },
6307
+ SN: {
6308
+ name: "Senegal",
6309
+ dial_code: "+221",
6310
+ },
6311
+ RS: {
6312
+ name: "Serbia",
6313
+ dial_code: "+381",
6314
+ },
6315
+ SC: {
6316
+ name: "Seychelles",
6317
+ dial_code: "+248",
6318
+ },
6319
+ SL: {
6320
+ name: "Sierra Leone",
6321
+ dial_code: "+232",
6322
+ },
6323
+ SG: {
6324
+ name: "Singapore",
6325
+ dial_code: "+65",
6326
+ },
6327
+ SK: {
6328
+ name: "Slovakia",
6329
+ dial_code: "+421",
6330
+ },
6331
+ SI: {
6332
+ name: "Slovenia",
6333
+ dial_code: "+386",
6334
+ },
6335
+ SB: {
6336
+ name: "Solomon Islands",
6337
+ dial_code: "+677",
6338
+ },
6339
+ SO: {
6340
+ name: "Somalia",
6341
+ dial_code: "+252",
6342
+ },
6343
+ ZA: {
6344
+ name: "South Africa",
6345
+ dial_code: "+27",
6346
+ },
6347
+ SS: {
6348
+ name: "South Sudan",
6349
+ dial_code: "+211",
6350
+ },
6351
+ GS: {
6352
+ name: "South Georgia and the South Sandwich Islands",
6353
+ dial_code: "+500",
6354
+ },
6355
+ ES: {
6356
+ name: "Spain",
6357
+ dial_code: "+34",
6358
+ },
6359
+ LK: {
6360
+ name: "Sri Lanka",
6361
+ dial_code: "+94",
6362
+ },
6363
+ SD: {
6364
+ name: "Sudan",
6365
+ dial_code: "+249",
6366
+ },
6367
+ SR: {
6368
+ name: "Suriname",
6369
+ dial_code: "+597",
6370
+ },
6371
+ SJ: {
6372
+ name: "Svalbard and Jan Mayen",
6373
+ dial_code: "+47",
6374
+ },
6375
+ SZ: {
6376
+ name: "Swaziland",
6377
+ dial_code: "+268",
6378
+ },
6379
+ SE: {
6380
+ name: "Sweden",
6381
+ dial_code: "+46",
6382
+ },
6383
+ CH: {
6384
+ name: "Switzerland",
6385
+ dial_code: "+41",
6386
+ },
6387
+ SY: {
6388
+ name: "Syrian Arab Republic",
6389
+ dial_code: "+963",
6390
+ },
6391
+ TW: {
6392
+ name: "Taiwan",
6393
+ dial_code: "+886",
6394
+ },
6395
+ TJ: {
6396
+ name: "Tajikistan",
6397
+ dial_code: "+992",
6398
+ },
6399
+ TZ: {
6400
+ name: "Tanzania, United Republic of Tanzania",
6401
+ dial_code: "+255",
6402
+ },
6403
+ TH: {
6404
+ name: "Thailand",
6405
+ dial_code: "+66",
6406
+ },
6407
+ TL: {
6408
+ name: "Timor-Leste",
6409
+ dial_code: "+670",
6410
+ },
6411
+ TG: {
6412
+ name: "Togo",
6413
+ dial_code: "+228",
6414
+ },
6415
+ TK: {
6416
+ name: "Tokelau",
6417
+ dial_code: "+690",
6418
+ },
6419
+ TO: {
6420
+ name: "Tonga",
6421
+ dial_code: "+676",
6422
+ },
6423
+ TT: {
6424
+ name: "Trinidad and Tobago",
6425
+ dial_code: "+1868",
6426
+ },
6427
+ TN: {
6428
+ name: "Tunisia",
6429
+ dial_code: "+216",
6430
+ },
6431
+ TR: {
6432
+ name: "Turkey",
6433
+ dial_code: "+90",
6434
+ },
6435
+ TM: {
6436
+ name: "Turkmenistan",
6437
+ dial_code: "+993",
6438
+ },
6439
+ TC: {
6440
+ name: "Turks and Caicos Islands",
6441
+ dial_code: "+1649",
6442
+ },
6443
+ TV: {
6444
+ name: "Tuvalu",
6445
+ dial_code: "+688",
6446
+ },
6447
+ UG: {
6448
+ name: "Uganda",
6449
+ dial_code: "+256",
6450
+ },
6451
+ UA: {
6452
+ name: "Ukraine",
6453
+ dial_code: "+380",
6454
+ },
6455
+ AE: {
6456
+ name: "United Arab Emirates",
6457
+ dial_code: "+971",
6458
+ },
6459
+ GB: {
6460
+ name: "United Kingdom",
6461
+ dial_code: "+44",
6462
+ },
6463
+ US: {
6464
+ name: "United States",
6465
+ dial_code: "+1",
6466
+ },
6467
+ UY: {
6468
+ name: "Uruguay",
6469
+ dial_code: "+598",
6470
+ },
6471
+ UZ: {
6472
+ name: "Uzbekistan",
6473
+ dial_code: "+998",
6474
+ },
6475
+ VU: {
6476
+ name: "Vanuatu",
6477
+ dial_code: "+678",
6478
+ },
6479
+ VE: {
6480
+ name: "Venezuela, Bolivarian Republic of Venezuela",
6481
+ dial_code: "+58",
6482
+ },
6483
+ VN: {
6484
+ name: "Vietnam",
6485
+ dial_code: "+84",
6486
+ },
6487
+ VG: {
6488
+ name: "Virgin Islands, British",
6489
+ dial_code: "+1284",
6490
+ },
6491
+ VI: {
6492
+ name: "Virgin Islands, U.S.",
6493
+ dial_code: "+1340",
6494
+ },
6495
+ WF: {
6496
+ name: "Wallis and Futuna",
6497
+ dial_code: "+681",
6498
+ },
6499
+ YE: {
6500
+ name: "Yemen",
6501
+ dial_code: "+967",
6502
+ },
6503
+ ZM: {
6504
+ name: "Zambia",
6505
+ dial_code: "+260",
6506
+ },
6507
+ ZW: {
6508
+ name: "Zimbabwe",
6509
+ dial_code: "+263",
6510
+ },
6511
+ };
6512
+
5473
6513
  const style$6 = {
5474
6514
  FormWrapper: {},
5475
6515
  ErrorInput: {
@@ -5572,9 +6612,12 @@ const vanillaStyle$3 = `
5572
6612
  flex-direction: column;
5573
6613
  }
5574
6614
 
6615
+ sl-select#phoneNumberCountryCode::part(menu) {
6616
+ width: 450px;
6617
+ }
5575
6618
  `;
5576
6619
  const UserInfoFormView = (props) => {
5577
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
6620
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
5578
6621
  const { states, states: { formState }, callbacks, text, refs, data, } = props;
5579
6622
  const { classes } = sheet$5;
5580
6623
  const bankingCollectionText = global.intl.formatMessage({
@@ -5583,6 +6626,20 @@ const UserInfoFormView = (props) => {
5583
6626
  }, {
5584
6627
  termsAndConditionsLink: (index.h("a", { href: "https://app.impact.com/", target: "_blank" }, text.termsAndConditionsLabel)),
5585
6628
  });
6629
+ let regionLabel = undefined;
6630
+ switch (data.regionLabelEnum) {
6631
+ case "STATE":
6632
+ regionLabel = text.state;
6633
+ break;
6634
+ case "PROVINCE":
6635
+ regionLabel = text.province;
6636
+ break;
6637
+ case "REGION":
6638
+ regionLabel = text.region;
6639
+ break;
6640
+ default:
6641
+ regionLabel = text.state;
6642
+ }
5586
6643
  return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
5587
6644
  index.h("style", { type: "text/css" },
5588
6645
  styleString$5,
@@ -5617,18 +6674,18 @@ const UserInfoFormView = (props) => {
5617
6674
  index.h("div", { class: classes.InputContainer },
5618
6675
  index.h("sl-input", Object.assign({ exportparts: "label: input-label", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
5619
6676
  class: classes.ErrorInput,
5620
- helpText: sqmInvoiceTableView.getIsRequiredErrorMessage(text.firstName, text.error.fieldRequiredError),
6677
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.firstName, formState.errors.firstName),
5621
6678
  }
5622
6679
  : {}), { id: "firstName", name: "/firstName", required: true })),
5623
6680
  index.h("sl-input", Object.assign({ exportparts: "label: input-label", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
5624
6681
  class: classes.ErrorInput,
5625
- helpText: sqmInvoiceTableView.getIsRequiredErrorMessage(text.lastName, text.error.fieldRequiredError),
6682
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.lastName, formState.errors.lastName),
5626
6683
  }
5627
6684
  : {}), { id: "lastName", name: "/lastName", required: true })),
5628
6685
  index.h("sl-input", { exportparts: "label: input-label", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
5629
6686
  index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
5630
6687
  class: classes.ErrorInput,
5631
- helpText: sqmInvoiceTableView.getIsRequiredErrorMessage(text.country, text.error.fieldRequiredError),
6688
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.country, formState.errors.countryCode),
5632
6689
  }
5633
6690
  : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("countryCode", e) }),
5634
6691
  index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
@@ -5639,9 +6696,66 @@ const UserInfoFormView = (props) => {
5639
6696
  } }), (_e = data === null || data === void 0 ? void 0 : data.countries) === null || _e === void 0 ? void 0 :
5640
6697
  _e.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data === null || data === void 0 ? void 0 : data.allCountries) === null || _f === void 0 ? void 0 :
5641
6698
  _f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
5642
- index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.currency) ? {
6699
+ index.h("div", { style: { display: "flex", gap: "4px" } },
6700
+ index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label", name: "/phoneNumberCountryCode", label: text.phoneNumber, style: { minWidth: "140px" }, value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
6701
+ class: classes.ErrorInput,
6702
+ }
6703
+ : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
6704
+ index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
6705
+ // Stop shoelace intercepting key presses
6706
+ e.stopPropagation();
6707
+ }, "onSl-input": (e) => {
6708
+ callbacks.setPhoneCountrySearch(e.target.value);
6709
+ } }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
6710
+ _h.map((c) => {
6711
+ var _a, _b;
6712
+ return (index.h("sl-menu-item", { style: { width: "500px" }, value: c.countryCode },
6713
+ index.h("div", { slot: "prefix", style: { marginRight: "8px" } }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
6714
+ _b.dial_code));
6715
+ }), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
6716
+ _j.map((c) => {
6717
+ var _a, _b;
6718
+ return (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
6719
+ index.h("div", { slot: "prefix", style: { marginRight: "8px" } }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
6720
+ _b.dial_code));
6721
+ })),
6722
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label", label: " ", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, style: { marginTop: "2px", width: "362px" }, validationError: ({ value }) =>
6723
+ // Naive phone number validation
6724
+ sqmInvoiceTableView.validateBillingField(/[a-zA-Z]+/, value) &&
6725
+ sqmInvoiceTableView.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError), disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
6726
+ class: classes.ErrorInput,
6727
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
6728
+ }
6729
+ : {}), { required: true }))),
6730
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
6731
+ // Checks for non-ASCII characters
6732
+ !sqmInvoiceTableView.validateBillingField(/^[\x20-\xFF]+$/, value) &&
6733
+ sqmInvoiceTableView.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
6734
+ class: classes.ErrorInput,
6735
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.address, formState.errors.address),
6736
+ }
6737
+ : {}), { required: true })),
6738
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
6739
+ // Checks for non-ASCII characters
6740
+ !sqmInvoiceTableView.validateBillingField(/^[\x20-\xFF]+$/, value) &&
6741
+ sqmInvoiceTableView.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
5643
6742
  class: classes.ErrorInput,
5644
- helpText: sqmInvoiceTableView.getIsRequiredErrorMessage(text.currency, text.error.fieldRequiredError),
6743
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.city, formState.errors.city),
6744
+ }
6745
+ : {}), { required: true })),
6746
+ !states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
6747
+ class: classes.ErrorInput,
6748
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.state, formState.errors.state),
6749
+ }
6750
+ : {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
6751
+ index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
6752
+ class: classes.ErrorInput,
6753
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.postalCode, formState.errors.postalCode),
6754
+ }
6755
+ : {}), { required: true })),
6756
+ index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
6757
+ class: classes.ErrorInput,
6758
+ helpText: sqmInvoiceTableView.formatErrorMessage(text.currency, formState.errors.currency),
5645
6759
  }
5646
6760
  : {}), { required: true, ref: (el) => (refs.currencyRef.current = el) }),
5647
6761
  index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCurrencyText, onKeyDown: (e) => {
@@ -5649,12 +6763,12 @@ const UserInfoFormView = (props) => {
5649
6763
  e.stopPropagation();
5650
6764
  }, "onSl-input": (e) => {
5651
6765
  callbacks.setCurrencySearch(e.target.value);
5652
- } }), (_h = data === null || data === void 0 ? void 0 : data.currencies) === null || _h === void 0 ? void 0 :
5653
- _h.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
6766
+ } }), (_s = data === null || data === void 0 ? void 0 : data.currencies) === null || _s === void 0 ? void 0 :
6767
+ _s.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
5654
6768
  c.currencyCode,
5655
6769
  " - ",
5656
- c.displayName))), (_j = data === null || data === void 0 ? void 0 : data.allCurrencies) === null || _j === void 0 ? void 0 :
5657
- _j.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
6770
+ c.displayName))), (_t = data === null || data === void 0 ? void 0 : data.allCurrencies) === null || _t === void 0 ? void 0 :
6771
+ _t.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
5658
6772
  c.currencyCode,
5659
6773
  " - ",
5660
6774
  c.displayName)))),
@@ -5662,13 +6776,14 @@ const UserInfoFormView = (props) => {
5662
6776
  index.h("sl-checkbox", { exportparts: "label: input-label", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
5663
6777
  e.target.value = e.target.checked;
5664
6778
  }, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
5665
- ((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, sqmInvoiceTableView.getIsRequiredErrorMessage(text.termsAndConditionsLabel, text.error.fieldRequiredError))))),
6779
+ ((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, sqmInvoiceTableView.formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
5666
6780
  index.h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
5667
6781
  };
5668
6782
 
5669
6783
  function useUserInfoForm(props) {
5670
6784
  var _a, _b, _c, _d;
5671
6785
  const currencyRef = stencilHooks_module.useRef(undefined);
6786
+ const phoneCountryRef = stencilHooks_module.useRef(undefined);
5672
6787
  const formRef = stencilHooks_module.useRef(null);
5673
6788
  const context = index_module.In(TAX_FORM_CONTEXT_NAMESPACE);
5674
6789
  const countries = index_module.In(SORTED_COUNTRIES_NAMESPACE);
@@ -5678,12 +6793,14 @@ function useUserInfoForm(props) {
5678
6793
  const _currencies = index_module.In(CURRENCIES_NAMESPACE);
5679
6794
  const currencies = stencilHooks_module.useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
5680
6795
  const [countrySearch, setCountrySearch] = stencilHooks_module.useState("");
6796
+ const [phoneCountrySearch, setPhoneCountrySearch] = stencilHooks_module.useState("");
5681
6797
  const [filteredCountries, setFilteredCountries] = stencilHooks_module.useState(countries || []);
6798
+ const [filteredPhoneCountries, setFilteredPhoneCountries] = stencilHooks_module.useState(countries || []);
5682
6799
  const [currencySearch, setCurrencySearch] = stencilHooks_module.useState("");
5683
6800
  const [filteredCurrencies, setFilteredCurrencies] = stencilHooks_module.useState(currencies || []);
5684
6801
  const [formErrors, setErrors] = stencilHooks_module.useState({});
5685
6802
  stencilHooks_module.useEffect(() => {
5686
- var _a, _b, _c;
6803
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5687
6804
  const user = data === null || data === void 0 ? void 0 : data.user;
5688
6805
  if (!user || step !== "/1")
5689
6806
  return;
@@ -5698,6 +6815,12 @@ function useUserInfoForm(props) {
5698
6815
  lastName: user.impactConnection.user.lastName,
5699
6816
  countryCode: user.impactConnection.publisher.countryCode,
5700
6817
  currency: user.impactConnection.publisher.currency,
6818
+ phoneNumberCountryCode: user.impactConnection.publisher.phoneNumberCountryCode,
6819
+ phoneNumber: user.impactConnection.publisher.phoneNumber,
6820
+ address: user.impactConnection.publisher.billingAddress,
6821
+ city: user.impactConnection.publisher.billingCity,
6822
+ state: user.impactConnection.publisher.billingState,
6823
+ postalCode: user.impactConnection.publisher.billingPostalCode,
5701
6824
  });
5702
6825
  }
5703
6826
  else if (!(userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.email)) {
@@ -5708,6 +6831,12 @@ function useUserInfoForm(props) {
5708
6831
  lastName: user.lastName,
5709
6832
  countryCode: user.countryCode || "US",
5710
6833
  currency: (_c = user.customFields) === null || _c === void 0 ? void 0 : _c.currency,
6834
+ phoneNumberCountryCode: ((_d = user.customFields) === null || _d === void 0 ? void 0 : _d.phoneNumberCountryCode) || "US",
6835
+ phoneNumber: (_e = user.customFields) === null || _e === void 0 ? void 0 : _e.phoneNumber,
6836
+ address: (_f = user.customFields) === null || _f === void 0 ? void 0 : _f.address,
6837
+ city: (_g = user.customFields) === null || _g === void 0 ? void 0 : _g.city,
6838
+ state: (_h = user.customFields) === null || _h === void 0 ? void 0 : _h.state,
6839
+ postalCode: (_j = user.customFields) === null || _j === void 0 ? void 0 : _j.postalCode,
5711
6840
  });
5712
6841
  }
5713
6842
  }, [data, step, userFormContext]);
@@ -5720,8 +6849,10 @@ function useUserInfoForm(props) {
5720
6849
  ...userFormContext,
5721
6850
  [field]: value,
5722
6851
  });
5723
- if (field === "countryCode")
6852
+ if (field === "countryCode") {
6853
+ phoneCountryRef.current.value = value;
5724
6854
  currencyRef.current.value = "";
6855
+ }
5725
6856
  };
5726
6857
  stencilHooks_module.useEffect(() => {
5727
6858
  if (!(countries === null || countries === void 0 ? void 0 : countries.length))
@@ -5733,6 +6864,16 @@ function useUserInfoForm(props) {
5733
6864
  setFilteredCountries(countries.filter((c) => c.displayName.toLowerCase().includes(countrySearch.toLowerCase())) || []);
5734
6865
  }
5735
6866
  }, [countrySearch, countries]);
6867
+ stencilHooks_module.useEffect(() => {
6868
+ if (!(countries === null || countries === void 0 ? void 0 : countries.length))
6869
+ return;
6870
+ if (phoneCountrySearch.trim() === "") {
6871
+ setFilteredPhoneCountries(countries || []);
6872
+ }
6873
+ else {
6874
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
6875
+ }
6876
+ }, [phoneCountrySearch, countries]);
5736
6877
  stencilHooks_module.useEffect(() => {
5737
6878
  if (!(currencies === null || currencies === void 0 ? void 0 : currencies.length))
5738
6879
  return;
@@ -5752,10 +6893,6 @@ function useUserInfoForm(props) {
5752
6893
  return;
5753
6894
  const key = control.name;
5754
6895
  const value = control.value;
5755
- // required validation
5756
- if (control.required && !value) {
5757
- jsonpointer.jsonpointer.set(errors, key, props.fieldRequiredError);
5758
- }
5759
6896
  // custom validation
5760
6897
  if (typeof control.validationError === "function") {
5761
6898
  const validate = control.validationError;
@@ -5763,6 +6900,11 @@ function useUserInfoForm(props) {
5763
6900
  if (validationError)
5764
6901
  jsonpointer.jsonpointer.set(errors, key, validationError);
5765
6902
  }
6903
+ // required validation
6904
+ if (control.required) {
6905
+ if (!value || (typeof value === "string" && value.trim() === ""))
6906
+ jsonpointer.jsonpointer.set(errors, key, props.fieldRequiredError);
6907
+ }
5766
6908
  jsonpointer.jsonpointer.set(formData, key, value);
5767
6909
  });
5768
6910
  if (Object.keys(errors).length) {
@@ -5773,12 +6915,22 @@ function useUserInfoForm(props) {
5773
6915
  const { allowBankingCollection, ...userData } = formData;
5774
6916
  setUserFormContext({
5775
6917
  ...userFormContext,
6918
+ phoneNumberCountryCode: userData.phoneNumberCountryCode,
6919
+ phoneNumber: userData.phoneNumber,
5776
6920
  countryCode: userData.countryCode,
6921
+ address: userData.address,
6922
+ city: userData.city,
6923
+ state: userData.state,
6924
+ postalCode: userData.postalCode,
5777
6925
  currency: userData.currency,
5778
6926
  });
5779
6927
  const nextStep = context.overrideNextStep || "/2";
5780
6928
  setStep(nextStep);
5781
6929
  }
6930
+ const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
6931
+ const regionObj = hasStates
6932
+ ? sqmInvoiceTableView.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
6933
+ : {};
5782
6934
  return {
5783
6935
  setStep: setStep,
5784
6936
  onSubmit,
@@ -5786,20 +6938,26 @@ function useUserInfoForm(props) {
5786
6938
  callbacks: {
5787
6939
  setCurrencySearch,
5788
6940
  setCountrySearch,
6941
+ setPhoneCountrySearch,
5789
6942
  onFormChange,
5790
6943
  },
5791
6944
  refs: {
5792
6945
  formRef,
5793
6946
  currencyRef,
6947
+ phoneCountryRef,
5794
6948
  },
5795
6949
  data: {
5796
6950
  currencies: filteredCurrencies,
5797
6951
  countries: filteredCountries,
6952
+ phoneCountries: filteredPhoneCountries,
5798
6953
  allCurrencies: currencies,
5799
6954
  allCountries: countries,
6955
+ regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
6956
+ regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
5800
6957
  },
5801
6958
  states: {
5802
6959
  step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
6960
+ hideState: !hasStates,
5803
6961
  hideSteps: !!context.hideSteps,
5804
6962
  disabled: loading,
5805
6963
  loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
@@ -5834,6 +6992,34 @@ const TaxForm = class {
5834
6992
  * @uiName Country field label
5835
6993
  */
5836
6994
  this.country = "Country";
6995
+ /**
6996
+ * @uiName Phone number field label
6997
+ */
6998
+ this.phoneNumber = "Phone number";
6999
+ /**
7000
+ * @uiName Address field label
7001
+ */
7002
+ this.address = "Address";
7003
+ /**
7004
+ * @uiName City field label
7005
+ */
7006
+ this.city = "City";
7007
+ /**
7008
+ * @uiName State field label
7009
+ */
7010
+ this.state = "State";
7011
+ /**
7012
+ * @uiName State field label
7013
+ */
7014
+ this.province = "Province";
7015
+ /**
7016
+ * @uiName State field label
7017
+ */
7018
+ this.region = "Region";
7019
+ /**
7020
+ * @uiName Postal code field label
7021
+ */
7022
+ this.postalCode = "Postal code";
5837
7023
  /**
5838
7024
  * @uiName Currency field label
5839
7025
  */
@@ -5904,6 +7090,16 @@ const TaxForm = class {
5904
7090
  * @uiName Empty form field error message
5905
7091
  */
5906
7092
  this.fieldRequiredError = "{fieldName} is required";
7093
+ /**
7094
+ * Displayed under a field when it has an invalid entry.
7095
+ * @uiName Form field error message
7096
+ */
7097
+ this.fieldInvalidError = "{fieldName} is invalid";
7098
+ /**
7099
+ * Displayed under Address or City fields that includes invalid characters (non-ASCII).
7100
+ * @uiName Invalid character error message
7101
+ */
7102
+ this.invalidCharacterError = "{fieldName} includes characters that aren't supported.";
5907
7103
  /**
5908
7104
  * Part of the alert displayed at the top of the page.
5909
7105
  * @uiName Page load error message title
@@ -5930,10 +7126,12 @@ const TaxForm = class {
5930
7126
  ...props,
5931
7127
  error: {
5932
7128
  fieldRequiredError: props.fieldRequiredError,
7129
+ fieldInvalidError: props.fieldInvalidError,
5933
7130
  generalTitle: props.generalErrorTitle,
5934
7131
  generalDescription: props.generalErrorDescription,
5935
7132
  loadingErrorAlertHeader: props.loadingErrorAlertHeader,
5936
7133
  loadingErrorAlertDescription: props.loadingErrorAlertDescription,
7134
+ invalidCharacterError: props.invalidCharacterError,
5937
7135
  },
5938
7136
  };
5939
7137
  }
@@ -5964,11 +7162,13 @@ function useDemoUserInfoForm(props) {
5964
7162
  currencies: [{ currencyCode: "CAD", displayName: "CAD" }],
5965
7163
  allCurrencies: [{ currencyCode: "CAD", displayName: "CAD" }],
5966
7164
  countries: [{ countryCode: "CA", displayName: "Canada" }],
7165
+ phoneCountries: [{ countryCode: "CA", displayName: "Canada" }],
5967
7166
  allCountries: [{ countryCode: "CA", displayName: "Canada" }],
5968
7167
  },
5969
7168
  callbacks: {
5970
7169
  setCurrencySearch: (c) => console.log(c),
5971
7170
  setCountrySearch: (c) => console.log(c),
7171
+ setPhoneCountrySearch: (c) => console.log(c),
5972
7172
  onFormChange: () => { },
5973
7173
  },
5974
7174
  states: {