@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.esm.js CHANGED
@@ -3431,9 +3431,9 @@ var paymentMethod_fr = {
3431
3431
  select: select
3432
3432
  };
3433
3433
 
3434
- var title$h = "Enter your email to subscribe to our newsletter";
3434
+ var title$f = "Enter your email to subscribe to our newsletter";
3435
3435
  var updateTitle$1 = "Update newsletter selections";
3436
- var subtitle$9 = "We may use your email for other marketing communication";
3436
+ var subtitle$7 = "We may use your email for other marketing communication";
3437
3437
  var labels$p = {
3438
3438
  submit: "Submit",
3439
3439
  firstName: "First name",
@@ -3450,16 +3450,16 @@ var messages$r = {
3450
3450
  here: "here"
3451
3451
  };
3452
3452
  var newsletter_en = {
3453
- title: title$h,
3453
+ title: title$f,
3454
3454
  updateTitle: updateTitle$1,
3455
- subtitle: subtitle$9,
3455
+ subtitle: subtitle$7,
3456
3456
  labels: labels$p,
3457
3457
  messages: messages$r
3458
3458
  };
3459
3459
 
3460
- var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3460
+ var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3461
3461
  var updateTitle = "Mettre à jour son choix d'infolettres";
3462
- var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3462
+ var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3463
3463
  var labels$o = {
3464
3464
  submit: "Lire l’article !",
3465
3465
  firstName: "Prénom",
@@ -3476,9 +3476,9 @@ var messages$q = {
3476
3476
  here: "ici"
3477
3477
  };
3478
3478
  var newsletter_fr = {
3479
- title: title$g,
3479
+ title: title$e,
3480
3480
  updateTitle: updateTitle,
3481
- subtitle: subtitle$8,
3481
+ subtitle: subtitle$6,
3482
3482
  labels: labels$o,
3483
3483
  messages: messages$q
3484
3484
  };
@@ -3735,8 +3735,8 @@ var login_fr = {
3735
3735
  errors: errors$4
3736
3736
  };
3737
3737
 
3738
- var title$f = "Create an account";
3739
- var subtitle$7 = "Enter your email and password below";
3738
+ var title$d = "Create an account";
3739
+ var subtitle$5 = "Enter your email and password below";
3740
3740
  var labels$h = {
3741
3741
  signUpFacebook: "Sign up with Facebook",
3742
3742
  signUpGoogle: "Sign up with Google",
@@ -3821,8 +3821,8 @@ var redeem$1 = {
3821
3821
  }
3822
3822
  };
3823
3823
  var register_en = {
3824
- title: title$f,
3825
- subtitle: subtitle$7,
3824
+ title: title$d,
3825
+ subtitle: subtitle$5,
3826
3826
  labels: labels$h,
3827
3827
  messages: messages$h,
3828
3828
  errors: errors$3,
@@ -3830,8 +3830,8 @@ var register_en = {
3830
3830
  redeem: redeem$1
3831
3831
  };
3832
3832
 
3833
- var title$e = "Créer un compte";
3834
- var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3833
+ var title$c = "Créer un compte";
3834
+ var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3835
3835
  var labels$g = {
3836
3836
  signUpFacebook: "Inscrivez-vous avec Facebook",
3837
3837
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3917,8 +3917,8 @@ var redeem = {
3917
3917
  }
3918
3918
  };
3919
3919
  var register_fr = {
3920
- title: title$e,
3921
- subtitle: subtitle$6,
3920
+ title: title$c,
3921
+ subtitle: subtitle$4,
3922
3922
  labels: labels$g,
3923
3923
  messages: messages$g,
3924
3924
  errors: errors$2,
@@ -3978,7 +3978,7 @@ var userEdit_fr = {
3978
3978
  messages: messages$e
3979
3979
  };
3980
3980
 
3981
- var title$d = "Enter your shipping address";
3981
+ var title$b = "Enter your shipping address";
3982
3982
  var selectAddressTitle$1 = "Please select an address";
3983
3983
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
3984
3984
  var labels$d = {
@@ -4001,7 +4001,7 @@ var messages$d = {
4001
4001
  subRedeemed: "Your subscription has been redeemed."
4002
4002
  };
4003
4003
  var address_en = {
4004
- title: title$d,
4004
+ title: title$b,
4005
4005
  selectAddressTitle: selectAddressTitle$1,
4006
4006
  selectAddressSubtitle: selectAddressSubtitle$1,
4007
4007
  labels: labels$d,
@@ -4009,7 +4009,7 @@ var address_en = {
4009
4009
  messages: messages$d
4010
4010
  };
4011
4011
 
4012
- var title$c = "Entrez votre adresse de livraison";
4012
+ var title$a = "Entrez votre adresse de livraison";
4013
4013
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4014
4014
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4015
4015
  var labels$c = {
@@ -4032,7 +4032,7 @@ var messages$c = {
4032
4032
  subRedeemed: "Votre abonnement a bien été activé."
4033
4033
  };
4034
4034
  var address_fr = {
4035
- title: title$c,
4035
+ title: title$a,
4036
4036
  selectAddressTitle: selectAddressTitle,
4037
4037
  selectAddressSubtitle: selectAddressSubtitle,
4038
4038
  labels: labels$c,
@@ -4040,8 +4040,8 @@ var address_fr = {
4040
4040
  messages: messages$c
4041
4041
  };
4042
4042
 
4043
- var title$b = "Reset your password";
4044
- var subtitle$5 = "Enter a new password below";
4043
+ var title$9 = "Reset your password";
4044
+ var subtitle$3 = "Enter a new password below";
4045
4045
  var email$3 = "Email";
4046
4046
  var password$3 = "Password";
4047
4047
  var confirmPassword$1 = "Confirm password";
@@ -4049,8 +4049,8 @@ var submit$5 = "Submit";
4049
4049
  var required$5 = "Required";
4050
4050
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4051
4051
  var passwordReset_en = {
4052
- title: title$b,
4053
- subtitle: subtitle$5,
4052
+ title: title$9,
4053
+ subtitle: subtitle$3,
4054
4054
  email: email$3,
4055
4055
  password: password$3,
4056
4056
  confirmPassword: confirmPassword$1,
@@ -4059,8 +4059,8 @@ var passwordReset_en = {
4059
4059
  passwordUpdated: passwordUpdated$1
4060
4060
  };
4061
4061
 
4062
- var title$a = "Réinitialiser votre mot de passe";
4063
- var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4062
+ var title$8 = "Réinitialiser votre mot de passe";
4063
+ var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4064
4064
  var email$2 = "Adresse courriel";
4065
4065
  var password$2 = "Mot de passe";
4066
4066
  var confirmPassword = "Confirmer le mot de passe";
@@ -4068,8 +4068,8 @@ var submit$4 = "Soumettre";
4068
4068
  var required$4 = "Champs obligatoires";
4069
4069
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4070
4070
  var passwordReset_fr = {
4071
- title: title$a,
4072
- subtitle: subtitle$4,
4071
+ title: title$8,
4072
+ subtitle: subtitle$2,
4073
4073
  email: email$2,
4074
4074
  password: password$2,
4075
4075
  confirmPassword: confirmPassword,
@@ -4078,7 +4078,7 @@ var passwordReset_fr = {
4078
4078
  passwordUpdated: passwordUpdated
4079
4079
  };
4080
4080
 
4081
- var title$9 = "Forgot your password?";
4081
+ var title$7 = "Forgot your password?";
4082
4082
  var email$1 = "Email";
4083
4083
  var password$1 = "Password";
4084
4084
  var submit$3 = "Submit";
@@ -4089,7 +4089,7 @@ var messages$b = {
4089
4089
  loginHere: "login here."
4090
4090
  };
4091
4091
  var passwordForgot_en = {
4092
- title: title$9,
4092
+ title: title$7,
4093
4093
  email: email$1,
4094
4094
  password: password$1,
4095
4095
  submit: submit$3,
@@ -4098,7 +4098,7 @@ var passwordForgot_en = {
4098
4098
  messages: messages$b
4099
4099
  };
4100
4100
 
4101
- var title$8 = "Mot de passe oublié ?";
4101
+ var title$6 = "Mot de passe oublié ?";
4102
4102
  var email = "Courriel";
4103
4103
  var password = "Mot de passe";
4104
4104
  var submit$2 = "Soumettre";
@@ -4109,7 +4109,7 @@ var messages$a = {
4109
4109
  loginHere: "Connectez-vous ici"
4110
4110
  };
4111
4111
  var passwordForgot_fr = {
4112
- title: title$8,
4112
+ title: title$6,
4113
4113
  email: email,
4114
4114
  password: password,
4115
4115
  submit: submit$2,
@@ -4118,7 +4118,7 @@ var passwordForgot_fr = {
4118
4118
  messages: messages$a
4119
4119
  };
4120
4120
 
4121
- var title$7 = "Change your password";
4121
+ var title$5 = "Change your password";
4122
4122
  var currentPassword$1 = "Current password";
4123
4123
  var newPassword$1 = "New password";
4124
4124
  var confirmNewPassword$1 = "Confirm new password";
@@ -4128,7 +4128,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4128
4128
  var passwordsNotMatching$1 = "Passwords don't match";
4129
4129
  var weakPassword$1 = "Your password must contain at least 6 characters";
4130
4130
  var passwordChange_en = {
4131
- title: title$7,
4131
+ title: title$5,
4132
4132
  currentPassword: currentPassword$1,
4133
4133
  newPassword: newPassword$1,
4134
4134
  confirmNewPassword: confirmNewPassword$1,
@@ -4139,7 +4139,7 @@ var passwordChange_en = {
4139
4139
  weakPassword: weakPassword$1
4140
4140
  };
4141
4141
 
4142
- var title$6 = "Changez votre mot de passe";
4142
+ var title$4 = "Changez votre mot de passe";
4143
4143
  var currentPassword = "Mot de passe actuel";
4144
4144
  var newPassword = "Nouveau mot de passe";
4145
4145
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4149,7 +4149,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4149
4149
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4150
4150
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4151
4151
  var passwordChange_fr = {
4152
- title: title$6,
4152
+ title: title$4,
4153
4153
  currentPassword: currentPassword,
4154
4154
  newPassword: newPassword,
4155
4155
  confirmNewPassword: confirmNewPassword,
@@ -4160,8 +4160,8 @@ var passwordChange_fr = {
4160
4160
  weakPassword: weakPassword
4161
4161
  };
4162
4162
 
4163
- var title$5 = "Votre panier";
4164
- var subtitle$3 = "Terminez votre achat ci-dessous";
4163
+ var title$3 = "Votre panier";
4164
+ var subtitle$1 = "Terminez votre achat ci-dessous";
4165
4165
  var name$1 = "Produit";
4166
4166
  var quantity$1 = "Quantité";
4167
4167
  var price$1 = "Prix";
@@ -4172,8 +4172,8 @@ var confirm$3 = "Passer à la caisse";
4172
4172
  var empty$1 = "Votre panier est vide.";
4173
4173
  var removeAll$1 = "Vider";
4174
4174
  var cart_fr = {
4175
- title: title$5,
4176
- subtitle: subtitle$3,
4175
+ title: title$3,
4176
+ subtitle: subtitle$1,
4177
4177
  name: name$1,
4178
4178
  quantity: quantity$1,
4179
4179
  price: price$1,
@@ -4185,8 +4185,8 @@ var cart_fr = {
4185
4185
  removeAll: removeAll$1
4186
4186
  };
4187
4187
 
4188
- var title$4 = "Your shopping cart";
4189
- var subtitle$2 = "Comple your purchase below";
4188
+ var title$2 = "Your shopping cart";
4189
+ var subtitle = "Comple your purchase below";
4190
4190
  var name = "Name";
4191
4191
  var quantity = "Quantity";
4192
4192
  var price = "Price";
@@ -4197,8 +4197,8 @@ var confirm$2 = "Checkout";
4197
4197
  var empty = "Your cart is empty.";
4198
4198
  var removeAll = "Remove all";
4199
4199
  var cart_en = {
4200
- title: title$4,
4201
- subtitle: subtitle$2,
4200
+ title: title$2,
4201
+ subtitle: subtitle,
4202
4202
  name: name,
4203
4203
  quantity: quantity,
4204
4204
  price: price,
@@ -4636,7 +4636,7 @@ var verifyEmail_fr = {
4636
4636
  messages: messages
4637
4637
  };
4638
4638
 
4639
- var title$3 = "Invoice details";
4639
+ var title$1 = "Invoice details";
4640
4640
  var labels$1 = {
4641
4641
  summary: "Summary",
4642
4642
  total: "Total",
@@ -4649,55 +4649,29 @@ var buttons$1 = {
4649
4649
  pay: "Pay now"
4650
4650
  };
4651
4651
  var invoiceDetails_en = {
4652
- title: title$3,
4652
+ title: title$1,
4653
4653
  labels: labels$1,
4654
4654
  buttons: buttons$1
4655
4655
  };
4656
4656
 
4657
- var title$2 = "Invoice details";
4657
+ var title = "Détails de la facture";
4658
4658
  var labels = {
4659
- summary: "Summary",
4659
+ summary: "Résumé",
4660
4660
  total: "Total",
4661
- amountPaid: "Amount paid",
4662
- amountDue: "Amount due",
4663
- creationDate: "Created on:"
4661
+ amountPaid: "Montant payé",
4662
+ amountDue: "Montant ",
4663
+ creationDate: "Créé le:"
4664
4664
  };
4665
4665
  var buttons = {
4666
- download: "Download",
4667
- pay: "Pay now"
4666
+ download: "Télécharger",
4667
+ pay: "Payer"
4668
4668
  };
4669
4669
  var invoiceDetails_fr = {
4670
- title: title$2,
4670
+ title: title,
4671
4671
  labels: labels,
4672
4672
  buttons: buttons
4673
4673
  };
4674
4674
 
4675
- var title$1 = "Renewal options";
4676
- var subtitle$1 = "Select one of the options below to continue";
4677
- var next$1 = "Next";
4678
- var addNew$1 = "Add Another Subscription";
4679
- var renew$1 = "Renew Existing Subscription";
4680
- var subscriptionOptions_en = {
4681
- title: title$1,
4682
- subtitle: subtitle$1,
4683
- next: next$1,
4684
- addNew: addNew$1,
4685
- renew: renew$1
4686
- };
4687
-
4688
- var title = "Renewal options";
4689
- var subtitle = "Select one of the options below to continue";
4690
- var next = "Next";
4691
- var addNew = "Add Another Subscription";
4692
- var renew = "Renew Existing Subscription";
4693
- var subscriptionOptions_fr = {
4694
- title: title,
4695
- subtitle: subtitle,
4696
- next: next,
4697
- addNew: addNew,
4698
- renew: renew
4699
- };
4700
-
4701
4675
  function create$1(createState) {
4702
4676
  let state;
4703
4677
  const listeners = new Set();
@@ -6047,7 +6021,7 @@ class PelcroActions {
6047
6021
  view,
6048
6022
  cartItems,
6049
6023
  ...otherStateFields
6050
- } = initialState$j;
6024
+ } = initialState$i;
6051
6025
  this.set(otherStateFields);
6052
6026
  });
6053
6027
 
@@ -6071,16 +6045,6 @@ class PelcroActions {
6071
6045
  });
6072
6046
  }
6073
6047
 
6074
- if (view === "subscription-options") {
6075
- const noRenewableProducts = getRenewableProducts().length === 0;
6076
-
6077
- if (noRenewableProducts) {
6078
- return this.set({
6079
- view: "plan-select"
6080
- });
6081
- }
6082
- }
6083
-
6084
6048
  this.set({
6085
6049
  view
6086
6050
  });
@@ -6155,26 +6119,6 @@ class PelcroActions {
6155
6119
  }
6156
6120
  });
6157
6121
 
6158
- _defineProperty$3(this, "setProductsList", products => {
6159
- if (!Array.isArray(products)) {
6160
- return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6161
- }
6162
-
6163
- const allowedProducts = window.Pelcro.product.list();
6164
- const validProducts = products.filter(product => {
6165
- 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));
6166
-
6167
- if (!isValidProduct) {
6168
- 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);
6169
- }
6170
-
6171
- return isValidProduct;
6172
- });
6173
- this.set({
6174
- productsList: validProducts
6175
- });
6176
- });
6177
-
6178
6122
  _defineProperty$3(this, "setProduct", id => {
6179
6123
  const product = window.Pelcro.product.getById(id);
6180
6124
  if (!product) return console.error("invalid product id");
@@ -6396,12 +6340,10 @@ class PelcroCallbacks {
6396
6340
 
6397
6341
  }
6398
6342
 
6399
- var _window$Pelcro$produc, _window$Pelcro;
6400
- const initialState$j = {
6343
+ const initialState$i = {
6401
6344
  // View
6402
6345
  view: null,
6403
6346
  // Plans
6404
- 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 : [],
6405
6347
  product: null,
6406
6348
  plan: null,
6407
6349
  isGift: false,
@@ -6428,7 +6370,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6428
6370
  return {
6429
6371
  // Store setter
6430
6372
  set,
6431
- ...initialState$j,
6373
+ ...initialState$i,
6432
6374
  // State actions
6433
6375
  ...actions,
6434
6376
  // Callbacks
@@ -6783,30 +6725,6 @@ function userMustVerifyEmail() {
6783
6725
  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;
6784
6726
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6785
6727
  }
6786
- function getRenewableProducts() {
6787
- var _window$Pelcro$subscr, _window$Pelcro$subscr2;
6788
-
6789
- 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 : [];
6790
- const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6791
- const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6792
- const {
6793
- productsList
6794
- } = usePelcro.getStore();
6795
- return productsList.map(product => {
6796
- if (renewableProductsIds.includes(product.id)) {
6797
- const renewablePlans = getRenewablePlansOnly(product);
6798
- return { ...product,
6799
- plans: renewablePlans
6800
- };
6801
- }
6802
- }).filter(product => product);
6803
-
6804
- function getRenewablePlansOnly(product) {
6805
- var _product$plans$filter, _product$plans;
6806
-
6807
- 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 : [];
6808
- }
6809
- }
6810
6728
 
6811
6729
  const resources = {
6812
6730
  en: {
@@ -6831,8 +6749,7 @@ const resources = {
6831
6749
  dashboard: dashboard_en,
6832
6750
  select: select_en,
6833
6751
  notification: notification_en,
6834
- invoiceDetails: invoiceDetails_en,
6835
- subscriptionOptions: subscriptionOptions_en
6752
+ invoiceDetails: invoiceDetails_en
6836
6753
  },
6837
6754
  fr: {
6838
6755
  common: common_fr,
@@ -6856,8 +6773,7 @@ const resources = {
6856
6773
  dashboard: dashboard_fr,
6857
6774
  select: select_fr,
6858
6775
  notification: notification_fr,
6859
- invoiceDetails: invoiceDetails_fr,
6860
- subscriptionOptions: subscriptionOptions_fr
6776
+ invoiceDetails: invoiceDetails_fr
6861
6777
  }
6862
6778
  }; // set UI language to the page language or default to the language in site settings
6863
6779
 
@@ -7148,8 +7064,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7148
7064
 
7149
7065
  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}}
7150
7066
 
7151
- function _extends$A() {
7152
- _extends$A = Object.assign || function (target) {
7067
+ function _extends$z() {
7068
+ _extends$z = Object.assign || function (target) {
7153
7069
  for (var i = 1; i < arguments.length; i++) {
7154
7070
  var source = arguments[i];
7155
7071
 
@@ -7163,7 +7079,7 @@ function _extends$A() {
7163
7079
  return target;
7164
7080
  };
7165
7081
 
7166
- return _extends$A.apply(this, arguments);
7082
+ return _extends$z.apply(this, arguments);
7167
7083
  }
7168
7084
 
7169
7085
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7253,7 +7169,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7253
7169
  var reducer = function reducer(state, action) {
7254
7170
  switch (action.type) {
7255
7171
  case ActionType.ADD_TOAST:
7256
- return _extends$A({}, state, {
7172
+ return _extends$z({}, state, {
7257
7173
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7258
7174
  });
7259
7175
 
@@ -7263,9 +7179,9 @@ var reducer = function reducer(state, action) {
7263
7179
  clearFromRemoveQueue(action.toast.id);
7264
7180
  }
7265
7181
 
7266
- return _extends$A({}, state, {
7182
+ return _extends$z({}, state, {
7267
7183
  toasts: state.toasts.map(function (t) {
7268
- return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7184
+ return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7269
7185
  })
7270
7186
  });
7271
7187
 
@@ -7292,9 +7208,9 @@ var reducer = function reducer(state, action) {
7292
7208
  });
7293
7209
  }
7294
7210
 
7295
- return _extends$A({}, state, {
7211
+ return _extends$z({}, state, {
7296
7212
  toasts: state.toasts.map(function (t) {
7297
- return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7213
+ return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7298
7214
  visible: false
7299
7215
  }) : t;
7300
7216
  })
@@ -7302,28 +7218,28 @@ var reducer = function reducer(state, action) {
7302
7218
 
7303
7219
  case ActionType.REMOVE_TOAST:
7304
7220
  if (action.toastId === undefined) {
7305
- return _extends$A({}, state, {
7221
+ return _extends$z({}, state, {
7306
7222
  toasts: []
7307
7223
  });
7308
7224
  }
7309
7225
 
7310
- return _extends$A({}, state, {
7226
+ return _extends$z({}, state, {
7311
7227
  toasts: state.toasts.filter(function (t) {
7312
7228
  return t.id !== action.toastId;
7313
7229
  })
7314
7230
  });
7315
7231
 
7316
7232
  case ActionType.START_PAUSE:
7317
- return _extends$A({}, state, {
7233
+ return _extends$z({}, state, {
7318
7234
  pausedAt: action.time
7319
7235
  });
7320
7236
 
7321
7237
  case ActionType.END_PAUSE:
7322
7238
  var diff = action.time - (state.pausedAt || 0);
7323
- return _extends$A({}, state, {
7239
+ return _extends$z({}, state, {
7324
7240
  pausedAt: undefined,
7325
7241
  toasts: state.toasts.map(function (t) {
7326
- return _extends$A({}, t, {
7242
+ return _extends$z({}, t, {
7327
7243
  pauseDuration: t.pauseDuration + diff
7328
7244
  });
7329
7245
  })
@@ -7370,12 +7286,12 @@ var useStore = function useStore(toastOptions) {
7370
7286
  var mergedToasts = state.toasts.map(function (t) {
7371
7287
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7372
7288
 
7373
- return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7289
+ return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7374
7290
  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],
7375
- style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7291
+ style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7376
7292
  });
7377
7293
  });
7378
- return _extends$A({}, state, {
7294
+ return _extends$z({}, state, {
7379
7295
  toasts: mergedToasts
7380
7296
  });
7381
7297
  };
@@ -7385,7 +7301,7 @@ var createToast = function createToast(message, type, opts) {
7385
7301
  type = 'blank';
7386
7302
  }
7387
7303
 
7388
- return _extends$A({
7304
+ return _extends$z({
7389
7305
  createdAt: Date.now(),
7390
7306
  visible: true,
7391
7307
  type: type,
@@ -7435,14 +7351,14 @@ toast.remove = function (toastId) {
7435
7351
  };
7436
7352
 
7437
7353
  toast.promise = function (promise, msgs, opts) {
7438
- var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7354
+ var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7439
7355
  promise.then(function (p) {
7440
- toast.success(resolveValue(msgs.success, p), _extends$A({
7356
+ toast.success(resolveValue(msgs.success, p), _extends$z({
7441
7357
  id: id
7442
7358
  }, opts, opts == null ? void 0 : opts.success));
7443
7359
  return p;
7444
7360
  })["catch"](function (e) {
7445
- toast.error(resolveValue(msgs.error, e), _extends$A({
7361
+ toast.error(resolveValue(msgs.error, e), _extends$z({
7446
7362
  id: id
7447
7363
  }, opts, opts == null ? void 0 : opts.error));
7448
7364
  });
@@ -7781,7 +7697,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7781
7697
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7782
7698
  return createElement(ToastBarBase, {
7783
7699
  className: toast.className,
7784
- style: _extends$A({}, animationStyle, style, toast.style)
7700
+ style: _extends$z({}, animationStyle, style, toast.style)
7785
7701
  }, typeof children === 'function' ? children({
7786
7702
  icon: icon,
7787
7703
  message: message
@@ -7811,7 +7727,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7811
7727
  } : position.includes('right') ? {
7812
7728
  justifyContent: 'flex-end'
7813
7729
  } : {};
7814
- return _extends$A({
7730
+ return _extends$z({
7815
7731
  left: 0,
7816
7732
  right: 0,
7817
7733
  display: 'flex',
@@ -7838,7 +7754,7 @@ var Toaster = function Toaster(_ref) {
7838
7754
  handlers = _useToaster.handlers;
7839
7755
 
7840
7756
  return createElement("div", {
7841
- style: _extends$A({
7757
+ style: _extends$z({
7842
7758
  position: 'fixed',
7843
7759
  zIndex: 9999,
7844
7760
  top: DEFAULT_OFFSET,
@@ -7873,82 +7789,82 @@ var Toaster = function Toaster(_ref) {
7873
7789
  }));
7874
7790
  };
7875
7791
 
7876
- var _path$x;
7792
+ var _path$w;
7877
7793
 
7878
- 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); }
7794
+ 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); }
7879
7795
 
7880
7796
  function SvgCheckSolid(props) {
7881
- return /*#__PURE__*/React.createElement("svg", _extends$z({
7797
+ return /*#__PURE__*/React.createElement("svg", _extends$y({
7882
7798
  xmlns: "http://www.w3.org/2000/svg",
7883
7799
  className: "h-5 w-5",
7884
7800
  viewBox: "0 0 20 20",
7885
7801
  fill: "currentColor"
7886
- }, props), _path$x || (_path$x = /*#__PURE__*/React.createElement("path", {
7802
+ }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7887
7803
  fillRule: "evenodd",
7888
7804
  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",
7889
7805
  clipRule: "evenodd"
7890
7806
  })));
7891
7807
  }
7892
7808
 
7893
- var _path$w;
7809
+ var _path$v;
7894
7810
 
7895
- 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); }
7811
+ 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); }
7896
7812
 
7897
7813
  function SvgXIcon(props) {
7898
- return /*#__PURE__*/React.createElement("svg", _extends$y({
7814
+ return /*#__PURE__*/React.createElement("svg", _extends$x({
7899
7815
  xmlns: "http://www.w3.org/2000/svg",
7900
7816
  viewBox: "0 0 20 20",
7901
7817
  fill: "currentColor"
7902
- }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7818
+ }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7903
7819
  fill: "evenodd",
7904
7820
  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",
7905
7821
  clipRule: "evenodd"
7906
7822
  })));
7907
7823
  }
7908
7824
 
7909
- var _path$v;
7825
+ var _path$u;
7910
7826
 
7911
- 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); }
7827
+ 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); }
7912
7828
 
7913
7829
  function SvgXIconSolid(props) {
7914
- return /*#__PURE__*/React.createElement("svg", _extends$x({
7830
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
7915
7831
  className: "plc-w-4 plc-h-4",
7916
7832
  fill: "currentColor",
7917
7833
  xmlns: "http://www.w3.org/2000/svg",
7918
7834
  viewBox: "0 0 100 100"
7919
- }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7835
+ }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7920
7836
  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"
7921
7837
  })));
7922
7838
  }
7923
7839
 
7924
- var _path$u;
7840
+ var _path$t;
7925
7841
 
7926
- 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); }
7842
+ 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); }
7927
7843
 
7928
7844
  function SvgExclamation(props) {
7929
- return /*#__PURE__*/React.createElement("svg", _extends$w({
7845
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7930
7846
  className: "plc-w-4 plc-h-4 plc-mr-1",
7931
7847
  xmlns: "http://www.w3.org/2000/svg",
7932
7848
  viewBox: "0 0 20 20",
7933
7849
  fill: "currentColor"
7934
- }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7850
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7935
7851
  fillRule: "evenodd",
7936
7852
  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",
7937
7853
  clipRule: "evenodd"
7938
7854
  })));
7939
7855
  }
7940
7856
 
7941
- var _path$t, _path2$4;
7857
+ var _path$s, _path2$4;
7942
7858
 
7943
- 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); }
7859
+ 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); }
7944
7860
 
7945
7861
  function SvgSpinner(props) {
7946
- return /*#__PURE__*/React.createElement("svg", _extends$v({
7862
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
7947
7863
  className: "plc-animate-spin",
7948
7864
  viewBox: "0 0 24 24",
7949
7865
  fill: "currentColor",
7950
7866
  xmlns: "http://www.w3.org/2000/svg"
7951
- }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7867
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7952
7868
  opacity: 0.2,
7953
7869
  fill: "evenodd",
7954
7870
  clipRule: "evenodd",
@@ -8238,9 +8154,7 @@ const init$1 = () => {
8238
8154
  return switchToAddressView();
8239
8155
  });
8240
8156
  } else {
8241
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8242
- return switchView("subscription-options");
8243
- });
8157
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8244
8158
  }
8245
8159
  }
8246
8160
  }
@@ -8402,8 +8316,7 @@ function Link({
8402
8316
  const init = () => {
8403
8317
  const {
8404
8318
  switchView,
8405
- set,
8406
- setProductsList
8319
+ set
8407
8320
  } = usePelcro.getStore();
8408
8321
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8409
8322
 
@@ -8454,8 +8367,7 @@ const init = () => {
8454
8367
  }
8455
8368
 
8456
8369
  notify.dismiss(NOTIFICATION_ID);
8457
- setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8458
- switchView("plan-select");
8370
+ switchView("_plan-select-entitlements");
8459
8371
  }
8460
8372
  }, "Subscribe"), "now to get full page access.")), {
8461
8373
  className: "pelcro-notification-entitlement",
@@ -8707,6 +8619,10 @@ const getErrorMessages = error => {
8707
8619
  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;
8708
8620
  }
8709
8621
 
8622
+ if (error !== null && error !== void 0 && error.message) {
8623
+ return error.message;
8624
+ }
8625
+
8710
8626
  const errorMessages = []; // enumerable error (ex: validation errors)
8711
8627
 
8712
8628
  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]) => {
@@ -8745,7 +8661,7 @@ const debounce = (func, waitTime) => {
8745
8661
  function getSiteCardProcessor() {
8746
8662
  var _window$Pelcro$site$r;
8747
8663
 
8748
- if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_pay_page_id) {
8664
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_gateway_settings) {
8749
8665
  return "vantiv";
8750
8666
  }
8751
8667
 
@@ -9286,7 +9202,7 @@ const PelcroModalController = ({
9286
9202
  type
9287
9203
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default.Children.map(children, child => child).find(({
9288
9204
  type
9289
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default.Children.map(children, child => child).find(({
9205
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default.Children.map(children, child => child).find(({
9290
9206
  type
9291
9207
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default.Children.map(children, child => child).find(({
9292
9208
  type
@@ -9567,10 +9483,8 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9567
9483
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9568
9484
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9569
9485
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9570
- const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9571
- const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9572
9486
 
9573
- const initialState$i = {
9487
+ const initialState$h = {
9574
9488
  email: "",
9575
9489
  password: "",
9576
9490
  emailError: null,
@@ -9581,10 +9495,10 @@ const initialState$i = {
9581
9495
  content: ""
9582
9496
  }
9583
9497
  };
9584
- const store$i = /*#__PURE__*/createContext(initialState$i);
9498
+ const store$h = /*#__PURE__*/createContext(initialState$h);
9585
9499
  const {
9586
- Provider: Provider$i
9587
- } = store$i;
9500
+ Provider: Provider$h
9501
+ } = store$h;
9588
9502
 
9589
9503
  const LoginContainer = ({
9590
9504
  style,
@@ -9691,7 +9605,7 @@ const LoginContainer = ({
9691
9605
  });
9692
9606
 
9693
9607
  case RESET_LOGIN_FORM:
9694
- return initialState$i;
9608
+ return initialState$h;
9695
9609
 
9696
9610
  case DISABLE_LOGIN_BUTTON:
9697
9611
  return lib_7({ ...state,
@@ -9709,12 +9623,12 @@ const LoginContainer = ({
9709
9623
  default:
9710
9624
  return state;
9711
9625
  }
9712
- }, initialState$i);
9626
+ }, initialState$h);
9713
9627
  return /*#__PURE__*/React__default.createElement("div", {
9714
9628
  style: { ...style
9715
9629
  },
9716
9630
  className: `pelcro-container pelcro-login-container ${className}`
9717
- }, /*#__PURE__*/React__default.createElement(Provider$i, {
9631
+ }, /*#__PURE__*/React__default.createElement(Provider$h, {
9718
9632
  value: {
9719
9633
  state,
9720
9634
  dispatch
@@ -9722,12 +9636,12 @@ const LoginContainer = ({
9722
9636
  }, children.length ? children.map((child, i) => {
9723
9637
  if (child) {
9724
9638
  return /*#__PURE__*/React__default.cloneElement(child, {
9725
- store: store$i,
9639
+ store: store$h,
9726
9640
  key: i
9727
9641
  });
9728
9642
  }
9729
9643
  }) : /*#__PURE__*/React__default.cloneElement(children, {
9730
- store: store$i
9644
+ store: store$h
9731
9645
  })));
9732
9646
  };
9733
9647
 
@@ -9972,7 +9886,7 @@ const LoginButton = ({
9972
9886
  buttonDisabled
9973
9887
  },
9974
9888
  dispatch
9975
- } = useContext(store$i);
9889
+ } = useContext(store$h);
9976
9890
  const {
9977
9891
  t
9978
9892
  } = useTranslation("login");
@@ -9993,23 +9907,23 @@ const LoginButton = ({
9993
9907
  };
9994
9908
 
9995
9909
  const LoginEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
9996
- store: store$i
9910
+ store: store$h
9997
9911
  }, props));
9998
9912
 
9999
9913
  const LoginPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
10000
- store: store$i
9914
+ store: store$h
10001
9915
  }, props));
10002
9916
 
10003
- var _path$s;
9917
+ var _path$r;
10004
9918
 
10005
- 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); }
9919
+ 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); }
10006
9920
 
10007
9921
  function SvgCheck(props) {
10008
- return /*#__PURE__*/React.createElement("svg", _extends$u({
9922
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
10009
9923
  xmlns: "http://www.w3.org/2000/svg",
10010
9924
  fill: "currentColor",
10011
9925
  viewBox: "0 0 20 20"
10012
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
9926
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
10013
9927
  fillRule: "evenodd",
10014
9928
  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",
10015
9929
  clipRule: "evenodd"
@@ -10074,7 +9988,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
10074
9988
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
10075
9989
  facebookLoginRenderProps.FacebookLogin;
10076
9990
 
10077
- const initialState$h = {
9991
+ const initialState$g = {
10078
9992
  email: "",
10079
9993
  password: "",
10080
9994
  emailError: null,
@@ -10091,10 +10005,10 @@ const initialState$h = {
10091
10005
  content: ""
10092
10006
  }
10093
10007
  };
10094
- const store$h = /*#__PURE__*/createContext(initialState$h);
10008
+ const store$g = /*#__PURE__*/createContext(initialState$g);
10095
10009
  const {
10096
- Provider: Provider$h
10097
- } = store$h;
10010
+ Provider: Provider$g
10011
+ } = store$g;
10098
10012
 
10099
10013
  const RegisterContainer = ({
10100
10014
  style,
@@ -10277,7 +10191,7 @@ const RegisterContainer = ({
10277
10191
  });
10278
10192
 
10279
10193
  case RESET_LOGIN_FORM:
10280
- return initialState$h;
10194
+ return initialState$g;
10281
10195
 
10282
10196
  case DISABLE_REGISTRATION_BUTTON:
10283
10197
  return lib_7({ ...state,
@@ -10295,12 +10209,12 @@ const RegisterContainer = ({
10295
10209
  default:
10296
10210
  return state;
10297
10211
  }
10298
- }, initialState$h);
10212
+ }, initialState$g);
10299
10213
  return /*#__PURE__*/React__default.createElement("div", {
10300
10214
  style: { ...style
10301
10215
  },
10302
10216
  className: `pelcro-container pelcro-register-container ${className}`
10303
- }, /*#__PURE__*/React__default.createElement(Provider$h, {
10217
+ }, /*#__PURE__*/React__default.createElement(Provider$g, {
10304
10218
  value: {
10305
10219
  state,
10306
10220
  dispatch
@@ -10308,12 +10222,12 @@ const RegisterContainer = ({
10308
10222
  }, children.length ? children.map((child, i) => {
10309
10223
  if (child) {
10310
10224
  return /*#__PURE__*/React__default.cloneElement(child, {
10311
- store: store$h,
10225
+ store: store$g,
10312
10226
  key: i
10313
10227
  });
10314
10228
  }
10315
10229
  }) : /*#__PURE__*/React__default.cloneElement(children, {
10316
- store: store$h
10230
+ store: store$g
10317
10231
  })));
10318
10232
  };
10319
10233
  /**
@@ -10328,15 +10242,15 @@ function hasSecurityTokenEnabled$1() {
10328
10242
  return hasSecuritySdkLoaded;
10329
10243
  }
10330
10244
 
10331
- var _path$r;
10245
+ var _path$q;
10332
10246
 
10333
- 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); }
10247
+ 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); }
10334
10248
 
10335
10249
  function SvgFacebookLogo(props) {
10336
- return /*#__PURE__*/React.createElement("svg", _extends$t({
10250
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
10337
10251
  xmlns: "http://www.w3.org/2000/svg",
10338
10252
  viewBox: "88.428 12.828 107.543 207.085"
10339
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
10253
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10340
10254
  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",
10341
10255
  fill: "#3c5a9a"
10342
10256
  })));
@@ -10353,10 +10267,10 @@ const FacebookLoginButton = ({
10353
10267
  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;
10354
10268
  const {
10355
10269
  dispatch: loginDispatch
10356
- } = useContext(store$i);
10270
+ } = useContext(store$h);
10357
10271
  const {
10358
10272
  dispatch: registerDispatch
10359
- } = useContext(store$h);
10273
+ } = useContext(store$g);
10360
10274
 
10361
10275
  const onSuccess = facebookUser => {
10362
10276
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10409,15 +10323,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10409
10323
  unwrapExports(googleLogin);
10410
10324
  var googleLogin_1 = googleLogin.GoogleLogin;
10411
10325
 
10412
- var _path$q, _path2$3, _path3$1, _path4;
10326
+ var _path$p, _path2$3, _path3$1, _path4;
10413
10327
 
10414
- 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); }
10328
+ 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); }
10415
10329
 
10416
10330
  function SvgGoogleLogo(props) {
10417
- return /*#__PURE__*/React.createElement("svg", _extends$s({
10331
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
10418
10332
  viewBox: "0 0 24 24",
10419
10333
  xmlns: "http://www.w3.org/2000/svg"
10420
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10334
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10421
10335
  fill: "#4285F4",
10422
10336
  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"
10423
10337
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
@@ -10443,10 +10357,10 @@ const GoogleLoginButton = ({
10443
10357
  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;
10444
10358
  const {
10445
10359
  dispatch: loginDispatch
10446
- } = useContext(store$i);
10360
+ } = useContext(store$h);
10447
10361
  const {
10448
10362
  dispatch: registerDispatch
10449
- } = useContext(store$h);
10363
+ } = useContext(store$g);
10450
10364
 
10451
10365
  const onSuccess = response => {
10452
10366
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10494,15 +10408,15 @@ const GoogleLoginButton = ({
10494
10408
  }) : null;
10495
10409
  };
10496
10410
 
10497
- var _path$p;
10411
+ var _path$o;
10498
10412
 
10499
- 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); }
10413
+ 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); }
10500
10414
 
10501
10415
  function SvgAuth0Logo(props) {
10502
- return /*#__PURE__*/React.createElement("svg", _extends$r({
10416
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
10503
10417
  viewBox: "0 0 256 285",
10504
10418
  xmlns: "http://www.w3.org/2000/svg"
10505
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10419
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10506
10420
  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"
10507
10421
  })));
10508
10422
  }
@@ -10542,10 +10456,10 @@ const Auth0LoginButton = ({
10542
10456
  }, [auth0Enabled, auth0Loaded]);
10543
10457
  const {
10544
10458
  dispatch: loginDispatch
10545
- } = useContext(store$i);
10459
+ } = useContext(store$h);
10546
10460
  const {
10547
10461
  dispatch: registerDispatch
10548
- } = useContext(store$h);
10462
+ } = useContext(store$g);
10549
10463
 
10550
10464
  function handleClick() {
10551
10465
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10678,15 +10592,15 @@ function LoginView(props) {
10678
10592
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10679
10593
  }
10680
10594
 
10681
- var _path$o, _path2$2, _path3;
10595
+ var _path$n, _path2$2, _path3;
10682
10596
 
10683
- 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); }
10597
+ 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); }
10684
10598
 
10685
10599
  function SvgPelcroAuthorship(props) {
10686
- return /*#__PURE__*/React.createElement("svg", _extends$q({
10600
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
10687
10601
  xmlns: "http://www.w3.org/2000/svg",
10688
10602
  viewBox: "0 -80.652 497.072 179.991"
10689
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10603
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10690
10604
  fill: "none",
10691
10605
  stroke: "#4a4a4a",
10692
10606
  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"
@@ -10833,11 +10747,11 @@ function LoginModal({
10833
10747
  LoginModal.viewId = "login";
10834
10748
 
10835
10749
  const RegisterEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
10836
- store: store$h
10750
+ store: store$g
10837
10751
  }, props));
10838
10752
 
10839
10753
  const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
10840
- store: store$h
10754
+ store: store$g
10841
10755
  }, props));
10842
10756
 
10843
10757
  const RegisterButton = ({
@@ -10857,7 +10771,7 @@ const RegisterButton = ({
10857
10771
  buttonDisabled
10858
10772
  },
10859
10773
  dispatch
10860
- } = useContext(store$h);
10774
+ } = useContext(store$g);
10861
10775
  const {
10862
10776
  t
10863
10777
  } = useTranslation("register");
@@ -10995,7 +10909,7 @@ function FirstName({
10995
10909
  }
10996
10910
 
10997
10911
  const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
10998
- store: store$h
10912
+ store: store$g
10999
10913
  }, props));
11000
10914
 
11001
10915
  function LastName({
@@ -11026,7 +10940,7 @@ function LastName({
11026
10940
  }
11027
10941
 
11028
10942
  const RegisterLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
11029
- store: store$h
10943
+ store: store$g
11030
10944
  }, props));
11031
10945
 
11032
10946
  /**
@@ -11150,7 +11064,7 @@ function TextInput({
11150
11064
 
11151
11065
  const RegisterTextInput = props => {
11152
11066
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
11153
- store: store$h
11067
+ store: store$g
11154
11068
  }));
11155
11069
  };
11156
11070
 
@@ -11297,7 +11211,6 @@ function SelectModalWithHook(props) {
11297
11211
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11298
11212
  }, []);
11299
11213
  const {
11300
- productsList,
11301
11214
  isGift,
11302
11215
  plan,
11303
11216
  product,
@@ -11307,12 +11220,11 @@ function SelectModalWithHook(props) {
11307
11220
  view,
11308
11221
  set
11309
11222
  } = usePelcro();
11310
- const isRenewingSub = view === "_plan-select-renew";
11223
+ const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11224
+ const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11311
11225
  return /*#__PURE__*/React__default.createElement(SelectModalWithTrans, {
11312
- productsList: productsList,
11313
11226
  isGift: isGift,
11314
- disableGifting: isRenewingGift || isRenewingSub,
11315
- isRenewingSub: isRenewingSub,
11227
+ disableGifting: isRenewingGift,
11316
11228
  plan: plan,
11317
11229
  product: product,
11318
11230
  onClose: () => {
@@ -11326,10 +11238,8 @@ function SelectModalWithHook(props) {
11326
11238
  plan,
11327
11239
  isGift
11328
11240
  }),
11329
- setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11330
- subscriptionIdToRenew
11331
- }),
11332
- setView: switchView
11241
+ setView: switchView,
11242
+ matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11333
11243
  });
11334
11244
  }
11335
11245
  SelectModalWithHook.viewId = "plan-select";
@@ -11361,10 +11271,10 @@ class SelectModal extends Component {
11361
11271
  });
11362
11272
  }
11363
11273
 
11364
- if (this.props.productsList.length === 1) {
11274
+ if (this.state.productList.length === 1) {
11365
11275
  this.setState({
11366
- product: this.props.productsList[0],
11367
- planList: this.props.productsList[0].plans,
11276
+ product: this.state.productList[0],
11277
+ planList: this.state.productList[0].plans,
11368
11278
  mode: "plan"
11369
11279
  });
11370
11280
  }
@@ -11381,7 +11291,7 @@ class SelectModal extends Component {
11381
11291
  });
11382
11292
 
11383
11293
  _defineProperty$3(this, "onProductChange", e => {
11384
- const product = productsList[e.target.selectedIndex];
11294
+ const product = window.Pelcro.product.list()[e.target.selectedIndex];
11385
11295
  this.setState({
11386
11296
  product: product,
11387
11297
  plan: product.plans[0]
@@ -11447,7 +11357,7 @@ class SelectModal extends Component {
11447
11357
 
11448
11358
  _defineProperty$3(this, "renderProducts", () => {
11449
11359
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11450
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11360
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11451
11361
  return productsToShow.map((product, index) => {
11452
11362
  return this.renderOneProduct(product, index);
11453
11363
  });
@@ -11460,7 +11370,7 @@ class SelectModal extends Component {
11460
11370
  return this.renderOneProduct(this.state.product);
11461
11371
  }
11462
11372
 
11463
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11373
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11464
11374
 
11465
11375
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11466
11376
  return this.renderProducts();
@@ -11476,7 +11386,10 @@ class SelectModal extends Component {
11476
11386
  className: "plc-text-sm plc-font-semibold"
11477
11387
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11478
11388
 
11479
- function productsWithMatchedTaggedFirst(allProducts) {
11389
+ function productsWithMatchedTaggedFirst() {
11390
+ var _window$Pelcro$produc;
11391
+
11392
+ const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11480
11393
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11481
11394
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11482
11395
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11510,7 +11423,7 @@ class SelectModal extends Component {
11510
11423
  _defineProperty$3(this, "selectProduct", e => {
11511
11424
  const id = e.target.dataset.key;
11512
11425
 
11513
- for (const product of this.props.productsList) {
11426
+ for (const product of this.state.productList) {
11514
11427
  if (+product.id === +id) {
11515
11428
  var _this$state$plan;
11516
11429
 
@@ -11563,14 +11476,6 @@ class SelectModal extends Component {
11563
11476
 
11564
11477
  _defineProperty$3(this, "submitOption", () => {
11565
11478
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11566
-
11567
- if (this.props.isRenewingSub) {
11568
- var _matchingSub$id;
11569
-
11570
- const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11571
- this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11572
- }
11573
-
11574
11479
  const {
11575
11480
  product,
11576
11481
  isGift
@@ -11608,7 +11513,8 @@ class SelectModal extends Component {
11608
11513
  plan: {},
11609
11514
  isGift: props.isGift,
11610
11515
  disabled: true,
11611
- mode: "product"
11516
+ mode: "product",
11517
+ productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11612
11518
  };
11613
11519
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11614
11520
  this.locale = this.props.t;
@@ -11616,7 +11522,7 @@ class SelectModal extends Component {
11616
11522
  }
11617
11523
 
11618
11524
  render() {
11619
- var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11525
+ var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11620
11526
 
11621
11527
  const {
11622
11528
  disableGifting
@@ -11650,7 +11556,7 @@ class SelectModal extends Component {
11650
11556
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11651
11557
  }, /*#__PURE__*/React__default.createElement("h4", {
11652
11558
  className: "plc-text-2xl plc-font-semibold"
11653
- }, 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.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.createElement("div", {
11559
+ }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default.createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default.createElement("div", {
11654
11560
  className: "pelcro-select-products-wrapper"
11655
11561
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11656
11562
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -13502,7 +13408,7 @@ class VantivGateway {
13502
13408
 
13503
13409
  /** @type {PaymentStateType} */
13504
13410
 
13505
- const initialState$g = {
13411
+ const initialState$f = {
13506
13412
  disableSubmit: false,
13507
13413
  isLoading: false,
13508
13414
  disableCouponButton: false,
@@ -13521,10 +13427,10 @@ const initialState$g = {
13521
13427
  content: ""
13522
13428
  }
13523
13429
  };
13524
- const store$g = /*#__PURE__*/createContext(initialState$g);
13430
+ const store$f = /*#__PURE__*/createContext(initialState$f);
13525
13431
  const {
13526
- Provider: Provider$g
13527
- } = store$g;
13432
+ Provider: Provider$f
13433
+ } = store$f;
13528
13434
 
13529
13435
  const PaymentMethodContainerWithoutStripe = ({
13530
13436
  style,
@@ -13570,8 +13476,11 @@ const PaymentMethodContainerWithoutStripe = ({
13570
13476
  updateTotalAmountWithTax();
13571
13477
  }, []);
13572
13478
 
13573
- const submitVantivPayment = () => {
13574
- if (selectedPaymentMethodId) {
13479
+ const submitUsingVantiv = () => {
13480
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13481
+
13482
+ if (isUsingExistingPaymentMethod) {
13483
+ // no need to create a new source using vantiv
13575
13484
  return handleVantivPayment(null);
13576
13485
  }
13577
13486
 
@@ -13579,7 +13488,10 @@ const PaymentMethodContainerWithoutStripe = ({
13579
13488
  return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13580
13489
  }
13581
13490
 
13582
- const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13491
+ const orderId = `pelcro-${new Date().getTime()}`;
13492
+ /*
13493
+ calls handleVantivPayment to either handle a payment or update a source by simply creating a new source
13494
+ */
13583
13495
 
13584
13496
  vantivInstanceRef.current.getPaypageRegistrationId({
13585
13497
  id: orderId,
@@ -13606,6 +13518,45 @@ const PaymentMethodContainerWithoutStripe = ({
13606
13518
  purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13607
13519
  } else if (type === "invoicePayment") {
13608
13520
  payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13521
+ } else if (type === "updatePaymentSource") {
13522
+ createNewVantivCard();
13523
+ }
13524
+
13525
+ function createNewVantivCard() {
13526
+ window.Pelcro.source.create({
13527
+ auth_token: window.Pelcro.user.read().auth_token,
13528
+ token: paymentRequest,
13529
+ gateway: "vantiv"
13530
+ }, (err, res) => {
13531
+ dispatch({
13532
+ type: DISABLE_SUBMIT,
13533
+ payload: false
13534
+ });
13535
+ dispatch({
13536
+ type: LOADING,
13537
+ payload: false
13538
+ });
13539
+
13540
+ if (err) {
13541
+ onFailure(err);
13542
+ return dispatch({
13543
+ type: SHOW_ALERT,
13544
+ payload: {
13545
+ type: "error",
13546
+ content: getErrorMessages(err)
13547
+ }
13548
+ });
13549
+ }
13550
+
13551
+ dispatch({
13552
+ type: SHOW_ALERT,
13553
+ payload: {
13554
+ type: "success",
13555
+ content: t("messages.sourceUpdated")
13556
+ }
13557
+ });
13558
+ onSuccess(res);
13559
+ });
13609
13560
  }
13610
13561
 
13611
13562
  function handleVantivSubscription() {
@@ -14327,7 +14278,9 @@ const PaymentMethodContainerWithoutStripe = ({
14327
14278
 
14328
14279
  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") {
14329
14280
  return handlePaymentError({
14330
- message: t("messages.cardAuthNotSupported")
14281
+ error: {
14282
+ message: t("messages.cardAuthNotSupported")
14283
+ }
14331
14284
  });
14332
14285
  }
14333
14286
 
@@ -14572,7 +14525,9 @@ const PaymentMethodContainerWithoutStripe = ({
14572
14525
 
14573
14526
  if ((source === null || source === void 0 ? void 0 : source.status) === "failed") {
14574
14527
  return handlePaymentError({
14575
- message: t("messages.cardAuthFailed")
14528
+ error: {
14529
+ message: t("messages.cardAuthFailed")
14530
+ }
14576
14531
  });
14577
14532
  }
14578
14533
 
@@ -14644,7 +14599,7 @@ const PaymentMethodContainerWithoutStripe = ({
14644
14599
  isLoading: true
14645
14600
  }, (state, dispatch) => {
14646
14601
  if (getSiteCardProcessor() === "vantiv") {
14647
- return submitVantivPayment();
14602
+ return submitUsingVantiv();
14648
14603
  }
14649
14604
 
14650
14605
  if (selectedPaymentMethodId) {
@@ -14727,21 +14682,21 @@ const PaymentMethodContainerWithoutStripe = ({
14727
14682
  default:
14728
14683
  return state;
14729
14684
  }
14730
- }, initialState$g);
14685
+ }, initialState$f);
14731
14686
  return /*#__PURE__*/React__default.createElement("div", {
14732
14687
  style: { ...style
14733
14688
  },
14734
14689
  className: `pelcro-container pelcro-payment-container ${className}`
14735
- }, /*#__PURE__*/React__default.createElement(Provider$g, {
14690
+ }, /*#__PURE__*/React__default.createElement(Provider$f, {
14736
14691
  value: {
14737
14692
  state,
14738
14693
  dispatch
14739
14694
  }
14740
14695
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
14741
- store: store$g,
14696
+ store: store$f,
14742
14697
  key: i
14743
14698
  })) : /*#__PURE__*/React__default.cloneElement(children, {
14744
- store: store$g
14699
+ store: store$f
14745
14700
  })));
14746
14701
  };
14747
14702
 
@@ -14763,7 +14718,7 @@ const PaymentMethodContainer = props => {
14763
14718
  stripeAccount: window.Pelcro.site.read().account_id,
14764
14719
  locale: getPageOrDefaultLanguage()
14765
14720
  }, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
14766
- store: store$g
14721
+ store: store$f
14767
14722
  }, props))));
14768
14723
  }
14769
14724
 
@@ -14816,7 +14771,7 @@ const PelcroPaymentRequestButton = props => {
14816
14771
  currentPlan,
14817
14772
  updatedPrice
14818
14773
  }
14819
- } = useContext(store$g);
14774
+ } = useContext(store$f);
14820
14775
 
14821
14776
  const updatePaymentRequest = () => {
14822
14777
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14892,7 +14847,7 @@ const DiscountedPrice = props => {
14892
14847
  taxAmount,
14893
14848
  percentOff
14894
14849
  }
14895
- } = useContext(store$g);
14850
+ } = useContext(store$f);
14896
14851
  const {
14897
14852
  order,
14898
14853
  plan
@@ -14942,7 +14897,7 @@ const SubmitPaymentMethod = ({
14942
14897
  isLoading,
14943
14898
  updatedPrice
14944
14899
  }
14945
- } = useContext(store$g);
14900
+ } = useContext(store$f);
14946
14901
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14947
14902
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14948
14903
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14963,17 +14918,17 @@ const SubmitPaymentMethod = ({
14963
14918
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14964
14919
  };
14965
14920
 
14966
- var _path$n;
14921
+ var _path$m;
14967
14922
 
14968
- 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); }
14923
+ 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); }
14969
14924
 
14970
14925
  function SvgArrowLeft(props) {
14971
- return /*#__PURE__*/React.createElement("svg", _extends$p({
14926
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
14972
14927
  xmlns: "http://www.w3.org/2000/svg",
14973
14928
  fill: "none",
14974
14929
  viewBox: "0 0 24 24",
14975
14930
  stroke: "currentColor"
14976
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
14931
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
14977
14932
  strokeLinecap: "round",
14978
14933
  strokeLinejoin: "round",
14979
14934
  strokeWidth: 2,
@@ -14992,7 +14947,7 @@ const ApplyCouponButton = ({
14992
14947
  disableCouponButton
14993
14948
  },
14994
14949
  dispatch
14995
- } = useContext(store$g);
14950
+ } = useContext(store$f);
14996
14951
  const {
14997
14952
  t
14998
14953
  } = useTranslation("checkoutForm");
@@ -15026,7 +14981,7 @@ const CouponCodeField = props => {
15026
14981
  couponCode,
15027
14982
  couponError
15028
14983
  }
15029
- } = useContext(store$g);
14984
+ } = useContext(store$f);
15030
14985
 
15031
14986
  const onCouponCodeChange = e => {
15032
14987
  dispatch({
@@ -15055,17 +15010,17 @@ const CouponCodeField = props => {
15055
15010
  }, props));
15056
15011
  };
15057
15012
 
15058
- var _path$m;
15013
+ var _path$l;
15059
15014
 
15060
- 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); }
15015
+ 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); }
15061
15016
 
15062
15017
  function SvgTicket(props) {
15063
- return /*#__PURE__*/React.createElement("svg", _extends$o({
15018
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
15064
15019
  xmlns: "http://www.w3.org/2000/svg",
15065
15020
  fill: "none",
15066
15021
  viewBox: "0 0 24 24",
15067
15022
  stroke: "currentColor"
15068
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
15023
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
15069
15024
  strokeLinecap: "round",
15070
15025
  strokeLinejoin: "round",
15071
15026
  strokeWidth: 2,
@@ -15082,7 +15037,7 @@ const CouponCode = ({
15082
15037
  state: {
15083
15038
  enableCouponField
15084
15039
  }
15085
- } = useContext(store$g);
15040
+ } = useContext(store$f);
15086
15041
  const {
15087
15042
  t
15088
15043
  } = useTranslation("checkoutForm");
@@ -15339,7 +15294,7 @@ const PaypalSubscribeButton = props => {
15339
15294
  const {
15340
15295
  dispatch,
15341
15296
  state
15342
- } = useContext(store$g);
15297
+ } = useContext(store$f);
15343
15298
  const {
15344
15299
  product,
15345
15300
  plan,
@@ -15354,7 +15309,7 @@ const PaypalSubscribeButton = props => {
15354
15309
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
15355
15310
 
15356
15311
  const initializePaypal = async () => {
15357
- var _props$buttonElementI, _props$product$addres, _props$product, _props$plan2;
15312
+ var _props$buttonElementI, _props$product$addres, _props$product;
15358
15313
 
15359
15314
  const paypalCheckoutInstance = new PaypalClient({
15360
15315
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
@@ -15364,12 +15319,33 @@ const PaypalSubscribeButton = props => {
15364
15319
  displayName: props.merchantDisplayName,
15365
15320
  locale: props.locale,
15366
15321
  billingAgreementDescription: props.billingDescription
15367
- }); // Await building paypal instance
15322
+ });
15323
+
15324
+ const getProduct = () => {
15325
+ if (invoice) {
15326
+ invoice.plan = null;
15327
+
15328
+ if (invoice.plan) {
15329
+ return invoice.plan;
15330
+ } else {
15331
+ // standalone invoices dont have a plan
15332
+ return {
15333
+ currency: invoice.currency,
15334
+ nickname: `invoice #${invoice.id}`
15335
+ };
15336
+ }
15337
+ } else if (props.plan) {
15338
+ return props.plan;
15339
+ } else {
15340
+ return plan;
15341
+ }
15342
+ }; // Await building paypal instance
15343
+
15368
15344
 
15369
15345
  await paypalCheckoutInstance.build(); // Create paypal payment
15370
15346
 
15371
15347
  paypalCheckoutInstance.createPayment({
15372
- product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
15348
+ product: getProduct(),
15373
15349
  amount: updatedPrice,
15374
15350
  address: invoice ? null : selectedAddress,
15375
15351
  onButtonClick: () => {
@@ -15425,16 +15401,16 @@ const BankRedirection = () => {
15425
15401
  }));
15426
15402
  };
15427
15403
 
15428
- var _path$l;
15404
+ var _path$k;
15429
15405
 
15430
- 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); }
15406
+ 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); }
15431
15407
 
15432
15408
  function SvgLock(props) {
15433
- return /*#__PURE__*/React.createElement("svg", _extends$n({
15409
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
15434
15410
  xmlns: "http://www.w3.org/2000/svg",
15435
15411
  viewBox: "0 0 20 20",
15436
15412
  fill: "currentColor"
15437
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
15413
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
15438
15414
  fillRule: "evenodd",
15439
15415
  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",
15440
15416
  clipRule: "evenodd"
@@ -15451,7 +15427,7 @@ const SelectedPaymentMethod = () => {
15451
15427
  state: {
15452
15428
  isLoading
15453
15429
  }
15454
- } = useContext(store$g);
15430
+ } = useContext(store$f);
15455
15431
  const {
15456
15432
  switchView,
15457
15433
  selectedPaymentMethodId
@@ -15493,7 +15469,7 @@ const TaxAmount = () => {
15493
15469
  state: {
15494
15470
  taxAmount
15495
15471
  }
15496
- } = useContext(store$g);
15472
+ } = useContext(store$f);
15497
15473
  const {
15498
15474
  plan
15499
15475
  } = usePelcro();
@@ -15657,12 +15633,12 @@ function SubscriptionRenewModal({
15657
15633
  }
15658
15634
  SubscriptionRenewModal.viewId = "subscription-renew";
15659
15635
 
15660
- var _path$k;
15636
+ var _path$j;
15661
15637
 
15662
- 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); }
15638
+ 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); }
15663
15639
 
15664
15640
  function SvgGift(props) {
15665
- return /*#__PURE__*/React.createElement("svg", _extends$m({
15641
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
15666
15642
  className: "plc-w-6 plc-h-6 plc-mr-2",
15667
15643
  fill: "none",
15668
15644
  stroke: "currentColor",
@@ -15671,7 +15647,7 @@ function SvgGift(props) {
15671
15647
  strokeWidth: 2,
15672
15648
  viewBox: "0 0 24 24",
15673
15649
  xmlns: "http://www.w3.org/2000/svg"
15674
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
15650
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
15675
15651
  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"
15676
15652
  })));
15677
15653
  }
@@ -16012,7 +15988,7 @@ class DefaultNewsLetter extends Component {
16012
15988
 
16013
15989
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
16014
15990
 
16015
- const initialState$f = {
15991
+ const initialState$e = {
16016
15992
  didSubToNewslettersBefore: false,
16017
15993
  newsletters: [],
16018
15994
  isListLoading: true,
@@ -16022,10 +15998,10 @@ const initialState$f = {
16022
15998
  content: ""
16023
15999
  }
16024
16000
  };
16025
- const store$f = /*#__PURE__*/createContext(initialState$f);
16001
+ const store$e = /*#__PURE__*/createContext(initialState$e);
16026
16002
  const {
16027
- Provider: Provider$f
16028
- } = store$f;
16003
+ Provider: Provider$e
16004
+ } = store$e;
16029
16005
 
16030
16006
  const NewsletterUpdateContainer = ({
16031
16007
  style,
@@ -16138,7 +16114,7 @@ const NewsletterUpdateContainer = ({
16138
16114
  default:
16139
16115
  return state;
16140
16116
  }
16141
- }, initialState$f);
16117
+ }, initialState$e);
16142
16118
  useEffect(() => {
16143
16119
  const getUserNewsletters = () => {
16144
16120
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -16182,7 +16158,7 @@ const NewsletterUpdateContainer = ({
16182
16158
  style: { ...style
16183
16159
  },
16184
16160
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
16185
- }, /*#__PURE__*/React__default.createElement(Provider$f, {
16161
+ }, /*#__PURE__*/React__default.createElement(Provider$e, {
16186
16162
  value: {
16187
16163
  state,
16188
16164
  dispatch
@@ -16190,12 +16166,12 @@ const NewsletterUpdateContainer = ({
16190
16166
  }, children.length ? children.map((child, i) => {
16191
16167
  if (child) {
16192
16168
  return /*#__PURE__*/React__default.cloneElement(child, {
16193
- store: store$f,
16169
+ store: store$e,
16194
16170
  key: i
16195
16171
  });
16196
16172
  }
16197
16173
  }) : /*#__PURE__*/React__default.cloneElement(children, {
16198
- store: store$f
16174
+ store: store$e
16199
16175
  })));
16200
16176
  };
16201
16177
 
@@ -16210,7 +16186,7 @@ const NewsletterUpdateButton = ({
16210
16186
  isSubmitting,
16211
16187
  isListLoading
16212
16188
  }
16213
- } = useContext(store$f);
16189
+ } = useContext(store$e);
16214
16190
  const {
16215
16191
  t
16216
16192
  } = useTranslation("newsletter");
@@ -16240,7 +16216,7 @@ const NewsletterUpdateList = () => {
16240
16216
  newsletters,
16241
16217
  isListLoading
16242
16218
  }
16243
- } = useContext(store$f);
16219
+ } = useContext(store$e);
16244
16220
 
16245
16221
  if (isListLoading) {
16246
16222
  return /*#__PURE__*/React__default.createElement(Loader, {
@@ -16444,7 +16420,7 @@ function SubscriptionCreateModal({
16444
16420
  SubscriptionCreateModal.viewId = "subscription-create";
16445
16421
 
16446
16422
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
16447
- const initialState$e = {
16423
+ const initialState$d = {
16448
16424
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
16449
16425
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
16450
16426
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -16457,10 +16433,10 @@ const initialState$e = {
16457
16433
  content: ""
16458
16434
  }
16459
16435
  };
16460
- const store$e = /*#__PURE__*/createContext(initialState$e);
16436
+ const store$d = /*#__PURE__*/createContext(initialState$d);
16461
16437
  const {
16462
- Provider: Provider$e
16463
- } = store$e;
16438
+ Provider: Provider$d
16439
+ } = store$d;
16464
16440
 
16465
16441
  const UserUpdateContainer = ({
16466
16442
  style,
@@ -16592,27 +16568,27 @@ const UserUpdateContainer = ({
16592
16568
  default:
16593
16569
  return state;
16594
16570
  }
16595
- }, initialState$e);
16571
+ }, initialState$d);
16596
16572
  return /*#__PURE__*/React__default.createElement("div", {
16597
16573
  style: { ...style
16598
16574
  },
16599
16575
  className: `pelcro-container pelcro-user-update-container ${className}`
16600
- }, /*#__PURE__*/React__default.createElement(Provider$e, {
16576
+ }, /*#__PURE__*/React__default.createElement(Provider$d, {
16601
16577
  value: {
16602
16578
  state,
16603
16579
  dispatch
16604
16580
  }
16605
16581
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
16606
- store: store$e,
16582
+ store: store$d,
16607
16583
  key: i
16608
16584
  })) : /*#__PURE__*/React__default.cloneElement(children, {
16609
- store: store$e
16585
+ store: store$d
16610
16586
  })));
16611
16587
  };
16612
16588
 
16613
16589
  const UserUpdateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
16614
16590
  disabled: true,
16615
- store: store$e
16591
+ store: store$d
16616
16592
  }, props));
16617
16593
 
16618
16594
  const UserUpdateButton = ({
@@ -16625,7 +16601,7 @@ const UserUpdateButton = ({
16625
16601
  buttonDisabled
16626
16602
  },
16627
16603
  dispatch
16628
- } = useContext(store$e);
16604
+ } = useContext(store$d);
16629
16605
  const {
16630
16606
  t
16631
16607
  } = useTranslation("userEdit");
@@ -16642,11 +16618,11 @@ const UserUpdateButton = ({
16642
16618
  };
16643
16619
 
16644
16620
  const UserUpdateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
16645
- store: store$e
16621
+ store: store$d
16646
16622
  }, props));
16647
16623
 
16648
16624
  const UserUpdateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
16649
- store: store$e
16625
+ store: store$d
16650
16626
  }, props));
16651
16627
 
16652
16628
  function Phone({
@@ -16675,22 +16651,22 @@ function Phone({
16675
16651
  }
16676
16652
 
16677
16653
  const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone, Object.assign({
16678
- store: store$e
16654
+ store: store$d
16679
16655
  }, props));
16680
16656
 
16681
16657
  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";
16682
16658
 
16683
- var _path$j;
16659
+ var _path$i;
16684
16660
 
16685
- 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); }
16661
+ 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); }
16686
16662
 
16687
16663
  function SvgEdit(props) {
16688
- return /*#__PURE__*/React.createElement("svg", _extends$l({
16664
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
16689
16665
  className: "plc-w-6 plc-h-6",
16690
16666
  xmlns: "http://www.w3.org/2000/svg",
16691
16667
  viewBox: "0 0 20 20",
16692
16668
  fill: "currentColor"
16693
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
16669
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
16694
16670
  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"
16695
16671
  })));
16696
16672
  }
@@ -16822,16 +16798,16 @@ function DisplayName({
16822
16798
  }
16823
16799
 
16824
16800
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default.createElement(DisplayName, Object.assign({
16825
- store: store$e
16801
+ store: store$d
16826
16802
  }, props));
16827
16803
 
16828
16804
  const UserUpdateTextInput = props => {
16829
16805
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
16830
- store: store$e
16806
+ store: store$d
16831
16807
  }));
16832
16808
  };
16833
16809
 
16834
- const initialState$d = {
16810
+ const initialState$c = {
16835
16811
  isSubmitting: false,
16836
16812
  firstName: "",
16837
16813
  firstNameError: "",
@@ -16856,10 +16832,10 @@ const initialState$d = {
16856
16832
  content: ""
16857
16833
  }
16858
16834
  };
16859
- const store$d = /*#__PURE__*/createContext(initialState$d);
16835
+ const store$c = /*#__PURE__*/createContext(initialState$c);
16860
16836
  const {
16861
- Provider: Provider$d
16862
- } = store$d;
16837
+ Provider: Provider$c
16838
+ } = store$c;
16863
16839
 
16864
16840
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16865
16841
 
@@ -17066,7 +17042,7 @@ const AddressCreateContainer = ({
17066
17042
  default:
17067
17043
  return state;
17068
17044
  }
17069
- }, initialState$d);
17045
+ }, initialState$c);
17070
17046
  useEffect(() => {
17071
17047
  const getStates = () => {
17072
17048
  dispatch({
@@ -17098,16 +17074,16 @@ const AddressCreateContainer = ({
17098
17074
  style: { ...style
17099
17075
  },
17100
17076
  className: `pelcro-container pelcro-address-create-container ${className}`
17101
- }, /*#__PURE__*/React__default.createElement(Provider$d, {
17077
+ }, /*#__PURE__*/React__default.createElement(Provider$c, {
17102
17078
  value: {
17103
17079
  state,
17104
17080
  dispatch
17105
17081
  }
17106
17082
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17107
- store: store$d,
17083
+ store: store$c,
17108
17084
  key: i
17109
17085
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17110
- store: store$d
17086
+ store: store$c
17111
17087
  })));
17112
17088
  };
17113
17089
 
@@ -17118,7 +17094,7 @@ function AddressCreateFirstName(props) {
17118
17094
  firstName,
17119
17095
  firstNameError
17120
17096
  }
17121
- } = useContext(store$d);
17097
+ } = useContext(store$c);
17122
17098
 
17123
17099
  const handleBlur = () => {
17124
17100
  return dispatch({
@@ -17161,7 +17137,7 @@ function AddressCreateLastName(props) {
17161
17137
  lastName,
17162
17138
  lastNameError
17163
17139
  }
17164
- } = useContext(store$d);
17140
+ } = useContext(store$c);
17165
17141
 
17166
17142
  const handleBlur = () => {
17167
17143
  return dispatch({
@@ -17204,7 +17180,7 @@ function AddressCreateLine1(props) {
17204
17180
  line1,
17205
17181
  line1Error
17206
17182
  }
17207
- } = useContext(store$d);
17183
+ } = useContext(store$c);
17208
17184
 
17209
17185
  const handleBlur = () => {
17210
17186
  return dispatch({
@@ -17247,7 +17223,7 @@ function AddressCreateCity(props) {
17247
17223
  city,
17248
17224
  cityError
17249
17225
  }
17250
- } = useContext(store$d);
17226
+ } = useContext(store$c);
17251
17227
 
17252
17228
  const handleBlur = () => {
17253
17229
  return dispatch({
@@ -17290,7 +17266,7 @@ function AddressCreatePostalCode(props) {
17290
17266
  postalCode,
17291
17267
  postalCodeError
17292
17268
  }
17293
- } = useContext(store$d);
17269
+ } = useContext(store$c);
17294
17270
 
17295
17271
  const handleBlur = () => {
17296
17272
  return dispatch({
@@ -17336,7 +17312,7 @@ const AddressCreateSubmit = ({
17336
17312
  state: {
17337
17313
  isSubmitting
17338
17314
  }
17339
- } = useContext(store$d);
17315
+ } = useContext(store$c);
17340
17316
  const {
17341
17317
  t
17342
17318
  } = useTranslation("address");
@@ -17447,7 +17423,7 @@ function CountrySelect({
17447
17423
  }
17448
17424
 
17449
17425
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
17450
- store: store$d
17426
+ store: store$c
17451
17427
  }, props));
17452
17428
 
17453
17429
  function StateSelect({
@@ -17535,7 +17511,7 @@ function StateSelect({
17535
17511
  }
17536
17512
 
17537
17513
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
17538
- store: store$d
17514
+ store: store$c
17539
17515
  }, props));
17540
17516
 
17541
17517
  const AddressCreateView = props => {
@@ -17640,18 +17616,18 @@ AddressCreateModal.viewId = "address-create";
17640
17616
 
17641
17617
  const AddressCreateTextInput = props => {
17642
17618
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
17643
- store: store$d
17619
+ store: store$c
17644
17620
  }));
17645
17621
  };
17646
17622
 
17647
17623
  const AddressCreateLine2 = props => {
17648
17624
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
17649
17625
  fieldName: "line2",
17650
- store: store$d
17626
+ store: store$c
17651
17627
  }, props));
17652
17628
  };
17653
17629
 
17654
- const initialState$c = {
17630
+ const initialState$b = {
17655
17631
  isSubmitting: false,
17656
17632
  firstName: "",
17657
17633
  firstNameError: "",
@@ -17676,10 +17652,10 @@ const initialState$c = {
17676
17652
  content: ""
17677
17653
  }
17678
17654
  };
17679
- const store$c = /*#__PURE__*/createContext(initialState$c);
17655
+ const store$b = /*#__PURE__*/createContext(initialState$b);
17680
17656
  const {
17681
- Provider: Provider$c
17682
- } = store$c;
17657
+ Provider: Provider$b
17658
+ } = store$b;
17683
17659
 
17684
17660
  const AddressUpdateContainer = ({
17685
17661
  style,
@@ -17731,7 +17707,7 @@ const AddressUpdateContainer = ({
17731
17707
  const thisAddress = addresses[address];
17732
17708
 
17733
17709
  if (+thisAddress.id === +addressId) {
17734
- const newState = { ...initialState$c,
17710
+ const newState = { ...initialState$b,
17735
17711
  firstName: thisAddress.first_name,
17736
17712
  lastName: thisAddress.last_name,
17737
17713
  line1: thisAddress.line1,
@@ -17864,7 +17840,7 @@ const AddressUpdateContainer = ({
17864
17840
  default:
17865
17841
  return state;
17866
17842
  }
17867
- }, initialState$c);
17843
+ }, initialState$b);
17868
17844
  useEffect(() => {
17869
17845
  const getStates = () => {
17870
17846
  dispatch({
@@ -17896,21 +17872,21 @@ const AddressUpdateContainer = ({
17896
17872
  style: { ...style
17897
17873
  },
17898
17874
  className: `pelcro-container pelcro-address-update-container ${className}`
17899
- }, /*#__PURE__*/React__default.createElement(Provider$c, {
17875
+ }, /*#__PURE__*/React__default.createElement(Provider$b, {
17900
17876
  value: {
17901
17877
  state,
17902
17878
  dispatch
17903
17879
  }
17904
17880
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17905
- store: store$c,
17881
+ store: store$b,
17906
17882
  key: i
17907
17883
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17908
- store: store$c
17884
+ store: store$b
17909
17885
  })));
17910
17886
  };
17911
17887
 
17912
17888
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
17913
- store: store$c
17889
+ store: store$b
17914
17890
  }, props));
17915
17891
 
17916
17892
  function AddressUpdateFirstName(props) {
@@ -17920,7 +17896,7 @@ function AddressUpdateFirstName(props) {
17920
17896
  firstName,
17921
17897
  firstNameError
17922
17898
  }
17923
- } = useContext(store$c);
17899
+ } = useContext(store$b);
17924
17900
 
17925
17901
  const handleBlur = () => {
17926
17902
  return dispatch({
@@ -17963,7 +17939,7 @@ function AddressUpdateLastName(props) {
17963
17939
  lastName,
17964
17940
  lastNameError
17965
17941
  }
17966
- } = useContext(store$c);
17942
+ } = useContext(store$b);
17967
17943
 
17968
17944
  const handleBlur = () => {
17969
17945
  return dispatch({
@@ -18006,7 +17982,7 @@ function AddressUpdateLine1(props) {
18006
17982
  line1,
18007
17983
  line1Error
18008
17984
  }
18009
- } = useContext(store$c);
17985
+ } = useContext(store$b);
18010
17986
 
18011
17987
  const handleBlur = () => {
18012
17988
  return dispatch({
@@ -18046,7 +18022,7 @@ const AddressUpdateLine2 = props => {
18046
18022
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
18047
18023
  fieldName: "line2"
18048
18024
  }, props, {
18049
- store: store$c
18025
+ store: store$b
18050
18026
  }));
18051
18027
  };
18052
18028
 
@@ -18057,7 +18033,7 @@ function AddressUpdateCity(props) {
18057
18033
  city,
18058
18034
  cityError
18059
18035
  }
18060
- } = useContext(store$c);
18036
+ } = useContext(store$b);
18061
18037
 
18062
18038
  const handleBlur = () => {
18063
18039
  return dispatch({
@@ -18100,7 +18076,7 @@ function AddressUpdatePostalCode(props) {
18100
18076
  postalCode,
18101
18077
  postalCodeError
18102
18078
  }
18103
- } = useContext(store$c);
18079
+ } = useContext(store$b);
18104
18080
 
18105
18081
  const handleBlur = () => {
18106
18082
  return dispatch({
@@ -18146,7 +18122,7 @@ const AddressUpdateSubmit = ({
18146
18122
  state: {
18147
18123
  isSubmitting
18148
18124
  }
18149
- } = useContext(store$c);
18125
+ } = useContext(store$b);
18150
18126
  const {
18151
18127
  t
18152
18128
  } = useTranslation("address");
@@ -18162,7 +18138,7 @@ const AddressUpdateSubmit = ({
18162
18138
  };
18163
18139
 
18164
18140
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
18165
- store: store$c
18141
+ store: store$b
18166
18142
  }, props));
18167
18143
 
18168
18144
  const AddressUpdateView = props => {
@@ -18245,7 +18221,7 @@ AddressUpdateModal.viewId = "address-edit";
18245
18221
 
18246
18222
  const AddressUpdateTextInput = props => {
18247
18223
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
18248
- store: store$c
18224
+ store: store$b
18249
18225
  }));
18250
18226
  };
18251
18227
 
@@ -18328,7 +18304,7 @@ const PaymentMethodUpdateModal = props => {
18328
18304
  };
18329
18305
  PaymentMethodUpdateModal.viewId = "payment-method-update";
18330
18306
 
18331
- const initialState$b = {
18307
+ const initialState$a = {
18332
18308
  email: "",
18333
18309
  password: "",
18334
18310
  passwordError: null,
@@ -18341,10 +18317,10 @@ const initialState$b = {
18341
18317
  content: ""
18342
18318
  }
18343
18319
  };
18344
- const store$b = /*#__PURE__*/createContext(initialState$b);
18320
+ const store$a = /*#__PURE__*/createContext(initialState$a);
18345
18321
  const {
18346
- Provider: Provider$b
18347
- } = store$b;
18322
+ Provider: Provider$a
18323
+ } = store$a;
18348
18324
 
18349
18325
  const PasswordResetContainer = ({
18350
18326
  style,
@@ -18401,7 +18377,7 @@ const PasswordResetContainer = ({
18401
18377
  type: SET_EMAIL,
18402
18378
  payload: window.Pelcro.helpers.getURLParameter("email")
18403
18379
  });
18404
- initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
18380
+ initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18405
18381
  dispatch({
18406
18382
  type: SET_TOKEN,
18407
18383
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -18461,26 +18437,26 @@ const PasswordResetContainer = ({
18461
18437
  default:
18462
18438
  return state;
18463
18439
  }
18464
- }, initialState$b);
18440
+ }, initialState$a);
18465
18441
  return /*#__PURE__*/React__default.createElement("div", {
18466
18442
  style: { ...style
18467
18443
  },
18468
18444
  className: `pelcro-container pelcro-password-reset-container ${className}`
18469
- }, /*#__PURE__*/React__default.createElement(Provider$b, {
18445
+ }, /*#__PURE__*/React__default.createElement(Provider$a, {
18470
18446
  value: {
18471
18447
  state,
18472
18448
  dispatch
18473
18449
  }
18474
18450
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18475
- store: store$b,
18451
+ store: store$a,
18476
18452
  key: i
18477
18453
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18478
- store: store$b
18454
+ store: store$a
18479
18455
  })));
18480
18456
  };
18481
18457
 
18482
18458
  const PasswordResetPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
18483
- store: store$b
18459
+ store: store$a
18484
18460
  }, props));
18485
18461
 
18486
18462
  const PasswordResetButton = ({
@@ -18493,7 +18469,7 @@ const PasswordResetButton = ({
18493
18469
  buttonDisabled
18494
18470
  },
18495
18471
  dispatch
18496
- } = useContext(store$b);
18472
+ } = useContext(store$a);
18497
18473
  const {
18498
18474
  t
18499
18475
  } = useTranslation("passwordReset");
@@ -18510,14 +18486,14 @@ const PasswordResetButton = ({
18510
18486
  };
18511
18487
 
18512
18488
  const PasswordResetEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
18513
- store: store$b
18489
+ store: store$a
18514
18490
  }, props, {
18515
18491
  value: window.Pelcro.helpers.getURLParameter("email"),
18516
18492
  disabled: true
18517
18493
  }));
18518
18494
 
18519
18495
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default.createElement(ConfirmPassword, Object.assign({
18520
- store: store$b
18496
+ store: store$a
18521
18497
  }, props));
18522
18498
 
18523
18499
  const PasswordResetView = props => {
@@ -18569,7 +18545,7 @@ const PasswordResetModal = ({
18569
18545
  };
18570
18546
  PasswordResetModal.viewId = "password-reset";
18571
18547
 
18572
- const initialState$a = {
18548
+ const initialState$9 = {
18573
18549
  email: "",
18574
18550
  emailError: null,
18575
18551
  buttonDisabled: false,
@@ -18578,10 +18554,10 @@ const initialState$a = {
18578
18554
  content: ""
18579
18555
  }
18580
18556
  };
18581
- const store$a = /*#__PURE__*/createContext(initialState$a);
18557
+ const store$9 = /*#__PURE__*/createContext(initialState$9);
18582
18558
  const {
18583
- Provider: Provider$a
18584
- } = store$a;
18559
+ Provider: Provider$9
18560
+ } = store$9;
18585
18561
 
18586
18562
  const PasswordForgotContainer = ({
18587
18563
  style,
@@ -18659,21 +18635,21 @@ const PasswordForgotContainer = ({
18659
18635
  default:
18660
18636
  return state;
18661
18637
  }
18662
- }, initialState$a);
18638
+ }, initialState$9);
18663
18639
  return /*#__PURE__*/React__default.createElement("div", {
18664
18640
  style: { ...style
18665
18641
  },
18666
18642
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18667
- }, /*#__PURE__*/React__default.createElement(Provider$a, {
18643
+ }, /*#__PURE__*/React__default.createElement(Provider$9, {
18668
18644
  value: {
18669
18645
  state,
18670
18646
  dispatch
18671
18647
  }
18672
18648
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18673
- store: store$a,
18649
+ store: store$9,
18674
18650
  key: i
18675
18651
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18676
- store: store$a
18652
+ store: store$9
18677
18653
  })));
18678
18654
  };
18679
18655
 
@@ -18689,7 +18665,7 @@ const PasswordForgotButton = ({
18689
18665
  emailError
18690
18666
  },
18691
18667
  dispatch
18692
- } = useContext(store$a);
18668
+ } = useContext(store$9);
18693
18669
  const {
18694
18670
  t
18695
18671
  } = useTranslation("passwordForgot");
@@ -18710,7 +18686,7 @@ const PasswordForgotButton = ({
18710
18686
  };
18711
18687
 
18712
18688
  const PasswordForgotEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
18713
- store: store$a
18689
+ store: store$9
18714
18690
  }, props));
18715
18691
 
18716
18692
  const PasswordForgotView = props => {
@@ -18760,7 +18736,7 @@ const PasswordForgotModal = ({
18760
18736
  };
18761
18737
  PasswordForgotModal.viewId = "password-forgot";
18762
18738
 
18763
- const initialState$9 = {
18739
+ const initialState$8 = {
18764
18740
  currentPassword: "",
18765
18741
  newPassword: "",
18766
18742
  confirmNewPassword: "",
@@ -18774,10 +18750,10 @@ const initialState$9 = {
18774
18750
  content: ""
18775
18751
  }
18776
18752
  };
18777
- const store$9 = /*#__PURE__*/createContext(initialState$9);
18753
+ const store$8 = /*#__PURE__*/createContext(initialState$8);
18778
18754
  const {
18779
- Provider: Provider$9
18780
- } = store$9;
18755
+ Provider: Provider$8
18756
+ } = store$8;
18781
18757
  const PasswordChangeContainer = ({
18782
18758
  style,
18783
18759
  className = "",
@@ -18929,21 +18905,21 @@ const PasswordChangeContainer = ({
18929
18905
  default:
18930
18906
  return state;
18931
18907
  }
18932
- }, initialState$9);
18908
+ }, initialState$8);
18933
18909
  return /*#__PURE__*/React__default.createElement("div", {
18934
18910
  style: { ...style
18935
18911
  },
18936
18912
  className: `pelcro-container pelcro-password-change-container ${className}`
18937
- }, /*#__PURE__*/React__default.createElement(Provider$9, {
18913
+ }, /*#__PURE__*/React__default.createElement(Provider$8, {
18938
18914
  value: {
18939
18915
  state,
18940
18916
  dispatch
18941
18917
  }
18942
18918
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18943
- store: store$9,
18919
+ store: store$8,
18944
18920
  key: i
18945
18921
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18946
- store: store$9
18922
+ store: store$8
18947
18923
  })));
18948
18924
  };
18949
18925
 
@@ -18954,7 +18930,7 @@ function PasswordChangeCurrentPassword(props) {
18954
18930
  currentPassword,
18955
18931
  currentPasswordError
18956
18932
  }
18957
- } = useContext(store$9);
18933
+ } = useContext(store$8);
18958
18934
  const handleBlur = useCallback(() => {
18959
18935
  return dispatch({
18960
18936
  type: VALIDATE_PASSWORD
@@ -18988,7 +18964,7 @@ function PasswordChangeNewPassword(props) {
18988
18964
  newPassword,
18989
18965
  newPasswordError
18990
18966
  }
18991
- } = useContext(store$9);
18967
+ } = useContext(store$8);
18992
18968
  const handleBlur = useCallback(() => {
18993
18969
  return dispatch({
18994
18970
  type: VALIDATE_NEW_PASSWORD
@@ -19022,7 +18998,7 @@ function PasswordChangeConfirmNewPassword(props) {
19022
18998
  confirmNewPassword,
19023
18999
  confirmNewPasswordError
19024
19000
  }
19025
- } = useContext(store$9);
19001
+ } = useContext(store$8);
19026
19002
  const handleBlur = useCallback(() => {
19027
19003
  return dispatch({
19028
19004
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -19063,7 +19039,7 @@ const PasswordChangeButton = ({
19063
19039
  confirmNewPasswordError
19064
19040
  },
19065
19041
  dispatch
19066
- } = useContext(store$9);
19042
+ } = useContext(store$8);
19067
19043
  const {
19068
19044
  t
19069
19045
  } = useTranslation("passwordChange");
@@ -19129,17 +19105,17 @@ const PasswordChangeModal = ({
19129
19105
  };
19130
19106
  PasswordChangeModal.viewId = "password-change";
19131
19107
 
19132
- const initialState$8 = {
19108
+ const initialState$7 = {
19133
19109
  buttonDisabled: false,
19134
19110
  alert: {
19135
19111
  type: "error",
19136
19112
  content: ""
19137
19113
  }
19138
19114
  };
19139
- const store$8 = /*#__PURE__*/createContext(initialState$8);
19115
+ const store$7 = /*#__PURE__*/createContext(initialState$7);
19140
19116
  const {
19141
- Provider: Provider$8
19142
- } = store$8;
19117
+ Provider: Provider$7
19118
+ } = store$7;
19143
19119
 
19144
19120
  const CartContainer = ({
19145
19121
  style,
@@ -19230,21 +19206,21 @@ const CartContainer = ({
19230
19206
  default:
19231
19207
  return state;
19232
19208
  }
19233
- }, initialState$8);
19209
+ }, initialState$7);
19234
19210
  return /*#__PURE__*/React__default.createElement("div", {
19235
19211
  style: { ...style
19236
19212
  },
19237
19213
  className: `pelcro-container pelcro-cart-container ${className}`
19238
- }, /*#__PURE__*/React__default.createElement(Provider$8, {
19214
+ }, /*#__PURE__*/React__default.createElement(Provider$7, {
19239
19215
  value: {
19240
19216
  state,
19241
19217
  dispatch
19242
19218
  }
19243
19219
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19244
- store: store$8,
19220
+ store: store$7,
19245
19221
  key: i
19246
19222
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19247
- store: store$8
19223
+ store: store$7
19248
19224
  })));
19249
19225
  };
19250
19226
 
@@ -19281,7 +19257,7 @@ const CartSubmit = ({
19281
19257
  buttonDisabled
19282
19258
  },
19283
19259
  dispatch
19284
- } = useContext(store$8);
19260
+ } = useContext(store$7);
19285
19261
  const {
19286
19262
  t
19287
19263
  } = useTranslation("cart");
@@ -19312,7 +19288,7 @@ const CartTotalPrice = () => {
19312
19288
  state: {
19313
19289
  alert
19314
19290
  }
19315
- } = useContext(store$8);
19291
+ } = useContext(store$7);
19316
19292
  const {
19317
19293
  cartItems
19318
19294
  } = usePelcro();
@@ -19625,7 +19601,7 @@ const OrderConfirmModal = props => {
19625
19601
  };
19626
19602
  OrderConfirmModal.viewId = "order-confirm";
19627
19603
 
19628
- const initialState$7 = {
19604
+ const initialState$6 = {
19629
19605
  email: "",
19630
19606
  firstName: "",
19631
19607
  lastName: "",
@@ -19637,10 +19613,10 @@ const initialState$7 = {
19637
19613
  content: ""
19638
19614
  }
19639
19615
  };
19640
- const store$7 = /*#__PURE__*/createContext(initialState$7);
19616
+ const store$6 = /*#__PURE__*/createContext(initialState$6);
19641
19617
  const {
19642
- Provider: Provider$7
19643
- } = store$7;
19618
+ Provider: Provider$6
19619
+ } = store$6;
19644
19620
 
19645
19621
  const GiftCreateContainer = ({
19646
19622
  style,
@@ -19744,21 +19720,21 @@ const GiftCreateContainer = ({
19744
19720
  default:
19745
19721
  return state;
19746
19722
  }
19747
- }, initialState$7);
19723
+ }, initialState$6);
19748
19724
  return /*#__PURE__*/React__default.createElement("div", {
19749
19725
  style: { ...style
19750
19726
  },
19751
19727
  className: `pelcro-container pelcro-gift-create-container ${className}`
19752
- }, /*#__PURE__*/React__default.createElement(Provider$7, {
19728
+ }, /*#__PURE__*/React__default.createElement(Provider$6, {
19753
19729
  value: {
19754
19730
  state,
19755
19731
  dispatch
19756
19732
  }
19757
19733
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19758
- store: store$7,
19734
+ store: store$6,
19759
19735
  key: i
19760
19736
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19761
- store: store$7
19737
+ store: store$6
19762
19738
  })));
19763
19739
  };
19764
19740
 
@@ -19772,7 +19748,7 @@ const GiftCreateSubmitButton = ({
19772
19748
  state: {
19773
19749
  disableSubmit
19774
19750
  }
19775
- } = useContext(store$7);
19751
+ } = useContext(store$6);
19776
19752
  const {
19777
19753
  t
19778
19754
  } = useTranslation("register");
@@ -19789,29 +19765,29 @@ const GiftCreateSubmitButton = ({
19789
19765
 
19790
19766
  const GiftCreateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
19791
19767
  initWithUserEmail: false,
19792
- store: store$7
19768
+ store: store$6
19793
19769
  }, props));
19794
19770
 
19795
19771
  const GiftCreateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
19796
- store: store$7
19772
+ store: store$6
19797
19773
  }, props));
19798
19774
 
19799
19775
  const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
19800
- store: store$7
19776
+ store: store$6
19801
19777
  }, props));
19802
19778
 
19803
- var _path$i;
19779
+ var _path$h;
19804
19780
 
19805
- 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); }
19781
+ 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); }
19806
19782
 
19807
19783
  function SvgInfoCircle(props) {
19808
- return /*#__PURE__*/React.createElement("svg", _extends$k({
19784
+ return /*#__PURE__*/React.createElement("svg", _extends$j({
19809
19785
  xmlns: "http://www.w3.org/2000/svg",
19810
19786
  className: "plc-w-5 plc-h-5",
19811
19787
  fill: "none",
19812
19788
  viewBox: "0 0 24 24",
19813
19789
  stroke: "currentColor"
19814
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
19790
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
19815
19791
  strokeLinecap: "round",
19816
19792
  strokeLinejoin: "round",
19817
19793
  strokeWidth: 2,
@@ -19882,7 +19858,7 @@ const GiftCreateStartDate = props => {
19882
19858
  const {
19883
19859
  dispatch,
19884
19860
  state
19885
- } = useContext(store$7);
19861
+ } = useContext(store$6);
19886
19862
 
19887
19863
  const handleInputChange = value => {
19888
19864
  dispatch({
@@ -19955,7 +19931,7 @@ function GiftCreateMessage(props) {
19955
19931
  const {
19956
19932
  dispatch,
19957
19933
  state
19958
- } = useContext(store$7);
19934
+ } = useContext(store$6);
19959
19935
  const MAX_CHARS_COUNT = 200;
19960
19936
  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;
19961
19937
 
@@ -20079,7 +20055,7 @@ const GiftCreateModal = ({
20079
20055
  };
20080
20056
  GiftCreateModal.viewId = "gift-create";
20081
20057
 
20082
- const initialState$6 = {
20058
+ const initialState$5 = {
20083
20059
  giftCode: "",
20084
20060
  buttonDisabled: true,
20085
20061
  alert: {
@@ -20087,10 +20063,10 @@ const initialState$6 = {
20087
20063
  content: ""
20088
20064
  }
20089
20065
  };
20090
- const store$6 = /*#__PURE__*/createContext(initialState$6);
20066
+ const store$5 = /*#__PURE__*/createContext(initialState$5);
20091
20067
  const {
20092
- Provider: Provider$6
20093
- } = store$6;
20068
+ Provider: Provider$5
20069
+ } = store$5;
20094
20070
 
20095
20071
  const GiftRedeemContainer = ({
20096
20072
  style,
@@ -20155,21 +20131,21 @@ const GiftRedeemContainer = ({
20155
20131
  default:
20156
20132
  return state;
20157
20133
  }
20158
- }, initialState$6);
20134
+ }, initialState$5);
20159
20135
  return /*#__PURE__*/React__default.createElement("div", {
20160
20136
  style: { ...style
20161
20137
  },
20162
20138
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
20163
- }, /*#__PURE__*/React__default.createElement(Provider$6, {
20139
+ }, /*#__PURE__*/React__default.createElement(Provider$5, {
20164
20140
  value: {
20165
20141
  state,
20166
20142
  dispatch
20167
20143
  }
20168
20144
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
20169
- store: store$6,
20145
+ store: store$5,
20170
20146
  key: i
20171
20147
  })) : /*#__PURE__*/React__default.cloneElement(children, {
20172
- store: store$6
20148
+ store: store$5
20173
20149
  })));
20174
20150
  };
20175
20151
 
@@ -20206,7 +20182,7 @@ function GiftCode({
20206
20182
  }
20207
20183
 
20208
20184
  const GiftRedeemCode = props => /*#__PURE__*/React__default.createElement(GiftCode, Object.assign({
20209
- store: store$6
20185
+ store: store$5
20210
20186
  }, props));
20211
20187
 
20212
20188
  const GiftRedeemSubmitButton = ({
@@ -20219,7 +20195,7 @@ const GiftRedeemSubmitButton = ({
20219
20195
  state: {
20220
20196
  disableSubmit
20221
20197
  }
20222
- } = useContext(store$6);
20198
+ } = useContext(store$5);
20223
20199
  const {
20224
20200
  t
20225
20201
  } = useTranslation("register");
@@ -20312,7 +20288,7 @@ const moveDefaultAddressToStart = addresses => {
20312
20288
  return [defaultAddress, ...addressesWithoutDefault];
20313
20289
  };
20314
20290
 
20315
- const initialState$5 = {
20291
+ const initialState$4 = {
20316
20292
  addresses: [],
20317
20293
  selectedAddressId: null,
20318
20294
  isSubmitting: false,
@@ -20321,10 +20297,10 @@ const initialState$5 = {
20321
20297
  content: ""
20322
20298
  }
20323
20299
  };
20324
- const store$5 = /*#__PURE__*/createContext(initialState$5);
20300
+ const store$4 = /*#__PURE__*/createContext(initialState$4);
20325
20301
  const {
20326
- Provider: Provider$5
20327
- } = store$5;
20302
+ Provider: Provider$4
20303
+ } = store$4;
20328
20304
 
20329
20305
  const AddressSelectContainer = ({
20330
20306
  style,
@@ -20419,7 +20395,7 @@ const AddressSelectContainer = ({
20419
20395
  default:
20420
20396
  return state;
20421
20397
  }
20422
- }, initialState$5);
20398
+ }, initialState$4);
20423
20399
  useEffect(() => {
20424
20400
  var _window$Pelcro$user$r;
20425
20401
 
@@ -20432,16 +20408,16 @@ const AddressSelectContainer = ({
20432
20408
  style: { ...style
20433
20409
  },
20434
20410
  className: `pelcro-container pelcro-address-select-container ${className}`
20435
- }, /*#__PURE__*/React__default.createElement(Provider$5, {
20411
+ }, /*#__PURE__*/React__default.createElement(Provider$4, {
20436
20412
  value: {
20437
20413
  state,
20438
20414
  dispatch
20439
20415
  }
20440
20416
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
20441
- store: store$5,
20417
+ store: store$4,
20442
20418
  key: i
20443
20419
  })) : /*#__PURE__*/React__default.cloneElement(children, {
20444
- store: store$5
20420
+ store: store$4
20445
20421
  })));
20446
20422
  };
20447
20423
 
@@ -20452,7 +20428,7 @@ const AddressSelectList = () => {
20452
20428
  addresses,
20453
20429
  selectedAddressId
20454
20430
  }
20455
- } = useContext(store$5);
20431
+ } = useContext(store$4);
20456
20432
 
20457
20433
  const handleAddressSelect = event => {
20458
20434
  dispatch({
@@ -20496,7 +20472,7 @@ const AddressSelectSubmit = ({
20496
20472
  selectedAddressId,
20497
20473
  isSubmitting
20498
20474
  }
20499
- } = useContext(store$5);
20475
+ } = useContext(store$4);
20500
20476
  const {
20501
20477
  t
20502
20478
  } = useTranslation("address");
@@ -20592,7 +20568,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20592
20568
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20593
20569
  };
20594
20570
 
20595
- const initialState$4 = {
20571
+ const initialState$3 = {
20596
20572
  paymentMethods: [],
20597
20573
  selectedPaymentMethodId: null,
20598
20574
  isSubmitting: false,
@@ -20601,10 +20577,10 @@ const initialState$4 = {
20601
20577
  content: ""
20602
20578
  }
20603
20579
  };
20604
- const store$4 = /*#__PURE__*/createContext(initialState$4);
20580
+ const store$3 = /*#__PURE__*/createContext(initialState$3);
20605
20581
  const {
20606
- Provider: Provider$4
20607
- } = store$4;
20582
+ Provider: Provider$3
20583
+ } = store$3;
20608
20584
 
20609
20585
  const PaymentMethodSelectContainer = ({
20610
20586
  style,
@@ -20663,7 +20639,7 @@ const PaymentMethodSelectContainer = ({
20663
20639
  default:
20664
20640
  return state;
20665
20641
  }
20666
- }, initialState$4);
20642
+ }, initialState$3);
20667
20643
  useEffect(() => {
20668
20644
  var _window$Pelcro$user$r3;
20669
20645
 
@@ -20676,16 +20652,16 @@ const PaymentMethodSelectContainer = ({
20676
20652
  style: { ...style
20677
20653
  },
20678
20654
  className: `pelcro-container pelcro-payment-select-container ${className}`
20679
- }, /*#__PURE__*/React__default.createElement(Provider$4, {
20655
+ }, /*#__PURE__*/React__default.createElement(Provider$3, {
20680
20656
  value: {
20681
20657
  state,
20682
20658
  dispatch
20683
20659
  }
20684
20660
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
20685
- store: store$4,
20661
+ store: store$3,
20686
20662
  key: i
20687
20663
  })) : /*#__PURE__*/React__default.cloneElement(children, {
20688
- store: store$4
20664
+ store: store$3
20689
20665
  })));
20690
20666
  };
20691
20667
 
@@ -20699,7 +20675,7 @@ const PaymentMethodSelectList = () => {
20699
20675
  paymentMethods,
20700
20676
  selectedPaymentMethodId
20701
20677
  }
20702
- } = useContext(store$4);
20678
+ } = useContext(store$3);
20703
20679
 
20704
20680
  const handlePaymentMethodSelect = event => {
20705
20681
  dispatch({
@@ -20749,7 +20725,7 @@ const PaymentMethodSelectSubmit = ({
20749
20725
  selectedPaymentMethodId,
20750
20726
  isSubmitting
20751
20727
  }
20752
- } = useContext(store$4);
20728
+ } = useContext(store$3);
20753
20729
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
20754
20730
  onClick: () => {
20755
20731
  dispatch({
@@ -20823,8 +20799,8 @@ const PaymentMethodSelectModal = ({
20823
20799
  };
20824
20800
  PaymentMethodSelectModal.viewId = "payment-method-select";
20825
20801
 
20826
- function _extends$j() {
20827
- _extends$j = Object.assign || function (target) {
20802
+ function _extends$i() {
20803
+ _extends$i = Object.assign || function (target) {
20828
20804
  for (var i = 1; i < arguments.length; i++) {
20829
20805
  var source = arguments[i];
20830
20806
 
@@ -20838,7 +20814,7 @@ function _extends$j() {
20838
20814
  return target;
20839
20815
  };
20840
20816
 
20841
- return _extends$j.apply(this, arguments);
20817
+ return _extends$i.apply(this, arguments);
20842
20818
  }
20843
20819
 
20844
20820
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -21022,7 +20998,7 @@ function render(props, propsBag, defaultTag, features, visible) {
21022
20998
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
21023
20999
  return null;
21024
21000
  }, _match[RenderStrategy.Hidden] = function () {
21025
- return _render(_extends$j({}, _rest, {
21001
+ return _render(_extends$i({}, _rest, {
21026
21002
  hidden: true,
21027
21003
  style: {
21028
21004
  display: 'none'
@@ -21550,7 +21526,7 @@ function TransitionChild(props) {
21550
21526
  var passthroughProps = rest;
21551
21527
  return React__default.createElement(NestingContext.Provider, {
21552
21528
  value: nesting
21553
- }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21529
+ }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21554
21530
  }
21555
21531
 
21556
21532
  function Transition(props) {
@@ -21594,7 +21570,7 @@ function Transition(props) {
21594
21570
  value: nestingBag
21595
21571
  }, React__default.createElement(TransitionContext.Provider, {
21596
21572
  value: transitionBag
21597
- }, render(_extends$j({}, sharedProps, {
21573
+ }, render(_extends$i({}, sharedProps, {
21598
21574
  as: Fragment,
21599
21575
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21600
21576
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21721,12 +21697,12 @@ var ActionTypes;
21721
21697
  })(ActionTypes || (ActionTypes = {}));
21722
21698
 
21723
21699
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21724
- return _extends$j({}, state, {
21700
+ return _extends$i({}, state, {
21725
21701
  activeItemIndex: null,
21726
21702
  menuState: MenuStates.Closed
21727
21703
  });
21728
21704
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21729
- return _extends$j({}, state, {
21705
+ return _extends$i({}, state, {
21730
21706
  menuState: MenuStates.Open
21731
21707
  });
21732
21708
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21745,7 +21721,7 @@ var ActionTypes;
21745
21721
  }
21746
21722
  });
21747
21723
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21748
- return _extends$j({}, state, {
21724
+ return _extends$i({}, state, {
21749
21725
  searchQuery: '',
21750
21726
  activeItemIndex: activeItemIndex
21751
21727
  });
@@ -21756,19 +21732,19 @@ var ActionTypes;
21756
21732
 
21757
21733
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21758
21734
  });
21759
- if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21735
+ if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21760
21736
  searchQuery: searchQuery
21761
21737
  });
21762
- return _extends$j({}, state, {
21738
+ return _extends$i({}, state, {
21763
21739
  searchQuery: searchQuery,
21764
21740
  activeItemIndex: match
21765
21741
  });
21766
21742
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21767
- return _extends$j({}, state, {
21743
+ return _extends$i({}, state, {
21768
21744
  searchQuery: ''
21769
21745
  });
21770
21746
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21771
- return _extends$j({}, state, {
21747
+ return _extends$i({}, state, {
21772
21748
  items: [].concat(state.items, [{
21773
21749
  id: action.id,
21774
21750
  dataRef: action.dataRef
@@ -21781,7 +21757,7 @@ var ActionTypes;
21781
21757
  return a.id === action.id;
21782
21758
  });
21783
21759
  if (idx !== -1) nextItems.splice(idx, 1);
21784
- return _extends$j({}, state, {
21760
+ return _extends$i({}, state, {
21785
21761
  items: nextItems,
21786
21762
  activeItemIndex: function () {
21787
21763
  if (idx === state.activeItemIndex) return null;
@@ -21820,19 +21796,19 @@ var ActionTypes$1;
21820
21796
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21821
21797
  if (state.disabled) return state;
21822
21798
  if (state.listboxState === ListboxStates.Closed) return state;
21823
- return _extends$j({}, state, {
21799
+ return _extends$i({}, state, {
21824
21800
  activeOptionIndex: null,
21825
21801
  listboxState: ListboxStates.Closed
21826
21802
  });
21827
21803
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21828
21804
  if (state.disabled) return state;
21829
21805
  if (state.listboxState === ListboxStates.Open) return state;
21830
- return _extends$j({}, state, {
21806
+ return _extends$i({}, state, {
21831
21807
  listboxState: ListboxStates.Open
21832
21808
  });
21833
21809
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21834
21810
  if (state.disabled === action.disabled) return state;
21835
- return _extends$j({}, state, {
21811
+ return _extends$i({}, state, {
21836
21812
  disabled: action.disabled
21837
21813
  });
21838
21814
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21853,7 +21829,7 @@ var ActionTypes$1;
21853
21829
  }
21854
21830
  });
21855
21831
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21856
- return _extends$j({}, state, {
21832
+ return _extends$i({}, state, {
21857
21833
  searchQuery: '',
21858
21834
  activeOptionIndex: activeOptionIndex
21859
21835
  });
@@ -21866,10 +21842,10 @@ var ActionTypes$1;
21866
21842
 
21867
21843
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21868
21844
  });
21869
- if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21845
+ if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21870
21846
  searchQuery: searchQuery
21871
21847
  });
21872
- return _extends$j({}, state, {
21848
+ return _extends$i({}, state, {
21873
21849
  searchQuery: searchQuery,
21874
21850
  activeOptionIndex: match
21875
21851
  });
@@ -21877,11 +21853,11 @@ var ActionTypes$1;
21877
21853
  if (state.disabled) return state;
21878
21854
  if (state.listboxState === ListboxStates.Closed) return state;
21879
21855
  if (state.searchQuery === '') return state;
21880
- return _extends$j({}, state, {
21856
+ return _extends$i({}, state, {
21881
21857
  searchQuery: ''
21882
21858
  });
21883
21859
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21884
- return _extends$j({}, state, {
21860
+ return _extends$i({}, state, {
21885
21861
  options: [].concat(state.options, [{
21886
21862
  id: action.id,
21887
21863
  dataRef: action.dataRef
@@ -21894,7 +21870,7 @@ var ActionTypes$1;
21894
21870
  return a.id === action.id;
21895
21871
  });
21896
21872
  if (idx !== -1) nextOptions.splice(idx, 1);
21897
- return _extends$j({}, state, {
21873
+ return _extends$i({}, state, {
21898
21874
  options: nextOptions,
21899
21875
  activeOptionIndex: function () {
21900
21876
  if (idx === state.activeOptionIndex) return null;
@@ -21955,18 +21931,18 @@ const getPaymentCardIcon = name => {
21955
21931
  }));
21956
21932
  };
21957
21933
 
21958
- var _path$h;
21934
+ var _path$g;
21959
21935
 
21960
- 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); }
21936
+ 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); }
21961
21937
 
21962
21938
  function SvgChevronRight(props) {
21963
- return /*#__PURE__*/React.createElement("svg", _extends$i({
21939
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
21964
21940
  className: "plc-w-6 plc-h-6",
21965
21941
  xmlns: "http://www.w3.org/2000/svg",
21966
21942
  fill: "none",
21967
21943
  viewBox: "0 0 24 24",
21968
21944
  stroke: "currentColor"
21969
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
21945
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
21970
21946
  strokeLinecap: "round",
21971
21947
  strokeLinejoin: "round",
21972
21948
  strokeWidth: 2,
@@ -22182,18 +22158,18 @@ const SavedItems = ({
22182
22158
  });
22183
22159
  };
22184
22160
 
22185
- var _path$g;
22161
+ var _path$f;
22186
22162
 
22187
- 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); }
22163
+ 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); }
22188
22164
 
22189
22165
  function SvgRefresh(props) {
22190
- return /*#__PURE__*/React.createElement("svg", _extends$h({
22166
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
22191
22167
  className: "plc-w-4 plc-h-4 plc-mr-1",
22192
22168
  xmlns: "http://www.w3.org/2000/svg",
22193
22169
  fill: "none",
22194
22170
  viewBox: "0 0 24 24",
22195
22171
  stroke: "currentColor"
22196
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
22172
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
22197
22173
  strokeLinecap: "round",
22198
22174
  strokeLinejoin: "round",
22199
22175
  strokeWidth: 2,
@@ -22201,35 +22177,35 @@ function SvgRefresh(props) {
22201
22177
  })));
22202
22178
  }
22203
22179
 
22204
- var _path$f;
22180
+ var _path$e;
22205
22181
 
22206
- 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); }
22182
+ 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); }
22207
22183
 
22208
22184
  function SvgCalendar(props) {
22209
- return /*#__PURE__*/React.createElement("svg", _extends$g({
22185
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
22210
22186
  xmlns: "http://www.w3.org/2000/svg",
22211
22187
  className: "plc-h-4 plc-w-4 plc-mr-1",
22212
22188
  viewBox: "0 0 20 20",
22213
22189
  fill: "currentColor"
22214
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
22190
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
22215
22191
  fillRule: "evenodd",
22216
22192
  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",
22217
22193
  clipRule: "evenodd"
22218
22194
  })));
22219
22195
  }
22220
22196
 
22221
- var _path$e;
22197
+ var _path$d;
22222
22198
 
22223
- 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); }
22199
+ 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); }
22224
22200
 
22225
22201
  function SvgPlus(props) {
22226
- return /*#__PURE__*/React.createElement("svg", _extends$f({
22202
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
22227
22203
  className: "plc-w-5 plc-h-5",
22228
22204
  xmlns: "http://www.w3.org/2000/svg",
22229
22205
  fill: "none",
22230
22206
  viewBox: "0 0 24 24",
22231
22207
  stroke: "currentColor"
22232
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
22208
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
22233
22209
  strokeLinecap: "round",
22234
22210
  strokeLinejoin: "round",
22235
22211
  strokeWidth: 2,
@@ -22237,17 +22213,17 @@ function SvgPlus(props) {
22237
22213
  })));
22238
22214
  }
22239
22215
 
22240
- var _path$d;
22216
+ var _path$c;
22241
22217
 
22242
- 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); }
22218
+ 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); }
22243
22219
 
22244
22220
  function SvgCheckMark(props) {
22245
- return /*#__PURE__*/React.createElement("svg", _extends$e({
22221
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
22246
22222
  className: "plc-w-4 plc-h-4 plc-mr-1",
22247
22223
  xmlns: "http://www.w3.org/2000/svg",
22248
22224
  viewBox: "0 0 20 20",
22249
22225
  fill: "currentColor"
22250
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
22226
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
22251
22227
  fillRule: "evenodd",
22252
22228
  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",
22253
22229
  clipRule: "evenodd"
@@ -22311,8 +22287,7 @@ const SubscriptionsItems = ({
22311
22287
  } = useTranslation("dashboard");
22312
22288
  const {
22313
22289
  switchView,
22314
- switchToAddressView,
22315
- switchToPaymentView
22290
+ isAuthenticated
22316
22291
  } = usePelcro();
22317
22292
  const subs = getNonDonationSubs();
22318
22293
  if (subs.length === 0) return null;
@@ -22354,12 +22329,7 @@ const SubscriptionsItems = ({
22354
22329
  const plan = window.Pelcro.plan.getById(plan_id);
22355
22330
  setProductAndPlan(product, plan);
22356
22331
  setSubscriptionIdToRenew(sub.id);
22357
-
22358
- if (product.address_required) {
22359
- return switchToAddressView();
22360
- }
22361
-
22362
- return switchToPaymentView();
22332
+ setView("plan-select");
22363
22333
  };
22364
22334
 
22365
22335
  const getPhases = () => {
@@ -22548,18 +22518,18 @@ Accordion.item = function AccordionItem({
22548
22518
  }, content)) : null;
22549
22519
  };
22550
22520
 
22551
- var _path$c;
22521
+ var _path$b;
22552
22522
 
22553
- 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); }
22523
+ 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); }
22554
22524
 
22555
22525
  function SvgExit(props) {
22556
- return /*#__PURE__*/React.createElement("svg", _extends$d({
22526
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
22557
22527
  className: "plc-w-6 plc-h-6",
22558
22528
  xmlns: "http://www.w3.org/2000/svg",
22559
22529
  fill: "none",
22560
22530
  viewBox: "0 0 24 24",
22561
22531
  stroke: "currentColor"
22562
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
22532
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
22563
22533
  strokeLinecap: "round",
22564
22534
  strokeLinejoin: "round",
22565
22535
  strokeWidth: 2,
@@ -22567,17 +22537,17 @@ function SvgExit(props) {
22567
22537
  })));
22568
22538
  }
22569
22539
 
22570
- var _path$b;
22540
+ var _path$a;
22571
22541
 
22572
- 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); }
22542
+ 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); }
22573
22543
 
22574
22544
  function SvgUser(props) {
22575
- return /*#__PURE__*/React.createElement("svg", _extends$c({
22545
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
22576
22546
  xmlns: "http://www.w3.org/2000/svg",
22577
22547
  fill: "none",
22578
22548
  viewBox: "0 0 24 24",
22579
22549
  stroke: "currentColor"
22580
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
22550
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
22581
22551
  strokeLinecap: "round",
22582
22552
  strokeLinejoin: "round",
22583
22553
  strokeWidth: 2,
@@ -22585,18 +22555,18 @@ function SvgUser(props) {
22585
22555
  })));
22586
22556
  }
22587
22557
 
22588
- var _path$a;
22558
+ var _path$9;
22589
22559
 
22590
- 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); }
22560
+ 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); }
22591
22561
 
22592
22562
  function SvgNewsletter(props) {
22593
- return /*#__PURE__*/React.createElement("svg", _extends$b({
22563
+ return /*#__PURE__*/React.createElement("svg", _extends$a({
22594
22564
  xmlns: "http://www.w3.org/2000/svg",
22595
22565
  className: "plc-h-5 plc-w-5",
22596
22566
  fill: "none",
22597
22567
  viewBox: "0 0 24 24",
22598
22568
  stroke: "currentColor"
22599
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
22569
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
22600
22570
  strokeLinecap: "round",
22601
22571
  strokeLinejoin: "round",
22602
22572
  strokeWidth: 2,
@@ -22604,18 +22574,18 @@ function SvgNewsletter(props) {
22604
22574
  })));
22605
22575
  }
22606
22576
 
22607
- var _path$9;
22577
+ var _path$8;
22608
22578
 
22609
- 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); }
22579
+ 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); }
22610
22580
 
22611
22581
  function SvgDocument(props) {
22612
- return /*#__PURE__*/React.createElement("svg", _extends$a({
22582
+ return /*#__PURE__*/React.createElement("svg", _extends$9({
22613
22583
  xmlns: "http://www.w3.org/2000/svg",
22614
22584
  className: "plc-h-6 plc-w-6 plc-mr-2",
22615
22585
  fill: "none",
22616
22586
  viewBox: "0 0 24 24",
22617
22587
  stroke: "currentColor"
22618
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
22588
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
22619
22589
  strokeLinecap: "round",
22620
22590
  strokeLinejoin: "round",
22621
22591
  strokeWidth: 2,
@@ -22623,18 +22593,18 @@ function SvgDocument(props) {
22623
22593
  })));
22624
22594
  }
22625
22595
 
22626
- var _path$8;
22596
+ var _path$7;
22627
22597
 
22628
- 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); }
22598
+ 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); }
22629
22599
 
22630
22600
  function SvgPaymentCard(props) {
22631
- return /*#__PURE__*/React.createElement("svg", _extends$9({
22601
+ return /*#__PURE__*/React.createElement("svg", _extends$8({
22632
22602
  className: "plc-w-6 plc-h-6 plc-mr-2",
22633
22603
  xmlns: "http://www.w3.org/2000/svg",
22634
22604
  fill: "none",
22635
22605
  viewBox: "0 0 24 24",
22636
22606
  stroke: "currentColor"
22637
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
22607
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
22638
22608
  strokeLinecap: "round",
22639
22609
  strokeLinejoin: "round",
22640
22610
  strokeWidth: 2,
@@ -22642,18 +22612,18 @@ function SvgPaymentCard(props) {
22642
22612
  })));
22643
22613
  }
22644
22614
 
22645
- var _path$7, _path2$1;
22615
+ var _path$6, _path2$1;
22646
22616
 
22647
- 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); }
22617
+ 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); }
22648
22618
 
22649
22619
  function SvgLocationPin(props) {
22650
- return /*#__PURE__*/React.createElement("svg", _extends$8({
22620
+ return /*#__PURE__*/React.createElement("svg", _extends$7({
22651
22621
  className: "plc-w-6 plc-h-6 plc-mr-2",
22652
22622
  xmlns: "http://www.w3.org/2000/svg",
22653
22623
  fill: "none",
22654
22624
  viewBox: "0 0 24 24",
22655
22625
  stroke: "currentColor"
22656
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
22626
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
22657
22627
  strokeLinecap: "round",
22658
22628
  strokeLinejoin: "round",
22659
22629
  strokeWidth: 2,
@@ -22668,10 +22638,10 @@ function SvgLocationPin(props) {
22668
22638
 
22669
22639
  var _switch;
22670
22640
 
22671
- 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); }
22641
+ 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); }
22672
22642
 
22673
22643
  function SvgSubscription(props) {
22674
- return /*#__PURE__*/React.createElement("svg", _extends$7({
22644
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
22675
22645
  xmlns: "http://www.w3.org/2000/svg",
22676
22646
  viewBox: "0 0 100 125",
22677
22647
  fill: "currentColor"
@@ -22686,18 +22656,18 @@ function SvgSubscription(props) {
22686
22656
  }))))));
22687
22657
  }
22688
22658
 
22689
- var _path$6;
22659
+ var _path$5;
22690
22660
 
22691
- 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); }
22661
+ 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); }
22692
22662
 
22693
22663
  function SvgShopping(props) {
22694
- return /*#__PURE__*/React.createElement("svg", _extends$6({
22664
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
22695
22665
  className: "plc-w-6 plc-h-6 plc-mr-2",
22696
22666
  xmlns: "http://www.w3.org/2000/svg",
22697
22667
  fill: "none",
22698
22668
  viewBox: "0 0 24 24",
22699
22669
  stroke: "currentColor"
22700
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
22670
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
22701
22671
  strokeLinecap: "round",
22702
22672
  strokeLinejoin: "round",
22703
22673
  strokeWidth: 2,
@@ -22705,18 +22675,18 @@ function SvgShopping(props) {
22705
22675
  })));
22706
22676
  }
22707
22677
 
22708
- var _path$5;
22678
+ var _path$4;
22709
22679
 
22710
- 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); }
22680
+ 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); }
22711
22681
 
22712
22682
  function SvgBookmark(props) {
22713
- return /*#__PURE__*/React.createElement("svg", _extends$5({
22683
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
22714
22684
  className: "plc-w-6 plc-h-6 plc-mr-2",
22715
22685
  xmlns: "http://www.w3.org/2000/svg",
22716
22686
  fill: "none",
22717
22687
  viewBox: "0 0 24 24",
22718
22688
  stroke: "currentColor"
22719
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
22689
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
22720
22690
  strokeLinecap: "round",
22721
22691
  strokeLinejoin: "round",
22722
22692
  strokeWidth: 2,
@@ -22724,33 +22694,33 @@ function SvgBookmark(props) {
22724
22694
  })));
22725
22695
  }
22726
22696
 
22727
- var _path$4;
22697
+ var _path$3;
22728
22698
 
22729
- 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); }
22699
+ 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); }
22730
22700
 
22731
22701
  function SvgKey(props) {
22732
- return /*#__PURE__*/React.createElement("svg", _extends$4({
22702
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
22733
22703
  xmlns: "http://www.w3.org/2000/svg",
22734
22704
  viewBox: "0 0 20 20",
22735
22705
  fill: "currentColor"
22736
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
22706
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
22737
22707
  fillRule: "evenodd",
22738
22708
  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",
22739
22709
  clipRule: "evenodd"
22740
22710
  })));
22741
22711
  }
22742
22712
 
22743
- var _path$3;
22713
+ var _path$2;
22744
22714
 
22745
- 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); }
22715
+ 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); }
22746
22716
 
22747
22717
  function SvgDonate(props) {
22748
- return /*#__PURE__*/React.createElement("svg", _extends$3({
22718
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
22749
22719
  width: 24,
22750
22720
  height: 24,
22751
22721
  fill: "currentColor",
22752
22722
  xmlns: "http://www.w3.org/2000/svg"
22753
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
22723
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
22754
22724
  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"
22755
22725
  })));
22756
22726
  }
@@ -23077,10 +23047,9 @@ class Dashboard extends Component {
23077
23047
  }) => {
23078
23048
  if (isGift) {
23079
23049
  this.props.setProductAndPlan(null, null, true);
23080
- return this.props.setView("plan-select");
23081
23050
  }
23082
23051
 
23083
- return this.props.setView("subscription-options");
23052
+ return this.props.setView("plan-select");
23084
23053
  });
23085
23054
 
23086
23055
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -23548,7 +23517,7 @@ const DashboardOpenButton = () => {
23548
23517
  };
23549
23518
  DashboardOpenButton.viewId = "dashboard-open";
23550
23519
 
23551
- const initialState$3 = {
23520
+ const initialState$2 = {
23552
23521
  imageSrc: null,
23553
23522
  crop: {
23554
23523
  x: 0,
@@ -23562,10 +23531,10 @@ const initialState$3 = {
23562
23531
  content: ""
23563
23532
  }
23564
23533
  };
23565
- const store$3 = /*#__PURE__*/createContext(initialState$3);
23534
+ const store$2 = /*#__PURE__*/createContext(initialState$2);
23566
23535
  const {
23567
- Provider: Provider$3
23568
- } = store$3;
23536
+ Provider: Provider$2
23537
+ } = store$2;
23569
23538
 
23570
23539
  const ProfilePicChangeContainer = ({
23571
23540
  style,
@@ -23699,21 +23668,21 @@ const ProfilePicChangeContainer = ({
23699
23668
  default:
23700
23669
  return state;
23701
23670
  }
23702
- }, initialState$3);
23671
+ }, initialState$2);
23703
23672
  return /*#__PURE__*/React__default.createElement("div", {
23704
23673
  style: { ...style
23705
23674
  },
23706
23675
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23707
- }, /*#__PURE__*/React__default.createElement(Provider$3, {
23676
+ }, /*#__PURE__*/React__default.createElement(Provider$2, {
23708
23677
  value: {
23709
23678
  state,
23710
23679
  dispatch
23711
23680
  }
23712
23681
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
23713
- store: store$3,
23682
+ store: store$2,
23714
23683
  key: i
23715
23684
  })) : /*#__PURE__*/React__default.cloneElement(children, {
23716
- store: store$3
23685
+ store: store$2
23717
23686
  })));
23718
23687
  };
23719
23688
  /**
@@ -23775,7 +23744,7 @@ const ProfilePicChangeButton = ({
23775
23744
  isSubmitting
23776
23745
  },
23777
23746
  dispatch
23778
- } = useContext(store$3);
23747
+ } = useContext(store$2);
23779
23748
  const {
23780
23749
  t
23781
23750
  } = useTranslation("userEdit");
@@ -25143,7 +25112,7 @@ const ProfilePicChangeCropper = ({
25143
25112
  zoom
25144
25113
  },
25145
25114
  dispatch
25146
- } = useContext(store$3);
25115
+ } = useContext(store$2);
25147
25116
  return /*#__PURE__*/React__default.createElement("div", {
25148
25117
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
25149
25118
  }, /*#__PURE__*/React__default.createElement(Cropper, Object.assign({
@@ -25185,7 +25154,7 @@ const ProfilePicChangeZoom = ({
25185
25154
  zoom
25186
25155
  },
25187
25156
  dispatch
25188
- } = useContext(store$3);
25157
+ } = useContext(store$2);
25189
25158
  const {
25190
25159
  t
25191
25160
  } = useTranslation("userEdit");
@@ -25208,18 +25177,18 @@ const ProfilePicChangeZoom = ({
25208
25177
  }, otherProps)));
25209
25178
  };
25210
25179
 
25211
- var _path$2;
25180
+ var _path$1;
25212
25181
 
25213
- 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); }
25182
+ 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); }
25214
25183
 
25215
25184
  function SvgPhotograph(props) {
25216
- return /*#__PURE__*/React.createElement("svg", _extends$2({
25185
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
25217
25186
  xmlns: "http://www.w3.org/2000/svg",
25218
25187
  className: "plc-h-6 plc-w-6",
25219
25188
  fill: "none",
25220
25189
  viewBox: "0 0 24 24",
25221
25190
  stroke: "currentColor"
25222
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
25191
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
25223
25192
  strokeLinecap: "round",
25224
25193
  strokeLinejoin: "round",
25225
25194
  strokeWidth: 2,
@@ -25237,7 +25206,7 @@ const ProfilePicChangeSelectButton = ({
25237
25206
  state: {
25238
25207
  isSubmitting
25239
25208
  }
25240
- } = useContext(store$3);
25209
+ } = useContext(store$2);
25241
25210
  const {
25242
25211
  t
25243
25212
  } = useTranslation("userEdit");
@@ -25279,7 +25248,7 @@ const ProfilePicChangeRemoveButton = ({
25279
25248
  state: {
25280
25249
  isSubmitting
25281
25250
  }
25282
- } = useContext(store$3);
25251
+ } = useContext(store$2);
25283
25252
  const {
25284
25253
  t
25285
25254
  } = useTranslation("userEdit");
@@ -25302,7 +25271,7 @@ const ProfilePicChangeWrapper = () => {
25302
25271
  state: {
25303
25272
  imageSrc
25304
25273
  }
25305
- } = useContext(store$3);
25274
+ } = useContext(store$2);
25306
25275
  const {
25307
25276
  t
25308
25277
  } = useTranslation("userEdit");
@@ -25364,17 +25333,17 @@ function ProfilePicChangeModal({
25364
25333
  }
25365
25334
  ProfilePicChangeModal.viewId = "profile-picture";
25366
25335
 
25367
- const initialState$2 = {
25336
+ const initialState$1 = {
25368
25337
  isSubmitting: false,
25369
25338
  alert: {
25370
25339
  type: "error",
25371
25340
  content: ""
25372
25341
  }
25373
25342
  };
25374
- const store$2 = /*#__PURE__*/createContext(initialState$2);
25343
+ const store$1 = /*#__PURE__*/createContext(initialState$1);
25375
25344
  const {
25376
- Provider: Provider$2
25377
- } = store$2;
25345
+ Provider: Provider$1
25346
+ } = store$1;
25378
25347
 
25379
25348
  const EmailVerifyContainer = ({
25380
25349
  style,
@@ -25437,21 +25406,21 @@ const EmailVerifyContainer = ({
25437
25406
  default:
25438
25407
  return state;
25439
25408
  }
25440
- }, initialState$2);
25409
+ }, initialState$1);
25441
25410
  return /*#__PURE__*/React__default.createElement("div", {
25442
25411
  style: { ...style
25443
25412
  },
25444
25413
  className: `pelcro-container pelcro-email-verify-container ${className}`
25445
- }, /*#__PURE__*/React__default.createElement(Provider$2, {
25414
+ }, /*#__PURE__*/React__default.createElement(Provider$1, {
25446
25415
  value: {
25447
25416
  state,
25448
25417
  dispatch
25449
25418
  }
25450
25419
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
25451
- store: store$2,
25420
+ store: store$1,
25452
25421
  key: i
25453
25422
  })) : /*#__PURE__*/React__default.cloneElement(children, {
25454
- store: store$2
25423
+ store: store$1
25455
25424
  })));
25456
25425
  };
25457
25426
 
@@ -25465,7 +25434,7 @@ const EmailVerifyResendButton = ({
25465
25434
  state: {
25466
25435
  isSubmitting
25467
25436
  }
25468
- } = useContext(store$2);
25437
+ } = useContext(store$1);
25469
25438
  const {
25470
25439
  t
25471
25440
  } = useTranslation("verifyEmail");
@@ -25480,16 +25449,16 @@ const EmailVerifyResendButton = ({
25480
25449
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
25481
25450
  };
25482
25451
 
25483
- var _path$1, _path2;
25452
+ var _path, _path2;
25484
25453
 
25485
- 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); }
25454
+ 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); }
25486
25455
 
25487
25456
  function SvgEmailVerify(props) {
25488
- return /*#__PURE__*/React.createElement("svg", _extends$1({
25457
+ return /*#__PURE__*/React.createElement("svg", _extends({
25489
25458
  className: "plc-w-6 plc-h-6",
25490
25459
  viewBox: "0 0 700 700",
25491
25460
  xmlns: "http://www.w3.org/2000/svg"
25492
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
25461
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
25493
25462
  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"
25494
25463
  })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
25495
25464
  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"
@@ -25593,11 +25562,11 @@ const invoicePaymentSubmitButton = props => {
25593
25562
  return /*#__PURE__*/React__default.createElement(SubmitPaymentMethod, props);
25594
25563
  };
25595
25564
 
25596
- const initialState$1 = {};
25597
- const store$1 = /*#__PURE__*/createContext(initialState$1);
25565
+ const initialState = {};
25566
+ const store = /*#__PURE__*/createContext(initialState);
25598
25567
  const {
25599
- Provider: Provider$1
25600
- } = store$1;
25568
+ Provider
25569
+ } = store;
25601
25570
 
25602
25571
  const InvoiceDetailsContainer = ({
25603
25572
  style,
@@ -25618,21 +25587,21 @@ const InvoiceDetailsContainer = ({
25618
25587
  default:
25619
25588
  return state;
25620
25589
  }
25621
- }, initialState$1);
25590
+ }, initialState);
25622
25591
  return /*#__PURE__*/React__default.createElement("div", {
25623
25592
  style: { ...style
25624
25593
  },
25625
25594
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25626
- }, /*#__PURE__*/React__default.createElement(Provider$1, {
25595
+ }, /*#__PURE__*/React__default.createElement(Provider, {
25627
25596
  value: {
25628
25597
  state,
25629
25598
  dispatch
25630
25599
  }
25631
25600
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
25632
- store: store$1,
25601
+ store,
25633
25602
  key: i
25634
25603
  })) : /*#__PURE__*/React__default.cloneElement(children, {
25635
- store: store$1
25604
+ store
25636
25605
  })));
25637
25606
  };
25638
25607
 
@@ -25664,7 +25633,7 @@ const InvoiceDetailsPayButton = ({
25664
25633
  }) => {
25665
25634
  const {
25666
25635
  dispatch
25667
- } = useContext(store$1);
25636
+ } = useContext(store);
25668
25637
  const {
25669
25638
  t
25670
25639
  } = useTranslation("invoiceDetails");
@@ -25686,6 +25655,8 @@ const InvoiceDetailsView = props => {
25686
25655
  invoice
25687
25656
  } = usePelcro();
25688
25657
  const showPayButton = canPayInvoice(invoice);
25658
+ const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
25659
+ const hasPlanDetails = Boolean(invoice.plan);
25689
25660
  const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25690
25661
  const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25691
25662
  return /*#__PURE__*/React__default.createElement("div", {
@@ -25703,7 +25674,7 @@ const InvoiceDetailsView = props => {
25703
25674
  className: "plc-font-bold pelcro-invoice-summary-title"
25704
25675
  }, t("labels.summary")), invoice && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
25705
25676
  className: "plc-mr-2 pelcro-invoice-creation-date"
25706
- }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default.createElement("div", {
25677
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), hasPlanDetails && /*#__PURE__*/React__default.createElement("div", {
25707
25678
  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"
25708
25679
  }, /*#__PURE__*/React__default.createElement("div", {
25709
25680
  className: "plc-break-words pelcro-invoice-plan-name"
@@ -25729,7 +25700,7 @@ const InvoiceDetailsView = props => {
25729
25700
  className: "plc-font-semibold pelcro-invoice-total"
25730
25701
  }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default.createElement("div", {
25731
25702
  className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25732
- }, /*#__PURE__*/React__default.createElement(InvoiceDetailsDownloadButton, {
25703
+ }, showDownloadButton && /*#__PURE__*/React__default.createElement(InvoiceDetailsDownloadButton, {
25733
25704
  url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25734
25705
  className: "plc-w-full plc-text-center"
25735
25706
  }), showPayButton && /*#__PURE__*/React__default.createElement(InvoiceDetailsPayButton, {
@@ -25769,230 +25740,4 @@ const InvoiceDetailsModal = ({
25769
25740
  };
25770
25741
  InvoiceDetailsModal.viewId = "invoice-details";
25771
25742
 
25772
- const initialState = {
25773
- selectedOption: ""
25774
- };
25775
- const store = /*#__PURE__*/createContext(initialState);
25776
- const {
25777
- Provider
25778
- } = store;
25779
-
25780
- const SubscriptionOptionsContainer = ({
25781
- style,
25782
- className = "",
25783
- onRenewSubSuccess = () => {},
25784
- onNewSubSuccess = () => {},
25785
- children,
25786
- ...props
25787
- }) => {
25788
- const submit = ({
25789
- selectedOption
25790
- }, dispatch) => {
25791
- if (selectedOption === "renew") return onRenewSubSuccess();
25792
- if (selectedOption === "new") return onNewSubSuccess();
25793
- };
25794
-
25795
- const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25796
- switch (action.type) {
25797
- case SWITCH_TO_NEW:
25798
- return lib_7({ ...state,
25799
- selectedOption: "new"
25800
- });
25801
-
25802
- case SWITCH_TO_RENEW:
25803
- return lib_7({ ...state,
25804
- selectedOption: "renew"
25805
- });
25806
-
25807
- case HANDLE_SUBMIT:
25808
- return lib_4((state, dispatch) => submit(state));
25809
-
25810
- default:
25811
- return state;
25812
- }
25813
- }, initialState);
25814
- return /*#__PURE__*/React__default.createElement("div", {
25815
- style: { ...style
25816
- },
25817
- className: `pelcro-container pelcro-subscription-options-container ${className}`
25818
- }, /*#__PURE__*/React__default.createElement(Provider, {
25819
- value: {
25820
- state,
25821
- dispatch
25822
- }
25823
- }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
25824
- store,
25825
- key: i
25826
- })) : /*#__PURE__*/React__default.cloneElement(children, {
25827
- store
25828
- })));
25829
- };
25830
-
25831
- var _path;
25832
-
25833
- 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); }
25834
-
25835
- function SvgPlusCircle(props) {
25836
- return /*#__PURE__*/React.createElement("svg", _extends({
25837
- xmlns: "http://www.w3.org/2000/svg",
25838
- className: "plc-h-6 plc-w-6",
25839
- fill: "none",
25840
- viewBox: "0 0 24 24",
25841
- stroke: "currentColor",
25842
- strokeWidth: 2
25843
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
25844
- strokeLinecap: "round",
25845
- strokeLinejoin: "round",
25846
- d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25847
- })));
25848
- }
25849
-
25850
- const SubscriptionOptionsNewButton = ({
25851
- name,
25852
- onClick,
25853
- ...otherProps
25854
- }) => {
25855
- const {
25856
- dispatch,
25857
- state: {
25858
- selectedOption
25859
- }
25860
- } = useContext(store);
25861
- const {
25862
- t
25863
- } = useTranslation("subscriptionOptions");
25864
- const isChecked = selectedOption === "new";
25865
- return /*#__PURE__*/React__default.createElement(Radio, Object.assign({
25866
- className: "plc-hidden pelcro-new-sub-option",
25867
- 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"}`,
25868
- id: "pelcro-new-sub-option",
25869
- name: "option",
25870
- onChange: () => {
25871
- dispatch({
25872
- type: SWITCH_TO_NEW
25873
- });
25874
- onClick === null || onClick === void 0 ? void 0 : onClick();
25875
- },
25876
- checked: isChecked
25877
- }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default.createElement(SvgPlusCircle, {
25878
- className: "plc-w-full plc-h-full plc-mr-0"
25879
- }));
25880
- };
25881
-
25882
- const SubscriptionOptionsRenewButton = ({
25883
- name,
25884
- onClick,
25885
- ...otherProps
25886
- }) => {
25887
- const {
25888
- dispatch,
25889
- state: {
25890
- selectedOption
25891
- }
25892
- } = useContext(store);
25893
- const {
25894
- t
25895
- } = useTranslation("subscriptionOptions");
25896
- const isChecked = selectedOption === "renew";
25897
- return /*#__PURE__*/React__default.createElement(Radio, Object.assign({
25898
- className: "plc-hidden pelcro-renew-sub-option",
25899
- 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"}`,
25900
- id: "pelcro-renew-sub-option",
25901
- name: "option",
25902
- onChange: () => {
25903
- dispatch({
25904
- type: SWITCH_TO_RENEW
25905
- });
25906
- onClick === null || onClick === void 0 ? void 0 : onClick();
25907
- },
25908
- checked: isChecked
25909
- }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default.createElement(SvgRefresh, {
25910
- className: "plc-w-full plc-h-full plc-mr-0"
25911
- }));
25912
- };
25913
-
25914
- const SubscriptionOptionsSubmit = ({
25915
- name,
25916
- onClick,
25917
- ...otherProps
25918
- }) => {
25919
- const {
25920
- dispatch,
25921
- state: {
25922
- selectedOption
25923
- }
25924
- } = useContext(store);
25925
- const {
25926
- t
25927
- } = useTranslation("subscriptionOptions");
25928
- return /*#__PURE__*/React__default.createElement(Button, Object.assign({
25929
- onClick: () => {
25930
- dispatch({
25931
- type: HANDLE_SUBMIT
25932
- });
25933
- onClick === null || onClick === void 0 ? void 0 : onClick();
25934
- },
25935
- disabled: !selectedOption
25936
- }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25937
- };
25938
-
25939
- const SubscriptionOptionsView = props => {
25940
- const {
25941
- t
25942
- } = useTranslation("subscriptionOptions");
25943
- return /*#__PURE__*/React__default.createElement("div", {
25944
- id: "pelcro-subscription-options-view"
25945
- }, /*#__PURE__*/React__default.createElement("div", {
25946
- className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25947
- }, /*#__PURE__*/React__default.createElement("h4", {
25948
- className: "plc-text-2xl plc-font-semibold"
25949
- }, t("title")), /*#__PURE__*/React__default.createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default.createElement("form", {
25950
- action: "javascript:void(0);",
25951
- className: "plc-mt-2 pelcro-form"
25952
- }, /*#__PURE__*/React__default.createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default.createElement("div", {
25953
- className: "plc-flex plc-justify-between plc-items-center"
25954
- }, /*#__PURE__*/React__default.createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default.createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default.createElement(SubscriptionOptionsSubmit, {
25955
- role: "submit",
25956
- className: "plc-mt-4 plc-w-full",
25957
- name: t("next"),
25958
- id: "pelcro-submit"
25959
- }))));
25960
- };
25961
-
25962
- const SubscriptionOptionsModal = ({
25963
- onDisplay,
25964
- onClose,
25965
- ...otherProps
25966
- }) => {
25967
- const {
25968
- switchView,
25969
- setProductsList
25970
- } = usePelcro();
25971
-
25972
- const onRenewSubSuccess = () => {
25973
- var _otherProps$onRenewSu;
25974
-
25975
- (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
25976
- setProductsList(getRenewableProducts());
25977
- switchView("_plan-select-renew");
25978
- };
25979
-
25980
- const onNewSubSuccess = () => {
25981
- var _otherProps$onNewSubS;
25982
-
25983
- (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
25984
- switchView("plan-select");
25985
- };
25986
-
25987
- return /*#__PURE__*/React__default.createElement(Modal, {
25988
- onDisplay: onDisplay,
25989
- onClose: onClose,
25990
- id: "pelcro-subscription-options-modal"
25991
- }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
25992
- onNewSubSuccess: onNewSubSuccess,
25993
- onRenewSubSuccess: onRenewSubSuccess
25994
- }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
25995
- };
25996
- SubscriptionOptionsModal.viewId = "subscription-options";
25997
-
25998
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionOptionsContainer, SubscriptionOptionsModal, SubscriptionOptionsNewButton, SubscriptionOptionsRenewButton, SubscriptionOptionsSubmit, SubscriptionOptionsView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
25743
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };