@pelcro/react-pelcro-js 3.22.0-beta.18 → 3.22.0-beta.19

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/index.cjs.js CHANGED
@@ -3945,6 +3945,9 @@ var labels$Y = {
3945
3945
  },
3946
3946
  subCancellation: {
3947
3947
  goBack: "Go back"
3948
+ },
3949
+ donationCancellation: {
3950
+ goBack: "Go back"
3948
3951
  }
3949
3952
  };
3950
3953
  var messages$_ = {
@@ -3964,6 +3967,22 @@ var messages$_ = {
3964
3967
  loading: "Unsuspending your subscription",
3965
3968
  success: "Subscription is successfully unsuspended",
3966
3969
  error: "Error while unsuspending your subscription"
3970
+ },
3971
+ donationCancellation: {
3972
+ isSureToCancel: "Are you sure you want to cancel your donation?",
3973
+ loading: "Cancelling your donation",
3974
+ success: "Donation is successfully cancelled",
3975
+ error: "Error while cancelling your donation"
3976
+ },
3977
+ donationReactivation: {
3978
+ success: "Donation is successfully reactivated",
3979
+ error: "Error while reactivating your donation"
3980
+ },
3981
+ donationUnSuspend: {
3982
+ isSureToUnSuspend: "Are you sure you want to unsuspend your donation?",
3983
+ loading: "Unsuspending your donation",
3984
+ success: "Donation is successfully unsuspended",
3985
+ error: "Error while unsuspending your donation"
3967
3986
  }
3968
3987
  };
3969
3988
  var dashboard_en = {
@@ -4923,6 +4942,9 @@ var labels$C = {
4923
4942
  },
4924
4943
  subCancellation: {
4925
4944
  goBack: "Retourner"
4945
+ },
4946
+ donationCancellation: {
4947
+ goBack: "Go back"
4926
4948
  }
4927
4949
  };
4928
4950
  var messages$F = {
@@ -4942,6 +4964,22 @@ var messages$F = {
4942
4964
  loading: "Annulation de la suspension de votre abonnement",
4943
4965
  success: "L'abonnement a été suspendu avec succès",
4944
4966
  error: "Erreur lors de l'annulation de la suspension de votre abonnement"
4967
+ },
4968
+ donationCancellation: {
4969
+ isSureToCancel: "Êtes-vous certain de vouloir annuler votre don?",
4970
+ loading: "Annulation de l'don",
4971
+ success: "L'don a été annulé avec succès",
4972
+ error: "Une erreur s'est produite lors de l'annulation de l'don"
4973
+ },
4974
+ donationReactivation: {
4975
+ success: "L'don a été réactivé avec succès",
4976
+ error: "Erreur lors de la réactivation de votre don"
4977
+ },
4978
+ donationUnSuspend: {
4979
+ isSureToUnSuspend: "Êtes-vous sûr de vouloir annuler la suspension de votre don ?",
4980
+ loading: "Annulation de la suspension de votre don",
4981
+ success: "L'don a été suspendu avec succès",
4982
+ error: "Erreur lors de l'annulation de la suspension de votre don"
4945
4983
  }
4946
4984
  };
4947
4985
  var dashboard_fr = {
@@ -5846,6 +5884,9 @@ var savedItems = {
5846
5884
  var subCancellation = {
5847
5885
  goBack: "뒤로 가기"
5848
5886
  };
5887
+ var donationCancellation = {
5888
+ goBack: "뒤로 가기"
5889
+ };
5849
5890
  var messages$n = {
5850
5891
  noCard: "등록된 카드가 없습니다.",
5851
5892
  subCancellation: {
@@ -5863,6 +5904,22 @@ var messages$n = {
5863
5904
  loading: "구독 일시 중단 해제",
5864
5905
  success: "구독이 성공적으로 일시 중단 해제되었습니다",
5865
5906
  error: "구독 일시 중단을 해제하는 동안 오류가 발생했습니다."
5907
+ },
5908
+ donationCancellation: {
5909
+ isSureToCancel: "정말로 유료 멤버십을 취소하시겠습니까?",
5910
+ loading: "귀하의 유료 멤버십을 취소합니다.",
5911
+ success: "유료 멤버십이 성공적으로 취소되었습니다.",
5912
+ error: "유료 멤버십 취소 과정에서 오류가 발생했습니다."
5913
+ },
5914
+ donationReactivation: {
5915
+ success: "구독이 성공적으로 재활성화되었습니다.",
5916
+ error: "구독을 재활성화하는 동안 오류가 발생했습니다."
5917
+ },
5918
+ donationUnSuspend: {
5919
+ isSureToUnSuspend: "구독 일시 중단을 해제하시겠습니까?",
5920
+ loading: "구독 일시 중단 해제",
5921
+ success: "구독이 성공적으로 일시 중단 해제되었습니다",
5922
+ error: "구독 일시 중단을 해제하는 동안 오류가 발생했습니다."
5866
5923
  }
5867
5924
  };
5868
5925
  var dashboard_ko = {
@@ -5915,6 +5972,7 @@ var dashboard_ko = {
5915
5972
  orders: orders,
5916
5973
  savedItems: savedItems,
5917
5974
  subCancellation: subCancellation,
5975
+ donationCancellation: donationCancellation,
5918
5976
  messages: messages$n
5919
5977
  };
5920
5978
 
@@ -6746,6 +6804,9 @@ var labels$6 = {
6746
6804
  },
6747
6805
  subCancellation: {
6748
6806
  goBack: "Volver"
6807
+ },
6808
+ donationCancellation: {
6809
+ goBack: "Go back"
6749
6810
  }
6750
6811
  };
6751
6812
  var messages$5 = {
@@ -6765,6 +6826,22 @@ var messages$5 = {
6765
6826
  loading: "Reanudando tu suscripción",
6766
6827
  success: "La suscripción se reanudó con éxito",
6767
6828
  error: "Error al reanudar tu suscripción"
6829
+ },
6830
+ donationCancellation: {
6831
+ isSureToCancel: "¿Estás seguro de que quieres cancelar tu donación?",
6832
+ loading: "Cancelando tu donación",
6833
+ success: "La donación se canceló con éxito",
6834
+ error: "Error al cancelar tu donación"
6835
+ },
6836
+ donationReactivation: {
6837
+ success: "La donación se reactivó con éxito",
6838
+ error: "Error al reactivar su donación"
6839
+ },
6840
+ donationUnSuspend: {
6841
+ isSureToUnSuspend: "¿Estás seguro de que quieres reanudar tu donación?",
6842
+ loading: "Reanudando tu donación",
6843
+ success: "La donación se reanudó con éxito",
6844
+ error: "Error al reanudar tu donación"
6768
6845
  }
6769
6846
  };
6770
6847
  var dashboard_es = {
@@ -10574,7 +10651,7 @@ toast.confirm = function (onConfirm, _ref3) {
10574
10651
  ...options
10575
10652
  });
10576
10653
  setTimeout(() => {
10577
- notify$1.dismiss(id);
10654
+ notify.dismiss(id);
10578
10655
  }, 3000);
10579
10656
  };
10580
10657
  const onFailure = errorValue => {
@@ -10583,11 +10660,11 @@ toast.confirm = function (onConfirm, _ref3) {
10583
10660
  ...options
10584
10661
  });
10585
10662
  setTimeout(() => {
10586
- notify$1.dismiss(id);
10663
+ notify.dismiss(id);
10587
10664
  }, 3000);
10588
10665
  };
10589
10666
  };
10590
- const notify$1 = toast;
10667
+ const notify = toast;
10591
10668
 
10592
10669
  const translations = i18next.t("common:buttons", {
10593
10670
  returnObjects: true
@@ -10648,7 +10725,7 @@ const init$1 = () => {
10648
10725
  const errorMessage = i18next.t("messages:invalidSubscription", {
10649
10726
  returnObjects: true
10650
10727
  });
10651
- return notify$1.error(errorMessage);
10728
+ return notify.error(errorMessage);
10652
10729
  }
10653
10730
  switchView("manage-members");
10654
10731
  });
