@saasquatch/mint-components 2.0.2-6 → 2.0.2-7
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-dce2a79b.js → IndirectTaxDetailsView-e5f70b8b.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-357bc625.js → ShadowViewAddon-925a8fa6.js} +8 -8
- package/dist/cjs/{global-3d01d469.js → global-8bba5b3a.js} +1 -5
- 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 +345 -115
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +224 -29
- 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 +14 -1
- package/dist/cjs/{sqm-lead-checkbox-field-view-ebb9ead9.js → sqm-lead-checkbox-field-view-340acad0.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-62debb73.js → sqm-lead-input-field-view-06ed3632.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-c280139a.js → sqm-portal-email-verification-view-5518eb0d.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-7bca5749.js → sqm-portal-profile-view-615e6975.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 +9 -8
- package/dist/cjs/{useLeadFormState-593f5d39.js → useLeadFormState-fd0445f9.js} +1 -1
- package/dist/cjs/{data-16106637.js → usePayoutStatus-95874989.js} +155 -129
- package/dist/cjs/{utils-5167439f.js → utils-83d125fa.js} +1 -1
- package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +80 -3
- 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 +1 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +2 -1
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +46 -40
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +90 -2
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +353 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +30 -3
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +301 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +92 -2
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +302 -2
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +23 -12
- 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 +92 -9
- package/dist/collection/global/styles.js +1 -5
- package/dist/collection/global/styles.ts +1 -5
- package/dist/esm/{IndirectTaxDetailsView-b7fa596b.js → IndirectTaxDetailsView-0a57b622.js} +2 -2
- package/dist/esm/{ShadowViewAddon-32559cba.js → ShadowViewAddon-aae27c2e.js} +8 -8
- package/dist/esm/{global-55e73040.js → global-1099f20d.js} +1 -5
- 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 +296 -66
- package/dist/esm/sqm-big-stat_47.entry.js +202 -7
- 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 +14 -1
- package/dist/esm/{sqm-lead-checkbox-field-view-c359cc95.js → sqm-lead-checkbox-field-view-cbafee07.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-6fe71f32.js → sqm-lead-input-field-view-f3775c28.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-176ddb91.js → sqm-portal-email-verification-view-7d86299c.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-6a53716b.js → sqm-portal-profile-view-3ed13e4d.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 +9 -8
- package/dist/esm/{useLeadFormState-d8667862.js → useLeadFormState-c379e5d7.js} +1 -1
- package/dist/esm/{data-acdb790f.js → usePayoutStatus-c515b24b.js} +156 -130
- package/dist/esm/{utils-27fdc7d7.js → utils-6122971b.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-b7fa596b.js → IndirectTaxDetailsView-0a57b622.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-32559cba.js → ShadowViewAddon-aae27c2e.js} +1 -1
- package/dist/esm-es5/{global-55e73040.js → global-1099f20d.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-c359cc95.js → sqm-lead-checkbox-field-view-cbafee07.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-6fe71f32.js → sqm-lead-input-field-view-f3775c28.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-176ddb91.js → sqm-portal-email-verification-view-7d86299c.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-6a53716b.js → sqm-portal-profile-view-3ed13e4d.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-d8667862.js → useLeadFormState-c379e5d7.js} +1 -1
- package/dist/esm-es5/usePayoutStatus-c515b24b.js +6 -0
- package/dist/esm-es5/{utils-27fdc7d7.js → utils-6122971b.js} +1 -1
- package/dist/mint-components/global/styles.ts +1 -5
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-c25e76f7.js → p-00bc7211.js} +1 -1
- package/dist/mint-components/{p-3aba7c3a.system.entry.js → p-0649123a.system.entry.js} +1 -1
- package/dist/mint-components/p-09ab53fb.system.entry.js +1 -0
- package/dist/mint-components/{p-b9d63ca9.system.entry.js → p-14e813a7.system.entry.js} +1 -1
- package/dist/mint-components/{p-7a2375c3.system.entry.js → p-18720462.system.entry.js} +1 -1
- package/dist/mint-components/p-1c1ae908.system.js +6 -0
- package/dist/mint-components/{p-6ec7b746.system.entry.js → p-22a9114f.system.entry.js} +1 -1
- package/dist/mint-components/p-37544d95.system.entry.js +1 -0
- package/dist/mint-components/{p-73fdd315.system.js → p-38f932ae.system.js} +1 -1
- package/dist/mint-components/{p-5a8911c7.entry.js → p-47c83656.entry.js} +1 -1
- package/dist/mint-components/p-49da7b73.entry.js +273 -0
- package/dist/mint-components/{p-449314ca.entry.js → p-4c811d12.entry.js} +1 -1
- package/dist/mint-components/{p-745a27ee.system.entry.js → p-4ce51b1c.system.entry.js} +1 -1
- package/dist/mint-components/{p-9db05d78.js → p-4fed8672.js} +1 -1
- package/dist/mint-components/{p-b5905137.system.entry.js → p-511c87ce.system.entry.js} +1 -1
- package/dist/mint-components/{p-5b088b96.system.entry.js → p-56009bf0.system.entry.js} +1 -1
- package/dist/mint-components/{p-47b73018.js → p-57ce33dd.js} +2 -2
- package/dist/mint-components/{p-da0a7fa5.entry.js → p-5d059c95.entry.js} +1 -1
- package/dist/mint-components/{p-2e0a3d84.entry.js → p-5f3eafd4.entry.js} +2 -2
- package/dist/mint-components/{p-4cfa1432.system.js → p-60465a2d.system.js} +1 -1
- package/dist/mint-components/{p-93f37676.entry.js → p-60c14cec.entry.js} +1 -1
- package/dist/mint-components/{p-709cdbf7.system.entry.js → p-6445e926.system.entry.js} +1 -1
- package/dist/mint-components/{p-c803eaed.entry.js → p-6c006998.entry.js} +1 -1
- package/dist/mint-components/{p-618d249d.js → p-6d5bd95a.js} +1 -1
- package/dist/mint-components/{p-757820a4.entry.js → p-6d9ce4e5.entry.js} +1 -1
- package/dist/mint-components/{p-959925bf.system.entry.js → p-717b6730.system.entry.js} +1 -1
- package/dist/mint-components/{p-f9c3290d.system.js → p-74f43a08.system.js} +1 -1
- package/dist/mint-components/{p-ec0f9326.js → p-79a3344f.js} +1 -1
- package/dist/mint-components/{p-9504b639.js → p-7a268047.js} +1 -1
- package/dist/mint-components/p-8b5b2acc.entry.js +1 -0
- package/dist/mint-components/p-8b726fe1.system.entry.js +1 -0
- package/dist/mint-components/p-8b73f5bf.entry.js +99 -0
- package/dist/mint-components/p-967a9040.system.js +1 -0
- package/dist/mint-components/{p-bcb8532f.entry.js → p-a217cc8d.entry.js} +1 -1
- package/dist/mint-components/{p-b427cf9e.entry.js → p-a5c63310.entry.js} +1 -1
- package/dist/mint-components/{p-271c092c.system.js → p-aa08457e.system.js} +1 -1
- package/dist/mint-components/{p-887e3b03.js → p-aa8c6332.js} +1 -1
- package/dist/mint-components/p-ab111e29.entry.js +1 -0
- package/dist/mint-components/{p-e8661eaa.system.js → p-ad4348c3.system.js} +1 -1
- package/dist/mint-components/{p-130fd1d8.entry.js → p-aefaec37.entry.js} +1 -1
- package/dist/mint-components/{p-54154ed4.system.entry.js → p-bec87ac9.system.entry.js} +1 -1
- package/dist/mint-components/{p-52123353.system.js → p-c85f204b.system.js} +1 -1
- package/dist/mint-components/{p-aeea89b4.system.js → p-c994512c.system.js} +1 -1
- package/dist/mint-components/p-c9cceb05.js +157 -0
- package/dist/mint-components/{p-84632241.system.entry.js → p-d3120982.system.entry.js} +1 -1
- package/dist/mint-components/{p-1b7900ed.js → p-db1a0db1.js} +1 -1
- package/dist/mint-components/{p-bcc61fbe.system.js → p-e0a724dd.system.js} +1 -1
- package/dist/mint-components/p-ea0bc627.entry.js +1 -0
- package/dist/mint-components/{p-23c21cf4.js → p-ed16b35a.js} +1 -1
- package/dist/mint-components/{p-0c6259b2.system.js → p-f0eae4e6.system.js} +1 -1
- package/dist/mint-components/{p-46a22d08.system.entry.js → p-f401ef19.system.entry.js} +1 -1
- package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +14 -1
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +24 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +16 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +57 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +3 -1
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +48 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +12 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +48 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +2 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -0
- package/dist/types/components.d.ts +331 -41
- package/dist/types/global/android.d.ts +7 -0
- package/dist/types/global/demo.d.ts +2 -0
- package/dist/types/stories/features.d.ts +4 -0
- package/dist/types/stories/templates.d.ts +4 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/data-acdb790f.js +0 -6
- package/dist/mint-components/p-17e3f564.system.entry.js +0 -1
- package/dist/mint-components/p-469a6450.system.js +0 -6
- package/dist/mint-components/p-8a2ec966.entry.js +0 -1
- package/dist/mint-components/p-8a458176.entry.js +0 -273
- package/dist/mint-components/p-9d4f1401.system.entry.js +0 -1
- package/dist/mint-components/p-9ff60e10.system.js +0 -1
- package/dist/mint-components/p-a7ee19dc.entry.js +0 -1
- package/dist/mint-components/p-c8bbd212.entry.js +0 -99
- package/dist/mint-components/p-e1e7d01c.js +0 -157
- package/dist/mint-components/p-eea87fdc.system.entry.js +0 -1
- package/dist/mint-components/p-fac02d24.entry.js +0 -1
- package/shoelace/assets/icons/twitter-x.svg +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as Host, g as getElement } from './index-b3a06de8.js';
|
|
2
|
-
import { i as intl } from './global-
|
|
1
|
+
import { h, r as registerInstance, c as Host, g as getElement, F as Fragment } from './index-b3a06de8.js';
|
|
2
|
+
import { i as intl } from './global-1099f20d.js';
|
|
3
3
|
import { m as useRef, k as useState, f as useEffect, n as h$1, u as useMemo, b as browser, j as useReducer } from './dom-context-hooks.module-63370afd.js';
|
|
4
4
|
import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, p as En, u as useCallback, R as Rn, w as wn } from './index.module-c9811a48.js';
|
|
5
5
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
@@ -12,10 +12,10 @@ import { u as useRerenderListener, a as useRequestRerender } from './re-render-7
|
|
|
12
12
|
import { u as useChildElements } from './useChildElements-3d872cef.js';
|
|
13
13
|
import { l as luxon } from './luxon-bbf75a9d.js';
|
|
14
14
|
import { g as generateUserError } from './useReferralTable-909ccb28.js';
|
|
15
|
-
import { a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, A as ADDRESS_REGIONS } from './IndirectTaxDetailsView-
|
|
16
|
-
import { t as taxTypeToName, v as validTaxDocument, g as getCountryObj, L as LoadingView, f as formatErrorMessage, a as validateBillingField, o as objectIsFull } from './utils-
|
|
15
|
+
import { a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, A as ADDRESS_REGIONS } from './IndirectTaxDetailsView-0a57b622.js';
|
|
16
|
+
import { t as taxTypeToName, v as validTaxDocument, g as getCountryObj, L as LoadingView, f as formatErrorMessage, a as validateBillingField, o as objectIsFull } from './utils-6122971b.js';
|
|
17
17
|
import { b as VERIFICATION_EVENT_KEY } from './keys-406491dc.js';
|
|
18
|
-
import { i as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, F as FINANCE_NETWORK_SETTINGS_NAMESPACE, j as TAX_FORM_UPDATED_EVENT_KEY, U as USER_FORM_CONTEXT_NAMESPACE, d as COUNTRIES_QUERY_NAMESPACE, k as useVeriffApp, l as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, C as CURRENCIES_NAMESPACE } from './
|
|
18
|
+
import { i as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, F as FINANCE_NETWORK_SETTINGS_NAMESPACE, j as TAX_FORM_UPDATED_EVENT_KEY, U as USER_FORM_CONTEXT_NAMESPACE, d as COUNTRIES_QUERY_NAMESPACE, k as useVeriffApp, l as getStatus, V as VERIFF_COMPLETE_EVENT_KEY, C as CURRENCIES_NAMESPACE } from './usePayoutStatus-c515b24b.js';
|
|
19
19
|
|
|
20
20
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
21
21
|
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;
|
|
@@ -901,7 +901,8 @@ function useBankingInfoForm(props) {
|
|
|
901
901
|
: _paymentMethodChecked;
|
|
902
902
|
useEffect(() => {
|
|
903
903
|
// reset redirect hash
|
|
904
|
-
window.location.hash
|
|
904
|
+
if (window.location.hash !== "#4")
|
|
905
|
+
window.location.hash = "";
|
|
905
906
|
}, []);
|
|
906
907
|
useEffect(() => {
|
|
907
908
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -2607,8 +2608,51 @@ function useIndirectTaxForm(props) {
|
|
|
2607
2608
|
console.error("Could not detect select change");
|
|
2608
2609
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
2609
2610
|
};
|
|
2610
|
-
|
|
2611
|
+
async function connectPartner(formData) {
|
|
2611
2612
|
var _a, _b, _c, _d, _e;
|
|
2613
|
+
const vars = {
|
|
2614
|
+
user: {
|
|
2615
|
+
id: user.id,
|
|
2616
|
+
accountId: user.accountId,
|
|
2617
|
+
},
|
|
2618
|
+
firstName: userForm.firstName,
|
|
2619
|
+
lastName: userForm.lastName,
|
|
2620
|
+
countryCode: userForm.countryCode,
|
|
2621
|
+
currency: userForm.currency,
|
|
2622
|
+
address: userForm.address,
|
|
2623
|
+
city: userForm.city,
|
|
2624
|
+
state: userForm.state,
|
|
2625
|
+
postalCode: userForm.postalCode,
|
|
2626
|
+
phoneNumber: userForm.phoneNumber,
|
|
2627
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2628
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
2629
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2630
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
2631
|
+
additionalTaxId: formData.qstNumber,
|
|
2632
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2633
|
+
};
|
|
2634
|
+
const result = await connectImpactPartner({
|
|
2635
|
+
vars,
|
|
2636
|
+
});
|
|
2637
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2638
|
+
throw new Error();
|
|
2639
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2640
|
+
// Output backend errors to console for now
|
|
2641
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
2642
|
+
throw new Error();
|
|
2643
|
+
}
|
|
2644
|
+
await refetch();
|
|
2645
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
2646
|
+
.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;
|
|
2647
|
+
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2648
|
+
// Fire form change event
|
|
2649
|
+
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
2650
|
+
return {
|
|
2651
|
+
resultPublisher,
|
|
2652
|
+
hasValidCurrentDocument,
|
|
2653
|
+
};
|
|
2654
|
+
}
|
|
2655
|
+
const onSubmit = async (event) => {
|
|
2612
2656
|
if (!option) {
|
|
2613
2657
|
setErrors({ taxDetails: true });
|
|
2614
2658
|
return;
|
|
@@ -2634,44 +2678,7 @@ function useIndirectTaxForm(props) {
|
|
|
2634
2678
|
}
|
|
2635
2679
|
setLoading(true);
|
|
2636
2680
|
try {
|
|
2637
|
-
const
|
|
2638
|
-
user: {
|
|
2639
|
-
id: user.id,
|
|
2640
|
-
accountId: user.accountId,
|
|
2641
|
-
},
|
|
2642
|
-
firstName: userForm.firstName,
|
|
2643
|
-
lastName: userForm.lastName,
|
|
2644
|
-
countryCode: userForm.countryCode,
|
|
2645
|
-
currency: userForm.currency,
|
|
2646
|
-
address: userForm.address,
|
|
2647
|
-
city: userForm.city,
|
|
2648
|
-
state: userForm.state,
|
|
2649
|
-
postalCode: userForm.postalCode,
|
|
2650
|
-
phoneNumber: userForm.phoneNumber,
|
|
2651
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2652
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
2653
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2654
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
2655
|
-
additionalTaxId: formData.qstNumber,
|
|
2656
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2657
|
-
};
|
|
2658
|
-
const result = await connectImpactPartner({
|
|
2659
|
-
vars,
|
|
2660
|
-
});
|
|
2661
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2662
|
-
throw new Error();
|
|
2663
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2664
|
-
// Output backend errors to console for now
|
|
2665
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
2666
|
-
.validationErrors);
|
|
2667
|
-
throw new Error();
|
|
2668
|
-
}
|
|
2669
|
-
await refetch();
|
|
2670
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
2671
|
-
.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;
|
|
2672
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2673
|
-
// Fire form change event
|
|
2674
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
2681
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
2675
2682
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
2676
2683
|
!hasValidCurrentDocument) {
|
|
2677
2684
|
// Go to docusign form
|
|
@@ -4024,7 +4031,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4024
4031
|
icon: "exclamation-octagon",
|
|
4025
4032
|
class: sheet$4.classes.ErrorHoldAlertContainer,
|
|
4026
4033
|
};
|
|
4027
|
-
case "
|
|
4034
|
+
case "NEW_PAYEE_REVIEW":
|
|
4028
4035
|
return {
|
|
4029
4036
|
header: text.accountReviewHeader,
|
|
4030
4037
|
description: intl.formatMessage({
|
|
@@ -4038,6 +4045,96 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4038
4045
|
icon: "exclamation-triangle",
|
|
4039
4046
|
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4040
4047
|
};
|
|
4048
|
+
case "PAYMENT_HOLD_ON_CHANGE":
|
|
4049
|
+
return {
|
|
4050
|
+
header: text.paymentHoldOnChangeHeader,
|
|
4051
|
+
description: intl.formatMessage({
|
|
4052
|
+
id: "accountReviewDescription",
|
|
4053
|
+
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
4054
|
+
}, {
|
|
4055
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4056
|
+
}),
|
|
4057
|
+
buttonText: null,
|
|
4058
|
+
alertType: "warning",
|
|
4059
|
+
icon: "exclamation-triangle",
|
|
4060
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4061
|
+
};
|
|
4062
|
+
case "BENEFICIARY_NAME_INVALID":
|
|
4063
|
+
return {
|
|
4064
|
+
header: text.beneficiaryNameInvalidHeader,
|
|
4065
|
+
description: intl.formatMessage({
|
|
4066
|
+
id: "accountReviewDescription",
|
|
4067
|
+
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
4068
|
+
}, {
|
|
4069
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4070
|
+
}),
|
|
4071
|
+
button: (h(Fragment, null,
|
|
4072
|
+
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4073
|
+
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4074
|
+
alertType: "warning",
|
|
4075
|
+
icon: "exclamation-triangle",
|
|
4076
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4077
|
+
};
|
|
4078
|
+
case "BENEFICIARY_NAME_MISMATCH":
|
|
4079
|
+
return {
|
|
4080
|
+
header: text.beneficiaryNameMismatchHeader,
|
|
4081
|
+
description: intl.formatMessage({
|
|
4082
|
+
id: "accountReviewDescription",
|
|
4083
|
+
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
4084
|
+
}, {
|
|
4085
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4086
|
+
}),
|
|
4087
|
+
button: (h(Fragment, null,
|
|
4088
|
+
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4089
|
+
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4090
|
+
alertType: "warning",
|
|
4091
|
+
icon: "exclamation-triangle",
|
|
4092
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4093
|
+
};
|
|
4094
|
+
case "BANK_TAX_NAME_MISMATCH":
|
|
4095
|
+
return {
|
|
4096
|
+
header: text.bankTaxNameMismatchHeader,
|
|
4097
|
+
description: intl.formatMessage({
|
|
4098
|
+
id: "accountReviewDescription",
|
|
4099
|
+
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
4100
|
+
}, {
|
|
4101
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4102
|
+
}),
|
|
4103
|
+
button: (h(Fragment, null,
|
|
4104
|
+
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4105
|
+
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4106
|
+
alertType: "warning",
|
|
4107
|
+
icon: "exclamation-triangle",
|
|
4108
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4109
|
+
};
|
|
4110
|
+
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
4111
|
+
return {
|
|
4112
|
+
header: text.withdrawalSettingsInvalidHeader,
|
|
4113
|
+
description: intl.formatMessage({
|
|
4114
|
+
id: "accountReviewDescription",
|
|
4115
|
+
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
4116
|
+
}, {
|
|
4117
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4118
|
+
}),
|
|
4119
|
+
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4120
|
+
alertType: "warning",
|
|
4121
|
+
icon: "exclamation-triangle",
|
|
4122
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4123
|
+
};
|
|
4124
|
+
case "PAYMENT_RETURNED":
|
|
4125
|
+
return {
|
|
4126
|
+
header: text.paymentReturnedHeader,
|
|
4127
|
+
description: intl.formatMessage({
|
|
4128
|
+
id: "accountReviewDescription",
|
|
4129
|
+
defaultMessage: text.paymentReturnedDescription,
|
|
4130
|
+
}, {
|
|
4131
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4132
|
+
}),
|
|
4133
|
+
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4134
|
+
alertType: "error",
|
|
4135
|
+
icon: "exclamation-triangle",
|
|
4136
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4137
|
+
};
|
|
4041
4138
|
case "HOLD":
|
|
4042
4139
|
return {
|
|
4043
4140
|
header: text.payoutHoldAlertHeader,
|
|
@@ -4505,7 +4602,7 @@ const TaxAndCashDashboard = class {
|
|
|
4505
4602
|
*
|
|
4506
4603
|
* @uiName Edit payment info button label
|
|
4507
4604
|
*/
|
|
4508
|
-
this.editPaymentInformationButton = "Edit
|
|
4605
|
+
this.editPaymentInformationButton = "Edit payout information";
|
|
4509
4606
|
/**
|
|
4510
4607
|
* @uiName Not registered for indirect tax text
|
|
4511
4608
|
* @uiWidget textArea
|
|
@@ -4608,6 +4705,54 @@ const TaxAndCashDashboard = class {
|
|
|
4608
4705
|
* @uiName Account review alert description
|
|
4609
4706
|
*/
|
|
4610
4707
|
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}.";
|
|
4708
|
+
/**
|
|
4709
|
+
* @uiName Payment hold on change alert header
|
|
4710
|
+
*/
|
|
4711
|
+
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
4712
|
+
/**
|
|
4713
|
+
* @uiName Payment hold on change alert description
|
|
4714
|
+
*/
|
|
4715
|
+
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
4716
|
+
/**
|
|
4717
|
+
* @uiName Beneficiary name invalid alert header
|
|
4718
|
+
*/
|
|
4719
|
+
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
4720
|
+
/**
|
|
4721
|
+
* @uiName Beneficiary name invalid description
|
|
4722
|
+
*/
|
|
4723
|
+
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.";
|
|
4724
|
+
/**
|
|
4725
|
+
* @uiName Beneficiary name mismatch alert header
|
|
4726
|
+
*/
|
|
4727
|
+
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4728
|
+
/**
|
|
4729
|
+
* @uiName Beneficiary name mismatch alert description
|
|
4730
|
+
*/
|
|
4731
|
+
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.";
|
|
4732
|
+
/**
|
|
4733
|
+
* @uiName Bank name mismatch alert header
|
|
4734
|
+
*/
|
|
4735
|
+
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4736
|
+
/**
|
|
4737
|
+
* @uiName Bank name mismatch alert description
|
|
4738
|
+
*/
|
|
4739
|
+
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.";
|
|
4740
|
+
/**
|
|
4741
|
+
* @uiName Withdrawal settings invalid alert header
|
|
4742
|
+
*/
|
|
4743
|
+
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
4744
|
+
/**
|
|
4745
|
+
* @uiName Withdrawal settings invalid alert description
|
|
4746
|
+
*/
|
|
4747
|
+
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.";
|
|
4748
|
+
/**
|
|
4749
|
+
* @uiName Payment returned alert header
|
|
4750
|
+
*/
|
|
4751
|
+
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
4752
|
+
/**
|
|
4753
|
+
* @uiName Payment returned alert description
|
|
4754
|
+
*/
|
|
4755
|
+
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
4611
4756
|
/**
|
|
4612
4757
|
* @uiName Terms and Conditions text
|
|
4613
4758
|
*/
|
|
@@ -6026,6 +6171,12 @@ const UserInfoFormView = (props) => {
|
|
|
6026
6171
|
default:
|
|
6027
6172
|
regionLabel = text.state;
|
|
6028
6173
|
}
|
|
6174
|
+
function isDisabledInput(field) {
|
|
6175
|
+
var _a;
|
|
6176
|
+
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6177
|
+
return true;
|
|
6178
|
+
return false;
|
|
6179
|
+
}
|
|
6029
6180
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
6030
6181
|
h("style", { type: "text/css" },
|
|
6031
6182
|
styleString$5,
|
|
@@ -6066,18 +6217,22 @@ const UserInfoFormView = (props) => {
|
|
|
6066
6217
|
})))),
|
|
6067
6218
|
h("div", null,
|
|
6068
6219
|
h("div", { class: classes.InputContainer },
|
|
6069
|
-
h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6220
|
+
h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6221
|
+
states.isUser ||
|
|
6222
|
+
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6070
6223
|
class: classes.ErrorInput,
|
|
6071
6224
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
6072
6225
|
}
|
|
6073
6226
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
6074
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6227
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6228
|
+
states.isUser ||
|
|
6229
|
+
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6075
6230
|
class: classes.ErrorInput,
|
|
6076
6231
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
6077
6232
|
}
|
|
6078
6233
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
6079
6234
|
h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
6080
|
-
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 ||
|
|
6235
|
+
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 || isDisabledInput("countryCode") }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
6081
6236
|
class: classes.ErrorInput,
|
|
6082
6237
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
6083
6238
|
}
|
|
@@ -6093,7 +6248,8 @@ const UserInfoFormView = (props) => {
|
|
|
6093
6248
|
h("div", { class: classes.PhoneInputsSection },
|
|
6094
6249
|
h("p", null, text.phoneNumber),
|
|
6095
6250
|
h("div", { class: classes.PhoneInputsContainer },
|
|
6096
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6251
|
+
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6252
|
+
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6097
6253
|
class: classes.ErrorInput,
|
|
6098
6254
|
}
|
|
6099
6255
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -6119,7 +6275,7 @@ const UserInfoFormView = (props) => {
|
|
|
6119
6275
|
// Naive phone number validation
|
|
6120
6276
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
6121
6277
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
6122
|
-
}, disabled: states.disabled ||
|
|
6278
|
+
}, disabled: states.disabled || isDisabledInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
6123
6279
|
class: classes.ErrorInput,
|
|
6124
6280
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
6125
6281
|
}
|
|
@@ -6127,7 +6283,7 @@ const UserInfoFormView = (props) => {
|
|
|
6127
6283
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
6128
6284
|
// Checks for non-ASCII characters
|
|
6129
6285
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6130
|
-
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6286
|
+
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("address") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
6131
6287
|
class: classes.ErrorInput,
|
|
6132
6288
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
6133
6289
|
}
|
|
@@ -6135,22 +6291,22 @@ const UserInfoFormView = (props) => {
|
|
|
6135
6291
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
6136
6292
|
// Checks for non-ASCII characters
|
|
6137
6293
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6138
|
-
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6294
|
+
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("city") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
6139
6295
|
class: classes.ErrorInput,
|
|
6140
6296
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
6141
6297
|
}
|
|
6142
6298
|
: {}), { required: true })),
|
|
6143
|
-
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
6299
|
+
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || isDisabledInput("state") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
6144
6300
|
class: classes.ErrorInput,
|
|
6145
6301
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
6146
6302
|
}
|
|
6147
6303
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6148
|
-
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 ||
|
|
6304
|
+
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 || isDisabledInput("postalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
6149
6305
|
class: classes.ErrorInput,
|
|
6150
6306
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
6151
6307
|
}
|
|
6152
6308
|
: {}), { required: true })),
|
|
6153
|
-
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 ||
|
|
6309
|
+
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 || isDisabledInput("currency"), helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
6154
6310
|
class: classes.ErrorInput,
|
|
6155
6311
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
6156
6312
|
}
|
|
@@ -6172,13 +6328,13 @@ const UserInfoFormView = (props) => {
|
|
|
6172
6328
|
h("div", { class: classes.CheckboxWrapper },
|
|
6173
6329
|
h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
6174
6330
|
e.target.value = e.target.checked;
|
|
6175
|
-
}, disabled: states.
|
|
6331
|
+
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6176
6332
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
6177
|
-
h("sl-button", { type: "primary", disabled: states.
|
|
6333
|
+
h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6178
6334
|
};
|
|
6179
6335
|
|
|
6180
6336
|
function useUserInfoForm(props) {
|
|
6181
|
-
var _a, _b, _c, _d;
|
|
6337
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6182
6338
|
const currencyRef = useRef(undefined);
|
|
6183
6339
|
const phoneCountryRef = useRef(undefined);
|
|
6184
6340
|
const formRef = useRef(null);
|
|
@@ -6186,7 +6342,9 @@ function useUserInfoForm(props) {
|
|
|
6186
6342
|
const countries = Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
6187
6343
|
const [step, setStep] = Pn(TAX_CONTEXT_NAMESPACE);
|
|
6188
6344
|
const [userFormContext, setUserFormContext] = Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
6189
|
-
const
|
|
6345
|
+
const user = J();
|
|
6346
|
+
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
6347
|
+
const { data, loading, refetch, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
6190
6348
|
const _currencies = Fn(CURRENCIES_NAMESPACE);
|
|
6191
6349
|
const currencies = useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
6192
6350
|
const [countrySearch, setCountrySearch] = useState("");
|
|
@@ -6288,6 +6446,45 @@ function useUserInfoForm(props) {
|
|
|
6288
6446
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
6289
6447
|
}
|
|
6290
6448
|
}, [currencySearch, currencies]);
|
|
6449
|
+
async function connectPartner(formData) {
|
|
6450
|
+
var _a, _b, _c, _d, _e;
|
|
6451
|
+
const vars = {
|
|
6452
|
+
user: {
|
|
6453
|
+
id: user.id,
|
|
6454
|
+
accountId: user.accountId,
|
|
6455
|
+
},
|
|
6456
|
+
firstName: formData.firstName,
|
|
6457
|
+
lastName: formData.lastName,
|
|
6458
|
+
countryCode: formData.countryCode,
|
|
6459
|
+
currency: formData.currency,
|
|
6460
|
+
address: formData.address,
|
|
6461
|
+
city: formData.city,
|
|
6462
|
+
state: formData.state,
|
|
6463
|
+
postalCode: formData.postalCode,
|
|
6464
|
+
phoneNumber: formData.phoneNumber,
|
|
6465
|
+
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
6466
|
+
};
|
|
6467
|
+
const result = await connectImpactPartner({
|
|
6468
|
+
vars,
|
|
6469
|
+
});
|
|
6470
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
6471
|
+
throw new Error();
|
|
6472
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
6473
|
+
// Output backend errors to console for now
|
|
6474
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
6475
|
+
throw new Error();
|
|
6476
|
+
}
|
|
6477
|
+
await refetch();
|
|
6478
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
6479
|
+
.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;
|
|
6480
|
+
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
6481
|
+
// Fire form change event
|
|
6482
|
+
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
6483
|
+
return {
|
|
6484
|
+
resultPublisher,
|
|
6485
|
+
hasValidCurrentDocument,
|
|
6486
|
+
};
|
|
6487
|
+
}
|
|
6291
6488
|
async function onSubmit(event) {
|
|
6292
6489
|
let formControls = event.target.getFormControls();
|
|
6293
6490
|
let formData = {};
|
|
@@ -6330,9 +6527,41 @@ function useUserInfoForm(props) {
|
|
|
6330
6527
|
postalCode: userData.postalCode,
|
|
6331
6528
|
currency: userData.currency,
|
|
6332
6529
|
});
|
|
6333
|
-
const
|
|
6530
|
+
const skipNextStep = getSkipNextStep(userData);
|
|
6531
|
+
console.log({ skipNextStep });
|
|
6532
|
+
if (skipNextStep) {
|
|
6533
|
+
try {
|
|
6534
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
6535
|
+
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
6536
|
+
!hasValidCurrentDocument) {
|
|
6537
|
+
// Go to docusign form
|
|
6538
|
+
setStep("/3");
|
|
6539
|
+
}
|
|
6540
|
+
else {
|
|
6541
|
+
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
6542
|
+
// Go to banking information form
|
|
6543
|
+
setStep("/4");
|
|
6544
|
+
}
|
|
6545
|
+
else {
|
|
6546
|
+
// Go right to the dashboard
|
|
6547
|
+
setStep("/dashboard");
|
|
6548
|
+
}
|
|
6549
|
+
}
|
|
6550
|
+
return;
|
|
6551
|
+
}
|
|
6552
|
+
catch (e) {
|
|
6553
|
+
setErrors({ general: true });
|
|
6554
|
+
return;
|
|
6555
|
+
}
|
|
6556
|
+
}
|
|
6557
|
+
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
6334
6558
|
setStep(nextStep);
|
|
6335
6559
|
}
|
|
6560
|
+
function getSkipNextStep(userData) {
|
|
6561
|
+
if (userData.countryCode === "US")
|
|
6562
|
+
return true;
|
|
6563
|
+
return true;
|
|
6564
|
+
}
|
|
6336
6565
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
6337
6566
|
const regionObj = hasStates
|
|
6338
6567
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -6360,16 +6589,17 @@ function useUserInfoForm(props) {
|
|
|
6360
6589
|
allCountries: countries,
|
|
6361
6590
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
6362
6591
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
6592
|
+
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,
|
|
6363
6593
|
},
|
|
6364
6594
|
states: {
|
|
6365
6595
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
6366
6596
|
hideState: !hasStates,
|
|
6367
6597
|
hideSteps: !!context.hideSteps,
|
|
6368
|
-
disabled: loading,
|
|
6598
|
+
disabled: loading || connectLoading,
|
|
6369
6599
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6370
|
-
loading: loading,
|
|
6371
|
-
isPartner: !!((
|
|
6372
|
-
isUser: !!((
|
|
6600
|
+
loading: loading || connectLoading,
|
|
6601
|
+
isPartner: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.publisher),
|
|
6602
|
+
isUser: !!((_f = (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.user),
|
|
6373
6603
|
formState: {
|
|
6374
6604
|
...userFormContext,
|
|
6375
6605
|
errors: formErrors,
|