@pelcro/react-pelcro-js 3.0.0-beta.9 → 3.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -3461,9 +3461,9 @@ var paymentMethod_fr = {
3461
3461
  select: select
3462
3462
  };
3463
3463
 
3464
- var title$f = "Enter your email to subscribe to our newsletter";
3464
+ var title$h = "Enter your email to subscribe to our newsletter";
3465
3465
  var updateTitle$1 = "Update newsletter selections";
3466
- var subtitle$7 = "We may use your email for other marketing communication";
3466
+ var subtitle$9 = "We may use your email for other marketing communication";
3467
3467
  var labels$p = {
3468
3468
  submit: "Submit",
3469
3469
  firstName: "First name",
@@ -3480,16 +3480,16 @@ var messages$r = {
3480
3480
  here: "here"
3481
3481
  };
3482
3482
  var newsletter_en = {
3483
- title: title$f,
3483
+ title: title$h,
3484
3484
  updateTitle: updateTitle$1,
3485
- subtitle: subtitle$7,
3485
+ subtitle: subtitle$9,
3486
3486
  labels: labels$p,
3487
3487
  messages: messages$r
3488
3488
  };
3489
3489
 
3490
- var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3490
+ var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3491
3491
  var updateTitle = "Mettre à jour son choix d'infolettres";
3492
- var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3492
+ var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3493
3493
  var labels$o = {
3494
3494
  submit: "Lire l’article !",
3495
3495
  firstName: "Prénom",
@@ -3506,9 +3506,9 @@ var messages$q = {
3506
3506
  here: "ici"
3507
3507
  };
3508
3508
  var newsletter_fr = {
3509
- title: title$e,
3509
+ title: title$g,
3510
3510
  updateTitle: updateTitle,
3511
- subtitle: subtitle$6,
3511
+ subtitle: subtitle$8,
3512
3512
  labels: labels$o,
3513
3513
  messages: messages$q
3514
3514
  };
@@ -3670,6 +3670,7 @@ var successfully$1 = "successfully";
3670
3670
  var entitlement$1 = "Some of the content on this page is available with one or more of our plans. <1>Subscribe</1> now to get full page access.";
3671
3671
  var recaptcha$1 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
3672
3672
  var invalidInvoice$1 = "Invalid invoice ID, please contact support";
3673
+ var zeroTotalInvoice$1 = "You can't view an invoice of 0$";
3673
3674
  var messages_en = {
3674
3675
  youAreSafe: youAreSafe$1,
3675
3676
  cancel: cancel$1,
@@ -3677,7 +3678,8 @@ var messages_en = {
3677
3678
  successfully: successfully$1,
3678
3679
  entitlement: entitlement$1,
3679
3680
  recaptcha: recaptcha$1,
3680
- invalidInvoice: invalidInvoice$1
3681
+ invalidInvoice: invalidInvoice$1,
3682
+ zeroTotalInvoice: zeroTotalInvoice$1
3681
3683
  };
3682
3684
 
3683
3685
  var youAreSafe = "Vous êtes en sécurité - PCI conforme 128 SSL par";
@@ -3687,6 +3689,7 @@ var successfully = "avec succès.";
3687
3689
  var entitlement = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1>Abonnez-vous</1> à l'un de nos plans disponibles pour accéder à plus de contenu";
3688
3690
  var recaptcha = "Ce site est protégé par reCAPTCHA - les <1>règles de confidentialité</1> Google ainsi que les <3>conditions d'utilisation</3> s'appliquent.";
3689
3691
  var invalidInvoice = "Invalid invoice ID, please contact support";
3692
+ var zeroTotalInvoice = "You can't view an invoice of 0$";
3690
3693
  var messages_fr = {
3691
3694
  youAreSafe: youAreSafe,
3692
3695
  cancel: cancel,
@@ -3694,7 +3697,8 @@ var messages_fr = {
3694
3697
  successfully: successfully,
3695
3698
  entitlement: entitlement,
3696
3699
  recaptcha: recaptcha,
3697
- invalidInvoice: invalidInvoice
3700
+ invalidInvoice: invalidInvoice,
3701
+ zeroTotalInvoice: zeroTotalInvoice
3698
3702
  };
3699
3703
 
3700
3704
  var labels$j = {
@@ -3761,8 +3765,8 @@ var login_fr = {
3761
3765
  errors: errors$4
3762
3766
  };
3763
3767
 
3764
- var title$d = "Create an account";
3765
- var subtitle$5 = "Enter your email and password below";
3768
+ var title$f = "Create an account";
3769
+ var subtitle$7 = "Enter your email and password below";
3766
3770
  var labels$h = {
3767
3771
  signUpFacebook: "Sign up with Facebook",
3768
3772
  signUpGoogle: "Sign up with Google",
@@ -3808,7 +3812,7 @@ var gift$1 = {
3808
3812
  lastName: "Last name",
3809
3813
  email: "Email",
3810
3814
  startDate: "Gift date",
3811
- giftMessage: "Gift message (200 characters max)",
3815
+ giftMessage: "Gift message ({{count}} characters remaining)",
3812
3816
  required: "required",
3813
3817
  firstNamePlaceholder: "First name",
3814
3818
  lastNamePlaceholder: "Last name",
@@ -3847,8 +3851,8 @@ var redeem$1 = {
3847
3851
  }
3848
3852
  };
3849
3853
  var register_en = {
3850
- title: title$d,
3851
- subtitle: subtitle$5,
3854
+ title: title$f,
3855
+ subtitle: subtitle$7,
3852
3856
  labels: labels$h,
3853
3857
  messages: messages$h,
3854
3858
  errors: errors$3,
@@ -3856,8 +3860,8 @@ var register_en = {
3856
3860
  redeem: redeem$1
3857
3861
  };
3858
3862
 
3859
- var title$c = "Créer un compte";
3860
- var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3863
+ var title$e = "Créer un compte";
3864
+ var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3861
3865
  var labels$g = {
3862
3866
  signUpFacebook: "Inscrivez-vous avec Facebook",
3863
3867
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3904,7 +3908,7 @@ var gift = {
3904
3908
  lastName: "Nom de famille",
3905
3909
  email: "Adresse courriel",
3906
3910
  startDate: "Date de début",
3907
- giftMessage: "Message du cadeau (200 caractères max)",
3911
+ giftMessage: "Message du cadeau ({{count}} caractères restants)",
3908
3912
  required: "Champs obligatoires",
3909
3913
  firstNamePlaceholder: "Prénom",
3910
3914
  lastNamePlaceholder: "Nom de famille",
@@ -3943,8 +3947,8 @@ var redeem = {
3943
3947
  }
3944
3948
  };
3945
3949
  var register_fr = {
3946
- title: title$c,
3947
- subtitle: subtitle$4,
3950
+ title: title$e,
3951
+ subtitle: subtitle$6,
3948
3952
  labels: labels$g,
3949
3953
  messages: messages$g,
3950
3954
  errors: errors$2,
@@ -4004,7 +4008,7 @@ var userEdit_fr = {
4004
4008
  messages: messages$e
4005
4009
  };
4006
4010
 
4007
- var title$b = "Enter your shipping address";
4011
+ var title$d = "Enter your shipping address";
4008
4012
  var selectAddressTitle$1 = "Please select an address";
4009
4013
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
4010
4014
  var labels$d = {
@@ -4027,7 +4031,7 @@ var messages$d = {
4027
4031
  subRedeemed: "Your subscription has been redeemed."
4028
4032
  };
4029
4033
  var address_en = {
4030
- title: title$b,
4034
+ title: title$d,
4031
4035
  selectAddressTitle: selectAddressTitle$1,
4032
4036
  selectAddressSubtitle: selectAddressSubtitle$1,
4033
4037
  labels: labels$d,
@@ -4035,7 +4039,7 @@ var address_en = {
4035
4039
  messages: messages$d
4036
4040
  };
4037
4041
 
4038
- var title$a = "Entrez votre adresse de livraison";
4042
+ var title$c = "Entrez votre adresse de livraison";
4039
4043
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4040
4044
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4041
4045
  var labels$c = {
@@ -4058,7 +4062,7 @@ var messages$c = {
4058
4062
  subRedeemed: "Votre abonnement a bien été activé."
4059
4063
  };
4060
4064
  var address_fr = {
4061
- title: title$a,
4065
+ title: title$c,
4062
4066
  selectAddressTitle: selectAddressTitle,
4063
4067
  selectAddressSubtitle: selectAddressSubtitle,
4064
4068
  labels: labels$c,
@@ -4066,8 +4070,8 @@ var address_fr = {
4066
4070
  messages: messages$c
4067
4071
  };
4068
4072
 
4069
- var title$9 = "Reset your password";
4070
- var subtitle$3 = "Enter a new password below";
4073
+ var title$b = "Reset your password";
4074
+ var subtitle$5 = "Enter a new password below";
4071
4075
  var email$3 = "Email";
4072
4076
  var password$3 = "Password";
4073
4077
  var confirmPassword$1 = "Confirm password";
@@ -4075,8 +4079,8 @@ var submit$5 = "Submit";
4075
4079
  var required$5 = "Required";
4076
4080
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4077
4081
  var passwordReset_en = {
4078
- title: title$9,
4079
- subtitle: subtitle$3,
4082
+ title: title$b,
4083
+ subtitle: subtitle$5,
4080
4084
  email: email$3,
4081
4085
  password: password$3,
4082
4086
  confirmPassword: confirmPassword$1,
@@ -4085,8 +4089,8 @@ var passwordReset_en = {
4085
4089
  passwordUpdated: passwordUpdated$1
4086
4090
  };
4087
4091
 
4088
- var title$8 = "Réinitialiser votre mot de passe";
4089
- var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4092
+ var title$a = "Réinitialiser votre mot de passe";
4093
+ var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4090
4094
  var email$2 = "Adresse courriel";
4091
4095
  var password$2 = "Mot de passe";
4092
4096
  var confirmPassword = "Confirmer le mot de passe";
@@ -4094,8 +4098,8 @@ var submit$4 = "Soumettre";
4094
4098
  var required$4 = "Champs obligatoires";
4095
4099
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4096
4100
  var passwordReset_fr = {
4097
- title: title$8,
4098
- subtitle: subtitle$2,
4101
+ title: title$a,
4102
+ subtitle: subtitle$4,
4099
4103
  email: email$2,
4100
4104
  password: password$2,
4101
4105
  confirmPassword: confirmPassword,
@@ -4104,7 +4108,7 @@ var passwordReset_fr = {
4104
4108
  passwordUpdated: passwordUpdated
4105
4109
  };
4106
4110
 
4107
- var title$7 = "Forgot your password?";
4111
+ var title$9 = "Forgot your password?";
4108
4112
  var email$1 = "Email";
4109
4113
  var password$1 = "Password";
4110
4114
  var submit$3 = "Submit";
@@ -4115,7 +4119,7 @@ var messages$b = {
4115
4119
  loginHere: "login here."
4116
4120
  };
4117
4121
  var passwordForgot_en = {
4118
- title: title$7,
4122
+ title: title$9,
4119
4123
  email: email$1,
4120
4124
  password: password$1,
4121
4125
  submit: submit$3,
@@ -4124,7 +4128,7 @@ var passwordForgot_en = {
4124
4128
  messages: messages$b
4125
4129
  };
4126
4130
 
4127
- var title$6 = "Mot de passe oublié ?";
4131
+ var title$8 = "Mot de passe oublié ?";
4128
4132
  var email = "Courriel";
4129
4133
  var password = "Mot de passe";
4130
4134
  var submit$2 = "Soumettre";
@@ -4135,7 +4139,7 @@ var messages$a = {
4135
4139
  loginHere: "Connectez-vous ici"
4136
4140
  };
4137
4141
  var passwordForgot_fr = {
4138
- title: title$6,
4142
+ title: title$8,
4139
4143
  email: email,
4140
4144
  password: password,
4141
4145
  submit: submit$2,
@@ -4144,7 +4148,7 @@ var passwordForgot_fr = {
4144
4148
  messages: messages$a
4145
4149
  };
4146
4150
 
4147
- var title$5 = "Change your password";
4151
+ var title$7 = "Change your password";
4148
4152
  var currentPassword$1 = "Current password";
4149
4153
  var newPassword$1 = "New password";
4150
4154
  var confirmNewPassword$1 = "Confirm new password";
@@ -4154,7 +4158,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4154
4158
  var passwordsNotMatching$1 = "Passwords don't match";
4155
4159
  var weakPassword$1 = "Your password must contain at least 6 characters";
4156
4160
  var passwordChange_en = {
4157
- title: title$5,
4161
+ title: title$7,
4158
4162
  currentPassword: currentPassword$1,
4159
4163
  newPassword: newPassword$1,
4160
4164
  confirmNewPassword: confirmNewPassword$1,
@@ -4165,7 +4169,7 @@ var passwordChange_en = {
4165
4169
  weakPassword: weakPassword$1
4166
4170
  };
4167
4171
 
4168
- var title$4 = "Changez votre mot de passe";
4172
+ var title$6 = "Changez votre mot de passe";
4169
4173
  var currentPassword = "Mot de passe actuel";
4170
4174
  var newPassword = "Nouveau mot de passe";
4171
4175
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4175,7 +4179,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4175
4179
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4176
4180
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4177
4181
  var passwordChange_fr = {
4178
- title: title$4,
4182
+ title: title$6,
4179
4183
  currentPassword: currentPassword,
4180
4184
  newPassword: newPassword,
4181
4185
  confirmNewPassword: confirmNewPassword,
@@ -4186,8 +4190,8 @@ var passwordChange_fr = {
4186
4190
  weakPassword: weakPassword
4187
4191
  };
4188
4192
 
4189
- var title$3 = "Votre panier";
4190
- var subtitle$1 = "Terminez votre achat ci-dessous";
4193
+ var title$5 = "Votre panier";
4194
+ var subtitle$3 = "Terminez votre achat ci-dessous";
4191
4195
  var name$1 = "Produit";
4192
4196
  var quantity$1 = "Quantité";
4193
4197
  var price$1 = "Prix";
@@ -4198,8 +4202,8 @@ var confirm$3 = "Passer à la caisse";
4198
4202
  var empty$1 = "Votre panier est vide.";
4199
4203
  var removeAll$1 = "Vider";
4200
4204
  var cart_fr = {
4201
- title: title$3,
4202
- subtitle: subtitle$1,
4205
+ title: title$5,
4206
+ subtitle: subtitle$3,
4203
4207
  name: name$1,
4204
4208
  quantity: quantity$1,
4205
4209
  price: price$1,
@@ -4211,8 +4215,8 @@ var cart_fr = {
4211
4215
  removeAll: removeAll$1
4212
4216
  };
4213
4217
 
4214
- var title$2 = "Your shopping cart";
4215
- var subtitle = "Comple your purchase below";
4218
+ var title$4 = "Your shopping cart";
4219
+ var subtitle$2 = "Comple your purchase below";
4216
4220
  var name = "Name";
4217
4221
  var quantity = "Quantity";
4218
4222
  var price = "Price";
@@ -4223,8 +4227,8 @@ var confirm$2 = "Checkout";
4223
4227
  var empty = "Your cart is empty.";
4224
4228
  var removeAll = "Remove all";
4225
4229
  var cart_en = {
4226
- title: title$2,
4227
- subtitle: subtitle,
4230
+ title: title$4,
4231
+ subtitle: subtitle$2,
4228
4232
  name: name,
4229
4233
  quantity: quantity,
4230
4234
  price: price,
@@ -4662,7 +4666,7 @@ var verifyEmail_fr = {
4662
4666
  messages: messages
4663
4667
  };
4664
4668
 
4665
- var title$1 = "Invoice details";
4669
+ var title$3 = "Invoice details";
4666
4670
  var labels$1 = {
4667
4671
  summary: "Summary",
4668
4672
  total: "Total",
@@ -4675,12 +4679,12 @@ var buttons$1 = {
4675
4679
  pay: "Pay now"
4676
4680
  };
4677
4681
  var invoiceDetails_en = {
4678
- title: title$1,
4682
+ title: title$3,
4679
4683
  labels: labels$1,
4680
4684
  buttons: buttons$1
4681
4685
  };
4682
4686
 
4683
- var title = "Invoice details";
4687
+ var title$2 = "Invoice details";
4684
4688
  var labels = {
4685
4689
  summary: "Summary",
4686
4690
  total: "Total",
@@ -4693,11 +4697,37 @@ var buttons = {
4693
4697
  pay: "Pay now"
4694
4698
  };
4695
4699
  var invoiceDetails_fr = {
4696
- title: title,
4700
+ title: title$2,
4697
4701
  labels: labels,
4698
4702
  buttons: buttons
4699
4703
  };
4700
4704
 
4705
+ var title$1 = "Renewal options";
4706
+ var subtitle$1 = "Select one of the options below to continue";
4707
+ var next$1 = "Next";
4708
+ var addNew$1 = "Add Another Subscription";
4709
+ var renew$1 = "Renew Existing Subscription";
4710
+ var subscriptionOptions_en = {
4711
+ title: title$1,
4712
+ subtitle: subtitle$1,
4713
+ next: next$1,
4714
+ addNew: addNew$1,
4715
+ renew: renew$1
4716
+ };
4717
+
4718
+ var title = "Renewal options";
4719
+ var subtitle = "Select one of the options below to continue";
4720
+ var next = "Next";
4721
+ var addNew = "Add Another Subscription";
4722
+ var renew = "Renew Existing Subscription";
4723
+ var subscriptionOptions_fr = {
4724
+ title: title,
4725
+ subtitle: subtitle,
4726
+ next: next,
4727
+ addNew: addNew,
4728
+ renew: renew
4729
+ };
4730
+
4701
4731
  function create$1(createState) {
4702
4732
  let state;
4703
4733
  const listeners = new Set();
@@ -6047,7 +6077,7 @@ class PelcroActions {
6047
6077
  view,
6048
6078
  cartItems,
6049
6079
  ...otherStateFields
6050
- } = initialState$i;
6080
+ } = initialState$j;
6051
6081
  this.set(otherStateFields);
6052
6082
  });
6053
6083
 
@@ -6071,6 +6101,16 @@ class PelcroActions {
6071
6101
  });
6072
6102
  }
6073
6103
 
6104
+ if (view === "subscription-options") {
6105
+ const noRenewableProducts = getRenewableProducts().length === 0;
6106
+
6107
+ if (noRenewableProducts) {
6108
+ return this.set({
6109
+ view: "plan-select"
6110
+ });
6111
+ }
6112
+ }
6113
+
6074
6114
  this.set({
6075
6115
  view
6076
6116
  });
@@ -6145,6 +6185,26 @@ class PelcroActions {
6145
6185
  }
6146
6186
  });
6147
6187
 
6188
+ _defineProperty$3(this, "setProductsList", products => {
6189
+ if (!Array.isArray(products)) {
6190
+ return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6191
+ }
6192
+
6193
+ const allowedProducts = window.Pelcro.product.list();
6194
+ const validProducts = products.filter(product => {
6195
+ const isValidProduct = allowedProducts.some(allowedProduct => allowedProduct.id === (product === null || product === void 0 ? void 0 : product.id) && allowedProduct.name === (product === null || product === void 0 ? void 0 : product.name));
6196
+
6197
+ if (!isValidProduct) {
6198
+ console.warn(`setProductsList expects an array of products that exist in the list of valid products (window.Pelcro.product.list()), but it recieved a product which doesn't exist in that list:`, product);
6199
+ }
6200
+
6201
+ return isValidProduct;
6202
+ });
6203
+ this.set({
6204
+ productsList: validProducts
6205
+ });
6206
+ });
6207
+
6148
6208
  _defineProperty$3(this, "setProduct", id => {
6149
6209
  const product = window.Pelcro.product.getById(id);
6150
6210
  if (!product) return console.error("invalid product id");
@@ -6366,10 +6426,12 @@ class PelcroCallbacks {
6366
6426
 
6367
6427
  }
6368
6428
 
6369
- const initialState$i = {
6429
+ var _window$Pelcro$produc, _window$Pelcro;
6430
+ const initialState$j = {
6370
6431
  // View
6371
6432
  view: null,
6372
6433
  // Plans
6434
+ productsList: (_window$Pelcro$produc = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : _window$Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [],
6373
6435
  product: null,
6374
6436
  plan: null,
6375
6437
  isGift: false,
@@ -6396,7 +6458,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6396
6458
  return {
6397
6459
  // Store setter
6398
6460
  set,
6399
- ...initialState$i,
6461
+ ...initialState$j,
6400
6462
  // State actions
6401
6463
  ...actions,
6402
6464
  // Callbacks
@@ -6751,6 +6813,28 @@ function userMustVerifyEmail() {
6751
6813
  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;
6752
6814
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6753
6815
  }
6816
+ function getRenewableProducts() {
6817
+ const renewableSubs = window.Pelcro.subscription.list().filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1);
6818
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6819
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6820
+ const {
6821
+ productsList
6822
+ } = usePelcro.getStore();
6823
+ return productsList.map(product => {
6824
+ if (renewableProductsIds.includes(product.id)) {
6825
+ const renewablePlans = getRenewablePlansOnly(product);
6826
+ return { ...product,
6827
+ plans: renewablePlans
6828
+ };
6829
+ }
6830
+ }).filter(product => product);
6831
+
6832
+ function getRenewablePlansOnly(product) {
6833
+ var _product$plans$filter, _product$plans;
6834
+
6835
+ 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 : [];
6836
+ }
6837
+ }
6754
6838
 
6755
6839
  const resources = {
6756
6840
  en: {
@@ -6775,7 +6859,8 @@ const resources = {
6775
6859
  dashboard: dashboard_en,
6776
6860
  select: select_en,
6777
6861
  notification: notification_en,
6778
- invoiceDetails: invoiceDetails_en
6862
+ invoiceDetails: invoiceDetails_en,
6863
+ subscriptionOptions: subscriptionOptions_en
6779
6864
  },
6780
6865
  fr: {
6781
6866
  common: common_fr,
@@ -6799,7 +6884,8 @@ const resources = {
6799
6884
  dashboard: dashboard_fr,
6800
6885
  select: select_fr,
6801
6886
  notification: notification_fr,
6802
- invoiceDetails: invoiceDetails_fr
6887
+ invoiceDetails: invoiceDetails_fr,
6888
+ subscriptionOptions: subscriptionOptions_fr
6803
6889
  }
6804
6890
  }; // set UI language to the page language or default to the language in site settings
6805
6891
 
@@ -7090,8 +7176,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7090
7176
 
7091
7177
  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}}
7092
7178
 
7093
- function _extends$z() {
7094
- _extends$z = Object.assign || function (target) {
7179
+ function _extends$A() {
7180
+ _extends$A = Object.assign || function (target) {
7095
7181
  for (var i = 1; i < arguments.length; i++) {
7096
7182
  var source = arguments[i];
7097
7183
 
@@ -7105,7 +7191,7 @@ function _extends$z() {
7105
7191
  return target;
7106
7192
  };
7107
7193
 
7108
- return _extends$z.apply(this, arguments);
7194
+ return _extends$A.apply(this, arguments);
7109
7195
  }
7110
7196
 
7111
7197
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7195,7 +7281,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7195
7281
  var reducer = function reducer(state, action) {
7196
7282
  switch (action.type) {
7197
7283
  case ActionType.ADD_TOAST:
7198
- return _extends$z({}, state, {
7284
+ return _extends$A({}, state, {
7199
7285
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7200
7286
  });
7201
7287
 
@@ -7205,9 +7291,9 @@ var reducer = function reducer(state, action) {
7205
7291
  clearFromRemoveQueue(action.toast.id);
7206
7292
  }
7207
7293
 
7208
- return _extends$z({}, state, {
7294
+ return _extends$A({}, state, {
7209
7295
  toasts: state.toasts.map(function (t) {
7210
- return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7296
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7211
7297
  })
7212
7298
  });
7213
7299
 
@@ -7234,9 +7320,9 @@ var reducer = function reducer(state, action) {
7234
7320
  });
7235
7321
  }
7236
7322
 
7237
- return _extends$z({}, state, {
7323
+ return _extends$A({}, state, {
7238
7324
  toasts: state.toasts.map(function (t) {
7239
- return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7325
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7240
7326
  visible: false
7241
7327
  }) : t;
7242
7328
  })
@@ -7244,28 +7330,28 @@ var reducer = function reducer(state, action) {
7244
7330
 
7245
7331
  case ActionType.REMOVE_TOAST:
7246
7332
  if (action.toastId === undefined) {
7247
- return _extends$z({}, state, {
7333
+ return _extends$A({}, state, {
7248
7334
  toasts: []
7249
7335
  });
7250
7336
  }
7251
7337
 
7252
- return _extends$z({}, state, {
7338
+ return _extends$A({}, state, {
7253
7339
  toasts: state.toasts.filter(function (t) {
7254
7340
  return t.id !== action.toastId;
7255
7341
  })
7256
7342
  });
7257
7343
 
7258
7344
  case ActionType.START_PAUSE:
7259
- return _extends$z({}, state, {
7345
+ return _extends$A({}, state, {
7260
7346
  pausedAt: action.time
7261
7347
  });
7262
7348
 
7263
7349
  case ActionType.END_PAUSE:
7264
7350
  var diff = action.time - (state.pausedAt || 0);
7265
- return _extends$z({}, state, {
7351
+ return _extends$A({}, state, {
7266
7352
  pausedAt: undefined,
7267
7353
  toasts: state.toasts.map(function (t) {
7268
- return _extends$z({}, t, {
7354
+ return _extends$A({}, t, {
7269
7355
  pauseDuration: t.pauseDuration + diff
7270
7356
  });
7271
7357
  })
@@ -7312,12 +7398,12 @@ var useStore = function useStore(toastOptions) {
7312
7398
  var mergedToasts = state.toasts.map(function (t) {
7313
7399
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7314
7400
 
7315
- return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7401
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7316
7402
  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],
7317
- style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7403
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7318
7404
  });
7319
7405
  });
7320
- return _extends$z({}, state, {
7406
+ return _extends$A({}, state, {
7321
7407
  toasts: mergedToasts
7322
7408
  });
7323
7409
  };
@@ -7327,7 +7413,7 @@ var createToast = function createToast(message, type, opts) {
7327
7413
  type = 'blank';
7328
7414
  }
7329
7415
 
7330
- return _extends$z({
7416
+ return _extends$A({
7331
7417
  createdAt: Date.now(),
7332
7418
  visible: true,
7333
7419
  type: type,
@@ -7377,14 +7463,14 @@ toast.remove = function (toastId) {
7377
7463
  };
7378
7464
 
7379
7465
  toast.promise = function (promise, msgs, opts) {
7380
- var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7466
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7381
7467
  promise.then(function (p) {
7382
- toast.success(resolveValue(msgs.success, p), _extends$z({
7468
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7383
7469
  id: id
7384
7470
  }, opts, opts == null ? void 0 : opts.success));
7385
7471
  return p;
7386
7472
  })["catch"](function (e) {
7387
- toast.error(resolveValue(msgs.error, e), _extends$z({
7473
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7388
7474
  id: id
7389
7475
  }, opts, opts == null ? void 0 : opts.error));
7390
7476
  });
@@ -7723,7 +7809,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7723
7809
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7724
7810
  return React.createElement(ToastBarBase, {
7725
7811
  className: toast.className,
7726
- style: _extends$z({}, animationStyle, style, toast.style)
7812
+ style: _extends$A({}, animationStyle, style, toast.style)
7727
7813
  }, typeof children === 'function' ? children({
7728
7814
  icon: icon,
7729
7815
  message: message
@@ -7753,7 +7839,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7753
7839
  } : position.includes('right') ? {
7754
7840
  justifyContent: 'flex-end'
7755
7841
  } : {};
7756
- return _extends$z({
7842
+ return _extends$A({
7757
7843
  left: 0,
7758
7844
  right: 0,
7759
7845
  display: 'flex',
@@ -7780,7 +7866,7 @@ var Toaster = function Toaster(_ref) {
7780
7866
  handlers = _useToaster.handlers;
7781
7867
 
7782
7868
  return React.createElement("div", {
7783
- style: _extends$z({
7869
+ style: _extends$A({
7784
7870
  position: 'fixed',
7785
7871
  zIndex: 9999,
7786
7872
  top: DEFAULT_OFFSET,
@@ -7815,82 +7901,82 @@ var Toaster = function Toaster(_ref) {
7815
7901
  }));
7816
7902
  };
7817
7903
 
7818
- var _path$w;
7904
+ var _path$x;
7819
7905
 
7820
- 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); }
7906
+ 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); }
7821
7907
 
7822
7908
  function SvgCheckSolid(props) {
7823
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7909
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
7824
7910
  xmlns: "http://www.w3.org/2000/svg",
7825
7911
  className: "h-5 w-5",
7826
7912
  viewBox: "0 0 20 20",
7827
7913
  fill: "currentColor"
7828
- }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7914
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
7829
7915
  fillRule: "evenodd",
7830
7916
  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",
7831
7917
  clipRule: "evenodd"
7832
7918
  })));
7833
7919
  }
7834
7920
 
7835
- var _path$v;
7921
+ var _path$w;
7836
7922
 
7837
- 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); }
7923
+ 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); }
7838
7924
 
7839
7925
  function SvgXIcon(props) {
7840
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7926
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7841
7927
  xmlns: "http://www.w3.org/2000/svg",
7842
7928
  viewBox: "0 0 20 20",
7843
7929
  fill: "currentColor"
7844
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7930
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7845
7931
  fill: "evenodd",
7846
7932
  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",
7847
7933
  clipRule: "evenodd"
7848
7934
  })));
7849
7935
  }
7850
7936
 
7851
- var _path$u;
7937
+ var _path$v;
7852
7938
 
7853
- 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); }
7939
+ 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); }
7854
7940
 
7855
7941
  function SvgXIconSolid(props) {
7856
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7942
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7857
7943
  className: "plc-w-4 plc-h-4",
7858
7944
  fill: "currentColor",
7859
7945
  xmlns: "http://www.w3.org/2000/svg",
7860
7946
  viewBox: "0 0 100 100"
7861
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7947
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7862
7948
  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"
7863
7949
  })));
7864
7950
  }
7865
7951
 
7866
- var _path$t;
7952
+ var _path$u;
7867
7953
 
7868
- 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); }
7954
+ 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); }
7869
7955
 
7870
7956
  function SvgExclamation(props) {
7871
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7957
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7872
7958
  className: "plc-w-4 plc-h-4 plc-mr-1",
7873
7959
  xmlns: "http://www.w3.org/2000/svg",
7874
7960
  viewBox: "0 0 20 20",
7875
7961
  fill: "currentColor"
7876
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7962
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7877
7963
  fillRule: "evenodd",
7878
7964
  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",
7879
7965
  clipRule: "evenodd"
7880
7966
  })));
7881
7967
  }
7882
7968
 
7883
- var _path$s, _path2$4;
7969
+ var _path$t, _path2$4;
7884
7970
 
7885
- 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); }
7971
+ 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); }
7886
7972
 
7887
7973
  function SvgSpinner(props) {
7888
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7974
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7889
7975
  className: "plc-animate-spin",
7890
7976
  viewBox: "0 0 24 24",
7891
7977
  fill: "currentColor",
7892
7978
  xmlns: "http://www.w3.org/2000/svg"
7893
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7979
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7894
7980
  opacity: 0.2,
7895
7981
  fill: "evenodd",
7896
7982
  clipRule: "evenodd",
@@ -8180,7 +8266,9 @@ const init$1 = () => {
8180
8266
  return switchToAddressView();
8181
8267
  });
8182
8268
  } else {
8183
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8269
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8270
+ return switchView("subscription-options");
8271
+ });
8184
8272
  }
8185
8273
  }
8186
8274
  }
@@ -8342,7 +8430,8 @@ function Link({
8342
8430
  const init = () => {
8343
8431
  const {
8344
8432
  switchView,
8345
- set
8433
+ set,
8434
+ setProductsList
8346
8435
  } = usePelcro.getStore();
8347
8436
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8348
8437
 
@@ -8393,7 +8482,8 @@ const init = () => {
8393
8482
  }
8394
8483
 
8395
8484
  notify.dismiss(NOTIFICATION_ID);
8396
- switchView("_plan-select-entitlements");
8485
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8486
+ switchView("plan-select");
8397
8487
  }
8398
8488
  }, "Subscribe"), "now to get full page access.")), {
8399
8489
  className: "pelcro-notification-entitlement",
@@ -9126,6 +9216,17 @@ const showInvoiceDetailsFromUrl = () => {
9126
9216
  return notify.error(errorMessage);
9127
9217
  }
9128
9218
 
9219
+ const {
9220
+ invoice
9221
+ } = usePelcro.getStore();
9222
+
9223
+ if (invoice.total === 0) {
9224
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9225
+ returnObjects: true
9226
+ });
9227
+ return notify.error(errorMessage);
9228
+ }
9229
+
9129
9230
  return switchView("invoice-details");
9130
9231
  });
9131
9232
  };
@@ -9187,7 +9288,7 @@ const PelcroModalController = ({
9187
9288
  type
9188
9289
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9189
9290
  type
9190
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9291
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9191
9292
  type
9192
9293
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9193
9294
  type
@@ -9468,8 +9569,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9468
9569
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9469
9570
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9470
9571
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9572
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9573
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9471
9574
 
9472
- const initialState$h = {
9575
+ const initialState$i = {
9473
9576
  email: "",
9474
9577
  password: "",
9475
9578
  emailError: null,
@@ -9480,10 +9583,10 @@ const initialState$h = {
9480
9583
  content: ""
9481
9584
  }
9482
9585
  };
9483
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
9586
+ const store$i = /*#__PURE__*/React.createContext(initialState$i);
9484
9587
  const {
9485
- Provider: Provider$h
9486
- } = store$h;
9588
+ Provider: Provider$i
9589
+ } = store$i;
9487
9590
 
9488
9591
  const LoginContainer = ({
9489
9592
  style,
@@ -9590,7 +9693,7 @@ const LoginContainer = ({
9590
9693
  });
9591
9694
 
9592
9695
  case RESET_LOGIN_FORM:
9593
- return initialState$h;
9696
+ return initialState$i;
9594
9697
 
9595
9698
  case DISABLE_LOGIN_BUTTON:
9596
9699
  return lib_7({ ...state,
@@ -9608,12 +9711,12 @@ const LoginContainer = ({
9608
9711
  default:
9609
9712
  return state;
9610
9713
  }
9611
- }, initialState$h);
9714
+ }, initialState$i);
9612
9715
  return /*#__PURE__*/React__default['default'].createElement("div", {
9613
9716
  style: { ...style
9614
9717
  },
9615
9718
  className: `pelcro-container pelcro-login-container ${className}`
9616
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9719
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9617
9720
  value: {
9618
9721
  state,
9619
9722
  dispatch
@@ -9621,12 +9724,12 @@ const LoginContainer = ({
9621
9724
  }, children.length ? children.map((child, i) => {
9622
9725
  if (child) {
9623
9726
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9624
- store: store$h,
9727
+ store: store$i,
9625
9728
  key: i
9626
9729
  });
9627
9730
  }
9628
9731
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9629
- store: store$h
9732
+ store: store$i
9630
9733
  })));
9631
9734
  };
9632
9735
 
@@ -9871,7 +9974,7 @@ const LoginButton = ({
9871
9974
  buttonDisabled
9872
9975
  },
9873
9976
  dispatch
9874
- } = React.useContext(store$h);
9977
+ } = React.useContext(store$i);
9875
9978
  const {
9876
9979
  t
9877
9980
  } = useTranslation("login");
@@ -9892,23 +9995,23 @@ const LoginButton = ({
9892
9995
  };
9893
9996
 
9894
9997
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9895
- store: store$h
9998
+ store: store$i
9896
9999
  }, props));
9897
10000
 
9898
10001
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9899
- store: store$h
10002
+ store: store$i
9900
10003
  }, props));
9901
10004
 
9902
- var _path$r;
10005
+ var _path$s;
9903
10006
 
9904
- 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); }
10007
+ 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); }
9905
10008
 
9906
10009
  function SvgCheck(props) {
9907
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10010
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9908
10011
  xmlns: "http://www.w3.org/2000/svg",
9909
10012
  fill: "currentColor",
9910
10013
  viewBox: "0 0 20 20"
9911
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10014
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9912
10015
  fillRule: "evenodd",
9913
10016
  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",
9914
10017
  clipRule: "evenodd"
@@ -9973,7 +10076,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9973
10076
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9974
10077
  facebookLoginRenderProps.FacebookLogin;
9975
10078
 
9976
- const initialState$g = {
10079
+ const initialState$h = {
9977
10080
  email: "",
9978
10081
  password: "",
9979
10082
  emailError: null,
@@ -9990,10 +10093,10 @@ const initialState$g = {
9990
10093
  content: ""
9991
10094
  }
9992
10095
  };
9993
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
10096
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9994
10097
  const {
9995
- Provider: Provider$g
9996
- } = store$g;
10098
+ Provider: Provider$h
10099
+ } = store$h;
9997
10100
 
9998
10101
  const RegisterContainer = ({
9999
10102
  style,
@@ -10176,7 +10279,7 @@ const RegisterContainer = ({
10176
10279
  });
10177
10280
 
10178
10281
  case RESET_LOGIN_FORM:
10179
- return initialState$g;
10282
+ return initialState$h;
10180
10283
 
10181
10284
  case DISABLE_REGISTRATION_BUTTON:
10182
10285
  return lib_7({ ...state,
@@ -10194,12 +10297,12 @@ const RegisterContainer = ({
10194
10297
  default:
10195
10298
  return state;
10196
10299
  }
10197
- }, initialState$g);
10300
+ }, initialState$h);
10198
10301
  return /*#__PURE__*/React__default['default'].createElement("div", {
10199
10302
  style: { ...style
10200
10303
  },
10201
10304
  className: `pelcro-container pelcro-register-container ${className}`
10202
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10305
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10203
10306
  value: {
10204
10307
  state,
10205
10308
  dispatch
@@ -10207,12 +10310,12 @@ const RegisterContainer = ({
10207
10310
  }, children.length ? children.map((child, i) => {
10208
10311
  if (child) {
10209
10312
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10210
- store: store$g,
10313
+ store: store$h,
10211
10314
  key: i
10212
10315
  });
10213
10316
  }
10214
10317
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10215
- store: store$g
10318
+ store: store$h
10216
10319
  })));
10217
10320
  };
10218
10321
  /**
@@ -10227,15 +10330,15 @@ function hasSecurityTokenEnabled$1() {
10227
10330
  return hasSecuritySdkLoaded;
10228
10331
  }
10229
10332
 
10230
- var _path$q;
10333
+ var _path$r;
10231
10334
 
10232
- 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); }
10335
+ 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); }
10233
10336
 
10234
10337
  function SvgFacebookLogo(props) {
10235
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10338
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10236
10339
  xmlns: "http://www.w3.org/2000/svg",
10237
10340
  viewBox: "88.428 12.828 107.543 207.085"
10238
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10341
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10239
10342
  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",
10240
10343
  fill: "#3c5a9a"
10241
10344
  })));
@@ -10252,10 +10355,10 @@ const FacebookLoginButton = ({
10252
10355
  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;
10253
10356
  const {
10254
10357
  dispatch: loginDispatch
10255
- } = React.useContext(store$h);
10358
+ } = React.useContext(store$i);
10256
10359
  const {
10257
10360
  dispatch: registerDispatch
10258
- } = React.useContext(store$g);
10361
+ } = React.useContext(store$h);
10259
10362
 
10260
10363
  const onSuccess = facebookUser => {
10261
10364
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10308,15 +10411,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10308
10411
  unwrapExports(googleLogin);
10309
10412
  var googleLogin_1 = googleLogin.GoogleLogin;
10310
10413
 
10311
- var _path$p, _path2$3, _path3$1, _path4;
10414
+ var _path$q, _path2$3, _path3$1, _path4;
10312
10415
 
10313
- 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); }
10416
+ 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); }
10314
10417
 
10315
10418
  function SvgGoogleLogo(props) {
10316
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10419
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10317
10420
  viewBox: "0 0 24 24",
10318
10421
  xmlns: "http://www.w3.org/2000/svg"
10319
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10422
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10320
10423
  fill: "#4285F4",
10321
10424
  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"
10322
10425
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10342,10 +10445,10 @@ const GoogleLoginButton = ({
10342
10445
  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;
10343
10446
  const {
10344
10447
  dispatch: loginDispatch
10345
- } = React.useContext(store$h);
10448
+ } = React.useContext(store$i);
10346
10449
  const {
10347
10450
  dispatch: registerDispatch
10348
- } = React.useContext(store$g);
10451
+ } = React.useContext(store$h);
10349
10452
 
10350
10453
  const onSuccess = response => {
10351
10454
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10393,15 +10496,15 @@ const GoogleLoginButton = ({
10393
10496
  }) : null;
10394
10497
  };
10395
10498
 
10396
- var _path$o;
10499
+ var _path$p;
10397
10500
 
10398
- 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); }
10501
+ 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); }
10399
10502
 
10400
10503
  function SvgAuth0Logo(props) {
10401
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10504
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10402
10505
  viewBox: "0 0 256 285",
10403
10506
  xmlns: "http://www.w3.org/2000/svg"
10404
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10507
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10405
10508
  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"
10406
10509
  })));
10407
10510
  }
@@ -10441,10 +10544,10 @@ const Auth0LoginButton = ({
10441
10544
  }, [auth0Enabled, auth0Loaded]);
10442
10545
  const {
10443
10546
  dispatch: loginDispatch
10444
- } = React.useContext(store$h);
10547
+ } = React.useContext(store$i);
10445
10548
  const {
10446
10549
  dispatch: registerDispatch
10447
- } = React.useContext(store$g);
10550
+ } = React.useContext(store$h);
10448
10551
 
10449
10552
  function handleClick() {
10450
10553
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10577,15 +10680,15 @@ function LoginView(props) {
10577
10680
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10578
10681
  }
10579
10682
 
10580
- var _path$n, _path2$2, _path3;
10683
+ var _path$o, _path2$2, _path3;
10581
10684
 
10582
- 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); }
10685
+ 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); }
10583
10686
 
10584
10687
  function SvgPelcroAuthorship(props) {
10585
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10688
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10586
10689
  xmlns: "http://www.w3.org/2000/svg",
10587
10690
  viewBox: "0 -80.652 497.072 179.991"
10588
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10691
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10589
10692
  fill: "none",
10590
10693
  stroke: "#4a4a4a",
10591
10694
  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"
@@ -10732,11 +10835,11 @@ function LoginModal({
10732
10835
  LoginModal.viewId = "login";
10733
10836
 
10734
10837
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10735
- store: store$g
10838
+ store: store$h
10736
10839
  }, props));
10737
10840
 
10738
10841
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10739
- store: store$g
10842
+ store: store$h
10740
10843
  }, props));
10741
10844
 
10742
10845
  const RegisterButton = ({
@@ -10756,7 +10859,7 @@ const RegisterButton = ({
10756
10859
  buttonDisabled
10757
10860
  },
10758
10861
  dispatch
10759
- } = React.useContext(store$g);
10862
+ } = React.useContext(store$h);
10760
10863
  const {
10761
10864
  t
10762
10865
  } = useTranslation("register");
@@ -10894,7 +10997,7 @@ function FirstName({
10894
10997
  }
10895
10998
 
10896
10999
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10897
- store: store$g
11000
+ store: store$h
10898
11001
  }, props));
10899
11002
 
10900
11003
  function LastName({
@@ -10925,7 +11028,7 @@ function LastName({
10925
11028
  }
10926
11029
 
10927
11030
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10928
- store: store$g
11031
+ store: store$h
10929
11032
  }, props));
10930
11033
 
10931
11034
  /**
@@ -11049,7 +11152,7 @@ function TextInput({
11049
11152
 
11050
11153
  const RegisterTextInput = props => {
11051
11154
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11052
- store: store$g
11155
+ store: store$h
11053
11156
  }));
11054
11157
  };
11055
11158
 
@@ -11196,6 +11299,7 @@ function SelectModalWithHook(props) {
11196
11299
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11197
11300
  }, []);
11198
11301
  const {
11302
+ productsList,
11199
11303
  isGift,
11200
11304
  plan,
11201
11305
  product,
@@ -11205,11 +11309,12 @@ function SelectModalWithHook(props) {
11205
11309
  view,
11206
11310
  set
11207
11311
  } = usePelcro();
11208
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11209
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11312
+ const isRenewingSub = view === "_plan-select-renew";
11210
11313
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11314
+ productsList: productsList,
11211
11315
  isGift: isGift,
11212
- disableGifting: isRenewingGift,
11316
+ disableGifting: isRenewingGift || isRenewingSub,
11317
+ isRenewingSub: isRenewingSub,
11213
11318
  plan: plan,
11214
11319
  product: product,
11215
11320
  onClose: () => {
@@ -11223,8 +11328,10 @@ function SelectModalWithHook(props) {
11223
11328
  plan,
11224
11329
  isGift
11225
11330
  }),
11226
- setView: switchView,
11227
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11331
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11332
+ subscriptionIdToRenew
11333
+ }),
11334
+ setView: switchView
11228
11335
  });
11229
11336
  }
11230
11337
  SelectModalWithHook.viewId = "plan-select";
@@ -11256,10 +11363,10 @@ class SelectModal extends React.Component {
11256
11363
  });
11257
11364
  }
11258
11365
 
11259
- if (this.state.productList.length === 1) {
11366
+ if (this.props.productsList.length === 1) {
11260
11367
  this.setState({
11261
- product: this.state.productList[0],
11262
- planList: this.state.productList[0].plans,
11368
+ product: this.props.productsList[0],
11369
+ planList: this.props.productsList[0].plans,
11263
11370
  mode: "plan"
11264
11371
  });
11265
11372
  }
@@ -11276,7 +11383,7 @@ class SelectModal extends React.Component {
11276
11383
  });
11277
11384
 
11278
11385
  _defineProperty$3(this, "onProductChange", e => {
11279
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11386
+ const product = productsList[e.target.selectedIndex];
11280
11387
  this.setState({
11281
11388
  product: product,
11282
11389
  plan: product.plans[0]
@@ -11342,7 +11449,7 @@ class SelectModal extends React.Component {
11342
11449
 
11343
11450
  _defineProperty$3(this, "renderProducts", () => {
11344
11451
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11345
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11452
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11346
11453
  return productsToShow.map((product, index) => {
11347
11454
  return this.renderOneProduct(product, index);
11348
11455
  });
@@ -11355,7 +11462,7 @@ class SelectModal extends React.Component {
11355
11462
  return this.renderOneProduct(this.state.product);
11356
11463
  }
11357
11464
 
11358
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11465
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11359
11466
 
11360
11467
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11361
11468
  return this.renderProducts();
@@ -11371,10 +11478,7 @@ class SelectModal extends React.Component {
11371
11478
  className: "plc-text-sm plc-font-semibold"
11372
11479
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11373
11480
 
11374
- function productsWithMatchedTaggedFirst() {
11375
- var _window$Pelcro$produc;
11376
-
11377
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11481
+ function productsWithMatchedTaggedFirst(allProducts) {
11378
11482
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11379
11483
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11380
11484
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11408,7 +11512,7 @@ class SelectModal extends React.Component {
11408
11512
  _defineProperty$3(this, "selectProduct", e => {
11409
11513
  const id = e.target.dataset.key;
11410
11514
 
11411
- for (const product of this.state.productList) {
11515
+ for (const product of this.props.productsList) {
11412
11516
  if (+product.id === +id) {
11413
11517
  var _this$state$plan;
11414
11518
 
@@ -11461,6 +11565,14 @@ class SelectModal extends React.Component {
11461
11565
 
11462
11566
  _defineProperty$3(this, "submitOption", () => {
11463
11567
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11568
+
11569
+ if (this.props.isRenewingSub) {
11570
+ var _matchingSub$id;
11571
+
11572
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11573
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11574
+ }
11575
+
11464
11576
  const {
11465
11577
  product,
11466
11578
  isGift
@@ -11498,8 +11610,7 @@ class SelectModal extends React.Component {
11498
11610
  plan: {},
11499
11611
  isGift: props.isGift,
11500
11612
  disabled: true,
11501
- mode: "product",
11502
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11613
+ mode: "product"
11503
11614
  };
11504
11615
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11505
11616
  this.locale = this.props.t;
@@ -11507,7 +11618,7 @@ class SelectModal extends React.Component {
11507
11618
  }
11508
11619
 
11509
11620
  render() {
11510
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11621
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11511
11622
 
11512
11623
  const {
11513
11624
  disableGifting
@@ -11541,7 +11652,7 @@ class SelectModal extends React.Component {
11541
11652
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11542
11653
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11543
11654
  className: "plc-text-2xl plc-font-semibold"
11544
- }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11655
+ }, this.product && this.product.paywall.select_title || ((_this$props$productsL = this.props.productsList[0]) === null || _this$props$productsL === void 0 ? void 0 : _this$props$productsL.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_this$props$productsL2 = this.props.productsList[0]) === null || _this$props$productsL2 === void 0 ? void 0 : _this$props$productsL2.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11545
11656
  className: "pelcro-select-products-wrapper"
11546
11657
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
11547
11658
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12782,6 +12893,7 @@ class Subscription {
12782
12893
  * @property {number} [quantity]
12783
12894
  * @property {string} addressId
12784
12895
  * @property {number} invoiceId
12896
+ * @property {boolean} isExistingSource
12785
12897
  */
12786
12898
 
12787
12899
  /**
@@ -12966,11 +13078,15 @@ class StripeGateway {
12966
13078
  token,
12967
13079
  invoiceId
12968
13080
  } = options;
12969
- window.Pelcro.invoice.pay({
13081
+ const params = options.isExistingSource ? {
13082
+ source_id: token,
13083
+ invoice_id: invoiceId
13084
+ } : {
12970
13085
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
12971
13086
  gateway_token: token,
12972
13087
  invoice_id: invoiceId
12973
- }, (err, res) => {
13088
+ };
13089
+ window.Pelcro.invoice.pay(params, (err, res) => {
12974
13090
  callback(err, res);
12975
13091
  });
12976
13092
  }
@@ -13111,7 +13227,7 @@ class PaypalGateWay {
13111
13227
 
13112
13228
  /** @type {PaymentStateType} */
13113
13229
 
13114
- const initialState$f = {
13230
+ const initialState$g = {
13115
13231
  disableSubmit: false,
13116
13232
  isLoading: false,
13117
13233
  disableCouponButton: false,
@@ -13130,10 +13246,10 @@ const initialState$f = {
13130
13246
  content: ""
13131
13247
  }
13132
13248
  };
13133
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
13249
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
13134
13250
  const {
13135
- Provider: Provider$f
13136
- } = store$f;
13251
+ Provider: Provider$g
13252
+ } = store$g;
13137
13253
 
13138
13254
  const PaymentMethodContainerWithoutStripe = ({
13139
13255
  style,
@@ -13737,6 +13853,7 @@ const PaymentMethodContainerWithoutStripe = ({
13737
13853
  return subscription.execute({
13738
13854
  type: SUBSCRIPTION_TYPES.PAY_INVOICE,
13739
13855
  token: gatewayToken,
13856
+ isExistingSource: Boolean(selectedPaymentMethodId),
13740
13857
  invoiceId: invoice.id
13741
13858
  }, (err, res) => {
13742
13859
  dispatch({
@@ -13759,9 +13876,6 @@ const PaymentMethodContainerWithoutStripe = ({
13759
13876
  });
13760
13877
  }
13761
13878
 
13762
- set({
13763
- invoice: null
13764
- });
13765
13879
  onSuccess(res);
13766
13880
  });
13767
13881
  };
@@ -13866,7 +13980,7 @@ const PaymentMethodContainerWithoutStripe = ({
13866
13980
  }, 0);
13867
13981
  };
13868
13982
 
13869
- const totalAmount = (_ref = (_ref2 = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13983
+ const totalAmount = (_ref = (_ref2 = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13870
13984
 
13871
13985
  if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
13872
13986
  return resolveTaxCalculation().then(res => {
@@ -14113,7 +14227,7 @@ const PaymentMethodContainerWithoutStripe = ({
14113
14227
  case HANDLE_PAYPAL_SUBSCRIPTION:
14114
14228
  return lib_5(state, (state, dispatch) => {
14115
14229
  if (type === "invoicePayment") {
14116
- payInvoice(new PaypalGateWay(), action.payload, dispatch);
14230
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14117
14231
  } else {
14118
14232
  handlePaypalSubscription(state, action.payload);
14119
14233
  }
@@ -14175,21 +14289,21 @@ const PaymentMethodContainerWithoutStripe = ({
14175
14289
  default:
14176
14290
  return state;
14177
14291
  }
14178
- }, initialState$f);
14292
+ }, initialState$g);
14179
14293
  return /*#__PURE__*/React__default['default'].createElement("div", {
14180
14294
  style: { ...style
14181
14295
  },
14182
14296
  className: `pelcro-container pelcro-payment-container ${className}`
14183
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14297
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14184
14298
  value: {
14185
14299
  state,
14186
14300
  dispatch
14187
14301
  }
14188
14302
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14189
- store: store$f,
14303
+ store: store$g,
14190
14304
  key: i
14191
14305
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14192
- store: store$f
14306
+ store: store$g
14193
14307
  })));
14194
14308
  };
14195
14309
 
@@ -14211,7 +14325,7 @@ const PaymentMethodContainer = props => {
14211
14325
  stripeAccount: window.Pelcro.site.read().account_id,
14212
14326
  locale: getPageOrDefaultLanguage()
14213
14327
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14214
- store: store$f
14328
+ store: store$g
14215
14329
  }, props))));
14216
14330
  }
14217
14331
 
@@ -14264,7 +14378,7 @@ const PelcroPaymentRequestButton = props => {
14264
14378
  currentPlan,
14265
14379
  updatedPrice
14266
14380
  }
14267
- } = React.useContext(store$f);
14381
+ } = React.useContext(store$g);
14268
14382
 
14269
14383
  const updatePaymentRequest = () => {
14270
14384
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14324,7 +14438,7 @@ const DiscountedPrice = props => {
14324
14438
  taxAmount,
14325
14439
  percentOff
14326
14440
  }
14327
- } = React.useContext(store$f);
14441
+ } = React.useContext(store$g);
14328
14442
  const {
14329
14443
  order,
14330
14444
  plan
@@ -14374,7 +14488,7 @@ const SubmitPaymentMethod = ({
14374
14488
  isLoading,
14375
14489
  updatedPrice
14376
14490
  }
14377
- } = React.useContext(store$f);
14491
+ } = React.useContext(store$g);
14378
14492
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14379
14493
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14380
14494
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14395,17 +14509,17 @@ const SubmitPaymentMethod = ({
14395
14509
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14396
14510
  };
14397
14511
 
14398
- var _path$m;
14512
+ var _path$n;
14399
14513
 
14400
- 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); }
14514
+ 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); }
14401
14515
 