@@ -10656,7 +10733,7 @@ const init$1 = () => {
10656
10733
  const errorMessage = i18next.t("messages:invalidSubscription", {
10657
10734
  returnObjects: true
10658
10735
  });
10659
- return notify$1.error(errorMessage);
10736
+ return notify.error(errorMessage);
10660
10737
  }
10661
10738
  }
10662
10739
  }
@@ -10844,7 +10921,7 @@ const init$1 = () => {
10844
10921
  const errorMsg = i18next.t("shop:messages.currencyMismatch", {
10845
10922
  currency: userCurrency
10846
10923
  });
10847
- notify$1.error(errorMsg);
10924
+ notify.error(errorMsg);
10848
10925
  }
10849
10926
  });
10850
10927
  }
@@ -10937,7 +11014,7 @@ const init = () => {
10937
11014
  unblurElemWhenUserLogsIn(elemDeepClone, entitlements);
10938
11015
  unblurElemWhenUserLogsOut(elemDeepClone, entitlements);
10939
11016
  const NOTIFICATION_ID = "entitlement";
10940
- notify$1( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
11017
+ notify( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
10941
11018
  i18nKey: "messages:entitlement"
10942
11019
  }, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default['default'].createElement(Link, {
10943
11020
  onClick: () => {
@@ -10952,7 +11029,7 @@ const init = () => {
10952
11029
  plan: selectedPlan
10953
11030
  });
10954
11031
  }
10955
- notify$1.dismiss(NOTIFICATION_ID);
11032
+ notify.dismiss(NOTIFICATION_ID);
10956
11033
  switchView("_plan-select-entitlements");
10957
11034
  }
10958
11035
  }, "Subscribe"), "now to get full page access.")), {
@@ -11559,9 +11636,9 @@ const verifyEmailTokenFromUrl = () => {
11559
11636
  token: emailToken
11560
11637
  }, (err, res) => {
11561
11638
  if (err) {
11562
- return notify$1.error(getErrorMessages(err));
11639
+ return notify.error(getErrorMessages(err));
11563
11640
  }
11564
- return notify$1.success(translations.success);
11641
+ return notify.success(translations.success);
11565
11642
  });
11566
11643
  }, {
11567
11644
  once: true
@@ -11585,7 +11662,7 @@ const verifyLinkTokenFromUrl = () => {
11585
11662
  token: loginToken
11586
11663
  }, (err, res) => {
11587
11664
  if (err) {
11588
- return notify$1.error(getErrorMessages(err));
11665
+ return notify.error(getErrorMessages(err));
11589
11666
  }
11590
11667
  const {
11591
11668
  auth_token
@@ -11594,10 +11671,10 @@ const verifyLinkTokenFromUrl = () => {
11594
11671
  auth_token
11595
11672
  }, (err, res) => {
11596
11673
  if (err) {
11597
- return notify$1.error(getErrorMessages(err));
11674
+ return notify.error(getErrorMessages(err));
11598
11675
  }
11599
11676
  resetView();
11600
- return notify$1.success(translations.success);
11677
+ return notify.success(translations.success);
11601
11678
  });
11602
11679
  });
11603
11680
  }, {
@@ -11672,7 +11749,7 @@ const showInvoiceDetailsFromUrl = () => {
11672
11749
  const errorMessage = i18next.t("messages:invalidInvoice", {
11673
11750
  returnObjects: true
11674
11751
  });
11675
- return notify$1.error(errorMessage);
11752
+ return notify.error(errorMessage);
11676
11753
  }
11677
11754
  const {
11678
11755
  invoice
@@ -11681,7 +11758,7 @@ const showInvoiceDetailsFromUrl = () => {
11681
11758
  const errorMessage = i18next.t("messages:zeroTotalInvoice", {
11682
11759
  returnObjects: true
11683
11760
  });
11684
- return notify$1.error(errorMessage);
11761
+ return notify.error(errorMessage);
11685
11762
  }
11686
11763
  return switchView("invoice-details");
11687
11764
  });
@@ -11706,7 +11783,7 @@ const showSubscriptionManageMembersFromUrl = () => {
11706
11783
  const errorMessage = i18next.t("messages:invalidSubscription", {
11707
11784
  returnObjects: true
11708
11785
  });
11709
- return notify$1.error(errorMessage);
11786
+ return notify.error(errorMessage);
11710
11787
  }
11711
11788
  return switchView("manage-members");
11712
11789
  });
@@ -14816,7 +14893,7 @@ class DonationModal extends React.Component {
14816
14893
  className: "plc-bg-gray-100 plc-rounded-md plc-p-3 plc-mt-3 plc-text-sm plc-flex plc-items-center"
14817
14894
  }, /*#__PURE__*/React__default['default'].createElement("div", {
14818
14895
  className: "plc-flex plc-items-center plc-flex-1"
14819
- }, "Auto renewed:", " ", /*#__PURE__*/React__default['default'].createElement("span", {
14896
+ }, "Auto renew:", " ", /*#__PURE__*/React__default['default'].createElement("span", {
14820
14897
  className: "plc-inline-flex plc-w-6 plc-ml-1"
14821
14898
  }, plan.auto_renew ? /*#__PURE__*/React__default['default'].createElement(SvgCheck, {
14822
14899
  className: "plc-text-green-500"
@@ -14835,7 +14912,7 @@ class DonationModal extends React.Component {
14835
14912
  }, plan.preset_donation_values.map(value => /*#__PURE__*/React__default['default'].createElement("li", {
14836
14913
  key: value
14837
14914
  }, /*#__PURE__*/React__default['default'].createElement("button", {
14838
- className: `plc-bg-white plc-rounded-md plc-flex plc-items-center plc-justify-center plc-text-lg plc-w-full plc-min-h-20 focus:plc-outline-none ${isChecked && +this.state.selectedDonationAmount === +value ? "plc-border-primary-500 plc-text-primary-900 plc-border-2" : "plc-border-gray-200 plc-text-gray-900 plc-border"}`,
14915
+ className: `plc-bg-white plc-rounded-md plc-flex plc-items-center plc-justify-center plc-text-lg plc-w-full plc-min-h-16 focus:plc-outline-none ${isChecked && +this.state.selectedDonationAmount === +value ? "plc-border-primary-500 plc-text-primary-900 plc-border-2" : "plc-border-gray-200 plc-text-gray-900 plc-border"}`,
14839
14916
  onClick: () => {
14840
14917
  this.setState({
14841
14918
  selectedDonationAmount: +value,
@@ -14843,7 +14920,11 @@ class DonationModal extends React.Component {
14843
14920
  disabled: false
14844
14921
  });
14845
14922
  }
14846
- }, getFormattedPriceByLocal(value, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()))))), /*#__PURE__*/React__default['default'].createElement("div", {
14923
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
14924
+ className: "plc-font-bold plc-mr-1"
14925
+ }, value), /*#__PURE__*/React__default['default'].createElement("span", {
14926
+ className: "plc-uppercase"
14927
+ }, plan === null || plan === void 0 ? void 0 : plan.currency))))), /*#__PURE__*/React__default['default'].createElement("div", {
14847
14928
  className: "plc-relative plc-py-3 plc-mt-3"
14848
14929
  }, /*#__PURE__*/React__default['default'].createElement("hr", null), " ", /*#__PURE__*/React__default['default'].createElement("span", {
14849
14930
  className: "plc-absolute plc-top-1/2 plc-left-1/2 plc-transform plc--translate-x-1/2 plc--translate-y-1/2 plc-leading-none plc-bg-white plc-px-2"
@@ -14868,8 +14949,9 @@ class DonationModal extends React.Component {
14868
14949
  });
14869
14950
  }
14870
14951
  },
14871
- placeholder: "Donate a custome amount ...",
14872
- className: "plc-pr-14"
14952
+ placeholder: "Donate a custom amount ...",
14953
+ className: "plc-pr-14",
14954
+ wrapperClassName: "plc-mb-0"
14873
14955
  }), /*#__PURE__*/React__default['default'].createElement("span", {
14874
14956
  className: "plc-absolute plc-top-1/2 plc-transform plc--translate-y-1/2 plc-right-3 plc-pl-3 plc-border-l plc-border-gray-200 plc-uppercase plc-text-sm"
14875
14957
  }, plan.currency)));
