@saasquatch/mint-components 2.1.8-15 → 2.1.8-17

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.
@@ -4454,23 +4454,17 @@ const SHARE_LINK_EDIT_COUNT = index_module.dist.gql `
4454
4454
  }
4455
4455
  }
4456
4456
  `;
4457
- function parseDomainPrefix(url) {
4457
+ function parseShareUrl(url) {
4458
4458
  try {
4459
4459
  const parsed = new URL(url);
4460
- return parsed.origin + "/";
4461
- }
4462
- catch {
4463
- return url;
4464
- }
4465
- }
4466
- function parsePathSuffix(url) {
4467
- try {
4468
- const parsed = new URL(url);
4469
- // Remove leading slash and strip query params/hash
4470
- return parsed.pathname.slice(1);
4460
+ return {
4461
+ url: parsed.origin + parsed.pathname,
4462
+ domain: parsed.origin + "/",
4463
+ path: parsed.pathname.slice(1),
4464
+ };
4471
4465
  }
4472
4466
  catch {
4473
- return "";
4467
+ return { url, domain: url, path: "" };
4474
4468
  }
4475
4469
  }
4476
4470
  function useShareLink(props) {
@@ -4487,16 +4481,15 @@ function useShareLink(props) {
4487
4481
  const { refresh } = index_module.Qe();
4488
4482
  const { data: linkDomainData } = index_module.wn(GET_LINK_DOMAIN, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
4489
4483
  const { data: editCountData, refetch: refetchEditCount } = index_module.wn(SHARE_LINK_EDIT_COUNT, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
4490
- const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4484
+ const { url: copyString, domain: domainPrefix, path: pathSuffix, } = parseShareUrl((_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4491
4485
  // Shown during loading
4492
- "...";
4486
+ "...");
4493
4487
  const [open, setOpen] = domContextHooks_module.useState(false);
4494
4488
  const [isEditing, setIsEditing] = domContextHooks_module.useState(false);
4495
4489
  const [editValue, setEditValue] = domContextHooks_module.useState("");
4496
4490
  const [validationError, setValidationError] = domContextHooks_module.useState(null);
4497
4491
  const [isValidating, setIsValidating] = domContextHooks_module.useState(false);
4498
4492
  const debounceTimerRef = domContextHooks_module.useRef(undefined);
4499
- const domainPrefix = parseDomainPrefix(copyString);
4500
4493
  const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
4501
4494
  const customizeDisabled = !hasPrimaryLinkDomain;
4502
4495
  const vanityCount = (_g = (_f = (_e = (_d = editCountData === null || editCountData === void 0 ? void 0 : editCountData.viewer) === null || _d === void 0 ? void 0 : _d.shareLinkCodes) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.filter((code) => code.isVanity).length) !== null && _g !== void 0 ? _g : 0;
@@ -4552,7 +4545,7 @@ function useShareLink(props) {
4552
4545
  if (limitReached || customizeDisabled)
4553
4546
  return;
4554
4547
  setIsEditing(true);
4555
- setEditValue(editCount === 0 ? "" : parsePathSuffix(copyString));
4548
+ setEditValue(editCount === 0 ? "" : pathSuffix);
4556
4549
  setValidationError(null);
4557
4550
  }
4558
4551
  function onEditValueChange(value) {
@@ -27,7 +27,7 @@ const useInstantAccessRegistration = require('./useInstantAccessRegistration-239
27
27
  const useLeadFormState = require('./useLeadFormState-b4c2ab5b.js');
28
28
  const utilities = require('./utilities-fcdb9504.js');
29
29
  const ErrorView = require('./ErrorView-ee7b0f36.js');
30
- const ShadowViewAddon = require('./ShadowViewAddon-28ad7150.js');
30
+ const ShadowViewAddon = require('./ShadowViewAddon-9b8a1a85.js');
31
31
  require('./sqm-portal-container-view-70a47420.js');
32
32
  const data = require('./data-8c8a08f6.js');
33
33
  const extractProps = require('./extractProps-e9c55ba8.js');
@@ -33,7 +33,7 @@ require('./utilities-fcdb9504.js');
33
33
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-6b1acd90.js');
34
34
  require('./ErrorView-ee7b0f36.js');
35
35
  const sqmQrCodeView = require('./sqm-qr-code-view-1f2daa76.js');
36
- const ShadowViewAddon = require('./ShadowViewAddon-28ad7150.js');
36
+ const ShadowViewAddon = require('./ShadowViewAddon-9b8a1a85.js');
37
37
  const sqmPortalContainerView = require('./sqm-portal-container-view-70a47420.js');
38
38
  const sqmUserInfoFormView = require('./sqm-user-info-form-view-53306f6e.js');
39
39
  const data = require('./data-8c8a08f6.js');
@@ -63,23 +63,17 @@ const SHARE_LINK_EDIT_COUNT = gql `
63
63
  }
64
64
  }
65
65
  `;
66
- function parseDomainPrefix(url) {
66
+ function parseShareUrl(url) {
67
67
  try {
68
68
  const parsed = new URL(url);
69
- return parsed.origin + "/";
70
- }
71
- catch {
72
- return url;
73
- }
74
- }
75
- function parsePathSuffix(url) {
76
- try {
77
- const parsed = new URL(url);
78
- // Remove leading slash and strip query params/hash
79
- return parsed.pathname.slice(1);
69
+ return {
70
+ url: parsed.origin + parsed.pathname,
71
+ domain: parsed.origin + "/",
72
+ path: parsed.pathname.slice(1),
73
+ };
80
74
  }
81
75
  catch {
82
- return "";
76
+ return { url, domain: url, path: "" };
83
77
  }
84
78
  }
85
79
  export function useShareLink(props) {
@@ -96,16 +90,15 @@ export function useShareLink(props) {
96
90
  const { refresh } = useRefreshDispatcher();
97
91
  const { data: linkDomainData } = useQuery(GET_LINK_DOMAIN, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
98
92
  const { data: editCountData, refetch: refetchEditCount } = useQuery(SHARE_LINK_EDIT_COUNT, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
99
- const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
93
+ const { url: copyString, domain: domainPrefix, path: pathSuffix, } = parseShareUrl((_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
100
94
  // Shown during loading
101
- "...";
95
+ "...");
102
96
  const [open, setOpen] = useState(false);
103
97
  const [isEditing, setIsEditing] = useState(false);
104
98
  const [editValue, setEditValue] = useState("");
105
99
  const [validationError, setValidationError] = useState(null);
106
100
  const [isValidating, setIsValidating] = useState(false);
107
101
  const debounceTimerRef = useRef(undefined);
108
- const domainPrefix = parseDomainPrefix(copyString);
109
102
  const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
110
103
  const customizeDisabled = !hasPrimaryLinkDomain;
111
104
  const vanityCount = (_g = (_f = (_e = (_d = editCountData === null || editCountData === void 0 ? void 0 : editCountData.viewer) === null || _d === void 0 ? void 0 : _d.shareLinkCodes) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.filter((code) => code.isVanity).length) !== null && _g !== void 0 ? _g : 0;
@@ -161,7 +154,7 @@ export function useShareLink(props) {
161
154
  if (limitReached || customizeDisabled)
162
155
  return;
163
156
  setIsEditing(true);
164
- setEditValue(editCount === 0 ? "" : parsePathSuffix(copyString));
157
+ setEditValue(editCount === 0 ? "" : pathSuffix);
165
158
  setValidationError(null);
166
159
  }
167
160
  function onEditValueChange(value) {
@@ -4452,23 +4452,17 @@ const SHARE_LINK_EDIT_COUNT = dist.gql `
4452
4452
  }
4453
4453
  }
4454
4454
  `;
4455
- function parseDomainPrefix(url) {
4455
+ function parseShareUrl(url) {
4456
4456
  try {
4457
4457
  const parsed = new URL(url);
4458
- return parsed.origin + "/";
4459
- }
4460
- catch {
4461
- return url;
4462
- }
4463
- }
4464
- function parsePathSuffix(url) {
4465
- try {
4466
- const parsed = new URL(url);
4467
- // Remove leading slash and strip query params/hash
4468
- return parsed.pathname.slice(1);
4458
+ return {
4459
+ url: parsed.origin + parsed.pathname,
4460
+ domain: parsed.origin + "/",
4461
+ path: parsed.pathname.slice(1),
4462
+ };
4469
4463
  }
4470
4464
  catch {
4471
- return "";
4465
+ return { url, domain: url, path: "" };
4472
4466
  }
4473
4467
  }
4474
4468
  function useShareLink(props) {
@@ -4485,16 +4479,15 @@ function useShareLink(props) {
4485
4479
  const { refresh } = Qe();
4486
4480
  const { data: linkDomainData } = wn(GET_LINK_DOMAIN, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
4487
4481
  const { data: editCountData, refetch: refetchEditCount } = wn(SHARE_LINK_EDIT_COUNT, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.customizeUrl);
4488
- const copyString = (_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4482
+ const { url: copyString, domain: domainPrefix, path: pathSuffix, } = parseShareUrl((_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
4489
4483
  // Shown during loading
4490
- "...";
4484
+ "...");
4491
4485
  const [open, setOpen] = useState(false);
4492
4486
  const [isEditing, setIsEditing] = useState(false);
4493
4487
  const [editValue, setEditValue] = useState("");
4494
4488
  const [validationError, setValidationError] = useState(null);
4495
4489
  const [isValidating, setIsValidating] = useState(false);
4496
4490
  const debounceTimerRef = useRef(undefined);
4497
- const domainPrefix = parseDomainPrefix(copyString);
4498
4491
  const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
4499
4492
  const customizeDisabled = !hasPrimaryLinkDomain;
4500
4493
  const vanityCount = (_g = (_f = (_e = (_d = editCountData === null || editCountData === void 0 ? void 0 : editCountData.viewer) === null || _d === void 0 ? void 0 : _d.shareLinkCodes) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.filter((code) => code.isVanity).length) !== null && _g !== void 0 ? _g : 0;
@@ -4550,7 +4543,7 @@ function useShareLink(props) {
4550
4543
  if (limitReached || customizeDisabled)
4551
4544
  return;
4552
4545
  setIsEditing(true);
4553
- setEditValue(editCount === 0 ? "" : parsePathSuffix(copyString));
4546
+ setEditValue(editCount === 0 ? "" : pathSuffix);
4554
4547
  setValidationError(null);
4555
4548
  }
4556
4549
  function onEditValueChange(value) {
@@ -23,7 +23,7 @@ import { u as useInstantAccessRegistration } from './useInstantAccessRegistratio
23
23
  import { R as RequiredPropsError, L as LEAD_FORM_STATE_CONTEXT, u as useLeadFormState } from './useLeadFormState-dd4e8b08.js';
24
24
  import { i as isEmpty } from './utilities-77b1e0cc.js';
25
25
  import { E as ErrorView } from './ErrorView-74cb3af8.js';
26
- import { u as useDemoBigStat, W as useBigStat, B as BigStatView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, U as LeadDropdownFieldView, Q as LeadFormView, X as withShadowView, L as LeaderboardView, N as NameFieldsView, f as ChangeMarktingView, P as PortalChangePasswordView, g as PortalFooterView, h as PortalFrameView, c as BaseRegistrationFormView, R as ReferralIframeView, i as RewardExchangeView, Y as demoRewardExchange, G as useShareButton, a as ShareButtonView, K as useShareLink, J as ShareLinkView, S as StatContainerView, T as TaskCardView } from './ShadowViewAddon-25647ca5.js';
26
+ import { u as useDemoBigStat, W as useBigStat, B as BigStatView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, U as LeadDropdownFieldView, Q as LeadFormView, X as withShadowView, L as LeaderboardView, N as NameFieldsView, f as ChangeMarktingView, P as PortalChangePasswordView, g as PortalFooterView, h as PortalFrameView, c as BaseRegistrationFormView, R as ReferralIframeView, i as RewardExchangeView, Y as demoRewardExchange, G as useShareButton, a as ShareButtonView, K as useShareLink, J as ShareLinkView, S as StatContainerView, T as TaskCardView } from './ShadowViewAddon-00b8bb80.js';
27
27
  import './sqm-portal-container-view-a8c708cd.js';
28
28
  import { T as TAX_CONTEXT_NAMESPACE, a as TAX_FORM_CONTEXT_NAMESPACE, U as USER_FORM_CONTEXT_NAMESPACE, C as CURRENCIES_NAMESPACE, b as COUNTRIES_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, g as getCountryObj, c as USER_QUERY_NAMESPACE, G as GET_USER$2, d as COUNTRIES_QUERY_NAMESPACE, e as GET_COUNTRIES, h as FINANCE_NETWORK_SETTINGS_NAMESPACE, i as GET_FINANCE_NETWORK_SETTINGS, j as CURRENCIES_QUERY_NAMESPACE, k as GET_CURRENCIES, L as LoadingView } from './data-12e6aae1.js';
29
29
  import { p as parseStates, e as extractProps } from './extractProps-54064fb0.js';
@@ -29,7 +29,7 @@ import './utilities-77b1e0cc.js';
29
29
  import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-cfbc0eb0.js';
30
30
  import './ErrorView-74cb3af8.js';
31
31
  import { Q as QrCodeView } from './sqm-qr-code-view-ce476721.js';
32
- import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, c as BaseRegistrationFormView, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as ShareLinkView, K as useShareLink, M as ProgressBarView, O as ProgressBar$2, Q as LeadFormView, U as LeadDropdownFieldView, V as ShadowViewAddon } from './ShadowViewAddon-25647ca5.js';
32
+ import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, c as BaseRegistrationFormView, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as ShareLinkView, K as useShareLink, M as ProgressBarView, O as ProgressBar$2, Q as LeadFormView, U as LeadDropdownFieldView, V as ShadowViewAddon } from './ShadowViewAddon-00b8bb80.js';
33
33
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-a8c708cd.js';
34
34
  import { I as InvoiceTableView, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, U as UserInfoFormView$1 } from './sqm-user-info-form-view-19d81a2b.js';
35
35
  import { t as taxTypeToName, L as LoadingView } from './data-12e6aae1.js';