@saasquatch/mint-components 2.0.2-4 → 2.0.2-5
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.
- package/dist/cjs/{IndirectTaxDetailsView-e5f70b8b.js → IndirectTaxDetailsView-20d5b4c5.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-925a8fa6.js → ShadowViewAddon-21e729d3.js} +8 -8
- package/dist/cjs/{usePayoutStatus-95874989.js → data-16106637.js} +129 -155
- package/dist/cjs/{global-8bba5b3a.js → global-560ac58f.js} +4 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mint-components.cjs.js +2 -2
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +115 -345
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +29 -224
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/sqm-header-logo.cjs.entry.js +1 -14
- package/dist/cjs/{sqm-lead-checkbox-field-view-340acad0.js → sqm-lead-checkbox-field-view-f7910206.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-06ed3632.js → sqm-lead-input-field-view-4e2a0c1a.js} +1 -1
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-5518eb0d.js → sqm-portal-email-verification-view-556c645c.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-615e6975.js → sqm-portal-profile-view-4a41c680.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +8 -9
- package/dist/cjs/{useLeadFormState-fd0445f9.js → useLeadFormState-b916bf5d.js} +1 -1
- package/dist/cjs/{utils-83d125fa.js → utils-f6c4eed4.js} +1 -1
- package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +3 -80
- package/dist/collection/components/sqm-portal-footer/sqm-portal-footer-view.js +3 -3
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +4 -4
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -1
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -2
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +40 -46
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +2 -90
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -353
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +3 -30
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +1 -301
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +2 -92
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +0 -300
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +14 -25
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +9 -92
- package/dist/collection/global/styles.js +4 -0
- package/dist/collection/global/styles.ts +4 -0
- package/dist/esm/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-d1816a57.js} +2 -2
- package/dist/esm/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-5ecab399.js} +8 -8
- package/dist/esm/{usePayoutStatus-c515b24b.js → data-acdb790f.js} +130 -156
- package/dist/esm/{global-1099f20d.js → global-80e8f351.js} +4 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mint-components.js +2 -2
- package/dist/esm/sqm-banking-info-form_10.entry.js +67 -297
- package/dist/esm/sqm-big-stat_47.entry.js +7 -202
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-email-verification.entry.js +1 -1
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/sqm-header-logo.entry.js +1 -14
- package/dist/esm/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-babfef96.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-5e9001b5.js} +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +3 -3
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-2e84bb34.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-87621310.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +8 -9
- package/dist/esm/{useLeadFormState-c379e5d7.js → useLeadFormState-53b556e3.js} +1 -1
- package/dist/esm/{utils-6122971b.js → utils-7e72d7ed.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-d1816a57.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-5ecab399.js} +1 -1
- package/dist/esm-es5/data-acdb790f.js +6 -0
- package/dist/esm-es5/{global-1099f20d.js → global-80e8f351.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-header-logo.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-babfef96.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-5e9001b5.js} +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-2e84bb34.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-87621310.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/{useLeadFormState-c379e5d7.js → useLeadFormState-53b556e3.js} +1 -1
- package/dist/esm-es5/{utils-6122971b.js → utils-7e72d7ed.js} +1 -1
- package/dist/mint-components/global/styles.ts +4 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-79a3344f.js → p-0605808e.js} +1 -1
- package/dist/mint-components/{p-aa8c6332.js → p-0d0cbf6a.js} +1 -1
- package/dist/mint-components/{p-60c14cec.entry.js → p-190407f1.entry.js} +1 -1
- package/dist/mint-components/{p-ed16b35a.js → p-21cb9d95.js} +1 -1
- package/dist/mint-components/p-27bb4223.system.js +1 -0
- package/dist/mint-components/{p-14e813a7.system.entry.js → p-2923b3b7.system.entry.js} +1 -1
- package/dist/mint-components/{p-56009bf0.system.entry.js → p-31d32dc8.system.entry.js} +1 -1
- package/dist/mint-components/{p-8b5b2acc.entry.js → p-35dd7d31.entry.js} +1 -1
- package/dist/mint-components/{p-18720462.system.entry.js → p-364e5ac9.system.entry.js} +1 -1
- package/dist/mint-components/{p-a217cc8d.entry.js → p-36d4d879.entry.js} +1 -1
- package/dist/mint-components/{p-db1a0db1.js → p-3dfd91d9.js} +1 -1
- package/dist/mint-components/p-469a6450.system.js +6 -0
- package/dist/mint-components/{p-6d5bd95a.js → p-4765a7b5.js} +1 -1
- package/dist/mint-components/{p-d3120982.system.entry.js → p-499c11c0.system.entry.js} +1 -1
- package/dist/mint-components/{p-0649123a.system.entry.js → p-4d5845ac.system.entry.js} +1 -1
- package/dist/mint-components/{p-511c87ce.system.entry.js → p-4deeebde.system.entry.js} +1 -1
- package/dist/mint-components/{p-4ce51b1c.system.entry.js → p-4f194ece.system.entry.js} +1 -1
- package/dist/mint-components/{p-aefaec37.entry.js → p-506f8db5.entry.js} +1 -1
- package/dist/mint-components/{p-00bc7211.js → p-51c8c4a3.js} +1 -1
- package/dist/mint-components/{p-ad4348c3.system.js → p-5eff6672.system.js} +1 -1
- package/dist/mint-components/{p-6c006998.entry.js → p-6483aea3.entry.js} +2 -2
- package/dist/mint-components/{p-c994512c.system.js → p-65bc35d5.system.js} +1 -1
- package/dist/mint-components/{p-c85f204b.system.js → p-6653236d.system.js} +1 -1
- package/dist/mint-components/{p-57ce33dd.js → p-6b287172.js} +2 -2
- package/dist/mint-components/{p-6d9ce4e5.entry.js → p-6c3f484f.entry.js} +1 -1
- package/dist/mint-components/{p-22a9114f.system.entry.js → p-70a53a17.system.entry.js} +1 -1
- package/dist/mint-components/{p-5d059c95.entry.js → p-70b14f52.entry.js} +1 -1
- package/dist/mint-components/{p-6445e926.system.entry.js → p-74bfa4d7.system.entry.js} +1 -1
- package/dist/mint-components/{p-47c83656.entry.js → p-84ec18aa.entry.js} +1 -1
- package/dist/mint-components/{p-f0eae4e6.system.js → p-8f07cca2.system.js} +1 -1
- package/dist/mint-components/{p-a5c63310.entry.js → p-909fe833.entry.js} +1 -1
- package/dist/mint-components/p-914e5b02.entry.js +99 -0
- package/dist/mint-components/{p-5f3eafd4.entry.js → p-9c235f83.entry.js} +2 -2
- package/dist/mint-components/{p-74f43a08.system.js → p-9dc453c2.system.js} +1 -1
- package/dist/mint-components/{p-60465a2d.system.js → p-9de8768b.system.js} +1 -1
- package/dist/mint-components/{p-4fed8672.js → p-a6264af4.js} +1 -1
- package/dist/mint-components/p-a7ee19dc.entry.js +1 -0
- package/dist/mint-components/{p-bec87ac9.system.entry.js → p-a9be3cea.system.entry.js} +1 -1
- package/dist/mint-components/{p-e0a724dd.system.js → p-abad7828.system.js} +1 -1
- package/dist/mint-components/{p-ea0bc627.entry.js → p-bffd1ff7.entry.js} +1 -1
- package/dist/mint-components/{p-aa08457e.system.js → p-c594cd6a.system.js} +1 -1
- package/dist/mint-components/{p-7a268047.js → p-d52d3dd7.js} +1 -1
- package/dist/mint-components/{p-38f932ae.system.js → p-d5db98bf.system.js} +1 -1
- package/dist/mint-components/p-db1e009d.system.entry.js +1 -0
- package/dist/mint-components/p-e1e7d01c.js +157 -0
- package/dist/mint-components/p-e8b74744.entry.js +273 -0
- package/dist/mint-components/p-ed5629ca.system.entry.js +1 -0
- package/dist/mint-components/{p-717b6730.system.entry.js → p-ee5fd8d3.system.entry.js} +1 -1
- package/dist/mint-components/p-eea87fdc.system.entry.js +1 -0
- package/dist/mint-components/{p-f401ef19.system.entry.js → p-f092162f.system.entry.js} +1 -1
- package/dist/mint-components/{p-4c811d12.entry.js → p-f5e9fa02.entry.js} +2 -2
- package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +1 -14
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +0 -24
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +0 -16
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -57
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -3
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +0 -48
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +0 -12
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +0 -48
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -2
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +0 -1
- package/dist/types/components.d.ts +41 -331
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/shoelace/assets/icons/twitter-x.svg +4 -0
- package/dist/esm-es5/usePayoutStatus-c515b24b.js +0 -6
- package/dist/mint-components/p-09ab53fb.system.entry.js +0 -1
- package/dist/mint-components/p-1c1ae908.system.js +0 -6
- package/dist/mint-components/p-296dea25.system.entry.js +0 -1
- package/dist/mint-components/p-69ed04cc.entry.js +0 -273
- package/dist/mint-components/p-6eb050f1.system.entry.js +0 -1
- package/dist/mint-components/p-967a9040.system.js +0 -1
- package/dist/mint-components/p-9c3ad5dc.entry.js +0 -99
- package/dist/mint-components/p-ab111e29.entry.js +0 -1
- package/dist/mint-components/p-c9cceb05.js +0 -157
- package/dist/types/global/android.d.ts +0 -7
- package/dist/types/global/demo.d.ts +0 -2
- package/dist/types/stories/features.d.ts +0 -4
- package/dist/types/stories/templates.d.ts +0 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-a43a63b4.js');
|
|
6
|
-
const global = require('./global-
|
|
6
|
+
const global = require('./global-560ac58f.js');
|
|
7
7
|
const domContextHooks_module = require('./dom-context-hooks.module-7fa676ae.js');
|
|
8
8
|
const index_module = require('./index.module-4f54e412.js');
|
|
9
9
|
const jsonpointer = require('./jsonpointer-11327262.js');
|
|
@@ -16,10 +16,10 @@ const reRender = require('./re-render-d516138a.js');
|
|
|
16
16
|
const useChildElements = require('./useChildElements-966c9041.js');
|
|
17
17
|
const luxon = require('./luxon-949beaf2.js');
|
|
18
18
|
const useReferralTable = require('./useReferralTable-90d4d6e9.js');
|
|
19
|
-
const IndirectTaxDetailsView = require('./IndirectTaxDetailsView-
|
|
20
|
-
const utils$1 = require('./utils-
|
|
19
|
+
const IndirectTaxDetailsView = require('./IndirectTaxDetailsView-20d5b4c5.js');
|
|
20
|
+
const utils$1 = require('./utils-f6c4eed4.js');
|
|
21
21
|
const keys = require('./keys-cff24974.js');
|
|
22
|
-
const
|
|
22
|
+
const data = require('./data-16106637.js');
|
|
23
23
|
|
|
24
24
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
25
25
|
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;
|
|
@@ -728,7 +728,7 @@ const BankingInfoFormView = (props) => {
|
|
|
728
728
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
729
729
|
id: "formStep",
|
|
730
730
|
defaultMessage: text.formStep,
|
|
731
|
-
}, { step: states.step, count:
|
|
731
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
732
732
|
index.h("h3", { style: { fontSize: "24px" } }, text.taxAndPayouts),
|
|
733
733
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription)),
|
|
734
734
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
|
|
@@ -865,12 +865,12 @@ function useBankingInfoForm(props) {
|
|
|
865
865
|
const host = index_module._();
|
|
866
866
|
const locale = index_module.L();
|
|
867
867
|
const user = index_module.J();
|
|
868
|
-
const [step, setStep] = index_module.Pn(
|
|
869
|
-
const context = index_module.Fn(
|
|
870
|
-
const countries = index_module.Fn(
|
|
868
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
869
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
870
|
+
const countries = index_module.Fn(data.SORTED_COUNTRIES_NAMESPACE);
|
|
871
871
|
const formRef = domContextHooks_module.useRef(null);
|
|
872
|
-
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(
|
|
873
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
872
|
+
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(data.FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
873
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
874
874
|
const [saveWithdrawalSettings] = index_module.$e(SAVE_WITHDRAWAL_SETTINGS);
|
|
875
875
|
const [updateWithdrawalSettings] = index_module.$e(UPDATE_WITHDRAWAL_SETTINGS);
|
|
876
876
|
const [showVerification, setShowVerification] = domContextHooks_module.useState(false);
|
|
@@ -905,8 +905,7 @@ function useBankingInfoForm(props) {
|
|
|
905
905
|
: _paymentMethodChecked;
|
|
906
906
|
domContextHooks_module.useEffect(() => {
|
|
907
907
|
// reset redirect hash
|
|
908
|
-
|
|
909
|
-
window.location.hash = "";
|
|
908
|
+
window.location.hash = "";
|
|
910
909
|
}, []);
|
|
911
910
|
domContextHooks_module.useEffect(() => {
|
|
912
911
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -1032,7 +1031,7 @@ function useBankingInfoForm(props) {
|
|
|
1032
1031
|
return;
|
|
1033
1032
|
}
|
|
1034
1033
|
// Fire form change event
|
|
1035
|
-
window.dispatchEvent(new Event(
|
|
1034
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
1036
1035
|
await refetch();
|
|
1037
1036
|
setStep("/dashboard");
|
|
1038
1037
|
}
|
|
@@ -1575,7 +1574,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1575
1574
|
const defaultPaymentScheduleChecked = (_f = (_e = (_d = props.demoData) === null || _d === void 0 ? void 0 : _d.states) === null || _e === void 0 ? void 0 : _e.formState) === null || _f === void 0 ? void 0 : _f.paymentScheduleChecked;
|
|
1576
1575
|
const defaultCurrency = (_h = (_g = props.demoData) === null || _g === void 0 ? void 0 : _g.states) === null || _h === void 0 ? void 0 : _h.currency;
|
|
1577
1576
|
const defaultCountry = (_l = (_k = (_j = props.demoData) === null || _j === void 0 ? void 0 : _j.states) === null || _k === void 0 ? void 0 : _k.formState) === null || _l === void 0 ? void 0 : _l.bankCountry;
|
|
1578
|
-
const setStep = index_module.En(
|
|
1577
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
1579
1578
|
const [paymentMethodChecked, setPaymentMethodChecked] = domContextHooks_module.useState(undefined);
|
|
1580
1579
|
const [paymentScheduleChecked, setPaymentScheduleChecked] = domContextHooks_module.useState(undefined);
|
|
1581
1580
|
const [currency, setCurrency] = domContextHooks_module.useState(defaultCurrency);
|
|
@@ -1699,10 +1698,10 @@ const DOCUSIGN_EXPIRED_STATES = ["ttl_expired", "session_timeout"];
|
|
|
1699
1698
|
function useDocusignForm(props) {
|
|
1700
1699
|
var _a, _b, _c;
|
|
1701
1700
|
const user = index_module.J();
|
|
1702
|
-
const context = index_module.Fn(
|
|
1703
|
-
const [step, setStep] = index_module.Pn(
|
|
1704
|
-
const { data, loading: userLoading, refetch, } = index_module.$n(
|
|
1705
|
-
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
1701
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
1702
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
1703
|
+
const { data: data$1, loading: userLoading, refetch, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
1704
|
+
const publisher = (_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
1706
1705
|
const [createTaxDocument, { loading: documentLoading, data: document, errors: documentErrors },] = index_module.$e(GET_TAX_DOCUMENT);
|
|
1707
1706
|
const [completeTaxDocument, { loading: completeDocumentLoading, data: completeData, errors: completeErrors, },] = index_module.$e(COMPLETE_TAX_DOCUMENT);
|
|
1708
1707
|
const [docusignStatus, setDocusignStatus] = domContextHooks_module.useState(undefined);
|
|
@@ -1770,7 +1769,7 @@ function useDocusignForm(props) {
|
|
|
1770
1769
|
if (!result.completeImpactPublisherTaxDocument.success)
|
|
1771
1770
|
throw new Error();
|
|
1772
1771
|
// Fire form change event
|
|
1773
|
-
window.dispatchEvent(new Event(
|
|
1772
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
1774
1773
|
setShowExitButton(true);
|
|
1775
1774
|
}
|
|
1776
1775
|
catch (e) {
|
|
@@ -2074,7 +2073,7 @@ const DocusignFormView = (props) => {
|
|
|
2074
2073
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
2075
2074
|
id: "formStep",
|
|
2076
2075
|
defaultMessage: text.formStep,
|
|
2077
|
-
}, { step: states.step, count:
|
|
2076
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
2078
2077
|
index.h("h3", null, text.taxForm),
|
|
2079
2078
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
2080
2079
|
states.loadingError && (index.h("div", null,
|
|
@@ -2267,7 +2266,7 @@ const DocusignForm = class {
|
|
|
2267
2266
|
get el() { return index.getElement(this); }
|
|
2268
2267
|
};
|
|
2269
2268
|
function useDocusignFormDemo(props) {
|
|
2270
|
-
const setStep = index_module.En(
|
|
2269
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
2271
2270
|
return cjs.cjs({
|
|
2272
2271
|
text: props.getTextProps(),
|
|
2273
2272
|
states: {
|
|
@@ -2453,7 +2452,7 @@ const IndirectTaxFormView = (props) => {
|
|
|
2453
2452
|
global.intl.formatMessage({
|
|
2454
2453
|
id: "formStep",
|
|
2455
2454
|
defaultMessage: text.formStep,
|
|
2456
|
-
}, { step: states.step, count:
|
|
2455
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
2457
2456
|
index.h("h3", null, text.indirectTax),
|
|
2458
2457
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
2459
2458
|
index.h("p", { class: classes.DescriptionText }, text.indirectTaxDescription)),
|
|
@@ -2548,12 +2547,12 @@ function useIndirectTaxForm(props) {
|
|
|
2548
2547
|
const user = index_module.J();
|
|
2549
2548
|
const locale = index_module.L();
|
|
2550
2549
|
const formRef = domContextHooks_module.useRef(null);
|
|
2551
|
-
const context = index_module.Fn(
|
|
2552
|
-
const [step, setStep] = index_module.Pn(
|
|
2550
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
2551
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
2553
2552
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
2554
|
-
const userForm = index_module.Fn(
|
|
2555
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
2556
|
-
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(
|
|
2553
|
+
const userForm = index_module.Fn(data.USER_FORM_CONTEXT_NAMESPACE);
|
|
2554
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
2555
|
+
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(data.COUNTRIES_QUERY_NAMESPACE);
|
|
2557
2556
|
const intlLocale = (locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en";
|
|
2558
2557
|
const _countries = domContextHooks_module.useMemo(() => { var _a, _b; return (_b = (_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.map((country) => utils$1.getCountryObj({ countryCode: country.countryCode, locale: intlLocale })); }, [(_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data]);
|
|
2559
2558
|
const [loading, setLoading] = domContextHooks_module.useState(false);
|
|
@@ -2612,51 +2611,8 @@ function useIndirectTaxForm(props) {
|
|
|
2612
2611
|
console.error("Could not detect select change");
|
|
2613
2612
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
2614
2613
|
};
|
|
2615
|
-
async function connectPartner(formData) {
|
|
2616
|
-
var _a, _b, _c, _d, _e;
|
|
2617
|
-
const vars = {
|
|
2618
|
-
user: {
|
|
2619
|
-
id: user.id,
|
|
2620
|
-
accountId: user.accountId,
|
|
2621
|
-
},
|
|
2622
|
-
firstName: userForm.firstName,
|
|
2623
|
-
lastName: userForm.lastName,
|
|
2624
|
-
countryCode: userForm.countryCode,
|
|
2625
|
-
currency: userForm.currency,
|
|
2626
|
-
address: userForm.address,
|
|
2627
|
-
city: userForm.city,
|
|
2628
|
-
state: userForm.state,
|
|
2629
|
-
postalCode: userForm.postalCode,
|
|
2630
|
-
phoneNumber: userForm.phoneNumber,
|
|
2631
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2632
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
2633
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2634
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
2635
|
-
additionalTaxId: formData.qstNumber,
|
|
2636
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2637
|
-
};
|
|
2638
|
-
const result = await connectImpactPartner({
|
|
2639
|
-
vars,
|
|
2640
|
-
});
|
|
2641
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2642
|
-
throw new Error();
|
|
2643
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2644
|
-
// Output backend errors to console for now
|
|
2645
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
2646
|
-
throw new Error();
|
|
2647
|
-
}
|
|
2648
|
-
await refetch();
|
|
2649
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
2650
|
-
.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;
|
|
2651
|
-
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2652
|
-
// Fire form change event
|
|
2653
|
-
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
2654
|
-
return {
|
|
2655
|
-
resultPublisher,
|
|
2656
|
-
hasValidCurrentDocument,
|
|
2657
|
-
};
|
|
2658
|
-
}
|
|
2659
2614
|
const onSubmit = async (event) => {
|
|
2615
|
+
var _a, _b, _c, _d, _e;
|
|
2660
2616
|
if (!option) {
|
|
2661
2617
|
setErrors({ taxDetails: true });
|
|
2662
2618
|
return;
|
|
@@ -2682,7 +2638,44 @@ function useIndirectTaxForm(props) {
|
|
|
2682
2638
|
}
|
|
2683
2639
|
setLoading(true);
|
|
2684
2640
|
try {
|
|
2685
|
-
const
|
|
2641
|
+
const vars = {
|
|
2642
|
+
user: {
|
|
2643
|
+
id: user.id,
|
|
2644
|
+
accountId: user.accountId,
|
|
2645
|
+
},
|
|
2646
|
+
firstName: userForm.firstName,
|
|
2647
|
+
lastName: userForm.lastName,
|
|
2648
|
+
countryCode: userForm.countryCode,
|
|
2649
|
+
currency: userForm.currency,
|
|
2650
|
+
address: userForm.address,
|
|
2651
|
+
city: userForm.city,
|
|
2652
|
+
state: userForm.state,
|
|
2653
|
+
postalCode: userForm.postalCode,
|
|
2654
|
+
phoneNumber: userForm.phoneNumber,
|
|
2655
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2656
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
2657
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2658
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
2659
|
+
additionalTaxId: formData.qstNumber,
|
|
2660
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2661
|
+
};
|
|
2662
|
+
const result = await connectImpactPartner({
|
|
2663
|
+
vars,
|
|
2664
|
+
});
|
|
2665
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2666
|
+
throw new Error();
|
|
2667
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2668
|
+
// Output backend errors to console for now
|
|
2669
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
2670
|
+
.validationErrors);
|
|
2671
|
+
throw new Error();
|
|
2672
|
+
}
|
|
2673
|
+
await refetch();
|
|
2674
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
2675
|
+
.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;
|
|
2676
|
+
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2677
|
+
// Fire form change event
|
|
2678
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
2686
2679
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
2687
2680
|
!hasValidCurrentDocument) {
|
|
2688
2681
|
// Go to docusign form
|
|
@@ -2958,7 +2951,7 @@ const IndirectTaxForm = class {
|
|
|
2958
2951
|
}
|
|
2959
2952
|
};
|
|
2960
2953
|
function useDemoIndirectTaxForm(props) {
|
|
2961
|
-
const setStep = index_module.En(
|
|
2954
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
2962
2955
|
const [option, setOption] = domContextHooks_module.useState("otherRegion");
|
|
2963
2956
|
const [demoFormState, setDemoFormState] = domContextHooks_module.useState({});
|
|
2964
2957
|
return cjs.cjs({
|
|
@@ -3593,8 +3586,8 @@ function PayoutDetailsCardView(props) {
|
|
|
3593
3586
|
|
|
3594
3587
|
function usePayoutDetailsCard(props) {
|
|
3595
3588
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
3596
|
-
const { data, loading } = index_module.$n(
|
|
3597
|
-
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
3589
|
+
const { data: data$1, loading } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
3590
|
+
const publisher = (_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
3598
3591
|
function getPayoutDetailedStatusText(paymentDay) {
|
|
3599
3592
|
var _a;
|
|
3600
3593
|
const currentDay = luxon.luxon.DateTime.now().day;
|
|
@@ -4035,7 +4028,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4035
4028
|
icon: "exclamation-octagon",
|
|
4036
4029
|
class: sheet$4.classes.ErrorHoldAlertContainer,
|
|
4037
4030
|
};
|
|
4038
|
-
case "
|
|
4031
|
+
case "ACCOUNT_REVIEW":
|
|
4039
4032
|
return {
|
|
4040
4033
|
header: text.accountReviewHeader,
|
|
4041
4034
|
description: global.intl.formatMessage({
|
|
@@ -4049,96 +4042,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4049
4042
|
icon: "exclamation-triangle",
|
|
4050
4043
|
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4051
4044
|
};
|
|
4052
|
-
case "PAYMENT_HOLD_ON_CHANGE":
|
|
4053
|
-
return {
|
|
4054
|
-
header: text.paymentHoldOnChangeHeader,
|
|
4055
|
-
description: global.intl.formatMessage({
|
|
4056
|
-
id: "accountReviewDescription",
|
|
4057
|
-
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
4058
|
-
}, {
|
|
4059
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4060
|
-
}),
|
|
4061
|
-
buttonText: null,
|
|
4062
|
-
alertType: "warning",
|
|
4063
|
-
icon: "exclamation-triangle",
|
|
4064
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4065
|
-
};
|
|
4066
|
-
case "BENEFICIARY_NAME_INVALID":
|
|
4067
|
-
return {
|
|
4068
|
-
header: text.beneficiaryNameInvalidHeader,
|
|
4069
|
-
description: global.intl.formatMessage({
|
|
4070
|
-
id: "accountReviewDescription",
|
|
4071
|
-
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
4072
|
-
}, {
|
|
4073
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4074
|
-
}),
|
|
4075
|
-
button: (index.h(index.Fragment, null,
|
|
4076
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4077
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4078
|
-
alertType: "warning",
|
|
4079
|
-
icon: "exclamation-triangle",
|
|
4080
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4081
|
-
};
|
|
4082
|
-
case "BENEFICIARY_NAME_MISMATCH":
|
|
4083
|
-
return {
|
|
4084
|
-
header: text.beneficiaryNameMismatchHeader,
|
|
4085
|
-
description: global.intl.formatMessage({
|
|
4086
|
-
id: "accountReviewDescription",
|
|
4087
|
-
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
4088
|
-
}, {
|
|
4089
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4090
|
-
}),
|
|
4091
|
-
button: (index.h(index.Fragment, null,
|
|
4092
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4093
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4094
|
-
alertType: "warning",
|
|
4095
|
-
icon: "exclamation-triangle",
|
|
4096
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4097
|
-
};
|
|
4098
|
-
case "BANK_TAX_NAME_MISMATCH":
|
|
4099
|
-
return {
|
|
4100
|
-
header: text.bankTaxNameMismatchHeader,
|
|
4101
|
-
description: global.intl.formatMessage({
|
|
4102
|
-
id: "accountReviewDescription",
|
|
4103
|
-
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
4104
|
-
}, {
|
|
4105
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4106
|
-
}),
|
|
4107
|
-
button: (index.h(index.Fragment, null,
|
|
4108
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4109
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4110
|
-
alertType: "warning",
|
|
4111
|
-
icon: "exclamation-triangle",
|
|
4112
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4113
|
-
};
|
|
4114
|
-
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
4115
|
-
return {
|
|
4116
|
-
header: text.withdrawalSettingsInvalidHeader,
|
|
4117
|
-
description: global.intl.formatMessage({
|
|
4118
|
-
id: "accountReviewDescription",
|
|
4119
|
-
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
4120
|
-
}, {
|
|
4121
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4122
|
-
}),
|
|
4123
|
-
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4124
|
-
alertType: "warning",
|
|
4125
|
-
icon: "exclamation-triangle",
|
|
4126
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4127
|
-
};
|
|
4128
|
-
case "PAYMENT_RETURNED":
|
|
4129
|
-
return {
|
|
4130
|
-
header: text.paymentReturnedHeader,
|
|
4131
|
-
description: global.intl.formatMessage({
|
|
4132
|
-
id: "accountReviewDescription",
|
|
4133
|
-
defaultMessage: text.paymentReturnedDescription,
|
|
4134
|
-
}, {
|
|
4135
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4136
|
-
}),
|
|
4137
|
-
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4138
|
-
alertType: "warning",
|
|
4139
|
-
icon: "exclamation-triangle",
|
|
4140
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4141
|
-
};
|
|
4142
4045
|
case "HOLD":
|
|
4143
4046
|
return {
|
|
4144
4047
|
header: text.payoutHoldAlertHeader,
|
|
@@ -4386,10 +4289,10 @@ function getIndirectTaxType(taxInformation) {
|
|
|
4386
4289
|
}
|
|
4387
4290
|
const useTaxAndCashDashboard = (props) => {
|
|
4388
4291
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
4389
|
-
const setStep = index_module.En(
|
|
4390
|
-
const setContext = index_module.En(
|
|
4292
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
4293
|
+
const setContext = index_module.En(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
4391
4294
|
const [showDialog, setShowDialog] = domContextHooks_module.useState(false);
|
|
4392
|
-
const { render, loading: veriffLoading, errors: veriffErrors, } =
|
|
4295
|
+
const { render, loading: veriffLoading, errors: veriffErrors, } = data.useVeriffApp();
|
|
4393
4296
|
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
4394
4297
|
const locale = index_module.L();
|
|
4395
4298
|
domContextHooks_module.useEffect(() => {
|
|
@@ -4398,8 +4301,8 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
4398
4301
|
if (window.location.hash)
|
|
4399
4302
|
setStep(`/${window.location.hash.replace("#", "")}`);
|
|
4400
4303
|
}, []);
|
|
4401
|
-
const { data, loading, errors: userError, refetch, } = index_module.$n(
|
|
4402
|
-
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
4304
|
+
const { data: data$1, loading, errors: userError, refetch, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
4305
|
+
const publisher = (_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
4403
4306
|
const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
|
|
4404
4307
|
const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
|
|
4405
4308
|
const dateSubmitted = submissionDate
|
|
@@ -4423,12 +4326,12 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
4423
4326
|
setStep("/3");
|
|
4424
4327
|
};
|
|
4425
4328
|
const provinceName = (_d = IndirectTaxDetailsView.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;
|
|
4426
|
-
const payoutStatus = data ?
|
|
4329
|
+
const payoutStatus = data$1 ? data.getStatus(data$1) : null;
|
|
4427
4330
|
domContextHooks_module.useEffect(() => {
|
|
4428
4331
|
const cb = () => refetch();
|
|
4429
|
-
window.addEventListener(
|
|
4332
|
+
window.addEventListener(data.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
4430
4333
|
return () => {
|
|
4431
|
-
window.removeEventListener(
|
|
4334
|
+
window.removeEventListener(data.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
4432
4335
|
};
|
|
4433
4336
|
}, []);
|
|
4434
4337
|
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
@@ -4709,54 +4612,6 @@ const TaxAndCashDashboard = class {
|
|
|
4709
4612
|
* @uiName Account review alert description
|
|
4710
4613
|
*/
|
|
4711
4614
|
this.accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
4712
|
-
/**
|
|
4713
|
-
* @uiName Payment hold on change alert header
|
|
4714
|
-
*/
|
|
4715
|
-
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
4716
|
-
/**
|
|
4717
|
-
* @uiName Payment hold on change alert description
|
|
4718
|
-
*/
|
|
4719
|
-
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
4720
|
-
/**
|
|
4721
|
-
* @uiName Beneficiary name invalid alert header
|
|
4722
|
-
*/
|
|
4723
|
-
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
4724
|
-
/**
|
|
4725
|
-
* @uiName Beneficiary name invalid description
|
|
4726
|
-
*/
|
|
4727
|
-
this.beneficiaryNameInvalidDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
4728
|
-
/**
|
|
4729
|
-
* @uiName Beneficiary name mismatch alert header
|
|
4730
|
-
*/
|
|
4731
|
-
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4732
|
-
/**
|
|
4733
|
-
* @uiName Beneficiary name mismatch alert description
|
|
4734
|
-
*/
|
|
4735
|
-
this.beneficiaryNameMismatchDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
4736
|
-
/**
|
|
4737
|
-
* @uiName Bank name mismatch alert header
|
|
4738
|
-
*/
|
|
4739
|
-
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4740
|
-
/**
|
|
4741
|
-
* @uiName Bank name mismatch alert description
|
|
4742
|
-
*/
|
|
4743
|
-
this.bankTaxNameMismatchDescription = "The bank name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
4744
|
-
/**
|
|
4745
|
-
* @uiName Withdrawal settings invalid alert header
|
|
4746
|
-
*/
|
|
4747
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
4748
|
-
/**
|
|
4749
|
-
* @uiName Withdrawal settings invalid alert description
|
|
4750
|
-
*/
|
|
4751
|
-
this.withdrawalSettingsInvalidDescription = "There are invalid characters in your payment information. Please review your information and make sure it is correct with no invalid characters. Your payouts are on hold until this is resolved.";
|
|
4752
|
-
/**
|
|
4753
|
-
* @uiName Payment returned alert header
|
|
4754
|
-
*/
|
|
4755
|
-
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
4756
|
-
/**
|
|
4757
|
-
* @uiName Payment returned alert description
|
|
4758
|
-
*/
|
|
4759
|
-
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
4760
4615
|
/**
|
|
4761
4616
|
* @uiName Terms and Conditions text
|
|
4762
4617
|
*/
|
|
@@ -6153,7 +6008,7 @@ const vanillaStyle$4 = `
|
|
|
6153
6008
|
`;
|
|
6154
6009
|
const UserInfoFormView = (props) => {
|
|
6155
6010
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
6156
|
-
const { states, states: { formState }, callbacks, text, refs, data, } = props;
|
|
6011
|
+
const { states, states: { formState }, callbacks, text, refs, data: data$1, } = props;
|
|
6157
6012
|
const { classes } = sheet$5;
|
|
6158
6013
|
const bankingCollectionText = global.intl.formatMessage({
|
|
6159
6014
|
id: "bankingCollectionText",
|
|
@@ -6162,7 +6017,7 @@ const UserInfoFormView = (props) => {
|
|
|
6162
6017
|
termsAndConditionsLink: (index.h("a", { href: text.termsAndConditionsLink, target: "_blank" }, text.termsAndConditionsLabel)),
|
|
6163
6018
|
});
|
|
6164
6019
|
let regionLabel = undefined;
|
|
6165
|
-
switch (data.regionLabelEnum) {
|
|
6020
|
+
switch (data$1.regionLabelEnum) {
|
|
6166
6021
|
case "STATE":
|
|
6167
6022
|
regionLabel = text.state;
|
|
6168
6023
|
break;
|
|
@@ -6175,12 +6030,6 @@ const UserInfoFormView = (props) => {
|
|
|
6175
6030
|
default:
|
|
6176
6031
|
regionLabel = text.state;
|
|
6177
6032
|
}
|
|
6178
|
-
function isDisabledInput(field) {
|
|
6179
|
-
var _a;
|
|
6180
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6181
|
-
return true;
|
|
6182
|
-
return false;
|
|
6183
|
-
}
|
|
6184
6033
|
return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
6185
6034
|
index.h("style", { type: "text/css" },
|
|
6186
6035
|
styleString$5,
|
|
@@ -6200,7 +6049,7 @@ const UserInfoFormView = (props) => {
|
|
|
6200
6049
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
6201
6050
|
id: "formStep",
|
|
6202
6051
|
defaultMessage: text.formStep,
|
|
6203
|
-
}, { step: states.step, count:
|
|
6052
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
6204
6053
|
index.h("h3", null, text.personalInformation),
|
|
6205
6054
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
6206
6055
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
|
|
@@ -6221,22 +6070,18 @@ const UserInfoFormView = (props) => {
|
|
|
6221
6070
|
})))),
|
|
6222
6071
|
index.h("div", null,
|
|
6223
6072
|
index.h("div", { class: classes.InputContainer },
|
|
6224
|
-
index.h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6225
|
-
states.isUser ||
|
|
6226
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6073
|
+
index.h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6227
6074
|
class: classes.ErrorInput,
|
|
6228
6075
|
helpText: utils$1.formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
6229
6076
|
}
|
|
6230
6077
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
6231
|
-
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6232
|
-
states.isUser ||
|
|
6233
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6078
|
+
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6234
6079
|
class: classes.ErrorInput,
|
|
6235
6080
|
helpText: utils$1.formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
6236
6081
|
}
|
|
6237
6082
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
6238
6083
|
index.h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
6239
|
-
index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled ||
|
|
6084
|
+
index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
6240
6085
|
class: classes.ErrorInput,
|
|
6241
6086
|
helpText: utils$1.formatErrorMessage(text.country, formState.errors.countryCode),
|
|
6242
6087
|
}
|
|
@@ -6246,14 +6091,13 @@ const UserInfoFormView = (props) => {
|
|
|
6246
6091
|
e.stopPropagation();
|
|
6247
6092
|
}, "onSl-input": (e) => {
|
|
6248
6093
|
callbacks.setCountrySearch(e.target.value);
|
|
6249
|
-
} }), (_e = data === null || data === void 0 ? void 0 : data.countries) === null || _e === void 0 ? void 0 :
|
|
6250
|
-
_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 :
|
|
6251
|
-
_f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
|
|
6094
|
+
} }), (_e = data$1 === null || data$1 === void 0 ? void 0 : data$1.countries) === null || _e === void 0 ? void 0 :
|
|
6095
|
+
_e.map((c) => (index.h("sl-menu-item", { value: c.countryCode, exportparts: "base: menu-item-base" }, c.displayName))), (_f = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _f === void 0 ? void 0 :
|
|
6096
|
+
_f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" }, exportparts: "base: menu-item-base" }, c.displayName)))),
|
|
6252
6097
|
index.h("div", { class: classes.PhoneInputsSection },
|
|
6253
6098
|
index.h("p", null, text.phoneNumber),
|
|
6254
6099
|
index.h("div", { class: classes.PhoneInputsContainer },
|
|
6255
|
-
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6256
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6100
|
+
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", 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) ? {
|
|
6257
6101
|
class: classes.ErrorInput,
|
|
6258
6102
|
}
|
|
6259
6103
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -6262,13 +6106,13 @@ const UserInfoFormView = (props) => {
|
|
|
6262
6106
|
e.stopPropagation();
|
|
6263
6107
|
}, "onSl-input": (e) => {
|
|
6264
6108
|
callbacks.setPhoneCountrySearch(e.target.value);
|
|
6265
|
-
} }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
6109
|
+
} }), (_h = data$1 === null || data$1 === void 0 ? void 0 : data$1.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
6266
6110
|
_h.map((c) => {
|
|
6267
6111
|
var _a, _b;
|
|
6268
6112
|
return (index.h("sl-menu-item", { value: c.countryCode },
|
|
6269
6113
|
index.h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
6270
6114
|
_b.dial_code));
|
|
6271
|
-
}), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
|
|
6115
|
+
}), (_j = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _j === void 0 ? void 0 :
|
|
6272
6116
|
_j.map((c) => {
|
|
6273
6117
|
var _a, _b;
|
|
6274
6118
|
return (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
|
|
@@ -6279,7 +6123,7 @@ const UserInfoFormView = (props) => {
|
|
|
6279
6123
|
// Naive phone number validation
|
|
6280
6124
|
utils$1.validateBillingField(/[a-zA-Z]+/, value) &&
|
|
6281
6125
|
utils$1.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
6282
|
-
}, disabled: states.disabled ||
|
|
6126
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
6283
6127
|
class: classes.ErrorInput,
|
|
6284
6128
|
helpText: utils$1.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
6285
6129
|
}
|
|
@@ -6287,7 +6131,7 @@ const UserInfoFormView = (props) => {
|
|
|
6287
6131
|
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
6288
6132
|
// Checks for non-ASCII characters
|
|
6289
6133
|
!utils$1.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6290
|
-
utils$1.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6134
|
+
utils$1.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
6291
6135
|
class: classes.ErrorInput,
|
|
6292
6136
|
helpText: utils$1.formatErrorMessage(text.address, formState.errors.address),
|
|
6293
6137
|
}
|
|
@@ -6295,22 +6139,22 @@ const UserInfoFormView = (props) => {
|
|
|
6295
6139
|
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
6296
6140
|
// Checks for non-ASCII characters
|
|
6297
6141
|
!utils$1.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6298
|
-
utils$1.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6142
|
+
utils$1.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
6299
6143
|
class: classes.ErrorInput,
|
|
6300
6144
|
helpText: utils$1.formatErrorMessage(text.city, formState.errors.city),
|
|
6301
6145
|
}
|
|
6302
6146
|
: {}), { required: true })),
|
|
6303
|
-
!states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
6147
|
+
!states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
6304
6148
|
class: classes.ErrorInput,
|
|
6305
6149
|
helpText: utils$1.formatErrorMessage(text.state, formState.errors.state),
|
|
6306
6150
|
}
|
|
6307
|
-
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6308
|
-
index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled ||
|
|
6151
|
+
: {}), { required: true }), (_p = data$1.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6152
|
+
index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
6309
6153
|
class: classes.ErrorInput,
|
|
6310
6154
|
helpText: utils$1.formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
6311
6155
|
}
|
|
6312
6156
|
: {}), { required: true })),
|
|
6313
|
-
index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled ||
|
|
6157
|
+
index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", 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) ? {
|
|
6314
6158
|
class: classes.ErrorInput,
|
|
6315
6159
|
helpText: utils$1.formatErrorMessage(text.currency, formState.errors.currency),
|
|
6316
6160
|
}
|
|
@@ -6320,11 +6164,11 @@ const UserInfoFormView = (props) => {
|
|
|
6320
6164
|
e.stopPropagation();
|
|
6321
6165
|
}, "onSl-input": (e) => {
|
|
6322
6166
|
callbacks.setCurrencySearch(e.target.value);
|
|
6323
|
-
} }), (_s = data === null || data === void 0 ? void 0 : data.currencies) === null || _s === void 0 ? void 0 :
|
|
6167
|
+
} }), (_s = data$1 === null || data$1 === void 0 ? void 0 : data$1.currencies) === null || _s === void 0 ? void 0 :
|
|
6324
6168
|
_s.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
|
|
6325
6169
|
c.currencyCode,
|
|
6326
6170
|
" - ",
|
|
6327
|
-
c.displayName))), (_t = data === null || data === void 0 ? void 0 : data.allCurrencies) === null || _t === void 0 ? void 0 :
|
|
6171
|
+
c.displayName))), (_t = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCurrencies) === null || _t === void 0 ? void 0 :
|
|
6328
6172
|
_t.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
|
|
6329
6173
|
c.currencyCode,
|
|
6330
6174
|
" - ",
|
|
@@ -6332,24 +6176,22 @@ const UserInfoFormView = (props) => {
|
|
|
6332
6176
|
index.h("div", { class: classes.CheckboxWrapper },
|
|
6333
6177
|
index.h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
6334
6178
|
e.target.value = e.target.checked;
|
|
6335
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6179
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6336
6180
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, utils$1.formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
6337
|
-
index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6181
|
+
index.h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6338
6182
|
};
|
|
6339
6183
|
|
|
6340
6184
|
function useUserInfoForm(props) {
|
|
6341
|
-
var _a, _b, _c, _d
|
|
6185
|
+
var _a, _b, _c, _d;
|
|
6342
6186
|
const currencyRef = domContextHooks_module.useRef(undefined);
|
|
6343
6187
|
const phoneCountryRef = domContextHooks_module.useRef(undefined);
|
|
6344
6188
|
const formRef = domContextHooks_module.useRef(null);
|
|
6345
|
-
const context = index_module.Fn(
|
|
6346
|
-
const countries = index_module.Fn(
|
|
6347
|
-
const [step, setStep] = index_module.Pn(
|
|
6348
|
-
const [userFormContext, setUserFormContext] = index_module.Pn(
|
|
6349
|
-
const
|
|
6350
|
-
const
|
|
6351
|
-
const { data, loading, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
6352
|
-
const _currencies = index_module.Fn(usePayoutStatus.CURRENCIES_NAMESPACE);
|
|
6189
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
6190
|
+
const countries = index_module.Fn(data.SORTED_COUNTRIES_NAMESPACE);
|
|
6191
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
6192
|
+
const [userFormContext, setUserFormContext] = index_module.Pn(data.USER_FORM_CONTEXT_NAMESPACE);
|
|
6193
|
+
const { data: data$1, loading, errors: userError, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
6194
|
+
const _currencies = index_module.Fn(data.CURRENCIES_NAMESPACE);
|
|
6353
6195
|
const currencies = domContextHooks_module.useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
6354
6196
|
const [countrySearch, setCountrySearch] = domContextHooks_module.useState("");
|
|
6355
6197
|
const [phoneCountrySearch, setPhoneCountrySearch] = domContextHooks_module.useState("");
|
|
@@ -6364,7 +6206,7 @@ function useUserInfoForm(props) {
|
|
|
6364
6206
|
}, []);
|
|
6365
6207
|
domContextHooks_module.useEffect(() => {
|
|
6366
6208
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
6367
|
-
const user = data === null || data === void 0 ? void 0 : data.user;
|
|
6209
|
+
const user = data$1 === null || data$1 === void 0 ? void 0 : data$1.user;
|
|
6368
6210
|
if (!user || step !== "/1")
|
|
6369
6211
|
return;
|
|
6370
6212
|
// If form already filled out, skip initialising it
|
|
@@ -6405,7 +6247,7 @@ function useUserInfoForm(props) {
|
|
|
6405
6247
|
postalCode: (_k = user.customFields) === null || _k === void 0 ? void 0 : _k.postalCode,
|
|
6406
6248
|
});
|
|
6407
6249
|
}
|
|
6408
|
-
}, [data, step, userFormContext]);
|
|
6250
|
+
}, [data$1, step, userFormContext]);
|
|
6409
6251
|
const onFormChange = (field, e) => {
|
|
6410
6252
|
var _a, _b;
|
|
6411
6253
|
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
@@ -6450,45 +6292,6 @@ function useUserInfoForm(props) {
|
|
|
6450
6292
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
6451
6293
|
}
|
|
6452
6294
|
}, [currencySearch, currencies]);
|
|
6453
|
-
async function connectPartner(formData) {
|
|
6454
|
-
var _a, _b, _c, _d, _e;
|
|
6455
|
-
const vars = {
|
|
6456
|
-
user: {
|
|
6457
|
-
id: user.id,
|
|
6458
|
-
accountId: user.accountId,
|
|
6459
|
-
},
|
|
6460
|
-
firstName: formData.firstName,
|
|
6461
|
-
lastName: formData.lastName,
|
|
6462
|
-
countryCode: formData.countryCode,
|
|
6463
|
-
currency: formData.currency,
|
|
6464
|
-
address: formData.address,
|
|
6465
|
-
city: formData.city,
|
|
6466
|
-
state: formData.state,
|
|
6467
|
-
postalCode: formData.postalCode,
|
|
6468
|
-
phoneNumber: formData.phoneNumber,
|
|
6469
|
-
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
6470
|
-
};
|
|
6471
|
-
const result = await connectImpactPartner({
|
|
6472
|
-
vars,
|
|
6473
|
-
});
|
|
6474
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
6475
|
-
throw new Error();
|
|
6476
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
6477
|
-
// Output backend errors to console for now
|
|
6478
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
6479
|
-
throw new Error();
|
|
6480
|
-
}
|
|
6481
|
-
await refetch();
|
|
6482
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
6483
|
-
.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;
|
|
6484
|
-
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
6485
|
-
// Fire form change event
|
|
6486
|
-
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
6487
|
-
return {
|
|
6488
|
-
resultPublisher,
|
|
6489
|
-
hasValidCurrentDocument,
|
|
6490
|
-
};
|
|
6491
|
-
}
|
|
6492
6295
|
async function onSubmit(event) {
|
|
6493
6296
|
let formControls = event.target.getFormControls();
|
|
6494
6297
|
let formData = {};
|
|
@@ -6531,41 +6334,9 @@ function useUserInfoForm(props) {
|
|
|
6531
6334
|
postalCode: userData.postalCode,
|
|
6532
6335
|
currency: userData.currency,
|
|
6533
6336
|
});
|
|
6534
|
-
const
|
|
6535
|
-
console.log({ skipNextStep });
|
|
6536
|
-
if (skipNextStep) {
|
|
6537
|
-
try {
|
|
6538
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
6539
|
-
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
6540
|
-
!hasValidCurrentDocument) {
|
|
6541
|
-
// Go to docusign form
|
|
6542
|
-
setStep("/3");
|
|
6543
|
-
}
|
|
6544
|
-
else {
|
|
6545
|
-
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
6546
|
-
// Go to banking information form
|
|
6547
|
-
setStep("/4");
|
|
6548
|
-
}
|
|
6549
|
-
else {
|
|
6550
|
-
// Go right to the dashboard
|
|
6551
|
-
setStep("/dashboard");
|
|
6552
|
-
}
|
|
6553
|
-
}
|
|
6554
|
-
return;
|
|
6555
|
-
}
|
|
6556
|
-
catch (e) {
|
|
6557
|
-
setErrors({ general: true });
|
|
6558
|
-
return;
|
|
6559
|
-
}
|
|
6560
|
-
}
|
|
6561
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
6337
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
6562
6338
|
setStep(nextStep);
|
|
6563
6339
|
}
|
|
6564
|
-
function getSkipNextStep(userData) {
|
|
6565
|
-
if (userData.countryCode === "US")
|
|
6566
|
-
return true;
|
|
6567
|
-
return true;
|
|
6568
|
-
}
|
|
6569
6340
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
6570
6341
|
const regionObj = hasStates
|
|
6571
6342
|
? IndirectTaxDetailsView.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -6593,17 +6364,16 @@ function useUserInfoForm(props) {
|
|
|
6593
6364
|
allCountries: countries,
|
|
6594
6365
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
6595
6366
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
6596
|
-
partnerData: (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher,
|
|
6597
6367
|
},
|
|
6598
6368
|
states: {
|
|
6599
6369
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
6600
6370
|
hideState: !hasStates,
|
|
6601
6371
|
hideSteps: !!context.hideSteps,
|
|
6602
|
-
disabled: loading
|
|
6372
|
+
disabled: loading,
|
|
6603
6373
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6604
|
-
loading: loading
|
|
6605
|
-
isPartner: !!((
|
|
6606
|
-
isUser: !!((
|
|
6374
|
+
loading: loading,
|
|
6375
|
+
isPartner: !!((_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher),
|
|
6376
|
+
isUser: !!((_d = (_c = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.user),
|
|
6607
6377
|
formState: {
|
|
6608
6378
|
...userFormContext,
|
|
6609
6379
|
errors: formErrors,
|
|
@@ -6793,7 +6563,7 @@ const TaxForm = class {
|
|
|
6793
6563
|
}
|
|
6794
6564
|
};
|
|
6795
6565
|
function useDemoUserInfoForm(props) {
|
|
6796
|
-
const setStep = index_module.En(
|
|
6566
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
6797
6567
|
return cjs.cjs({
|
|
6798
6568
|
setStep,
|
|
6799
6569
|
onSubmit: async () => {
|