14402
14516
  function SvgArrowLeft(props) {
14403
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14517
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14404
14518
  xmlns: "http://www.w3.org/2000/svg",
14405
14519
  fill: "none",
14406
14520
  viewBox: "0 0 24 24",
14407
14521
  stroke: "currentColor"
14408
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14522
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14409
14523
  strokeLinecap: "round",
14410
14524
  strokeLinejoin: "round",
14411
14525
  strokeWidth: 2,
@@ -14424,7 +14538,7 @@ const ApplyCouponButton = ({
14424
14538
  disableCouponButton
14425
14539
  },
14426
14540
  dispatch
14427
- } = React.useContext(store$f);
14541
+ } = React.useContext(store$g);
14428
14542
  const {
14429
14543
  t
14430
14544
  } = useTranslation("checkoutForm");
@@ -14458,7 +14572,7 @@ const CouponCodeField = props => {
14458
14572
  couponCode,
14459
14573
  couponError
14460
14574
  }
14461
- } = React.useContext(store$f);
14575
+ } = React.useContext(store$g);
14462
14576
 
14463
14577
  const onCouponCodeChange = e => {
14464
14578
  dispatch({
@@ -14487,17 +14601,17 @@ const CouponCodeField = props => {
14487
14601
  }, props));
14488
14602
  };
