@pelcro/react-pelcro-js 3.2.0-beta.7 → 3.2.0

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
@@ -3461,9 +3461,9 @@ var paymentMethod_fr = {
3461
3461
  select: select
3462
3462
  };
3463
3463
 
3464
- var title$h = "Enter your email to subscribe to our newsletter";
3464
+ var title$f = "Enter your email to subscribe to our newsletter";
3465
3465
  var updateTitle$1 = "Update newsletter selections";
3466
- var subtitle$9 = "We may use your email for other marketing communication";
3466
+ var subtitle$7 = "We may use your email for other marketing communication";
3467
3467
  var labels$p = {
3468
3468
  submit: "Submit",
3469
3469
  firstName: "First name",
@@ -3480,16 +3480,16 @@ var messages$r = {
3480
3480
  here: "here"
3481
3481
  };
3482
3482
  var newsletter_en = {
3483
- title: title$h,
3483
+ title: title$f,
3484
3484
  updateTitle: updateTitle$1,
3485
- subtitle: subtitle$9,
3485
+ subtitle: subtitle$7,
3486
3486
  labels: labels$p,
3487
3487
  messages: messages$r
3488
3488
  };
3489
3489
 
3490
- var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3490
+ var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3491
3491
  var updateTitle = "Mettre à jour son choix d'infolettres";
3492
- var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3492
+ var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3493
3493
  var labels$o = {
3494
3494
  submit: "Lire l’article !",
3495
3495
  firstName: "Prénom",
@@ -3506,9 +3506,9 @@ var messages$q = {
3506
3506
  here: "ici"
3507
3507
  };
3508
3508
  var newsletter_fr = {
3509
- title: title$g,
3509
+ title: title$e,
3510
3510
  updateTitle: updateTitle,
3511
- subtitle: subtitle$8,
3511
+ subtitle: subtitle$6,
3512
3512
  labels: labels$o,
3513
3513
  messages: messages$q
3514
3514
  };
@@ -3765,8 +3765,8 @@ var login_fr = {
3765
3765
  errors: errors$4
3766
3766
  };
3767
3767
 
3768
- var title$f = "Create an account";
3769
- var subtitle$7 = "Enter your email and password below";
3768
+ var title$d = "Create an account";
3769
+ var subtitle$5 = "Enter your email and password below";
3770
3770
  var labels$h = {
3771
3771
  signUpFacebook: "Sign up with Facebook",
3772
3772
  signUpGoogle: "Sign up with Google",
@@ -3851,8 +3851,8 @@ var redeem$1 = {
3851
3851
  }
3852
3852
  };
3853
3853
  var register_en = {
3854
- title: title$f,
3855
- subtitle: subtitle$7,
3854
+ title: title$d,
3855
+ subtitle: subtitle$5,
3856
3856
  labels: labels$h,
3857
3857
  messages: messages$h,
3858
3858
  errors: errors$3,
@@ -3860,8 +3860,8 @@ var register_en = {
3860
3860
  redeem: redeem$1
3861
3861
  };
3862
3862
 
3863
- var title$e = "Créer un compte";
3864
- var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3863
+ var title$c = "Créer un compte";
3864
+ var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3865
3865
  var labels$g = {
3866
3866
  signUpFacebook: "Inscrivez-vous avec Facebook",
3867
3867
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3947,8 +3947,8 @@ var redeem = {
3947
3947
  }
3948
3948
  };
3949
3949
  var register_fr = {
3950
- title: title$e,
3951
- subtitle: subtitle$6,
3950
+ title: title$c,
3951
+ subtitle: subtitle$4,
3952
3952
  labels: labels$g,
3953
3953
  messages: messages$g,
3954
3954
  errors: errors$2,
@@ -4008,7 +4008,7 @@ var userEdit_fr = {
4008
4008
  messages: messages$e
4009
4009
  };
4010
4010
 
4011
- var title$d = "Enter your shipping address";
4011
+ var title$b = "Enter your shipping address";
4012
4012
  var selectAddressTitle$1 = "Please select an address";
4013
4013
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
4014
4014
  var labels$d = {
@@ -4031,7 +4031,7 @@ var messages$d = {
4031
4031
  subRedeemed: "Your subscription has been redeemed."
4032
4032
  };
4033
4033
  var address_en = {
4034
- title: title$d,
4034
+ title: title$b,
4035
4035
  selectAddressTitle: selectAddressTitle$1,
4036
4036
  selectAddressSubtitle: selectAddressSubtitle$1,
4037
4037
  labels: labels$d,
@@ -4039,7 +4039,7 @@ var address_en = {
4039
4039
  messages: messages$d
4040
4040
  };
4041
4041
 
4042
- var title$c = "Entrez votre adresse de livraison";
4042
+ var title$a = "Entrez votre adresse de livraison";
4043
4043
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4044
4044
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4045
4045
  var labels$c = {
@@ -4062,7 +4062,7 @@ var messages$c = {
4062
4062
  subRedeemed: "Votre abonnement a bien été activé."
4063
4063
  };
4064
4064
  var address_fr = {
4065
- title: title$c,
4065
+ title: title$a,
4066
4066
  selectAddressTitle: selectAddressTitle,
4067
4067
  selectAddressSubtitle: selectAddressSubtitle,
4068
4068
  labels: labels$c,
@@ -4070,8 +4070,8 @@ var address_fr = {
4070
4070
  messages: messages$c
4071
4071
  };
4072
4072
 
4073
- var title$b = "Reset your password";
4074
- var subtitle$5 = "Enter a new password below";
4073
+ var title$9 = "Reset your password";
4074
+ var subtitle$3 = "Enter a new password below";
4075
4075
  var email$3 = "Email";
4076
4076
  var password$3 = "Password";
4077
4077
  var confirmPassword$1 = "Confirm password";
@@ -4079,8 +4079,8 @@ var submit$5 = "Submit";
4079
4079
  var required$5 = "Required";
4080
4080
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4081
4081
  var passwordReset_en = {
4082
- title: title$b,
4083
- subtitle: subtitle$5,
4082
+ title: title$9,
4083
+ subtitle: subtitle$3,
4084
4084
  email: email$3,
4085
4085
  password: password$3,
4086
4086
  confirmPassword: confirmPassword$1,
@@ -4089,8 +4089,8 @@ var passwordReset_en = {
4089
4089
  passwordUpdated: passwordUpdated$1
4090
4090
  };
4091
4091
 
4092
- var title$a = "Réinitialiser votre mot de passe";
4093
- var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4092
+ var title$8 = "Réinitialiser votre mot de passe";
4093
+ var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4094
4094
  var email$2 = "Adresse courriel";
4095
4095
  var password$2 = "Mot de passe";
4096
4096
  var confirmPassword = "Confirmer le mot de passe";
@@ -4098,8 +4098,8 @@ var submit$4 = "Soumettre";
4098
4098
  var required$4 = "Champs obligatoires";
4099
4099
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4100
4100
  var passwordReset_fr = {
4101
- title: title$a,
4102
- subtitle: subtitle$4,
4101
+ title: title$8,
4102
+ subtitle: subtitle$2,
4103
4103
  email: email$2,
4104
4104
  password: password$2,
4105
4105
  confirmPassword: confirmPassword,
@@ -4108,7 +4108,7 @@ var passwordReset_fr = {
4108
4108
  passwordUpdated: passwordUpdated
4109
4109
  };
4110
4110
 
4111
- var title$9 = "Forgot your password?";
4111
+ var title$7 = "Forgot your password?";
4112
4112
  var email$1 = "Email";
4113
4113
  var password$1 = "Password";
4114
4114
  var submit$3 = "Submit";
@@ -4119,7 +4119,7 @@ var messages$b = {
4119
4119
  loginHere: "login here."
4120
4120
  };
4121
4121
  var passwordForgot_en = {
4122
- title: title$9,
4122
+ title: title$7,
4123
4123
  email: email$1,
4124
4124
  password: password$1,
4125
4125
  submit: submit$3,
@@ -4128,7 +4128,7 @@ var passwordForgot_en = {
4128
4128
  messages: messages$b
4129
4129
  };
4130
4130
 
4131
- var title$8 = "Mot de passe oublié ?";
4131
+ var title$6 = "Mot de passe oublié ?";
4132
4132
  var email = "Courriel";
4133
4133
  var password = "Mot de passe";
4134
4134
  var submit$2 = "Soumettre";
@@ -4139,7 +4139,7 @@ var messages$a = {
4139
4139
  loginHere: "Connectez-vous ici"
4140
4140
  };
4141
4141
  var passwordForgot_fr = {
4142
- title: title$8,
4142
+ title: title$6,
4143
4143
  email: email,
4144
4144
  password: password,
4145
4145
  submit: submit$2,
@@ -4148,7 +4148,7 @@ var passwordForgot_fr = {
4148
4148
  messages: messages$a
4149
4149
  };
4150
4150
 
4151
- var title$7 = "Change your password";
4151
+ var title$5 = "Change your password";
4152
4152
  var currentPassword$1 = "Current password";
4153
4153
  var newPassword$1 = "New password";
4154
4154
  var confirmNewPassword$1 = "Confirm new password";
@@ -4158,7 +4158,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4158
4158
  var passwordsNotMatching$1 = "Passwords don't match";
4159
4159
  var weakPassword$1 = "Your password must contain at least 6 characters";
4160
4160
  var passwordChange_en = {
4161
- title: title$7,
4161
+ title: title$5,
4162
4162
  currentPassword: currentPassword$1,
4163
4163
  newPassword: newPassword$1,
4164
4164
  confirmNewPassword: confirmNewPassword$1,
@@ -4169,7 +4169,7 @@ var passwordChange_en = {
4169
4169
  weakPassword: weakPassword$1
4170
4170
  };
4171
4171
 
4172
- var title$6 = "Changez votre mot de passe";
4172
+ var title$4 = "Changez votre mot de passe";
4173
4173
  var currentPassword = "Mot de passe actuel";
4174
4174
  var newPassword = "Nouveau mot de passe";
4175
4175
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4179,7 +4179,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4179
4179
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4180
4180
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4181
4181
  var passwordChange_fr = {
4182
- title: title$6,
4182
+ title: title$4,
4183
4183
  currentPassword: currentPassword,
4184
4184
  newPassword: newPassword,
4185
4185
  confirmNewPassword: confirmNewPassword,
@@ -4190,8 +4190,8 @@ var passwordChange_fr = {
4190
4190
  weakPassword: weakPassword
4191
4191
  };
4192
4192
 
4193
- var title$5 = "Votre panier";
4194
- var subtitle$3 = "Terminez votre achat ci-dessous";
4193
+ var title$3 = "Votre panier";
4194
+ var subtitle$1 = "Terminez votre achat ci-dessous";
4195
4195
  var name$1 = "Produit";
4196
4196
  var quantity$1 = "Quantité";
4197
4197
  var price$1 = "Prix";
@@ -4202,8 +4202,8 @@ var confirm$3 = "Passer à la caisse";
4202
4202
  var empty$1 = "Votre panier est vide.";
4203
4203
  var removeAll$1 = "Vider";
4204
4204
  var cart_fr = {
4205
- title: title$5,
4206
- subtitle: subtitle$3,
4205
+ title: title$3,
4206
+ subtitle: subtitle$1,
4207
4207
  name: name$1,
4208
4208
  quantity: quantity$1,
4209
4209
  price: price$1,
@@ -4215,8 +4215,8 @@ var cart_fr = {
4215
4215
  removeAll: removeAll$1
4216
4216
  };
4217
4217
 
4218
- var title$4 = "Your shopping cart";
4219
- var subtitle$2 = "Comple your purchase below";
4218
+ var title$2 = "Your shopping cart";
4219
+ var subtitle = "Comple your purchase below";
4220
4220
  var name = "Name";
4221
4221
  var quantity = "Quantity";
4222
4222
  var price = "Price";
@@ -4227,8 +4227,8 @@ var confirm$2 = "Checkout";
4227
4227
  var empty = "Your cart is empty.";
4228
4228
  var removeAll = "Remove all";
4229
4229
  var cart_en = {
4230
- title: title$4,
4231
- subtitle: subtitle$2,
4230
+ title: title$2,
4231
+ subtitle: subtitle,
4232
4232
  name: name,
4233
4233
  quantity: quantity,
4234
4234
  price: price,
@@ -4666,7 +4666,7 @@ var verifyEmail_fr = {
4666
4666
  messages: messages
4667
4667
  };
4668
4668
 
4669
- var title$3 = "Invoice details";
4669
+ var title$1 = "Invoice details";
4670
4670
  var labels$1 = {
4671
4671
  summary: "Summary",
4672
4672
  total: "Total",
@@ -4679,55 +4679,29 @@ var buttons$1 = {
4679
4679
  pay: "Pay now"
4680
4680
  };
4681
4681
  var invoiceDetails_en = {
4682
- title: title$3,
4682
+ title: title$1,
4683
4683
  labels: labels$1,
4684
4684
  buttons: buttons$1
4685
4685
  };
4686
4686
 
4687
- var title$2 = "Invoice details";
4687
+ var title = "Détails de la facture";
4688
4688
  var labels = {
4689
- summary: "Summary",
4689
+ summary: "Résumé",
4690
4690
  total: "Total",
4691
- amountPaid: "Amount paid",
4692
- amountDue: "Amount due",
4693
- creationDate: "Created on:"
4691
+ amountPaid: "Montant payé",
4692
+ amountDue: "Montant ",
4693
+ creationDate: "Créé le:"
4694
4694
  };
4695
4695
  var buttons = {
4696
- download: "Download",
4697
- pay: "Pay now"
4696
+ download: "Télécharger",
4697
+ pay: "Payer"
4698
4698
  };
4699
4699
  var invoiceDetails_fr = {
4700
- title: title$2,
4700
+ title: title,
4701
4701
  labels: labels,
4702
4702
  buttons: buttons
4703
4703
  };
4704
4704
 
4705
- var title$1 = "Renewal options";
4706
- var subtitle$1 = "Select one of the options below to continue";
4707
- var next$1 = "Next";
4708
- var addNew$1 = "Add Another Subscription";
4709
- var renew$1 = "Renew Existing Subscription";
4710
- var subscriptionOptions_en = {
4711
- title: title$1,
4712
- subtitle: subtitle$1,
4713
- next: next$1,
4714
- addNew: addNew$1,
4715
- renew: renew$1
4716
- };
4717
-
4718
- var title = "Renewal options";
4719
- var subtitle = "Select one of the options below to continue";
4720
- var next = "Next";
4721
- var addNew = "Add Another Subscription";
4722
- var renew = "Renew Existing Subscription";
4723
- var subscriptionOptions_fr = {
4724
- title: title,
4725
- subtitle: subtitle,
4726
- next: next,
4727
- addNew: addNew,
4728
- renew: renew
4729
- };
4730
-
4731
4705
  function create$1(createState) {
4732
4706
  let state;
4733
4707
  const listeners = new Set();
@@ -6077,7 +6051,7 @@ class PelcroActions {
6077
6051
  view,
6078
6052
  cartItems,
6079
6053
  ...otherStateFields
6080
- } = initialState$j;
6054
+ } = initialState$i;
6081
6055
  this.set(otherStateFields);
6082
6056
  });
6083
6057
 
@@ -6101,16 +6075,6 @@ class PelcroActions {
6101
6075
  });
6102
6076
  }
6103
6077
 
6104
- if (view === "subscription-options") {
6105
- const noRenewableProducts = getRenewableProducts().length === 0;
6106
-
6107
- if (noRenewableProducts) {
6108
- return this.set({
6109
- view: "plan-select"
6110
- });
6111
- }
6112
- }
6113
-
6114
6078
  this.set({
6115
6079
  view
6116
6080
  });
@@ -6185,26 +6149,6 @@ class PelcroActions {
6185
6149
  }
6186
6150
  });
6187
6151
 
6188
- _defineProperty$3(this, "setProductsList", products => {
6189
- if (!Array.isArray(products)) {
6190
- return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6191
- }
6192
-
6193
- const allowedProducts = window.Pelcro.product.list();
6194
- const validProducts = products.filter(product => {
6195
- const isValidProduct = allowedProducts.some(allowedProduct => allowedProduct.id === (product === null || product === void 0 ? void 0 : product.id) && allowedProduct.name === (product === null || product === void 0 ? void 0 : product.name));
6196
-
6197
- if (!isValidProduct) {
6198
- console.warn(`setProductsList expects an array of products that exist in the list of valid products (window.Pelcro.product.list()), but it recieved a product which doesn't exist in that list:`, product);
6199
- }
6200
-
6201
- return isValidProduct;
6202
- });
6203
- this.set({
6204
- productsList: validProducts
6205
- });
6206
- });
6207
-
6208
6152
  _defineProperty$3(this, "setProduct", id => {
6209
6153
  const product = window.Pelcro.product.getById(id);
6210
6154
  if (!product) return console.error("invalid product id");
@@ -6426,12 +6370,10 @@ class PelcroCallbacks {
6426
6370
 
6427
6371
  }
6428
6372
 
6429
- var _window$Pelcro$produc, _window$Pelcro;
6430
- const initialState$j = {
6373
+ const initialState$i = {
6431
6374
  // View
6432
6375
  view: null,
6433
6376
  // Plans
6434
- productsList: (_window$Pelcro$produc = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : _window$Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [],
6435
6377
  product: null,
6436
6378
  plan: null,
6437
6379
  isGift: false,
@@ -6458,7 +6400,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6458
6400
  return {
6459
6401
  // Store setter
6460
6402
  set,
6461
- ...initialState$j,
6403
+ ...initialState$i,
6462
6404
  // State actions
6463
6405
  ...actions,
6464
6406
  // Callbacks
@@ -6813,30 +6755,6 @@ function userMustVerifyEmail() {
6813
6755
  const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
6814
6756
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6815
6757
  }
6816
- function getRenewableProducts() {
6817
- var _window$Pelcro$subscr, _window$Pelcro$subscr2;
6818
-
6819
- const renewableSubs = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription.list()) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : _window$Pelcro$subscr2.filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
6820
- const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6821
- const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6822
- const {
6823
- productsList
6824
- } = usePelcro.getStore();
6825
- return productsList.map(product => {
6826
- if (renewableProductsIds.includes(product.id)) {
6827
- const renewablePlans = getRenewablePlansOnly(product);
6828
- return { ...product,
6829
- plans: renewablePlans
6830
- };
6831
- }
6832
- }).filter(product => product);
6833
-
6834
- function getRenewablePlansOnly(product) {
6835
- var _product$plans$filter, _product$plans;
6836
-
6837
- return (_product$plans$filter = product === null || product === void 0 ? void 0 : (_product$plans = product.plans) === null || _product$plans === void 0 ? void 0 : _product$plans.filter(plan => renewablePlansIds.includes(plan.id))) !== null && _product$plans$filter !== void 0 ? _product$plans$filter : [];
6838
- }
6839
- }
6840
6758
 
6841
6759
  const resources = {
6842
6760
  en: {
@@ -6861,8 +6779,7 @@ const resources = {
6861
6779
  dashboard: dashboard_en,
6862
6780
  select: select_en,
6863
6781
  notification: notification_en,
6864
- invoiceDetails: invoiceDetails_en,
6865
- subscriptionOptions: subscriptionOptions_en
6782
+ invoiceDetails: invoiceDetails_en
6866
6783
  },
6867
6784
  fr: {
6868
6785
  common: common_fr,
@@ -6886,8 +6803,7 @@ const resources = {
6886
6803
  dashboard: dashboard_fr,
6887
6804
  select: select_fr,
6888
6805
  notification: notification_fr,
6889
- invoiceDetails: invoiceDetails_fr,
6890
- subscriptionOptions: subscriptionOptions_fr
6806
+ invoiceDetails: invoiceDetails_fr
6891
6807
  }
6892
6808
  }; // set UI language to the page language or default to the language in site settings
6893
6809
 
@@ -7178,8 +7094,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7178
7094
 
7179
7095
  let e={data:""},t=t=>"undefined"!=typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,n=(e,t)=>{let r,l="",a="",o="";for(let c in e){let s=e[c];"object"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):c,a+="@"==c[0]?"f"==c[1]?n(s,c):c+"{"+n(s,"k"==c[1]?"":t)+"}":n(s,r)):"@"==c[0]&&"i"==c[1]?l=c+" "+s+";":(c=c.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=n.p?n.p(c,s):c+":"+s+";");}return o[0]?(r=t?t+"{"+o+"}":o,l+r+a):l+a},o={},c=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p="object"==typeof e?c(e):e,u=o[p]||(o[p]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(p));if(!o[u]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{["@keyframes "+u]:t}:t,r?"":"."+u);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":n(e,""):e;}return e+l+(null==o?"":o)},"");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,f,d;p.bind({g:1});let b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,f=r,d=l;}function y(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=p.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=c.as||e;return d&&i[0]&&d(c),u(i,c)}return t?t(a):a}}
7180
7096
 
7181
- function _extends$A() {
7182
- _extends$A = Object.assign || function (target) {
7097
+ function _extends$z() {
7098
+ _extends$z = Object.assign || function (target) {
7183
7099
  for (var i = 1; i < arguments.length; i++) {
7184
7100
  var source = arguments[i];
7185
7101
 
@@ -7193,7 +7109,7 @@ function _extends$A() {
7193
7109
  return target;
7194
7110
  };
7195
7111
 
7196
- return _extends$A.apply(this, arguments);
7112
+ return _extends$z.apply(this, arguments);
7197
7113
  }
7198
7114
 
7199
7115
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7283,7 +7199,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7283
7199
  var reducer = function reducer(state, action) {
7284
7200
  switch (action.type) {
7285
7201
  case ActionType.ADD_TOAST:
7286
- return _extends$A({}, state, {
7202
+ return _extends$z({}, state, {
7287
7203
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7288
7204
  });
7289
7205
 
@@ -7293,9 +7209,9 @@ var reducer = function reducer(state, action) {
7293
7209
  clearFromRemoveQueue(action.toast.id);
7294
7210
  }
7295
7211
 
7296
- return _extends$A({}, state, {
7212
+ return _extends$z({}, state, {
7297
7213
  toasts: state.toasts.map(function (t) {
7298
- return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7214
+ return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7299
7215
  })
7300
7216
  });
7301
7217
 
@@ -7322,9 +7238,9 @@ var reducer = function reducer(state, action) {
7322
7238
  });
7323
7239
  }
7324
7240
 
7325
- return _extends$A({}, state, {
7241
+ return _extends$z({}, state, {
7326
7242
  toasts: state.toasts.map(function (t) {
7327
- return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7243
+ return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7328
7244
  visible: false
7329
7245
  }) : t;
7330
7246
  })
@@ -7332,28 +7248,28 @@ var reducer = function reducer(state, action) {
7332
7248
 
7333
7249
  case ActionType.REMOVE_TOAST:
7334
7250
  if (action.toastId === undefined) {
7335
- return _extends$A({}, state, {
7251
+ return _extends$z({}, state, {
7336
7252
  toasts: []
7337
7253
  });
7338
7254
  }
7339
7255
 
7340
- return _extends$A({}, state, {
7256
+ return _extends$z({}, state, {
7341
7257
  toasts: state.toasts.filter(function (t) {
7342
7258
  return t.id !== action.toastId;
7343
7259
  })
7344
7260
  });
7345
7261
 
7346
7262
  case ActionType.START_PAUSE:
7347
- return _extends$A({}, state, {
7263
+ return _extends$z({}, state, {
7348
7264
  pausedAt: action.time
7349
7265
  });
7350
7266
 
7351
7267
  case ActionType.END_PAUSE:
7352
7268
  var diff = action.time - (state.pausedAt || 0);
7353
- return _extends$A({}, state, {
7269
+ return _extends$z({}, state, {
7354
7270
  pausedAt: undefined,
7355
7271
  toasts: state.toasts.map(function (t) {
7356
- return _extends$A({}, t, {
7272
+ return _extends$z({}, t, {
7357
7273
  pauseDuration: t.pauseDuration + diff
7358
7274
  });
7359
7275
  })
@@ -7400,12 +7316,12 @@ var useStore = function useStore(toastOptions) {
7400
7316
  var mergedToasts = state.toasts.map(function (t) {
7401
7317
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7402
7318
 
7403
- return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7319
+ return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7404
7320
  duration: t.duration || ((_toastOptions$t$type = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type.duration) || ((_toastOptions = toastOptions) == null ? void 0 : _toastOptions.duration) || defaultTimeouts[t.type],
7405
- style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7321
+ style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7406
7322
  });
7407
7323
  });
7408
- return _extends$A({}, state, {
7324
+ return _extends$z({}, state, {
7409
7325
  toasts: mergedToasts
7410
7326
  });
7411
7327
  };
@@ -7415,7 +7331,7 @@ var createToast = function createToast(message, type, opts) {
7415
7331
  type = 'blank';
7416
7332
  }
7417
7333
 
7418
- return _extends$A({
7334
+ return _extends$z({
7419
7335
  createdAt: Date.now(),
7420
7336
  visible: true,
7421
7337
  type: type,
@@ -7465,14 +7381,14 @@ toast.remove = function (toastId) {
7465
7381
  };
7466
7382
 
7467
7383
  toast.promise = function (promise, msgs, opts) {
7468
- var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7384
+ var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7469
7385
  promise.then(function (p) {
7470
- toast.success(resolveValue(msgs.success, p), _extends$A({
7386
+ toast.success(resolveValue(msgs.success, p), _extends$z({
7471
7387
  id: id
7472
7388
  }, opts, opts == null ? void 0 : opts.success));
7473
7389
  return p;
7474
7390
  })["catch"](function (e) {
7475
- toast.error(resolveValue(msgs.error, e), _extends$A({
7391
+ toast.error(resolveValue(msgs.error, e), _extends$z({
7476
7392
  id: id
7477
7393
  }, opts, opts == null ? void 0 : opts.error));
7478
7394
  });
@@ -7811,7 +7727,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7811
7727
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7812
7728
  return React.createElement(ToastBarBase, {
7813
7729
  className: toast.className,
7814
- style: _extends$A({}, animationStyle, style, toast.style)
7730
+ style: _extends$z({}, animationStyle, style, toast.style)
7815
7731
  }, typeof children === 'function' ? children({
7816
7732
  icon: icon,
7817
7733
  message: message
@@ -7841,7 +7757,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7841
7757
  } : position.includes('right') ? {
7842
7758
  justifyContent: 'flex-end'
7843
7759
  } : {};
7844
- return _extends$A({
7760
+ return _extends$z({
7845
7761
  left: 0,
7846
7762
  right: 0,
7847
7763
  display: 'flex',
@@ -7868,7 +7784,7 @@ var Toaster = function Toaster(_ref) {
7868
7784
  handlers = _useToaster.handlers;
7869
7785
 
7870
7786
  return React.createElement("div", {
7871
- style: _extends$A({
7787
+ style: _extends$z({
7872
7788
  position: 'fixed',
7873
7789
  zIndex: 9999,
7874
7790
  top: DEFAULT_OFFSET,
@@ -7903,82 +7819,82 @@ var Toaster = function Toaster(_ref) {
7903
7819
  }));
7904
7820
  };
7905
7821
 
7906
- var _path$x;
7822
+ var _path$w;
7907
7823
 
7908
- function _extends$z() { _extends$z = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
7824
+ function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7909
7825
 
7910
7826
  function SvgCheckSolid(props) {
7911
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
7827
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7912
7828
  xmlns: "http://www.w3.org/2000/svg",
7913
7829
  className: "h-5 w-5",
7914
7830
  viewBox: "0 0 20 20",
7915
7831
  fill: "currentColor"
7916
- }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
7832
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7917
7833
  fillRule: "evenodd",
7918
7834
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
7919
7835
  clipRule: "evenodd"
7920
7836
  })));
7921
7837
  }
7922
7838
 
7923
- var _path$w;
7839
+ var _path$v;
7924
7840
 
7925
- function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7841
+ function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7926
7842
 
7927
7843
  function SvgXIcon(props) {
7928
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7844
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7929
7845
  xmlns: "http://www.w3.org/2000/svg",
7930
7846
  viewBox: "0 0 20 20",
7931
7847
  fill: "currentColor"
7932
- }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7848
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7933
7849
  fill: "evenodd",
7934
7850
  d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
7935
7851
  clipRule: "evenodd"
7936
7852
  })));
7937
7853
  }
7938
7854
 
7939
- var _path$v;
7855
+ var _path$u;
7940
7856
 
7941
- function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7857
+ function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7942
7858
 
7943
7859
  function SvgXIconSolid(props) {
7944
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7860
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7945
7861
  className: "plc-w-4 plc-h-4",
7946
7862
  fill: "currentColor",
7947
7863
  xmlns: "http://www.w3.org/2000/svg",
7948
7864
  viewBox: "0 0 100 100"
7949
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7865
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7950
7866
  d: "M94.842 48.408c0 24.852-20.148 44.999-45.002 44.999-24.851 0-44.997-20.146-44.997-44.999 0-24.854 20.146-45 44.997-45 24.853 0 45.002 20.146 45.002 45zM71.073 64.841L54.73 48.497l16.344-16.344-4.979-4.979-16.343 16.345-16.343-16.344-4.799 4.799 16.344 16.344L28.61 64.661l4.979 4.978 16.344-16.344 16.343 16.344 4.797-4.798z"
7951
7867
  })));
7952
7868
  }
7953
7869
 
7954
- var _path$u;
7870
+ var _path$t;
7955
7871
 
7956
- function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7872
+ function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7957
7873
 
7958
7874
  function SvgExclamation(props) {
7959
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7875
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7960
7876
  className: "plc-w-4 plc-h-4 plc-mr-1",
7961
7877
  xmlns: "http://www.w3.org/2000/svg",
7962
7878
  viewBox: "0 0 20 20",
7963
7879
  fill: "currentColor"
7964
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7880
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7965
7881
  fillRule: "evenodd",
7966
7882
  d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
7967
7883
  clipRule: "evenodd"
7968
7884
  })));
7969
7885
  }
7970
7886
 
7971
- var _path$t, _path2$4;
7887
+ var _path$s, _path2$4;
7972
7888
 
7973
- function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7889
+ function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
7974
7890
 
7975
7891
  function SvgSpinner(props) {
7976
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7892
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7977
7893
  className: "plc-animate-spin",
7978
7894
  viewBox: "0 0 24 24",
7979
7895
  fill: "currentColor",
7980
7896
  xmlns: "http://www.w3.org/2000/svg"
7981
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7897
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7982
7898
  opacity: 0.2,
7983
7899
  fill: "evenodd",
7984
7900
  clipRule: "evenodd",
@@ -8268,9 +8184,7 @@ const init$1 = () => {
8268
8184
  return switchToAddressView();
8269
8185
  });
8270
8186
  } else {
8271
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8272
- return switchView("subscription-options");
8273
- });
8187
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8274
8188
  }
8275
8189
  }
8276
8190
  }
@@ -8432,8 +8346,7 @@ function Link({
8432
8346
  const init = () => {
8433
8347
  const {
8434
8348
  switchView,
8435
- set,
8436
- setProductsList
8349
+ set
8437
8350
  } = usePelcro.getStore();
8438
8351
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8439
8352
 
@@ -8484,8 +8397,7 @@ const init = () => {
8484
8397
  }
8485
8398
 
8486
8399
  notify.dismiss(NOTIFICATION_ID);
8487
- setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8488
- switchView("plan-select");
8400
+ switchView("_plan-select-entitlements");
8489
8401
  }
8490
8402
  }, "Subscribe"), "now to get full page access.")), {
8491
8403
  className: "pelcro-notification-entitlement",
@@ -8737,6 +8649,10 @@ const getErrorMessages = error => {
8737
8649
  return error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.error) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2.message;
8738
8650
  }
8739
8651
 
8652
+ if (error !== null && error !== void 0 && error.message) {
8653
+ return error.message;
8654
+ }
8655
+
8740
8656
  const errorMessages = []; // enumerable error (ex: validation errors)
8741
8657
 
8742
8658
  Object.values(error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : (_error$response5$data = _error$response5.data) === null || _error$response5$data === void 0 ? void 0 : _error$response5$data.errors).forEach(([errorMessage]) => {
@@ -8775,7 +8691,7 @@ const debounce = (func, waitTime) => {
8775
8691
  function getSiteCardProcessor() {
8776
8692
  var _window$Pelcro$site$r;
8777
8693
 
8778
- if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_pay_page_id) {
8694
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_gateway_settings) {
8779
8695
  return "vantiv";
8780
8696
  }
8781
8697
 
@@ -9316,7 +9232,7 @@ const PelcroModalController = ({
9316
9232
  type
9317
9233
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9318
9234
  type
9319
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9235
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9320
9236
  type
9321
9237
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9322
9238
  type
@@ -9597,10 +9513,8 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9597
9513
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9598
9514
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9599
9515
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9600
- const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9601
- const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9602
9516
 
9603
- const initialState$i = {
9517
+ const initialState$h = {
9604
9518
  email: "",
9605
9519
  password: "",
9606
9520
  emailError: null,
@@ -9611,10 +9525,10 @@ const initialState$i = {
9611
9525
  content: ""
9612
9526
  }
9613
9527
  };
9614
- const store$i = /*#__PURE__*/React.createContext(initialState$i);
9528
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9615
9529
  const {
9616
- Provider: Provider$i
9617
- } = store$i;
9530
+ Provider: Provider$h
9531
+ } = store$h;
9618
9532
 
9619
9533
  const LoginContainer = ({
9620
9534
  style,
@@ -9721,7 +9635,7 @@ const LoginContainer = ({
9721
9635
  });
9722
9636
 
9723
9637
  case RESET_LOGIN_FORM:
9724
- return initialState$i;
9638
+ return initialState$h;
9725
9639
 
9726
9640
  case DISABLE_LOGIN_BUTTON:
9727
9641
  return lib_7({ ...state,
@@ -9739,12 +9653,12 @@ const LoginContainer = ({
9739
9653
  default:
9740
9654
  return state;
9741
9655
  }
9742
- }, initialState$i);
9656
+ }, initialState$h);
9743
9657
  return /*#__PURE__*/React__default['default'].createElement("div", {
9744
9658
  style: { ...style
9745
9659
  },
9746
9660
  className: `pelcro-container pelcro-login-container ${className}`
9747
- }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9661
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9748
9662
  value: {
9749
9663
  state,
9750
9664
  dispatch
@@ -9752,12 +9666,12 @@ const LoginContainer = ({
9752
9666
  }, children.length ? children.map((child, i) => {
9753
9667
  if (child) {
9754
9668
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9755
- store: store$i,
9669
+ store: store$h,
9756
9670
  key: i
9757
9671
  });
9758
9672
  }
9759
9673
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9760
- store: store$i
9674
+ store: store$h
9761
9675
  })));
9762
9676
  };
9763
9677
 
@@ -10002,7 +9916,7 @@ const LoginButton = ({
10002
9916
  buttonDisabled
10003
9917
  },
10004
9918
  dispatch
10005
- } = React.useContext(store$i);
9919
+ } = React.useContext(store$h);
10006
9920
  const {
10007
9921
  t
10008
9922
  } = useTranslation("login");
@@ -10023,23 +9937,23 @@ const LoginButton = ({
10023
9937
  };
10024
9938
 
10025
9939
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10026
- store: store$i
9940
+ store: store$h
10027
9941
  }, props));
10028
9942
 
10029
9943
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10030
- store: store$i
9944
+ store: store$h
10031
9945
  }, props));
10032
9946
 
10033
- var _path$s;
9947
+ var _path$r;
10034
9948
 
10035
- function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
9949
+ function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
10036
9950
 
10037
9951
  function SvgCheck(props) {
10038
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9952
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10039
9953
  xmlns: "http://www.w3.org/2000/svg",
10040
9954
  fill: "currentColor",
10041
9955
  viewBox: "0 0 20 20"
10042
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9956
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10043
9957
  fillRule: "evenodd",
10044
9958
  d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
10045
9959
  clipRule: "evenodd"
@@ -10104,7 +10018,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
10104
10018
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
10105
10019
  facebookLoginRenderProps.FacebookLogin;
10106
10020
 
10107
- const initialState$h = {
10021
+ const initialState$g = {
10108
10022
  email: "",
10109
10023
  password: "",
10110
10024
  emailError: null,
@@ -10121,10 +10035,10 @@ const initialState$h = {
10121
10035
  content: ""
10122
10036
  }
10123
10037
  };
10124
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
10038
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
10125
10039
  const {
10126
- Provider: Provider$h
10127
- } = store$h;
10040
+ Provider: Provider$g
10041
+ } = store$g;
10128
10042
 
10129
10043
  const RegisterContainer = ({
10130
10044
  style,
@@ -10307,7 +10221,7 @@ const RegisterContainer = ({
10307
10221
  });
10308
10222
 
10309
10223
  case RESET_LOGIN_FORM:
10310
- return initialState$h;
10224
+ return initialState$g;
10311
10225
 
10312
10226
  case DISABLE_REGISTRATION_BUTTON:
10313
10227
  return lib_7({ ...state,
@@ -10325,12 +10239,12 @@ const RegisterContainer = ({
10325
10239
  default:
10326
10240
  return state;
10327
10241
  }
10328
- }, initialState$h);
10242
+ }, initialState$g);
10329
10243
  return /*#__PURE__*/React__default['default'].createElement("div", {
10330
10244
  style: { ...style
10331
10245
  },
10332
10246
  className: `pelcro-container pelcro-register-container ${className}`
10333
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10247
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10334
10248
  value: {
10335
10249
  state,
10336
10250
  dispatch
@@ -10338,12 +10252,12 @@ const RegisterContainer = ({
10338
10252
  }, children.length ? children.map((child, i) => {
10339
10253
  if (child) {
10340
10254
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10341
- store: store$h,
10255
+ store: store$g,
10342
10256
  key: i
10343
10257
  });
10344
10258
  }
10345
10259
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10346
- store: store$h
10260
+ store: store$g
10347
10261
  })));
10348
10262
  };
10349
10263
  /**
@@ -10358,15 +10272,15 @@ function hasSecurityTokenEnabled$1() {
10358
10272
  return hasSecuritySdkLoaded;
10359
10273
  }
10360
10274
 
10361
- var _path$r;
10275
+ var _path$q;
10362
10276
 
10363
- function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
10277
+ function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
10364
10278
 
10365
10279
  function SvgFacebookLogo(props) {
10366
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10280
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10367
10281
  xmlns: "http://www.w3.org/2000/svg",
10368
10282
  viewBox: "88.428 12.828 107.543 207.085"
10369
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10283
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10370
10284
  d: "M158.232 219.912v-94.461h31.707l4.747-36.813h-36.454V65.134c0-10.658 2.96-17.922 18.245-17.922l19.494-.009V14.278c-3.373-.447-14.944-1.449-28.406-1.449-28.106 0-47.348 17.155-47.348 48.661v27.149H88.428v36.813h31.788v94.461l38.016-.001z",
10371
10285
  fill: "#3c5a9a"
10372
10286
  })));
@@ -10383,10 +10297,10 @@ const FacebookLoginButton = ({
10383
10297
  const facebookLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id;
10384
10298
  const {
10385
10299
  dispatch: loginDispatch
10386
- } = React.useContext(store$i);
10300
+ } = React.useContext(store$h);
10387
10301
  const {
10388
10302
  dispatch: registerDispatch
10389
- } = React.useContext(store$h);
10303
+ } = React.useContext(store$g);
10390
10304
 
10391
10305
  const onSuccess = facebookUser => {
10392
10306
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10439,15 +10353,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10439
10353
  unwrapExports(googleLogin);
10440
10354
  var googleLogin_1 = googleLogin.GoogleLogin;
10441
10355
 
10442
- var _path$q, _path2$3, _path3$1, _path4;
10356
+ var _path$p, _path2$3, _path3$1, _path4;
10443
10357
 
10444
- function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
10358
+ function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10445
10359
 
10446
10360
  function SvgGoogleLogo(props) {
10447
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10361
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10448
10362
  viewBox: "0 0 24 24",
10449
10363
  xmlns: "http://www.w3.org/2000/svg"
10450
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10364
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10451
10365
  fill: "#4285F4",
10452
10366
  d: "M23.745 12.27c0-.79-.07-1.54-.19-2.27h-11.3v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"
10453
10367
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10473,10 +10387,10 @@ const GoogleLoginButton = ({
10473
10387
  const googleLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.google_app_id;
10474
10388
  const {
10475
10389
  dispatch: loginDispatch
10476
- } = React.useContext(store$i);
10390
+ } = React.useContext(store$h);
10477
10391
  const {
10478
10392
  dispatch: registerDispatch
10479
- } = React.useContext(store$h);
10393
+ } = React.useContext(store$g);
10480
10394
 
10481
10395
  const onSuccess = response => {
10482
10396
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10524,15 +10438,15 @@ const GoogleLoginButton = ({
10524
10438
  }) : null;
10525
10439
  };
10526
10440
 
10527
- var _path$p;
10441
+ var _path$o;
10528
10442
 
10529
- function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10443
+ function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10530
10444
 
10531
10445
  function SvgAuth0Logo(props) {
10532
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10446
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10533
10447
  viewBox: "0 0 256 285",
10534
10448
  xmlns: "http://www.w3.org/2000/svg"
10535
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10449
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10536
10450
  d: "M220.412 0h-92.415l28.562 89.006h92.416l-74.77 53.077 28.57 89.511c48.128-35.06 63.854-88.12 46.208-142.588L220.413 0zM7.018 89.006h92.416L127.997 0H35.589L7.019 89.006c-17.655 54.468-1.92 107.529 46.207 142.588l28.563-89.51-74.77-53.078zm46.208 142.588l74.77 52.97 74.77-52.97-74.77-53.847-74.77 53.847z"
10537
10451
  })));
10538
10452
  }
@@ -10572,10 +10486,10 @@ const Auth0LoginButton = ({
10572
10486
  }, [auth0Enabled, auth0Loaded]);
10573
10487
  const {
10574
10488
  dispatch: loginDispatch
10575
- } = React.useContext(store$i);
10489
+ } = React.useContext(store$h);
10576
10490
  const {
10577
10491
  dispatch: registerDispatch
10578
- } = React.useContext(store$h);
10492
+ } = React.useContext(store$g);
10579
10493
 
10580
10494
  function handleClick() {
10581
10495
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10708,15 +10622,15 @@ function LoginView(props) {
10708
10622
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10709
10623
  }
10710
10624
 
10711
- var _path$o, _path2$2, _path3;
10625
+ var _path$n, _path2$2, _path3;
10712
10626
 
10713
- function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10627
+ function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
10714
10628
 
10715
10629
  function SvgPelcroAuthorship(props) {
10716
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10630
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10717
10631
  xmlns: "http://www.w3.org/2000/svg",
10718
10632
  viewBox: "0 -80.652 497.072 179.991"
10719
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10633
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10720
10634
  fill: "none",
10721
10635
  stroke: "#4a4a4a",
10722
10636
  d: "M487.89 42.299c0 13.158-10.671 23.829-23.829 23.829H37.074c-13.162 0-23.832-10.671-23.832-23.829v-63.552c0-13.158 10.67-23.831 23.832-23.831H464.06c13.158 0 23.829 10.672 23.829 23.831l.001 63.552z"
@@ -10863,11 +10777,11 @@ function LoginModal({
10863
10777
  LoginModal.viewId = "login";
10864
10778
 
10865
10779
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10866
- store: store$h
10780
+ store: store$g
10867
10781
  }, props));
10868
10782
 
10869
10783
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10870
- store: store$h
10784
+ store: store$g
10871
10785
  }, props));
10872
10786
 
10873
10787
  const RegisterButton = ({
@@ -10887,7 +10801,7 @@ const RegisterButton = ({
10887
10801
  buttonDisabled
10888
10802
  },
10889
10803
  dispatch
10890
- } = React.useContext(store$h);
10804
+ } = React.useContext(store$g);
10891
10805
  const {
10892
10806
  t
10893
10807
  } = useTranslation("register");
@@ -11025,7 +10939,7 @@ function FirstName({
11025
10939
  }
11026
10940
 
11027
10941
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
11028
- store: store$h
10942
+ store: store$g
11029
10943
  }, props));
11030
10944
 
11031
10945
  function LastName({
@@ -11056,7 +10970,7 @@ function LastName({
11056
10970
  }
11057
10971
 
11058
10972
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
11059
- store: store$h
10973
+ store: store$g
11060
10974
  }, props));
11061
10975
 
11062
10976
  /**
@@ -11180,7 +11094,7 @@ function TextInput({
11180
11094
 
11181
11095
  const RegisterTextInput = props => {
11182
11096
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11183
- store: store$h
11097
+ store: store$g
11184
11098
  }));
11185
11099
  };
11186
11100
 
@@ -11327,7 +11241,6 @@ function SelectModalWithHook(props) {
11327
11241
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11328
11242
  }, []);
11329
11243
  const {
11330
- productsList,
11331
11244
  isGift,
11332
11245
  plan,
11333
11246
  product,
@@ -11337,12 +11250,11 @@ function SelectModalWithHook(props) {
11337
11250
  view,
11338
11251
  set
11339
11252
  } = usePelcro();
11340
- const isRenewingSub = view === "_plan-select-renew";
11253
+ const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11254
+ const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11341
11255
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11342
- productsList: productsList,
11343
11256
  isGift: isGift,
11344
- disableGifting: isRenewingGift || isRenewingSub,
11345
- isRenewingSub: isRenewingSub,
11257
+ disableGifting: isRenewingGift,
11346
11258
  plan: plan,
11347
11259
  product: product,
11348
11260
  onClose: () => {
@@ -11356,10 +11268,8 @@ function SelectModalWithHook(props) {
11356
11268
  plan,
11357
11269
  isGift
11358
11270
  }),
11359
- setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11360
- subscriptionIdToRenew
11361
- }),
11362
- setView: switchView
11271
+ setView: switchView,
11272
+ matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11363
11273
  });
11364
11274
  }
11365
11275
  SelectModalWithHook.viewId = "plan-select";
@@ -11391,10 +11301,10 @@ class SelectModal extends React.Component {
11391
11301
  });
11392
11302
  }
11393
11303
 
11394
- if (this.props.productsList.length === 1) {
11304
+ if (this.state.productList.length === 1) {
11395
11305
  this.setState({
11396
- product: this.props.productsList[0],
11397
- planList: this.props.productsList[0].plans,
11306
+ product: this.state.productList[0],
11307
+ planList: this.state.productList[0].plans,
11398
11308
  mode: "plan"
11399
11309
  });
11400
11310
  }
@@ -11411,7 +11321,7 @@ class SelectModal extends React.Component {
11411
11321
  });
11412
11322
 
11413
11323
  _defineProperty$3(this, "onProductChange", e => {
11414
- const product = productsList[e.target.selectedIndex];
11324
+ const product = window.Pelcro.product.list()[e.target.selectedIndex];
11415
11325
  this.setState({
11416
11326
  product: product,
11417
11327
  plan: product.plans[0]
@@ -11477,7 +11387,7 @@ class SelectModal extends React.Component {
11477
11387
 
11478
11388
  _defineProperty$3(this, "renderProducts", () => {
11479
11389
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11480
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11390
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11481
11391
  return productsToShow.map((product, index) => {
11482
11392
  return this.renderOneProduct(product, index);
11483
11393
  });
@@ -11490,7 +11400,7 @@ class SelectModal extends React.Component {
11490
11400
  return this.renderOneProduct(this.state.product);
11491
11401
  }
11492
11402
 
11493
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11403
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11494
11404
 
11495
11405
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11496
11406
  return this.renderProducts();
@@ -11506,7 +11416,10 @@ class SelectModal extends React.Component {
11506
11416
  className: "plc-text-sm plc-font-semibold"
11507
11417
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11508
11418
 
11509
- function productsWithMatchedTaggedFirst(allProducts) {
11419
+ function productsWithMatchedTaggedFirst() {
11420
+ var _window$Pelcro$produc;
11421
+
11422
+ const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11510
11423
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11511
11424
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11512
11425
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11540,7 +11453,7 @@ class SelectModal extends React.Component {
11540
11453
  _defineProperty$3(this, "selectProduct", e => {
11541
11454
  const id = e.target.dataset.key;
11542
11455
 
11543
- for (const product of this.props.productsList) {
11456
+ for (const product of this.state.productList) {
11544
11457
  if (+product.id === +id) {
11545
11458
  var _this$state$plan;
11546
11459
 
@@ -11593,14 +11506,6 @@ class SelectModal extends React.Component {
11593
11506
 
11594
11507
  _defineProperty$3(this, "submitOption", () => {
11595
11508
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11596
-
11597
- if (this.props.isRenewingSub) {
11598
- var _matchingSub$id;
11599
-
11600
- const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11601
- this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11602
- }
11603
-
11604
11509
  const {
11605
11510
  product,
11606
11511
  isGift
@@ -11638,7 +11543,8 @@ class SelectModal extends React.Component {
11638
11543
  plan: {},
11639
11544
  isGift: props.isGift,
11640
11545
  disabled: true,
11641
- mode: "product"
11546
+ mode: "product",
11547
+ productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11642
11548
  };
11643
11549
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11644
11550
  this.locale = this.props.t;
@@ -11646,7 +11552,7 @@ class SelectModal extends React.Component {
11646
11552
  }
11647
11553
 
11648
11554
  render() {
11649
- var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11555
+ var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11650
11556
 
11651
11557
  const {
11652
11558
  disableGifting
@@ -11680,7 +11586,7 @@ class SelectModal extends React.Component {
11680
11586
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11681
11587
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11682
11588
  className: "plc-text-2xl plc-font-semibold"
11683
- }, this.product && this.product.paywall.select_title || ((_this$props$productsL = this.props.productsList[0]) === null || _this$props$productsL === void 0 ? void 0 : _this$props$productsL.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_this$props$productsL2 = this.props.productsList[0]) === null || _this$props$productsL2 === void 0 ? void 0 : _this$props$productsL2.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11589
+ }, 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", {
11684
11590
  className: "pelcro-select-products-wrapper"
11685
11591
  }, (_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", {
11686
11592
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -13532,7 +13438,7 @@ class VantivGateway {
13532
13438
 
13533
13439
  /** @type {PaymentStateType} */
13534
13440
 
13535
- const initialState$g = {
13441
+ const initialState$f = {
13536
13442
  disableSubmit: false,
13537
13443
  isLoading: false,
13538
13444
  disableCouponButton: false,
@@ -13551,10 +13457,10 @@ const initialState$g = {
13551
13457
  content: ""
13552
13458
  }
13553
13459
  };
13554
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
13460
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
13555
13461
  const {
13556
- Provider: Provider$g
13557
- } = store$g;
13462
+ Provider: Provider$f
13463
+ } = store$f;
13558
13464
 
13559
13465
  const PaymentMethodContainerWithoutStripe = ({
13560
13466
  style,
@@ -13600,8 +13506,11 @@ const PaymentMethodContainerWithoutStripe = ({
13600
13506
  updateTotalAmountWithTax();
13601
13507
  }, []);
13602
13508
 
13603
- const submitVantivPayment = () => {
13604
- if (selectedPaymentMethodId) {
13509
+ const submitUsingVantiv = () => {
13510
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13511
+
13512
+ if (isUsingExistingPaymentMethod) {
13513
+ // no need to create a new source using vantiv
13605
13514
  return handleVantivPayment(null);
13606
13515
  }
13607
13516
 
@@ -13609,7 +13518,10 @@ const PaymentMethodContainerWithoutStripe = ({
13609
13518
  return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13610
13519
  }
13611
13520
 
13612
- const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13521
+ const orderId = `pelcro-${new Date().getTime()}`;
13522
+ /*
13523
+ calls handleVantivPayment to either handle a payment or update a source by simply creating a new source
13524
+ */
13613
13525
 
13614
13526
  vantivInstanceRef.current.getPaypageRegistrationId({
13615
13527
  id: orderId,
@@ -13636,6 +13548,45 @@ const PaymentMethodContainerWithoutStripe = ({
13636
13548
  purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13637
13549
  } else if (type === "invoicePayment") {
13638
13550
  payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13551
+ } else if (type === "updatePaymentSource") {
13552
+ createNewVantivCard();
13553
+ }
13554
+
13555
+ function createNewVantivCard() {
13556
+ window.Pelcro.source.create({
13557
+ auth_token: window.Pelcro.user.read().auth_token,
13558
+ token: paymentRequest,
13559
+ gateway: "vantiv"
13560
+ }, (err, res) => {
13561
+ dispatch({
13562
+ type: DISABLE_SUBMIT,
13563
+ payload: false
13564
+ });
13565
+ dispatch({
13566
+ type: LOADING,
13567
+ payload: false
13568
+ });
13569
+
13570
+ if (err) {
13571
+ onFailure(err);
13572
+ return dispatch({
13573
+ type: SHOW_ALERT,
13574
+ payload: {
13575
+ type: "error",
13576
+ content: getErrorMessages(err)
13577
+ }
13578
+ });
13579
+ }
13580
+
13581
+ dispatch({
13582
+ type: SHOW_ALERT,
13583
+ payload: {
13584
+ type: "success",
13585
+ content: t("messages.sourceUpdated")
13586
+ }
13587
+ });
13588
+ onSuccess(res);
13589
+ });
13639
13590
  }
13640
13591
 
13641
13592
  function handleVantivSubscription() {
@@ -14357,7 +14308,9 @@ const PaymentMethodContainerWithoutStripe = ({
14357
14308
 
14358
14309
  if ((source === null || source === void 0 ? void 0 : (_source$card2 = source.card) === null || _source$card2 === void 0 ? void 0 : _source$card2.three_d_secure) === "required") {
14359
14310
  return handlePaymentError({
14360
- message: t("messages.cardAuthNotSupported")
14311
+ error: {
14312
+ message: t("messages.cardAuthNotSupported")
14313
+ }
14361
14314
  });
14362
14315
  }
14363
14316
 
@@ -14602,7 +14555,9 @@ const PaymentMethodContainerWithoutStripe = ({
14602
14555
 
14603
14556
  if ((source === null || source === void 0 ? void 0 : source.status) === "failed") {
14604
14557
  return handlePaymentError({
14605
- message: t("messages.cardAuthFailed")
14558
+ error: {
14559
+ message: t("messages.cardAuthFailed")
14560
+ }
14606
14561
  });
14607
14562
  }
14608
14563
 
@@ -14674,7 +14629,7 @@ const PaymentMethodContainerWithoutStripe = ({
14674
14629
  isLoading: true
14675
14630
  }, (state, dispatch) => {
14676
14631
  if (getSiteCardProcessor() === "vantiv") {
14677
- return submitVantivPayment();
14632
+ return submitUsingVantiv();
14678
14633
  }
14679
14634
 
14680
14635
  if (selectedPaymentMethodId) {
@@ -14757,21 +14712,21 @@ const PaymentMethodContainerWithoutStripe = ({
14757
14712
  default:
14758
14713
  return state;
14759
14714
  }
14760
- }, initialState$g);
14715
+ }, initialState$f);
14761
14716
  return /*#__PURE__*/React__default['default'].createElement("div", {
14762
14717
  style: { ...style
14763
14718
  },
14764
14719
  className: `pelcro-container pelcro-payment-container ${className}`
14765
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14720
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14766
14721
  value: {
14767
14722
  state,
14768
14723
  dispatch
14769
14724
  }
14770
14725
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14771
- store: store$g,
14726
+ store: store$f,
14772
14727
  key: i
14773
14728
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14774
- store: store$g
14729
+ store: store$f
14775
14730
  })));
14776
14731
  };
14777
14732
 
@@ -14793,7 +14748,7 @@ const PaymentMethodContainer = props => {
14793
14748
  stripeAccount: window.Pelcro.site.read().account_id,
14794
14749
  locale: getPageOrDefaultLanguage()
14795
14750
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14796
- store: store$g
14751
+ store: store$f
14797
14752
  }, props))));
14798
14753
  }
14799
14754
 
@@ -14846,7 +14801,7 @@ const PelcroPaymentRequestButton = props => {
14846
14801
  currentPlan,
14847
14802
  updatedPrice
14848
14803
  }
14849
- } = React.useContext(store$g);
14804
+ } = React.useContext(store$f);
14850
14805
 
14851
14806
  const updatePaymentRequest = () => {
14852
14807
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14922,7 +14877,7 @@ const DiscountedPrice = props => {
14922
14877
  taxAmount,
14923
14878
  percentOff
14924
14879
  }
14925
- } = React.useContext(store$g);
14880
+ } = React.useContext(store$f);
14926
14881
  const {
14927
14882
  order,
14928
14883
  plan
@@ -14972,7 +14927,7 @@ const SubmitPaymentMethod = ({
14972
14927
  isLoading,
14973
14928
  updatedPrice
14974
14929
  }
14975
- } = React.useContext(store$g);
14930
+ } = React.useContext(store$f);
14976
14931
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14977
14932
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14978
14933
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14993,17 +14948,17 @@ const SubmitPaymentMethod = ({
14993
14948
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14994
14949
  };
14995
14950
 
14996
- var _path$n;
14951
+ var _path$m;
14997
14952
 
14998
- function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
14953
+ function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
14999
14954
 
15000
14955
  function SvgArrowLeft(props) {
15001
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14956
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
15002
14957
  xmlns: "http://www.w3.org/2000/svg",
15003
14958
  fill: "none",
15004
14959
  viewBox: "0 0 24 24",
15005
14960
  stroke: "currentColor"
15006
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14961
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
15007
14962
  strokeLinecap: "round",
15008
14963
  strokeLinejoin: "round",
15009
14964
  strokeWidth: 2,
@@ -15022,7 +14977,7 @@ const ApplyCouponButton = ({
15022
14977
  disableCouponButton
15023
14978
  },
15024
14979
  dispatch
15025
- } = React.useContext(store$g);
14980
+ } = React.useContext(store$f);
15026
14981
  const {
15027
14982
  t
15028
14983
  } = useTranslation("checkoutForm");
@@ -15056,7 +15011,7 @@ const CouponCodeField = props => {
15056
15011
  couponCode,
15057
15012
  couponError
15058
15013
  }
15059
- } = React.useContext(store$g);
15014
+ } = React.useContext(store$f);
15060
15015
 
15061
15016
  const onCouponCodeChange = e => {
15062
15017
  dispatch({
@@ -15085,17 +15040,17 @@ const CouponCodeField = props => {
15085
15040
  }, props));
15086
15041
  };
15087
15042
 
15088
- var _path$m;
15043
+ var _path$l;
15089
15044
 
15090
- function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
15045
+ function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
15091
15046
 
15092
15047
  function SvgTicket(props) {
15093
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
15048
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15094
15049
  xmlns: "http://www.w3.org/2000/svg",
15095
15050
  fill: "none",
15096
15051
  viewBox: "0 0 24 24",
15097
15052
  stroke: "currentColor"
15098
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
15053
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15099
15054
  strokeLinecap: "round",
15100
15055
  strokeLinejoin: "round",
15101
15056
  strokeWidth: 2,
@@ -15112,7 +15067,7 @@ const CouponCode = ({
15112
15067
  state: {
15113
15068
  enableCouponField
15114
15069
  }
15115
- } = React.useContext(store$g);
15070
+ } = React.useContext(store$f);
15116
15071
  const {
15117
15072
  t
15118
15073
  } = useTranslation("checkoutForm");
@@ -15369,7 +15324,7 @@ const PaypalSubscribeButton = props => {
15369
15324
  const {
15370
15325
  dispatch,
15371
15326
  state
15372
- } = React.useContext(store$g);
15327
+ } = React.useContext(store$f);
15373
15328
  const {
15374
15329
  product,
15375
15330
  plan,
@@ -15384,7 +15339,7 @@ const PaypalSubscribeButton = props => {
15384
15339
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
15385
15340
 
15386
15341
  const initializePaypal = async () => {
15387
- var _props$buttonElementI, _props$product$addres, _props$product, _props$plan2;
15342
+ var _props$buttonElementI, _props$product$addres, _props$product;
15388
15343
 
15389
15344
  const paypalCheckoutInstance = new PaypalClient({
15390
15345
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
@@ -15394,12 +15349,33 @@ const PaypalSubscribeButton = props => {
15394
15349
  displayName: props.merchantDisplayName,
15395
15350
  locale: props.locale,
15396
15351
  billingAgreementDescription: props.billingDescription
15397
- }); // Await building paypal instance
15352
+ });
15353
+
15354
+ const getProduct = () => {
15355
+ if (invoice) {
15356
+ invoice.plan = null;
15357
+
15358
+ if (invoice.plan) {
15359
+ return invoice.plan;
15360
+ } else {
15361
+ // standalone invoices dont have a plan
15362
+ return {
15363
+ currency: invoice.currency,
15364
+ nickname: `invoice #${invoice.id}`
15365
+ };
15366
+ }
15367
+ } else if (props.plan) {
15368
+ return props.plan;
15369
+ } else {
15370
+ return plan;
15371
+ }
15372
+ }; // Await building paypal instance
15373
+
15398
15374
 
15399
15375
  await paypalCheckoutInstance.build(); // Create paypal payment
15400
15376
 
15401
15377
  paypalCheckoutInstance.createPayment({
15402
- product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
15378
+ product: getProduct(),
15403
15379
  amount: updatedPrice,
15404
15380
  address: invoice ? null : selectedAddress,
15405
15381
  onButtonClick: () => {
@@ -15455,16 +15431,16 @@ const BankRedirection = () => {
15455
15431
  }));
15456
15432
  };
15457
15433
 
15458
- var _path$l;
15434
+ var _path$k;
15459
15435
 
15460
- function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
15436
+ function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
15461
15437
 
15462
15438
  function SvgLock(props) {
15463
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15439
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15464
15440
  xmlns: "http://www.w3.org/2000/svg",
15465
15441
  viewBox: "0 0 20 20",
15466
15442
  fill: "currentColor"
15467
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15443
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15468
15444
  fillRule: "evenodd",
15469
15445
  d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
15470
15446
  clipRule: "evenodd"
@@ -15481,7 +15457,7 @@ const SelectedPaymentMethod = () => {
15481
15457
  state: {
15482
15458
  isLoading
15483
15459
  }
15484
- } = React.useContext(store$g);
15460
+ } = React.useContext(store$f);
15485
15461
  const {
15486
15462
  switchView,
15487
15463
  selectedPaymentMethodId
@@ -15523,7 +15499,7 @@ const TaxAmount = () => {
15523
15499
  state: {
15524
15500
  taxAmount
15525
15501
  }
15526
- } = React.useContext(store$g);
15502
+ } = React.useContext(store$f);
15527
15503
  const {
15528
15504
  plan
15529
15505
  } = usePelcro();
@@ -15687,12 +15663,12 @@ function SubscriptionRenewModal({
15687
15663
  }
15688
15664
  SubscriptionRenewModal.viewId = "subscription-renew";
15689
15665
 
15690
- var _path$k;
15666
+ var _path$j;
15691
15667
 
15692
- function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
15668
+ function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
15693
15669
 
15694
15670
  function SvgGift(props) {
15695
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15671
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15696
15672
  className: "plc-w-6 plc-h-6 plc-mr-2",
15697
15673
  fill: "none",
15698
15674
  stroke: "currentColor",
@@ -15701,7 +15677,7 @@ function SvgGift(props) {
15701
15677
  strokeWidth: 2,
15702
15678
  viewBox: "0 0 24 24",
15703
15679
  xmlns: "http://www.w3.org/2000/svg"
15704
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15680
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15705
15681
  d: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z"
15706
15682
  })));
15707
15683
  }
@@ -16042,7 +16018,7 @@ class DefaultNewsLetter extends React.Component {
16042
16018
 
16043
16019
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
16044
16020
 
16045
- const initialState$f = {
16021
+ const initialState$e = {
16046
16022
  didSubToNewslettersBefore: false,
16047
16023
  newsletters: [],
16048
16024
  isListLoading: true,
@@ -16052,10 +16028,10 @@ const initialState$f = {
16052
16028
  content: ""
16053
16029
  }
16054
16030
  };
16055
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
16031
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
16056
16032
  const {
16057
- Provider: Provider$f
16058
- } = store$f;
16033
+ Provider: Provider$e
16034
+ } = store$e;
16059
16035
 
16060
16036
  const NewsletterUpdateContainer = ({
16061
16037
  style,
@@ -16168,7 +16144,7 @@ const NewsletterUpdateContainer = ({
16168
16144
  default:
16169
16145
  return state;
16170
16146
  }
16171
- }, initialState$f);
16147
+ }, initialState$e);
16172
16148
  React.useEffect(() => {
16173
16149
  const getUserNewsletters = () => {
16174
16150
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -16212,7 +16188,7 @@ const NewsletterUpdateContainer = ({
16212
16188
  style: { ...style
16213
16189
  },
16214
16190
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
16215
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
16191
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16216
16192
  value: {
16217
16193
  state,
16218
16194
  dispatch
@@ -16220,12 +16196,12 @@ const NewsletterUpdateContainer = ({
16220
16196
  }, children.length ? children.map((child, i) => {
16221
16197
  if (child) {
16222
16198
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
16223
- store: store$f,
16199
+ store: store$e,
16224
16200
  key: i
16225
16201
  });
16226
16202
  }
16227
16203
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16228
- store: store$f
16204
+ store: store$e
16229
16205
  })));
16230
16206
  };
16231
16207
 
@@ -16240,7 +16216,7 @@ const NewsletterUpdateButton = ({
16240
16216
  isSubmitting,
16241
16217
  isListLoading
16242
16218
  }
16243
- } = React.useContext(store$f);
16219
+ } = React.useContext(store$e);
16244
16220
  const {
16245
16221
  t
16246
16222
  } = useTranslation("newsletter");
@@ -16270,7 +16246,7 @@ const NewsletterUpdateList = () => {
16270
16246
  newsletters,
16271
16247
  isListLoading
16272
16248
  }
16273
- } = React.useContext(store$f);
16249
+ } = React.useContext(store$e);
16274
16250
 
16275
16251
  if (isListLoading) {
16276
16252
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -16474,7 +16450,7 @@ function SubscriptionCreateModal({
16474
16450
  SubscriptionCreateModal.viewId = "subscription-create";
16475
16451
 
16476
16452
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
16477
- const initialState$e = {
16453
+ const initialState$d = {
16478
16454
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
16479
16455
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
16480
16456
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -16487,10 +16463,10 @@ const initialState$e = {
16487
16463
  content: ""
16488
16464
  }
16489
16465
  };
16490
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
16466
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16491
16467
  const {
16492
- Provider: Provider$e
16493
- } = store$e;
16468
+ Provider: Provider$d
16469
+ } = store$d;
16494
16470
 
16495
16471
  const UserUpdateContainer = ({
16496
16472
  style,
@@ -16622,27 +16598,27 @@ const UserUpdateContainer = ({
16622
16598
  default:
16623
16599
  return state;
16624
16600
  }
16625
- }, initialState$e);
16601
+ }, initialState$d);
16626
16602
  return /*#__PURE__*/React__default['default'].createElement("div", {
16627
16603
  style: { ...style
16628
16604
  },
16629
16605
  className: `pelcro-container pelcro-user-update-container ${className}`
16630
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16606
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16631
16607
  value: {
16632
16608
  state,
16633
16609
  dispatch
16634
16610
  }
16635
16611
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16636
- store: store$e,
16612
+ store: store$d,
16637
16613
  key: i
16638
16614
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16639
- store: store$e
16615
+ store: store$d
16640
16616
  })));
16641
16617
  };
16642
16618
 
16643
16619
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16644
16620
  disabled: true,
16645
- store: store$e
16621
+ store: store$d
16646
16622
  }, props));
16647
16623
 
16648
16624
  const UserUpdateButton = ({
@@ -16655,7 +16631,7 @@ const UserUpdateButton = ({
16655
16631
  buttonDisabled
16656
16632
  },
16657
16633
  dispatch
16658
- } = React.useContext(store$e);
16634
+ } = React.useContext(store$d);
16659
16635
  const {
16660
16636
  t
16661
16637
  } = useTranslation("userEdit");
@@ -16672,11 +16648,11 @@ const UserUpdateButton = ({
16672
16648
  };
16673
16649
 
16674
16650
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16675
- store: store$e
16651
+ store: store$d
16676
16652
  }, props));
16677
16653
 
16678
16654
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16679
- store: store$e
16655
+ store: store$d
16680
16656
  }, props));
16681
16657
 
16682
16658
  function Phone({
@@ -16705,22 +16681,22 @@ function Phone({
16705
16681
  }
16706
16682
 
16707
16683
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16708
- store: store$e
16684
+ store: store$d
16709
16685
  }, props));
16710
16686
 
16711
16687
  var userSolidIcon = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20class%3D%22plc-h-5%20plc-w-5%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22white%22%3E%20%20%3Cpath%20transform%3D%22translate%280%2C2%29%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%209a3%203%200%20100-6%203%203%200%20000%206zm-7%209a7%207%200%201114%200H3z%22%20clip-rule%3D%22evenodd%22%20%2F%3E%3C%2Fsvg%3E";
16712
16688
 
16713
- var _path$j;
16689
+ var _path$i;
16714
16690
 
16715
- function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
16691
+ function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
16716
16692
 
16717
16693
  function SvgEdit(props) {
16718
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16694
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
16719
16695
  className: "plc-w-6 plc-h-6",
16720
16696
  xmlns: "http://www.w3.org/2000/svg",
16721
16697
  viewBox: "0 0 20 20",
16722
16698
  fill: "currentColor"
16723
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16699
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
16724
16700
  d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zm-2.207 2.207L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
16725
16701
  })));
16726
16702
  }
@@ -16852,16 +16828,16 @@ function DisplayName({
16852
16828
  }
16853
16829
 
16854
16830
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16855
- store: store$e
16831
+ store: store$d
16856
16832
  }, props));
16857
16833
 
16858
16834
  const UserUpdateTextInput = props => {
16859
16835
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16860
- store: store$e
16836
+ store: store$d
16861
16837
  }));
16862
16838
  };
16863
16839
 
16864
- const initialState$d = {
16840
+ const initialState$c = {
16865
16841
  isSubmitting: false,
16866
16842
  firstName: "",
16867
16843
  firstNameError: "",
@@ -16886,10 +16862,10 @@ const initialState$d = {
16886
16862
  content: ""
16887
16863
  }
16888
16864
  };
16889
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16865
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
16890
16866
  const {
16891
- Provider: Provider$d
16892
- } = store$d;
16867
+ Provider: Provider$c
16868
+ } = store$c;
16893
16869
 
16894
16870
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16895
16871
 
@@ -17096,7 +17072,7 @@ const AddressCreateContainer = ({
17096
17072
  default:
17097
17073
  return state;
17098
17074
  }
17099
- }, initialState$d);
17075
+ }, initialState$c);
17100
17076
  React.useEffect(() => {
17101
17077
  const getStates = () => {
17102
17078
  dispatch({
@@ -17128,16 +17104,16 @@ const AddressCreateContainer = ({
17128
17104
  style: { ...style
17129
17105
  },
17130
17106
  className: `pelcro-container pelcro-address-create-container ${className}`
17131
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
17107
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17132
17108
  value: {
17133
17109
  state,
17134
17110
  dispatch
17135
17111
  }
17136
17112
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17137
- store: store$d,
17113
+ store: store$c,
17138
17114
  key: i
17139
17115
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17140
- store: store$d
17116
+ store: store$c
17141
17117
  })));
17142
17118
  };
17143
17119
 
@@ -17148,7 +17124,7 @@ function AddressCreateFirstName(props) {
17148
17124
  firstName,
17149
17125
  firstNameError
17150
17126
  }
17151
- } = React.useContext(store$d);
17127
+ } = React.useContext(store$c);
17152
17128
 
17153
17129
  const handleBlur = () => {
17154
17130
  return dispatch({
@@ -17191,7 +17167,7 @@ function AddressCreateLastName(props) {
17191
17167
  lastName,
17192
17168
  lastNameError
17193
17169
  }
17194
- } = React.useContext(store$d);
17170
+ } = React.useContext(store$c);
17195
17171
 
17196
17172
  const handleBlur = () => {
17197
17173
  return dispatch({
@@ -17234,7 +17210,7 @@ function AddressCreateLine1(props) {
17234
17210
  line1,
17235
17211
  line1Error
17236
17212
  }
17237
- } = React.useContext(store$d);
17213
+ } = React.useContext(store$c);
17238
17214
 
17239
17215
  const handleBlur = () => {
17240
17216
  return dispatch({
@@ -17277,7 +17253,7 @@ function AddressCreateCity(props) {
17277
17253
  city,
17278
17254
  cityError
17279
17255
  }
17280
- } = React.useContext(store$d);
17256
+ } = React.useContext(store$c);
17281
17257
 
17282
17258
  const handleBlur = () => {
17283
17259
  return dispatch({
@@ -17320,7 +17296,7 @@ function AddressCreatePostalCode(props) {
17320
17296
  postalCode,
17321
17297
  postalCodeError
17322
17298
  }
17323
- } = React.useContext(store$d);
17299
+ } = React.useContext(store$c);
17324
17300
 
17325
17301
  const handleBlur = () => {
17326
17302
  return dispatch({
@@ -17366,7 +17342,7 @@ const AddressCreateSubmit = ({
17366
17342
  state: {
17367
17343
  isSubmitting
17368
17344
  }
17369
- } = React.useContext(store$d);
17345
+ } = React.useContext(store$c);
17370
17346
  const {
17371
17347
  t
17372
17348
  } = useTranslation("address");
@@ -17477,7 +17453,7 @@ function CountrySelect({
17477
17453
  }
17478
17454
 
17479
17455
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17480
- store: store$d
17456
+ store: store$c
17481
17457
  }, props));
17482
17458
 
17483
17459
  function StateSelect({
@@ -17565,7 +17541,7 @@ function StateSelect({
17565
17541
  }
17566
17542
 
17567
17543
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17568
- store: store$d
17544
+ store: store$c
17569
17545
  }, props));
17570
17546
 
17571
17547
  const AddressCreateView = props => {
@@ -17670,18 +17646,18 @@ AddressCreateModal.viewId = "address-create";
17670
17646
 
17671
17647
  const AddressCreateTextInput = props => {
17672
17648
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17673
- store: store$d
17649
+ store: store$c
17674
17650
  }));
17675
17651
  };
17676
17652
 
17677
17653
  const AddressCreateLine2 = props => {
17678
17654
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17679
17655
  fieldName: "line2",
17680
- store: store$d
17656
+ store: store$c
17681
17657
  }, props));
17682
17658
  };
17683
17659
 
17684
- const initialState$c = {
17660
+ const initialState$b = {
17685
17661
  isSubmitting: false,
17686
17662
  firstName: "",
17687
17663
  firstNameError: "",
@@ -17706,10 +17682,10 @@ const initialState$c = {
17706
17682
  content: ""
17707
17683
  }
17708
17684
  };
17709
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
17685
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
17710
17686
  const {
17711
- Provider: Provider$c
17712
- } = store$c;
17687
+ Provider: Provider$b
17688
+ } = store$b;
17713
17689
 
17714
17690
  const AddressUpdateContainer = ({
17715
17691
  style,
@@ -17761,7 +17737,7 @@ const AddressUpdateContainer = ({
17761
17737
  const thisAddress = addresses[address];
17762
17738
 
17763
17739
  if (+thisAddress.id === +addressId) {
17764
- const newState = { ...initialState$c,
17740
+ const newState = { ...initialState$b,
17765
17741
  firstName: thisAddress.first_name,
17766
17742
  lastName: thisAddress.last_name,
17767
17743
  line1: thisAddress.line1,
@@ -17894,7 +17870,7 @@ const AddressUpdateContainer = ({
17894
17870
  default:
17895
17871
  return state;
17896
17872
  }
17897
- }, initialState$c);
17873
+ }, initialState$b);
17898
17874
  React.useEffect(() => {
17899
17875
  const getStates = () => {
17900
17876
  dispatch({
@@ -17926,21 +17902,21 @@ const AddressUpdateContainer = ({
17926
17902
  style: { ...style
17927
17903
  },
17928
17904
  className: `pelcro-container pelcro-address-update-container ${className}`
17929
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17905
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17930
17906
  value: {
17931
17907
  state,
17932
17908
  dispatch
17933
17909
  }
17934
17910
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17935
- store: store$c,
17911
+ store: store$b,
17936
17912
  key: i
17937
17913
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17938
- store: store$c
17914
+ store: store$b
17939
17915
  })));
17940
17916
  };
17941
17917
 
17942
17918
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17943
- store: store$c
17919
+ store: store$b
17944
17920
  }, props));
17945
17921
 
17946
17922
  function AddressUpdateFirstName(props) {
@@ -17950,7 +17926,7 @@ function AddressUpdateFirstName(props) {
17950
17926
  firstName,
17951
17927
  firstNameError
17952
17928
  }
17953
- } = React.useContext(store$c);
17929
+ } = React.useContext(store$b);
17954
17930
 
17955
17931
  const handleBlur = () => {
17956
17932
  return dispatch({
@@ -17993,7 +17969,7 @@ function AddressUpdateLastName(props) {
17993
17969
  lastName,
17994
17970
  lastNameError
17995
17971
  }
17996
- } = React.useContext(store$c);
17972
+ } = React.useContext(store$b);
17997
17973
 
17998
17974
  const handleBlur = () => {
17999
17975
  return dispatch({
@@ -18036,7 +18012,7 @@ function AddressUpdateLine1(props) {
18036
18012
  line1,
18037
18013
  line1Error
18038
18014
  }
18039
- } = React.useContext(store$c);
18015
+ } = React.useContext(store$b);
18040
18016
 
18041
18017
  const handleBlur = () => {
18042
18018
  return dispatch({
@@ -18076,7 +18052,7 @@ const AddressUpdateLine2 = props => {
18076
18052
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
18077
18053
  fieldName: "line2"
18078
18054
  }, props, {
18079
- store: store$c
18055
+ store: store$b
18080
18056
  }));
18081
18057
  };
18082
18058
 
@@ -18087,7 +18063,7 @@ function AddressUpdateCity(props) {
18087
18063
  city,
18088
18064
  cityError
18089
18065
  }
18090
- } = React.useContext(store$c);
18066
+ } = React.useContext(store$b);
18091
18067
 
18092
18068
  const handleBlur = () => {
18093
18069
  return dispatch({
@@ -18130,7 +18106,7 @@ function AddressUpdatePostalCode(props) {
18130
18106
  postalCode,
18131
18107
  postalCodeError
18132
18108
  }
18133
- } = React.useContext(store$c);
18109
+ } = React.useContext(store$b);
18134
18110
 
18135
18111
  const handleBlur = () => {
18136
18112
  return dispatch({
@@ -18176,7 +18152,7 @@ const AddressUpdateSubmit = ({
18176
18152
  state: {
18177
18153
  isSubmitting
18178
18154
  }
18179
- } = React.useContext(store$c);
18155
+ } = React.useContext(store$b);
18180
18156
  const {
18181
18157
  t
18182
18158
  } = useTranslation("address");
@@ -18192,7 +18168,7 @@ const AddressUpdateSubmit = ({
18192
18168
  };
18193
18169
 
18194
18170
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
18195
- store: store$c
18171
+ store: store$b
18196
18172
  }, props));
18197
18173
 
18198
18174
  const AddressUpdateView = props => {
@@ -18275,7 +18251,7 @@ AddressUpdateModal.viewId = "address-edit";
18275
18251
 
18276
18252
  const AddressUpdateTextInput = props => {
18277
18253
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
18278
- store: store$c
18254
+ store: store$b
18279
18255
  }));
18280
18256
  };
18281
18257
 
@@ -18358,7 +18334,7 @@ const PaymentMethodUpdateModal = props => {
18358
18334
  };
18359
18335
  PaymentMethodUpdateModal.viewId = "payment-method-update";
18360
18336
 
18361
- const initialState$b = {
18337
+ const initialState$a = {
18362
18338
  email: "",
18363
18339
  password: "",
18364
18340
  passwordError: null,
@@ -18371,10 +18347,10 @@ const initialState$b = {
18371
18347
  content: ""
18372
18348
  }
18373
18349
  };
18374
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
18350
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
18375
18351
  const {
18376
- Provider: Provider$b
18377
- } = store$b;
18352
+ Provider: Provider$a
18353
+ } = store$a;
18378
18354
 
18379
18355
  const PasswordResetContainer = ({
18380
18356
  style,
@@ -18431,7 +18407,7 @@ const PasswordResetContainer = ({
18431
18407
  type: SET_EMAIL,
18432
18408
  payload: window.Pelcro.helpers.getURLParameter("email")
18433
18409
  });
18434
- initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
18410
+ initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18435
18411
  dispatch({
18436
18412
  type: SET_TOKEN,
18437
18413
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -18491,26 +18467,26 @@ const PasswordResetContainer = ({
18491
18467
  default:
18492
18468
  return state;
18493
18469
  }
18494
- }, initialState$b);
18470
+ }, initialState$a);
18495
18471
  return /*#__PURE__*/React__default['default'].createElement("div", {
18496
18472
  style: { ...style
18497
18473
  },
18498
18474
  className: `pelcro-container pelcro-password-reset-container ${className}`
18499
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
18475
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18500
18476
  value: {
18501
18477
  state,
18502
18478
  dispatch
18503
18479
  }
18504
18480
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18505
- store: store$b,
18481
+ store: store$a,
18506
18482
  key: i
18507
18483
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18508
- store: store$b
18484
+ store: store$a
18509
18485
  })));
18510
18486
  };
18511
18487
 
18512
18488
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
18513
- store: store$b
18489
+ store: store$a
18514
18490
  }, props));
18515
18491
 
18516
18492
  const PasswordResetButton = ({
@@ -18523,7 +18499,7 @@ const PasswordResetButton = ({
18523
18499
  buttonDisabled
18524
18500
  },
18525
18501
  dispatch
18526
- } = React.useContext(store$b);
18502
+ } = React.useContext(store$a);
18527
18503
  const {
18528
18504
  t
18529
18505
  } = useTranslation("passwordReset");
@@ -18540,14 +18516,14 @@ const PasswordResetButton = ({
18540
18516
  };
18541
18517
 
18542
18518
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18543
- store: store$b
18519
+ store: store$a
18544
18520
  }, props, {
18545
18521
  value: window.Pelcro.helpers.getURLParameter("email"),
18546
18522
  disabled: true
18547
18523
  }));
18548
18524
 
18549
18525
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
18550
- store: store$b
18526
+ store: store$a
18551
18527
  }, props));
18552
18528
 
18553
18529
  const PasswordResetView = props => {
@@ -18599,7 +18575,7 @@ const PasswordResetModal = ({
18599
18575
  };
18600
18576
  PasswordResetModal.viewId = "password-reset";
18601
18577
 
18602
- const initialState$a = {
18578
+ const initialState$9 = {
18603
18579
  email: "",
18604
18580
  emailError: null,
18605
18581
  buttonDisabled: false,
@@ -18608,10 +18584,10 @@ const initialState$a = {
18608
18584
  content: ""
18609
18585
  }
18610
18586
  };
18611
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
18587
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18612
18588
  const {
18613
- Provider: Provider$a
18614
- } = store$a;
18589
+ Provider: Provider$9
18590
+ } = store$9;
18615
18591
 
18616
18592
  const PasswordForgotContainer = ({
18617
18593
  style,
@@ -18689,21 +18665,21 @@ const PasswordForgotContainer = ({
18689
18665
  default:
18690
18666
  return state;
18691
18667
  }
18692
- }, initialState$a);
18668
+ }, initialState$9);
18693
18669
  return /*#__PURE__*/React__default['default'].createElement("div", {
18694
18670
  style: { ...style
18695
18671
  },
18696
18672
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18697
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18673
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18698
18674
  value: {
18699
18675
  state,
18700
18676
  dispatch
18701
18677
  }
18702
18678
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18703
- store: store$a,
18679
+ store: store$9,
18704
18680
  key: i
18705
18681
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18706
- store: store$a
18682
+ store: store$9
18707
18683
  })));
18708
18684
  };
18709
18685
 
@@ -18719,7 +18695,7 @@ const PasswordForgotButton = ({
18719
18695
  emailError
18720
18696
  },
18721
18697
  dispatch
18722
- } = React.useContext(store$a);
18698
+ } = React.useContext(store$9);
18723
18699
  const {
18724
18700
  t
18725
18701
  } = useTranslation("passwordForgot");
@@ -18740,7 +18716,7 @@ const PasswordForgotButton = ({
18740
18716
  };
18741
18717
 
18742
18718
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18743
- store: store$a
18719
+ store: store$9
18744
18720
  }, props));
18745
18721
 
18746
18722
  const PasswordForgotView = props => {
@@ -18790,7 +18766,7 @@ const PasswordForgotModal = ({
18790
18766
  };
18791
18767
  PasswordForgotModal.viewId = "password-forgot";
18792
18768
 
18793
- const initialState$9 = {
18769
+ const initialState$8 = {
18794
18770
  currentPassword: "",
18795
18771
  newPassword: "",
18796
18772
  confirmNewPassword: "",
@@ -18804,10 +18780,10 @@ const initialState$9 = {
18804
18780
  content: ""
18805
18781
  }
18806
18782
  };
18807
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18783
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18808
18784
  const {
18809
- Provider: Provider$9
18810
- } = store$9;
18785
+ Provider: Provider$8
18786
+ } = store$8;
18811
18787
  const PasswordChangeContainer = ({
18812
18788
  style,
18813
18789
  className = "",
@@ -18959,21 +18935,21 @@ const PasswordChangeContainer = ({
18959
18935
  default:
18960
18936
  return state;
18961
18937
  }
18962
- }, initialState$9);
18938
+ }, initialState$8);
18963
18939
  return /*#__PURE__*/React__default['default'].createElement("div", {
18964
18940
  style: { ...style
18965
18941
  },
18966
18942
  className: `pelcro-container pelcro-password-change-container ${className}`
18967
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18943
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18968
18944
  value: {
18969
18945
  state,
18970
18946
  dispatch
18971
18947
  }
18972
18948
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18973
- store: store$9,
18949
+ store: store$8,
18974
18950
  key: i
18975
18951
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18976
- store: store$9
18952
+ store: store$8
18977
18953
  })));
18978
18954
  };
18979
18955
 
@@ -18984,7 +18960,7 @@ function PasswordChangeCurrentPassword(props) {
18984
18960
  currentPassword,
18985
18961
  currentPasswordError
18986
18962
  }
18987
- } = React.useContext(store$9);
18963
+ } = React.useContext(store$8);
18988
18964
  const handleBlur = React.useCallback(() => {
18989
18965
  return dispatch({
18990
18966
  type: VALIDATE_PASSWORD
@@ -19018,7 +18994,7 @@ function PasswordChangeNewPassword(props) {
19018
18994
  newPassword,
19019
18995
  newPasswordError
19020
18996
  }
19021
- } = React.useContext(store$9);
18997
+ } = React.useContext(store$8);
19022
18998
  const handleBlur = React.useCallback(() => {
19023
18999
  return dispatch({
19024
19000
  type: VALIDATE_NEW_PASSWORD
@@ -19052,7 +19028,7 @@ function PasswordChangeConfirmNewPassword(props) {
19052
19028
  confirmNewPassword,
19053
19029
  confirmNewPasswordError
19054
19030
  }
19055
- } = React.useContext(store$9);
19031
+ } = React.useContext(store$8);
19056
19032
  const handleBlur = React.useCallback(() => {
19057
19033
  return dispatch({
19058
19034
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -19093,7 +19069,7 @@ const PasswordChangeButton = ({
19093
19069
  confirmNewPasswordError
19094
19070
  },
19095
19071
  dispatch
19096
- } = React.useContext(store$9);
19072
+ } = React.useContext(store$8);
19097
19073
  const {
19098
19074
  t
19099
19075
  } = useTranslation("passwordChange");
@@ -19159,17 +19135,17 @@ const PasswordChangeModal = ({
19159
19135
  };
19160
19136
  PasswordChangeModal.viewId = "password-change";
19161
19137
 
19162
- const initialState$8 = {
19138
+ const initialState$7 = {
19163
19139
  buttonDisabled: false,
19164
19140
  alert: {
19165
19141
  type: "error",
19166
19142
  content: ""
19167
19143
  }
19168
19144
  };
19169
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
19145
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19170
19146
  const {
19171
- Provider: Provider$8
19172
- } = store$8;
19147
+ Provider: Provider$7
19148
+ } = store$7;
19173
19149
 
19174
19150
  const CartContainer = ({
19175
19151
  style,
@@ -19260,21 +19236,21 @@ const CartContainer = ({
19260
19236
  default:
19261
19237
  return state;
19262
19238
  }
19263
- }, initialState$8);
19239
+ }, initialState$7);
19264
19240
  return /*#__PURE__*/React__default['default'].createElement("div", {
19265
19241
  style: { ...style
19266
19242
  },
19267
19243
  className: `pelcro-container pelcro-cart-container ${className}`
19268
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
19244
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19269
19245
  value: {
19270
19246
  state,
19271
19247
  dispatch
19272
19248
  }
19273
19249
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19274
- store: store$8,
19250
+ store: store$7,
19275
19251
  key: i
19276
19252
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19277
- store: store$8
19253
+ store: store$7
19278
19254
  })));
19279
19255
  };
19280
19256
 
@@ -19311,7 +19287,7 @@ const CartSubmit = ({
19311
19287
  buttonDisabled
19312
19288
  },
19313
19289
  dispatch
19314
- } = React.useContext(store$8);
19290
+ } = React.useContext(store$7);
19315
19291
  const {
19316
19292
  t
19317
19293
  } = useTranslation("cart");
@@ -19342,7 +19318,7 @@ const CartTotalPrice = () => {
19342
19318
  state: {
19343
19319
  alert
19344
19320
  }
19345
- } = React.useContext(store$8);
19321
+ } = React.useContext(store$7);
19346
19322
  const {
19347
19323
  cartItems
19348
19324
  } = usePelcro();
@@ -19655,7 +19631,7 @@ const OrderConfirmModal = props => {
19655
19631
  };
19656
19632
  OrderConfirmModal.viewId = "order-confirm";
19657
19633
 
19658
- const initialState$7 = {
19634
+ const initialState$6 = {
19659
19635
  email: "",
19660
19636
  firstName: "",
19661
19637
  lastName: "",
@@ -19667,10 +19643,10 @@ const initialState$7 = {
19667
19643
  content: ""
19668
19644
  }
19669
19645
  };
19670
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19646
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19671
19647
  const {
19672
- Provider: Provider$7
19673
- } = store$7;
19648
+ Provider: Provider$6
19649
+ } = store$6;
19674
19650
 
19675
19651
  const GiftCreateContainer = ({
19676
19652
  style,
@@ -19774,21 +19750,21 @@ const GiftCreateContainer = ({
19774
19750
  default:
19775
19751
  return state;
19776
19752
  }
19777
- }, initialState$7);
19753
+ }, initialState$6);
19778
19754
  return /*#__PURE__*/React__default['default'].createElement("div", {
19779
19755
  style: { ...style
19780
19756
  },
19781
19757
  className: `pelcro-container pelcro-gift-create-container ${className}`
19782
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19758
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19783
19759
  value: {
19784
19760
  state,
19785
19761
  dispatch
19786
19762
  }
19787
19763
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19788
- store: store$7,
19764
+ store: store$6,
19789
19765
  key: i
19790
19766
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19791
- store: store$7
19767
+ store: store$6
19792
19768
  })));
19793
19769
  };