@@ -15019,7 +15101,7 @@ class DonationModal extends React.Component {
15019
15101
  }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
15020
15102
  className: "pelcro-select-products-wrapper"
15021
15103
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
15022
- className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
15104
+ className: "plc-overflow-y-scroll pelcro-select-plans-wrapper"
15023
15105
  }, this.renderPlans()), !window.Pelcro.user.isAuthenticated() && (_this$state$product = this.state.product) !== null && _this$state$product !== void 0 && _this$state$product.address_required ? /*#__PURE__*/React__default['default'].createElement(Button, {
15024
15106
  disabled: this.state.disabled,
15025
15107
  onClick: () => this.submitOption(true),
@@ -18968,13 +19050,15 @@ const DiscountedPrice = props => {
18968
19050
  };
18969
19051
 
18970
19052
  const SubmitPaymentMethod = _ref => {
18971
- var _plan$quantity, _window$Pelcro$site$r;
19053
+ var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
18972
19054
  let {
18973
19055
  onClick,
18974
19056
  ...otherProps
18975
19057
  } = _ref;
18976
19058
  const {
18977
- plan
19059
+ plan,
19060
+ selectedDonationAmount,
19061
+ customDonationAmount
18978
19062
  } = usePelcro();
18979
19063
  const {
18980
19064
  t
@@ -18996,7 +19080,13 @@ const SubmitPaymentMethod = _ref => {
18996
19080
  } = React.useContext(store$k);
18997
19081
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
18998
19082
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
18999
- const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
19083
+ // const priceFormatted = getFormattedPriceByLocal(
19084
+ // price * planQuantity,
19085
+ // plan?.currency,
19086
+ // getPageOrDefaultLanguage()
19087
+ // );
19088
+
19089
+ const priceFormatted = plan.type === "donation" && (selectedDonationAmount || customDonationAmount) ? getFormattedPriceByLocal(selectedDonationAmount ? selectedDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity2 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity2 !== void 0 ? _plan$quantity2 : 1) : customDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity3 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity3 !== void 0 ? _plan$quantity3 : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()) : getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
19000
19090
  const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
19001
19091
  const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
19002
19092
  const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
@@ -20046,7 +20136,7 @@ const SubscriptionCancelNowButton = _ref => {
20046
20136
  switchView(null);
20047
20137
 
20048
20138
  //Show confirmation alert after closing the modal
20049
- notify$1.confirm((onSuccess, onFailure) => {
20139
+ notify.confirm((onSuccess, onFailure) => {
20050
20140
  cancelSubscription(payload, onSuccess, onFailure);
20051
20141
  }, {
20052
20142
  confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
@@ -20116,7 +20206,7 @@ const SubscriptionCancelLaterButton = _ref => {
20116
20206
  switchView(null);
20117
20207
 
20118
20208
  //Show confirmation alert after closing the modal
20119
- notify$1.confirm((onSuccess, onFailure) => {
20209
+ notify.confirm((onSuccess, onFailure) => {
20120
20210
  cancelSubscription(payload, onSuccess, onFailure);
20121
20211
  }, {
20122
20212
  confirmMessage: t("messages.subCancellation.isSureToCancel"),
@@ -20351,7 +20441,7 @@ const SubscriptionSuspendButton = _ref => {
20351
20441
  switchView(null);
20352
20442
 
20353
20443
  //Show confirmation alert after closing the modal
20354
- notify$1.confirm((onSuccess, onFailure) => {
20444
+ notify.confirm((onSuccess, onFailure) => {
20355
20445
  suspendSubscription(payload, onSuccess, onFailure);
20356
20446
  }, {
20357
20447
  confirmMessage: t("messages.subCancellation.isSureToSuspendNow"),
@@ -22411,7 +22501,7 @@ const AddressCreateContainer = _ref => {
22411
22501
  });
22412
22502
  return onFailure(err);
22413
22503
  }
22414
- notify$1.success(t("messages.addressUpdated"));
22504
+ notify.success(t("messages.addressUpdated"));
22415
22505
  return onMembershipAdressUpdateSuccess(res);
22416
22506
  });
22417
22507
  }
@@ -25922,7 +26012,7 @@ const AddressSelectContainer = _ref => {
25922
26012
  });
25923
26013
  return onFailure(err);
25924
26014
  }
25925
- notify$1.success(t("messages.addressUpdated"));
26015
+ notify.success(t("messages.addressUpdated"));
25926
26016
  return onMembershipAdressUpdateSuccess(res);
25927
26017
  });
25928
26018
  }
@@ -27881,7 +27971,7 @@ const SubscriptionsItems = _ref => {
27881
27971
  return switchView("email-verify");
27882
27972
  }
27883
27973
  onClose === null || onClose === void 0 ? void 0 : onClose();
27884
- notify$1.confirm((onSuccess, onFailure) => {
27974
+ notify.confirm((onSuccess, onFailure) => {
27885
27975
  cancelSubscription(sub.id, onSuccess, onFailure);
27886
27976
  }, {
27887
27977
  confirmMessage: t("messages.subCancellation.isSureToCancel"),
@@ -27898,7 +27988,7 @@ const SubscriptionsItems = _ref => {
27898
27988
  if (userMustVerifyEmail()) {
27899
27989
  return switchView("email-verify");
27900
27990
  }
27901
- reactivateSubscription(sub.id);
27991
+ reactivateSubscription(sub.id, false);
27902
27992
  };
27903
27993
 
27904
27994
  // Renew click
@@ -27936,7 +28026,7 @@ const SubscriptionsItems = _ref => {
27936
28026
  return switchView("email-verify");
27937
28027
  }
27938
28028
  onClose === null || onClose === void 0 ? void 0 : onClose();
27939
- notify$1.confirm((onSuccess, onFailure) => {
28029
+ notify.confirm((onSuccess, onFailure) => {
27940
28030
  unSuspendSubscription(sub.id, onSuccess, onFailure);
27941
28031
  }, {
27942
28032
  confirmMessage: t("messages.subUnSuspend.isSureToUnSuspend"),
@@ -28018,7 +28108,7 @@ const SubscriptionsItems = _ref => {
28018
28108
  onClick: onCancelClick,
28019
28109
  disabled: disableSubmit,
28020
28110
  "data-key": sub.id
28021
- }, t("labels.unsubscribe")) : "", (sub === null || sub === void 0 ? void 0 : (_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === 'membership' && /*#__PURE__*/React__default['default'].createElement(Button, {
28111
+ }, t("labels.unsubscribe")) : "", (sub === null || sub === void 0 ? void 0 : (_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === "membership" && /*#__PURE__*/React__default['default'].createElement(Button, {
28022
28112
  variant: "ghost",
28023
28113
  className: "plc-text-blue-400 pelcro-dashboard-sub-manage-members-button",
28024
28114
  icon: /*#__PURE__*/React__default['default'].createElement(SvgRefresh, null),
@@ -28065,7 +28155,10 @@ const SubscriptionsItems = _ref => {
28065
28155
  };
28066
28156
  function getNonDonationSubs() {
28067
28157
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
28068
- return (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => !sub.plan.is_donation)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28158
+ return (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => {
28159
+ var _sub$plan2;
28160
+ return ((_sub$plan2 = sub.plan) === null || _sub$plan2 === void 0 ? void 0 : _sub$plan2.type) !== "donation";
28161
+ })) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28069
28162
  }
28070
28163
  function isDateAfterToday(date) {
28071
28164
  const today = new Date().setHours(0, 0, 0, 0);
@@ -28353,6 +28446,7 @@ function SvgQrcode(props) {
28353
28446
 
28354
28447
  const DonationsMenu = _ref => {
28355
28448
  let {
28449
+ onClose,
28356
28450
  reactivateSubscription,
28357
28451
  disableSubmit,
28358
28452
  cancelSubscription
@@ -28364,10 +28458,9 @@ const DonationsMenu = _ref => {
28364
28458
  switchView,
28365
28459
  setSubscriptionToCancel
28366
28460
  } = usePelcro();
28367
- const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
28461
+ const donations = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
28368
28462
  // Cancel button click handlers
28369
28463
  const onCancelClick = () => {
28370
- var _onClose;
28371
28464
  const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
28372
28465
  if (isImmediateCancelationEnabled) {
28373
28466
  setSubscriptionToCancel(sub.id);
@@ -28376,16 +28469,16 @@ const DonationsMenu = _ref => {
28376
28469
  if (userMustVerifyEmail()) {
28377
28470
  return switchView("email-verify");
28378
28471
  }
28379
- (_onClose = onClose) === null || _onClose === void 0 ? void 0 : _onClose();
28472
+ onClose === null || onClose === void 0 ? void 0 : onClose();
28380
28473
  notify.confirm((onSuccess, onFailure) => {
28381
28474
  cancelSubscription(sub.id, onSuccess, onFailure);
28382
28475
  }, {
28383
- confirmMessage: t("messages.subCancellation.isSureToCancel"),
28384
- loadingMessage: t("messages.subCancellation.loading"),
28385
- successMessage: t("messages.subCancellation.success"),
28386
- errorMessage: t("messages.subCancellation.error")
28476
+ confirmMessage: t("messages.donationCancellation.isSureToCancel"),
28477
+ loadingMessage: t("messages.donationCancellation.loading"),
28478
+ successMessage: t("messages.donationCancellation.success"),
28479
+ errorMessage: t("messages.donationCancellation.error")
28387
28480
  }, {
28388
- closeButtonLabel: t("labels.subCancellation.goBack")
28481
+ closeButtonLabel: t("labels.donationCancellation.goBack")
28389
28482
  });
28390
28483
  };
28391
28484
 
@@ -28394,7 +28487,7 @@ const DonationsMenu = _ref => {
28394
28487
  if (userMustVerifyEmail()) {
28395
28488
  return switchView("email-verify");
28396
28489
  }
28397
- reactivateSubscription(sub.id);
28490
+ reactivateSubscription(sub.id, true);
28398
28491
  };
28399
28492
  return /*#__PURE__*/React__default['default'].createElement("tr", {
28400
28493
  key: sub.id,
@@ -28435,12 +28528,18 @@ const DonationsMenu = _ref => {
28435
28528
  className: "plc-w-3/12 "
28436
28529
  }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
28437
28530
  className: "plc-h-4"
28438
- }), subscriptions));
28531
+ }), donations));
28439
28532
  };
28440
28533
  function getDonationSubs() {
28441
28534
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
28442
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28443
- const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
28535
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => {
28536
+ var _sub$plan;
28537
+ return ((_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === "donation";
28538
+ })) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28539
+ const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => {
28540
+ var _sub$plan2;
28541
+ return ((_sub$plan2 = sub.plan) === null || _sub$plan2 === void 0 ? void 0 : _sub$plan2.type) === "donation";
28542
+ })) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
28444
28543
  return [...donations, ...canceledDonations];
28445
28544
  }
28446
28545
  function formatStartDate(date) {
@@ -28829,7 +28928,7 @@ class Dashboard extends React.Component {
28829
28928
  const formattedRenewDate = new Intl.DateTimeFormat("en-CA").format(renewDate);
28830
28929
  return `${this.locale("labels.renewsOn")} ${formattedRenewDate}`;
28831
28930
  });
28832
- _defineProperty$3(this, "reactivateSubscription", subscription_id => {
28931
+ _defineProperty$3(this, "reactivateSubscription", (subscription_id, isDonation) => {
28833
28932
  // disable the Login button to prevent repeated clicks
28834
28933
  this.setState({
28835
28934
  disableSubmit: true
@@ -28843,9 +28942,17 @@ class Dashboard extends React.Component {
28843
28942
  });
28844
28943
  this.props.onClose();
28845
28944
  if (err) {
28846
- return notify$1.error(this.locale("messages.subReactivation.error"));
28945
+ if (isDonation) {
28946
+ return notify.error(this.locale("messages.donationReactivation.error"));
28947
+ } else {
28948
+ return notify.error(this.locale("messages.subReactivation.error"));
28949
+ }
28950
+ }
28951
+ if (isDonation) {
28952
+ return notify.success(this.locale("messages.donationReactivation.success"));
28953
+ } else {
28954
+ return notify.success(this.locale("messages.subReactivation.success"));
28847
28955
  }
28848
- return notify$1.success(this.locale("messages.subReactivation.success"));
28849
28956
  });
28850
28957
  });
28851
28958
  _defineProperty$3(this, "getSubscriptionStatus", sub => {
@@ -29207,6 +29314,7 @@ class Dashboard extends React.Component {
29207
29314
  }),
29208
29315
  title: this.locale("labels.donations"),
29209
29316
  content: /*#__PURE__*/React__default['default'].createElement(DonationsMenu, {
29317
+ onClose: this.props.onClose,
29210
29318
  reactivateSubscription: this.reactivateSubscription,
29211
29319
  disableSubmit: this.state.disableSubmit,
29212
29320
  cancelSubscription: this.cancelSubscription
@@ -29248,8 +29356,14 @@ function hasInvoices() {
29248
29356
  }
29249
29357
  function hasDonationSubs() {
29250
29358
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
29251
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
29252
- const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
29359
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => {
29360
+ var _sub$plan;
29361
+ return ((_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === "donation";
29362
+ })) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
29363
+ const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => {
29364
+ var _sub$plan2;
29365
+ return ((_sub$plan2 = sub.plan) === null || _sub$plan2 === void 0 ? void 0 : _sub$plan2.type) === "donation";
29366
+ })) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
29253
29367
  return donations.length > 0 || canceledDonations.length > 0;
29254
29368
  }
29255
29369
  function hasActiveMemberships() {
@@ -31414,7 +31528,7 @@ function VerifyLinkTokenModal(_ref) {
31414
31528
  var _props$onSuccess;
31415
31529
  (_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
31416
31530
  resetView();
31417
- notify$1.success(t("messages.success"));
31531
+ notify.success(t("messages.success"));
31418
31532
  };
31419
31533
  return /*#__PURE__*/React__default['default'].createElement(Modal, {
31420
31534
  id: "pelcro-login-modal",
@@ -33306,6 +33420,6 @@ exports.i18n = i18next;
33306
33420
  exports.initButtons = init$1;
33307
33421
  exports.initContentEntitlement = init;
33308
33422
  exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
33309
- exports.notify = notify$1;
33423
+ exports.notify = notify;
33310
33424
  exports.unauthenticatedButtons = unauthenticatedButtons;
33311
33425
  exports.usePelcro = usePelcro;
package/dist/index.esm.js CHANGED
@@ -3915,6 +3915,9 @@ var labels$Y = {
3915
3915
  },
3916
3916
  subCancellation: {
3917
3917
  goBack: "Go back"
3918
+ },
3919
+ donationCancellation: {
3920
+ goBack: "Go back"
3918
3921
  }
3919
3922
  };
3920
3923
  var messages$_ = {
@@ -3934,6 +3937,22 @@ var messages$_ = {
3934
3937
  loading: "Unsuspending your subscription",
3935
3938
  success: "Subscription is successfully unsuspended",
3936
3939
  error: "Error while unsuspending your subscription"
3940
+ },
3941
+ donationCancellation: {
3942
+ isSureToCancel: "Are you sure you want to cancel your donation?",
3943
+ loading: "Cancelling your donation",
3944
+ success: "Donation is successfully cancelled",
3945
+ error: "Error while cancelling your donation"
3946
+ },
3947
+ donationReactivation: {
3948
+ success: "Donation is successfully reactivated",
3949
+ error: "Error while reactivating your donation"
3950
+ },
3951
+ donationUnSuspend: {
3952
+ isSureToUnSuspend: "Are you sure you want to unsuspend your donation?",
3953
+ loading: "Unsuspending your donation",
3954
+ success: "Donation is successfully unsuspended",
3955
+ error: "Error while unsuspending your donation"
3937
3956
  }
3938
3957
  };
3939
3958
  var dashboard_en = {
@@ -4893,6 +4912,9 @@ var labels$C = {
4893
4912
  },
4894
4913
  subCancellation: {
4895
4914
  goBack: "Retourner"
4915
+ },
4916
+ donationCancellation: {
4917
+ goBack: "Go back"
4896
4918
  }
4897
4919
  };
4898
4920
  var messages$F = {
@@ -4912,6 +4934,22 @@ var messages$F = {
4912
4934
  loading: "Annulation de la suspension de votre abonnement",
4913
4935
  success: "L'abonnement a été suspendu avec succès",
4914
4936
  error: "Erreur lors de l'annulation de la suspension de votre abonnement"
4937
+ },
4938
+ donationCancellation: {
4939
+ isSureToCancel: "Êtes-vous certain de vouloir annuler votre don?",
4940
+ loading: "Annulation de l'don",
4941
+ success: "L'don a été annulé avec succès",
4942
+ error: "Une erreur s'est produite lors de l'annulation de l'don"
4943
+ },
4944
+ donationReactivation: {
4945
+ success: "L'don a été réactivé avec succès",
4946
+ error: "Erreur lors de la réactivation de votre don"
4947
+ },
4948
+ donationUnSuspend: {
4949
+ isSureToUnSuspend: "Êtes-vous sûr de vouloir annuler la suspension de votre don ?",
4950
+ loading: "Annulation de la suspension de votre don",
4951
+ success: "L'don a été suspendu avec succès",
4952
+ error: "Erreur lors de l'annulation de la suspension de votre don"
4915
4953
  }
4916
4954
  };
4917
4955
  var dashboard_fr = {
@@ -5816,6 +5854,9 @@ var savedItems = {
5816
5854
  var subCancellation = {
5817
5855
  goBack: "뒤로 가기"
5818
5856
  };
5857
+ var donationCancellation = {
5858
+ goBack: "뒤로 가기"
5859
+ };
5819
5860
  var messages$n = {
5820
5861
  noCard: "등록된 카드가 없습니다.",
5821
5862
  subCancellation: {
@@ -5833,6 +5874,22 @@ var messages$n = {
5833
5874
  loading: "구독 일시 중단 해제",
5834
5875
  success: "구독이 성공적으로 일시 중단 해제되었습니다",
5835
5876
  error: "구독 일시 중단을 해제하는 동안 오류가 발생했습니다."
5877
+ },
5878
+ donationCancellation: {
5879
+ isSureToCancel: "정말로 유료 멤버십을 취소하시겠습니까?",
5880
+ loading: "귀하의 유료 멤버십을 취소합니다.",
5881
+ success: "유료 멤버십이 성공적으로 취소되었습니다.",
5882
+ error: "유료 멤버십 취소 과정에서 오류가 발생했습니다."
5883
+ },
5884
+ donationReactivation: {
5885
+ success: "구독이 성공적으로 재활성화되었습니다.",
5886
+ error: "구독을 재활성화하는 동안 오류가 발생했습니다."
5887
+ },
5888
+ donationUnSuspend: {
5889
+ isSureToUnSuspend: "구독 일시 중단을 해제하시겠습니까?",
5890
+ loading: "구독 일시 중단 해제",
5891
+ success: "구독이 성공적으로 일시 중단 해제되었습니다",
5892
+ error: "구독 일시 중단을 해제하는 동안 오류가 발생했습니다."
5836
5893
  }
5837
5894
  };
5838
5895
  var dashboard_ko = {
@@ -5885,6 +5942,7 @@ var dashboard_ko = {
5885
5942
  orders: orders,
5886
5943
  savedItems: savedItems,
5887
5944
  subCancellation: subCancellation,
5945
+ donationCancellation: donationCancellation,
5888
5946
  messages: messages$n
5889
5947
  };
5890
5948
 
@@ -6716,6 +6774,9 @@ var labels$6 = {
6716
6774
  },
6717
6775
  subCancellation: {
6718
6776
  goBack: "Volver"
6777
+ },
6778
+ donationCancellation: {
6779
+ goBack: "Go back"
6719
6780
  }
6720
6781
  };
6721
6782
  var messages$5 = {
@@ -6735,6 +6796,22 @@ var messages$5 = {
6735
6796
  loading: "Reanudando tu suscripción",
6736
6797
  success: "La suscripción se reanudó con éxito",
6737
6798
  error: "Error al reanudar tu suscripción"
6799
+ },
6800
+ donationCancellation: {
6801
+ isSureToCancel: "¿Estás seguro de que quieres cancelar tu donación?",
6802
+ loading: "Cancelando tu donación",
6803
+ success: "La donación se canceló con éxito",
6804
+ error: "Error al cancelar tu donación"
6805
+ },
6806
+ donationReactivation: {
6807
+ success: "La donación se reactivó con éxito",
6808
+ error: "Error al reactivar su donación"
6809
+ },
6810
+ donationUnSuspend: {
6811
+ isSureToUnSuspend: "¿Estás seguro de que quieres reanudar tu donación?",
6812
+ loading: "Reanudando tu donación",
6813
+ success: "La donación se reanudó con éxito",
6814
+ error: "Error al reanudar tu donación"
6738
6815
  }
6739
6816
  };
6740
6817
  var dashboard_es = {
@@ -10544,7 +10621,7 @@ toast.confirm = function (onConfirm, _ref3) {
10544
10621
  ...options
10545
10622
  });
10546
10623
  setTimeout(() => {
10547
- notify$1.dismiss(id);
10624
+ notify.dismiss(id);
10548
10625
  }, 3000);
10549
10626
  };
10550
10627
  const onFailure = errorValue => {
@@ -10553,11 +10630,11 @@ toast.confirm = function (onConfirm, _ref3) {
10553
10630
  ...options
10554
10631
  });
10555
10632
  setTimeout(() => {
10556
- notify$1.dismiss(id);
10633
+ notify.dismiss(id);
10557
10634
  }, 3000);
10558
10635
  };
10559
10636
  };
10560
- const notify$1 = toast;
10637
+ const notify = toast;
10561
10638
 
10562
10639
  const translations = i18next.t("common:buttons", {
10563
10640
  returnObjects: true
@@ -10618,7 +10695,7 @@ const init$1 = () => {
10618
10695
  const errorMessage = i18next.t("messages:invalidSubscription", {
10619
10696
  returnObjects: true
10620
10697
  });
10621
- return notify$1.error(errorMessage);
10698
+ return notify.error(errorMessage);
10622
10699
  }
10623
10700
  switchView("manage-members");
10624
10701
  });
@@ -10626,7 +10703,7 @@ const init$1 = () => {
10626
10703
  const errorMessage = i18next.t("messages:invalidSubscription", {
10627
10704
  returnObjects: true
10628
10705
  });
10629
- return notify$1.error(errorMessage);
10706
+ return notify.error(errorMessage);
10630
10707
  }
10631
10708
  }
10632
10709
  }
@@ -10814,7 +10891,7 @@ const init$1 = () => {
10814
10891
  const errorMsg = i18next.t("shop:messages.currencyMismatch", {
10815
10892
  currency: userCurrency
10816
10893
  });
10817
- notify$1.error(errorMsg);
10894
+ notify.error(errorMsg);
10818
10895
  }
10819
10896
  });
10820
10897
  }
@@ -10907,7 +10984,7 @@ const init = () => {
10907
10984
  unblurElemWhenUserLogsIn(elemDeepClone, entitlements);
10908
10985
  unblurElemWhenUserLogsOut(elemDeepClone, entitlements);
10909
10986
  const NOTIFICATION_ID = "entitlement";
10910
- notify$1( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
10987
+ notify( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
10911
10988
  i18nKey: "messages:entitlement"
10912
10989
  }, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default.createElement(Link, {
10913
10990
  onClick: () => {
@@ -10922,7 +10999,7 @@ const init = () => {
10922
10999
  plan: selectedPlan
10923
11000
  });
10924
11001
  }
10925
- notify$1.dismiss(NOTIFICATION_ID);
11002
+ notify.dismiss(NOTIFICATION_ID);
10926
11003
  switchView("_plan-select-entitlements");
10927
11004
  }
10928
11005
  }, "Subscribe"), "now to get full page access.")), {
@@ -11529,9 +11606,9 @@ const verifyEmailTokenFromUrl = () => {
11529
11606
  token: emailToken
11530
11607
  }, (err, res) => {
11531
11608
  if (err) {
11532
- return notify$1.error(getErrorMessages(err));
11609
+ return notify.error(getErrorMessages(err));
11533
11610
  }
11534
- return notify$1.success(translations.success);
11611
+ return notify.success(translations.success);
11535
11612
  });
11536
11613
  }, {
11537
11614
  once: true
@@ -11555,7 +11632,7 @@ const verifyLinkTokenFromUrl = () => {
11555
11632
  token: loginToken
11556
11633
  }, (err, res) => {
11557
11634
  if (err) {
11558
- return notify$1.error(getErrorMessages(err));
11635
+ return notify.error(getErrorMessages(err));
11559
11636
  }
11560
11637
  const {
11561
11638
  auth_token
@@ -11564,10 +11641,10 @@ const verifyLinkTokenFromUrl = () => {
11564
11641
  auth_token
11565
11642
  }, (err, res) => {
11566
11643
  if (err) {
11567
- return notify$1.error(getErrorMessages(err));
11644
+ return notify.error(getErrorMessages(err));
11568
11645
  }
11569
11646
  resetView();
11570
- return notify$1.success(translations.success);
11647
+ return notify.success(translations.success);
11571
11648
  });
11572
11649
  });
11573
11650
  }, {
@@ -11642,7 +11719,7 @@ const showInvoiceDetailsFromUrl = () => {
11642
11719
  const errorMessage = i18next.t("messages:invalidInvoice", {
11643
11720
  returnObjects: true
11644
11721
  });
11645
- return notify$1.error(errorMessage);
11722
+ return notify.error(errorMessage);
11646
11723
  }
11647
11724
  const {
11648
11725
  invoice
@@ -11651,7 +11728,7 @@ const showInvoiceDetailsFromUrl = () => {
11651
11728
  const errorMessage = i18next.t("messages:zeroTotalInvoice", {
11652
11729
  returnObjects: true
11653
11730
  });
11654
- return notify$1.error(errorMessage);
11731
+ return notify.error(errorMessage);
11655
11732
  }
11656
11733
  return switchView("invoice-details");
11657
11734
  });
@@ -11676,7 +11753,7 @@ const showSubscriptionManageMembersFromUrl = () => {
11676
11753
  const errorMessage = i18next.t("messages:invalidSubscription", {
11677
11754
  returnObjects: true
11678
11755
  });
11679
- return notify$1.error(errorMessage);
11756
+ return notify.error(errorMessage);
11680
11757
  }
11681
11758
  return switchView("manage-members");
11682
11759
  });
@@ -14786,7 +14863,7 @@ class DonationModal extends Component {
14786
14863
  className: "plc-bg-gray-100 plc-rounded-md plc-p-3 plc-mt-3 plc-text-sm plc-flex plc-items-center"
14787
14864
  }, /*#__PURE__*/React__default.createElement("div", {
14788
14865
  className: "plc-flex plc-items-center plc-flex-1"
14789
- }, "Auto renewed:", " ", /*#__PURE__*/React__default.createElement("span", {
14866
+ }, "Auto renew:", " ", /*#__PURE__*/React__default.createElement("span", {
14790
14867
  className: "plc-inline-flex plc-w-6 plc-ml-1"
14791
14868
  }, plan.auto_renew ? /*#__PURE__*/React__default.createElement(SvgCheck, {
14792
14869
  className: "plc-text-green-500"
@@ -14805,7 +14882,7 @@ class DonationModal extends Component {
14805
14882
  }, plan.preset_donation_values.map(value => /*#__PURE__*/React__default.createElement("li", {
14806
14883
  key: value
14807
14884
  }, /*#__PURE__*/React__default.createElement("button", {
14808
- className: `plc-bg-white plc-rounded-md plc-flex plc-items-center plc-justify-center plc-text-lg plc-w-full plc-min-h-20 focus:plc-outline-none ${isChecked && +this.state.selectedDonationAmount === +value ? "plc-border-primary-500 plc-text-primary-900 plc-border-2" : "plc-border-gray-200 plc-text-gray-900 plc-border"}`,
14885
+ className: `plc-bg-white plc-rounded-md plc-flex plc-items-center plc-justify-center plc-text-lg plc-w-full plc-min-h-16 focus:plc-outline-none ${isChecked && +this.state.selectedDonationAmount === +value ? "plc-border-primary-500 plc-text-primary-900 plc-border-2" : "plc-border-gray-200 plc-text-gray-900 plc-border"}`,
14809
14886
  onClick: () => {
14810
14887
  this.setState({
14811
14888
  selectedDonationAmount: +value,
@@ -14813,7 +14890,11 @@ class DonationModal extends Component {
14813
14890
  disabled: false
14814
14891
  });
14815
14892
  }
14816
- }, getFormattedPriceByLocal(value, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()))))), /*#__PURE__*/React__default.createElement("div", {
14893
+ }, /*#__PURE__*/React__default.createElement("span", {
14894
+ className: "plc-font-bold plc-mr-1"
14895
+ }, value), /*#__PURE__*/React__default.createElement("span", {
14896
+ className: "plc-uppercase"
14897
+ }, plan === null || plan === void 0 ? void 0 : plan.currency))))), /*#__PURE__*/React__default.createElement("div", {
14817
14898
  className: "plc-relative plc-py-3 plc-mt-3"
14818
14899
  }, /*#__PURE__*/React__default.createElement("hr", null), " ", /*#__PURE__*/React__default.createElement("span", {
14819
14900
  className: "plc-absolute plc-top-1/2 plc-left-1/2 plc-transform plc--translate-x-1/2 plc--translate-y-1/2 plc-leading-none plc-bg-white plc-px-2"
@@ -14838,8 +14919,9 @@ class DonationModal extends Component {
14838
14919
  });
14839
14920
  }
14840
14921
  },
14841
- placeholder: "Donate a custome amount ...",
14842
- className: "plc-pr-14"
14922
+ placeholder: "Donate a custom amount ...",
14923
+ className: "plc-pr-14",
14924
+ wrapperClassName: "plc-mb-0"
14843
14925
  }), /*#__PURE__*/React__default.createElement("span", {
14844
14926
  className: "plc-absolute plc-top-1/2 plc-transform plc--translate-y-1/2 plc-right-3 plc-pl-3 plc-border-l plc-border-gray-200 plc-uppercase plc-text-sm"
14845
14927
  }, plan.currency)));
@@ -14989,7 +15071,7 @@ class DonationModal extends Component {
14989
15071
  }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default.createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default.createElement("div", {
14990
15072
  className: "pelcro-select-products-wrapper"
14991
15073
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
14992
- className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
15074
+ className: "plc-overflow-y-scroll pelcro-select-plans-wrapper"
14993
15075
  }, this.renderPlans()), !window.Pelcro.user.isAuthenticated() && (_this$state$product = this.state.product) !== null && _this$state$product !== void 0 && _this$state$product.address_required ? /*#__PURE__*/React__default.createElement(Button, {
14994
15076
  disabled: this.state.disabled,
14995
15077
  onClick: () => this.submitOption(true),
@@ -18938,13 +19020,15 @@ const DiscountedPrice = props => {
18938
19020
  };
18939
19021
 
18940
19022
  const SubmitPaymentMethod = _ref => {
18941
- var _plan$quantity, _window$Pelcro$site$r;
19023
+ var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
18942
19024
  let {
18943
19025
  onClick,
18944
19026
  ...otherProps
18945
19027
  } = _ref;
18946
19028
  const {
18947
- plan
19029
+ plan,
19030
+ selectedDonationAmount,
19031
+ customDonationAmount
18948
19032
  } = usePelcro();
18949
19033
  const {
18950
19034
  t
@@ -18966,7 +19050,13 @@ const SubmitPaymentMethod = _ref => {
18966
19050
  } = useContext(store$k);
18967
19051
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
18968
19052
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
18969
- const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
19053
+ // const priceFormatted = getFormattedPriceByLocal(
19054
+ // price * planQuantity,
19055
+ // plan?.currency,
19056
+ // getPageOrDefaultLanguage()
19057
+ // );
19058
+
19059
+ const priceFormatted = plan.type === "donation" && (selectedDonationAmount || customDonationAmount) ? getFormattedPriceByLocal(selectedDonationAmount ? selectedDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity2 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity2 !== void 0 ? _plan$quantity2 : 1) : customDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity3 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity3 !== void 0 ? _plan$quantity3 : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()) : getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
18970
19060
  const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
18971
19061
  const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
18972
19062
  const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
@@ -20016,7 +20106,7 @@ const SubscriptionCancelNowButton = _ref => {
20016
20106
  switchView(null);
20017
20107
 
20018
20108
  //Show confirmation alert after closing the modal
20019
- notify$1.confirm((onSuccess, onFailure) => {
20109
+ notify.confirm((onSuccess, onFailure) => {
20020
20110
  cancelSubscription(payload, onSuccess, onFailure);
20021
20111
  }, {
20022
20112
  confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
@@ -20086,7 +20176,7 @@ const SubscriptionCancelLaterButton = _ref => {
20086
20176
  switchView(null);
20087
20177
 
20088
20178
  //Show confirmation alert after closing the modal
20089
- notify$1.confirm((onSuccess, onFailure) => {
20179
+ notify.confirm((onSuccess, onFailure) => {
20090
20180
  cancelSubscription(payload, onSuccess, onFailure);
20091
20181
  }, {
20092
20182
  confirmMessage: t("messages.subCancellation.isSureToCancel"),
@@ -20321,7 +20411,7 @@ const SubscriptionSuspendButton = _ref => {
20321
20411
  switchView(null);
20322
20412
 
20323
20413
  //Show confirmation alert after closing the modal
20324
- notify$1.confirm((onSuccess, onFailure) => {
20414
+ notify.confirm((onSuccess, onFailure) => {
20325
20415
  suspendSubscription(payload, onSuccess, onFailure);
20326
20416
  }, {
20327
20417
  confirmMessage: t("messages.subCancellation.isSureToSuspendNow"),
@@ -22381,7 +22471,7 @@ const AddressCreateContainer = _ref => {
22381
22471
  });
22382
22472
  return onFailure(err);
22383
22473
  }
22384
- notify$1.success(t("messages.addressUpdated"));
22474
+ notify.success(t("messages.addressUpdated"));
22385
22475
  return onMembershipAdressUpdateSuccess(res);
22386
22476
  });
22387
22477
  }
@@ -25892,7 +25982,7 @@ const AddressSelectContainer = _ref => {
25892
25982
  });
25893
25983
  return onFailure(err);
25894
25984
  }
25895
- notify$1.success(t("messages.addressUpdated"));
25985
+ notify.success(t("messages.addressUpdated"));
25896
25986
  return onMembershipAdressUpdateSuccess(res);
25897
25987
  });
25898
25988
  }
@@ -27851,7 +27941,7 @@ const SubscriptionsItems = _ref => {
27851
27941
  return switchView("email-verify");
27852
27942
  }
27853
27943
  onClose === null || onClose === void 0 ? void 0 : onClose();
27854
- notify$1.confirm((onSuccess, onFailure) => {
27944
+ notify.confirm((onSuccess, onFailure) => {
27855
27945
  cancelSubscription(sub.id, onSuccess, onFailure);
27856
27946
  }, {
27857
27947
  confirmMessage: t("messages.subCancellation.isSureToCancel"),
@@ -27868,7 +27958,7 @@ const SubscriptionsItems = _ref => {
27868
27958
  if (userMustVerifyEmail()) {
27869
27959
  return switchView("email-verify");
27870
27960
  }
27871
- reactivateSubscription(sub.id);
27961
+ reactivateSubscription(sub.id, false);
27872
27962
  };
27873
27963
 
27874
27964
  // Renew click
@@ -27906,7 +27996,7 @@ const SubscriptionsItems = _ref => {
27906
27996
  return switchView("email-verify");
27907
27997
  }
27908
27998
  onClose === null || onClose === void 0 ? void 0 : onClose();
27909
- notify$1.confirm((onSuccess, onFailure) => {
27999
+ notify.confirm((onSuccess, onFailure) => {
27910
28000
  unSuspendSubscription(sub.id, onSuccess, onFailure);
27911
28001
  }, {
27912
28002
  confirmMessage: t("messages.subUnSuspend.isSureToUnSuspend"),
@@ -27988,7 +28078,7 @@ const SubscriptionsItems = _ref => {
27988
28078
  onClick: onCancelClick,
27989
28079
  disabled: disableSubmit,
27990
28080
  "data-key": sub.id
27991
- }, t("labels.unsubscribe")) : "", (sub === null || sub === void 0 ? void 0 : (_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === 'membership' && /*#__PURE__*/React__default.createElement(Button, {
28081
+ }, t("labels.unsubscribe")) : "", (sub === null || sub === void 0 ? void 0 : (_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === "membership" && /*#__PURE__*/React__default.createElement(Button, {
27992
28082
  variant: "ghost",
27993
28083
  className: "plc-text-blue-400 pelcro-dashboard-sub-manage-members-button",
27994
28084
  icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
@@ -28035,7 +28125,10 @@ const SubscriptionsItems = _ref => {
28035
28125
  };
28036
28126
  function getNonDonationSubs() {
28037
28127
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
28038
- return (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => !sub.plan.is_donation)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28128
+ return (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => {
28129
+ var _sub$plan2;
28130
+ return ((_sub$plan2 = sub.plan) === null || _sub$plan2 === void 0 ? void 0 : _sub$plan2.type) !== "donation";
28131
+ })) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28039
28132
  }
28040
28133
  function isDateAfterToday(date) {
28041
28134
  const today = new Date().setHours(0, 0, 0, 0);
@@ -28323,6 +28416,7 @@ function SvgQrcode(props) {
28323
28416
 
28324
28417
  const DonationsMenu = _ref => {
28325
28418
  let {
28419
+ onClose,
28326
28420
  reactivateSubscription,
28327
28421
  disableSubmit,
28328
28422
  cancelSubscription
@@ -28334,10 +28428,9 @@ const DonationsMenu = _ref => {
28334
28428
  switchView,
28335
28429
  setSubscriptionToCancel
28336
28430
  } = usePelcro();
28337
- const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
28431
+ const donations = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
28338
28432
  // Cancel button click handlers
28339
28433
  const onCancelClick = () => {
28340
- var _onClose;
28341
28434
  const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
28342
28435
  if (isImmediateCancelationEnabled) {
28343
28436
  setSubscriptionToCancel(sub.id);
@@ -28346,16 +28439,16 @@ const DonationsMenu = _ref => {
28346
28439
  if (userMustVerifyEmail()) {
28347
28440
  return switchView("email-verify");
28348
28441
  }
28349
- (_onClose = onClose) === null || _onClose === void 0 ? void 0 : _onClose();
28442
+ onClose === null || onClose === void 0 ? void 0 : onClose();
28350
28443
  notify.confirm((onSuccess, onFailure) => {
28351
28444
  cancelSubscription(sub.id, onSuccess, onFailure);
28352
28445
  }, {
28353
- confirmMessage: t("messages.subCancellation.isSureToCancel"),
28354
- loadingMessage: t("messages.subCancellation.loading"),
28355
- successMessage: t("messages.subCancellation.success"),
28356
- errorMessage: t("messages.subCancellation.error")
28446
+ confirmMessage: t("messages.donationCancellation.isSureToCancel"),
28447
+ loadingMessage: t("messages.donationCancellation.loading"),
28448
+ successMessage: t("messages.donationCancellation.success"),
28449
+ errorMessage: t("messages.donationCancellation.error")
28357
28450
  }, {
28358
- closeButtonLabel: t("labels.subCancellation.goBack")
28451
+ closeButtonLabel: t("labels.donationCancellation.goBack")
28359
28452
  });
28360
28453
  };
28361
28454
 
@@ -28364,7 +28457,7 @@ const DonationsMenu = _ref => {
28364
28457
  if (userMustVerifyEmail()) {
28365
28458
  return switchView("email-verify");
28366
28459
  }
28367
- reactivateSubscription(sub.id);
28460
+ reactivateSubscription(sub.id, true);
28368
28461
  };
28369
28462
  return /*#__PURE__*/React__default.createElement("tr", {
28370
28463
  key: sub.id,
@@ -28405,12 +28498,18 @@ const DonationsMenu = _ref => {
28405
28498
  className: "plc-w-3/12 "
28406
28499
  }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
28407
28500
  className: "plc-h-4"
28408
- }), subscriptions));
28501
+ }), donations));
28409
28502
  };
28410
28503
  function getDonationSubs() {
28411
28504
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
28412
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28413
- const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
28505
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => {
28506
+ var _sub$plan;
28507
+ return ((_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === "donation";
28508
+ })) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
28509
+ const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => {
28510
+ var _sub$plan2;
28511
+ return ((_sub$plan2 = sub.plan) === null || _sub$plan2 === void 0 ? void 0 : _sub$plan2.type) === "donation";
28512
+ })) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
28414
28513
  return [...donations, ...canceledDonations];
28415
28514
  }
28416
28515
  function formatStartDate(date) {
@@ -28799,7 +28898,7 @@ class Dashboard extends Component {
28799
28898
  const formattedRenewDate = new Intl.DateTimeFormat("en-CA").format(renewDate);
28800
28899
  return `${this.locale("labels.renewsOn")} ${formattedRenewDate}`;
28801
28900
  });
28802
- _defineProperty$3(this, "reactivateSubscription", subscription_id => {
28901
+ _defineProperty$3(this, "reactivateSubscription", (subscription_id, isDonation) => {
28803
28902
  // disable the Login button to prevent repeated clicks
28804
28903
  this.setState({
28805
28904
  disableSubmit: true
@@ -28813,9 +28912,17 @@ class Dashboard extends Component {
28813
28912
  });
28814
28913
  this.props.onClose();
28815
28914
  if (err) {
28816
- return notify$1.error(this.locale("messages.subReactivation.error"));
28915
+ if (isDonation) {
28916
+ return notify.error(this.locale("messages.donationReactivation.error"));
28917
+ } else {
28918
+ return notify.error(this.locale("messages.subReactivation.error"));
28919
+ }
28920
+ }
28921
+ if (isDonation) {
28922
+ return notify.success(this.locale("messages.donationReactivation.success"));
28923
+ } else {
28924
+ return notify.success(this.locale("messages.subReactivation.success"));
28817
28925
  }
28818
- return notify$1.success(this.locale("messages.subReactivation.success"));
28819
28926
  });
28820
28927
  });
28821
28928
  _defineProperty$3(this, "getSubscriptionStatus", sub => {
@@ -29177,6 +29284,7 @@ class Dashboard extends Component {
29177
29284
  }),
29178
29285
  title: this.locale("labels.donations"),
29179
29286
  content: /*#__PURE__*/React__default.createElement(DonationsMenu, {
29287
+ onClose: this.props.onClose,
29180
29288
  reactivateSubscription: this.reactivateSubscription,
29181
29289
  disableSubmit: this.state.disableSubmit,
29182
29290
  cancelSubscription: this.cancelSubscription
@@ -29218,8 +29326,14 @@ function hasInvoices() {
29218
29326
  }
29219
29327
  function hasDonationSubs() {
29220
29328
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
29221
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
29222
- const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
29329
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => {
29330
+ var _sub$plan;
29331
+ return ((_sub$plan = sub.plan) === null || _sub$plan === void 0 ? void 0 : _sub$plan.type) === "donation";
29332
+ })) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
29333
+ const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => {
29334
+ var _sub$plan2;
29335
+ return ((_sub$plan2 = sub.plan) === null || _sub$plan2 === void 0 ? void 0 : _sub$plan2.type) === "donation";
29336
+ })) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
29223
29337
  return donations.length > 0 || canceledDonations.length > 0;
29224
29338
  }
29225
29339
  function hasActiveMemberships() {
@@ -31384,7 +31498,7 @@ function VerifyLinkTokenModal(_ref) {
31384
31498
  var _props$onSuccess;
31385
31499
  (_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
31386
31500
  resetView();
31387
- notify$1.success(t("messages.success"));
31501
+ notify.success(t("messages.success"));
31388
31502
  };
31389
31503
  return /*#__PURE__*/React__default.createElement(Modal, {
31390
31504
  id: "pelcro-login-modal",
@@ -33042,4 +33156,4 @@ const QrCodeModal = _ref => {
33042
33156
  };
33043
33157
  QrCodeModal.viewId = "qrcode";
33044
33158
 
33045
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, DonationModalWithHook as DonationModal, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro };
33159
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, DonationModalWithHook as DonationModal, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
package/dist/pelcro.css CHANGED
@@ -2270,6 +2270,10 @@ layer components {
2270
2270
  margin-right: auto;
2271
2271
  }
2272
2272
 
2273
+ .pelcro-root .plc-mb-0 {
2274
+ margin-bottom: 0px;
2275
+ }
2276
+
2273
2277
  .pelcro-root .plc-ml-0 {
2274
2278
  margin-left: 0px;
2275
2279
  }
@@ -2390,8 +2394,8 @@ layer components {
2390
2394
  min-height: 3rem;
2391
2395
  }
2392
2396
 
2393
- .pelcro-root .plc-min-h-20 {
2394
- min-height: 6rem;
2397
+ .pelcro-root .plc-min-h-16 {
2398
+ min-height: 4rem;
2395
2399
  }
2396
2400
 
2397
2401
  .pelcro-root .plc-min-h-40 {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.22.0-beta.18",
4
+ "version": "3.22.0-beta.19",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",