14489
14603
 
14490
- var _path$l;
14604
+ var _path$m;
14491
14605
 
14492
- 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); }
14606
+ 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); }
14493
14607
 
14494
14608
  function SvgTicket(props) {
14495
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14609
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14496
14610
  xmlns: "http://www.w3.org/2000/svg",
14497
14611
  fill: "none",
14498
14612
  viewBox: "0 0 24 24",
14499
14613
  stroke: "currentColor"
14500
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14614
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14501
14615
  strokeLinecap: "round",
14502
14616
  strokeLinejoin: "round",
14503
14617
  strokeWidth: 2,
@@ -14514,7 +14628,7 @@ const CouponCode = ({
14514
14628
  state: {
14515
14629
  enableCouponField
14516
14630
  }
14517
- } = React.useContext(store$f);
14631
+ } = React.useContext(store$g);
14518
14632
  const {
14519
14633
  t
14520
14634
  } = useTranslation("checkoutForm");
@@ -14771,7 +14885,7 @@ const PaypalSubscribeButton = props => {
14771
14885
  const {
14772
14886
  dispatch,
14773
14887
  state
14774
- } = React.useContext(store$f);
14888
+ } = React.useContext(store$g);
14775
14889
  const {
14776
14890
  product,
14777
14891
  plan,
@@ -14857,16 +14971,16 @@ const BankRedirection = () => {
14857
14971
  }));