19794
19770
 
@@ -19802,7 +19778,7 @@ const GiftCreateSubmitButton = ({
19802
19778
  state: {
19803
19779
  disableSubmit
19804
19780
  }
19805
- } = React.useContext(store$7);
19781
+ } = React.useContext(store$6);
19806
19782
  const {
19807
19783
  t
19808
19784
  } = useTranslation("register");
@@ -19819,29 +19795,29 @@ const GiftCreateSubmitButton = ({
19819
19795
 
19820
19796
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19821
19797
  initWithUserEmail: false,
19822
- store: store$7
19798
+ store: store$6
19823
19799
  }, props));
19824
19800
 
19825
19801
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19826
- store: store$7
19802
+ store: store$6
19827
19803
  }, props));
19828
19804
 
19829
19805
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19830
- store: store$7
19806
+ store: store$6
19831
19807
  }, props));
19832
19808
 
19833
- var _path$i;
19809
+ var _path$h;
19834
19810
 
19835
- function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
19811
+ function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
19836
19812
 
19837
19813
  function SvgInfoCircle(props) {
19838
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19814
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
19839
19815
  xmlns: "http://www.w3.org/2000/svg",
19840
19816
  className: "plc-w-5 plc-h-5",
19841
19817
  fill: "none",
19842
19818
  viewBox: "0 0 24 24",
19843
19819
  stroke: "currentColor"
19844
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19820
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
19845
19821
  strokeLinecap: "round",
19846
19822
  strokeLinejoin: "round",
19847
19823
  strokeWidth: 2,
@@ -19912,7 +19888,7 @@ const GiftCreateStartDate = props => {
19912
19888
  const {
19913
19889
  dispatch,
19914
19890
  state
19915
- } = React.useContext(store$7);
19891
+ } = React.useContext(store$6);
19916
19892
 
19917
19893
  const handleInputChange = value => {
19918
19894
  dispatch({
@@ -19985,7 +19961,7 @@ function GiftCreateMessage(props) {
19985
19961
  const {
19986
19962
  dispatch,
19987
19963
  state
19988
- } = React.useContext(store$7);
19964
+ } = React.useContext(store$6);
19989
19965
  const MAX_CHARS_COUNT = 200;
19990
19966
  const remainingCharsCount = (_ref = MAX_CHARS_COUNT - ((_state$giftMessage = state.giftMessage) === null || _state$giftMessage === void 0 ? void 0 : _state$giftMessage.length)) !== null && _ref !== void 0 ? _ref : 0;
19991
19967
 
@@ -20109,7 +20085,7 @@ const GiftCreateModal = ({
20109
20085
  };
20110
20086
  GiftCreateModal.viewId = "gift-create";
20111
20087
 
20112
- const initialState$6 = {
20088
+ const initialState$5 = {
20113
20089
  giftCode: "",
20114
20090
  buttonDisabled: true,
20115
20091
  alert: {
@@ -20117,10 +20093,10 @@ const initialState$6 = {
20117
20093
  content: ""
20118
20094
  }
20119
20095
  };
20120
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
20096
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20121
20097
  const {
20122
- Provider: Provider$6
20123
- } = store$6;
20098
+ Provider: Provider$5
20099
+ } = store$5;
20124
20100
 
20125
20101
  const GiftRedeemContainer = ({
20126
20102
  style,
@@ -20185,21 +20161,21 @@ const GiftRedeemContainer = ({
20185
20161
  default:
20186
20162
  return state;
20187
20163
  }
20188
- }, initialState$6);
20164
+ }, initialState$5);
20189
20165
  return /*#__PURE__*/React__default['default'].createElement("div", {
20190
20166
  style: { ...style
20191
20167
  },
20192
20168
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
20193
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
20169
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20194
20170
  value: {
20195
20171
  state,
20196
20172
  dispatch
20197
20173
  }
20198
20174
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20199
- store: store$6,
20175
+ store: store$5,
20200
20176
  key: i
20201
20177
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20202
- store: store$6
20178
+ store: store$5
20203
20179
  })));
20204
20180
  };
20205
20181
 
@@ -20236,7 +20212,7 @@ function GiftCode({
20236
20212
  }
20237
20213
 
20238
20214
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
20239
- store: store$6
20215
+ store: store$5
20240
20216
  }, props));
