@saasquatch/mint-components 2.0.2-3 → 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 +114 -343
- 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-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 +66 -295
- 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-363289da.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-ab111e29.entry.js +0 -1
- package/dist/mint-components/p-c9cceb05.js +0 -157
- package/dist/mint-components/p-eb1475a1.entry.js +0 -99
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as Host, g as getElement
|
|
2
|
-
import { i as intl } from './global-
|
|
1
|
+
import { h, r as registerInstance, c as Host, g as getElement } from './index-b3a06de8.js';
|
|
2
|
+
import { i as intl } from './global-80e8f351.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-d1816a57.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-7e72d7ed.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 './data-acdb790f.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;
|
|
@@ -2607,51 +2607,8 @@ function useIndirectTaxForm(props) {
|
|
|
2607
2607
|
console.error("Could not detect select change");
|
|
2608
2608
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
2609
2609
|
};
|
|
2610
|
-
async function connectPartner(formData) {
|
|
2611
|
-
var _a, _b, _c, _d, _e;
|
|
2612
|
-
const vars = {
|
|
2613
|
-
user: {
|
|
2614
|
-
id: user.id,
|
|
2615
|
-
accountId: user.accountId,
|
|
2616
|
-
},
|
|
2617
|
-
firstName: userForm.firstName,
|
|
2618
|
-
lastName: userForm.lastName,
|
|
2619
|
-
countryCode: userForm.countryCode,
|
|
2620
|
-
currency: userForm.currency,
|
|
2621
|
-
address: userForm.address,
|
|
2622
|
-
city: userForm.city,
|
|
2623
|
-
state: userForm.state,
|
|
2624
|
-
postalCode: userForm.postalCode,
|
|
2625
|
-
phoneNumber: userForm.phoneNumber,
|
|
2626
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2627
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
2628
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2629
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
2630
|
-
additionalTaxId: formData.qstNumber,
|
|
2631
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2632
|
-
};
|
|
2633
|
-
const result = await connectImpactPartner({
|
|
2634
|
-
vars,
|
|
2635
|
-
});
|
|
2636
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2637
|
-
throw new Error();
|
|
2638
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2639
|
-
// Output backend errors to console for now
|
|
2640
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
2641
|
-
throw new Error();
|
|
2642
|
-
}
|
|
2643
|
-
await refetch();
|
|
2644
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
2645
|
-
.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;
|
|
2646
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2647
|
-
// Fire form change event
|
|
2648
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
2649
|
-
return {
|
|
2650
|
-
resultPublisher,
|
|
2651
|
-
hasValidCurrentDocument,
|
|
2652
|
-
};
|
|
2653
|
-
}
|
|
2654
2610
|
const onSubmit = async (event) => {
|
|
2611
|
+
var _a, _b, _c, _d, _e;
|
|
2655
2612
|
if (!option) {
|
|
2656
2613
|
setErrors({ taxDetails: true });
|
|
2657
2614
|
return;
|
|
@@ -2677,7 +2634,44 @@ function useIndirectTaxForm(props) {
|
|
|
2677
2634
|
}
|
|
2678
2635
|
setLoading(true);
|
|
2679
2636
|
try {
|
|
2680
|
-
const
|
|
2637
|
+
const vars = {
|
|
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
2675
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
2682
2676
|
!hasValidCurrentDocument) {
|
|
2683
2677
|
// Go to docusign form
|
|
@@ -4030,7 +4024,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4030
4024
|
icon: "exclamation-octagon",
|
|
4031
4025
|
class: sheet$4.classes.ErrorHoldAlertContainer,
|
|
4032
4026
|
};
|
|
4033
|
-
case "
|
|
4027
|
+
case "ACCOUNT_REVIEW":
|
|
4034
4028
|
return {
|
|
4035
4029
|
header: text.accountReviewHeader,
|
|
4036
4030
|
description: intl.formatMessage({
|
|
@@ -4044,96 +4038,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4044
4038
|
icon: "exclamation-triangle",
|
|
4045
4039
|
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4046
4040
|
};
|
|
4047
|
-
case "PAYMENT_HOLD_ON_CHANGE":
|
|
4048
|
-
return {
|
|
4049
|
-
header: text.paymentHoldOnChangeHeader,
|
|
4050
|
-
description: intl.formatMessage({
|
|
4051
|
-
id: "accountReviewDescription",
|
|
4052
|
-
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
4053
|
-
}, {
|
|
4054
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4055
|
-
}),
|
|
4056
|
-
buttonText: null,
|
|
4057
|
-
alertType: "warning",
|
|
4058
|
-
icon: "exclamation-triangle",
|
|
4059
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4060
|
-
};
|
|
4061
|
-
case "BENEFICIARY_NAME_INVALID":
|
|
4062
|
-
return {
|
|
4063
|
-
header: text.beneficiaryNameInvalidHeader,
|
|
4064
|
-
description: intl.formatMessage({
|
|
4065
|
-
id: "accountReviewDescription",
|
|
4066
|
-
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
4067
|
-
}, {
|
|
4068
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4069
|
-
}),
|
|
4070
|
-
button: (h(Fragment, null,
|
|
4071
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4072
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4073
|
-
alertType: "warning",
|
|
4074
|
-
icon: "exclamation-triangle",
|
|
4075
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4076
|
-
};
|
|
4077
|
-
case "BENEFICIARY_NAME_MISMATCH":
|
|
4078
|
-
return {
|
|
4079
|
-
header: text.beneficiaryNameMismatchHeader,
|
|
4080
|
-
description: intl.formatMessage({
|
|
4081
|
-
id: "accountReviewDescription",
|
|
4082
|
-
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
4083
|
-
}, {
|
|
4084
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4085
|
-
}),
|
|
4086
|
-
button: (h(Fragment, null,
|
|
4087
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4088
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4089
|
-
alertType: "warning",
|
|
4090
|
-
icon: "exclamation-triangle",
|
|
4091
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4092
|
-
};
|
|
4093
|
-
case "BANK_TAX_NAME_MISMATCH":
|
|
4094
|
-
return {
|
|
4095
|
-
header: text.bankTaxNameMismatchHeader,
|
|
4096
|
-
description: intl.formatMessage({
|
|
4097
|
-
id: "accountReviewDescription",
|
|
4098
|
-
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
4099
|
-
}, {
|
|
4100
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4101
|
-
}),
|
|
4102
|
-
button: (h(Fragment, null,
|
|
4103
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4104
|
-
h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4105
|
-
alertType: "warning",
|
|
4106
|
-
icon: "exclamation-triangle",
|
|
4107
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4108
|
-
};
|
|
4109
|
-
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
4110
|
-
return {
|
|
4111
|
-
header: text.withdrawalSettingsInvalidHeader,
|
|
4112
|
-
description: intl.formatMessage({
|
|
4113
|
-
id: "accountReviewDescription",
|
|
4114
|
-
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
4115
|
-
}, {
|
|
4116
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4117
|
-
}),
|
|
4118
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4119
|
-
alertType: "warning",
|
|
4120
|
-
icon: "exclamation-triangle",
|
|
4121
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4122
|
-
};
|
|
4123
|
-
case "PAYMENT_RETURNED":
|
|
4124
|
-
return {
|
|
4125
|
-
header: text.paymentReturnedHeader,
|
|
4126
|
-
description: intl.formatMessage({
|
|
4127
|
-
id: "accountReviewDescription",
|
|
4128
|
-
defaultMessage: text.paymentReturnedDescription,
|
|
4129
|
-
}, {
|
|
4130
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4131
|
-
}),
|
|
4132
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4133
|
-
alertType: "warning",
|
|
4134
|
-
icon: "exclamation-triangle",
|
|
4135
|
-
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4136
|
-
};
|
|
4137
4041
|
case "HOLD":
|
|
4138
4042
|
return {
|
|
4139
4043
|
header: text.payoutHoldAlertHeader,
|
|
@@ -4704,54 +4608,6 @@ const TaxAndCashDashboard = class {
|
|
|
4704
4608
|
* @uiName Account review alert description
|
|
4705
4609
|
*/
|
|
4706
4610
|
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}.";
|
|
4707
|
-
/**
|
|
4708
|
-
* @uiName Payment hold on change alert header
|
|
4709
|
-
*/
|
|
4710
|
-
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
4711
|
-
/**
|
|
4712
|
-
* @uiName Payment hold on change alert description
|
|
4713
|
-
*/
|
|
4714
|
-
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
4715
|
-
/**
|
|
4716
|
-
* @uiName Beneficiary name invalid alert header
|
|
4717
|
-
*/
|
|
4718
|
-
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
4719
|
-
/**
|
|
4720
|
-
* @uiName Beneficiary name invalid description
|
|
4721
|
-
*/
|
|
4722
|
-
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.";
|
|
4723
|
-
/**
|
|
4724
|
-
* @uiName Beneficiary name mismatch alert header
|
|
4725
|
-
*/
|
|
4726
|
-
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4727
|
-
/**
|
|
4728
|
-
* @uiName Beneficiary name mismatch alert description
|
|
4729
|
-
*/
|
|
4730
|
-
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.";
|
|
4731
|
-
/**
|
|
4732
|
-
* @uiName Bank name mismatch alert header
|
|
4733
|
-
*/
|
|
4734
|
-
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4735
|
-
/**
|
|
4736
|
-
* @uiName Bank name mismatch alert description
|
|
4737
|
-
*/
|
|
4738
|
-
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.";
|
|
4739
|
-
/**
|
|
4740
|
-
* @uiName Withdrawal settings invalid alert header
|
|
4741
|
-
*/
|
|
4742
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
4743
|
-
/**
|
|
4744
|
-
* @uiName Withdrawal settings invalid alert description
|
|
4745
|
-
*/
|
|
4746
|
-
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.";
|
|
4747
|
-
/**
|
|
4748
|
-
* @uiName Payment returned alert header
|
|
4749
|
-
*/
|
|
4750
|
-
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
4751
|
-
/**
|
|
4752
|
-
* @uiName Payment returned alert description
|
|
4753
|
-
*/
|
|
4754
|
-
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
4755
4611
|
/**
|
|
4756
4612
|
* @uiName Terms and Conditions text
|
|
4757
4613
|
*/
|
|
@@ -6170,12 +6026,6 @@ const UserInfoFormView = (props) => {
|
|
|
6170
6026
|
default:
|
|
6171
6027
|
regionLabel = text.state;
|
|
6172
6028
|
}
|
|
6173
|
-
function isDisabledInput(field) {
|
|
6174
|
-
var _a;
|
|
6175
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6176
|
-
return true;
|
|
6177
|
-
return false;
|
|
6178
|
-
}
|
|
6179
6029
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
6180
6030
|
h("style", { type: "text/css" },
|
|
6181
6031
|
styleString$5,
|
|
@@ -6216,22 +6066,18 @@ const UserInfoFormView = (props) => {
|
|
|
6216
6066
|
})))),
|
|
6217
6067
|
h("div", null,
|
|
6218
6068
|
h("div", { class: classes.InputContainer },
|
|
6219
|
-
h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6220
|
-
states.isUser ||
|
|
6221
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6069
|
+
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) ? {
|
|
6222
6070
|
class: classes.ErrorInput,
|
|
6223
6071
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
6224
6072
|
}
|
|
6225
6073
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
6226
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6227
|
-
states.isUser ||
|
|
6228
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6074
|
+
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) ? {
|
|
6229
6075
|
class: classes.ErrorInput,
|
|
6230
6076
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
6231
6077
|
}
|
|
6232
6078
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
6233
6079
|
h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
6234
|
-
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 ||
|
|
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 || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
6235
6081
|
class: classes.ErrorInput,
|
|
6236
6082
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
6237
6083
|
}
|
|
@@ -6242,13 +6088,12 @@ const UserInfoFormView = (props) => {
|
|
|
6242
6088
|
}, "onSl-input": (e) => {
|
|
6243
6089
|
callbacks.setCountrySearch(e.target.value);
|
|
6244
6090
|
} }), (_e = data === null || data === void 0 ? void 0 : data.countries) === null || _e === void 0 ? void 0 :
|
|
6245
|
-
_e.map((c) => (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 :
|
|
6246
|
-
_f.map((c) => (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
|
|
6091
|
+
_e.map((c) => (h("sl-menu-item", { value: c.countryCode, exportparts: "base: menu-item-base" }, c.displayName))), (_f = data === null || data === void 0 ? void 0 : data.allCountries) === null || _f === void 0 ? void 0 :
|
|
6092
|
+
_f.map((c) => (h("sl-menu-item", { value: c.countryCode, style: { display: "none" }, exportparts: "base: menu-item-base" }, c.displayName)))),
|
|
6247
6093
|
h("div", { class: classes.PhoneInputsSection },
|
|
6248
6094
|
h("p", null, text.phoneNumber),
|
|
6249
6095
|
h("div", { class: classes.PhoneInputsContainer },
|
|
6250
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6251
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6096
|
+
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) ? {
|
|
6252
6097
|
class: classes.ErrorInput,
|
|
6253
6098
|
}
|
|
6254
6099
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -6274,7 +6119,7 @@ const UserInfoFormView = (props) => {
|
|
|
6274
6119
|
// Naive phone number validation
|
|
6275
6120
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
6276
6121
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
6277
|
-
}, disabled: states.disabled ||
|
|
6122
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
6278
6123
|
class: classes.ErrorInput,
|
|
6279
6124
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
6280
6125
|
}
|
|
@@ -6282,7 +6127,7 @@ const UserInfoFormView = (props) => {
|
|
|
6282
6127
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
6283
6128
|
// Checks for non-ASCII characters
|
|
6284
6129
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6285
|
-
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6130
|
+
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
6286
6131
|
class: classes.ErrorInput,
|
|
6287
6132
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
6288
6133
|
}
|
|
@@ -6290,22 +6135,22 @@ const UserInfoFormView = (props) => {
|
|
|
6290
6135
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
6291
6136
|
// Checks for non-ASCII characters
|
|
6292
6137
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6293
|
-
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6138
|
+
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
6294
6139
|
class: classes.ErrorInput,
|
|
6295
6140
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
6296
6141
|
}
|
|
6297
6142
|
: {}), { required: true })),
|
|
6298
|
-
!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 ||
|
|
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 || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
6299
6144
|
class: classes.ErrorInput,
|
|
6300
6145
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
6301
6146
|
}
|
|
6302
6147
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6303
|
-
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 ||
|
|
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 || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
6304
6149
|
class: classes.ErrorInput,
|
|
6305
6150
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
6306
6151
|
}
|
|
6307
6152
|
: {}), { required: true })),
|
|
6308
|
-
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 ||
|
|
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 || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
6309
6154
|
class: classes.ErrorInput,
|
|
6310
6155
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
6311
6156
|
}
|
|
@@ -6327,13 +6172,13 @@ const UserInfoFormView = (props) => {
|
|
|
6327
6172
|
h("div", { class: classes.CheckboxWrapper },
|
|
6328
6173
|
h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
6329
6174
|
e.target.value = e.target.checked;
|
|
6330
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6175
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6331
6176
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
6332
|
-
h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6177
|
+
h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6333
6178
|
};
|
|
6334
6179
|
|
|
6335
6180
|
function useUserInfoForm(props) {
|
|
6336
|
-
var _a, _b, _c, _d
|
|
6181
|
+
var _a, _b, _c, _d;
|
|
6337
6182
|
const currencyRef = useRef(undefined);
|
|
6338
6183
|
const phoneCountryRef = useRef(undefined);
|
|
6339
6184
|
const formRef = useRef(null);
|
|
@@ -6341,9 +6186,7 @@ function useUserInfoForm(props) {
|
|
|
6341
6186
|
const countries = Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
6342
6187
|
const [step, setStep] = Pn(TAX_CONTEXT_NAMESPACE);
|
|
6343
6188
|
const [userFormContext, setUserFormContext] = Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
6344
|
-
const
|
|
6345
|
-
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
6346
|
-
const { data, loading, refetch, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
6189
|
+
const { data, loading, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
6347
6190
|
const _currencies = Fn(CURRENCIES_NAMESPACE);
|
|
6348
6191
|
const currencies = useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
6349
6192
|
const [countrySearch, setCountrySearch] = useState("");
|
|
@@ -6445,45 +6288,6 @@ function useUserInfoForm(props) {
|
|
|
6445
6288
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
6446
6289
|
}
|
|
6447
6290
|
}, [currencySearch, currencies]);
|
|
6448
|
-
async function connectPartner(formData) {
|
|
6449
|
-
var _a, _b, _c, _d, _e;
|
|
6450
|
-
const vars = {
|
|
6451
|
-
user: {
|
|
6452
|
-
id: user.id,
|
|
6453
|
-
accountId: user.accountId,
|
|
6454
|
-
},
|
|
6455
|
-
firstName: formData.firstName,
|
|
6456
|
-
lastName: formData.lastName,
|
|
6457
|
-
countryCode: formData.countryCode,
|
|
6458
|
-
currency: formData.currency,
|
|
6459
|
-
address: formData.address,
|
|
6460
|
-
city: formData.city,
|
|
6461
|
-
state: formData.state,
|
|
6462
|
-
postalCode: formData.postalCode,
|
|
6463
|
-
phoneNumber: formData.phoneNumber,
|
|
6464
|
-
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
6465
|
-
};
|
|
6466
|
-
const result = await connectImpactPartner({
|
|
6467
|
-
vars,
|
|
6468
|
-
});
|
|
6469
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
6470
|
-
throw new Error();
|
|
6471
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
6472
|
-
// Output backend errors to console for now
|
|
6473
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
6474
|
-
throw new Error();
|
|
6475
|
-
}
|
|
6476
|
-
await refetch();
|
|
6477
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
6478
|
-
.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;
|
|
6479
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
6480
|
-
// Fire form change event
|
|
6481
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
6482
|
-
return {
|
|
6483
|
-
resultPublisher,
|
|
6484
|
-
hasValidCurrentDocument,
|
|
6485
|
-
};
|
|
6486
|
-
}
|
|
6487
6291
|
async function onSubmit(event) {
|
|
6488
6292
|
let formControls = event.target.getFormControls();
|
|
6489
6293
|
let formData = {};
|
|
@@ -6526,41 +6330,9 @@ function useUserInfoForm(props) {
|
|
|
6526
6330
|
postalCode: userData.postalCode,
|
|
6527
6331
|
currency: userData.currency,
|
|
6528
6332
|
});
|
|
6529
|
-
const
|
|
6530
|
-
console.log({ skipNextStep });
|
|
6531
|
-
if (skipNextStep) {
|
|
6532
|
-
try {
|
|
6533
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
6534
|
-
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
6535
|
-
!hasValidCurrentDocument) {
|
|
6536
|
-
// Go to docusign form
|
|
6537
|
-
setStep("/3");
|
|
6538
|
-
}
|
|
6539
|
-
else {
|
|
6540
|
-
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
6541
|
-
// Go to banking information form
|
|
6542
|
-
setStep("/4");
|
|
6543
|
-
}
|
|
6544
|
-
else {
|
|
6545
|
-
// Go right to the dashboard
|
|
6546
|
-
setStep("/dashboard");
|
|
6547
|
-
}
|
|
6548
|
-
}
|
|
6549
|
-
return;
|
|
6550
|
-
}
|
|
6551
|
-
catch (e) {
|
|
6552
|
-
setErrors({ general: true });
|
|
6553
|
-
return;
|
|
6554
|
-
}
|
|
6555
|
-
}
|
|
6556
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
6333
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
6557
6334
|
setStep(nextStep);
|
|
6558
6335
|
}
|
|
6559
|
-
function getSkipNextStep(userData) {
|
|
6560
|
-
if (userData.countryCode === "US")
|
|
6561
|
-
return true;
|
|
6562
|
-
return true;
|
|
6563
|
-
}
|
|
6564
6336
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
6565
6337
|
const regionObj = hasStates
|
|
6566
6338
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -6588,17 +6360,16 @@ function useUserInfoForm(props) {
|
|
|
6588
6360
|
allCountries: countries,
|
|
6589
6361
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
6590
6362
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
6591
|
-
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,
|
|
6592
6363
|
},
|
|
6593
6364
|
states: {
|
|
6594
6365
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
6595
6366
|
hideState: !hasStates,
|
|
6596
6367
|
hideSteps: !!context.hideSteps,
|
|
6597
|
-
disabled: loading
|
|
6368
|
+
disabled: loading,
|
|
6598
6369
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6599
|
-
loading: loading
|
|
6600
|
-
isPartner: !!((
|
|
6601
|
-
isUser: !!((
|
|
6370
|
+
loading: loading,
|
|
6371
|
+
isPartner: !!((_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),
|
|
6372
|
+
isUser: !!((_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.user),
|
|
6602
6373
|
formState: {
|
|
6603
6374
|
...userFormContext,
|
|
6604
6375
|
errors: formErrors,
|