14858
14972
  };
14859
14973
 
14860
- var _path$k;
14974
+ var _path$l;
14861
14975
 
14862
- 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); }
14976
+ 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); }
14863
14977
 
14864
14978
  function SvgLock(props) {
14865
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
14979
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14866
14980
  xmlns: "http://www.w3.org/2000/svg",
14867
14981
  viewBox: "0 0 20 20",
14868
14982
  fill: "currentColor"
14869
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
14983
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14870
14984
  fillRule: "evenodd",
14871
14985
  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",
14872
14986
  clipRule: "evenodd"
@@ -14883,7 +14997,7 @@ const SelectedPaymentMethod = () => {
14883
14997
  state: {
14884
14998
  isLoading
14885
14999
  }
14886
- } = React.useContext(store$f);
15000
+ } = React.useContext(store$g);
14887
15001
  const {
14888
15002
  switchView,
14889
15003
  selectedPaymentMethodId
@@ -14925,7 +15039,7 @@ const TaxAmount = () => {
14925
15039
  state: {
14926
15040
  taxAmount
14927
15041
  }
14928
- } = React.useContext(store$f);
15042
+ } = React.useContext(store$g);
14929
15043
  const {
14930
15044
  plan
14931
15045
  } = usePelcro();
@@ -15088,12 +15202,12 @@ function SubscriptionRenewModal({
15088
15202
  }
15089
15203
  SubscriptionRenewModal.viewId = "subscription-renew";
15090
15204
 
15091
- var _path$j;
15205
+ var _path$k;
15092
15206
 
15093
- 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); }
15207
+ 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); }
15094
15208
 
15095
15209
  function SvgGift(props) {
15096
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15210
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15097
15211
  className: "plc-w-6 plc-h-6 plc-mr-2",
15098
15212
  fill: "none",
15099
15213
  stroke: "currentColor",
@@ -15102,7 +15216,7 @@ function SvgGift(props) {
15102
15216
  strokeWidth: 2,
15103
15217
  viewBox: "0 0 24 24",
15104
15218
  xmlns: "http://www.w3.org/2000/svg"
15105
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15219
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15106
15220
  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"
15107
15221
  })));
15108
15222
  }
@@ -15443,7 +15557,7 @@ class DefaultNewsLetter extends React.Component {
15443
15557
 
15444
15558
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15445
15559
 
15446
- const initialState$e = {
15560
+ const initialState$f = {
15447
15561
  didSubToNewslettersBefore: false,
15448
15562
  newsletters: [],
15449
15563
  isListLoading: true,
@@ -15453,10 +15567,10 @@ const initialState$e = {
15453
15567
  content: ""
15454
15568
  }
15455
15569
  };
15456
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
15570
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
15457
15571
  const {
15458
- Provider: Provider$e
15459
- } = store$e;
15572
+ Provider: Provider$f
15573
+ } = store$f;
15460
15574
 
15461
15575
  const NewsletterUpdateContainer = ({
15462
15576
  style,
@@ -15569,7 +15683,7 @@ const NewsletterUpdateContainer = ({
15569
15683
  default:
15570
15684
  return state;
15571
15685
  }
15572
- }, initialState$e);
15686
+ }, initialState$f);
15573
15687
  React.useEffect(() => {
15574
15688
  const getUserNewsletters = () => {
15575
15689
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15613,7 +15727,7 @@ const NewsletterUpdateContainer = ({
15613
15727
  style: { ...style
15614
15728
  },
15615
15729
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15616
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
15730
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
15617
15731
  value: {
15618
15732
  state,
15619
15733
  dispatch
@@ -15621,12 +15735,12 @@ const NewsletterUpdateContainer = ({
15621
15735
  }, children.length ? children.map((child, i) => {
15622
15736
  if (child) {
15623
15737
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15624
- store: store$e,
15738
+ store: store$f,
15625
15739
  key: i
15626
15740
  });
15627
15741
  }
15628
15742
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15629
- store: store$e
15743
+ store: store$f
15630
15744
  })));
15631
15745
  };
15632
15746
 
@@ -15641,7 +15755,7 @@ const NewsletterUpdateButton = ({
15641
15755
  isSubmitting,
15642
15756
  isListLoading
15643
15757
  }
15644
- } = React.useContext(store$e);
15758
+ } = React.useContext(store$f);
15645
15759
  const {
15646
15760
  t
15647
15761
  } = useTranslation("newsletter");
@@ -15671,7 +15785,7 @@ const NewsletterUpdateList = () => {
15671
15785
  newsletters,
15672
15786
  isListLoading
15673
15787
  }
15674
- } = React.useContext(store$e);
15788
+ } = React.useContext(store$f);
15675
15789
 
15676
15790
  if (isListLoading) {
15677
15791
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -15875,7 +15989,7 @@ function SubscriptionCreateModal({
15875
15989
  SubscriptionCreateModal.viewId = "subscription-create";
15876
15990
 
15877
15991
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15878
- const initialState$d = {
15992
+ const initialState$e = {
15879
15993
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15880
15994
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15881
15995
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15888,10 +16002,10 @@ const initialState$d = {
15888
16002
  content: ""
15889
16003
  }
15890
16004
  };
15891
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16005
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
15892
16006
  const {
15893
- Provider: Provider$d
15894
- } = store$d;
16007
+ Provider: Provider$e
16008
+ } = store$e;
15895
16009
 
15896
16010
  const UserUpdateContainer = ({
15897
16011
  style,
@@ -16023,27 +16137,27 @@ const UserUpdateContainer = ({
16023
16137
  default:
16024
16138
  return state;
16025
16139
  }
16026
- }, initialState$d);
16140
+ }, initialState$e);
16027
16141
  return /*#__PURE__*/React__default['default'].createElement("div", {
16028
16142
  style: { ...style
16029
16143
  },
16030
16144
  className: `pelcro-container pelcro-user-update-container ${className}`
16031
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16145
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16032
16146
  value: {
16033
16147
  state,
16034
16148
  dispatch
16035
16149
  }
16036
16150
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16037
- store: store$d,
16151
+ store: store$e,
16038
16152
  key: i
16039
16153
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16040
- store: store$d
16154
+ store: store$e
16041
16155
  })));
16042
16156
  };
16043
16157
 
16044
16158
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16045
16159
  disabled: true,
16046
- store: store$d
16160
+ store: store$e
16047
16161
  }, props));
16048
16162
 
16049
16163
  const UserUpdateButton = ({
@@ -16056,7 +16170,7 @@ const UserUpdateButton = ({
16056
16170
  buttonDisabled
16057
16171
  },
16058
16172
  dispatch
16059
- } = React.useContext(store$d);
16173
+ } = React.useContext(store$e);
16060
16174
  const {
16061
16175
  t
16062
16176
  } = useTranslation("userEdit");
@@ -16073,11 +16187,11 @@ const UserUpdateButton = ({
16073
16187
  };
16074
16188
 
16075
16189
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16076
- store: store$d
16190
+ store: store$e
16077
16191
  }, props));
16078
16192
 
16079
16193
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16080
- store: store$d
16194
+ store: store$e
16081
16195
  }, props));
16082
16196
 
16083
16197
  function Phone({
@@ -16106,22 +16220,22 @@ function Phone({
16106
16220
  }
16107
16221
 
16108
16222
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16109
- store: store$d
16223
+ store: store$e
16110
16224
  }, props));
16111
16225
 
16112
16226
  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";
16113
16227
 
16114
- var _path$i;
16228
+ var _path$j;
16115
16229
 
16116
- 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); }
16230
+ 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); }
16117
16231
 
16118
16232
  function SvgEdit(props) {
16119
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
16233
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16120
16234
  className: "plc-w-6 plc-h-6",
16121
16235
  xmlns: "http://www.w3.org/2000/svg",
16122
16236
  viewBox: "0 0 20 20",
16123
16237
  fill: "currentColor"
16124
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
16238
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16125
16239
  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"
16126
16240
  })));
16127
16241
  }
@@ -16253,16 +16367,16 @@ function DisplayName({
16253
16367
  }
16254
16368
 
16255
16369
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16256
- store: store$d
16370
+ store: store$e
16257
16371
  }, props));
16258
16372
 
16259
16373
  const UserUpdateTextInput = props => {
16260
16374
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16261
- store: store$d
16375
+ store: store$e
16262
16376
  }));
16263
16377
  };
16264
16378
 
16265
- const initialState$c = {
16379
+ const initialState$d = {
16266
16380
  isSubmitting: false,
16267
16381
  firstName: "",
16268
16382
  firstNameError: "",
@@ -16287,10 +16401,10 @@ const initialState$c = {
16287
16401
  content: ""
16288
16402
  }
16289
16403
  };
16290
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
16404
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16291
16405
  const {
16292
- Provider: Provider$c
16293
- } = store$c;
16406
+ Provider: Provider$d
16407
+ } = store$d;
16294
16408
 
16295
16409
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16296
16410
 
@@ -16497,7 +16611,7 @@ const AddressCreateContainer = ({
16497
16611
  default:
16498
16612
  return state;
16499
16613
  }
16500
- }, initialState$c);
16614
+ }, initialState$d);
16501
16615
  React.useEffect(() => {
16502
16616
  const getStates = () => {
16503
16617
  dispatch({
@@ -16529,16 +16643,16 @@ const AddressCreateContainer = ({
16529
16643
  style: { ...style
16530
16644
  },
16531
16645
  className: `pelcro-container pelcro-address-create-container ${className}`
16532
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
16646
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16533
16647
  value: {
16534
16648
  state,
16535
16649
  dispatch
16536
16650
  }
16537
16651
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16538
- store: store$c,
16652
+ store: store$d,
16539
16653
  key: i
16540
16654
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16541
- store: store$c
16655
+ store: store$d
16542
16656
  })));
16543
16657
  };
16544
16658
 
@@ -16549,7 +16663,7 @@ function AddressCreateFirstName(props) {
16549
16663
  firstName,
16550
16664
  firstNameError
16551
16665
  }
16552
- } = React.useContext(store$c);
16666
+ } = React.useContext(store$d);
16553
16667
 