20241
20217
 
20242
20218
  const GiftRedeemSubmitButton = ({
@@ -20249,7 +20225,7 @@ const GiftRedeemSubmitButton = ({
20249
20225
  state: {
20250
20226
  disableSubmit
20251
20227
  }
20252
- } = React.useContext(store$6);
20228
+ } = React.useContext(store$5);
20253
20229
  const {
20254
20230
  t
20255
20231
  } = useTranslation("register");
@@ -20342,7 +20318,7 @@ const moveDefaultAddressToStart = addresses => {
20342
20318
  return [defaultAddress, ...addressesWithoutDefault];
20343
20319
  };
20344
20320
 
20345
- const initialState$5 = {
20321
+ const initialState$4 = {
20346
20322
  addresses: [],
20347
20323
  selectedAddressId: null,
20348
20324
  isSubmitting: false,
@@ -20351,10 +20327,10 @@ const initialState$5 = {
20351
20327
  content: ""
20352
20328
  }
20353
20329
  };
20354
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20330
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20355
20331
  const {
20356
- Provider: Provider$5
20357
- } = store$5;
20332
+ Provider: Provider$4
20333
+ } = store$4;
20358
20334
 
20359
20335
  const AddressSelectContainer = ({
20360
20336
  style,
@@ -20449,7 +20425,7 @@ const AddressSelectContainer = ({
20449
20425
  default:
20450
20426
  return state;
20451
20427
  }
20452
- }, initialState$5);
20428
+ }, initialState$4);
20453
20429
  React.useEffect(() => {
20454
20430
  var _window$Pelcro$user$r;
20455
20431
 
@@ -20462,16 +20438,16 @@ const AddressSelectContainer = ({
20462
20438
  style: { ...style
20463
20439
  },
20464
20440
  className: `pelcro-container pelcro-address-select-container ${className}`
20465
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20441
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20466
20442
  value: {
20467
20443
  state,
20468
20444
  dispatch
20469
20445
  }
20470
20446
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20471
- store: store$5,
20447
+ store: store$4,
20472
20448
  key: i
20473
20449
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20474
- store: store$5
20450
+ store: store$4
20475
20451
  })));
20476
20452
  };
