@saasquatch/mint-components 2.3.0-6 → 2.3.0-8

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 (67) hide show
  1. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +50 -743
  2. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +4 -4
  3. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +16 -31
  4. package/dist/cjs/sqm-stencilbook.cjs.entry.js +253 -76
  5. package/dist/cjs/sqm-user-info-form-view-374a3f01.js +1427 -0
  6. package/dist/cjs/subregions-984e30d7.js +1505 -0
  7. package/dist/cjs/{useIndirectTaxForm-c3c1ec56.js → useIndirectTaxForm-112914a0.js} +5 -5
  8. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +16 -31
  9. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
  10. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.js +6 -0
  11. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.js +13 -2
  12. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.js +151 -0
  13. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +18 -7
  14. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +22 -19
  15. package/dist/collection/components/tax-and-cash/utils.js +55 -0
  16. package/dist/esm/sqm-banking-info-form_10.entry.js +38 -731
  17. package/dist/esm/sqm-big-stat_47.entry.js +2 -2
  18. package/dist/esm/sqm-email-verification_2.entry.js +16 -31
  19. package/dist/esm/sqm-stencilbook.entry.js +217 -40
  20. package/dist/esm/sqm-user-info-form-view-5322525c.js +1421 -0
  21. package/dist/esm/subregions-7c9778d0.js +1492 -0
  22. package/dist/esm/{useIndirectTaxForm-b2888ea5.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  23. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  24. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  25. package/dist/esm-es5/sqm-email-verification_2.entry.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-b2888ea5.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  30. package/dist/mint-components/mint-components.esm.js +1 -1
  31. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  32. package/dist/mint-components/{p-abe9f5b1.js → p-2d4132fb.js} +4 -4
  33. package/dist/mint-components/{p-e7f09044.entry.js → p-459c4251.entry.js} +6 -31
  34. package/dist/mint-components/p-5623f1e0.js +1 -0
  35. package/dist/mint-components/{p-b419f9ac.entry.js → p-5bc707cf.entry.js} +1 -1
  36. package/dist/mint-components/p-6eebbc59.entry.js +83 -0
  37. package/dist/mint-components/{p-58c24352.system.js → p-6ef373ed.system.js} +1 -1
  38. package/dist/mint-components/p-7a4cf6c9.system.entry.js +1 -0
  39. package/dist/mint-components/p-7f29622d.js +1 -0
  40. package/dist/mint-components/{p-a38eece5.system.entry.js → p-8a08cec6.system.entry.js} +1 -1
  41. package/dist/mint-components/p-90200f08.system.entry.js +1 -0
  42. package/dist/mint-components/p-91295327.entry.js +9 -0
  43. package/dist/mint-components/p-b21c53cb.system.entry.js +1 -0
  44. package/dist/mint-components/p-bd03efe0.system.js +1 -0
  45. package/dist/mint-components/p-c13c20b2.system.js +1 -0
  46. package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +0 -1
  47. package/dist/types/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.d.ts +1 -0
  48. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.d.ts +19 -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/sqm-user-info-form-view-0e1ddbe4.js +0 -1682
  54. package/dist/cjs/utils-a3b3d05b.js +0 -478
  55. package/dist/esm/sqm-user-info-form-view-e1ba6009.js +0 -1677
  56. package/dist/esm/utils-4f5cd04c.js +0 -467
  57. package/dist/esm-es5/sqm-user-info-form-view-e1ba6009.js +0 -1
  58. package/dist/esm-es5/utils-4f5cd04c.js +0 -1
  59. package/dist/mint-components/p-12d11abc.system.entry.js +0 -1
  60. package/dist/mint-components/p-1e6a2945.js +0 -1
  61. package/dist/mint-components/p-88e427ac.system.entry.js +0 -1
  62. package/dist/mint-components/p-a0eb0331.entry.js +0 -9
  63. package/dist/mint-components/p-b222bace.system.entry.js +0 -1
  64. package/dist/mint-components/p-b96ed8eb.js +0 -1
  65. package/dist/mint-components/p-cdabd9de.system.js +0 -1
  66. package/dist/mint-components/p-ebc519bc.system.js +0 -1
  67. package/dist/mint-components/p-ffcebe78.entry.js +0 -83
@@ -16,12 +16,12 @@ const reRender = require('./re-render-72a0ef45.js');
16
16
  const useChildElements = require('./useChildElements-041127d7.js');
17
17
  const luxon = require('./luxon-c1ad356a.js');
18
18
  const useReferralTable = require('./useReferralTable-6e9de0d5.js');
19
- const sqmUserInfoFormView = require('./sqm-user-info-form-view-0e1ddbe4.js');
20
- const utils$1 = require('./utils-a3b3d05b.js');
19
+ const sqmUserInfoFormView = require('./sqm-user-info-form-view-374a3f01.js');
20
+ const subregions = require('./subregions-984e30d7.js');
21
21
  const data = require('./data-89ac73dd.js');
22
22
  const keys = require('./keys-5a2c9ed2.js');
23
23
  const eventKeys = require('./eventKeys-7af4df4d.js');
24
- const useIndirectTaxForm = require('./useIndirectTaxForm-c3c1ec56.js');
24
+ const useIndirectTaxForm = require('./useIndirectTaxForm-112914a0.js');
25
25
 
26
26
  function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
27
27
  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;
@@ -2071,7 +2071,7 @@ function useDocusignForm(props) {
2071
2071
  const [showExitButton, setShowExitButton] = domContextHooks_module.useState(false);
2072
2072
  const [showModal, setShowModal] = domContextHooks_module.useState(true);
2073
2073
  // Only look at current document if it's valid (same as required type)
2074
- const existingDocumentType = utils$1.validTaxDocument(publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) && (publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument)
2074
+ const existingDocumentType = subregions.validTaxDocument(publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) && (publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument)
2075
2075
  ? publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType : undefined;
2076
2076
  const actualDocumentType = existingDocumentType ||
2077
2077
  getDocumentType(participantType) || (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType);
@@ -2169,7 +2169,7 @@ function useDocusignForm(props) {
2169
2169
  },
2170
2170
  docusignStatus,
2171
2171
  documentType: actualDocumentType,
2172
- documentTypeString: utils$1.taxTypeToName(actualDocumentType),
2172
+ documentTypeString: subregions.taxTypeToName(actualDocumentType),
2173
2173
  showExitButton,
2174
2174
  showModal,
2175
2175
  },
@@ -3118,7 +3118,7 @@ function useDemoIndirectTaxForm(props) {
3118
3118
  setCountrySearch: (c) => console.log(c),
3119
3119
  },
3120
3120
  data: {
3121
- esRegions: utils$1.INDIRECT_TAX_SPAIN_REGIONS,
3121
+ esRegions: subregions.INDIRECT_TAX_SPAIN_REGIONS,
3122
3122
  countries: [
3123
3123
  {
3124
3124
  countryCode: "CA",
@@ -3137,7 +3137,7 @@ function useDemoIndirectTaxForm(props) {
3137
3137
  displayName: "United States",
3138
3138
  },
3139
3139
  ],
3140
- provinces: utils$1.INDIRECT_TAX_PROVINCES,
3140
+ provinces: subregions.INDIRECT_TAX_PROVINCES,
3141
3141
  },
3142
3142
  text: props.getTextProps(),
3143
3143
  refs: {
@@ -3653,6 +3653,14 @@ const style$4 = {
3653
3653
  color: "var(--sl-color-white)",
3654
3654
  },
3655
3655
  },
3656
+ DangerBadge: {
3657
+ "&::part(base)": {
3658
+ textAlign: "center",
3659
+ whiteSpace: "pre-line",
3660
+ background: "var(--sqm-danger-color-icon)",
3661
+ color: "var(--sl-color-white)",
3662
+ },
3663
+ },
3656
3664
  Container: {
3657
3665
  display: "flex",
3658
3666
  flexDirection: "column",
@@ -3673,8 +3681,11 @@ function PayoutDetailsCardView(props) {
3673
3681
  index.h("sqm-skeleton", { width: "25%", height: "16px" })));
3674
3682
  };
3675
3683
  const renderStatusBadge = (status, statusBadgeText) => {
3676
- const badgeType = status === "nextPayout" ? "success" : "primary";
3677
- const badgeClass = badgeType === "success" ? classes.SuccessBadge : classes.PrimaryBadge;
3684
+ const badgeClass = status === "nextPayout"
3685
+ ? classes.SuccessBadge
3686
+ : status === "payoutToday"
3687
+ ? classes.PrimaryBadge
3688
+ : classes.DangerBadge;
3678
3689
  const statusText = global.intl.formatMessage({
3679
3690
  id: "badgeText",
3680
3691
  defaultMessage: statusBadgeText,
@@ -3832,710 +3843,6 @@ function useDemoPayoutDetailsCard(props) {
3832
3843
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
3833
3844
  }
3834
3845
 
3835
- const style$5 = {
3836
- ErrorAlertContainer: {
3837
- "&::part(base)": {
3838
- backgroundColor: "var(--sl-color-red-100)",
3839
- borderTop: "none",
3840
- },
3841
- },
3842
- WarningAlertContainer: {
3843
- "&::part(base)": {
3844
- backgroundColor: "var(--sl-color-yellow-100)",
3845
- borderTop: "none",
3846
- maxWidth: "600px",
3847
- },
3848
- },
3849
- WarningHoldAlertContainer: {
3850
- marginLeft: "-20px",
3851
- "&::part(base)": {
3852
- maxWidth: "850px",
3853
- border: "none",
3854
- backgroundColor: "transparent",
3855
- color: "var(--sqm-text)",
3856
- },
3857
- "& sl-icon::part(base)": {
3858
- color: "var(--sqm-warning-color-icon)",
3859
- },
3860
- },
3861
- ErrorHoldAlertContainer: {
3862
- marginLeft: "-20px",
3863
- "&::part(base)": {
3864
- maxWidth: "850px",
3865
- border: "none",
3866
- backgroundColor: "transparent",
3867
- color: "var(--sqm-text)",
3868
- },
3869
- "& sl-icon::part(base)": {
3870
- color: "var(--sqm-danger-color-icon)",
3871
- },
3872
- },
3873
- ExpiringSoonAlertContainer: {
3874
- "&::part(base)": {
3875
- backgroundColor: "var(--sl-color-yellow-100)",
3876
- borderTop: "none",
3877
- },
3878
- },
3879
- BankingInformationContainer: {
3880
- maxWidth: "700px",
3881
- },
3882
- IndirectTaxPreviewContainer: {
3883
- marginTop: "var(--sl-spacing-x-large)",
3884
- borderTop: "1px solid var(--sl-color-neutral-200)",
3885
- },
3886
- IndirectTaxPreviewHeaderContainer: {
3887
- marginTop: "var(--sl-spacing-large)",
3888
- marginBottom: "var(--sl-spacing-xx-small)",
3889
- margin: "0",
3890
- display: "flex",
3891
- alignItems: "center",
3892
- gap: "var(--sl-spacing-x-small)",
3893
- "&::part(base)": {
3894
- color: "var(--sqm-text)",
3895
- },
3896
- },
3897
- IndirectTaxPreviewDetails: {
3898
- gap: "var(--sl-spacing-x-small)",
3899
- display: "flex",
3900
- flexDirection: "column",
3901
- lineHeight: "var(--sl-spacing-medium)",
3902
- fontSize: "var(--sl-font-size-small)",
3903
- color: "var(--sqm-text-subdued)",
3904
- },
3905
- InvoiceTableContainer: {
3906
- marginTop: "var(--sl-spacing-medium)",
3907
- },
3908
- NotRegisteredIndirectTaxText: {
3909
- color: "var(--sqm-text-subdued)",
3910
- },
3911
- TaxDocumentsContainer: {
3912
- marginTop: "var(--sl-spacing-xx-large)",
3913
- borderTop: "1px solid var(--sl-color-neutral-200)",
3914
- },
3915
- TaxDocumentsSectionHeaderContainer: {
3916
- marginTop: "var(--sl-spacing-x-large)",
3917
- marginBottom: "var(--sl-spacing-xx-small)",
3918
- },
3919
- StatusContainer: {
3920
- marginTop: "var(--sl-spacing-x-large)",
3921
- display: "flex",
3922
- flexDirection: "column",
3923
- gap: "var(--sl-spacing-x-small)",
3924
- "& h3": {
3925
- margin: "0",
3926
- },
3927
- "& p": {
3928
- margin: "0",
3929
- paddingTop: "2px",
3930
- },
3931
- },
3932
- StatusAlert: {
3933
- fontSize: "var(--sl-font-size-small)",
3934
- },
3935
- TaxFormDetailsContainer: {
3936
- display: "flex",
3937
- gap: "var(--sl-spacing-small)",
3938
- alignItems: "center",
3939
- },
3940
- NewFormButton: {
3941
- marginTop: "var(--sl-spacing-large)",
3942
- maxWidth: "300px",
3943
- },
3944
- EditBankDetailsButton: {
3945
- marginTop: "var(--sl-spacing-large)",
3946
- },
3947
- TaxSectionSkeletonContainer: {
3948
- display: "flex",
3949
- flexDirection: "column",
3950
- marginTop: "var(--sl-spacing-x-large)",
3951
- },
3952
- TaxDocSubtext: {
3953
- margin: "0",
3954
- color: "var(--sqm-text-subdued)",
3955
- lineHeight: "var(--sl-spacing-medium)",
3956
- fontSize: "var(--sl-font-size-small)",
3957
- marginLeft: "1px",
3958
- },
3959
- TooltipContainer: {
3960
- display: "flex",
3961
- textAlign: "center",
3962
- width: "250px",
3963
- "&::part(body)": {
3964
- pointerEvents: "auto",
3965
- },
3966
- },
3967
- ToolTip: {
3968
- top: "6px",
3969
- width: "16px",
3970
- height: "16px",
3971
- },
3972
- TaxNumberContainer: {
3973
- display: "flex",
3974
- flexDirection: "column",
3975
- gap: "6px",
3976
- },
3977
- DescriptionText: {
3978
- color: "var(--sqm-text-subdued)",
3979
- fontSize: "var(--sl-font-size-x-small)",
3980
- marginBottom: "none",
3981
- maxWidth: "492px",
3982
- },
3983
- PageDescriptionText: {
3984
- color: "var(--sqm-text-subdued)",
3985
- fontSize: "var(--sl-font-size-medium)",
3986
- marginTop: "0",
3987
- },
3988
- Dialog: {
3989
- "&::part(panel)": {
3990
- maxWidth: "420px",
3991
- },
3992
- "&::part(close-button)": {
3993
- marginBottom: "var(--sl-spacing-xx-large)",
3994
- },
3995
- "&::part(title)": {
3996
- fontSize: "var(--sl-font-size-x-large)",
3997
- fontWeight: "600",
3998
- marginTop: "var(--sl-spacing-xxx-large)",
3999
- padding: "var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
4000
- },
4001
- "&::part(body)": {
4002
- padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
4003
- fontSize: "var(--sl-font-size-small)",
4004
- },
4005
- "&::part(footer)": {
4006
- display: "flex",
4007
- flexDirection: "column",
4008
- gap: "var(--sl-spacing-small)",
4009
- marginBottom: "var(--sl-spacing-xx-small)",
4010
- alignItems: "center",
4011
- flex: "1",
4012
- },
4013
- },
4014
- DialogButton: { margin: "auto", width: "100%" },
4015
- SuccessBadge: {
4016
- "&::part(base)": {
4017
- textAlign: "center",
4018
- whiteSpace: "pre-line",
4019
- background: "var(--sqm-success-color-icon)",
4020
- },
4021
- },
4022
- WarningBadge: {
4023
- "&::part(base)": {
4024
- textAlign: "center",
4025
- whiteSpace: "pre-line",
4026
- background: "var(--sqm-warning-color-icon)",
4027
- },
4028
- },
4029
- ErrorBadge: {
4030
- "&::part(base)": {
4031
- textAlign: "center",
4032
- whiteSpace: "pre-line",
4033
- background: "var(--sqm-danger-color-icon)",
4034
- },
4035
- },
4036
- SubduedText: {
4037
- color: "var(--sqm-text-subdued)",
4038
- },
4039
- ButtonContainer: {
4040
- display: "flex",
4041
- gap: "var(--sl-spacing-medium)",
4042
- flexWrap: "wrap",
4043
- },
4044
- DropdownTooltipContainer: {
4045
- top: "-4px",
4046
- "&::part(panel)": {
4047
- boxShadow: "none",
4048
- border: "none",
4049
- marginTop: "var(--sl-spacing-x-small)",
4050
- },
4051
- },
4052
- DropdownContent: {
4053
- padding: "var(--sl-spacing-xxx-small) var(--sl-spacing-x-small)",
4054
- fontSize: "var(--sl-font-size-small)",
4055
- fontFamily: "var(--sl-font-sans)",
4056
- fontWeight: "var(--sl-font-weight-normal)",
4057
- lineHeight: "var(--sl-line-height-dense)",
4058
- minWidth: "225px",
4059
- backgroundColor: "var(--sl-color-gray-900)",
4060
- color: "var(--sl-color-white)",
4061
- borderRadius: "var(--sl-border-radius-medium)",
4062
- position: "relative",
4063
- marginLeft: "5px",
4064
- },
4065
- DropdownArrow: {
4066
- position: "absolute",
4067
- left: "-5px",
4068
- top: "50%",
4069
- transform: "translateY(-50%)",
4070
- width: "0",
4071
- height: "0",
4072
- borderTop: "5px solid transparent",
4073
- borderBottom: "5px solid transparent",
4074
- borderRight: "5px solid var(--sl-color-gray-900)",
4075
- zIndex: "1",
4076
- },
4077
- DropdownLink: {
4078
- color: "var(--sl-color-white)",
4079
- textDecoration: "underline",
4080
- },
4081
- };
4082
- const sheet$4 = JSS.createStyleSheet(style$5);
4083
- const styleString$4 = sheet$4.toString();
4084
- const vanillaStyle$3 = `
4085
- :host{
4086
- display: block;
4087
- }
4088
-
4089
- sl-button[type="secondary"]::part(base) {
4090
- font-family: var(--sqm-primary-font);
4091
- background-color: var(--sqm-secondary-button-background);
4092
- color: var(--sqm-secondary-button-color);
4093
- border-color: var(--sqm-secondary-button-color-border);
4094
- border-radius: var(--sqm-secondary-button-radius);
4095
- }
4096
-
4097
- sl-button[type="secondary"]::part(base):hover {
4098
- background-color: var(--sqm-secondary-button-background-hover);
4099
- color: var(--sqm-secondary-button-color-hover);
4100
- border-color: var(--sqm-secondary-button-border-color-hover);
4101
- }
4102
-
4103
- `;
4104
- const TaxAndCashDashboardView = (props) => {
4105
- var _a;
4106
- const { states, text, callbacks, slots } = props;
4107
- function getAlert(status) {
4108
- switch (status) {
4109
- case "OVER_W9_THRESHOLD":
4110
- if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
4111
- return {
4112
- header: text.w9RequiredHeader,
4113
- description: global.intl.formatMessage({
4114
- id: "w9RequiredDescription",
4115
- defaultMessage: text.w9RequiredDescription,
4116
- }, {
4117
- termsAndConditions: (index.h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
4118
- }),
4119
- button: (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
4120
- alertType: "warning",
4121
- icon: "info-circle",
4122
- class: sheet$4.classes.WarningHoldAlertContainer,
4123
- };
4124
- }
4125
- else {
4126
- return {
4127
- header: text.payoutHoldAlertHeader,
4128
- description: global.intl.formatMessage({
4129
- id: "payoutHoldAlertDescription",
4130
- defaultMessage: text.payoutHoldAlertDescription,
4131
- }, {
4132
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4133
- }),
4134
- buttonText: null,
4135
- alertType: "warning",
4136
- icon: "exclamation-triangle",
4137
- class: sheet$4.classes.WarningHoldAlertContainer,
4138
- };
4139
- }
4140
- case "VERIFICATION:REQUIRED":
4141
- return {
4142
- header: text.verificationRequiredHeader,
4143
- description: global.intl.formatMessage({
4144
- id: "verificationRequiredDescription",
4145
- defaultMessage: text.verificationRequiredDescription,
4146
- }, {
4147
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4148
- }),
4149
- buttonText: text.verificationRequiredButtonText,
4150
- alertType: "warning",
4151
- icon: "exclamation-triangle",
4152
- class: sheet$4.classes.WarningHoldAlertContainer,
4153
- };
4154
- case "VERIFICATION:INTERNAL":
4155
- return {
4156
- header: text.verificationRequiredInternalHeader,
4157
- description: global.intl.formatMessage({
4158
- id: "verificationRequiredInternalDescription",
4159
- defaultMessage: text.verificationRequiredInternalDescription,
4160
- }, {
4161
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4162
- }),
4163
- alertType: "warning",
4164
- icon: "exclamation-triangle",
4165
- class: sheet$4.classes.WarningHoldAlertContainer,
4166
- };
4167
- case "VERIFICATION:REVIEW":
4168
- return {
4169
- header: text.verificationReviewInternalHeader,
4170
- description: global.intl.formatMessage({
4171
- id: "verificationReviewInternalDescription",
4172
- defaultMessage: text.verificationReviewInternalDescription,
4173
- }, {
4174
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4175
- }),
4176
- alertType: "warning",
4177
- icon: "exclamation-triangle",
4178
- class: sheet$4.classes.WarningHoldAlertContainer,
4179
- };
4180
- case "VERIFICATION:FAILED":
4181
- return {
4182
- header: text.verificationFailedInternalHeader,
4183
- description: global.intl.formatMessage({
4184
- id: "verificationFailedInternalDescription",
4185
- defaultMessage: text.verificationFailedInternalDescription,
4186
- }, {
4187
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4188
- }),
4189
- alertType: "error",
4190
- icon: "exclamation-octagon",
4191
- class: sheet$4.classes.ErrorHoldAlertContainer,
4192
- };
4193
- case "NEW_PAYEE_REVIEW":
4194
- return {
4195
- header: text.accountReviewHeader,
4196
- description: global.intl.formatMessage({
4197
- id: "accountReviewDescription",
4198
- defaultMessage: text.accountReviewDescription,
4199
- }, {
4200
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4201
- }),
4202
- buttonText: null,
4203
- alertType: "warning",
4204
- icon: "exclamation-triangle",
4205
- class: sheet$4.classes.WarningHoldAlertContainer,
4206
- };
4207
- case "PAYMENT_HOLD_ON_CHANGE":
4208
- return {
4209
- header: text.paymentHoldOnChangeHeader,
4210
- description: global.intl.formatMessage({
4211
- id: "accountReviewDescription",
4212
- defaultMessage: text.paymentHoldOnChangeDescription,
4213
- }, {
4214
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4215
- }),
4216
- buttonText: null,
4217
- alertType: "warning",
4218
- icon: "exclamation-triangle",
4219
- class: sheet$4.classes.WarningHoldAlertContainer,
4220
- };
4221
- case "BENEFICIARY_NAME_INVALID":
4222
- return {
4223
- header: text.beneficiaryNameInvalidHeader,
4224
- description: global.intl.formatMessage({
4225
- id: "accountReviewDescription",
4226
- defaultMessage: text.beneficiaryNameInvalidDescription,
4227
- }, {
4228
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4229
- }),
4230
- button: (index.h("div", { class: sheet$4.classes.ButtonContainer },
4231
- index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
4232
- index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
4233
- alertType: "warning",
4234
- icon: "exclamation-triangle",
4235
- class: sheet$4.classes.WarningHoldAlertContainer,
4236
- };
4237
- case "BENEFICIARY_NAME_MISMATCH":
4238
- return {
4239
- header: text.beneficiaryNameMismatchHeader,
4240
- description: global.intl.formatMessage({
4241
- id: "accountReviewDescription",
4242
- defaultMessage: text.beneficiaryNameMismatchDescription,
4243
- }, {
4244
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4245
- }),
4246
- button: (index.h("div", { class: sheet$4.classes.ButtonContainer },
4247
- index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
4248
- index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
4249
- alertType: "warning",
4250
- icon: "exclamation-triangle",
4251
- class: sheet$4.classes.WarningHoldAlertContainer,
4252
- };
4253
- case "BANK_TAX_NAME_MISMATCH":
4254
- return {
4255
- header: text.bankTaxNameMismatchHeader,
4256
- description: global.intl.formatMessage({
4257
- id: "accountReviewDescription",
4258
- defaultMessage: text.bankTaxNameMismatchDescription,
4259
- }, {
4260
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4261
- }),
4262
- button: (index.h("div", { class: sheet$4.classes.ButtonContainer },
4263
- index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
4264
- index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
4265
- alertType: "warning",
4266
- icon: "exclamation-triangle",
4267
- class: sheet$4.classes.WarningHoldAlertContainer,
4268
- };
4269
- case "WITHDRAWAL_SETTINGS_INVALID":
4270
- return {
4271
- header: text.withdrawalSettingsInvalidHeader,
4272
- description: global.intl.formatMessage({
4273
- id: "accountReviewDescription",
4274
- defaultMessage: text.withdrawalSettingsInvalidDescription,
4275
- }, {
4276
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4277
- }),
4278
- button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
4279
- alertType: "warning",
4280
- icon: "exclamation-triangle",
4281
- class: sheet$4.classes.WarningHoldAlertContainer,
4282
- };
4283
- case "PAYMENT_RETURNED":
4284
- return {
4285
- header: text.paymentReturnedHeader,
4286
- description: global.intl.formatMessage({
4287
- id: "accountReviewDescription",
4288
- defaultMessage: text.paymentReturnedDescription,
4289
- }, {
4290
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4291
- }),
4292
- button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
4293
- alertType: "error",
4294
- icon: "exclamation-triangle",
4295
- class: sheet$4.classes.WarningHoldAlertContainer,
4296
- };
4297
- case "HOLD":
4298
- return {
4299
- header: text.payoutHoldAlertHeader,
4300
- description: global.intl.formatMessage({
4301
- id: "payoutHoldAlertDescription",
4302
- defaultMessage: text.payoutHoldAlertDescription,
4303
- }, {
4304
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4305
- }),
4306
- buttonText: null,
4307
- alertType: "warning",
4308
- icon: "exclamation-triangle",
4309
- class: sheet$4.classes.WarningHoldAlertContainer,
4310
- };
4311
- default:
4312
- return;
4313
- }
4314
- }
4315
- const statusMap = {
4316
- NOT_VERIFIED: (index.h("div", { class: sheet$4.classes.TaxFormDetailsContainer },
4317
- index.h("sl-badge", { class: sheet$4.classes.WarningBadge, type: "warning", pill: true }, text.statusTextNotVerified),
4318
- index.h("p", { class: sheet$4.classes.SubduedText }, global.intl.formatMessage({
4319
- id: `badgeTextAwaitingReview`,
4320
- defaultMessage: text.badgeTextAwaitingReview,
4321
- }, {
4322
- dateSubmitted: states.dateSubmitted,
4323
- })))),
4324
- ACTIVE: (index.h("div", { class: sheet$4.classes.TaxFormDetailsContainer },
4325
- index.h("sl-badge", { class: sheet$4.classes.SuccessBadge, type: "success", pill: true }, text.statusTextActive),
4326
- index.h("p", { class: sheet$4.classes.SubduedText }, global.intl.formatMessage({
4327
- id: `badgeTextSubmittedOn`,
4328
- defaultMessage: states.documentType === "W9" || !states.documentType
4329
- ? text.badgeTextSubmittedOn
4330
- : text.badgeTextSubmittedOnW8,
4331
- }, {
4332
- dateSubmitted: states.dateSubmitted,
4333
- })))),
4334
- INACTIVE: (index.h("div", { class: sheet$4.classes.TaxFormDetailsContainer },
4335
- index.h("sl-badge", { class: sheet$4.classes.ErrorBadge, type: "danger", pill: true }, text.statusTextNotActive),
4336
- index.h("p", { class: sheet$4.classes.SubduedText }, text.invalidForm))),
4337
- undefined: (index.h("div", { class: sheet$4.classes.TaxFormDetailsContainer },
4338
- index.h("sl-badge", { type: "danger", pill: true }, text.statusTextRequired),
4339
- index.h("p", null, global.intl.formatMessage({
4340
- id: `requiredTaxForm`,
4341
- defaultMessage: text.requiredTaxForm,
4342
- }, {
4343
- taxFormType: states.documentType,
4344
- })))),
4345
- };
4346
- const alertMap = {
4347
- INACTIVE: (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", class: sheet$4.classes.ErrorHoldAlertContainer, type: "danger", open: true },
4348
- index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
4349
- index.h("strong", null, global.intl.formatMessage({
4350
- id: `taxAlertHeaderNotActive`,
4351
- defaultMessage: states.documentType === "W9"
4352
- ? text.taxAlertHeaderNotActiveW9
4353
- : text.taxAlertHeaderNotActiveW8,
4354
- }, {
4355
- documentType: states.documentType || "Your",
4356
- })),
4357
- index.h("br", null),
4358
- global.intl.formatMessage({
4359
- id: `taxAlertMessage`,
4360
- defaultMessage: states.documentType === "W9"
4361
- ? text.taxAlertNotActiveMessageW9
4362
- : text.taxAlertNotActiveMessageW8,
4363
- }, {
4364
- documentType: states.documentTypeString || "tax",
4365
- }))),
4366
- };
4367
- const getIndirectTaxRegisteredIn = () => {
4368
- if (states.province) {
4369
- return global.intl.formatMessage({
4370
- id: `indirectTaxInfoCanada`,
4371
- defaultMessage: text.indirectTaxInfoCanada,
4372
- }, {
4373
- country: "Canada",
4374
- province: states.province,
4375
- });
4376
- }
4377
- else if (states.subRegion) {
4378
- return global.intl.formatMessage({
4379
- id: `indirectTaxInfoSpain`,
4380
- defaultMessage: text.indirectTaxInfoSpain,
4381
- }, {
4382
- country: states.country,
4383
- subRegion: states.subRegion,
4384
- });
4385
- }
4386
- else {
4387
- return global.intl.formatMessage({
4388
- id: `indirectTaxInfoOtherCountry`,
4389
- defaultMessage: text.indirectTaxInfoOtherCountry,
4390
- }, {
4391
- country: states.country,
4392
- });
4393
- }
4394
- };
4395
- const alertInfo = getAlert(states.payoutStatus);
4396
- const dropdownHover = (el) => {
4397
- var _a;
4398
- if (!el)
4399
- return;
4400
- const trigger = el.querySelector('[slot="trigger"]');
4401
- const panel = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".dropdown__panel");
4402
- if (!trigger || !panel)
4403
- return;
4404
- let hideTimeout;
4405
- const show = () => {
4406
- clearTimeout(hideTimeout);
4407
- el.show();
4408
- };
4409
- const scheduleHide = () => {
4410
- hideTimeout = setTimeout(() => el.hide(), 100);
4411
- };
4412
- trigger.addEventListener("mouseenter", show);
4413
- trigger.addEventListener("mouseleave", scheduleHide);
4414
- panel.addEventListener("mouseenter", show);
4415
- panel.addEventListener("mouseleave", scheduleHide);
4416
- return () => {
4417
- trigger.removeEventListener("mouseenter", show);
4418
- trigger.removeEventListener("mouseleave", scheduleHide);
4419
- panel.removeEventListener("mouseenter", show);
4420
- panel.removeEventListener("mouseleave", scheduleHide);
4421
- clearTimeout(hideTimeout);
4422
- };
4423
- };
4424
- return (index.h("div", null,
4425
- index.h("div", null,
4426
- index.h("style", { type: "text/css" },
4427
- styleString$4,
4428
- vanillaStyle$3),
4429
- states.loadingError && (index.h("div", null,
4430
- index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet$4.classes.ErrorAlertContainer },
4431
- index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
4432
- index.h("strong", null, text.error.loadingErrorAlertHeader),
4433
- index.h("br", null),
4434
- global.intl.formatMessage({
4435
- id: "loadingErrorAlertDescription",
4436
- defaultMessage: text.error.loadingErrorAlertDescription,
4437
- }, {
4438
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4439
- })))),
4440
- ((_a = states.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet$4.classes.ErrorAlertContainer },
4441
- index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
4442
- index.h("strong", null, text.error.generalTitle),
4443
- index.h("br", null),
4444
- global.intl.formatMessage({
4445
- id: "generalDescription",
4446
- defaultMessage: text.error.generalDescription,
4447
- }, {
4448
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4449
- }))),
4450
- alertInfo && (index.h("sqm-form-message", { loading: states.loading, exportparts: "base: alert-base, icon:alert-icon", type: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.alertType, class: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.class, icon: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.icon, transparent: true },
4451
- index.h("strong", null, alertInfo.header),
4452
- index.h("p", { style: { margin: "0" } }, alertInfo.description),
4453
- alertInfo.buttonText && (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.veriffLoading, onClick: () => callbacks.onVerifyClick() }, alertInfo.buttonText)),
4454
- alertInfo.button ? (alertInfo.button) : (index.h("div", { style: { display: "none" } })))),
4455
- index.h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet$4.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
4456
- index.h("p", null, text.replaceTaxFormModalBodyText),
4457
- index.h("sl-button", { slot: "footer", type: "primary", class: sheet$4.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),
4458
- index.h("sl-button", { slot: "footer", type: "default", class: sheet$4.classes.DialogButton, onClick: callbacks.onNewFormCancel }, text.cancelButton)),
4459
- states.status === "INACTIVE" && alertMap[states.status],
4460
- index.h("div", null,
4461
- index.h("h3", { style: { marginBottom: "0" } }, text.bankingInformationSectionHeader),
4462
- index.h("div", { class: sheet$4.classes.BankingInformationContainer },
4463
- slots.payoutDetailsCardSlot,
4464
- !states.loading && (index.h("p", { class: sheet$4.classes.DescriptionText }, text.payoutFromImpact)),
4465
- states.canEditPayoutInfo && (index.h("sl-button", { disabled: states.disabled || states.loading, exportparts: "base: secondarybutton-base", type: "secondary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
4466
- (!states.noFormNeeded || !!states.status) && (index.h("div", { class: sheet$4.classes.TaxDocumentsContainer },
4467
- index.h("div", null, states.loading ? (index.h("div", { class: sheet$4.classes.TaxSectionSkeletonContainer },
4468
- index.h("sqm-skeleton", { width: "15%", height: "10px" }),
4469
- index.h("sqm-skeleton", { width: "25%", height: "24px" }))) : (index.h("div", null,
4470
- index.h("div", null,
4471
- index.h("span", { class: sheet$4.classes.TaxFormDetailsContainer },
4472
- index.h("div", { class: sheet$4.classes.StatusContainer },
4473
- index.h("h3", null, states.documentType
4474
- ? global.intl.formatMessage({
4475
- id: "section-subheader",
4476
- defaultMessage: text.taxDocumentSectionSubHeader,
4477
- }, {
4478
- documentType: states.documentTypeString,
4479
- })
4480
- : text.taxDocumentSectionSubHeaderNoDocument),
4481
- index.h("span", { class: sheet$4.classes.StatusAlert }, statusMap[states.status]))),
4482
- (!states.noFormNeeded || !!states.status) &&
4483
- states.status !== "NOT_VERIFIED" && (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)))))))),
4484
- index.h("div", { class: sheet$4.classes.IndirectTaxPreviewContainer }, states.loading ? (index.h("div", { class: sheet$4.classes.TaxSectionSkeletonContainer },
4485
- index.h("sqm-skeleton", { width: "15%", height: "10px" }),
4486
- index.h("sqm-skeleton", { width: "25%", height: "24px" }))) : (index.h("div", null,
4487
- index.h("h3", { class: sheet$4.classes.IndirectTaxPreviewHeaderContainer },
4488
- text.indirectTaxInfoSectionHeader,
4489
- index.h("sl-dropdown", { placement: "right", distance: 1, ref: dropdownHover, class: sheet$4.classes.DropdownTooltipContainer },
4490
- index.h("sl-icon", { slot: "trigger", name: "info-circle", class: sheet$4.classes.ToolTip, style: { cursor: "pointer" } }),
4491
- index.h("div", { class: sheet$4.classes.DropdownContent },
4492
- index.h("div", { class: sheet$4.classes.DropdownArrow }),
4493
- global.intl.formatMessage({
4494
- id: "indirectTaxTooltipSupport",
4495
- defaultMessage: text.indirectTaxTooltipSupport,
4496
- }, {
4497
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com`, class: sheet$4.classes.DropdownLink }, text.supportLink)),
4498
- })))),
4499
- index.h("div", { class: sheet$4.classes.IndirectTaxPreviewDetails },
4500
- index.h("span", null, states.notRegistered ? (index.h("span", { class: sheet$4.classes.NotRegisteredIndirectTaxText }, global.intl.formatMessage({
4501
- id: "notRegisteredForTax",
4502
- defaultMessage: text.notRegisteredForTax,
4503
- }, {
4504
- supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
4505
- }))) : (getIndirectTaxRegisteredIn())),
4506
- !states.notRegistered && (index.h("div", { class: sheet$4.classes.TaxNumberContainer },
4507
- index.h("span", null, global.intl.formatMessage({
4508
- id: `indirectTaxDetails`,
4509
- defaultMessage: text.indirectTaxDetails,
4510
- }, {
4511
- indirectTaxType: states.indirectTaxType,
4512
- indirectTaxNumber: states.indirectTaxNumber,
4513
- })),
4514
- index.h("span", null,
4515
- states.qstNumber &&
4516
- global.intl.formatMessage({
4517
- id: `qstNumber`,
4518
- defaultMessage: text.qstNumber,
4519
- }, {
4520
- qstNumber: states.qstNumber,
4521
- }),
4522
- states.subRegionTaxNumber &&
4523
- global.intl.formatMessage({
4524
- id: `subRegionTaxNumber`,
4525
- defaultMessage: text.subRegionTaxNumber,
4526
- }, {
4527
- subRegionTaxNumber: states.subRegionTaxNumber,
4528
- })))),
4529
- !states.notRegistered && (index.h("div", { class: sheet$4.classes.InvoiceTableContainer },
4530
- index.h("sqm-invoice-table", { description: text.invoiceDescription, "prev-label": text.invoicePrevLabel, "more-label": text.invoiceMoreLabel, header: text.invoiceHeader, "empty-state-header": text.invoiceEmptyStateHeader, "empty-state-text": text.invoiceEmptyStateText },
4531
- index.h("sqm-invoice-table-download-column", null),
4532
- index.h("sqm-invoice-table-date-column", { "column-title": text.dateColumnTitle }),
4533
- index.h("sqm-invoice-table-data-column", { "column-title": text.invoiceColumnTitle, property: "invoiceId" }),
4534
- index.h("sqm-invoice-table-data-column", { "column-title": text.earningsColumnTitle, property: "earnings" }),
4535
- index.h("sqm-invoice-table-data-column", { "column-title": text.indirectTaxColumnTitle, property: "indirectTax" }),
4536
- index.h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
4537
- };
4538
-
4539
3846
  const GET_TAX_SETTING = index_module.dist.gql `
4540
3847
  query getTenantSettings {
4541
3848
  tenantSettings {
@@ -4557,12 +3864,12 @@ function getSubRegionName(regionCode) {
4557
3864
  return "";
4558
3865
  // Impact adds an underscore to some regions
4559
3866
  const standardCode = regionCode.replace("_", "");
4560
- const regions = [...utils$1.INDIRECT_TAX_PROVINCES, ...utils$1.INDIRECT_TAX_SPAIN_REGIONS];
3867
+ const regions = [...subregions.INDIRECT_TAX_PROVINCES, ...subregions.INDIRECT_TAX_SPAIN_REGIONS];
4561
3868
  return (_a = regions.find((r) => r.regionCode === standardCode)) === null || _a === void 0 ? void 0 : _a.displayName;
4562
3869
  }
4563
3870
  function getIndirectTaxType(taxInformation) {
4564
3871
  var _a;
4565
- const regions = [...utils$1.INDIRECT_TAX_PROVINCES, ...utils$1.INDIRECT_TAX_SPAIN_REGIONS];
3872
+ const regions = [...subregions.INDIRECT_TAX_PROVINCES, ...subregions.INDIRECT_TAX_SPAIN_REGIONS];
4566
3873
  if (taxInformation === null || taxInformation === void 0 ? void 0 : taxInformation.indirectTaxRegion) {
4567
3874
  const standardRegion = taxInformation.indirectTaxRegion.replace("_", "");
4568
3875
  const taxType = (_a = regions.find((r) => r.regionCode === standardRegion)) === null || _a === void 0 ? void 0 : _a.taxType;
@@ -4621,7 +3928,7 @@ const useTaxAndCashDashboard = (props) => {
4621
3928
  });
4622
3929
  setStep("/3");
4623
3930
  };
4624
- const provinceName = (_d = utils$1.INDIRECT_TAX_PROVINCES.find((p) => { var _a; return p.regionCode === ((_a = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _a === void 0 ? void 0 : _a.indirectTaxRegion); })) === null || _d === void 0 ? void 0 : _d.displayName;
3931
+ const provinceName = (_d = subregions.INDIRECT_TAX_PROVINCES.find((p) => { var _a; return p.regionCode === ((_a = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _a === void 0 ? void 0 : _a.indirectTaxRegion); })) === null || _d === void 0 ? void 0 : _d.displayName;
4625
3932
  const payoutStatus = data$1 ? useIndirectTaxForm.getStatus(data$1) : null;
4626
3933
  domContextHooks_module.useEffect(() => {
4627
3934
  const cb = () => refetch();
@@ -4636,7 +3943,7 @@ const useTaxAndCashDashboard = (props) => {
4636
3943
  dateSubmitted,
4637
3944
  documentType,
4638
3945
  canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
4639
- documentTypeString: utils$1.taxTypeToName(documentType),
3946
+ documentTypeString: subregions.taxTypeToName(documentType),
4640
3947
  status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
4641
3948
  subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
4642
3949
  subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
@@ -5077,7 +4384,7 @@ const TaxAndCashDashboard = class {
5077
4384
  const props = index_module.isDemo()
5078
4385
  ? useDemoTaxAndCashDashboard(this)
5079
4386
  : useTaxAndCashDashboard(this);
5080
- return (index.h(index.Host, null, index.h(TaxAndCashDashboardView, { callbacks: props.callbacks, states: props.states, text: props.text, slots: {
4387
+ return (index.h(index.Host, null, index.h(sqmUserInfoFormView.TaxAndCashDashboardView, { callbacks: props.callbacks, states: props.states, text: props.text, slots: {
5081
4388
  payoutDetailsCardSlot: (index.h("sqm-payout-details-card", Object.assign({}, this.getTextProps()))),
5082
4389
  } })));
5083
4390
  }
@@ -5168,7 +4475,7 @@ function useUserInfoForm(props) {
5168
4475
  if (!user || step !== "/1")
5169
4476
  return;
5170
4477
  // If form already filled out, skip initialising it
5171
- if (utils$1.objectIsFull(userFormContext))
4478
+ if (subregions.objectIsFull(userFormContext))
5172
4479
  return;
5173
4480
  // Prefer MI email if it was verified before this
5174
4481
  const email = ((_a = user.managedIdentity) === null || _a === void 0 ? void 0 : _a.emailVerified) ? user.managedIdentity.email
@@ -5242,9 +4549,7 @@ function useUserInfoForm(props) {
5242
4549
  setFilteredPhoneCountries(countries || []);
5243
4550
  }
5244
4551
  else {
5245
- setFilteredPhoneCountries(countries.filter((c) => c.displayName
5246
- .toLowerCase()
5247
- .includes(phoneCountrySearch.toLowerCase())) || []);
4552
+ setFilteredPhoneCountries(countries.filter((c) => c.displayName.toLowerCase().includes(phoneCountrySearch.toLowerCase())) || []);
5248
4553
  }
5249
4554
  }, [phoneCountrySearch, countries]);
5250
4555
  domContextHooks_module.useEffect(() => {
@@ -5258,7 +4563,7 @@ function useUserInfoForm(props) {
5258
4563
  }
5259
4564
  }, [currencySearch, currencies]);
5260
4565
  async function connectPartner(formData) {
5261
- var _a, _b, _c, _d, _e, _f;
4566
+ var _a, _b, _c, _d;
5262
4567
  const vars = {
5263
4568
  user: {
5264
4569
  id: user.id,
@@ -5275,32 +4580,34 @@ function useUserInfoForm(props) {
5275
4580
  phoneNumber: formData.phoneNumber,
5276
4581
  phoneNumberCountryCode: formData.phoneNumberCountryCode,
5277
4582
  };
5278
- // If the partner has already been started call completeImpactPartner to
5279
- // update the remaining details. Otherwise create a new connection.
5280
- const userData = data$1 === null || data$1 === void 0 ? void 0 : data$1.user;
5281
4583
  let result = null;
5282
4584
  let connectionResult;
5283
- if (((_a = userData === null || userData === void 0 ? void 0 : userData.impactConnection) === null || _a === void 0 ? void 0 : _a.connectionStatus) === "STARTED") {
5284
- result = await completeImpactPartner({
5285
- vars,
5286
- });
5287
- connectionResult = (_b = result) === null || _b === void 0 ? void 0 : _b.completeImpactConnection;
5288
- }
5289
- else {
5290
- result = await connectImpactPartner({
5291
- vars,
5292
- });
5293
- connectionResult = (_c = result) === null || _c === void 0 ? void 0 : _c.createImpactConnection;
5294
- }
5295
- if (!result || ((_d = result) === null || _d === void 0 ? void 0 : _d.message))
4585
+ result = await completeImpactPartner({
4586
+ vars,
4587
+ });
4588
+ connectionResult = (_a = result) === null || _a === void 0 ? void 0 : _a.completeImpactConnection;
4589
+ // if (userData?.impactConnection?.connectionStatus === "STARTED") {
4590
+ // result = await completeImpactPartner({
4591
+ // vars,
4592
+ // });
4593
+ // connectionResult = (result as CompletePartnerResult)
4594
+ // ?.completeImpactConnection;
4595
+ // } else {
4596
+ // result = await connectImpactPartner({
4597
+ // vars,
4598
+ // });
4599
+ // connectionResult = (result as ConnectPartnerResult)
4600
+ // ?.createImpactConnection;
4601
+ // }
4602
+ if (!result || ((_b = result) === null || _b === void 0 ? void 0 : _b.message))
5296
4603
  throw new Error();
5297
4604
  if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
5298
4605
  console.error("Failed to create Impact connection: ", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
5299
4606
  throw new Error();
5300
4607
  }
5301
4608
  await refetch();
5302
- 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;
5303
- const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
4609
+ 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;
4610
+ const hasValidCurrentDocument = subregions.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
5304
4611
  // Fire form change event
5305
4612
  window.dispatchEvent(new Event(eventKeys.TAX_FORM_UPDATED_EVENT_KEY));
5306
4613
  return {
@@ -5320,7 +4627,7 @@ function useUserInfoForm(props) {
5320
4627
  // custom validation
5321
4628
  if (typeof control.validationError === "function") {
5322
4629
  const validate = control.validationError;
5323
- const validationError = validate({ control, key, value });
4630
+ const validationError = validate({ control, key, value, formData });
5324
4631
  if (validationError)
5325
4632
  jsonpointer.jsonpointer.set(errors, key, validationError);
5326
4633
  }
@@ -5392,7 +4699,7 @@ function useUserInfoForm(props) {
5392
4699
  }
5393
4700
  const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
5394
4701
  const regionObj = hasStates
5395
- ? utils$1.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
4702
+ ? subregions.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
5396
4703
  : {};
5397
4704
  return {
5398
4705
  setStep: setStep,