16554
16668
  const handleBlur = () => {
16555
16669
  return dispatch({
@@ -16592,7 +16706,7 @@ function AddressCreateLastName(props) {
16592
16706
  lastName,
16593
16707
  lastNameError
16594
16708
  }
16595
- } = React.useContext(store$c);
16709
+ } = React.useContext(store$d);
16596
16710
 
16597
16711
  const handleBlur = () => {
16598
16712
  return dispatch({
@@ -16635,7 +16749,7 @@ function AddressCreateLine1(props) {
16635
16749
  line1,
16636
16750
  line1Error
16637
16751
  }
16638
- } = React.useContext(store$c);
16752
+ } = React.useContext(store$d);
16639
16753
 
16640
16754
  const handleBlur = () => {
16641
16755
  return dispatch({
@@ -16678,7 +16792,7 @@ function AddressCreateCity(props) {
16678
16792
  city,
16679
16793
  cityError
16680
16794
  }
16681
- } = React.useContext(store$c);
16795
+ } = React.useContext(store$d);
16682
16796
 
16683
16797
  const handleBlur = () => {
16684
16798
  return dispatch({
@@ -16721,7 +16835,7 @@ function AddressCreatePostalCode(props) {
16721
16835
  postalCode,
16722
16836
  postalCodeError
16723
16837
  }
16724
- } = React.useContext(store$c);
16838
+ } = React.useContext(store$d);
16725
16839
 
16726
16840
  const handleBlur = () => {
16727
16841
  return dispatch({
@@ -16767,7 +16881,7 @@ const AddressCreateSubmit = ({
16767
16881
  state: {
16768
16882
  isSubmitting
16769
16883
  }
16770
- } = React.useContext(store$c);
16884
+ } = React.useContext(store$d);
16771
16885
  const {
16772
16886
  t
16773
16887
  } = useTranslation("address");
@@ -16878,7 +16992,7 @@ function CountrySelect({
16878
16992
  }
16879
16993
 
16880
16994
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
16881
- store: store$c
16995
+ store: store$d
16882
16996
  }, props));
16883
16997
 
16884
16998
  function StateSelect({
@@ -16966,7 +17080,7 @@ function StateSelect({
16966
17080
  }
16967
17081
 
16968
17082
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
16969
- store: store$c
17083
+ store: store$d
16970
17084
  }, props));
16971
17085
 
16972
17086
  const AddressCreateView = props => {
@@ -17071,18 +17185,18 @@ AddressCreateModal.viewId = "address-create";
17071
17185
 
17072
17186
  const AddressCreateTextInput = props => {
17073
17187
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17074
- store: store$c
17188
+ store: store$d
17075
17189
  }));
17076
17190
  };
17077
17191
 
17078
17192
  const AddressCreateLine2 = props => {
17079
17193
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17080
17194
  fieldName: "line2",
17081
- store: store$c
17195
+ store: store$d
17082
17196
  }, props));
17083
17197
  };
17084
17198
 
17085
- const initialState$b = {
17199
+ const initialState$c = {
17086
17200
  isSubmitting: false,
17087
17201
  firstName: "",
17088
17202
  firstNameError: "",
@@ -17107,10 +17221,10 @@ const initialState$b = {
17107
17221
  content: ""
17108
17222
  }
17109
17223
  };
17110
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
17224
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
17111
17225
  const {
17112
- Provider: Provider$b
17113
- } = store$b;
17226
+ Provider: Provider$c
17227
+ } = store$c;
17114
17228
 
17115
17229
  const AddressUpdateContainer = ({
17116
17230
  style,
@@ -17162,7 +17276,7 @@ const AddressUpdateContainer = ({
17162
17276
  const thisAddress = addresses[address];
17163
17277
 
17164
17278
  if (+thisAddress.id === +addressId) {
17165
- const newState = { ...initialState$b,
17279
+ const newState = { ...initialState$c,
17166
17280
  firstName: thisAddress.first_name,
17167
17281
  lastName: thisAddress.last_name,
17168
17282
  line1: thisAddress.line1,
@@ -17295,7 +17409,7 @@ const AddressUpdateContainer = ({
17295
17409
  default:
17296
17410
  return state;
17297
17411
  }
17298
- }, initialState$b);
17412
+ }, initialState$c);
17299
17413
  React.useEffect(() => {
17300
17414
  const getStates = () => {
17301
17415
  dispatch({
@@ -17327,21 +17441,21 @@ const AddressUpdateContainer = ({
17327
17441
  style: { ...style
17328
17442
  },
17329
17443
  className: `pelcro-container pelcro-address-update-container ${className}`
17330
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17444
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17331
17445
  value: {
17332
17446
  state,
17333
17447
  dispatch
17334
17448
  }
17335
17449
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17336
- store: store$b,
17450
+ store: store$c,
17337
17451
  key: i
17338
17452
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17339
- store: store$b
17453
+ store: store$c
17340
17454
  })));
17341
17455
  };
17342
17456
 
17343
17457
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17344
- store: store$b
17458
+ store: store$c
17345
17459
  }, props));
17346
17460
 
17347
17461
  function AddressUpdateFirstName(props) {
@@ -17351,7 +17465,7 @@ function AddressUpdateFirstName(props) {
17351
17465
  firstName,
17352
17466
  firstNameError
17353
17467
  }
17354
- } = React.useContext(store$b);
17468
+ } = React.useContext(store$c);
17355
17469
 
17356
17470
  const handleBlur = () => {
17357
17471
  return dispatch({
@@ -17394,7 +17508,7 @@ function AddressUpdateLastName(props) {
17394
17508
  lastName,
17395
17509
  lastNameError
17396
17510
  }
17397
- } = React.useContext(store$b);
17511
+ } = React.useContext(store$c);
17398
17512
 
17399
17513
  const handleBlur = () => {
17400
17514
  return dispatch({
@@ -17437,7 +17551,7 @@ function AddressUpdateLine1(props) {
17437
17551
  line1,
17438
17552
  line1Error
17439
17553
  }
17440
- } = React.useContext(store$b);
17554
+ } = React.useContext(store$c);
17441
17555
 
17442
17556
  const handleBlur = () => {
17443
17557
  return dispatch({
@@ -17477,7 +17591,7 @@ const AddressUpdateLine2 = props => {
17477
17591
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17478
17592
  fieldName: "line2"
17479
17593
  }, props, {
17480
- store: store$b
17594
+ store: store$c
17481
17595
  }));
17482
17596
  };
17483
17597
 
@@ -17488,7 +17602,7 @@ function AddressUpdateCity(props) {
17488
17602
  city,
17489
17603
  cityError
17490
17604
  }
17491
- } = React.useContext(store$b);
17605
+ } = React.useContext(store$c);
17492
17606
 
17493
17607
  const handleBlur = () => {
17494
17608
  return dispatch({
@@ -17531,7 +17645,7 @@ function AddressUpdatePostalCode(props) {
17531
17645
  postalCode,
17532
17646
  postalCodeError
17533
17647
  }
17534
- } = React.useContext(store$b);
17648
+ } = React.useContext(store$c);
17535
17649
 
17536
17650
  const handleBlur = () => {
17537
17651
  return dispatch({
@@ -17577,7 +17691,7 @@ const AddressUpdateSubmit = ({
17577
17691
  state: {
17578
17692
  isSubmitting
17579
17693
  }
17580
- } = React.useContext(store$b);
17694
+ } = React.useContext(store$c);
17581
17695
  const {
17582
17696
  t
17583
17697
  } = useTranslation("address");
@@ -17593,7 +17707,7 @@ const AddressUpdateSubmit = ({
17593
17707
  };
17594
17708
 
17595
17709
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17596
- store: store$b
17710
+ store: store$c
17597
17711
  }, props));
17598
17712
 
17599
17713
  const AddressUpdateView = props => {
@@ -17676,7 +17790,7 @@ AddressUpdateModal.viewId = "address-edit";
17676
17790
 
17677
17791
  const AddressUpdateTextInput = props => {
17678
17792
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17679
- store: store$b
17793
+ store: store$c
17680
17794
  }));
17681
17795
  };
17682
17796
 
@@ -17759,7 +17873,7 @@ const PaymentMethodUpdateModal = props => {
17759
17873
  };
17760
17874
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17761
17875
 
17762
- const initialState$a = {
17876
+ const initialState$b = {
17763
17877
  email: "",
17764
17878
  password: "",
17765
17879
  passwordError: null,
@@ -17772,10 +17886,10 @@ const initialState$a = {
17772
17886
  content: ""
17773
17887
  }
17774
17888
  };
17775
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
17889
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
17776
17890
  const {
17777
- Provider: Provider$a
17778
- } = store$a;
17891
+ Provider: Provider$b
17892
+ } = store$b;
17779
17893
 
17780
17894
  const PasswordResetContainer = ({
17781
17895
  style,
@@ -17832,7 +17946,7 @@ const PasswordResetContainer = ({
17832
17946
  type: SET_EMAIL,
17833
17947
  payload: window.Pelcro.helpers.getURLParameter("email")
17834
17948
  });
17835
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
17949
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
17836
17950
  dispatch({
17837
17951
  type: SET_TOKEN,
17838
17952
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17892,26 +18006,26 @@ const PasswordResetContainer = ({
17892
18006
  default:
17893
18007
  return state;
17894
18008
  }
17895
- }, initialState$a);
18009
+ }, initialState$b);
17896
18010
  return /*#__PURE__*/React__default['default'].createElement("div", {
17897
18011
  style: { ...style
17898
18012
  },
17899
18013
  className: `pelcro-container pelcro-password-reset-container ${className}`
17900
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18014
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17901
18015
  value: {
17902
18016
  state,
17903
18017
  dispatch
17904
18018
  }
17905
18019
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17906
- store: store$a,
18020
+ store: store$b,
17907
18021
  key: i
17908
18022
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17909
- store: store$a
18023
+ store: store$b
17910
18024
  })));
17911
18025
  };
17912
18026
 
17913
18027
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
17914
- store: store$a
18028
+ store: store$b
17915
18029
  }, props));
17916
18030
 
17917
18031
  const PasswordResetButton = ({
@@ -17924,7 +18038,7 @@ const PasswordResetButton = ({
17924
18038
  buttonDisabled
17925
18039
  },
17926
18040
  dispatch
17927
- } = React.useContext(store$a);
18041
+ } = React.useContext(store$b);
17928
18042
  const {
17929
18043
  t
17930
18044
  } = useTranslation("passwordReset");
@@ -17941,14 +18055,14 @@ const PasswordResetButton = ({
17941
18055
  };
17942
18056
 
17943
18057
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
17944
- store: store$a
18058
+ store: store$b
17945
18059
  }, props, {
17946
18060
  value: window.Pelcro.helpers.getURLParameter("email"),
17947
18061
  disabled: true
17948
18062
  }));
17949
18063
 
17950
18064
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
17951
- store: store$a
18065
+ store: store$b
17952
18066
  }, props));
17953
18067
 
17954
18068
  const PasswordResetView = props => {
@@ -18000,7 +18114,7 @@ const PasswordResetModal = ({
18000
18114
  };
18001
18115
  PasswordResetModal.viewId = "password-reset";
18002
18116
 
18003
- const initialState$9 = {
18117
+ const initialState$a = {
18004
18118
  email: "",
18005
18119
  emailError: null,
18006
18120
  buttonDisabled: false,
@@ -18009,10 +18123,10 @@ const initialState$9 = {
18009
18123
  content: ""
18010
18124
  }
18011
18125
  };
18012
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18126
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
18013
18127
  const {
18014
- Provider: Provider$9
18015
- } = store$9;
18128
+ Provider: Provider$a
18129
+ } = store$a;
18016
18130
 
18017
18131
  const PasswordForgotContainer = ({
18018
18132
  style,
@@ -18090,21 +18204,21 @@ const PasswordForgotContainer = ({
18090
18204
  default:
18091
18205
  return state;
18092
18206
  }
18093
- }, initialState$9);
18207
+ }, initialState$a);
18094
18208
  return /*#__PURE__*/React__default['default'].createElement("div", {
18095
18209
  style: { ...style
18096
18210
  },
18097
18211
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18098
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18212
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18099
18213
  value: {
18100
18214
  state,
18101
18215
  dispatch
18102
18216
  }
18103
18217
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18104
- store: store$9,
18218
+ store: store$a,
18105
18219
  key: i
18106
18220
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18107
- store: store$9
18221
+ store: store$a
18108
18222
  })));
18109
18223
  };
18110
18224
 
@@ -18120,7 +18234,7 @@ const PasswordForgotButton = ({
18120
18234
  emailError
18121
18235
  },
18122
18236
  dispatch
18123
- } = React.useContext(store$9);
18237
+ } = React.useContext(store$a);
18124
18238
  const {
18125
18239
  t
18126
18240
  } = useTranslation("passwordForgot");
@@ -18141,7 +18255,7 @@ const PasswordForgotButton = ({
18141
18255
  };
18142
18256
 
18143
18257
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18144
- store: store$9
18258
+ store: store$a
18145
18259
  }, props));
18146
18260
 
18147
18261
  const PasswordForgotView = props => {
@@ -18191,7 +18305,7 @@ const PasswordForgotModal = ({
18191
18305
  };
18192
18306
  PasswordForgotModal.viewId = "password-forgot";
18193
18307
 
18194
- const initialState$8 = {
18308
+ const initialState$9 = {
18195
18309
  currentPassword: "",
18196
18310
  newPassword: "",
18197
18311
  confirmNewPassword: "",
@@ -18205,10 +18319,10 @@ const initialState$8 = {
18205
18319
  content: ""
18206
18320
  }
18207
18321
  };
18208
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18322
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18209
18323
  const {
18210
- Provider: Provider$8
18211
- } = store$8;
18324
+ Provider: Provider$9
18325
+ } = store$9;
18212
18326
  const PasswordChangeContainer = ({
18213
18327
  style,
18214
18328
  className = "",
@@ -18360,21 +18474,21 @@ const PasswordChangeContainer = ({
18360
18474
  default:
18361
18475
  return state;
18362
18476
  }
18363
- }, initialState$8);
18477
+ }, initialState$9);
18364
18478
  return /*#__PURE__*/React__default['default'].createElement("div", {
18365
18479
  style: { ...style
18366
18480
  },
18367
18481
  className: `pelcro-container pelcro-password-change-container ${className}`
18368
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18482
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18369
18483
  value: {
18370
18484
  state,
18371
18485
  dispatch
18372
18486
  }
18373
18487
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18374
- store: store$8,
18488
+ store: store$9,
18375
18489
  key: i
18376
18490
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18377
- store: store$8
18491
+ store: store$9
18378
18492
  })));
18379
18493
  };
18380
18494
 
@@ -18385,7 +18499,7 @@ function PasswordChangeCurrentPassword(props) {
18385
18499
  currentPassword,
18386
18500
  currentPasswordError
18387
18501
  }
18388
- } = React.useContext(store$8);
18502
+ } = React.useContext(store$9);
18389
18503
  const handleBlur = React.useCallback(() => {
18390
18504
  return dispatch({
18391
18505
  type: VALIDATE_PASSWORD
@@ -18419,7 +18533,7 @@ function PasswordChangeNewPassword(props) {
18419
18533
  newPassword,
18420
18534
  newPasswordError
18421
18535
  }
18422
- } = React.useContext(store$8);
18536
+ } = React.useContext(store$9);
18423
18537
  const handleBlur = React.useCallback(() => {
18424
18538
  return dispatch({
18425
18539
  type: VALIDATE_NEW_PASSWORD
@@ -18453,7 +18567,7 @@ function PasswordChangeConfirmNewPassword(props) {
18453
18567
  confirmNewPassword,
18454
18568
  confirmNewPasswordError
18455
18569
  }
18456
- } = React.useContext(store$8);
18570
+ } = React.useContext(store$9);
18457
18571
  const handleBlur = React.useCallback(() => {
18458
18572
  return dispatch({
18459
18573
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18494,7 +18608,7 @@ const PasswordChangeButton = ({
18494
18608
  confirmNewPasswordError
18495
18609
  },
18496
18610
  dispatch
18497
- } = React.useContext(store$8);
18611
+ } = React.useContext(store$9);
18498
18612
  const {
18499
18613
  t
18500
18614
  } = useTranslation("passwordChange");
@@ -18560,17 +18674,17 @@ const PasswordChangeModal = ({
18560
18674
  };
18561
18675
  PasswordChangeModal.viewId = "password-change";
18562
18676
 
18563
- const initialState$7 = {
18677
+ const initialState$8 = {
18564
18678
  buttonDisabled: false,
18565
18679
  alert: {
18566
18680
  type: "error",
18567
18681
  content: ""
18568
18682
  }
18569
18683
  };
18570
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
18684
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18571
18685
  const {
18572
- Provider: Provider$7
18573
- } = store$7;
18686
+ Provider: Provider$8
18687
+ } = store$8;
18574
18688
 
18575
18689
  const CartContainer = ({
18576
18690
  style,
@@ -18661,21 +18775,21 @@ const CartContainer = ({
18661
18775
  default:
18662
18776
  return state;
18663
18777
  }
18664
- }, initialState$7);
18778
+ }, initialState$8);
18665
18779
  return /*#__PURE__*/React__default['default'].createElement("div", {
18666
18780
  style: { ...style
18667
18781
  },
18668
18782
  className: `pelcro-container pelcro-cart-container ${className}`
18669
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
18783
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18670
18784
  value: {
18671
18785
  state,
18672
18786
  dispatch
18673
18787
  }
18674
18788
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18675
- store: store$7,
18789
+ store: store$8,
18676
18790
  key: i
18677
18791
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18678
- store: store$7
18792
+ store: store$8
18679
18793
  })));
18680
18794
  };
18681
18795
 
@@ -18712,7 +18826,7 @@ const CartSubmit = ({
18712
18826
  buttonDisabled
18713
18827
  },
18714
18828
  dispatch
18715
- } = React.useContext(store$7);
18829
+ } = React.useContext(store$8);
18716
18830
  const {
18717
18831
  t
18718
18832
  } = useTranslation("cart");
@@ -18743,7 +18857,7 @@ const CartTotalPrice = () => {
18743
18857
  state: {
18744
18858
  alert
18745
18859
  }
18746
- } = React.useContext(store$7);
18860
+ } = React.useContext(store$8);
18747
18861
  const {
18748
18862
  cartItems
18749
18863
  } = usePelcro();
@@ -19056,7 +19170,7 @@ const OrderConfirmModal = props => {
19056
19170
  };
19057
19171
  OrderConfirmModal.viewId = "order-confirm";
19058
19172
 
19059
- const initialState$6 = {
19173
+ const initialState$7 = {
19060
19174
  email: "",
19061
19175
  firstName: "",
19062
19176
  lastName: "",
@@ -19068,10 +19182,10 @@ const initialState$6 = {
19068
19182
  content: ""
19069
19183
  }
19070
19184
  };
19071
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19185
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19072
19186
  const {
19073
- Provider: Provider$6
19074
- } = store$6;
19187
+ Provider: Provider$7
19188
+ } = store$7;
19075
19189
 
19076
19190
  const GiftCreateContainer = ({
19077
19191
  style,
@@ -19175,21 +19289,21 @@ const GiftCreateContainer = ({
19175
19289
  default:
19176
19290
  return state;
19177
19291
  }
19178
- }, initialState$6);
19292
+ }, initialState$7);
19179
19293
  return /*#__PURE__*/React__default['default'].createElement("div", {
19180
19294
  style: { ...style
19181
19295
  },
19182
19296
  className: `pelcro-container pelcro-gift-create-container ${className}`
19183
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19297
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19184
19298
  value: {
19185
19299
  state,
19186
19300
  dispatch
19187
19301
  }
19188
19302
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19189
- store: store$6,
19303
+ store: store$7,
19190
19304
  key: i
19191
19305
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19192
- store: store$6
19306
+ store: store$7
19193
19307
  })));