20477
20453
 
@@ -20482,7 +20458,7 @@ const AddressSelectList = () => {
20482
20458
  addresses,
20483
20459
  selectedAddressId
20484
20460
  }
20485
- } = React.useContext(store$5);
20461
+ } = React.useContext(store$4);
20486
20462
 
20487
20463
  const handleAddressSelect = event => {
20488
20464
  dispatch({
@@ -20526,7 +20502,7 @@ const AddressSelectSubmit = ({
20526
20502
  selectedAddressId,
20527
20503
  isSubmitting
20528
20504
  }
20529
- } = React.useContext(store$5);
20505
+ } = React.useContext(store$4);
20530
20506
  const {
20531
20507
  t
20532
20508
  } = useTranslation("address");
@@ -20622,7 +20598,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20622
20598
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20623
20599
  };
20624
20600
 
20625
- const initialState$4 = {
20601
+ const initialState$3 = {
20626
20602
  paymentMethods: [],
20627
20603
  selectedPaymentMethodId: null,
20628
20604
  isSubmitting: false,
@@ -20631,10 +20607,10 @@ const initialState$4 = {
20631
20607
  content: ""
20632
20608
  }
20633
20609
  };
20634
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20610
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20635
20611
  const {
20636
- Provider: Provider$4
20637
- } = store$4;
20612
+ Provider: Provider$3
20613
+ } = store$3;
20638
20614
 
20639
20615
  const PaymentMethodSelectContainer = ({
20640
20616
  style,
@@ -20693,7 +20669,7 @@ const PaymentMethodSelectContainer = ({
20693
20669
  default:
20694
20670
  return state;
20695
20671
  }
20696
- }, initialState$4);
20672
+ }, initialState$3);
20697
20673
  React.useEffect(() => {
20698
20674
  var _window$Pelcro$user$r3;
20699
20675
 
@@ -20706,16 +20682,16 @@ const PaymentMethodSelectContainer = ({
20706
20682
  style: { ...style
20707
20683
  },
20708
20684
  className: `pelcro-container pelcro-payment-select-container ${className}`
20709
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20685
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20710
20686
  value: {
20711
20687
  state,
20712
20688
  dispatch
20713
20689
  }
20714
20690
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20715
- store: store$4,
20691
+ store: store$3,
20716
20692
  key: i
20717
20693
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20718
- store: store$4
20694
+ store: store$3
20719
20695
  })));