19194
19308
  };
19195
19309
 
@@ -19203,7 +19317,7 @@ const GiftCreateSubmitButton = ({
19203
19317
  state: {
19204
19318
  disableSubmit
19205
19319
  }
19206
- } = React.useContext(store$6);
19320
+ } = React.useContext(store$7);
19207
19321
  const {
19208
19322
  t
19209
19323
  } = useTranslation("register");
@@ -19220,29 +19334,29 @@ const GiftCreateSubmitButton = ({
19220
19334
 
19221
19335
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19222
19336
  initWithUserEmail: false,
19223
- store: store$6
19337
+ store: store$7
19224
19338
  }, props));
19225
19339
 
19226
19340
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19227
- store: store$6
19341
+ store: store$7
19228
19342
  }, props));
19229
19343
 
19230
19344
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19231
- store: store$6
19345
+ store: store$7
19232
19346
  }, props));
19233
19347
 
19234
- var _path$h;
19348
+ var _path$i;
19235
19349
 
19236
- 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); }
19350
+ 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); }
19237
19351
 
19238
19352
  function SvgInfoCircle(props) {
19239
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
19353
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19240
19354
  xmlns: "http://www.w3.org/2000/svg",
19241
19355
  className: "plc-w-5 plc-h-5",
19242
19356
  fill: "none",
19243
19357
  viewBox: "0 0 24 24",
19244
19358
  stroke: "currentColor"
19245
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
19359
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19246
19360
  strokeLinecap: "round",
19247
19361
  strokeLinejoin: "round",
19248
19362
  strokeWidth: 2,
@@ -19313,7 +19427,7 @@ const GiftCreateStartDate = props => {
19313
19427
  const {
19314
19428
  dispatch,
19315
19429
  state
19316
- } = React.useContext(store$6);
19430
+ } = React.useContext(store$7);
19317
19431
 
19318
19432
  const handleInputChange = value => {
19319
19433
  dispatch({
@@ -19378,13 +19492,17 @@ function TextArea({
19378
19492
  */
19379
19493
 
19380
19494
  function GiftCreateMessage(props) {
19495
+ var _ref, _state$giftMessage;
19496
+
19381
19497
  const {
19382
19498
  t
19383
19499
  } = useTranslation("register");
19384
19500
  const {
19385
19501
  dispatch,
19386
19502
  state
19387
- } = React.useContext(store$6);
19503
+ } = React.useContext(store$7);
19504
+ const MAX_CHARS_COUNT = 200;
19505
+ 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;
19388
19506
 
19389
19507
  const handleInputChange = value => {
19390
19508
  dispatch({
@@ -19402,6 +19520,9 @@ function GiftCreateMessage(props) {
19402
19520
  value: state.giftMessage,
19403
19521
  maxLength: "200",
19404
19522
  rows: 3,
19523
+ label: t("gift.labels.giftMessage", {
19524
+ count: remainingCharsCount
19525
+ }),
19405
19526
  tooltipText: t("gift.messages.giftMessageInfo")
19406
19527
  }, props));
19407
19528
  }
@@ -19451,8 +19572,7 @@ const GiftCreateView = props => {
19451
19572
  }, /*#__PURE__*/React__default['default'].createElement(GiftCreateMessage, {
19452
19573
  autoComplete: "gift-message",
19453
19574
  id: "pelcro-input-gift-message",
19454
- errorId: "pelcro-input-gift-message-error",
19455
- label: t("gift.labels.giftMessage")
19575
+ errorId: "pelcro-input-gift-message-error"
19456
19576
  })), /*#__PURE__*/React__default['default'].createElement("p", {
19457
19577
  className: "plc-text-gray-900 pelcro-footnote"
19458
19578
  }, "* ", t("gift.labels.required")), /*#__PURE__*/React__default['default'].createElement(GiftCreateSubmitButton, {
@@ -19504,7 +19624,7 @@ const GiftCreateModal = ({
19504
19624
  };
19505
19625
  GiftCreateModal.viewId = "gift-create";
19506
19626
 
19507
- const initialState$5 = {
19627
+ const initialState$6 = {
19508
19628
  giftCode: "",
19509
19629
  buttonDisabled: true,
19510
19630
  alert: {
@@ -19512,10 +19632,10 @@ const initialState$5 = {
19512
19632
  content: ""
19513
19633
  }
19514
19634
  };
19515
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19635
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19516
19636
  const {
19517
- Provider: Provider$5
19518
- } = store$5;
19637
+ Provider: Provider$6
19638
+ } = store$6;
19519
19639
 
19520
19640
  const GiftRedeemContainer = ({
19521
19641
  style,
@@ -19580,21 +19700,21 @@ const GiftRedeemContainer = ({
19580
19700
  default:
19581
19701
  return state;
19582
19702
  }
19583
- }, initialState$5);
19703
+ }, initialState$6);
19584
19704
  return /*#__PURE__*/React__default['default'].createElement("div", {
19585
19705
  style: { ...style
19586
19706
  },
19587
19707
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19588
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19708
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19589
19709
  value: {
19590
19710
  state,
19591
19711
  dispatch
19592
19712
  }
19593
19713
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19594
- store: store$5,
19714
+ store: store$6,
19595
19715
  key: i
19596
19716
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19597
- store: store$5
19717
+ store: store$6
19598
19718
  })));
19599
19719
  };
19600
19720
 
@@ -19631,7 +19751,7 @@ function GiftCode({
19631
19751
  }
19632
19752
 
19633
19753
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19634
- store: store$5
19754
+ store: store$6
19635
19755
  }, props));
19636
19756
 
19637
19757
  const GiftRedeemSubmitButton = ({
@@ -19644,7 +19764,7 @@ const GiftRedeemSubmitButton = ({
19644
19764
  state: {
19645
19765
  disableSubmit
19646
19766
  }
19647
- } = React.useContext(store$5);
19767
+ } = React.useContext(store$6);
19648
19768
  const {
19649
19769
  t
19650
19770
  } = useTranslation("register");
@@ -19737,7 +19857,7 @@ const moveDefaultAddressToStart = addresses => {
19737
19857
  return [defaultAddress, ...addressesWithoutDefault];
19738
19858
  };
19739
19859
 
19740
- const initialState$4 = {
19860
+ const initialState$5 = {
19741
19861
  addresses: [],
19742
19862
  selectedAddressId: null,
19743
19863
  isSubmitting: false,
@@ -19746,10 +19866,10 @@ const initialState$4 = {
19746
19866
  content: ""
19747
19867
  }
19748
19868
  };
19749
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
19869
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19750
19870
  const {
19751
- Provider: Provider$4
19752
- } = store$4;
19871
+ Provider: Provider$5
19872
+ } = store$5;
19753
19873
 
19754
19874
  const AddressSelectContainer = ({
19755
19875
  style,
@@ -19844,7 +19964,7 @@ const AddressSelectContainer = ({
19844
19964
  default:
19845
19965
  return state;
19846
19966
  }
19847
- }, initialState$4);
19967
+ }, initialState$5);
19848
19968
  React.useEffect(() => {
19849
19969
  var _window$Pelcro$user$r;
19850
19970
 
@@ -19857,16 +19977,16 @@ const AddressSelectContainer = ({
19857
19977
  style: { ...style
19858
19978
  },
19859
19979
  className: `pelcro-container pelcro-address-select-container ${className}`
19860
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
19980
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19861
19981
  value: {
19862
19982
  state,
19863
19983
  dispatch
19864
19984
  }
19865
19985
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19866
- store: store$4,
19986
+ store: store$5,
19867
19987
  key: i
19868
19988
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19869
- store: store$4
19989
+ store: store$5
19870
19990
  })));
19871
19991
  };
19872
19992
 
@@ -19877,7 +19997,7 @@ const AddressSelectList = () => {
19877
19997
  addresses,
19878
19998
  selectedAddressId
19879
19999
  }
19880
- } = React.useContext(store$4);
20000
+ } = React.useContext(store$5);
19881
20001
 
19882
20002
  const handleAddressSelect = event => {
19883
20003
  dispatch({
@@ -19921,7 +20041,7 @@ const AddressSelectSubmit = ({
19921
20041
  selectedAddressId,
19922
20042
  isSubmitting
19923
20043
  }
19924
- } = React.useContext(store$4);
20044
+ } = React.useContext(store$5);
19925
20045
  const {
19926
20046
  t
19927
20047
  } = useTranslation("address");
@@ -20017,7 +20137,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20017
20137
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20018
20138
  };
20019
20139
 
20020
- const initialState$3 = {
20140
+ const initialState$4 = {
20021
20141
  paymentMethods: [],
20022
20142
  selectedPaymentMethodId: null,
20023
20143
  isSubmitting: false,
@@ -20026,10 +20146,10 @@ const initialState$3 = {
20026
20146
  content: ""
20027
20147
  }
20028
20148
  };
20029
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20149
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20030
20150
  const {
20031
- Provider: Provider$3
20032
- } = store$3;
20151
+ Provider: Provider$4
20152
+ } = store$4;
20033
20153
 
20034
20154
  const PaymentMethodSelectContainer = ({
20035
20155
  style,
@@ -20074,7 +20194,7 @@ const PaymentMethodSelectContainer = ({
20074
20194
  default:
20075
20195
  return state;
20076
20196
  }
20077
- }, initialState$3);
20197
+ }, initialState$4);
20078
20198
  React.useEffect(() => {
20079
20199
  var _window$Pelcro$user$r4;
20080
20200
 
@@ -20087,16 +20207,16 @@ const PaymentMethodSelectContainer = ({
20087
20207
  style: { ...style
20088
20208
  },
20089
20209
  className: `pelcro-container pelcro-payment-select-container ${className}`
20090
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20210
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20091
20211
  value: {
20092
20212
  state,
20093
20213
  dispatch
20094
20214
  }
20095
20215
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20096
- store: store$3,
20216
+ store: store$4,
20097
20217
  key: i
20098
20218
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20099
- store: store$3
20219
+ store: store$4
20100
20220
  })));
20101
20221
  };
20102
20222
 
@@ -20110,7 +20230,7 @@ const PaymentMethodSelectList = () => {
20110
20230
  paymentMethods,
20111
20231
  selectedPaymentMethodId
20112
20232
  }
20113
- } = React.useContext(store$3);
20233
+ } = React.useContext(store$4);
20114
20234
 