20720
20696
  };
20721
20697
 
@@ -20729,7 +20705,7 @@ const PaymentMethodSelectList = () => {
20729
20705
  paymentMethods,
20730
20706
  selectedPaymentMethodId
20731
20707
  }
20732
- } = React.useContext(store$4);
20708
+ } = React.useContext(store$3);
20733
20709
 
20734
20710
  const handlePaymentMethodSelect = event => {
20735
20711
  dispatch({
@@ -20779,7 +20755,7 @@ const PaymentMethodSelectSubmit = ({
20779
20755
  selectedPaymentMethodId,
20780
20756
  isSubmitting
20781
20757
  }
20782
- } = React.useContext(store$4);
20758
+ } = React.useContext(store$3);
20783
20759
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20784
20760
  onClick: () => {
20785
20761
  dispatch({
@@ -20853,8 +20829,8 @@ const PaymentMethodSelectModal = ({
20853
20829
  };
20854
20830
  PaymentMethodSelectModal.viewId = "payment-method-select";
20855
20831
 
20856
- function _extends$j() {
20857
- _extends$j = Object.assign || function (target) {
20832
+ function _extends$i() {
20833
+ _extends$i = Object.assign || function (target) {
20858
20834
  for (var i = 1; i < arguments.length; i++) {
20859
20835
  var source = arguments[i];
20860
20836
 
@@ -20868,7 +20844,7 @@ function _extends$j() {
20868
20844
  return target;
20869
20845
  };
20870
20846
 
20871
- return _extends$j.apply(this, arguments);
20847
+ return _extends$i.apply(this, arguments);
20872
20848
  }
20873
20849
 
20874
20850
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -21052,7 +21028,7 @@ function render(props, propsBag, defaultTag, features, visible) {
21052
21028
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
21053
21029
  return null;
21054
21030
  }, _match[RenderStrategy.Hidden] = function () {
21055
- return _render(_extends$j({}, _rest, {
21031
+ return _render(_extends$i({}, _rest, {
21056
21032
  hidden: true,
21057
21033
  style: {
21058
21034
  display: 'none'
@@ -21580,7 +21556,7 @@ function TransitionChild(props) {
21580
21556
  var passthroughProps = rest;
21581
21557
  return React__default['default'].createElement(NestingContext.Provider, {
21582
21558
  value: nesting
21583
- }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21559
+ }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21584
21560
  }
21585
21561
 
21586
21562
  function Transition(props) {
@@ -21624,7 +21600,7 @@ function Transition(props) {
21624
21600
  value: nestingBag
21625
21601
  }, React__default['default'].createElement(TransitionContext.Provider, {
21626
21602
  value: transitionBag
21627
- }, render(_extends$j({}, sharedProps, {
21603
+ }, render(_extends$i({}, sharedProps, {
21628
21604
  as: React.Fragment,
21629
21605
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21630
21606
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21751,12 +21727,12 @@ var ActionTypes;
21751
21727
  })(ActionTypes || (ActionTypes = {}));
21752
21728
 
21753
21729
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21754
- return _extends$j({}, state, {
21730
+ return _extends$i({}, state, {
21755
21731
  activeItemIndex: null,
21756
21732
  menuState: MenuStates.Closed
21757
21733
  });
21758
21734
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21759
- return _extends$j({}, state, {
21735
+ return _extends$i({}, state, {
21760
21736
  menuState: MenuStates.Open
21761
21737
  });
21762
21738
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21775,7 +21751,7 @@ var ActionTypes;
21775
21751
  }
21776
21752
  });
21777
21753
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21778
- return _extends$j({}, state, {
21754
+ return _extends$i({}, state, {
21779
21755
  searchQuery: '',
21780
21756
  activeItemIndex: activeItemIndex
21781
21757
  });
@@ -21786,19 +21762,19 @@ var ActionTypes;
21786
21762
 
21787
21763
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21788
21764
  });
21789
- if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21765
+ if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21790
21766
  searchQuery: searchQuery
21791
21767
  });
21792
- return _extends$j({}, state, {
21768
+ return _extends$i({}, state, {
21793
21769
  searchQuery: searchQuery,
21794
21770
  activeItemIndex: match
21795
21771
  });
21796
21772
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21797
- return _extends$j({}, state, {
21773
+ return _extends$i({}, state, {
21798
21774
  searchQuery: ''
21799
21775
  });
21800
21776
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21801
- return _extends$j({}, state, {
21777
+ return _extends$i({}, state, {
21802
21778
  items: [].concat(state.items, [{
21803
21779
  id: action.id,
21804
21780
  dataRef: action.dataRef
@@ -21811,7 +21787,7 @@ var ActionTypes;
21811
21787
  return a.id === action.id;
21812
21788
  });
21813
21789
  if (idx !== -1) nextItems.splice(idx, 1);
21814
- return _extends$j({}, state, {
21790
+ return _extends$i({}, state, {
21815
21791
  items: nextItems,
21816
21792
  activeItemIndex: function () {
21817
21793
  if (idx === state.activeItemIndex) return null;
@@ -21850,19 +21826,19 @@ var ActionTypes$1;
21850
21826
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21851
21827
  if (state.disabled) return state;
21852
21828
  if (state.listboxState === ListboxStates.Closed) return state;
21853
- return _extends$j({}, state, {
21829
+ return _extends$i({}, state, {
21854
21830
  activeOptionIndex: null,
21855
21831
  listboxState: ListboxStates.Closed
21856
21832
  });
21857
21833
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21858
21834
  if (state.disabled) return state;
21859
21835
  if (state.listboxState === ListboxStates.Open) return state;
21860
- return _extends$j({}, state, {
21836
+ return _extends$i({}, state, {
21861
21837
  listboxState: ListboxStates.Open
21862
21838
  });
21863
21839
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21864
21840
  if (state.disabled === action.disabled) return state;
21865
- return _extends$j({}, state, {
21841
+ return _extends$i({}, state, {
21866
21842
  disabled: action.disabled
21867
21843
  });
21868
21844
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21883,7 +21859,7 @@ var ActionTypes$1;
21883
21859
  }
21884
21860
  });
21885
21861
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21886
- return _extends$j({}, state, {
21862
+ return _extends$i({}, state, {
21887
21863
  searchQuery: '',
21888
21864
  activeOptionIndex: activeOptionIndex
21889
21865
  });
@@ -21896,10 +21872,10 @@ var ActionTypes$1;
21896
21872
 
21897
21873
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21898
21874
  });
21899
- if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21875
+ if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21900
21876
  searchQuery: searchQuery
21901
21877
  });
21902
- return _extends$j({}, state, {
21878
+ return _extends$i({}, state, {
21903
21879
  searchQuery: searchQuery,
21904
21880
  activeOptionIndex: match
21905
21881
  });
@@ -21907,11 +21883,11 @@ var ActionTypes$1;
21907
21883
  if (state.disabled) return state;
21908
21884
  if (state.listboxState === ListboxStates.Closed) return state;
21909
21885
  if (state.searchQuery === '') return state;
21910
- return _extends$j({}, state, {
21886
+ return _extends$i({}, state, {
21911
21887
  searchQuery: ''
21912
21888
  });
21913
21889
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21914
- return _extends$j({}, state, {
21890
+ return _extends$i({}, state, {
21915
21891
  options: [].concat(state.options, [{
21916
21892
  id: action.id,
21917
21893
  dataRef: action.dataRef
@@ -21924,7 +21900,7 @@ var ActionTypes$1;
21924
21900
  return a.id === action.id;
21925
21901
  });
21926
21902
  if (idx !== -1) nextOptions.splice(idx, 1);
21927
- return _extends$j({}, state, {
21903
+ return _extends$i({}, state, {
21928
21904
  options: nextOptions,
21929
21905
  activeOptionIndex: function () {
21930
21906
  if (idx === state.activeOptionIndex) return null;
@@ -21985,18 +21961,18 @@ const getPaymentCardIcon = name => {
21985
21961
  }));
21986
21962
  };
21987
21963
 
21988
- var _path$h;
21964
+ var _path$g;
21989
21965
 
21990
- function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
21966
+ function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
21991
21967
 
21992
21968
  function SvgChevronRight(props) {
21993
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21969
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21994
21970
  className: "plc-w-6 plc-h-6",
21995
21971
  xmlns: "http://www.w3.org/2000/svg",
21996
21972
  fill: "none",
21997
21973
  viewBox: "0 0 24 24",
21998
21974
  stroke: "currentColor"
21999
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21975
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
22000
21976
  strokeLinecap: "round",
22001
21977
  strokeLinejoin: "round",
22002
21978
  strokeWidth: 2,
@@ -22212,18 +22188,18 @@ const SavedItems = ({
22212
22188
  });
22213
22189
  };
22214
22190
 
22215
- var _path$g;
22191
+ var _path$f;
22216
22192
 
22217
- function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
22193
+ function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
22218
22194
 
22219
22195
  function SvgRefresh(props) {
22220
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
22196
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22221
22197
  className: "plc-w-4 plc-h-4 plc-mr-1",
22222
22198
  xmlns: "http://www.w3.org/2000/svg",
22223
22199
  fill: "none",
22224
22200
  viewBox: "0 0 24 24",
22225
22201
  stroke: "currentColor"
22226
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
22202
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22227
22203
  strokeLinecap: "round",
22228
22204
  strokeLinejoin: "round",
22229
22205
  strokeWidth: 2,
@@ -22231,35 +22207,35 @@ function SvgRefresh(props) {
22231
22207
  })));
22232
22208
  }
22233
22209
 
22234
- var _path$f;
22210
+ var _path$e;
22235
22211
 
22236
- function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
22212
+ function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
22237
22213
 
22238
22214
  function SvgCalendar(props) {
22239
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22215
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22240
22216
  xmlns: "http://www.w3.org/2000/svg",
22241
22217
  className: "plc-h-4 plc-w-4 plc-mr-1",
22242
22218
  viewBox: "0 0 20 20",
22243
22219
  fill: "currentColor"
22244
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22220
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22245
22221
  fillRule: "evenodd",
22246
22222
  d: "M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",
22247
22223
  clipRule: "evenodd"
22248
22224
  })));
22249
22225
  }
22250
22226
 
22251
- var _path$e;
22227
+ var _path$d;
22252
22228
 
22253
- function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
22229
+ function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
22254
22230
 
22255
22231
  function SvgPlus(props) {
22256
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22232
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22257
22233
  className: "plc-w-5 plc-h-5",
22258
22234
  xmlns: "http://www.w3.org/2000/svg",
22259
22235
  fill: "none",
22260
22236
  viewBox: "0 0 24 24",
22261
22237
  stroke: "currentColor"
22262
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22238
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22263
22239
  strokeLinecap: "round",
22264
22240
  strokeLinejoin: "round",
22265
22241
  strokeWidth: 2,
@@ -22267,17 +22243,17 @@ function SvgPlus(props) {
22267
22243
  })));
22268
22244
  }
22269
22245
 
22270
- var _path$d;
22246
+ var _path$c;
22271
22247
 
22272
- function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
22248
+ function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
22273
22249
 
22274
22250
  function SvgCheckMark(props) {
22275
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22251
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22276
22252
  className: "plc-w-4 plc-h-4 plc-mr-1",
22277
22253
  xmlns: "http://www.w3.org/2000/svg",
22278
22254
  viewBox: "0 0 20 20",
22279
22255
  fill: "currentColor"
22280
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22256
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22281
22257
  fillRule: "evenodd",
22282
22258
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
22283
22259
  clipRule: "evenodd"
@@ -22341,8 +22317,7 @@ const SubscriptionsItems = ({
22341
22317
  } = useTranslation("dashboard");
22342
22318
  const {
22343
22319
  switchView,
22344
- switchToAddressView,
22345
- switchToPaymentView
22320
+ isAuthenticated
22346
22321
  } = usePelcro();
22347
22322
  const subs = getNonDonationSubs();
22348
22323
  if (subs.length === 0) return null;
@@ -22384,12 +22359,7 @@ const SubscriptionsItems = ({
22384
22359
  const plan = window.Pelcro.plan.getById(plan_id);
22385
22360
  setProductAndPlan(product, plan);
22386
22361
  setSubscriptionIdToRenew(sub.id);
22387
-
22388
- if (product.address_required) {
22389
- return switchToAddressView();
22390
- }
22391
-
22392
- return switchToPaymentView();
22362
+ setView("plan-select");
22393
22363
  };
22394
22364
 
22395
22365
  const getPhases = () => {
@@ -22578,18 +22548,18 @@ Accordion.item = function AccordionItem({
22578
22548
  }, content)) : null;
22579
22549
  };
22580
22550
 
22581
- var _path$c;
22551
+ var _path$b;
22582
22552
 
22583
- function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
22553
+ function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
22584
22554
 
22585
22555
  function SvgExit(props) {
22586
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22556
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22587
22557
  className: "plc-w-6 plc-h-6",
22588
22558
  xmlns: "http://www.w3.org/2000/svg",
22589
22559
  fill: "none",
22590
22560
  viewBox: "0 0 24 24",
22591
22561
  stroke: "currentColor"
22592
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22562
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22593
22563
  strokeLinecap: "round",
22594
22564
  strokeLinejoin: "round",
22595
22565
  strokeWidth: 2,
@@ -22597,17 +22567,17 @@ function SvgExit(props) {
22597
22567
  })));
22598
22568
  }
22599
22569
 
22600
- var _path$b;
22570
+ var _path$a;
22601
22571
 
22602
- function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
22572
+ function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
22603
22573
 
22604
22574
  function SvgUser(props) {
22605
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22575
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22606
22576
  xmlns: "http://www.w3.org/2000/svg",
22607
22577
  fill: "none",
22608
22578
  viewBox: "0 0 24 24",
22609
22579
  stroke: "currentColor"
22610
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22580
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22611
22581
  strokeLinecap: "round",
22612
22582
  strokeLinejoin: "round",
22613
22583
  strokeWidth: 2,
@@ -22615,18 +22585,18 @@ function SvgUser(props) {
22615
22585
  })));
22616
22586
  }
22617
22587
 
22618
- var _path$a;
22588
+ var _path$9;
22619
22589
 
22620
- function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
22590
+ function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
22621
22591
 
22622
22592
  function SvgNewsletter(props) {
22623
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22593
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22624
22594
  xmlns: "http://www.w3.org/2000/svg",
22625
22595
  className: "plc-h-5 plc-w-5",
22626
22596
  fill: "none",
22627
22597
  viewBox: "0 0 24 24",
22628
22598
  stroke: "currentColor"
22629
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22599
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22630
22600
  strokeLinecap: "round",
22631
22601
  strokeLinejoin: "round",
22632
22602
  strokeWidth: 2,
@@ -22634,18 +22604,18 @@ function SvgNewsletter(props) {
22634
22604
  })));
22635
22605
  }
22636
22606
 
22637
- var _path$9;
22607
+ var _path$8;
22638
22608
 
22639
- function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
22609
+ function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
22640
22610
 
22641
22611
  function SvgDocument(props) {
22642
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22612
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22643
22613
  xmlns: "http://www.w3.org/2000/svg",
22644
22614
  className: "plc-h-6 plc-w-6 plc-mr-2",
22645
22615
  fill: "none",
22646
22616
  viewBox: "0 0 24 24",
22647
22617
  stroke: "currentColor"
22648
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22618
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22649
22619
  strokeLinecap: "round",
22650
22620
  strokeLinejoin: "round",
22651
22621
  strokeWidth: 2,
@@ -22653,18 +22623,18 @@ function SvgDocument(props) {
22653
22623
  })));
22654
22624
  }
22655
22625
 
22656
- var _path$8;
22626
+ var _path$7;
22657
22627
 
22658
- function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
22628
+ function _extends$8() { _extends$8 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
22659
22629
 
22660
22630
  function SvgPaymentCard(props) {
22661
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22631
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22662
22632
  className: "plc-w-6 plc-h-6 plc-mr-2",
22663
22633
  xmlns: "http://www.w3.org/2000/svg",
22664
22634
  fill: "none",
22665
22635
  viewBox: "0 0 24 24",
22666
22636
  stroke: "currentColor"
22667
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22637
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22668
22638
  strokeLinecap: "round",
22669
22639
  strokeLinejoin: "round",
22670
22640
  strokeWidth: 2,
@@ -22672,18 +22642,18 @@ function SvgPaymentCard(props) {
22672
22642
  })));
22673
22643
  }
22674
22644
 
22675
- var _path$7, _path2$1;
22645
+ var _path$6, _path2$1;
22676
22646
 
22677
- function _extends$8() { _extends$8 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
22647
+ function _extends$7() { _extends$7 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
22678
22648
 
22679
22649
  function SvgLocationPin(props) {
22680
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22650
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22681
22651
  className: "plc-w-6 plc-h-6 plc-mr-2",
22682
22652
  xmlns: "http://www.w3.org/2000/svg",
22683
22653
  fill: "none",
22684
22654
  viewBox: "0 0 24 24",
22685
22655
  stroke: "currentColor"
22686
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22656
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22687
22657
  strokeLinecap: "round",
22688
22658
  strokeLinejoin: "round",
22689
22659
  strokeWidth: 2,
@@ -22698,10 +22668,10 @@ function SvgLocationPin(props) {
22698
22668
 
22699
22669
  var _switch;
22700
22670
 
22701
- function _extends$7() { _extends$7 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
22671
+ function _extends$6() { _extends$6 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
22702
22672
 
22703
22673
  function SvgSubscription(props) {
22704
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22674
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22705
22675
  xmlns: "http://www.w3.org/2000/svg",
22706
22676
  viewBox: "0 0 100 125",
22707
22677
  fill: "currentColor"
@@ -22716,18 +22686,18 @@ function SvgSubscription(props) {
22716
22686
  }))))));
22717
22687
  }
22718
22688
 
22719
- var _path$6;
22689
+ var _path$5;
22720
22690
 
22721
- function _extends$6() { _extends$6 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
22691
+ function _extends$5() { _extends$5 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
22722
22692
 
22723
22693
  function SvgShopping(props) {
22724
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22694
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22725
22695
  className: "plc-w-6 plc-h-6 plc-mr-2",
22726
22696
  xmlns: "http://www.w3.org/2000/svg",
22727
22697
  fill: "none",
22728
22698
  viewBox: "0 0 24 24",
22729
22699
  stroke: "currentColor"
22730
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22700
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22731
22701
  strokeLinecap: "round",
22732
22702
  strokeLinejoin: "round",
22733
22703
  strokeWidth: 2,
@@ -22735,18 +22705,18 @@ function SvgShopping(props) {
22735
22705
  })));
22736
22706
  }
22737
22707
 
22738
- var _path$5;
22708
+ var _path$4;
22739
22709
 
22740
- function _extends$5() { _extends$5 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
22710
+ function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
22741
22711
 
22742
22712
  function SvgBookmark(props) {
22743
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22713
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22744
22714
  className: "plc-w-6 plc-h-6 plc-mr-2",
22745
22715
  xmlns: "http://www.w3.org/2000/svg",
22746
22716
  fill: "none",
22747
22717
  viewBox: "0 0 24 24",
22748
22718
  stroke: "currentColor"
22749
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22719
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22750
22720
  strokeLinecap: "round",
22751
22721
  strokeLinejoin: "round",
22752
22722
  strokeWidth: 2,
@@ -22754,33 +22724,33 @@ function SvgBookmark(props) {
22754
22724
  })));
22755
22725
  }
22756
22726
 
22757
- var _path$4;
22727
+ var _path$3;
22758
22728
 
22759
- function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
22729
+ function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
22760
22730
 
22761
22731
  function SvgKey(props) {
22762
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22732
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22763
22733
  xmlns: "http://www.w3.org/2000/svg",
22764
22734
  viewBox: "0 0 20 20",
22765
22735
  fill: "currentColor"
22766
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22736
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22767
22737
  fillRule: "evenodd",
22768
22738
  d: "M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",
22769
22739
  clipRule: "evenodd"
22770
22740
  })));
22771
22741
  }
22772
22742
 
22773
- var _path$3;
22743
+ var _path$2;
22774
22744
 
22775
- function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
22745
+ function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
22776
22746
 
22777
22747
  function SvgDonate(props) {
22778
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22748
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22779
22749
  width: 24,
22780
22750
  height: 24,
22781
22751
  fill: "currentColor",
22782
22752
  xmlns: "http://www.w3.org/2000/svg"
22783
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22753
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22784
22754
  d: "M4 21h9.62a3.995 3.995 0 003.037-1.397l5.102-5.952a1 1 0 00-.442-1.6l-1.968-.656a3.043 3.043 0 00-2.823.503l-3.185 2.547-.617-1.235A3.98 3.98 0 009.146 11H4c-1.103 0-2 .897-2 2v6c0 1.103.897 2 2 2zm0-8h5.146c.763 0 1.448.423 1.789 1.105l.447.895H7v2h6.014a.996.996 0 00.442-.11l.003-.001.004-.002h.003l.002-.001h.004l.001-.001c.009.003.003-.001.003-.001.01 0 .002-.001.002-.001h.001l.002-.001.003-.001.002-.001.002-.001.003-.001.002-.001c.003 0 .001-.001.002-.001l.003-.002.002-.001.002-.001.003-.001.002-.001h.001l.002-.001h.001l.002-.001.002-.001c.009-.001.003-.001.003-.001l.002-.001a.915.915 0 00.11-.078l4.146-3.317c.262-.208.623-.273.94-.167l.557.186-4.133 4.823a2.029 2.029 0 01-1.52.688H4v-6zM16 2h-.017c-.163.002-1.006.039-1.983.705-.951-.648-1.774-.7-1.968-.704L12.002 2h-.004c-.801 0-1.555.313-2.119.878C9.313 3.445 9 4.198 9 5s.313 1.555.861 2.104l3.414 3.586a1.006 1.006 0 001.45-.001l3.396-3.568C18.688 6.555 19 5.802 19 5s-.313-1.555-.878-2.121A2.978 2.978 0 0016.002 2H16zm1 3c0 .267-.104.518-.311.725L14 8.55l-2.707-2.843C11.104 5.518 11 5.267 11 5s.104-.518.294-.708A.977.977 0 0111.979 4c.025.001.502.032 1.067.485.081.065.163.139.247.222l.707.707.707-.707c.084-.083.166-.157.247-.222.529-.425.976-.478 1.052-.484a.987.987 0 01.701.292c.189.189.293.44.293.707z"
22785
22755
  })));
22786
22756
  }
@@ -23107,10 +23077,9 @@ class Dashboard extends React.Component {
23107
23077
  }) => {
23108
23078
  if (isGift) {
23109
23079
  this.props.setProductAndPlan(null, null, true);
23110
- return this.props.setView("plan-select");
23111
23080
  }
23112
23081
 
23113
- return this.props.setView("subscription-options");
23082
+ return this.props.setView("plan-select");
23114
23083
  });
23115
23084
 
23116
23085
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -23578,7 +23547,7 @@ const DashboardOpenButton = () => {
23578
23547
  };
23579
23548
  DashboardOpenButton.viewId = "dashboard-open";
23580
23549
 
23581
- const initialState$3 = {
23550
+ const initialState$2 = {
23582
23551
  imageSrc: null,
23583
23552
  crop: {
23584
23553
  x: 0,
@@ -23592,10 +23561,10 @@ const initialState$3 = {
23592
23561
  content: ""
23593
23562
  }
23594
23563
  };
23595
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
23564
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23596
23565
  const {
23597
- Provider: Provider$3
23598
- } = store$3;
23566
+ Provider: Provider$2
23567
+ } = store$2;
23599
23568
 
23600
23569
  const ProfilePicChangeContainer = ({
23601
23570
  style,
@@ -23729,21 +23698,21 @@ const ProfilePicChangeContainer = ({
23729
23698
  default:
23730
23699
  return state;
23731
23700
  }
23732
- }, initialState$3);
23701
+ }, initialState$2);
23733
23702
  return /*#__PURE__*/React__default['default'].createElement("div", {
23734
23703
  style: { ...style
23735
23704
  },
23736
23705
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23737
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
23706
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23738
23707
  value: {
23739
23708
  state,
23740
23709
  dispatch
23741
23710
  }
23742
23711
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
23743
- store: store$3,
23712
+ store: store$2,
23744
23713
  key: i
23745
23714
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
23746
- store: store$3
23715
+ store: store$2
23747
23716
  })));
23748
23717
  };
23749
23718
  /**
@@ -23805,7 +23774,7 @@ const ProfilePicChangeButton = ({
23805
23774
  isSubmitting
23806
23775
  },
23807
23776
  dispatch
23808
- } = React.useContext(store$3);
23777
+ } = React.useContext(store$2);
23809
23778
  const {
23810
23779
  t
23811
23780
  } = useTranslation("userEdit");
@@ -25173,7 +25142,7 @@ const ProfilePicChangeCropper = ({
25173
25142
  zoom
25174
25143
  },
25175
25144
  dispatch
25176
- } = React.useContext(store$3);
25145
+ } = React.useContext(store$2);
25177
25146
  return /*#__PURE__*/React__default['default'].createElement("div", {
25178
25147
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
25179
25148
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -25215,7 +25184,7 @@ const ProfilePicChangeZoom = ({
25215
25184
  zoom
25216
25185
  },
25217
25186
  dispatch
25218
- } = React.useContext(store$3);
25187
+ } = React.useContext(store$2);
25219
25188
  const {
25220
25189
  t
25221
25190
  } = useTranslation("userEdit");
@@ -25238,18 +25207,18 @@ const ProfilePicChangeZoom = ({
25238
25207
  }, otherProps)));
25239
25208
  };
25240
25209
 
25241
- var _path$2;
25210
+ var _path$1;
25242
25211
 
25243
- function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
25212
+ function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
25244
25213
 
25245
25214
  function SvgPhotograph(props) {
25246
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
25215
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25247
25216
  xmlns: "http://www.w3.org/2000/svg",
25248
25217
  className: "plc-h-6 plc-w-6",
25249
25218
  fill: "none",
25250
25219
  viewBox: "0 0 24 24",
25251
25220
  stroke: "currentColor"
25252
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
25221
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25253
25222
  strokeLinecap: "round",
25254
25223
  strokeLinejoin: "round",
25255
25224
  strokeWidth: 2,
@@ -25267,7 +25236,7 @@ const ProfilePicChangeSelectButton = ({
25267
25236
  state: {
25268
25237
  isSubmitting
25269
25238
  }
25270
- } = React.useContext(store$3);
25239
+ } = React.useContext(store$2);
25271
25240
  const {
25272
25241
  t
25273
25242
  } = useTranslation("userEdit");
@@ -25309,7 +25278,7 @@ const ProfilePicChangeRemoveButton = ({
25309
25278
  state: {
25310
25279
  isSubmitting
25311
25280
  }
25312
- } = React.useContext(store$3);
25281
+ } = React.useContext(store$2);
25313
25282
  const {
25314
25283
  t
25315
25284
  } = useTranslation("userEdit");
@@ -25332,7 +25301,7 @@ const ProfilePicChangeWrapper = () => {
25332
25301
  state: {
25333
25302
  imageSrc
25334
25303
  }
25335
- } = React.useContext(store$3);
25304
+ } = React.useContext(store$2);
25336
25305
  const {
25337
25306
  t
25338
25307
  } = useTranslation("userEdit");
@@ -25394,17 +25363,17 @@ function ProfilePicChangeModal({
25394
25363
  }
25395
25364
  ProfilePicChangeModal.viewId = "profile-picture";
25396
25365
 
25397
- const initialState$2 = {
25366
+ const initialState$1 = {
25398
25367
  isSubmitting: false,
25399
25368
  alert: {
25400
25369
  type: "error",
25401
25370
  content: ""
25402
25371
  }
25403
25372
  };
25404
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
25373
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25405
25374
  const {
25406
- Provider: Provider$2
25407
- } = store$2;
25375
+ Provider: Provider$1
25376
+ } = store$1;
25408
25377
 
25409
25378
  const EmailVerifyContainer = ({
25410
25379
  style,
@@ -25467,21 +25436,21 @@ const EmailVerifyContainer = ({
25467
25436
  default:
25468
25437
  return state;
25469
25438
  }
25470
- }, initialState$2);
25439
+ }, initialState$1);
25471
25440
  return /*#__PURE__*/React__default['default'].createElement("div", {
25472
25441
  style: { ...style
25473
25442
  },
25474
25443
  className: `pelcro-container pelcro-email-verify-container ${className}`
25475
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
25444
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25476
25445
  value: {
25477
25446
  state,
25478
25447
  dispatch
25479
25448
  }
25480
25449
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25481
- store: store$2,
25450
+ store: store$1,
25482
25451
  key: i
25483
25452
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25484
- store: store$2
25453
+ store: store$1
25485
25454
  })));
25486
25455
  };
25487
25456
 
@@ -25495,7 +25464,7 @@ const EmailVerifyResendButton = ({
25495
25464
  state: {
25496
25465
  isSubmitting
25497
25466
  }
25498
- } = React.useContext(store$2);
25467
+ } = React.useContext(store$1);
25499
25468
  const {
25500
25469
  t
25501
25470
  } = useTranslation("verifyEmail");
@@ -25510,16 +25479,16 @@ const EmailVerifyResendButton = ({
25510
25479
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
25511
25480
  };
25512
25481
 
25513
- var _path$1, _path2;
25482
+ var _path, _path2;
25514
25483
 
25515
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
25484
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25516
25485
 
25517
25486
  function SvgEmailVerify(props) {
25518
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25487
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25519
25488
  className: "plc-w-6 plc-h-6",
25520
25489
  viewBox: "0 0 700 700",
25521
25490
  xmlns: "http://www.w3.org/2000/svg"
25522
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25491
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25523
25492
  d: "M583.01 231.93a15.008 15.008 0 00-.887-3.875c-.562-1.254-1.129-2.508-1.695-3.762a14.686 14.686 0 00-1.898-1.789c-.438-.437-.653-1.027-1.153-1.414l-56.266-44.164v-52.484a15.555 15.555 0 00-15.554-15.555H434.56l-74.945-58.895a15.547 15.547 0 00-19.227 0l-74.945 58.895h-70.996a15.555 15.555 0 00-15.555 15.555v52.484l-56.266 44.16c-.496.39-.715.996-1.152 1.43v.004a13.37 13.37 0 00-1.898 1.773c-.22.426-.414.86-.59 1.305a14.158 14.158 0 00-1.106 2.457 15.009 15.009 0 00-.886 3.875c0 .48-.329.918-.329 1.398l.004 264.45a15.555 15.555 0 0015.555 15.555h435.55a15.555 15.555 0 0015.555-15.555v-264.45c0-.48-.278-.918-.325-1.398zm-41.176.809l-20.723 14.809v-31.11zm-191.83-150.73l34.223 26.883h-68.445zm-140 57.992h280v124.45c.07 1.593.383 3.168.934 4.664l-140.93 100.66-140.46-100.33c.214-.77.37-1.555.464-2.348zm-31.109 107.55l-20.719-14.81 20.719-16.27zm-31.113 234.67V263.56l193.18 137.99a15.562 15.562 0 0018.078 0l193.18-137.99v218.66z"
25524
25493
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
25525
25494
  d: "M324.33 291.81a15.56 15.56 0 0020.582-.297l85.555-77.777a15.56 15.56 0 00-20.938-23.023l-75.398 68.539-44.023-37.723a15.54 15.54 0 00-11.46-4.106 15.553 15.553 0 00-8.758 27.718z"
@@ -25623,11 +25592,11 @@ const invoicePaymentSubmitButton = props => {
25623
25592
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
25624
25593
  };
25625
25594
 
25626
- const initialState$1 = {};
25627
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25595
+ const initialState = {};
25596
+ const store = /*#__PURE__*/React.createContext(initialState);
25628
25597
  const {
25629
- Provider: Provider$1
25630
- } = store$1;
25598
+ Provider
25599
+ } = store;
25631
25600
 
25632
25601
  const InvoiceDetailsContainer = ({
25633
25602
  style,
@@ -25648,21 +25617,21 @@ const InvoiceDetailsContainer = ({
25648
25617
  default:
25649
25618
  return state;
25650
25619
  }
25651
- }, initialState$1);
25620
+ }, initialState);
25652
25621
  return /*#__PURE__*/React__default['default'].createElement("div", {
25653
25622
  style: { ...style
25654
25623
  },
25655
25624
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25656
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25625
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25657
25626
  value: {
25658
25627
  state,
25659
25628
  dispatch
25660
25629
  }
25661
25630
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25662
- store: store$1,
25631
+ store,
25663
25632
  key: i
25664
25633
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25665
- store: store$1
25634
+ store
25666
25635
  })));
25667
25636
  };
25668
25637
 
@@ -25694,7 +25663,7 @@ const InvoiceDetailsPayButton = ({
25694
25663
  }) => {
25695
25664
  const {
25696
25665
  dispatch
25697
- } = React.useContext(store$1);
25666
+ } = React.useContext(store);
25698
25667
  const {
25699
25668
  t
25700
25669
  } = useTranslation("invoiceDetails");
@@ -25716,6 +25685,8 @@ const InvoiceDetailsView = props => {
25716
25685
  invoice
25717
25686
  } = usePelcro();
25718
25687
  const showPayButton = canPayInvoice(invoice);
25688
+ const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
25689
+ const hasPlanDetails = Boolean(invoice.plan);
25719
25690
  const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25720
25691
  const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25721
25692
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -25733,7 +25704,7 @@ const InvoiceDetailsView = props => {
25733
25704
  className: "plc-font-bold pelcro-invoice-summary-title"
25734
25705
  }, t("labels.summary")), invoice && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
25735
25706
  className: "plc-mr-2 pelcro-invoice-creation-date"
25736
- }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default['default'].createElement("div", {
25707
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), hasPlanDetails && /*#__PURE__*/React__default['default'].createElement("div", {
25737
25708
  className: "plc-flex plc-items-center plc-pt-2 plc-mt-2 plc-border-t plc-border-gray-400 plc-min-h-12 plc-justify-between pelcro-invoice-plan-wrapper"
25738
25709
  }, /*#__PURE__*/React__default['default'].createElement("div", {
25739
25710
  className: "plc-break-words pelcro-invoice-plan-name"
@@ -25759,7 +25730,7 @@ const InvoiceDetailsView = props => {
25759
25730
  className: "plc-font-semibold pelcro-invoice-total"
25760
25731
  }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default['default'].createElement("div", {
25761
25732
  className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25762
- }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25733
+ }, showDownloadButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25763
25734
  url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25764
25735
  className: "plc-w-full plc-text-center"
25765
25736
  }), showPayButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsPayButton, {
@@ -25799,232 +25770,6 @@ const InvoiceDetailsModal = ({
25799
25770
  };
25800
25771
  InvoiceDetailsModal.viewId = "invoice-details";
25801
25772
 
25802
- const initialState = {
25803
- selectedOption: ""
25804
- };
25805
- const store = /*#__PURE__*/React.createContext(initialState);
25806
- const {
25807
- Provider
25808
- } = store;
25809
-
25810
- const SubscriptionOptionsContainer = ({
25811
- style,
25812
- className = "",
25813
- onRenewSubSuccess = () => {},
25814
- onNewSubSuccess = () => {},
25815
- children,
25816
- ...props
25817
- }) => {
25818
- const submit = ({
25819
- selectedOption
25820
- }, dispatch) => {
25821
- if (selectedOption === "renew") return onRenewSubSuccess();
25822
- if (selectedOption === "new") return onNewSubSuccess();
25823
- };
25824
-
25825
- const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25826
- switch (action.type) {
25827
- case SWITCH_TO_NEW:
25828
- return lib_7({ ...state,
25829
- selectedOption: "new"
25830
- });
25831
-
25832
- case SWITCH_TO_RENEW:
25833
- return lib_7({ ...state,
25834
- selectedOption: "renew"
25835
- });
25836
-
25837
- case HANDLE_SUBMIT:
25838
- return lib_4((state, dispatch) => submit(state));
25839
-
25840
- default:
25841
- return state;
25842
- }
25843
- }, initialState);
25844
- return /*#__PURE__*/React__default['default'].createElement("div", {
25845
- style: { ...style
25846
- },
25847
- className: `pelcro-container pelcro-subscription-options-container ${className}`
25848
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25849
- value: {
25850
- state,
25851
- dispatch
25852
- }
25853
- }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25854
- store,
25855
- key: i
25856
- })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25857
- store
25858
- })));
25859
- };
25860
-
25861
- var _path;
25862
-
25863
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25864
-
25865
- function SvgPlusCircle(props) {
25866
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25867
- xmlns: "http://www.w3.org/2000/svg",
25868
- className: "plc-h-6 plc-w-6",
25869
- fill: "none",
25870
- viewBox: "0 0 24 24",
25871
- stroke: "currentColor",
25872
- strokeWidth: 2
25873
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25874
- strokeLinecap: "round",
25875
- strokeLinejoin: "round",
25876
- d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25877
- })));
25878
- }
25879
-
25880
- const SubscriptionOptionsNewButton = ({
25881
- name,
25882
- onClick,
25883
- ...otherProps
25884
- }) => {
25885
- const {
25886
- dispatch,
25887
- state: {
25888
- selectedOption
25889
- }
25890
- } = React.useContext(store);
25891
- const {
25892
- t
25893
- } = useTranslation("subscriptionOptions");
25894
- const isChecked = selectedOption === "new";
25895
- return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25896
- className: "plc-hidden pelcro-new-sub-option",
25897
- labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-new-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25898
- id: "pelcro-new-sub-option",
25899
- name: "option",
25900
- onChange: () => {
25901
- dispatch({
25902
- type: SWITCH_TO_NEW
25903
- });
25904
- onClick === null || onClick === void 0 ? void 0 : onClick();
25905
- },
25906
- checked: isChecked
25907
- }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25908
- className: "plc-w-full plc-h-full plc-mr-0"
25909
- }));
25910
- };
25911
-
25912
- const SubscriptionOptionsRenewButton = ({
25913
- name,
25914
- onClick,
25915
- ...otherProps
25916
- }) => {
25917
- const {
25918
- dispatch,
25919
- state: {
25920
- selectedOption
25921
- }
25922
- } = React.useContext(store);
25923
- const {
25924
- t
25925
- } = useTranslation("subscriptionOptions");
25926
- const isChecked = selectedOption === "renew";
25927
- return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25928
- className: "plc-hidden pelcro-renew-sub-option",
25929
- labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-renew-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25930
- id: "pelcro-renew-sub-option",
25931
- name: "option",
25932
- onChange: () => {
25933
- dispatch({
25934
- type: SWITCH_TO_RENEW
25935
- });
25936
- onClick === null || onClick === void 0 ? void 0 : onClick();
25937
- },
25938
- checked: isChecked
25939
- }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
25940
- className: "plc-w-full plc-h-full plc-mr-0"
25941
- }));
25942
- };
25943
-
25944
- const SubscriptionOptionsSubmit = ({
25945
- name,
25946
- onClick,
25947
- ...otherProps
25948
- }) => {
25949
- const {
25950
- dispatch,
25951
- state: {
25952
- selectedOption
25953
- }
25954
- } = React.useContext(store);
25955
- const {
25956
- t
25957
- } = useTranslation("subscriptionOptions");
25958
- return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25959
- onClick: () => {
25960
- dispatch({
25961
- type: HANDLE_SUBMIT
25962
- });
25963
- onClick === null || onClick === void 0 ? void 0 : onClick();
25964
- },
25965
- disabled: !selectedOption
25966
- }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25967
- };
25968
-
25969
- const SubscriptionOptionsView = props => {
25970
- const {
25971
- t
25972
- } = useTranslation("subscriptionOptions");
25973
- return /*#__PURE__*/React__default['default'].createElement("div", {
25974
- id: "pelcro-subscription-options-view"
25975
- }, /*#__PURE__*/React__default['default'].createElement("div", {
25976
- className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25977
- }, /*#__PURE__*/React__default['default'].createElement("h4", {
25978
- className: "plc-text-2xl plc-font-semibold"
25979
- }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
25980
- action: "javascript:void(0);",
25981
- className: "plc-mt-2 pelcro-form"
25982
- }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25983
- className: "plc-flex plc-justify-between plc-items-center"
25984
- }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
25985
- role: "submit",
25986
- className: "plc-mt-4 plc-w-full",
25987
- name: t("next"),
25988
- id: "pelcro-submit"
25989
- }))));
25990
- };
25991
-
25992
- const SubscriptionOptionsModal = ({
25993
- onDisplay,
25994
- onClose,
25995
- ...otherProps
25996
- }) => {
25997
- const {
25998
- switchView,
25999
- setProductsList
26000
- } = usePelcro();
26001
-
26002
- const onRenewSubSuccess = () => {
26003
- var _otherProps$onRenewSu;
26004
-
26005
- (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
26006
- setProductsList(getRenewableProducts());
26007
- switchView("_plan-select-renew");
26008
- };
26009
-
26010
- const onNewSubSuccess = () => {
26011
- var _otherProps$onNewSubS;
26012
-
26013
- (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
26014
- switchView("plan-select");
26015
- };
26016
-
26017
- return /*#__PURE__*/React__default['default'].createElement(Modal, {
26018
- onDisplay: onDisplay,
26019
- onClose: onClose,
26020
- id: "pelcro-subscription-options-modal"
26021
- }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
26022
- onNewSubSuccess: onNewSubSuccess,
26023
- onRenewSubSuccess: onRenewSubSuccess
26024
- }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
26025
- };
26026
- SubscriptionOptionsModal.viewId = "subscription-options";
26027
-
26028
25773
  exports.AddressCreateCity = AddressCreateCity;
26029
25774
  exports.AddressCreateContainer = AddressCreateContainer;
26030
25775
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -26202,12 +25947,6 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
26202
25947
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
26203
25948
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
26204
25949
  exports.SubscriptionCreateView = SubscriptionCreateView;
26205
- exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
26206
- exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
26207
- exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
26208
- exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
26209
- exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
26210
- exports.SubscriptionOptionsView = SubscriptionOptionsView;
26211
25950
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
26212
25951
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
26213
25952
  exports.SubscriptionRenewView = SubscriptionRenewView;