20115
20235
  const handlePaymentMethodSelect = event => {
20116
20236
  dispatch({
@@ -20160,7 +20280,7 @@ const PaymentMethodSelectSubmit = ({
20160
20280
  selectedPaymentMethodId,
20161
20281
  isSubmitting
20162
20282
  }
20163
- } = React.useContext(store$3);
20283
+ } = React.useContext(store$4);
20164
20284
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20165
20285
  onClick: () => {
20166
20286
  dispatch({
@@ -20234,8 +20354,8 @@ const PaymentMethodSelectModal = ({
20234
20354
  };
20235
20355
  PaymentMethodSelectModal.viewId = "payment-method-select";
20236
20356
 
20237
- function _extends$i() {
20238
- _extends$i = Object.assign || function (target) {
20357
+ function _extends$j() {
20358
+ _extends$j = Object.assign || function (target) {
20239
20359
  for (var i = 1; i < arguments.length; i++) {
20240
20360
  var source = arguments[i];
20241
20361
 
@@ -20249,7 +20369,7 @@ function _extends$i() {
20249
20369
  return target;
20250
20370
  };
20251
20371
 
20252
- return _extends$i.apply(this, arguments);
20372
+ return _extends$j.apply(this, arguments);
20253
20373
  }
20254
20374
 
20255
20375
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20433,7 +20553,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20433
20553
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20434
20554
  return null;
20435
20555
  }, _match[RenderStrategy.Hidden] = function () {
20436
- return _render(_extends$i({}, _rest, {
20556
+ return _render(_extends$j({}, _rest, {
20437
20557
  hidden: true,
20438
20558
  style: {
20439
20559
  display: 'none'
@@ -20961,7 +21081,7 @@ function TransitionChild(props) {
20961
21081
  var passthroughProps = rest;
20962
21082
  return React__default['default'].createElement(NestingContext.Provider, {
20963
21083
  value: nesting
20964
- }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21084
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20965
21085
  }
20966
21086
 
20967
21087
  function Transition(props) {
@@ -21005,7 +21125,7 @@ function Transition(props) {
21005
21125
  value: nestingBag
21006
21126
  }, React__default['default'].createElement(TransitionContext.Provider, {
21007
21127
  value: transitionBag
21008
- }, render(_extends$i({}, sharedProps, {
21128
+ }, render(_extends$j({}, sharedProps, {
21009
21129
  as: React.Fragment,
21010
21130
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21011
21131
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21132,12 +21252,12 @@ var ActionTypes;
21132
21252
  })(ActionTypes || (ActionTypes = {}));
21133
21253
 
21134
21254
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21135
- return _extends$i({}, state, {
21255
+ return _extends$j({}, state, {
21136
21256
  activeItemIndex: null,
21137
21257
  menuState: MenuStates.Closed
21138
21258
  });
21139
21259
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21140
- return _extends$i({}, state, {
21260
+ return _extends$j({}, state, {
21141
21261
  menuState: MenuStates.Open
21142
21262
  });
21143
21263
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21156,7 +21276,7 @@ var ActionTypes;
21156
21276
  }
21157
21277
  });
21158
21278
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21159
- return _extends$i({}, state, {
21279
+ return _extends$j({}, state, {
21160
21280
  searchQuery: '',
21161
21281
  activeItemIndex: activeItemIndex
21162
21282
  });
@@ -21167,19 +21287,19 @@ var ActionTypes;
21167
21287
 
21168
21288
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21169
21289
  });
21170
- if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21290
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21171
21291
  searchQuery: searchQuery
21172
21292
  });
21173
- return _extends$i({}, state, {
21293
+ return _extends$j({}, state, {
21174
21294
  searchQuery: searchQuery,
21175
21295
  activeItemIndex: match
21176
21296
  });
21177
21297
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21178
- return _extends$i({}, state, {
21298
+ return _extends$j({}, state, {
21179
21299
  searchQuery: ''
21180
21300
  });
21181
21301
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21182
- return _extends$i({}, state, {
21302
+ return _extends$j({}, state, {
21183
21303
  items: [].concat(state.items, [{
21184
21304
  id: action.id,
21185
21305
  dataRef: action.dataRef
@@ -21192,7 +21312,7 @@ var ActionTypes;
21192
21312
  return a.id === action.id;
21193
21313
  });
21194
21314
  if (idx !== -1) nextItems.splice(idx, 1);
21195
- return _extends$i({}, state, {
21315
+ return _extends$j({}, state, {
21196
21316
  items: nextItems,
21197
21317
  activeItemIndex: function () {
21198
21318
  if (idx === state.activeItemIndex) return null;
@@ -21231,19 +21351,19 @@ var ActionTypes$1;
21231
21351
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21232
21352
  if (state.disabled) return state;
21233
21353
  if (state.listboxState === ListboxStates.Closed) return state;
21234
- return _extends$i({}, state, {
21354
+ return _extends$j({}, state, {
21235
21355
  activeOptionIndex: null,
21236
21356
  listboxState: ListboxStates.Closed
21237
21357
  });
21238
21358
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21239
21359
  if (state.disabled) return state;
21240
21360
  if (state.listboxState === ListboxStates.Open) return state;
21241
- return _extends$i({}, state, {
21361
+ return _extends$j({}, state, {
21242
21362
  listboxState: ListboxStates.Open
21243
21363
  });
21244
21364
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21245
21365
  if (state.disabled === action.disabled) return state;
21246
- return _extends$i({}, state, {
21366
+ return _extends$j({}, state, {
21247
21367
  disabled: action.disabled
21248
21368
  });
21249
21369
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21264,7 +21384,7 @@ var ActionTypes$1;
21264
21384
  }
21265
21385
  });
21266
21386
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21267
- return _extends$i({}, state, {
21387
+ return _extends$j({}, state, {
21268
21388
  searchQuery: '',
21269
21389
  activeOptionIndex: activeOptionIndex
21270
21390
  });
@@ -21277,10 +21397,10 @@ var ActionTypes$1;
21277
21397
 
21278
21398
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21279
21399
  });
21280
- if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21400
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21281
21401
  searchQuery: searchQuery
21282
21402
  });
21283
- return _extends$i({}, state, {
21403
+ return _extends$j({}, state, {
21284
21404
  searchQuery: searchQuery,
21285
21405
  activeOptionIndex: match
21286
21406
  });
@@ -21288,11 +21408,11 @@ var ActionTypes$1;
21288
21408
  if (state.disabled) return state;
21289
21409
  if (state.listboxState === ListboxStates.Closed) return state;
21290
21410
  if (state.searchQuery === '') return state;
21291
- return _extends$i({}, state, {
21411
+ return _extends$j({}, state, {
21292
21412
  searchQuery: ''
21293
21413
  });
21294
21414
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21295
- return _extends$i({}, state, {
21415
+ return _extends$j({}, state, {
21296
21416
  options: [].concat(state.options, [{
21297
21417
  id: action.id,
21298
21418
  dataRef: action.dataRef
@@ -21305,7 +21425,7 @@ var ActionTypes$1;
21305
21425
  return a.id === action.id;
21306
21426
  });
21307
21427
  if (idx !== -1) nextOptions.splice(idx, 1);
21308
- return _extends$i({}, state, {
21428
+ return _extends$j({}, state, {
21309
21429
  options: nextOptions,
21310
21430
  activeOptionIndex: function () {
21311
21431
  if (idx === state.activeOptionIndex) return null;
@@ -21366,18 +21486,18 @@ const getPaymentCardIcon = name => {
21366
21486
  }));
21367
21487
  };
21368
21488
 
21369
- var _path$g;
21489
+ var _path$h;
21370
21490
 
21371
- 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); }
21491
+ 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); }
21372
21492
 
21373
21493
  function SvgChevronRight(props) {
21374
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21494
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21375
21495
  className: "plc-w-6 plc-h-6",
21376
21496
  xmlns: "http://www.w3.org/2000/svg",
21377
21497
  fill: "none",
21378
21498
  viewBox: "0 0 24 24",
21379
21499
  stroke: "currentColor"
21380
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21500
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21381
21501
  strokeLinecap: "round",
21382
21502
  strokeLinejoin: "round",
21383
21503
  strokeWidth: 2,
@@ -21593,18 +21713,18 @@ const SavedItems = ({
21593
21713
  });
21594
21714
  };
21595
21715
 
21596
- var _path$f;
21716
+ var _path$g;
21597
21717
 
21598
- 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); }
21718
+ 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); }
21599
21719
 
21600
21720
  function SvgRefresh(props) {
21601
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21721
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21602
21722
  className: "plc-w-4 plc-h-4 plc-mr-1",
21603
21723
  xmlns: "http://www.w3.org/2000/svg",
21604
21724
  fill: "none",
21605
21725
  viewBox: "0 0 24 24",
21606
21726
  stroke: "currentColor"
21607
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21727
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21608
21728
  strokeLinecap: "round",
21609
21729
  strokeLinejoin: "round",
21610
21730
  strokeWidth: 2,
@@ -21612,35 +21732,35 @@ function SvgRefresh(props) {
21612
21732
  })));
21613
21733
  }
21614
21734
 
21615
- var _path$e;
21735
+ var _path$f;
21616
21736
 
21617
- 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); }
21737
+ 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); }
21618
21738
 
21619
21739
  function SvgCalendar(props) {
21620
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21740
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21621
21741
  xmlns: "http://www.w3.org/2000/svg",
21622
21742
  className: "plc-h-4 plc-w-4 plc-mr-1",
21623
21743
  viewBox: "0 0 20 20",
21624
21744
  fill: "currentColor"
21625
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21745
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21626
21746
  fillRule: "evenodd",
21627
21747
  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",
21628
21748
  clipRule: "evenodd"
21629
21749
  })));
21630
21750
  }
21631
21751
 
21632
- var _path$d;
21752
+ var _path$e;
21633
21753
 
21634
- 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); }
21754
+ 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); }
21635
21755
 
21636
21756
  function SvgPlus(props) {
21637
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21757
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21638
21758
  className: "plc-w-5 plc-h-5",
21639
21759
  xmlns: "http://www.w3.org/2000/svg",
21640
21760
  fill: "none",
21641
21761
  viewBox: "0 0 24 24",
21642
21762
  stroke: "currentColor"
21643
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21763
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21644
21764
  strokeLinecap: "round",
21645
21765
  strokeLinejoin: "round",
21646
21766
  strokeWidth: 2,
@@ -21648,17 +21768,17 @@ function SvgPlus(props) {
21648
21768
  })));
21649
21769
  }
21650
21770
 
21651
- var _path$c;
21771
+ var _path$d;
21652
21772
 
21653
- 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); }
21773
+ 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); }
21654
21774
 
21655
21775
  function SvgCheckMark(props) {
21656
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21776
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21657
21777
  className: "plc-w-4 plc-h-4 plc-mr-1",
21658
21778
  xmlns: "http://www.w3.org/2000/svg",
21659
21779
  viewBox: "0 0 20 20",
21660
21780
  fill: "currentColor"
21661
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21781
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21662
21782
  fillRule: "evenodd",
21663
21783
  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",
21664
21784
  clipRule: "evenodd"
@@ -21722,7 +21842,8 @@ const SubscriptionsItems = ({
21722
21842
  } = useTranslation("dashboard");
21723
21843
  const {
21724
21844
  switchView,
21725
- isAuthenticated
21845
+ switchToAddressView,
21846
+ switchToPaymentView
21726
21847
  } = usePelcro();
21727
21848
  const subs = getNonDonationSubs();
21728
21849
  if (subs.length === 0) return null;
@@ -21764,7 +21885,12 @@ const SubscriptionsItems = ({
21764
21885
  const plan = window.Pelcro.plan.getById(plan_id);
21765
21886
  setProductAndPlan(product, plan);
21766
21887
  setSubscriptionIdToRenew(sub.id);
21767
- setView("plan-select");
21888
+
21889
+ if (product.address_required) {
21890
+ return switchToAddressView();
21891
+ }
21892
+
21893
+ return switchToPaymentView();
21768
21894
  };
21769
21895
 
21770
21896
  const getPhases = () => {
@@ -21953,18 +22079,18 @@ Accordion.item = function AccordionItem({
21953
22079
  }, content)) : null;
21954
22080
  };
21955
22081
 
21956
- var _path$b;
22082
+ var _path$c;
21957
22083
 
21958
- 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); }
22084
+ 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); }
21959
22085
 
21960
22086
  function SvgExit(props) {
21961
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22087
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21962
22088
  className: "plc-w-6 plc-h-6",
21963
22089
  xmlns: "http://www.w3.org/2000/svg",
21964
22090
  fill: "none",
21965
22091
  viewBox: "0 0 24 24",
21966
22092
  stroke: "currentColor"
21967
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22093
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21968
22094
  strokeLinecap: "round",
21969
22095
  strokeLinejoin: "round",
21970
22096
  strokeWidth: 2,
@@ -21972,17 +22098,17 @@ function SvgExit(props) {
21972
22098
  })));
21973
22099
  }
21974
22100
 
21975
- var _path$a;
22101
+ var _path$b;
21976
22102
 
21977
- 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); }
22103
+ 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); }
21978
22104
 
21979
22105
  function SvgUser(props) {
21980
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22106
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
21981
22107
  xmlns: "http://www.w3.org/2000/svg",
21982
22108
  fill: "none",
21983
22109
  viewBox: "0 0 24 24",
21984
22110
  stroke: "currentColor"
21985
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22111
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
21986
22112
  strokeLinecap: "round",
21987
22113
  strokeLinejoin: "round",
21988
22114
  strokeWidth: 2,
@@ -21990,18 +22116,18 @@ function SvgUser(props) {
21990
22116
  })));
21991
22117
  }
21992
22118
 
21993
- var _path$9;
22119
+ var _path$a;
21994
22120
 
21995
- 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); }
22121
+ 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); }
21996
22122
 
21997
22123
  function SvgNewsletter(props) {
21998
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22124
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
21999
22125
  xmlns: "http://www.w3.org/2000/svg",
22000
22126
  className: "plc-h-5 plc-w-5",
22001
22127
  fill: "none",
22002
22128
  viewBox: "0 0 24 24",
22003
22129
  stroke: "currentColor"
22004
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22130
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22005
22131
  strokeLinecap: "round",
22006
22132
  strokeLinejoin: "round",
22007
22133
  strokeWidth: 2,
@@ -22009,18 +22135,18 @@ function SvgNewsletter(props) {
22009
22135
  })));
22010
22136
  }
22011
22137
 
22012
- var _path$8;
22138
+ var _path$9;
22013
22139
 
22014
- 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); }
22140
+ 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); }
22015
22141
 
22016
22142
  function SvgDocument(props) {
22017
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22143
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22018
22144
  xmlns: "http://www.w3.org/2000/svg",
22019
22145
  className: "plc-h-6 plc-w-6 plc-mr-2",
22020
22146
  fill: "none",
22021
22147
  viewBox: "0 0 24 24",
22022
22148
  stroke: "currentColor"
22023
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22149
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22024
22150
  strokeLinecap: "round",
22025
22151
  strokeLinejoin: "round",
22026
22152
  strokeWidth: 2,
@@ -22028,18 +22154,18 @@ function SvgDocument(props) {
22028
22154
  })));
22029
22155
  }
22030
22156
 
22031
- var _path$7;
22157
+ var _path$8;
22032
22158
 
22033
- 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); }
22159
+ 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); }
22034
22160
 
22035
22161
  function SvgPaymentCard(props) {
22036
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22162
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22037
22163
  className: "plc-w-6 plc-h-6 plc-mr-2",
22038
22164
  xmlns: "http://www.w3.org/2000/svg",
22039
22165
  fill: "none",
22040
22166
  viewBox: "0 0 24 24",
22041
22167
  stroke: "currentColor"
22042
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22168
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22043
22169
  strokeLinecap: "round",
22044
22170
  strokeLinejoin: "round",
22045
22171
  strokeWidth: 2,
@@ -22047,18 +22173,18 @@ function SvgPaymentCard(props) {
22047
22173
  })));
22048
22174
  }
22049
22175
 
22050
- var _path$6, _path2$1;
22176
+ var _path$7, _path2$1;
22051
22177
 
22052
- 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); }
22178
+ 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); }
22053
22179
 
22054
22180
  function SvgLocationPin(props) {
22055
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22181
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22056
22182
  className: "plc-w-6 plc-h-6 plc-mr-2",
22057
22183
  xmlns: "http://www.w3.org/2000/svg",
22058
22184
  fill: "none",
22059
22185
  viewBox: "0 0 24 24",
22060
22186
  stroke: "currentColor"
22061
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22187
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22062
22188
  strokeLinecap: "round",
22063
22189
  strokeLinejoin: "round",
22064
22190
  strokeWidth: 2,
@@ -22073,10 +22199,10 @@ function SvgLocationPin(props) {
22073
22199
 
22074
22200
  var _switch;
22075
22201
 
22076
- 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); }
22202
+ 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); }
22077
22203
 
22078
22204
  function SvgSubscription(props) {
22079
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22205
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22080
22206
  xmlns: "http://www.w3.org/2000/svg",
22081
22207
  viewBox: "0 0 100 125",
22082
22208
  fill: "currentColor"
@@ -22091,18 +22217,18 @@ function SvgSubscription(props) {
22091
22217
  }))))));
22092
22218
  }
22093
22219
 
22094
- var _path$5;
22220
+ var _path$6;
22095
22221
 
22096
- 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); }
22222
+ 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); }
22097
22223
 
22098
22224
  function SvgShopping(props) {
22099
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22225
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22100
22226
  className: "plc-w-6 plc-h-6 plc-mr-2",
22101
22227
  xmlns: "http://www.w3.org/2000/svg",
22102
22228
  fill: "none",
22103
22229
  viewBox: "0 0 24 24",
22104
22230
  stroke: "currentColor"
22105
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22231
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22106
22232
  strokeLinecap: "round",
22107
22233
  strokeLinejoin: "round",
22108
22234
  strokeWidth: 2,
@@ -22110,18 +22236,18 @@ function SvgShopping(props) {
22110
22236
  })));
22111
22237
  }
22112
22238
 
22113
- var _path$4;
22239
+ var _path$5;
22114
22240
 
22115
- 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); }
22241
+ 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); }
22116
22242
 
22117
22243
  function SvgBookmark(props) {
22118
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22244
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22119
22245
  className: "plc-w-6 plc-h-6 plc-mr-2",
22120
22246
  xmlns: "http://www.w3.org/2000/svg",
22121
22247
  fill: "none",
22122
22248
  viewBox: "0 0 24 24",
22123
22249
  stroke: "currentColor"
22124
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22250
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22125
22251
  strokeLinecap: "round",
22126
22252
  strokeLinejoin: "round",
22127
22253
  strokeWidth: 2,
@@ -22129,33 +22255,33 @@ function SvgBookmark(props) {
22129
22255
  })));
22130
22256
  }
22131
22257
 
22132
- var _path$3;
22258
+ var _path$4;
22133
22259
 
22134
- 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); }
22260
+ 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); }
22135
22261
 
22136
22262
  function SvgKey(props) {
22137
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22263
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22138
22264
  xmlns: "http://www.w3.org/2000/svg",
22139
22265
  viewBox: "0 0 20 20",
22140
22266
  fill: "currentColor"
22141
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22267
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22142
22268
  fillRule: "evenodd",
22143
22269
  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",
22144
22270
  clipRule: "evenodd"
22145
22271
  })));
22146
22272
  }
22147
22273
 
22148
- var _path$2;
22274
+ var _path$3;
22149
22275
 
22150
- 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); }
22276
+ 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); }
22151
22277
 
22152
22278
  function SvgDonate(props) {
22153
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22279
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22154
22280
  width: 24,
22155
22281
  height: 24,
22156
22282
  fill: "currentColor",
22157
22283
  xmlns: "http://www.w3.org/2000/svg"
22158
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22284
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22159
22285
  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"
22160
22286
  })));
22161
22287
  }
@@ -22224,7 +22350,7 @@ const InvoicesMenu = props => {
22224
22350
  };
22225
22351
 
22226
22352
  const InvoicesItems = () => {
22227
- var _window$Pelcro$invoic;
22353
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22228
22354
 
22229
22355
  const {
22230
22356
  t
@@ -22233,7 +22359,7 @@ const InvoicesItems = () => {
22233
22359
  setInvoice,
22234
22360
  switchView
22235
22361
  } = usePelcro();
22236
- const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22362
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22237
22363
 
22238
22364
  const showInvoiceDetails = event => {
22239
22365
  if (setInvoice(event.target.dataset.id)) {
@@ -22482,9 +22608,10 @@ class Dashboard extends React.Component {
22482
22608
  }) => {
22483
22609
  if (isGift) {
22484
22610
  this.props.setProductAndPlan(null, null, true);
22611
+ return this.props.setView("plan-select");
22485
22612
  }
22486
22613
 
22487
- return this.props.setView("plan-select");
22614
+ return this.props.setView("subscription-options");
22488
22615
  });
22489
22616
 
22490
22617
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -22909,9 +23036,9 @@ class Dashboard extends React.Component {
22909
23036
  }
22910
23037
 
22911
23038
  function hasInvoices() {
22912
- var _window$Pelcro$invoic;
23039
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22913
23040
 
22914
- const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
23041
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22915
23042
  return invoices.length > 0;
22916
23043
  }
22917
23044
 
@@ -22950,7 +23077,7 @@ const DashboardOpenButton = () => {
22950
23077
  };
22951
23078
  DashboardOpenButton.viewId = "dashboard-open";
22952
23079
 
22953
- const initialState$2 = {
23080
+ const initialState$3 = {
22954
23081
  imageSrc: null,
22955
23082
  crop: {
22956
23083
  x: 0,
@@ -22964,10 +23091,10 @@ const initialState$2 = {
22964
23091
  content: ""
22965
23092
  }
22966
23093
  };
22967
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23094
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
22968
23095
  const {
22969
- Provider: Provider$2
22970
- } = store$2;
23096
+ Provider: Provider$3
23097
+ } = store$3;
22971
23098
 
22972
23099
  const ProfilePicChangeContainer = ({
22973
23100
  style,
@@ -23101,21 +23228,21 @@ const ProfilePicChangeContainer = ({
23101
23228
  default:
23102
23229
  return state;
23103
23230
  }
23104
- }, initialState$2);
23231
+ }, initialState$3);
23105
23232
  return /*#__PURE__*/React__default['default'].createElement("div", {
23106
23233
  style: { ...style
23107
23234
  },
23108
23235
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23109
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23236
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
23110
23237
  value: {
23111
23238
  state,
23112
23239
  dispatch
23113
23240
  }
23114
23241
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
23115
- store: store$2,
23242
+ store: store$3,
23116
23243
  key: i
23117
23244
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
23118
- store: store$2
23245
+ store: store$3
23119
23246
  })));
23120
23247
  };
23121
23248
  /**
@@ -23177,7 +23304,7 @@ const ProfilePicChangeButton = ({
23177
23304
  isSubmitting
23178
23305
  },
23179
23306
  dispatch
23180
- } = React.useContext(store$2);
23307
+ } = React.useContext(store$3);
23181
23308
  const {
23182
23309
  t
23183
23310
  } = useTranslation("userEdit");
@@ -24545,7 +24672,7 @@ const ProfilePicChangeCropper = ({
24545
24672
  zoom
24546
24673
  },
24547
24674
  dispatch
24548
- } = React.useContext(store$2);
24675
+ } = React.useContext(store$3);
24549
24676
  return /*#__PURE__*/React__default['default'].createElement("div", {
24550
24677
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24551
24678
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24587,7 +24714,7 @@ const ProfilePicChangeZoom = ({
24587
24714
  zoom
24588
24715
  },
24589
24716
  dispatch
24590
- } = React.useContext(store$2);
24717
+ } = React.useContext(store$3);
24591
24718
  const {
24592
24719
  t
24593
24720
  } = useTranslation("userEdit");
@@ -24610,18 +24737,18 @@ const ProfilePicChangeZoom = ({
24610
24737
  }, otherProps)));
24611
24738
  };
24612
24739
 
24613
- var _path$1;
24740
+ var _path$2;
24614
24741
 
24615
- 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); }
24742
+ 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); }
24616
24743
 
24617
24744
  function SvgPhotograph(props) {
24618
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
24745
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
24619
24746
  xmlns: "http://www.w3.org/2000/svg",
24620
24747
  className: "plc-h-6 plc-w-6",
24621
24748
  fill: "none",
24622
24749
  viewBox: "0 0 24 24",
24623
24750
  stroke: "currentColor"
24624
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
24751
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
24625
24752
  strokeLinecap: "round",
24626
24753
  strokeLinejoin: "round",
24627
24754
  strokeWidth: 2,
@@ -24639,7 +24766,7 @@ const ProfilePicChangeSelectButton = ({
24639
24766
  state: {
24640
24767
  isSubmitting
24641
24768
  }
24642
- } = React.useContext(store$2);
24769
+ } = React.useContext(store$3);
24643
24770
  const {
24644
24771
  t
24645
24772
  } = useTranslation("userEdit");
@@ -24681,7 +24808,7 @@ const ProfilePicChangeRemoveButton = ({
24681
24808
  state: {
24682
24809
  isSubmitting
24683
24810
  }
24684
- } = React.useContext(store$2);
24811
+ } = React.useContext(store$3);
24685
24812
  const {
24686
24813
  t
24687
24814
  } = useTranslation("userEdit");
@@ -24704,7 +24831,7 @@ const ProfilePicChangeWrapper = () => {
24704
24831
  state: {
24705
24832
  imageSrc
24706
24833
  }
24707
- } = React.useContext(store$2);
24834
+ } = React.useContext(store$3);
24708
24835
  const {
24709
24836
  t
24710
24837
  } = useTranslation("userEdit");
@@ -24766,17 +24893,17 @@ function ProfilePicChangeModal({
24766
24893
  }
24767
24894
  ProfilePicChangeModal.viewId = "profile-picture";
24768
24895
 
24769
- const initialState$1 = {
24896
+ const initialState$2 = {
24770
24897
  isSubmitting: false,
24771
24898
  alert: {
24772
24899
  type: "error",
24773
24900
  content: ""
24774
24901
  }
24775
24902
  };
24776
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
24903
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
24777
24904
  const {
24778
- Provider: Provider$1
24779
- } = store$1;
24905
+ Provider: Provider$2
24906
+ } = store$2;
24780
24907
 
24781
24908
  const EmailVerifyContainer = ({
24782
24909
  style,
@@ -24839,21 +24966,21 @@ const EmailVerifyContainer = ({
24839
24966
  default:
24840
24967
  return state;
24841
24968
  }
24842
- }, initialState$1);
24969
+ }, initialState$2);
24843
24970
  return /*#__PURE__*/React__default['default'].createElement("div", {
24844
24971
  style: { ...style
24845
24972
  },
24846
24973
  className: `pelcro-container pelcro-email-verify-container ${className}`
24847
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
24974
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
24848
24975
  value: {
24849
24976
  state,
24850
24977
  dispatch
24851
24978
  }
24852
24979
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24853
- store: store$1,
24980
+ store: store$2,
24854
24981
  key: i
24855
24982
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24856
- store: store$1
24983
+ store: store$2
24857
24984
  })));
24858
24985
  };
24859
24986
 
@@ -24867,7 +24994,7 @@ const EmailVerifyResendButton = ({
24867
24994
  state: {
24868
24995
  isSubmitting
24869
24996
  }
24870
- } = React.useContext(store$1);
24997
+ } = React.useContext(store$2);
24871
24998
  const {
24872
24999
  t
24873
25000
  } = useTranslation("verifyEmail");
@@ -24882,16 +25009,16 @@ const EmailVerifyResendButton = ({
24882
25009
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
24883
25010
  };
24884
25011
 
24885
- var _path, _path2;
25012
+ var _path$1, _path2;
24886
25013
 
24887
- 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); }
25014
+ 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); }
24888
25015
 
24889
25016
  function SvgEmailVerify(props) {
24890
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25017
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
24891
25018
  className: "plc-w-6 plc-h-6",
24892
25019
  viewBox: "0 0 700 700",
24893
25020
  xmlns: "http://www.w3.org/2000/svg"
24894
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25021
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
24895
25022
  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"
24896
25023
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
24897
25024
  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"
@@ -24995,11 +25122,11 @@ const invoicePaymentSubmitButton = props => {
24995
25122
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
24996
25123
  };
24997
25124
 
24998
- const initialState = {};
24999
- const store = /*#__PURE__*/React.createContext(initialState);
25125
+ const initialState$1 = {};
25126
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25000
25127
  const {
25001
- Provider
25002
- } = store;
25128
+ Provider: Provider$1
25129
+ } = store$1;
25003
25130
 
25004
25131
  const InvoiceDetailsContainer = ({
25005
25132
  style,
@@ -25020,21 +25147,21 @@ const InvoiceDetailsContainer = ({
25020
25147
  default:
25021
25148
  return state;
25022
25149
  }
25023
- }, initialState);
25150
+ }, initialState$1);
25024
25151
  return /*#__PURE__*/React__default['default'].createElement("div", {
25025
25152
  style: { ...style
25026
25153
  },
25027
25154
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25028
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25155
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25029
25156
  value: {
25030
25157
  state,
25031
25158
  dispatch
25032
25159
  }
25033
25160
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25034
- store,
25161
+ store: store$1,
25035
25162
  key: i
25036
25163
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25037
- store
25164
+ store: store$1
25038
25165
  })));
25039
25166
  };
25040
25167
 
@@ -25066,7 +25193,7 @@ const InvoiceDetailsPayButton = ({
25066
25193
  }) => {
25067
25194
  const {
25068
25195
  dispatch
25069
- } = React.useContext(store);
25196
+ } = React.useContext(store$1);
25070
25197
  const {
25071
25198
  t
25072
25199
  } = useTranslation("invoiceDetails");
@@ -25106,11 +25233,11 @@ const InvoiceDetailsView = props => {
25106
25233
  }, t("labels.summary")), invoice && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
25107
25234
  className: "plc-mr-2 pelcro-invoice-creation-date"
25108
25235
  }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default['default'].createElement("div", {
25109
- 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-evenly pelcro-invoice-plan-wrapper"
25236
+ 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"
25110
25237
  }, /*#__PURE__*/React__default['default'].createElement("div", {
25111
- className: "plc-w-1/2 plc-break-words pelcro-invoice-plan-name"
25238
+ className: "plc-break-words pelcro-invoice-plan-name"
25112
25239
  }, invoice.plan.nickname), /*#__PURE__*/React__default['default'].createElement("div", {
25113
- className: "plc-w-1/5 plc-text-center pelcro-invoice-summary-price"
25240
+ className: "plc-text-center pelcro-invoice-summary-price"
25114
25241
  }, calcAndFormatItemsTotal([invoice.plan], invoice.currency))), /*#__PURE__*/React__default['default'].createElement("div", {
25115
25242
  className: "plc-flex plc-justify-end plc-pt-2 plc-mt-2 plc-font-bold plc-border-t plc-border-gray-400 pelcro-invoice-total-wrapper"
25116
25243
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -25171,6 +25298,232 @@ const InvoiceDetailsModal = ({
25171
25298
  };
25172
25299
  InvoiceDetailsModal.viewId = "invoice-details";
25173
25300
 
25301
+ const initialState = {
25302
+ selectedOption: ""
25303
+ };
25304
+ const store = /*#__PURE__*/React.createContext(initialState);
25305
+ const {
25306
+ Provider
25307
+ } = store;
25308
+
25309
+ const SubscriptionOptionsContainer = ({
25310
+ style,
25311
+ className = "",
25312
+ onRenewSubSuccess = () => {},
25313
+ onNewSubSuccess = () => {},
25314
+ children,
25315
+ ...props
25316
+ }) => {
25317
+ const submit = ({
25318
+ selectedOption
25319
+ }, dispatch) => {
25320
+ if (selectedOption === "renew") return onRenewSubSuccess();
25321
+ if (selectedOption === "new") return onNewSubSuccess();
25322
+ };
25323
+
25324
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25325
+ switch (action.type) {
25326
+ case SWITCH_TO_NEW:
25327
+ return lib_7({ ...state,
25328
+ selectedOption: "new"
25329
+ });
25330
+
25331
+ case SWITCH_TO_RENEW:
25332
+ return lib_7({ ...state,
25333
+ selectedOption: "renew"
25334
+ });
25335
+
25336
+ case HANDLE_SUBMIT:
25337
+ return lib_4((state, dispatch) => submit(state));
25338
+
25339
+ default:
25340
+ return state;
25341
+ }
25342
+ }, initialState);
25343
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25344
+ style: { ...style
25345
+ },
25346
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25347
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25348
+ value: {
25349
+ state,
25350
+ dispatch
25351
+ }
25352
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25353
+ store,
25354
+ key: i
25355
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25356
+ store
25357
+ })));
25358
+ };
25359
+
25360
+ var _path;
25361
+
25362
+ 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); }
25363
+
25364
+ function SvgPlusCircle(props) {
25365
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25366
+ xmlns: "http://www.w3.org/2000/svg",
25367
+ className: "plc-h-6 plc-w-6",
25368
+ fill: "none",
25369
+ viewBox: "0 0 24 24",
25370
+ stroke: "currentColor",
25371
+ strokeWidth: 2
25372
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25373
+ strokeLinecap: "round",
25374
+ strokeLinejoin: "round",
25375
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25376
+ })));
25377
+ }
25378
+
25379
+ const SubscriptionOptionsNewButton = ({
25380
+ name,
25381
+ onClick,
25382
+ ...otherProps
25383
+ }) => {
25384
+ const {
25385
+ dispatch,
25386
+ state: {
25387
+ selectedOption
25388
+ }
25389
+ } = React.useContext(store);
25390
+ const {
25391
+ t
25392
+ } = useTranslation("subscriptionOptions");
25393
+ const isChecked = selectedOption === "new";
25394
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25395
+ className: "plc-hidden pelcro-new-sub-option",
25396
+ 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"}`,
25397
+ id: "pelcro-new-sub-option",
25398
+ name: "option",
25399
+ onChange: () => {
25400
+ dispatch({
25401
+ type: SWITCH_TO_NEW
25402
+ });
25403
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25404
+ },
25405
+ checked: isChecked
25406
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25407
+ className: "plc-w-full plc-h-full plc-mr-0"
25408
+ }));
25409
+ };
25410
+
25411
+ const SubscriptionOptionsRenewButton = ({
25412
+ name,
25413
+ onClick,
25414
+ ...otherProps
25415
+ }) => {
25416
+ const {
25417
+ dispatch,
25418
+ state: {
25419
+ selectedOption
25420
+ }
25421
+ } = React.useContext(store);
25422
+ const {
25423
+ t
25424
+ } = useTranslation("subscriptionOptions");
25425
+ const isChecked = selectedOption === "renew";
25426
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25427
+ className: "plc-hidden pelcro-renew-sub-option",
25428
+ 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"}`,
25429
+ id: "pelcro-renew-sub-option",
25430
+ name: "option",
25431
+ onChange: () => {
25432
+ dispatch({
25433
+ type: SWITCH_TO_RENEW
25434
+ });
25435
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25436
+ },
25437
+ checked: isChecked
25438
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
25439
+ className: "plc-w-full plc-h-full plc-mr-0"
25440
+ }));
25441
+ };
25442
+
25443
+ const SubscriptionOptionsSubmit = ({
25444
+ name,
25445
+ onClick,
25446
+ ...otherProps
25447
+ }) => {
25448
+ const {
25449
+ dispatch,
25450
+ state: {
25451
+ selectedOption
25452
+ }
25453
+ } = React.useContext(store);
25454
+ const {
25455
+ t
25456
+ } = useTranslation("subscriptionOptions");
25457
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25458
+ onClick: () => {
25459
+ dispatch({
25460
+ type: HANDLE_SUBMIT
25461
+ });
25462
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25463
+ },
25464
+ disabled: !selectedOption
25465
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25466
+ };
25467
+
25468
+ const SubscriptionOptionsView = props => {
25469
+ const {
25470
+ t
25471
+ } = useTranslation("subscriptionOptions");
25472
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25473
+ id: "pelcro-subscription-options-view"
25474
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25475
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25476
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
25477
+ className: "plc-text-2xl plc-font-semibold"
25478
+ }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
25479
+ action: "javascript:void(0);",
25480
+ className: "plc-mt-2 pelcro-form"
25481
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25482
+ className: "plc-flex plc-justify-between plc-items-center"
25483
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
25484
+ role: "submit",
25485
+ className: "plc-mt-4 plc-w-full",
25486
+ name: t("next"),
25487
+ id: "pelcro-submit"
25488
+ }))));
25489
+ };
25490
+
25491
+ const SubscriptionOptionsModal = ({
25492
+ onDisplay,
25493
+ onClose,
25494
+ ...otherProps
25495
+ }) => {
25496
+ const {
25497
+ switchView,
25498
+ setProductsList
25499
+ } = usePelcro();
25500
+
25501
+ const onRenewSubSuccess = () => {
25502
+ var _otherProps$onRenewSu;
25503
+
25504
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
25505
+ setProductsList(getRenewableProducts());
25506
+ switchView("_plan-select-renew");
25507
+ };
25508
+
25509
+ const onNewSubSuccess = () => {
25510
+ var _otherProps$onNewSubS;
25511
+
25512
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
25513
+ switchView("plan-select");
25514
+ };
25515
+
25516
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
25517
+ onDisplay: onDisplay,
25518
+ onClose: onClose,
25519
+ id: "pelcro-subscription-options-modal"
25520
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
25521
+ onNewSubSuccess: onNewSubSuccess,
25522
+ onRenewSubSuccess: onRenewSubSuccess
25523
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
25524
+ };
25525
+ SubscriptionOptionsModal.viewId = "subscription-options";
25526
+
25174
25527
  exports.AddressCreateCity = AddressCreateCity;
25175
25528
  exports.AddressCreateContainer = AddressCreateContainer;
25176
25529
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -25348,6 +25701,12 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
25348
25701
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
25349
25702
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
25350
25703
  exports.SubscriptionCreateView = SubscriptionCreateView;
25704
+ exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
25705
+ exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
25706
+ exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
25707
+ exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
25708
+ exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
25709
+ exports.SubscriptionOptionsView = SubscriptionOptionsView;
25351
25710
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
25352
25711
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
25353
25712
  exports.SubscriptionRenewView = SubscriptionRenewView;