@pelcro/react-pelcro-js 3.2.0-beta.3 → 3.2.0-beta.6

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
  };
@@ -3765,8 +3765,8 @@ var login_fr = {
3765
3765
  errors: errors$4
3766
3766
  };
3767
3767
 
3768
- var title$d = "Create an account";
3769
- 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";
3770
3770
  var labels$h = {
3771
3771
  signUpFacebook: "Sign up with Facebook",
3772
3772
  signUpGoogle: "Sign up with Google",
@@ -3851,8 +3851,8 @@ var redeem$1 = {
3851
3851
  }
3852
3852
  };
3853
3853
  var register_en = {
3854
- title: title$d,
3855
- subtitle: subtitle$5,
3854
+ title: title$f,
3855
+ subtitle: subtitle$7,
3856
3856
  labels: labels$h,
3857
3857
  messages: messages$h,
3858
3858
  errors: errors$3,
@@ -3860,8 +3860,8 @@ var register_en = {
3860
3860
  redeem: redeem$1
3861
3861
  };
3862
3862
 
3863
- var title$c = "Créer un compte";
3864
- 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";
3865
3865
  var labels$g = {
3866
3866
  signUpFacebook: "Inscrivez-vous avec Facebook",
3867
3867
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3947,8 +3947,8 @@ var redeem = {
3947
3947
  }
3948
3948
  };
3949
3949
  var register_fr = {
3950
- title: title$c,
3951
- subtitle: subtitle$4,
3950
+ title: title$e,
3951
+ subtitle: subtitle$6,
3952
3952
  labels: labels$g,
3953
3953
  messages: messages$g,
3954
3954
  errors: errors$2,
@@ -4008,7 +4008,7 @@ var userEdit_fr = {
4008
4008
  messages: messages$e
4009
4009
  };
4010
4010
 
4011
- var title$b = "Enter your shipping address";
4011
+ var title$d = "Enter your shipping address";
4012
4012
  var selectAddressTitle$1 = "Please select an address";
4013
4013
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
4014
4014
  var labels$d = {
@@ -4031,7 +4031,7 @@ var messages$d = {
4031
4031
  subRedeemed: "Your subscription has been redeemed."
4032
4032
  };
4033
4033
  var address_en = {
4034
- title: title$b,
4034
+ title: title$d,
4035
4035
  selectAddressTitle: selectAddressTitle$1,
4036
4036
  selectAddressSubtitle: selectAddressSubtitle$1,
4037
4037
  labels: labels$d,
@@ -4039,7 +4039,7 @@ var address_en = {
4039
4039
  messages: messages$d
4040
4040
  };
4041
4041
 
4042
- var title$a = "Entrez votre adresse de livraison";
4042
+ var title$c = "Entrez votre adresse de livraison";
4043
4043
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4044
4044
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4045
4045
  var labels$c = {
@@ -4062,7 +4062,7 @@ var messages$c = {
4062
4062
  subRedeemed: "Votre abonnement a bien été activé."
4063
4063
  };
4064
4064
  var address_fr = {
4065
- title: title$a,
4065
+ title: title$c,
4066
4066
  selectAddressTitle: selectAddressTitle,
4067
4067
  selectAddressSubtitle: selectAddressSubtitle,
4068
4068
  labels: labels$c,
@@ -4070,8 +4070,8 @@ var address_fr = {
4070
4070
  messages: messages$c
4071
4071
  };
4072
4072
 
4073
- var title$9 = "Reset your password";
4074
- var subtitle$3 = "Enter a new password below";
4073
+ var title$b = "Reset your password";
4074
+ var subtitle$5 = "Enter a new password below";
4075
4075
  var email$3 = "Email";
4076
4076
  var password$3 = "Password";
4077
4077
  var confirmPassword$1 = "Confirm password";
@@ -4079,8 +4079,8 @@ var submit$5 = "Submit";
4079
4079
  var required$5 = "Required";
4080
4080
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4081
4081
  var passwordReset_en = {
4082
- title: title$9,
4083
- subtitle: subtitle$3,
4082
+ title: title$b,
4083
+ subtitle: subtitle$5,
4084
4084
  email: email$3,
4085
4085
  password: password$3,
4086
4086
  confirmPassword: confirmPassword$1,
@@ -4089,8 +4089,8 @@ var passwordReset_en = {
4089
4089
  passwordUpdated: passwordUpdated$1
4090
4090
  };
4091
4091
 
4092
- var title$8 = "Réinitialiser votre mot de passe";
4093
- 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";
4094
4094
  var email$2 = "Adresse courriel";
4095
4095
  var password$2 = "Mot de passe";
4096
4096
  var confirmPassword = "Confirmer le mot de passe";
@@ -4098,8 +4098,8 @@ var submit$4 = "Soumettre";
4098
4098
  var required$4 = "Champs obligatoires";
4099
4099
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4100
4100
  var passwordReset_fr = {
4101
- title: title$8,
4102
- subtitle: subtitle$2,
4101
+ title: title$a,
4102
+ subtitle: subtitle$4,
4103
4103
  email: email$2,
4104
4104
  password: password$2,
4105
4105
  confirmPassword: confirmPassword,
@@ -4108,7 +4108,7 @@ var passwordReset_fr = {
4108
4108
  passwordUpdated: passwordUpdated
4109
4109
  };
4110
4110
 
4111
- var title$7 = "Forgot your password?";
4111
+ var title$9 = "Forgot your password?";
4112
4112
  var email$1 = "Email";
4113
4113
  var password$1 = "Password";
4114
4114
  var submit$3 = "Submit";
@@ -4119,7 +4119,7 @@ var messages$b = {
4119
4119
  loginHere: "login here."
4120
4120
  };
4121
4121
  var passwordForgot_en = {
4122
- title: title$7,
4122
+ title: title$9,
4123
4123
  email: email$1,
4124
4124
  password: password$1,
4125
4125
  submit: submit$3,
@@ -4128,7 +4128,7 @@ var passwordForgot_en = {
4128
4128
  messages: messages$b
4129
4129
  };
4130
4130
 
4131
- var title$6 = "Mot de passe oublié ?";
4131
+ var title$8 = "Mot de passe oublié ?";
4132
4132
  var email = "Courriel";
4133
4133
  var password = "Mot de passe";
4134
4134
  var submit$2 = "Soumettre";
@@ -4139,7 +4139,7 @@ var messages$a = {
4139
4139
  loginHere: "Connectez-vous ici"
4140
4140
  };
4141
4141
  var passwordForgot_fr = {
4142
- title: title$6,
4142
+ title: title$8,
4143
4143
  email: email,
4144
4144
  password: password,
4145
4145
  submit: submit$2,
@@ -4148,7 +4148,7 @@ var passwordForgot_fr = {
4148
4148
  messages: messages$a
4149
4149
  };
4150
4150
 
4151
- var title$5 = "Change your password";
4151
+ var title$7 = "Change your password";
4152
4152
  var currentPassword$1 = "Current password";
4153
4153
  var newPassword$1 = "New password";
4154
4154
  var confirmNewPassword$1 = "Confirm new password";
@@ -4158,7 +4158,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4158
4158
  var passwordsNotMatching$1 = "Passwords don't match";
4159
4159
  var weakPassword$1 = "Your password must contain at least 6 characters";
4160
4160
  var passwordChange_en = {
4161
- title: title$5,
4161
+ title: title$7,
4162
4162
  currentPassword: currentPassword$1,
4163
4163
  newPassword: newPassword$1,
4164
4164
  confirmNewPassword: confirmNewPassword$1,
@@ -4169,7 +4169,7 @@ var passwordChange_en = {
4169
4169
  weakPassword: weakPassword$1
4170
4170
  };
4171
4171
 
4172
- var title$4 = "Changez votre mot de passe";
4172
+ var title$6 = "Changez votre mot de passe";
4173
4173
  var currentPassword = "Mot de passe actuel";
4174
4174
  var newPassword = "Nouveau mot de passe";
4175
4175
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4179,7 +4179,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4179
4179
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4180
4180
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4181
4181
  var passwordChange_fr = {
4182
- title: title$4,
4182
+ title: title$6,
4183
4183
  currentPassword: currentPassword,
4184
4184
  newPassword: newPassword,
4185
4185
  confirmNewPassword: confirmNewPassword,
@@ -4190,8 +4190,8 @@ var passwordChange_fr = {
4190
4190
  weakPassword: weakPassword
4191
4191
  };
4192
4192
 
4193
- var title$3 = "Votre panier";
4194
- var subtitle$1 = "Terminez votre achat ci-dessous";
4193
+ var title$5 = "Votre panier";
4194
+ var subtitle$3 = "Terminez votre achat ci-dessous";
4195
4195
  var name$1 = "Produit";
4196
4196
  var quantity$1 = "Quantité";
4197
4197
  var price$1 = "Prix";
@@ -4202,8 +4202,8 @@ var confirm$3 = "Passer à la caisse";
4202
4202
  var empty$1 = "Votre panier est vide.";
4203
4203
  var removeAll$1 = "Vider";
4204
4204
  var cart_fr = {
4205
- title: title$3,
4206
- subtitle: subtitle$1,
4205
+ title: title$5,
4206
+ subtitle: subtitle$3,
4207
4207
  name: name$1,
4208
4208
  quantity: quantity$1,
4209
4209
  price: price$1,
@@ -4215,8 +4215,8 @@ var cart_fr = {
4215
4215
  removeAll: removeAll$1
4216
4216
  };
4217
4217
 
4218
- var title$2 = "Your shopping cart";
4219
- var subtitle = "Comple your purchase below";
4218
+ var title$4 = "Your shopping cart";
4219
+ var subtitle$2 = "Comple your purchase below";
4220
4220
  var name = "Name";
4221
4221
  var quantity = "Quantity";
4222
4222
  var price = "Price";
@@ -4227,8 +4227,8 @@ var confirm$2 = "Checkout";
4227
4227
  var empty = "Your cart is empty.";
4228
4228
  var removeAll = "Remove all";
4229
4229
  var cart_en = {
4230
- title: title$2,
4231
- subtitle: subtitle,
4230
+ title: title$4,
4231
+ subtitle: subtitle$2,
4232
4232
  name: name,
4233
4233
  quantity: quantity,
4234
4234
  price: price,
@@ -4666,7 +4666,7 @@ var verifyEmail_fr = {
4666
4666
  messages: messages
4667
4667
  };
4668
4668
 
4669
- var title$1 = "Invoice details";
4669
+ var title$3 = "Invoice details";
4670
4670
  var labels$1 = {
4671
4671
  summary: "Summary",
4672
4672
  total: "Total",
@@ -4679,12 +4679,12 @@ var buttons$1 = {
4679
4679
  pay: "Pay now"
4680
4680
  };
4681
4681
  var invoiceDetails_en = {
4682
- title: title$1,
4682
+ title: title$3,
4683
4683
  labels: labels$1,
4684
4684
  buttons: buttons$1
4685
4685
  };
4686
4686
 
4687
- var title = "Invoice details";
4687
+ var title$2 = "Invoice details";
4688
4688
  var labels = {
4689
4689
  summary: "Summary",
4690
4690
  total: "Total",
@@ -4697,11 +4697,37 @@ var buttons = {
4697
4697
  pay: "Pay now"
4698
4698
  };
4699
4699
  var invoiceDetails_fr = {
4700
- title: title,
4700
+ title: title$2,
4701
4701
  labels: labels,
4702
4702
  buttons: buttons
4703
4703
  };
4704
4704
 
4705
+ var title$1 = "Renewal options";
4706
+ var subtitle$1 = "Select one of the options below to continue";
4707
+ var next$1 = "Next";
4708
+ var addNew$1 = "Add Another Subscription";
4709
+ var renew$1 = "Renew Existing Subscription";
4710
+ var subscriptionOptions_en = {
4711
+ title: title$1,
4712
+ subtitle: subtitle$1,
4713
+ next: next$1,
4714
+ addNew: addNew$1,
4715
+ renew: renew$1
4716
+ };
4717
+
4718
+ var title = "Renewal options";
4719
+ var subtitle = "Select one of the options below to continue";
4720
+ var next = "Next";
4721
+ var addNew = "Add Another Subscription";
4722
+ var renew = "Renew Existing Subscription";
4723
+ var subscriptionOptions_fr = {
4724
+ title: title,
4725
+ subtitle: subtitle,
4726
+ next: next,
4727
+ addNew: addNew,
4728
+ renew: renew
4729
+ };
4730
+
4705
4731
  function create$1(createState) {
4706
4732
  let state;
4707
4733
  const listeners = new Set();
@@ -6051,7 +6077,7 @@ class PelcroActions {
6051
6077
  view,
6052
6078
  cartItems,
6053
6079
  ...otherStateFields
6054
- } = initialState$i;
6080
+ } = initialState$j;
6055
6081
  this.set(otherStateFields);
6056
6082
  });
6057
6083
 
@@ -6075,6 +6101,16 @@ class PelcroActions {
6075
6101
  });
6076
6102
  }
6077
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
+
6078
6114
  this.set({
6079
6115
  view
6080
6116
  });
@@ -6149,6 +6185,26 @@ class PelcroActions {
6149
6185
  }
6150
6186
  });
6151
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
+
6152
6208
  _defineProperty$3(this, "setProduct", id => {
6153
6209
  const product = window.Pelcro.product.getById(id);
6154
6210
  if (!product) return console.error("invalid product id");
@@ -6370,10 +6426,12 @@ class PelcroCallbacks {
6370
6426
 
6371
6427
  }
6372
6428
 
6373
- const initialState$i = {
6429
+ var _window$Pelcro$produc, _window$Pelcro;
6430
+ const initialState$j = {
6374
6431
  // View
6375
6432
  view: null,
6376
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 : [],
6377
6435
  product: null,
6378
6436
  plan: null,
6379
6437
  isGift: false,
@@ -6400,7 +6458,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6400
6458
  return {
6401
6459
  // Store setter
6402
6460
  set,
6403
- ...initialState$i,
6461
+ ...initialState$j,
6404
6462
  // State actions
6405
6463
  ...actions,
6406
6464
  // Callbacks
@@ -6755,6 +6813,30 @@ function userMustVerifyEmail() {
6755
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;
6756
6814
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6757
6815
  }
6816
+ function getRenewableProducts() {
6817
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2;
6818
+
6819
+ const renewableSubs = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription.list()) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : _window$Pelcro$subscr2.filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
6820
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6821
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6822
+ const {
6823
+ productsList
6824
+ } = usePelcro.getStore();
6825
+ return productsList.map(product => {
6826
+ if (renewableProductsIds.includes(product.id)) {
6827
+ const renewablePlans = getRenewablePlansOnly(product);
6828
+ return { ...product,
6829
+ plans: renewablePlans
6830
+ };
6831
+ }
6832
+ }).filter(product => product);
6833
+
6834
+ function getRenewablePlansOnly(product) {
6835
+ var _product$plans$filter, _product$plans;
6836
+
6837
+ return (_product$plans$filter = product === null || product === void 0 ? void 0 : (_product$plans = product.plans) === null || _product$plans === void 0 ? void 0 : _product$plans.filter(plan => renewablePlansIds.includes(plan.id))) !== null && _product$plans$filter !== void 0 ? _product$plans$filter : [];
6838
+ }
6839
+ }
6758
6840
 
6759
6841
  const resources = {
6760
6842
  en: {
@@ -6779,7 +6861,8 @@ const resources = {
6779
6861
  dashboard: dashboard_en,
6780
6862
  select: select_en,
6781
6863
  notification: notification_en,
6782
- invoiceDetails: invoiceDetails_en
6864
+ invoiceDetails: invoiceDetails_en,
6865
+ subscriptionOptions: subscriptionOptions_en
6783
6866
  },
6784
6867
  fr: {
6785
6868
  common: common_fr,
@@ -6803,7 +6886,8 @@ const resources = {
6803
6886
  dashboard: dashboard_fr,
6804
6887
  select: select_fr,
6805
6888
  notification: notification_fr,
6806
- invoiceDetails: invoiceDetails_fr
6889
+ invoiceDetails: invoiceDetails_fr,
6890
+ subscriptionOptions: subscriptionOptions_fr
6807
6891
  }
6808
6892
  }; // set UI language to the page language or default to the language in site settings
6809
6893
 
@@ -7094,8 +7178,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7094
7178
 
7095
7179
  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}}
7096
7180
 
7097
- function _extends$z() {
7098
- _extends$z = Object.assign || function (target) {
7181
+ function _extends$A() {
7182
+ _extends$A = Object.assign || function (target) {
7099
7183
  for (var i = 1; i < arguments.length; i++) {
7100
7184
  var source = arguments[i];
7101
7185
 
@@ -7109,7 +7193,7 @@ function _extends$z() {
7109
7193
  return target;
7110
7194
  };
7111
7195
 
7112
- return _extends$z.apply(this, arguments);
7196
+ return _extends$A.apply(this, arguments);
7113
7197
  }
7114
7198
 
7115
7199
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7199,7 +7283,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7199
7283
  var reducer = function reducer(state, action) {
7200
7284
  switch (action.type) {
7201
7285
  case ActionType.ADD_TOAST:
7202
- return _extends$z({}, state, {
7286
+ return _extends$A({}, state, {
7203
7287
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7204
7288
  });
7205
7289
 
@@ -7209,9 +7293,9 @@ var reducer = function reducer(state, action) {
7209
7293
  clearFromRemoveQueue(action.toast.id);
7210
7294
  }
7211
7295
 
7212
- return _extends$z({}, state, {
7296
+ return _extends$A({}, state, {
7213
7297
  toasts: state.toasts.map(function (t) {
7214
- return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7298
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7215
7299
  })
7216
7300
  });
7217
7301
 
@@ -7238,9 +7322,9 @@ var reducer = function reducer(state, action) {
7238
7322
  });
7239
7323
  }
7240
7324
 
7241
- return _extends$z({}, state, {
7325
+ return _extends$A({}, state, {
7242
7326
  toasts: state.toasts.map(function (t) {
7243
- return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7327
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7244
7328
  visible: false
7245
7329
  }) : t;
7246
7330
  })
@@ -7248,28 +7332,28 @@ var reducer = function reducer(state, action) {
7248
7332
 
7249
7333
  case ActionType.REMOVE_TOAST:
7250
7334
  if (action.toastId === undefined) {
7251
- return _extends$z({}, state, {
7335
+ return _extends$A({}, state, {
7252
7336
  toasts: []
7253
7337
  });
7254
7338
  }
7255
7339
 
7256
- return _extends$z({}, state, {
7340
+ return _extends$A({}, state, {
7257
7341
  toasts: state.toasts.filter(function (t) {
7258
7342
  return t.id !== action.toastId;
7259
7343
  })
7260
7344
  });
7261
7345
 
7262
7346
  case ActionType.START_PAUSE:
7263
- return _extends$z({}, state, {
7347
+ return _extends$A({}, state, {
7264
7348
  pausedAt: action.time
7265
7349
  });
7266
7350
 
7267
7351
  case ActionType.END_PAUSE:
7268
7352
  var diff = action.time - (state.pausedAt || 0);
7269
- return _extends$z({}, state, {
7353
+ return _extends$A({}, state, {
7270
7354
  pausedAt: undefined,
7271
7355
  toasts: state.toasts.map(function (t) {
7272
- return _extends$z({}, t, {
7356
+ return _extends$A({}, t, {
7273
7357
  pauseDuration: t.pauseDuration + diff
7274
7358
  });
7275
7359
  })
@@ -7316,12 +7400,12 @@ var useStore = function useStore(toastOptions) {
7316
7400
  var mergedToasts = state.toasts.map(function (t) {
7317
7401
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7318
7402
 
7319
- return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7403
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7320
7404
  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],
7321
- style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7405
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7322
7406
  });
7323
7407
  });
7324
- return _extends$z({}, state, {
7408
+ return _extends$A({}, state, {
7325
7409
  toasts: mergedToasts
7326
7410
  });
7327
7411
  };
@@ -7331,7 +7415,7 @@ var createToast = function createToast(message, type, opts) {
7331
7415
  type = 'blank';
7332
7416
  }
7333
7417
 
7334
- return _extends$z({
7418
+ return _extends$A({
7335
7419
  createdAt: Date.now(),
7336
7420
  visible: true,
7337
7421
  type: type,
@@ -7381,14 +7465,14 @@ toast.remove = function (toastId) {
7381
7465
  };
7382
7466
 
7383
7467
  toast.promise = function (promise, msgs, opts) {
7384
- var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7468
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7385
7469
  promise.then(function (p) {
7386
- toast.success(resolveValue(msgs.success, p), _extends$z({
7470
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7387
7471
  id: id
7388
7472
  }, opts, opts == null ? void 0 : opts.success));
7389
7473
  return p;
7390
7474
  })["catch"](function (e) {
7391
- toast.error(resolveValue(msgs.error, e), _extends$z({
7475
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7392
7476
  id: id
7393
7477
  }, opts, opts == null ? void 0 : opts.error));
7394
7478
  });
@@ -7727,7 +7811,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7727
7811
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7728
7812
  return React.createElement(ToastBarBase, {
7729
7813
  className: toast.className,
7730
- style: _extends$z({}, animationStyle, style, toast.style)
7814
+ style: _extends$A({}, animationStyle, style, toast.style)
7731
7815
  }, typeof children === 'function' ? children({
7732
7816
  icon: icon,
7733
7817
  message: message
@@ -7757,7 +7841,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7757
7841
  } : position.includes('right') ? {
7758
7842
  justifyContent: 'flex-end'
7759
7843
  } : {};
7760
- return _extends$z({
7844
+ return _extends$A({
7761
7845
  left: 0,
7762
7846
  right: 0,
7763
7847
  display: 'flex',
@@ -7784,7 +7868,7 @@ var Toaster = function Toaster(_ref) {
7784
7868
  handlers = _useToaster.handlers;
7785
7869
 
7786
7870
  return React.createElement("div", {
7787
- style: _extends$z({
7871
+ style: _extends$A({
7788
7872
  position: 'fixed',
7789
7873
  zIndex: 9999,
7790
7874
  top: DEFAULT_OFFSET,
@@ -7819,82 +7903,82 @@ var Toaster = function Toaster(_ref) {
7819
7903
  }));
7820
7904
  };
7821
7905
 
7822
- var _path$w;
7906
+ var _path$x;
7823
7907
 
7824
- function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7908
+ function _extends$z() { _extends$z = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
7825
7909
 
7826
7910
  function SvgCheckSolid(props) {
7827
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7911
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
7828
7912
  xmlns: "http://www.w3.org/2000/svg",
7829
7913
  className: "h-5 w-5",
7830
7914
  viewBox: "0 0 20 20",
7831
7915
  fill: "currentColor"
7832
- }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7916
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
7833
7917
  fillRule: "evenodd",
7834
7918
  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",
7835
7919
  clipRule: "evenodd"
7836
7920
  })));
7837
7921
  }
7838
7922
 
7839
- var _path$v;
7923
+ var _path$w;
7840
7924
 
7841
- function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7925
+ function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7842
7926
 
7843
7927
  function SvgXIcon(props) {
7844
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7928
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7845
7929
  xmlns: "http://www.w3.org/2000/svg",
7846
7930
  viewBox: "0 0 20 20",
7847
7931
  fill: "currentColor"
7848
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7932
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7849
7933
  fill: "evenodd",
7850
7934
  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",
7851
7935
  clipRule: "evenodd"
7852
7936
  })));
7853
7937
  }
7854
7938
 
7855
- var _path$u;
7939
+ var _path$v;
7856
7940
 
7857
- function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7941
+ function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7858
7942
 
7859
7943
  function SvgXIconSolid(props) {
7860
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7944
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7861
7945
  className: "plc-w-4 plc-h-4",
7862
7946
  fill: "currentColor",
7863
7947
  xmlns: "http://www.w3.org/2000/svg",
7864
7948
  viewBox: "0 0 100 100"
7865
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7949
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7866
7950
  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"
7867
7951
  })));
7868
7952
  }
7869
7953
 
7870
- var _path$t;
7954
+ var _path$u;
7871
7955
 
7872
- function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7956
+ function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7873
7957
 
7874
7958
  function SvgExclamation(props) {
7875
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7959
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7876
7960
  className: "plc-w-4 plc-h-4 plc-mr-1",
7877
7961
  xmlns: "http://www.w3.org/2000/svg",
7878
7962
  viewBox: "0 0 20 20",
7879
7963
  fill: "currentColor"
7880
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7964
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7881
7965
  fillRule: "evenodd",
7882
7966
  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",
7883
7967
  clipRule: "evenodd"
7884
7968
  })));
7885
7969
  }
7886
7970
 
7887
- var _path$s, _path2$4;
7971
+ var _path$t, _path2$4;
7888
7972
 
7889
- function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
7973
+ function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7890
7974
 
7891
7975
  function SvgSpinner(props) {
7892
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7976
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7893
7977
  className: "plc-animate-spin",
7894
7978
  viewBox: "0 0 24 24",
7895
7979
  fill: "currentColor",
7896
7980
  xmlns: "http://www.w3.org/2000/svg"
7897
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7981
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7898
7982
  opacity: 0.2,
7899
7983
  fill: "evenodd",
7900
7984
  clipRule: "evenodd",
@@ -8184,7 +8268,9 @@ const init$1 = () => {
8184
8268
  return switchToAddressView();
8185
8269
  });
8186
8270
  } else {
8187
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8271
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8272
+ return switchView("subscription-options");
8273
+ });
8188
8274
  }
8189
8275
  }
8190
8276
  }
@@ -8346,7 +8432,8 @@ function Link({
8346
8432
  const init = () => {
8347
8433
  const {
8348
8434
  switchView,
8349
- set
8435
+ set,
8436
+ setProductsList
8350
8437
  } = usePelcro.getStore();
8351
8438
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8352
8439
 
@@ -8397,7 +8484,8 @@ const init = () => {
8397
8484
  }
8398
8485
 
8399
8486
  notify.dismiss(NOTIFICATION_ID);
8400
- switchView("_plan-select-entitlements");
8487
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8488
+ switchView("plan-select");
8401
8489
  }
8402
8490
  }, "Subscribe"), "now to get full page access.")), {
8403
8491
  className: "pelcro-notification-entitlement",
@@ -8783,7 +8871,7 @@ const loadPaymentSDKs = () => {
8783
8871
  } // Load Vantiv SDKs
8784
8872
 
8785
8873
 
8786
- const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_pay_page_id);
8874
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
8787
8875
 
8788
8876
  if (supportsVantiv) {
8789
8877
  if (!window.jQuery) {
@@ -8791,7 +8879,10 @@ const loadPaymentSDKs = () => {
8791
8879
  }
8792
8880
 
8793
8881
  if (!window.EprotectIframeClient) {
8794
- window.Pelcro.helpers.loadSDK("https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js", "vantiv-eprotect-sdk");
8882
+ const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
8883
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
8884
+ const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
8885
+ window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
8795
8886
  }
8796
8887
  }
8797
8888
  };
@@ -9225,7 +9316,7 @@ const PelcroModalController = ({
9225
9316
  type
9226
9317
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9227
9318
  type
9228
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9319
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9229
9320
  type
9230
9321
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9231
9322
  type
@@ -9506,8 +9597,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9506
9597
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9507
9598
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9508
9599
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9600
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9601
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9509
9602
 
9510
- const initialState$h = {
9603
+ const initialState$i = {
9511
9604
  email: "",
9512
9605
  password: "",
9513
9606
  emailError: null,
@@ -9518,10 +9611,10 @@ const initialState$h = {
9518
9611
  content: ""
9519
9612
  }
9520
9613
  };
9521
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
9614
+ const store$i = /*#__PURE__*/React.createContext(initialState$i);
9522
9615
  const {
9523
- Provider: Provider$h
9524
- } = store$h;
9616
+ Provider: Provider$i
9617
+ } = store$i;
9525
9618
 
9526
9619
  const LoginContainer = ({
9527
9620
  style,
@@ -9628,7 +9721,7 @@ const LoginContainer = ({
9628
9721
  });
9629
9722
 
9630
9723
  case RESET_LOGIN_FORM:
9631
- return initialState$h;
9724
+ return initialState$i;
9632
9725
 
9633
9726
  case DISABLE_LOGIN_BUTTON:
9634
9727
  return lib_7({ ...state,
@@ -9646,12 +9739,12 @@ const LoginContainer = ({
9646
9739
  default:
9647
9740
  return state;
9648
9741
  }
9649
- }, initialState$h);
9742
+ }, initialState$i);
9650
9743
  return /*#__PURE__*/React__default['default'].createElement("div", {
9651
9744
  style: { ...style
9652
9745
  },
9653
9746
  className: `pelcro-container pelcro-login-container ${className}`
9654
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9747
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9655
9748
  value: {
9656
9749
  state,
9657
9750
  dispatch
@@ -9659,12 +9752,12 @@ const LoginContainer = ({
9659
9752
  }, children.length ? children.map((child, i) => {
9660
9753
  if (child) {
9661
9754
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9662
- store: store$h,
9755
+ store: store$i,
9663
9756
  key: i
9664
9757
  });
9665
9758
  }
9666
9759
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9667
- store: store$h
9760
+ store: store$i
9668
9761
  })));
9669
9762
  };
9670
9763
 
@@ -9909,7 +10002,7 @@ const LoginButton = ({
9909
10002
  buttonDisabled
9910
10003
  },
9911
10004
  dispatch
9912
- } = React.useContext(store$h);
10005
+ } = React.useContext(store$i);
9913
10006
  const {
9914
10007
  t
9915
10008
  } = useTranslation("login");
@@ -9930,23 +10023,23 @@ const LoginButton = ({
9930
10023
  };
9931
10024
 
9932
10025
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9933
- store: store$h
10026
+ store: store$i
9934
10027
  }, props));
9935
10028
 
9936
10029
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9937
- store: store$h
10030
+ store: store$i
9938
10031
  }, props));
9939
10032
 
9940
- var _path$r;
10033
+ var _path$s;
9941
10034
 
9942
- 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); }
10035
+ function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
9943
10036
 
9944
10037
  function SvgCheck(props) {
9945
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10038
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9946
10039
  xmlns: "http://www.w3.org/2000/svg",
9947
10040
  fill: "currentColor",
9948
10041
  viewBox: "0 0 20 20"
9949
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10042
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9950
10043
  fillRule: "evenodd",
9951
10044
  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",
9952
10045
  clipRule: "evenodd"
@@ -10011,7 +10104,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
10011
10104
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
10012
10105
  facebookLoginRenderProps.FacebookLogin;
10013
10106
 
10014
- const initialState$g = {
10107
+ const initialState$h = {
10015
10108
  email: "",
10016
10109
  password: "",
10017
10110
  emailError: null,
@@ -10028,10 +10121,10 @@ const initialState$g = {
10028
10121
  content: ""
10029
10122
  }
10030
10123
  };
10031
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
10124
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
10032
10125
  const {
10033
- Provider: Provider$g
10034
- } = store$g;
10126
+ Provider: Provider$h
10127
+ } = store$h;
10035
10128
 
10036
10129
  const RegisterContainer = ({
10037
10130
  style,
@@ -10214,7 +10307,7 @@ const RegisterContainer = ({
10214
10307
  });
10215
10308
 
10216
10309
  case RESET_LOGIN_FORM:
10217
- return initialState$g;
10310
+ return initialState$h;
10218
10311
 
10219
10312
  case DISABLE_REGISTRATION_BUTTON:
10220
10313
  return lib_7({ ...state,
@@ -10232,12 +10325,12 @@ const RegisterContainer = ({
10232
10325
  default:
10233
10326
  return state;
10234
10327
  }
10235
- }, initialState$g);
10328
+ }, initialState$h);
10236
10329
  return /*#__PURE__*/React__default['default'].createElement("div", {
10237
10330
  style: { ...style
10238
10331
  },
10239
10332
  className: `pelcro-container pelcro-register-container ${className}`
10240
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10333
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10241
10334
  value: {
10242
10335
  state,
10243
10336
  dispatch
@@ -10245,12 +10338,12 @@ const RegisterContainer = ({
10245
10338
  }, children.length ? children.map((child, i) => {
10246
10339
  if (child) {
10247
10340
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10248
- store: store$g,
10341
+ store: store$h,
10249
10342
  key: i
10250
10343
  });
10251
10344
  }
10252
10345
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10253
- store: store$g
10346
+ store: store$h
10254
10347
  })));
10255
10348
  };
10256
10349
  /**
@@ -10265,15 +10358,15 @@ function hasSecurityTokenEnabled$1() {
10265
10358
  return hasSecuritySdkLoaded;
10266
10359
  }
10267
10360
 
10268
- var _path$q;
10361
+ var _path$r;
10269
10362
 
10270
- 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); }
10363
+ function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
10271
10364
 
10272
10365
  function SvgFacebookLogo(props) {
10273
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10366
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10274
10367
  xmlns: "http://www.w3.org/2000/svg",
10275
10368
  viewBox: "88.428 12.828 107.543 207.085"
10276
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10369
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10277
10370
  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",
10278
10371
  fill: "#3c5a9a"
10279
10372
  })));
@@ -10290,10 +10383,10 @@ const FacebookLoginButton = ({
10290
10383
  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;
10291
10384
  const {
10292
10385
  dispatch: loginDispatch
10293
- } = React.useContext(store$h);
10386
+ } = React.useContext(store$i);
10294
10387
  const {
10295
10388
  dispatch: registerDispatch
10296
- } = React.useContext(store$g);
10389
+ } = React.useContext(store$h);
10297
10390
 
10298
10391
  const onSuccess = facebookUser => {
10299
10392
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10346,15 +10439,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10346
10439
  unwrapExports(googleLogin);
10347
10440
  var googleLogin_1 = googleLogin.GoogleLogin;
10348
10441
 
10349
- var _path$p, _path2$3, _path3$1, _path4;
10442
+ var _path$q, _path2$3, _path3$1, _path4;
10350
10443
 
10351
- 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); }
10444
+ function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
10352
10445
 
10353
10446
  function SvgGoogleLogo(props) {
10354
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10447
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10355
10448
  viewBox: "0 0 24 24",
10356
10449
  xmlns: "http://www.w3.org/2000/svg"
10357
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10450
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10358
10451
  fill: "#4285F4",
10359
10452
  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"
10360
10453
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10380,10 +10473,10 @@ const GoogleLoginButton = ({
10380
10473
  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;
10381
10474
  const {
10382
10475
  dispatch: loginDispatch
10383
- } = React.useContext(store$h);
10476
+ } = React.useContext(store$i);
10384
10477
  const {
10385
10478
  dispatch: registerDispatch
10386
- } = React.useContext(store$g);
10479
+ } = React.useContext(store$h);
10387
10480
 
10388
10481
  const onSuccess = response => {
10389
10482
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10431,15 +10524,15 @@ const GoogleLoginButton = ({
10431
10524
  }) : null;
10432
10525
  };
10433
10526
 
10434
- var _path$o;
10527
+ var _path$p;
10435
10528
 
10436
- 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); }
10529
+ function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10437
10530
 
10438
10531
  function SvgAuth0Logo(props) {
10439
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10532
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10440
10533
  viewBox: "0 0 256 285",
10441
10534
  xmlns: "http://www.w3.org/2000/svg"
10442
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10535
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10443
10536
  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"
10444
10537
  })));
10445
10538
  }
@@ -10479,10 +10572,10 @@ const Auth0LoginButton = ({
10479
10572
  }, [auth0Enabled, auth0Loaded]);
10480
10573
  const {
10481
10574
  dispatch: loginDispatch
10482
- } = React.useContext(store$h);
10575
+ } = React.useContext(store$i);
10483
10576
  const {
10484
10577
  dispatch: registerDispatch
10485
- } = React.useContext(store$g);
10578
+ } = React.useContext(store$h);
10486
10579
 
10487
10580
  function handleClick() {
10488
10581
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10615,15 +10708,15 @@ function LoginView(props) {
10615
10708
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10616
10709
  }
10617
10710
 
10618
- var _path$n, _path2$2, _path3;
10711
+ var _path$o, _path2$2, _path3;
10619
10712
 
10620
- 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); }
10713
+ function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10621
10714
 
10622
10715
  function SvgPelcroAuthorship(props) {
10623
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10716
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10624
10717
  xmlns: "http://www.w3.org/2000/svg",
10625
10718
  viewBox: "0 -80.652 497.072 179.991"
10626
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10719
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10627
10720
  fill: "none",
10628
10721
  stroke: "#4a4a4a",
10629
10722
  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"
@@ -10770,11 +10863,11 @@ function LoginModal({
10770
10863
  LoginModal.viewId = "login";
10771
10864
 
10772
10865
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10773
- store: store$g
10866
+ store: store$h
10774
10867
  }, props));
10775
10868
 
10776
10869
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10777
- store: store$g
10870
+ store: store$h
10778
10871
  }, props));
10779
10872
 
10780
10873
  const RegisterButton = ({
@@ -10794,7 +10887,7 @@ const RegisterButton = ({
10794
10887
  buttonDisabled
10795
10888
  },
10796
10889
  dispatch
10797
- } = React.useContext(store$g);
10890
+ } = React.useContext(store$h);
10798
10891
  const {
10799
10892
  t
10800
10893
  } = useTranslation("register");
@@ -10932,7 +11025,7 @@ function FirstName({
10932
11025
  }
10933
11026
 
10934
11027
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10935
- store: store$g
11028
+ store: store$h
10936
11029
  }, props));
10937
11030
 
10938
11031
  function LastName({
@@ -10963,7 +11056,7 @@ function LastName({
10963
11056
  }
10964
11057
 
10965
11058
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10966
- store: store$g
11059
+ store: store$h
10967
11060
  }, props));
10968
11061
 
10969
11062
  /**
@@ -11087,7 +11180,7 @@ function TextInput({
11087
11180
 
11088
11181
  const RegisterTextInput = props => {
11089
11182
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11090
- store: store$g
11183
+ store: store$h
11091
11184
  }));
11092
11185
  };
11093
11186
 
@@ -11234,6 +11327,7 @@ function SelectModalWithHook(props) {
11234
11327
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11235
11328
  }, []);
11236
11329
  const {
11330
+ productsList,
11237
11331
  isGift,
11238
11332
  plan,
11239
11333
  product,
@@ -11243,11 +11337,12 @@ function SelectModalWithHook(props) {
11243
11337
  view,
11244
11338
  set
11245
11339
  } = usePelcro();
11246
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11247
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11340
+ const isRenewingSub = view === "_plan-select-renew";
11248
11341
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11342
+ productsList: productsList,
11249
11343
  isGift: isGift,
11250
- disableGifting: isRenewingGift,
11344
+ disableGifting: isRenewingGift || isRenewingSub,
11345
+ isRenewingSub: isRenewingSub,
11251
11346
  plan: plan,
11252
11347
  product: product,
11253
11348
  onClose: () => {
@@ -11261,8 +11356,10 @@ function SelectModalWithHook(props) {
11261
11356
  plan,
11262
11357
  isGift
11263
11358
  }),
11264
- setView: switchView,
11265
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11359
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11360
+ subscriptionIdToRenew
11361
+ }),
11362
+ setView: switchView
11266
11363
  });
11267
11364
  }
11268
11365
  SelectModalWithHook.viewId = "plan-select";
@@ -11294,10 +11391,10 @@ class SelectModal extends React.Component {
11294
11391
  });
11295
11392
  }
11296
11393
 
11297
- if (this.state.productList.length === 1) {
11394
+ if (this.props.productsList.length === 1) {
11298
11395
  this.setState({
11299
- product: this.state.productList[0],
11300
- planList: this.state.productList[0].plans,
11396
+ product: this.props.productsList[0],
11397
+ planList: this.props.productsList[0].plans,
11301
11398
  mode: "plan"
11302
11399
  });
11303
11400
  }
@@ -11314,7 +11411,7 @@ class SelectModal extends React.Component {
11314
11411
  });
11315
11412
 
11316
11413
  _defineProperty$3(this, "onProductChange", e => {
11317
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11414
+ const product = productsList[e.target.selectedIndex];
11318
11415
  this.setState({
11319
11416
  product: product,
11320
11417
  plan: product.plans[0]
@@ -11380,7 +11477,7 @@ class SelectModal extends React.Component {
11380
11477
 
11381
11478
  _defineProperty$3(this, "renderProducts", () => {
11382
11479
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11383
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11480
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11384
11481
  return productsToShow.map((product, index) => {
11385
11482
  return this.renderOneProduct(product, index);
11386
11483
  });
@@ -11393,7 +11490,7 @@ class SelectModal extends React.Component {
11393
11490
  return this.renderOneProduct(this.state.product);
11394
11491
  }
11395
11492
 
11396
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11493
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11397
11494
 
11398
11495
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11399
11496
  return this.renderProducts();
@@ -11409,10 +11506,7 @@ class SelectModal extends React.Component {
11409
11506
  className: "plc-text-sm plc-font-semibold"
11410
11507
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11411
11508
 
11412
- function productsWithMatchedTaggedFirst() {
11413
- var _window$Pelcro$produc;
11414
-
11415
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11509
+ function productsWithMatchedTaggedFirst(allProducts) {
11416
11510
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11417
11511
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11418
11512
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11446,7 +11540,7 @@ class SelectModal extends React.Component {
11446
11540
  _defineProperty$3(this, "selectProduct", e => {
11447
11541
  const id = e.target.dataset.key;
11448
11542
 
11449
- for (const product of this.state.productList) {
11543
+ for (const product of this.props.productsList) {
11450
11544
  if (+product.id === +id) {
11451
11545
  var _this$state$plan;
11452
11546
 
@@ -11499,6 +11593,14 @@ class SelectModal extends React.Component {
11499
11593
 
11500
11594
  _defineProperty$3(this, "submitOption", () => {
11501
11595
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11596
+
11597
+ if (this.props.isRenewingSub) {
11598
+ var _matchingSub$id;
11599
+
11600
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11601
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11602
+ }
11603
+
11502
11604
  const {
11503
11605
  product,
11504
11606
  isGift
@@ -11536,8 +11638,7 @@ class SelectModal extends React.Component {
11536
11638
  plan: {},
11537
11639
  isGift: props.isGift,
11538
11640
  disabled: true,
11539
- mode: "product",
11540
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11641
+ mode: "product"
11541
11642
  };
11542
11643
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11543
11644
  this.locale = this.props.t;
@@ -11545,7 +11646,7 @@ class SelectModal extends React.Component {
11545
11646
  }
11546
11647
 
11547
11648
  render() {
11548
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11649
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11549
11650
 
11550
11651
  const {
11551
11652
  disableGifting
@@ -11579,7 +11680,7 @@ class SelectModal extends React.Component {
11579
11680
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11580
11681
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11581
11682
  className: "plc-text-2xl plc-font-semibold"
11582
- }, 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", {
11683
+ }, this.product && this.product.paywall.select_title || ((_this$props$productsL = this.props.productsList[0]) === null || _this$props$productsL === void 0 ? void 0 : _this$props$productsL.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_this$props$productsL2 = this.props.productsList[0]) === null || _this$props$productsL2 === void 0 ? void 0 : _this$props$productsL2.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11583
11684
  className: "pelcro-select-products-wrapper"
11584
11685
  }, (_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", {
11585
11686
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12743,20 +12844,21 @@ var es_12 = es.injectStripe;
12743
12844
  var es_13 = es.StripeProvider;
12744
12845
 
12745
12846
  /**
12746
- * @TODO: All subscription related business logic should end up moving
12847
+ * @TODO: All payment related business logic should end up moving
12747
12848
  * to this service, and out of react components.
12748
12849
  */
12749
12850
 
12750
12851
  /**
12751
- * Enum for subscription types
12852
+ * Enum for payment types
12752
12853
  * @readonly
12753
12854
  * @enum {string}
12754
12855
  */
12755
- const SUBSCRIPTION_TYPES = {
12856
+ const PAYMENT_TYPES = {
12756
12857
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12757
12858
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12758
12859
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12759
12860
  RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12861
+ PURCHASE_ECOMMERCE_ORDER: "PURCHASE_ECOMMERCE_ORDER",
12760
12862
  PAY_INVOICE: "PAY_INVOICE"
12761
12863
  };
12762
12864
 
@@ -12764,9 +12866,8 @@ var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
12764
12866
 
12765
12867
  var _generateUserError = /*#__PURE__*/new WeakMap();
12766
12868
 
12767
- class Subscription {
12869
+ class Payment {
12768
12870
  /**
12769
- * Subscription service constructor
12770
12871
  * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12771
12872
  */
12772
12873
  constructor(paymentGateway) {
@@ -12778,7 +12879,7 @@ class Subscription {
12778
12879
 
12779
12880
  if (!options.type) {
12780
12881
  callback(_classPrivateFieldGet(this, _generateUserError).call(this), null);
12781
- return console.error("No subscription type provided");
12882
+ return console.error("No payment type provided");
12782
12883
  } // delegate execution to paymentgateway
12783
12884
 
12784
12885
 
@@ -12796,21 +12897,21 @@ class Subscription {
12796
12897
  writable: true,
12797
12898
  value: () => {
12798
12899
  return {
12799
- error: new Error("An error has occured in the subscription service, please try again later")
12900
+ error: new Error("An error has occured in the payment service, please try again later")
12800
12901
  };
12801
12902
  }
12802
12903
  });
12803
12904
 
12804
12905
  if (_classPrivateFieldGet(this, _isPaymentGatewayInvalid).call(this, paymentGateway)) {
12805
12906
  this.paymentGateway = null;
12806
- console.error("Incompatible subscription gateway");
12907
+ console.error("Incompatible payment gateway");
12807
12908
  } else {
12808
12909
  this.paymentGateway = paymentGateway;
12809
12910
  }
12810
12911
  }
12811
12912
  /**
12812
- * @typedef subscriptionOptions
12813
- * @property {SUBSCRIPTION_TYPES} type
12913
+ * @typedef paymentOptions
12914
+ * @property {PAYMENT_TYPES} type
12814
12915
  * @property {string} token
12815
12916
  * @property {object} plan
12816
12917
  * @property {object} [product]
@@ -12821,6 +12922,7 @@ class Subscription {
12821
12922
  * @property {string} addressId
12822
12923
  * @property {number} invoiceId
12823
12924
  * @property {boolean} isExistingSource
12925
+ * @property {Array} items
12824
12926
  */
12825
12927
 
12826
12928
  /**
@@ -12831,8 +12933,8 @@ class Subscription {
12831
12933
  */
12832
12934
 
12833
12935
  /**
12834
- * Subscription execution method
12835
- * @param {subscriptionOptions} options subscription options
12936
+ * Payment execution method
12937
+ * @param {paymentOptions} options payment options
12836
12938
  * @param {executeCallback} callback
12837
12939
  * @return {void}
12838
12940
  */
@@ -12845,7 +12947,7 @@ const PAYMENT_GATEWAYS_ENUM = {
12845
12947
  vantiv: "vantiv"
12846
12948
  };
12847
12949
  /**
12848
- * Subscription Strategies
12950
+ * Payment Strategies
12849
12951
  */
12850
12952
 
12851
12953
  /**
@@ -12862,6 +12964,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12862
12964
 
12863
12965
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12864
12966
 
12967
+ var _purchaseEcommerceOrder = /*#__PURE__*/new WeakMap();
12968
+
12865
12969
  var _payInvoice = /*#__PURE__*/new WeakMap();
12866
12970
 
12867
12971
  class StripeGateway {
@@ -12872,7 +12976,7 @@ class StripeGateway {
12872
12976
  });
12873
12977
 
12874
12978
  _defineProperty$3(this, "execute", (options, callback) => {
12875
- const types = SUBSCRIPTION_TYPES;
12979
+ const types = PAYMENT_TYPES;
12876
12980
 
12877
12981
  switch (options.type) {
12878
12982
  case types.CREATE_SUBSCRIPTION:
@@ -12887,11 +12991,14 @@ class StripeGateway {
12887
12991
  case types.RENEW_GIFTED_SUBSCRIPTION:
12888
12992
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12889
12993
 
12994
+ case types.PURCHASE_ECOMMERCE_ORDER:
12995
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder).call(this, options, callback);
12996
+
12890
12997
  case types.PAY_INVOICE:
12891
12998
  return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12892
12999
 
12893
13000
  default:
12894
- console.error("Unsupported subscriptiion method: Stripe Gateway");
13001
+ console.error("Unsupported payment method: Stripe Gateway");
12895
13002
  }
12896
13003
  });
12897
13004
 
@@ -12999,6 +13106,35 @@ class StripeGateway {
12999
13106
  }
13000
13107
  });
13001
13108
 
13109
+ _purchaseEcommerceOrder.set(this, {
13110
+ writable: true,
13111
+ value: (options, callback) => {
13112
+ const {
13113
+ token,
13114
+ items,
13115
+ couponCode,
13116
+ addressId,
13117
+ isExistingSource
13118
+ } = options;
13119
+ const params = isExistingSource ? {
13120
+ source_id: token
13121
+ } : {
13122
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
13123
+ gateway_token: token
13124
+ };
13125
+ window.Pelcro.ecommerce.order.create({
13126
+ items,
13127
+ coupon_code: couponCode,
13128
+ ...params,
13129
+ ...(addressId && {
13130
+ address_id: addressId
13131
+ })
13132
+ }, (err, res) => {
13133
+ callback(err, res);
13134
+ });
13135
+ }
13136
+ });
13137
+
13002
13138
  _payInvoice.set(this, {
13003
13139
  writable: true,
13004
13140
  value: (options, callback) => {
@@ -13042,7 +13178,7 @@ class PaypalGateway {
13042
13178
  });
13043
13179
 
13044
13180
  _defineProperty$3(this, "execute", (options, callback) => {
13045
- const types = SUBSCRIPTION_TYPES;
13181
+ const types = PAYMENT_TYPES;
13046
13182
 
13047
13183
  switch (options.type) {
13048
13184
  case types.CREATE_SUBSCRIPTION:
@@ -13145,6 +13281,10 @@ var _createGiftedSubscription3 = /*#__PURE__*/new WeakMap();
13145
13281
 
13146
13282
  var _renewGiftedSubscription2 = /*#__PURE__*/new WeakMap();
13147
13283
 
13284
+ var _purchaseEcommerceOrder2 = /*#__PURE__*/new WeakMap();
13285
+
13286
+ var _payInvoice3 = /*#__PURE__*/new WeakMap();
13287
+
13148
13288
  class VantivGateway {
13149
13289
  constructor() {
13150
13290
  _paymentGateway3.set(this, {
@@ -13153,7 +13293,7 @@ class VantivGateway {
13153
13293
  });
13154
13294
 
13155
13295
  _defineProperty$3(this, "execute", (options, callback) => {
13156
- const types = SUBSCRIPTION_TYPES;
13296
+ const types = PAYMENT_TYPES;
13157
13297
 
13158
13298
  switch (options.type) {
13159
13299
  case types.CREATE_SUBSCRIPTION:
@@ -13167,12 +13307,15 @@ class VantivGateway {
13167
13307
 
13168
13308
  case types.RENEW_GIFTED_SUBSCRIPTION:
13169
13309
  return _classPrivateFieldGet(this, _renewGiftedSubscription2).call(this, options, callback);
13170
- // TODO: implement paying invoices as well
13171
- // case types.PAY_INVOICE:
13172
- // return this.#payInvoice(options, callback);
13310
+
13311
+ case types.PURCHASE_ECOMMERCE_ORDER:
13312
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder2).call(this, options, callback);
13313
+
13314
+ case types.PAY_INVOICE:
13315
+ return _classPrivateFieldGet(this, _payInvoice3).call(this, options, callback);
13173
13316
 
13174
13317
  default:
13175
- console.error("Unsupported subscriptiion method: vantiv Gateway");
13318
+ console.error("Unsupported payment method: vantiv Gateway");
13176
13319
  }
13177
13320
  });
13178
13321
 
@@ -13305,13 +13448,63 @@ class VantivGateway {
13305
13448
  });
13306
13449
  }
13307
13450
  });
13308
- }
13309
13451
 
13310
- }
13452
+ _purchaseEcommerceOrder2.set(this, {
13453
+ writable: true,
13454
+ value: (options, callback) => {
13455
+ const {
13456
+ token,
13457
+ items,
13458
+ couponCode,
13459
+ addressId,
13460
+ isExistingSource
13461
+ } = options;
13462
+ const params = isExistingSource ? {
13463
+ source_id: token
13464
+ } : {
13465
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13466
+ gateway_token: token
13467
+ };
13468
+ window.Pelcro.ecommerce.order.create({
13469
+ items,
13470
+ coupon_code: couponCode,
13471
+ ...params,
13472
+ ...(addressId && {
13473
+ address_id: addressId
13474
+ })
13475
+ }, (err, res) => {
13476
+ callback(err, res);
13477
+ });
13478
+ }
13479
+ });
13311
13480
 
13312
- /**
13313
- * @typedef {Object} PaymentStateType
13314
- * @property {boolean} disableSubmit
13481
+ _payInvoice3.set(this, {
13482
+ writable: true,
13483
+ value: (options, callback) => {
13484
+ const {
13485
+ token,
13486
+ invoiceId
13487
+ } = options;
13488
+ const params = options.isExistingSource ? {
13489
+ source_id: token,
13490
+ invoice_id: invoiceId
13491
+ } : {
13492
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13493
+ gateway_token: token,
13494
+ invoice_id: invoiceId
13495
+ };
13496
+ window.Pelcro.invoice.pay(params, (err, res) => {
13497
+ callback(err, res);
13498
+ });
13499
+ }
13500
+ });
13501
+ }
13502
+
13503
+ }
13504
+
13505
+ /**
13506
+ * @typedef {Object} PaymentStateType
13507
+ * @property {boolean} disableSubmit
13315
13508
  * @property {boolean} isLoading
13316
13509
  * @property {boolean} disableCouponButton
13317
13510
  * @property {object} couponObject
@@ -13329,7 +13522,7 @@ class VantivGateway {
13329
13522
 
13330
13523
  /** @type {PaymentStateType} */
13331
13524
 
13332
- const initialState$f = {
13525
+ const initialState$g = {
13333
13526
  disableSubmit: false,
13334
13527
  isLoading: false,
13335
13528
  disableCouponButton: false,
@@ -13348,10 +13541,10 @@ const initialState$f = {
13348
13541
  content: ""
13349
13542
  }
13350
13543
  };
13351
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
13544
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
13352
13545
  const {
13353
- Provider: Provider$f
13354
- } = store$f;
13546
+ Provider: Provider$g
13547
+ } = store$g;
13355
13548
 
13356
13549
  const PaymentMethodContainerWithoutStripe = ({
13357
13550
  style,
@@ -13397,22 +13590,22 @@ const PaymentMethodContainerWithoutStripe = ({
13397
13590
  updateTotalAmountWithTax();
13398
13591
  }, []);
13399
13592
 
13400
- function submitVantivPayment() {
13401
- if (!selectedPaymentMethodId) {
13402
- if (!vantivInstanceRef.current) {
13403
- return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13404
- }
13405
-
13406
- const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13593
+ const submitVantivPayment = () => {
13594
+ if (selectedPaymentMethodId) {
13595
+ return handleVantivPayment(null);
13596
+ }
13407
13597
 
13408
- vantivInstanceRef.current.getPaypageRegistrationId({
13409
- id: orderId,
13410
- orderId: orderId
13411
- });
13412
- } else {
13413
- handleVantivPayment(null);
13598
+ if (!vantivInstanceRef.current) {
13599
+ return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13414
13600
  }
13415
- }
13601
+
13602
+ const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13603
+
13604
+ vantivInstanceRef.current.getPaypageRegistrationId({
13605
+ id: orderId,
13606
+ orderId: orderId
13607
+ });
13608
+ };
13416
13609
 
13417
13610
  function handleVantivPayment(paymentRequest) {
13418
13611
  if (paymentRequest) {
@@ -13425,19 +13618,18 @@ const PaymentMethodContainerWithoutStripe = ({
13425
13618
  }
13426
13619
  }
13427
13620
 
13428
- const subscription = new Subscription(new VantivGateway());
13621
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13429
13622
 
13430
13623
  if (type === "createPayment") {
13431
13624
  handleVantivSubscription();
13432
- } // TODO: handle other types of payments
13433
- // } else if (type === "orderCreate") {
13434
- // purchase(stripeSource, state, dispatch);
13435
- // } else if (type === "invoicePayment") {
13436
- // payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13437
- // }
13438
-
13625
+ } else if (type === "orderCreate") {
13626
+ purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13627
+ } else if (type === "invoicePayment") {
13628
+ payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13629
+ }
13439
13630
 
13440
13631
  function handleVantivSubscription() {
13632
+ const payment = new Payment(new VantivGateway());
13441
13633
  const createSubscription = !isGift && !subscriptionIdToRenew;
13442
13634
  const renewSubscription = !isGift && subscriptionIdToRenew;
13443
13635
  const giftSubscriprition = isGift && !subscriptionIdToRenew;
@@ -13445,11 +13637,10 @@ const PaymentMethodContainerWithoutStripe = ({
13445
13637
  const {
13446
13638
  couponCode
13447
13639
  } = state;
13448
- const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13449
13640
 
13450
13641
  if (renewGift) {
13451
- return subscription.execute({
13452
- type: SUBSCRIPTION_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13642
+ return payment.execute({
13643
+ type: PAYMENT_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13453
13644
  token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13454
13645
  plan,
13455
13646
  couponCode,
@@ -13465,8 +13656,8 @@ const PaymentMethodContainerWithoutStripe = ({
13465
13656
  onSuccess(res);
13466
13657
  });
13467
13658
  } else if (giftSubscriprition) {
13468
- return subscription.execute({
13469
- type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13659
+ return payment.execute({
13660
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13470
13661
  token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13471
13662
  quantity: plan.quantity,
13472
13663
  plan,
@@ -13483,8 +13674,8 @@ const PaymentMethodContainerWithoutStripe = ({
13483
13674
  onSuccess(res);
13484
13675
  });
13485
13676
  } else if (renewSubscription) {
13486
- return subscription.execute({
13487
- type: SUBSCRIPTION_TYPES.RENEW_SUBSCRIPTION,
13677
+ return payment.execute({
13678
+ type: PAYMENT_TYPES.RENEW_SUBSCRIPTION,
13488
13679
  token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13489
13680
  quantity: plan.quantity,
13490
13681
  plan,
@@ -13501,8 +13692,8 @@ const PaymentMethodContainerWithoutStripe = ({
13501
13692
  onSuccess(res);
13502
13693
  });
13503
13694
  } else if (createSubscription) {
13504
- return subscription.execute({
13505
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13695
+ return payment.execute({
13696
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13506
13697
  token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13507
13698
  quantity: plan.quantity,
13508
13699
  plan,
@@ -13526,12 +13717,13 @@ const PaymentMethodContainerWithoutStripe = ({
13526
13717
  const cardProcessor = getSiteCardProcessor();
13527
13718
 
13528
13719
  if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13529
- var _window$Pelcro$site$r;
13720
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2;
13530
13721
 
13531
- const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_pay_page_id;
13722
+ const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
13723
+ const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
13532
13724
  vantivInstanceRef.current = new window.EprotectIframeClient({
13533
13725
  paypageId: payPageId,
13534
- reportGroup: payPageId,
13726
+ reportGroup: reportGroup,
13535
13727
  style: "pelcro",
13536
13728
  height: "245",
13537
13729
  timeout: 50000,
@@ -13620,9 +13812,9 @@ const PaymentMethodContainerWithoutStripe = ({
13620
13812
 
13621
13813
 
13622
13814
  const updateTotalAmountWithTax = () => {
13623
- var _window$Pelcro$site$r2;
13815
+ var _window$Pelcro$site$r3;
13624
13816
 
13625
- const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
13817
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13626
13818
 
13627
13819
  if (taxesEnabled && type === "createPayment") {
13628
13820
  dispatch({
@@ -13972,7 +14164,7 @@ const PaymentMethodContainerWithoutStripe = ({
13972
14164
 
13973
14165
 
13974
14166
  const handlePaypalSubscription = (state, paypalNonce) => {
13975
- const subscription = new Subscription(new PaypalGateway());
14167
+ const payment = new Payment(new PaypalGateway());
13976
14168
  const {
13977
14169
  couponCode
13978
14170
  } = state;
@@ -13981,8 +14173,8 @@ const PaymentMethodContainerWithoutStripe = ({
13981
14173
  */
13982
14174
 
13983
14175
  if (giftRecipient) {
13984
- return subscription.execute({
13985
- type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
14176
+ return payment.execute({
14177
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13986
14178
  token: paypalNonce,
13987
14179
  quantity: plan.quantity,
13988
14180
  plan,
@@ -14015,8 +14207,8 @@ const PaymentMethodContainerWithoutStripe = ({
14015
14207
  });
14016
14208
  }
14017
14209
 
14018
- return subscription.execute({
14019
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
14210
+ return payment.execute({
14211
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
14020
14212
  token: paypalNonce,
14021
14213
  quantity: plan.quantity,
14022
14214
  plan,
@@ -14048,7 +14240,7 @@ const PaymentMethodContainerWithoutStripe = ({
14048
14240
  });
14049
14241
  };
14050
14242
 
14051
- const purchase = (stripeSource, state, dispatch) => {
14243
+ const purchase = (gatewayService, gatewayToken, state, dispatch) => {
14052
14244
  const isQuickPurchase = !Array.isArray(order);
14053
14245
  const mappedOrderItems = isQuickPurchase ? [{
14054
14246
  sku_id: order.id,
@@ -14060,14 +14252,14 @@ const PaymentMethodContainerWithoutStripe = ({
14060
14252
  const {
14061
14253
  couponCode
14062
14254
  } = state;
14063
- window.Pelcro.ecommerce.order.create({
14064
- source_id: stripeSource.isExistingSource ? stripeSource.id : undefined,
14065
- stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
14255
+ const payment = new Payment(gatewayService);
14256
+ payment.execute({
14257
+ type: PAYMENT_TYPES.PURCHASE_ECOMMERCE_ORDER,
14258
+ token: gatewayToken,
14259
+ isExistingSource: Boolean(selectedPaymentMethodId),
14066
14260
  items: mappedOrderItems,
14067
- coupon_code: couponCode,
14068
- ...(selectedAddressId && {
14069
- address_id: selectedAddressId
14070
- })
14261
+ addressId: selectedAddressId,
14262
+ couponCode
14071
14263
  }, (err, res) => {
14072
14264
  dispatch({
14073
14265
  type: DISABLE_SUBMIT,
@@ -14105,9 +14297,9 @@ const PaymentMethodContainerWithoutStripe = ({
14105
14297
  };
14106
14298
 
14107
14299
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
14108
- const subscription = new Subscription(gatewayService);
14109
- return subscription.execute({
14110
- type: SUBSCRIPTION_TYPES.PAY_INVOICE,
14300
+ const payment = new Payment(gatewayService);
14301
+ return payment.execute({
14302
+ type: PAYMENT_TYPES.PAY_INVOICE,
14111
14303
  token: gatewayToken,
14112
14304
  isExistingSource: Boolean(selectedPaymentMethodId),
14113
14305
  invoiceId: invoice.id
@@ -14267,13 +14459,13 @@ const PaymentMethodContainerWithoutStripe = ({
14267
14459
 
14268
14460
 
14269
14461
  const resolveTaxCalculation = () => {
14270
- var _window$Pelcro$site$r3;
14462
+ var _window$Pelcro$site$r4;
14271
14463
 
14272
14464
  if (type === "invoicePayment") {
14273
14465
  return new Promise(resolve => resolve());
14274
14466
  }
14275
14467
 
14276
- const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
14468
+ const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
14277
14469
  return new Promise((resolve, reject) => {
14278
14470
  // resolve early if taxes isn't enabled
14279
14471
  if (!taxesEnabled) {
@@ -14345,7 +14537,7 @@ const PaymentMethodContainerWithoutStripe = ({
14345
14537
  if (stripeSource && type === "createPayment") {
14346
14538
  subscribe(stripeSource, state, dispatch);
14347
14539
  } else if (stripeSource && type === "orderCreate") {
14348
- purchase(stripeSource, state, dispatch);
14540
+ purchase(new StripeGateway(), stripeSource.id, state, dispatch);
14349
14541
  } else if (stripeSource && type === "invoicePayment") {
14350
14542
  payInvoice(new StripeGateway(), stripeSource.id, dispatch);
14351
14543
  }
@@ -14551,21 +14743,21 @@ const PaymentMethodContainerWithoutStripe = ({
14551
14743
  default:
14552
14744
  return state;
14553
14745
  }
14554
- }, initialState$f);
14746
+ }, initialState$g);
14555
14747
  return /*#__PURE__*/React__default['default'].createElement("div", {
14556
14748
  style: { ...style
14557
14749
  },
14558
14750
  className: `pelcro-container pelcro-payment-container ${className}`
14559
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14751
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14560
14752
  value: {
14561
14753
  state,
14562
14754
  dispatch
14563
14755
  }
14564
14756
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14565
- store: store$f,
14757
+ store: store$g,
14566
14758
  key: i
14567
14759
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14568
- store: store$f
14760
+ store: store$g
14569
14761
  })));
14570
14762
  };
14571
14763
 
@@ -14587,7 +14779,7 @@ const PaymentMethodContainer = props => {
14587
14779
  stripeAccount: window.Pelcro.site.read().account_id,
14588
14780
  locale: getPageOrDefaultLanguage()
14589
14781
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14590
- store: store$f
14782
+ store: store$g
14591
14783
  }, props))));
14592
14784
  }
14593
14785
 
@@ -14640,7 +14832,7 @@ const PelcroPaymentRequestButton = props => {
14640
14832
  currentPlan,
14641
14833
  updatedPrice
14642
14834
  }
14643
- } = React.useContext(store$f);
14835
+ } = React.useContext(store$g);
14644
14836
 
14645
14837
  const updatePaymentRequest = () => {
14646
14838
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14716,7 +14908,7 @@ const DiscountedPrice = props => {
14716
14908
  taxAmount,
14717
14909
  percentOff
14718
14910
  }
14719
- } = React.useContext(store$f);
14911
+ } = React.useContext(store$g);
14720
14912
  const {
14721
14913
  order,
14722
14914
  plan
@@ -14766,7 +14958,7 @@ const SubmitPaymentMethod = ({
14766
14958
  isLoading,
14767
14959
  updatedPrice
14768
14960
  }
14769
- } = React.useContext(store$f);
14961
+ } = React.useContext(store$g);
14770
14962
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14771
14963
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14772
14964
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14787,17 +14979,17 @@ const SubmitPaymentMethod = ({
14787
14979
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14788
14980
  };
14789
14981
 
14790
- var _path$m;
14982
+ var _path$n;
14791
14983
 
14792
- 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); }
14984
+ 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); }
14793
14985
 
14794
14986
  function SvgArrowLeft(props) {
14795
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14987
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14796
14988
  xmlns: "http://www.w3.org/2000/svg",
14797
14989
  fill: "none",
14798
14990
  viewBox: "0 0 24 24",
14799
14991
  stroke: "currentColor"
14800
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14992
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14801
14993
  strokeLinecap: "round",
14802
14994
  strokeLinejoin: "round",
14803
14995
  strokeWidth: 2,
@@ -14816,7 +15008,7 @@ const ApplyCouponButton = ({
14816
15008
  disableCouponButton
14817
15009
  },
14818
15010
  dispatch
14819
- } = React.useContext(store$f);
15011
+ } = React.useContext(store$g);
14820
15012
  const {
14821
15013
  t
14822
15014
  } = useTranslation("checkoutForm");
@@ -14850,7 +15042,7 @@ const CouponCodeField = props => {
14850
15042
  couponCode,
14851
15043
  couponError
14852
15044
  }
14853
- } = React.useContext(store$f);
15045
+ } = React.useContext(store$g);
14854
15046
 
14855
15047
  const onCouponCodeChange = e => {
14856
15048
  dispatch({
@@ -14879,17 +15071,17 @@ const CouponCodeField = props => {
14879
15071
  }, props));
14880
15072
  };
14881
15073
 
14882
- var _path$l;
15074
+ var _path$m;
14883
15075
 
14884
- 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); }
15076
+ 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); }
14885
15077
 
14886
15078
  function SvgTicket(props) {
14887
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15079
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14888
15080
  xmlns: "http://www.w3.org/2000/svg",
14889
15081
  fill: "none",
14890
15082
  viewBox: "0 0 24 24",
14891
15083
  stroke: "currentColor"
14892
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15084
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14893
15085
  strokeLinecap: "round",
14894
15086
  strokeLinejoin: "round",
14895
15087
  strokeWidth: 2,
@@ -14906,7 +15098,7 @@ const CouponCode = ({
14906
15098
  state: {
14907
15099
  enableCouponField
14908
15100
  }
14909
- } = React.useContext(store$f);
15101
+ } = React.useContext(store$g);
14910
15102
  const {
14911
15103
  t
14912
15104
  } = useTranslation("checkoutForm");
@@ -15163,7 +15355,7 @@ const PaypalSubscribeButton = props => {
15163
15355
  const {
15164
15356
  dispatch,
15165
15357
  state
15166
- } = React.useContext(store$f);
15358
+ } = React.useContext(store$g);
15167
15359
  const {
15168
15360
  product,
15169
15361
  plan,
@@ -15249,16 +15441,16 @@ const BankRedirection = () => {
15249
15441
  }));
15250
15442
  };
15251
15443
 
15252
- var _path$k;
15444
+ var _path$l;
15253
15445
 
15254
- 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); }
15446
+ 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); }
15255
15447
 
15256
15448
  function SvgLock(props) {
15257
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15449
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15258
15450
  xmlns: "http://www.w3.org/2000/svg",
15259
15451
  viewBox: "0 0 20 20",
15260
15452
  fill: "currentColor"
15261
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15453
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15262
15454
  fillRule: "evenodd",
15263
15455
  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",
15264
15456
  clipRule: "evenodd"
@@ -15275,7 +15467,7 @@ const SelectedPaymentMethod = () => {
15275
15467
  state: {
15276
15468
  isLoading
15277
15469
  }
15278
- } = React.useContext(store$f);
15470
+ } = React.useContext(store$g);
15279
15471
  const {
15280
15472
  switchView,
15281
15473
  selectedPaymentMethodId
@@ -15317,7 +15509,7 @@ const TaxAmount = () => {
15317
15509
  state: {
15318
15510
  taxAmount
15319
15511
  }
15320
- } = React.useContext(store$f);
15512
+ } = React.useContext(store$g);
15321
15513
  const {
15322
15514
  plan
15323
15515
  } = usePelcro();
@@ -15481,12 +15673,12 @@ function SubscriptionRenewModal({
15481
15673
  }
15482
15674
  SubscriptionRenewModal.viewId = "subscription-renew";
15483
15675
 
15484
- var _path$j;
15676
+ var _path$k;
15485
15677
 
15486
- 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); }
15678
+ 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); }
15487
15679
 
15488
15680
  function SvgGift(props) {
15489
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15681
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15490
15682
  className: "plc-w-6 plc-h-6 plc-mr-2",
15491
15683
  fill: "none",
15492
15684
  stroke: "currentColor",
@@ -15495,7 +15687,7 @@ function SvgGift(props) {
15495
15687
  strokeWidth: 2,
15496
15688
  viewBox: "0 0 24 24",
15497
15689
  xmlns: "http://www.w3.org/2000/svg"
15498
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15690
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15499
15691
  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"
15500
15692
  })));
15501
15693
  }
@@ -15836,7 +16028,7 @@ class DefaultNewsLetter extends React.Component {
15836
16028
 
15837
16029
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15838
16030
 
15839
- const initialState$e = {
16031
+ const initialState$f = {
15840
16032
  didSubToNewslettersBefore: false,
15841
16033
  newsletters: [],
15842
16034
  isListLoading: true,
@@ -15846,10 +16038,10 @@ const initialState$e = {
15846
16038
  content: ""
15847
16039
  }
15848
16040
  };
15849
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
16041
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
15850
16042
  const {
15851
- Provider: Provider$e
15852
- } = store$e;
16043
+ Provider: Provider$f
16044
+ } = store$f;
15853
16045
 
15854
16046
  const NewsletterUpdateContainer = ({
15855
16047
  style,
@@ -15962,7 +16154,7 @@ const NewsletterUpdateContainer = ({
15962
16154
  default:
15963
16155
  return state;
15964
16156
  }
15965
- }, initialState$e);
16157
+ }, initialState$f);
15966
16158
  React.useEffect(() => {
15967
16159
  const getUserNewsletters = () => {
15968
16160
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -16006,7 +16198,7 @@ const NewsletterUpdateContainer = ({
16006
16198
  style: { ...style
16007
16199
  },
16008
16200
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
16009
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16201
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
16010
16202
  value: {
16011
16203
  state,
16012
16204
  dispatch
@@ -16014,12 +16206,12 @@ const NewsletterUpdateContainer = ({
16014
16206
  }, children.length ? children.map((child, i) => {
16015
16207
  if (child) {
16016
16208
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
16017
- store: store$e,
16209
+ store: store$f,
16018
16210
  key: i
16019
16211
  });
16020
16212
  }
16021
16213
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16022
- store: store$e
16214
+ store: store$f
16023
16215
  })));
16024
16216
  };
16025
16217
 
@@ -16034,7 +16226,7 @@ const NewsletterUpdateButton = ({
16034
16226
  isSubmitting,
16035
16227
  isListLoading
16036
16228
  }
16037
- } = React.useContext(store$e);
16229
+ } = React.useContext(store$f);
16038
16230
  const {
16039
16231
  t
16040
16232
  } = useTranslation("newsletter");
@@ -16064,7 +16256,7 @@ const NewsletterUpdateList = () => {
16064
16256
  newsletters,
16065
16257
  isListLoading
16066
16258
  }
16067
- } = React.useContext(store$e);
16259
+ } = React.useContext(store$f);
16068
16260
 
16069
16261
  if (isListLoading) {
16070
16262
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -16268,7 +16460,7 @@ function SubscriptionCreateModal({
16268
16460
  SubscriptionCreateModal.viewId = "subscription-create";
16269
16461
 
16270
16462
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
16271
- const initialState$d = {
16463
+ const initialState$e = {
16272
16464
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
16273
16465
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
16274
16466
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -16281,10 +16473,10 @@ const initialState$d = {
16281
16473
  content: ""
16282
16474
  }
16283
16475
  };
16284
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16476
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
16285
16477
  const {
16286
- Provider: Provider$d
16287
- } = store$d;
16478
+ Provider: Provider$e
16479
+ } = store$e;
16288
16480
 
16289
16481
  const UserUpdateContainer = ({
16290
16482
  style,
@@ -16416,27 +16608,27 @@ const UserUpdateContainer = ({
16416
16608
  default:
16417
16609
  return state;
16418
16610
  }
16419
- }, initialState$d);
16611
+ }, initialState$e);
16420
16612
  return /*#__PURE__*/React__default['default'].createElement("div", {
16421
16613
  style: { ...style
16422
16614
  },
16423
16615
  className: `pelcro-container pelcro-user-update-container ${className}`
16424
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16616
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16425
16617
  value: {
16426
16618
  state,
16427
16619
  dispatch
16428
16620
  }
16429
16621
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16430
- store: store$d,
16622
+ store: store$e,
16431
16623
  key: i
16432
16624
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16433
- store: store$d
16625
+ store: store$e
16434
16626
  })));
16435
16627
  };
16436
16628
 
16437
16629
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16438
16630
  disabled: true,
16439
- store: store$d
16631
+ store: store$e
16440
16632
  }, props));
16441
16633
 
16442
16634
  const UserUpdateButton = ({
@@ -16449,7 +16641,7 @@ const UserUpdateButton = ({
16449
16641
  buttonDisabled
16450
16642
  },
16451
16643
  dispatch
16452
- } = React.useContext(store$d);
16644
+ } = React.useContext(store$e);
16453
16645
  const {
16454
16646
  t
16455
16647
  } = useTranslation("userEdit");
@@ -16466,11 +16658,11 @@ const UserUpdateButton = ({
16466
16658
  };
16467
16659
 
16468
16660
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16469
- store: store$d
16661
+ store: store$e
16470
16662
  }, props));
16471
16663
 
16472
16664
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16473
- store: store$d
16665
+ store: store$e
16474
16666
  }, props));
16475
16667
 
16476
16668
  function Phone({
@@ -16499,22 +16691,22 @@ function Phone({
16499
16691
  }
16500
16692
 
16501
16693
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16502
- store: store$d
16694
+ store: store$e
16503
16695
  }, props));
16504
16696
 
16505
16697
  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";
16506
16698
 
16507
- var _path$i;
16699
+ var _path$j;
16508
16700
 
16509
- 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); }
16701
+ 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); }
16510
16702
 
16511
16703
  function SvgEdit(props) {
16512
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
16704
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16513
16705
  className: "plc-w-6 plc-h-6",
16514
16706
  xmlns: "http://www.w3.org/2000/svg",
16515
16707
  viewBox: "0 0 20 20",
16516
16708
  fill: "currentColor"
16517
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
16709
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16518
16710
  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"
16519
16711
  })));
16520
16712
  }
@@ -16646,16 +16838,16 @@ function DisplayName({
16646
16838
  }
16647
16839
 
16648
16840
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16649
- store: store$d
16841
+ store: store$e
16650
16842
  }, props));
16651
16843
 
16652
16844
  const UserUpdateTextInput = props => {
16653
16845
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16654
- store: store$d
16846
+ store: store$e
16655
16847
  }));
16656
16848
  };
16657
16849
 
16658
- const initialState$c = {
16850
+ const initialState$d = {
16659
16851
  isSubmitting: false,
16660
16852
  firstName: "",
16661
16853
  firstNameError: "",
@@ -16680,10 +16872,10 @@ const initialState$c = {
16680
16872
  content: ""
16681
16873
  }
16682
16874
  };
16683
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
16875
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16684
16876
  const {
16685
- Provider: Provider$c
16686
- } = store$c;
16877
+ Provider: Provider$d
16878
+ } = store$d;
16687
16879
 
16688
16880
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16689
16881
 
@@ -16890,7 +17082,7 @@ const AddressCreateContainer = ({
16890
17082
  default:
16891
17083
  return state;
16892
17084
  }
16893
- }, initialState$c);
17085
+ }, initialState$d);
16894
17086
  React.useEffect(() => {
16895
17087
  const getStates = () => {
16896
17088
  dispatch({
@@ -16922,16 +17114,16 @@ const AddressCreateContainer = ({
16922
17114
  style: { ...style
16923
17115
  },
16924
17116
  className: `pelcro-container pelcro-address-create-container ${className}`
16925
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17117
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16926
17118
  value: {
16927
17119
  state,
16928
17120
  dispatch
16929
17121
  }
16930
17122
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16931
- store: store$c,
17123
+ store: store$d,
16932
17124
  key: i
16933
17125
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16934
- store: store$c
17126
+ store: store$d
16935
17127
  })));
16936
17128
  };
16937
17129
 
@@ -16942,7 +17134,7 @@ function AddressCreateFirstName(props) {
16942
17134
  firstName,
16943
17135
  firstNameError
16944
17136
  }
16945
- } = React.useContext(store$c);
17137
+ } = React.useContext(store$d);
16946
17138
 
16947
17139
  const handleBlur = () => {
16948
17140
  return dispatch({
@@ -16985,7 +17177,7 @@ function AddressCreateLastName(props) {
16985
17177
  lastName,
16986
17178
  lastNameError
16987
17179
  }
16988
- } = React.useContext(store$c);
17180
+ } = React.useContext(store$d);
16989
17181
 
16990
17182
  const handleBlur = () => {
16991
17183
  return dispatch({
@@ -17028,7 +17220,7 @@ function AddressCreateLine1(props) {
17028
17220
  line1,
17029
17221
  line1Error
17030
17222
  }
17031
- } = React.useContext(store$c);
17223
+ } = React.useContext(store$d);
17032
17224
 
17033
17225
  const handleBlur = () => {
17034
17226
  return dispatch({
@@ -17071,7 +17263,7 @@ function AddressCreateCity(props) {
17071
17263
  city,
17072
17264
  cityError
17073
17265
  }
17074
- } = React.useContext(store$c);
17266
+ } = React.useContext(store$d);
17075
17267
 
17076
17268
  const handleBlur = () => {
17077
17269
  return dispatch({
@@ -17114,7 +17306,7 @@ function AddressCreatePostalCode(props) {
17114
17306
  postalCode,
17115
17307
  postalCodeError
17116
17308
  }
17117
- } = React.useContext(store$c);
17309
+ } = React.useContext(store$d);
17118
17310
 
17119
17311
  const handleBlur = () => {
17120
17312
  return dispatch({
@@ -17160,7 +17352,7 @@ const AddressCreateSubmit = ({
17160
17352
  state: {
17161
17353
  isSubmitting
17162
17354
  }
17163
- } = React.useContext(store$c);
17355
+ } = React.useContext(store$d);
17164
17356
  const {
17165
17357
  t
17166
17358
  } = useTranslation("address");
@@ -17271,7 +17463,7 @@ function CountrySelect({
17271
17463
  }
17272
17464
 
17273
17465
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17274
- store: store$c
17466
+ store: store$d
17275
17467
  }, props));
17276
17468
 
17277
17469
  function StateSelect({
@@ -17359,7 +17551,7 @@ function StateSelect({
17359
17551
  }
17360
17552
 
17361
17553
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17362
- store: store$c
17554
+ store: store$d
17363
17555
  }, props));
17364
17556
 
17365
17557
  const AddressCreateView = props => {
@@ -17464,18 +17656,18 @@ AddressCreateModal.viewId = "address-create";
17464
17656
 
17465
17657
  const AddressCreateTextInput = props => {
17466
17658
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17467
- store: store$c
17659
+ store: store$d
17468
17660
  }));
17469
17661
  };
17470
17662
 
17471
17663
  const AddressCreateLine2 = props => {
17472
17664
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17473
17665
  fieldName: "line2",
17474
- store: store$c
17666
+ store: store$d
17475
17667
  }, props));
17476
17668
  };
17477
17669
 
17478
- const initialState$b = {
17670
+ const initialState$c = {
17479
17671
  isSubmitting: false,
17480
17672
  firstName: "",
17481
17673
  firstNameError: "",
@@ -17500,10 +17692,10 @@ const initialState$b = {
17500
17692
  content: ""
17501
17693
  }
17502
17694
  };
17503
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
17695
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
17504
17696
  const {
17505
- Provider: Provider$b
17506
- } = store$b;
17697
+ Provider: Provider$c
17698
+ } = store$c;
17507
17699
 
17508
17700
  const AddressUpdateContainer = ({
17509
17701
  style,
@@ -17555,7 +17747,7 @@ const AddressUpdateContainer = ({
17555
17747
  const thisAddress = addresses[address];
17556
17748
 
17557
17749
  if (+thisAddress.id === +addressId) {
17558
- const newState = { ...initialState$b,
17750
+ const newState = { ...initialState$c,
17559
17751
  firstName: thisAddress.first_name,
17560
17752
  lastName: thisAddress.last_name,
17561
17753
  line1: thisAddress.line1,
@@ -17688,7 +17880,7 @@ const AddressUpdateContainer = ({
17688
17880
  default:
17689
17881
  return state;
17690
17882
  }
17691
- }, initialState$b);
17883
+ }, initialState$c);
17692
17884
  React.useEffect(() => {
17693
17885
  const getStates = () => {
17694
17886
  dispatch({
@@ -17720,21 +17912,21 @@ const AddressUpdateContainer = ({
17720
17912
  style: { ...style
17721
17913
  },
17722
17914
  className: `pelcro-container pelcro-address-update-container ${className}`
17723
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17915
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17724
17916
  value: {
17725
17917
  state,
17726
17918
  dispatch
17727
17919
  }
17728
17920
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17729
- store: store$b,
17921
+ store: store$c,
17730
17922
  key: i
17731
17923
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17732
- store: store$b
17924
+ store: store$c
17733
17925
  })));
17734
17926
  };
17735
17927
 
17736
17928
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17737
- store: store$b
17929
+ store: store$c
17738
17930
  }, props));
17739
17931
 
17740
17932
  function AddressUpdateFirstName(props) {
@@ -17744,7 +17936,7 @@ function AddressUpdateFirstName(props) {
17744
17936
  firstName,
17745
17937
  firstNameError
17746
17938
  }
17747
- } = React.useContext(store$b);
17939
+ } = React.useContext(store$c);
17748
17940
 
17749
17941
  const handleBlur = () => {
17750
17942
  return dispatch({
@@ -17787,7 +17979,7 @@ function AddressUpdateLastName(props) {
17787
17979
  lastName,
17788
17980
  lastNameError
17789
17981
  }
17790
- } = React.useContext(store$b);
17982
+ } = React.useContext(store$c);
17791
17983
 
17792
17984
  const handleBlur = () => {
17793
17985
  return dispatch({
@@ -17830,7 +18022,7 @@ function AddressUpdateLine1(props) {
17830
18022
  line1,
17831
18023
  line1Error
17832
18024
  }
17833
- } = React.useContext(store$b);
18025
+ } = React.useContext(store$c);
17834
18026
 
17835
18027
  const handleBlur = () => {
17836
18028
  return dispatch({
@@ -17870,7 +18062,7 @@ const AddressUpdateLine2 = props => {
17870
18062
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17871
18063
  fieldName: "line2"
17872
18064
  }, props, {
17873
- store: store$b
18065
+ store: store$c
17874
18066
  }));
17875
18067
  };
17876
18068
 
@@ -17881,7 +18073,7 @@ function AddressUpdateCity(props) {
17881
18073
  city,
17882
18074
  cityError
17883
18075
  }
17884
- } = React.useContext(store$b);
18076
+ } = React.useContext(store$c);
17885
18077
 
17886
18078
  const handleBlur = () => {
17887
18079
  return dispatch({
@@ -17924,7 +18116,7 @@ function AddressUpdatePostalCode(props) {
17924
18116
  postalCode,
17925
18117
  postalCodeError
17926
18118
  }
17927
- } = React.useContext(store$b);
18119
+ } = React.useContext(store$c);
17928
18120
 
17929
18121
  const handleBlur = () => {
17930
18122
  return dispatch({
@@ -17970,7 +18162,7 @@ const AddressUpdateSubmit = ({
17970
18162
  state: {
17971
18163
  isSubmitting
17972
18164
  }
17973
- } = React.useContext(store$b);
18165
+ } = React.useContext(store$c);
17974
18166
  const {
17975
18167
  t
17976
18168
  } = useTranslation("address");
@@ -17986,7 +18178,7 @@ const AddressUpdateSubmit = ({
17986
18178
  };
17987
18179
 
17988
18180
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17989
- store: store$b
18181
+ store: store$c
17990
18182
  }, props));
17991
18183
 
17992
18184
  const AddressUpdateView = props => {
@@ -18069,7 +18261,7 @@ AddressUpdateModal.viewId = "address-edit";
18069
18261
 
18070
18262
  const AddressUpdateTextInput = props => {
18071
18263
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
18072
- store: store$b
18264
+ store: store$c
18073
18265
  }));
18074
18266
  };
18075
18267
 
@@ -18152,7 +18344,7 @@ const PaymentMethodUpdateModal = props => {
18152
18344
  };
18153
18345
  PaymentMethodUpdateModal.viewId = "payment-method-update";
18154
18346
 
18155
- const initialState$a = {
18347
+ const initialState$b = {
18156
18348
  email: "",
18157
18349
  password: "",
18158
18350
  passwordError: null,
@@ -18165,10 +18357,10 @@ const initialState$a = {
18165
18357
  content: ""
18166
18358
  }
18167
18359
  };
18168
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
18360
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
18169
18361
  const {
18170
- Provider: Provider$a
18171
- } = store$a;
18362
+ Provider: Provider$b
18363
+ } = store$b;
18172
18364
 
18173
18365
  const PasswordResetContainer = ({
18174
18366
  style,
@@ -18225,7 +18417,7 @@ const PasswordResetContainer = ({
18225
18417
  type: SET_EMAIL,
18226
18418
  payload: window.Pelcro.helpers.getURLParameter("email")
18227
18419
  });
18228
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18420
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
18229
18421
  dispatch({
18230
18422
  type: SET_TOKEN,
18231
18423
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -18285,26 +18477,26 @@ const PasswordResetContainer = ({
18285
18477
  default:
18286
18478
  return state;
18287
18479
  }
18288
- }, initialState$a);
18480
+ }, initialState$b);
18289
18481
  return /*#__PURE__*/React__default['default'].createElement("div", {
18290
18482
  style: { ...style
18291
18483
  },
18292
18484
  className: `pelcro-container pelcro-password-reset-container ${className}`
18293
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18485
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
18294
18486
  value: {
18295
18487
  state,
18296
18488
  dispatch
18297
18489
  }
18298
18490
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18299
- store: store$a,
18491
+ store: store$b,
18300
18492
  key: i
18301
18493
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18302
- store: store$a
18494
+ store: store$b
18303
18495
  })));
18304
18496
  };
18305
18497
 
18306
18498
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
18307
- store: store$a
18499
+ store: store$b
18308
18500
  }, props));
18309
18501
 
18310
18502
  const PasswordResetButton = ({
@@ -18317,7 +18509,7 @@ const PasswordResetButton = ({
18317
18509
  buttonDisabled
18318
18510
  },
18319
18511
  dispatch
18320
- } = React.useContext(store$a);
18512
+ } = React.useContext(store$b);
18321
18513
  const {
18322
18514
  t
18323
18515
  } = useTranslation("passwordReset");
@@ -18334,14 +18526,14 @@ const PasswordResetButton = ({
18334
18526
  };
18335
18527
 
18336
18528
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18337
- store: store$a
18529
+ store: store$b
18338
18530
  }, props, {
18339
18531
  value: window.Pelcro.helpers.getURLParameter("email"),
18340
18532
  disabled: true
18341
18533
  }));
18342
18534
 
18343
18535
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
18344
- store: store$a
18536
+ store: store$b
18345
18537
  }, props));
18346
18538
 
18347
18539
  const PasswordResetView = props => {
@@ -18393,7 +18585,7 @@ const PasswordResetModal = ({
18393
18585
  };
18394
18586
  PasswordResetModal.viewId = "password-reset";
18395
18587
 
18396
- const initialState$9 = {
18588
+ const initialState$a = {
18397
18589
  email: "",
18398
18590
  emailError: null,
18399
18591
  buttonDisabled: false,
@@ -18402,10 +18594,10 @@ const initialState$9 = {
18402
18594
  content: ""
18403
18595
  }
18404
18596
  };
18405
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18597
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
18406
18598
  const {
18407
- Provider: Provider$9
18408
- } = store$9;
18599
+ Provider: Provider$a
18600
+ } = store$a;
18409
18601
 
18410
18602
  const PasswordForgotContainer = ({
18411
18603
  style,
@@ -18483,21 +18675,21 @@ const PasswordForgotContainer = ({
18483
18675
  default:
18484
18676
  return state;
18485
18677
  }
18486
- }, initialState$9);
18678
+ }, initialState$a);
18487
18679
  return /*#__PURE__*/React__default['default'].createElement("div", {
18488
18680
  style: { ...style
18489
18681
  },
18490
18682
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18491
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18683
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18492
18684
  value: {
18493
18685
  state,
18494
18686
  dispatch
18495
18687
  }
18496
18688
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18497
- store: store$9,
18689
+ store: store$a,
18498
18690
  key: i
18499
18691
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18500
- store: store$9
18692
+ store: store$a
18501
18693
  })));
18502
18694
  };
18503
18695
 
@@ -18513,7 +18705,7 @@ const PasswordForgotButton = ({
18513
18705
  emailError
18514
18706
  },
18515
18707
  dispatch
18516
- } = React.useContext(store$9);
18708
+ } = React.useContext(store$a);
18517
18709
  const {
18518
18710
  t
18519
18711
  } = useTranslation("passwordForgot");
@@ -18534,7 +18726,7 @@ const PasswordForgotButton = ({
18534
18726
  };
18535
18727
 
18536
18728
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18537
- store: store$9
18729
+ store: store$a
18538
18730
  }, props));
18539
18731
 
18540
18732
  const PasswordForgotView = props => {
@@ -18584,7 +18776,7 @@ const PasswordForgotModal = ({
18584
18776
  };
18585
18777
  PasswordForgotModal.viewId = "password-forgot";
18586
18778
 
18587
- const initialState$8 = {
18779
+ const initialState$9 = {
18588
18780
  currentPassword: "",
18589
18781
  newPassword: "",
18590
18782
  confirmNewPassword: "",
@@ -18598,10 +18790,10 @@ const initialState$8 = {
18598
18790
  content: ""
18599
18791
  }
18600
18792
  };
18601
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18793
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18602
18794
  const {
18603
- Provider: Provider$8
18604
- } = store$8;
18795
+ Provider: Provider$9
18796
+ } = store$9;
18605
18797
  const PasswordChangeContainer = ({
18606
18798
  style,
18607
18799
  className = "",
@@ -18753,21 +18945,21 @@ const PasswordChangeContainer = ({
18753
18945
  default:
18754
18946
  return state;
18755
18947
  }
18756
- }, initialState$8);
18948
+ }, initialState$9);
18757
18949
  return /*#__PURE__*/React__default['default'].createElement("div", {
18758
18950
  style: { ...style
18759
18951
  },
18760
18952
  className: `pelcro-container pelcro-password-change-container ${className}`
18761
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18953
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18762
18954
  value: {
18763
18955
  state,
18764
18956
  dispatch
18765
18957
  }
18766
18958
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18767
- store: store$8,
18959
+ store: store$9,
18768
18960
  key: i
18769
18961
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18770
- store: store$8
18962
+ store: store$9
18771
18963
  })));
18772
18964
  };
18773
18965
 
@@ -18778,7 +18970,7 @@ function PasswordChangeCurrentPassword(props) {
18778
18970
  currentPassword,
18779
18971
  currentPasswordError
18780
18972
  }
18781
- } = React.useContext(store$8);
18973
+ } = React.useContext(store$9);
18782
18974
  const handleBlur = React.useCallback(() => {
18783
18975
  return dispatch({
18784
18976
  type: VALIDATE_PASSWORD
@@ -18812,7 +19004,7 @@ function PasswordChangeNewPassword(props) {
18812
19004
  newPassword,
18813
19005
  newPasswordError
18814
19006
  }
18815
- } = React.useContext(store$8);
19007
+ } = React.useContext(store$9);
18816
19008
  const handleBlur = React.useCallback(() => {
18817
19009
  return dispatch({
18818
19010
  type: VALIDATE_NEW_PASSWORD
@@ -18846,7 +19038,7 @@ function PasswordChangeConfirmNewPassword(props) {
18846
19038
  confirmNewPassword,
18847
19039
  confirmNewPasswordError
18848
19040
  }
18849
- } = React.useContext(store$8);
19041
+ } = React.useContext(store$9);
18850
19042
  const handleBlur = React.useCallback(() => {
18851
19043
  return dispatch({
18852
19044
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18887,7 +19079,7 @@ const PasswordChangeButton = ({
18887
19079
  confirmNewPasswordError
18888
19080
  },
18889
19081
  dispatch
18890
- } = React.useContext(store$8);
19082
+ } = React.useContext(store$9);
18891
19083
  const {
18892
19084
  t
18893
19085
  } = useTranslation("passwordChange");
@@ -18953,17 +19145,17 @@ const PasswordChangeModal = ({
18953
19145
  };
18954
19146
  PasswordChangeModal.viewId = "password-change";
18955
19147
 
18956
- const initialState$7 = {
19148
+ const initialState$8 = {
18957
19149
  buttonDisabled: false,
18958
19150
  alert: {
18959
19151
  type: "error",
18960
19152
  content: ""
18961
19153
  }
18962
19154
  };
18963
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19155
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18964
19156
  const {
18965
- Provider: Provider$7
18966
- } = store$7;
19157
+ Provider: Provider$8
19158
+ } = store$8;
18967
19159
 
18968
19160
  const CartContainer = ({
18969
19161
  style,
@@ -19054,21 +19246,21 @@ const CartContainer = ({
19054
19246
  default:
19055
19247
  return state;
19056
19248
  }
19057
- }, initialState$7);
19249
+ }, initialState$8);
19058
19250
  return /*#__PURE__*/React__default['default'].createElement("div", {
19059
19251
  style: { ...style
19060
19252
  },
19061
19253
  className: `pelcro-container pelcro-cart-container ${className}`
19062
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19254
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
19063
19255
  value: {
19064
19256
  state,
19065
19257
  dispatch
19066
19258
  }
19067
19259
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19068
- store: store$7,
19260
+ store: store$8,
19069
19261
  key: i
19070
19262
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19071
- store: store$7
19263
+ store: store$8
19072
19264
  })));
19073
19265
  };
19074
19266
 
@@ -19105,7 +19297,7 @@ const CartSubmit = ({
19105
19297
  buttonDisabled
19106
19298
  },
19107
19299
  dispatch
19108
- } = React.useContext(store$7);
19300
+ } = React.useContext(store$8);
19109
19301
  const {
19110
19302
  t
19111
19303
  } = useTranslation("cart");
@@ -19136,7 +19328,7 @@ const CartTotalPrice = () => {
19136
19328
  state: {
19137
19329
  alert
19138
19330
  }
19139
- } = React.useContext(store$7);
19331
+ } = React.useContext(store$8);
19140
19332
  const {
19141
19333
  cartItems
19142
19334
  } = usePelcro();
@@ -19449,7 +19641,7 @@ const OrderConfirmModal = props => {
19449
19641
  };
19450
19642
  OrderConfirmModal.viewId = "order-confirm";
19451
19643
 
19452
- const initialState$6 = {
19644
+ const initialState$7 = {
19453
19645
  email: "",
19454
19646
  firstName: "",
19455
19647
  lastName: "",
@@ -19461,10 +19653,10 @@ const initialState$6 = {
19461
19653
  content: ""
19462
19654
  }
19463
19655
  };
19464
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19656
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19465
19657
  const {
19466
- Provider: Provider$6
19467
- } = store$6;
19658
+ Provider: Provider$7
19659
+ } = store$7;
19468
19660
 
19469
19661
  const GiftCreateContainer = ({
19470
19662
  style,
@@ -19568,21 +19760,21 @@ const GiftCreateContainer = ({
19568
19760
  default:
19569
19761
  return state;
19570
19762
  }
19571
- }, initialState$6);
19763
+ }, initialState$7);
19572
19764
  return /*#__PURE__*/React__default['default'].createElement("div", {
19573
19765
  style: { ...style
19574
19766
  },
19575
19767
  className: `pelcro-container pelcro-gift-create-container ${className}`
19576
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19768
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19577
19769
  value: {
19578
19770
  state,
19579
19771
  dispatch
19580
19772
  }
19581
19773
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19582
- store: store$6,
19774
+ store: store$7,
19583
19775
  key: i
19584
19776
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19585
- store: store$6
19777
+ store: store$7
19586
19778
  })));
19587
19779
  };
19588
19780
 
@@ -19596,7 +19788,7 @@ const GiftCreateSubmitButton = ({
19596
19788
  state: {
19597
19789
  disableSubmit
19598
19790
  }
19599
- } = React.useContext(store$6);
19791
+ } = React.useContext(store$7);
19600
19792
  const {
19601
19793
  t
19602
19794
  } = useTranslation("register");
@@ -19613,29 +19805,29 @@ const GiftCreateSubmitButton = ({
19613
19805
 
19614
19806
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19615
19807
  initWithUserEmail: false,
19616
- store: store$6
19808
+ store: store$7
19617
19809
  }, props));
19618
19810
 
19619
19811
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19620
- store: store$6
19812
+ store: store$7
19621
19813
  }, props));
19622
19814
 
19623
19815
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19624
- store: store$6
19816
+ store: store$7
19625
19817
  }, props));
19626
19818
 
19627
- var _path$h;
19819
+ var _path$i;
19628
19820
 
19629
- 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); }
19821
+ 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); }
19630
19822
 
19631
19823
  function SvgInfoCircle(props) {
19632
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
19824
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19633
19825
  xmlns: "http://www.w3.org/2000/svg",
19634
19826
  className: "plc-w-5 plc-h-5",
19635
19827
  fill: "none",
19636
19828
  viewBox: "0 0 24 24",
19637
19829
  stroke: "currentColor"
19638
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
19830
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19639
19831
  strokeLinecap: "round",
19640
19832
  strokeLinejoin: "round",
19641
19833
  strokeWidth: 2,
@@ -19706,7 +19898,7 @@ const GiftCreateStartDate = props => {
19706
19898
  const {
19707
19899
  dispatch,
19708
19900
  state
19709
- } = React.useContext(store$6);
19901
+ } = React.useContext(store$7);
19710
19902
 
19711
19903
  const handleInputChange = value => {
19712
19904
  dispatch({
@@ -19779,7 +19971,7 @@ function GiftCreateMessage(props) {
19779
19971
  const {
19780
19972
  dispatch,
19781
19973
  state
19782
- } = React.useContext(store$6);
19974
+ } = React.useContext(store$7);
19783
19975
  const MAX_CHARS_COUNT = 200;
19784
19976
  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;
19785
19977
 
@@ -19903,7 +20095,7 @@ const GiftCreateModal = ({
19903
20095
  };
19904
20096
  GiftCreateModal.viewId = "gift-create";
19905
20097
 
19906
- const initialState$5 = {
20098
+ const initialState$6 = {
19907
20099
  giftCode: "",
19908
20100
  buttonDisabled: true,
19909
20101
  alert: {
@@ -19911,10 +20103,10 @@ const initialState$5 = {
19911
20103
  content: ""
19912
20104
  }
19913
20105
  };
19914
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20106
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19915
20107
  const {
19916
- Provider: Provider$5
19917
- } = store$5;
20108
+ Provider: Provider$6
20109
+ } = store$6;
19918
20110
 
19919
20111
  const GiftRedeemContainer = ({
19920
20112
  style,
@@ -19979,21 +20171,21 @@ const GiftRedeemContainer = ({
19979
20171
  default:
19980
20172
  return state;
19981
20173
  }
19982
- }, initialState$5);
20174
+ }, initialState$6);
19983
20175
  return /*#__PURE__*/React__default['default'].createElement("div", {
19984
20176
  style: { ...style
19985
20177
  },
19986
20178
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19987
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20179
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19988
20180
  value: {
19989
20181
  state,
19990
20182
  dispatch
19991
20183
  }
19992
20184
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19993
- store: store$5,
20185
+ store: store$6,
19994
20186
  key: i
19995
20187
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19996
- store: store$5
20188
+ store: store$6
19997
20189
  })));
19998
20190
  };
19999
20191
 
@@ -20030,7 +20222,7 @@ function GiftCode({
20030
20222
  }
20031
20223
 
20032
20224
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
20033
- store: store$5
20225
+ store: store$6
20034
20226
  }, props));
20035
20227
 
20036
20228
  const GiftRedeemSubmitButton = ({
@@ -20043,7 +20235,7 @@ const GiftRedeemSubmitButton = ({
20043
20235
  state: {
20044
20236
  disableSubmit
20045
20237
  }
20046
- } = React.useContext(store$5);
20238
+ } = React.useContext(store$6);
20047
20239
  const {
20048
20240
  t
20049
20241
  } = useTranslation("register");
@@ -20136,7 +20328,7 @@ const moveDefaultAddressToStart = addresses => {
20136
20328
  return [defaultAddress, ...addressesWithoutDefault];
20137
20329
  };
20138
20330
 
20139
- const initialState$4 = {
20331
+ const initialState$5 = {
20140
20332
  addresses: [],
20141
20333
  selectedAddressId: null,
20142
20334
  isSubmitting: false,
@@ -20145,10 +20337,10 @@ const initialState$4 = {
20145
20337
  content: ""
20146
20338
  }
20147
20339
  };
20148
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20340
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20149
20341
  const {
20150
- Provider: Provider$4
20151
- } = store$4;
20342
+ Provider: Provider$5
20343
+ } = store$5;
20152
20344
 
20153
20345
  const AddressSelectContainer = ({
20154
20346
  style,
@@ -20243,7 +20435,7 @@ const AddressSelectContainer = ({
20243
20435
  default:
20244
20436
  return state;
20245
20437
  }
20246
- }, initialState$4);
20438
+ }, initialState$5);
20247
20439
  React.useEffect(() => {
20248
20440
  var _window$Pelcro$user$r;
20249
20441
 
@@ -20256,16 +20448,16 @@ const AddressSelectContainer = ({
20256
20448
  style: { ...style
20257
20449
  },
20258
20450
  className: `pelcro-container pelcro-address-select-container ${className}`
20259
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20451
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20260
20452
  value: {
20261
20453
  state,
20262
20454
  dispatch
20263
20455
  }
20264
20456
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20265
- store: store$4,
20457
+ store: store$5,
20266
20458
  key: i
20267
20459
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20268
- store: store$4
20460
+ store: store$5
20269
20461
  })));
20270
20462
  };
20271
20463
 
@@ -20276,7 +20468,7 @@ const AddressSelectList = () => {
20276
20468
  addresses,
20277
20469
  selectedAddressId
20278
20470
  }
20279
- } = React.useContext(store$4);
20471
+ } = React.useContext(store$5);
20280
20472
 
20281
20473
  const handleAddressSelect = event => {
20282
20474
  dispatch({
@@ -20320,7 +20512,7 @@ const AddressSelectSubmit = ({
20320
20512
  selectedAddressId,
20321
20513
  isSubmitting
20322
20514
  }
20323
- } = React.useContext(store$4);
20515
+ } = React.useContext(store$5);
20324
20516
  const {
20325
20517
  t
20326
20518
  } = useTranslation("address");
@@ -20416,7 +20608,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20416
20608
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20417
20609
  };
20418
20610
 
20419
- const initialState$3 = {
20611
+ const initialState$4 = {
20420
20612
  paymentMethods: [],
20421
20613
  selectedPaymentMethodId: null,
20422
20614
  isSubmitting: false,
@@ -20425,10 +20617,10 @@ const initialState$3 = {
20425
20617
  content: ""
20426
20618
  }
20427
20619
  };
20428
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20620
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20429
20621
  const {
20430
- Provider: Provider$3
20431
- } = store$3;
20622
+ Provider: Provider$4
20623
+ } = store$4;
20432
20624
 
20433
20625
  const PaymentMethodSelectContainer = ({
20434
20626
  style,
@@ -20487,7 +20679,7 @@ const PaymentMethodSelectContainer = ({
20487
20679
  default:
20488
20680
  return state;
20489
20681
  }
20490
- }, initialState$3);
20682
+ }, initialState$4);
20491
20683
  React.useEffect(() => {
20492
20684
  var _window$Pelcro$user$r3;
20493
20685
 
@@ -20500,16 +20692,16 @@ const PaymentMethodSelectContainer = ({
20500
20692
  style: { ...style
20501
20693
  },
20502
20694
  className: `pelcro-container pelcro-payment-select-container ${className}`
20503
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20695
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20504
20696
  value: {
20505
20697
  state,
20506
20698
  dispatch
20507
20699
  }
20508
20700
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20509
- store: store$3,
20701
+ store: store$4,
20510
20702
  key: i
20511
20703
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20512
- store: store$3
20704
+ store: store$4
20513
20705
  })));
20514
20706
  };
20515
20707
 
@@ -20523,7 +20715,7 @@ const PaymentMethodSelectList = () => {
20523
20715
  paymentMethods,
20524
20716
  selectedPaymentMethodId
20525
20717
  }
20526
- } = React.useContext(store$3);
20718
+ } = React.useContext(store$4);
20527
20719
 
20528
20720
  const handlePaymentMethodSelect = event => {
20529
20721
  dispatch({
@@ -20573,7 +20765,7 @@ const PaymentMethodSelectSubmit = ({
20573
20765
  selectedPaymentMethodId,
20574
20766
  isSubmitting
20575
20767
  }
20576
- } = React.useContext(store$3);
20768
+ } = React.useContext(store$4);
20577
20769
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20578
20770
  onClick: () => {
20579
20771
  dispatch({
@@ -20647,8 +20839,8 @@ const PaymentMethodSelectModal = ({
20647
20839
  };
20648
20840
  PaymentMethodSelectModal.viewId = "payment-method-select";
20649
20841
 
20650
- function _extends$i() {
20651
- _extends$i = Object.assign || function (target) {
20842
+ function _extends$j() {
20843
+ _extends$j = Object.assign || function (target) {
20652
20844
  for (var i = 1; i < arguments.length; i++) {
20653
20845
  var source = arguments[i];
20654
20846
 
@@ -20662,7 +20854,7 @@ function _extends$i() {
20662
20854
  return target;
20663
20855
  };
20664
20856
 
20665
- return _extends$i.apply(this, arguments);
20857
+ return _extends$j.apply(this, arguments);
20666
20858
  }
20667
20859
 
20668
20860
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20846,7 +21038,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20846
21038
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20847
21039
  return null;
20848
21040
  }, _match[RenderStrategy.Hidden] = function () {
20849
- return _render(_extends$i({}, _rest, {
21041
+ return _render(_extends$j({}, _rest, {
20850
21042
  hidden: true,
20851
21043
  style: {
20852
21044
  display: 'none'
@@ -21374,7 +21566,7 @@ function TransitionChild(props) {
21374
21566
  var passthroughProps = rest;
21375
21567
  return React__default['default'].createElement(NestingContext.Provider, {
21376
21568
  value: nesting
21377
- }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21569
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21378
21570
  }
21379
21571
 
21380
21572
  function Transition(props) {
@@ -21418,7 +21610,7 @@ function Transition(props) {
21418
21610
  value: nestingBag
21419
21611
  }, React__default['default'].createElement(TransitionContext.Provider, {
21420
21612
  value: transitionBag
21421
- }, render(_extends$i({}, sharedProps, {
21613
+ }, render(_extends$j({}, sharedProps, {
21422
21614
  as: React.Fragment,
21423
21615
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21424
21616
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21545,12 +21737,12 @@ var ActionTypes;
21545
21737
  })(ActionTypes || (ActionTypes = {}));
21546
21738
 
21547
21739
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21548
- return _extends$i({}, state, {
21740
+ return _extends$j({}, state, {
21549
21741
  activeItemIndex: null,
21550
21742
  menuState: MenuStates.Closed
21551
21743
  });
21552
21744
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21553
- return _extends$i({}, state, {
21745
+ return _extends$j({}, state, {
21554
21746
  menuState: MenuStates.Open
21555
21747
  });
21556
21748
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21569,7 +21761,7 @@ var ActionTypes;
21569
21761
  }
21570
21762
  });
21571
21763
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21572
- return _extends$i({}, state, {
21764
+ return _extends$j({}, state, {
21573
21765
  searchQuery: '',
21574
21766
  activeItemIndex: activeItemIndex
21575
21767
  });
@@ -21580,19 +21772,19 @@ var ActionTypes;
21580
21772
 
21581
21773
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21582
21774
  });
21583
- if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21775
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21584
21776
  searchQuery: searchQuery
21585
21777
  });
21586
- return _extends$i({}, state, {
21778
+ return _extends$j({}, state, {
21587
21779
  searchQuery: searchQuery,
21588
21780
  activeItemIndex: match
21589
21781
  });
21590
21782
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21591
- return _extends$i({}, state, {
21783
+ return _extends$j({}, state, {
21592
21784
  searchQuery: ''
21593
21785
  });
21594
21786
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21595
- return _extends$i({}, state, {
21787
+ return _extends$j({}, state, {
21596
21788
  items: [].concat(state.items, [{
21597
21789
  id: action.id,
21598
21790
  dataRef: action.dataRef
@@ -21605,7 +21797,7 @@ var ActionTypes;
21605
21797
  return a.id === action.id;
21606
21798
  });
21607
21799
  if (idx !== -1) nextItems.splice(idx, 1);
21608
- return _extends$i({}, state, {
21800
+ return _extends$j({}, state, {
21609
21801
  items: nextItems,
21610
21802
  activeItemIndex: function () {
21611
21803
  if (idx === state.activeItemIndex) return null;
@@ -21644,19 +21836,19 @@ var ActionTypes$1;
21644
21836
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21645
21837
  if (state.disabled) return state;
21646
21838
  if (state.listboxState === ListboxStates.Closed) return state;
21647
- return _extends$i({}, state, {
21839
+ return _extends$j({}, state, {
21648
21840
  activeOptionIndex: null,
21649
21841
  listboxState: ListboxStates.Closed
21650
21842
  });
21651
21843
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21652
21844
  if (state.disabled) return state;
21653
21845
  if (state.listboxState === ListboxStates.Open) return state;
21654
- return _extends$i({}, state, {
21846
+ return _extends$j({}, state, {
21655
21847
  listboxState: ListboxStates.Open
21656
21848
  });
21657
21849
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21658
21850
  if (state.disabled === action.disabled) return state;
21659
- return _extends$i({}, state, {
21851
+ return _extends$j({}, state, {
21660
21852
  disabled: action.disabled
21661
21853
  });
21662
21854
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21677,7 +21869,7 @@ var ActionTypes$1;
21677
21869
  }
21678
21870
  });
21679
21871
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21680
- return _extends$i({}, state, {
21872
+ return _extends$j({}, state, {
21681
21873
  searchQuery: '',
21682
21874
  activeOptionIndex: activeOptionIndex
21683
21875
  });
@@ -21690,10 +21882,10 @@ var ActionTypes$1;
21690
21882
 
21691
21883
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21692
21884
  });
21693
- if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21885
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21694
21886
  searchQuery: searchQuery
21695
21887
  });
21696
- return _extends$i({}, state, {
21888
+ return _extends$j({}, state, {
21697
21889
  searchQuery: searchQuery,
21698
21890
  activeOptionIndex: match
21699
21891
  });
@@ -21701,11 +21893,11 @@ var ActionTypes$1;
21701
21893
  if (state.disabled) return state;
21702
21894
  if (state.listboxState === ListboxStates.Closed) return state;
21703
21895
  if (state.searchQuery === '') return state;
21704
- return _extends$i({}, state, {
21896
+ return _extends$j({}, state, {
21705
21897
  searchQuery: ''
21706
21898
  });
21707
21899
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21708
- return _extends$i({}, state, {
21900
+ return _extends$j({}, state, {
21709
21901
  options: [].concat(state.options, [{
21710
21902
  id: action.id,
21711
21903
  dataRef: action.dataRef
@@ -21718,7 +21910,7 @@ var ActionTypes$1;
21718
21910
  return a.id === action.id;
21719
21911
  });
21720
21912
  if (idx !== -1) nextOptions.splice(idx, 1);
21721
- return _extends$i({}, state, {
21913
+ return _extends$j({}, state, {
21722
21914
  options: nextOptions,
21723
21915
  activeOptionIndex: function () {
21724
21916
  if (idx === state.activeOptionIndex) return null;
@@ -21779,18 +21971,18 @@ const getPaymentCardIcon = name => {
21779
21971
  }));
21780
21972
  };
21781
21973
 
21782
- var _path$g;
21974
+ var _path$h;
21783
21975
 
21784
- 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); }
21976
+ 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); }
21785
21977
 
21786
21978
  function SvgChevronRight(props) {
21787
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21979
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21788
21980
  className: "plc-w-6 plc-h-6",
21789
21981
  xmlns: "http://www.w3.org/2000/svg",
21790
21982
  fill: "none",
21791
21983
  viewBox: "0 0 24 24",
21792
21984
  stroke: "currentColor"
21793
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21985
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21794
21986
  strokeLinecap: "round",
21795
21987
  strokeLinejoin: "round",
21796
21988
  strokeWidth: 2,
@@ -22006,18 +22198,18 @@ const SavedItems = ({
22006
22198
  });
22007
22199
  };
22008
22200
 
22009
- var _path$f;
22201
+ var _path$g;
22010
22202
 
22011
- 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); }
22203
+ 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); }
22012
22204
 
22013
22205
  function SvgRefresh(props) {
22014
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22206
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
22015
22207
  className: "plc-w-4 plc-h-4 plc-mr-1",
22016
22208
  xmlns: "http://www.w3.org/2000/svg",
22017
22209
  fill: "none",
22018
22210
  viewBox: "0 0 24 24",
22019
22211
  stroke: "currentColor"
22020
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22212
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
22021
22213
  strokeLinecap: "round",
22022
22214
  strokeLinejoin: "round",
22023
22215
  strokeWidth: 2,
@@ -22025,35 +22217,35 @@ function SvgRefresh(props) {
22025
22217
  })));
22026
22218
  }
22027
22219
 
22028
- var _path$e;
22220
+ var _path$f;
22029
22221
 
22030
- 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); }
22222
+ 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); }
22031
22223
 
22032
22224
  function SvgCalendar(props) {
22033
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22225
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22034
22226
  xmlns: "http://www.w3.org/2000/svg",
22035
22227
  className: "plc-h-4 plc-w-4 plc-mr-1",
22036
22228
  viewBox: "0 0 20 20",
22037
22229
  fill: "currentColor"
22038
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22230
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22039
22231
  fillRule: "evenodd",
22040
22232
  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",
22041
22233
  clipRule: "evenodd"
22042
22234
  })));
22043
22235
  }
22044
22236
 
22045
- var _path$d;
22237
+ var _path$e;
22046
22238
 
22047
- 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); }
22239
+ 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); }
22048
22240
 
22049
22241
  function SvgPlus(props) {
22050
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22242
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22051
22243
  className: "plc-w-5 plc-h-5",
22052
22244
  xmlns: "http://www.w3.org/2000/svg",
22053
22245
  fill: "none",
22054
22246
  viewBox: "0 0 24 24",
22055
22247
  stroke: "currentColor"
22056
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22248
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22057
22249
  strokeLinecap: "round",
22058
22250
  strokeLinejoin: "round",
22059
22251
  strokeWidth: 2,
@@ -22061,17 +22253,17 @@ function SvgPlus(props) {
22061
22253
  })));
22062
22254
  }
22063
22255
 
22064
- var _path$c;
22256
+ var _path$d;
22065
22257
 
22066
- 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); }
22258
+ 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); }
22067
22259
 
22068
22260
  function SvgCheckMark(props) {
22069
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22261
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22070
22262
  className: "plc-w-4 plc-h-4 plc-mr-1",
22071
22263
  xmlns: "http://www.w3.org/2000/svg",
22072
22264
  viewBox: "0 0 20 20",
22073
22265
  fill: "currentColor"
22074
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22266
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22075
22267
  fillRule: "evenodd",
22076
22268
  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",
22077
22269
  clipRule: "evenodd"
@@ -22135,7 +22327,8 @@ const SubscriptionsItems = ({
22135
22327
  } = useTranslation("dashboard");
22136
22328
  const {
22137
22329
  switchView,
22138
- isAuthenticated
22330
+ switchToAddressView,
22331
+ switchToPaymentView
22139
22332
  } = usePelcro();
22140
22333
  const subs = getNonDonationSubs();
22141
22334
  if (subs.length === 0) return null;
@@ -22177,7 +22370,12 @@ const SubscriptionsItems = ({
22177
22370
  const plan = window.Pelcro.plan.getById(plan_id);
22178
22371
  setProductAndPlan(product, plan);
22179
22372
  setSubscriptionIdToRenew(sub.id);
22180
- setView("plan-select");
22373
+
22374
+ if (product.address_required) {
22375
+ return switchToAddressView();
22376
+ }
22377
+
22378
+ return switchToPaymentView();
22181
22379
  };
22182
22380
 
22183
22381
  const getPhases = () => {
@@ -22366,18 +22564,18 @@ Accordion.item = function AccordionItem({
22366
22564
  }, content)) : null;
22367
22565
  };
22368
22566
 
22369
- var _path$b;
22567
+ var _path$c;
22370
22568
 
22371
- 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); }
22569
+ 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); }
22372
22570
 
22373
22571
  function SvgExit(props) {
22374
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22572
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22375
22573
  className: "plc-w-6 plc-h-6",
22376
22574
  xmlns: "http://www.w3.org/2000/svg",
22377
22575
  fill: "none",
22378
22576
  viewBox: "0 0 24 24",
22379
22577
  stroke: "currentColor"
22380
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22578
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22381
22579
  strokeLinecap: "round",
22382
22580
  strokeLinejoin: "round",
22383
22581
  strokeWidth: 2,
@@ -22385,17 +22583,17 @@ function SvgExit(props) {
22385
22583
  })));
22386
22584
  }
22387
22585
 
22388
- var _path$a;
22586
+ var _path$b;
22389
22587
 
22390
- 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); }
22588
+ 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); }
22391
22589
 
22392
22590
  function SvgUser(props) {
22393
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22591
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22394
22592
  xmlns: "http://www.w3.org/2000/svg",
22395
22593
  fill: "none",
22396
22594
  viewBox: "0 0 24 24",
22397
22595
  stroke: "currentColor"
22398
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22596
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22399
22597
  strokeLinecap: "round",
22400
22598
  strokeLinejoin: "round",
22401
22599
  strokeWidth: 2,
@@ -22403,18 +22601,18 @@ function SvgUser(props) {
22403
22601
  })));
22404
22602
  }
22405
22603
 
22406
- var _path$9;
22604
+ var _path$a;
22407
22605
 
22408
- 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); }
22606
+ 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); }
22409
22607
 
22410
22608
  function SvgNewsletter(props) {
22411
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22609
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22412
22610
  xmlns: "http://www.w3.org/2000/svg",
22413
22611
  className: "plc-h-5 plc-w-5",
22414
22612
  fill: "none",
22415
22613
  viewBox: "0 0 24 24",
22416
22614
  stroke: "currentColor"
22417
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22615
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22418
22616
  strokeLinecap: "round",
22419
22617
  strokeLinejoin: "round",
22420
22618
  strokeWidth: 2,
@@ -22422,18 +22620,18 @@ function SvgNewsletter(props) {
22422
22620
  })));
22423
22621
  }
22424
22622
 
22425
- var _path$8;
22623
+ var _path$9;
22426
22624
 
22427
- 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); }
22625
+ 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); }
22428
22626
 
22429
22627
  function SvgDocument(props) {
22430
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22628
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22431
22629
  xmlns: "http://www.w3.org/2000/svg",
22432
22630
  className: "plc-h-6 plc-w-6 plc-mr-2",
22433
22631
  fill: "none",
22434
22632
  viewBox: "0 0 24 24",
22435
22633
  stroke: "currentColor"
22436
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22634
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22437
22635
  strokeLinecap: "round",
22438
22636
  strokeLinejoin: "round",
22439
22637
  strokeWidth: 2,
@@ -22441,18 +22639,18 @@ function SvgDocument(props) {
22441
22639
  })));
22442
22640
  }
22443
22641
 
22444
- var _path$7;
22642
+ var _path$8;
22445
22643
 
22446
- 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); }
22644
+ 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); }
22447
22645
 
22448
22646
  function SvgPaymentCard(props) {
22449
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22647
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22450
22648
  className: "plc-w-6 plc-h-6 plc-mr-2",
22451
22649
  xmlns: "http://www.w3.org/2000/svg",
22452
22650
  fill: "none",
22453
22651
  viewBox: "0 0 24 24",
22454
22652
  stroke: "currentColor"
22455
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22653
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22456
22654
  strokeLinecap: "round",
22457
22655
  strokeLinejoin: "round",
22458
22656
  strokeWidth: 2,
@@ -22460,18 +22658,18 @@ function SvgPaymentCard(props) {
22460
22658
  })));
22461
22659
  }
22462
22660
 
22463
- var _path$6, _path2$1;
22661
+ var _path$7, _path2$1;
22464
22662
 
22465
- 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); }
22663
+ 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); }
22466
22664
 
22467
22665
  function SvgLocationPin(props) {
22468
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22666
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22469
22667
  className: "plc-w-6 plc-h-6 plc-mr-2",
22470
22668
  xmlns: "http://www.w3.org/2000/svg",
22471
22669
  fill: "none",
22472
22670
  viewBox: "0 0 24 24",
22473
22671
  stroke: "currentColor"
22474
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22672
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22475
22673
  strokeLinecap: "round",
22476
22674
  strokeLinejoin: "round",
22477
22675
  strokeWidth: 2,
@@ -22486,10 +22684,10 @@ function SvgLocationPin(props) {
22486
22684
 
22487
22685
  var _switch;
22488
22686
 
22489
- 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); }
22687
+ 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); }
22490
22688
 
22491
22689
  function SvgSubscription(props) {
22492
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22690
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22493
22691
  xmlns: "http://www.w3.org/2000/svg",
22494
22692
  viewBox: "0 0 100 125",
22495
22693
  fill: "currentColor"
@@ -22504,18 +22702,18 @@ function SvgSubscription(props) {
22504
22702
  }))))));
22505
22703
  }
22506
22704
 
22507
- var _path$5;
22705
+ var _path$6;
22508
22706
 
22509
- 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); }
22707
+ 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); }
22510
22708
 
22511
22709
  function SvgShopping(props) {
22512
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22710
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22513
22711
  className: "plc-w-6 plc-h-6 plc-mr-2",
22514
22712
  xmlns: "http://www.w3.org/2000/svg",
22515
22713
  fill: "none",
22516
22714
  viewBox: "0 0 24 24",
22517
22715
  stroke: "currentColor"
22518
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22716
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22519
22717
  strokeLinecap: "round",
22520
22718
  strokeLinejoin: "round",
22521
22719
  strokeWidth: 2,
@@ -22523,18 +22721,18 @@ function SvgShopping(props) {
22523
22721
  })));
22524
22722
  }
22525
22723
 
22526
- var _path$4;
22724
+ var _path$5;
22527
22725
 
22528
- 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); }
22726
+ 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); }
22529
22727
 
22530
22728
  function SvgBookmark(props) {
22531
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22729
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22532
22730
  className: "plc-w-6 plc-h-6 plc-mr-2",
22533
22731
  xmlns: "http://www.w3.org/2000/svg",
22534
22732
  fill: "none",
22535
22733
  viewBox: "0 0 24 24",
22536
22734
  stroke: "currentColor"
22537
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22735
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22538
22736
  strokeLinecap: "round",
22539
22737
  strokeLinejoin: "round",
22540
22738
  strokeWidth: 2,
@@ -22542,33 +22740,33 @@ function SvgBookmark(props) {
22542
22740
  })));
22543
22741
  }
22544
22742
 
22545
- var _path$3;
22743
+ var _path$4;
22546
22744
 
22547
- function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
22745
+ function _extends$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); }
22548
22746
 
22549
22747
  function SvgKey(props) {
22550
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22748
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22551
22749
  xmlns: "http://www.w3.org/2000/svg",
22552
22750
  viewBox: "0 0 20 20",
22553
22751
  fill: "currentColor"
22554
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22752
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22555
22753
  fillRule: "evenodd",
22556
22754
  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",
22557
22755
  clipRule: "evenodd"
22558
22756
  })));
22559
22757
  }
22560
22758
 
22561
- var _path$2;
22759
+ var _path$3;
22562
22760
 
22563
- 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); }
22761
+ 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); }
22564
22762
 
22565
22763
  function SvgDonate(props) {
22566
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22764
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22567
22765
  width: 24,
22568
22766
  height: 24,
22569
22767
  fill: "currentColor",
22570
22768
  xmlns: "http://www.w3.org/2000/svg"
22571
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22769
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22572
22770
  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"
22573
22771
  })));
22574
22772
  }
@@ -22895,9 +23093,10 @@ class Dashboard extends React.Component {
22895
23093
  }) => {
22896
23094
  if (isGift) {
22897
23095
  this.props.setProductAndPlan(null, null, true);
23096
+ return this.props.setView("plan-select");
22898
23097
  }
22899
23098
 
22900
- return this.props.setView("plan-select");
23099
+ return this.props.setView("subscription-options");
22901
23100
  });
22902
23101
 
22903
23102
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -23365,7 +23564,7 @@ const DashboardOpenButton = () => {
23365
23564
  };
23366
23565
  DashboardOpenButton.viewId = "dashboard-open";
23367
23566
 
23368
- const initialState$2 = {
23567
+ const initialState$3 = {
23369
23568
  imageSrc: null,
23370
23569
  crop: {
23371
23570
  x: 0,
@@ -23379,10 +23578,10 @@ const initialState$2 = {
23379
23578
  content: ""
23380
23579
  }
23381
23580
  };
23382
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23581
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
23383
23582
  const {
23384
- Provider: Provider$2
23385
- } = store$2;
23583
+ Provider: Provider$3
23584
+ } = store$3;
23386
23585
 
23387
23586
  const ProfilePicChangeContainer = ({
23388
23587
  style,
@@ -23516,21 +23715,21 @@ const ProfilePicChangeContainer = ({
23516
23715
  default:
23517
23716
  return state;
23518
23717
  }
23519
- }, initialState$2);
23718
+ }, initialState$3);
23520
23719
  return /*#__PURE__*/React__default['default'].createElement("div", {
23521
23720
  style: { ...style
23522
23721
  },
23523
23722
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23524
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23723
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
23525
23724
  value: {
23526
23725
  state,
23527
23726
  dispatch
23528
23727
  }
23529
23728
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
23530
- store: store$2,
23729
+ store: store$3,
23531
23730
  key: i
23532
23731
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
23533
- store: store$2
23732
+ store: store$3
23534
23733
  })));
23535
23734
  };
23536
23735
  /**
@@ -23592,7 +23791,7 @@ const ProfilePicChangeButton = ({
23592
23791
  isSubmitting
23593
23792
  },
23594
23793
  dispatch
23595
- } = React.useContext(store$2);
23794
+ } = React.useContext(store$3);
23596
23795
  const {
23597
23796
  t
23598
23797
  } = useTranslation("userEdit");
@@ -24960,7 +25159,7 @@ const ProfilePicChangeCropper = ({
24960
25159
  zoom
24961
25160
  },
24962
25161
  dispatch
24963
- } = React.useContext(store$2);
25162
+ } = React.useContext(store$3);
24964
25163
  return /*#__PURE__*/React__default['default'].createElement("div", {
24965
25164
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24966
25165
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -25002,7 +25201,7 @@ const ProfilePicChangeZoom = ({
25002
25201
  zoom
25003
25202
  },
25004
25203
  dispatch
25005
- } = React.useContext(store$2);
25204
+ } = React.useContext(store$3);
25006
25205
  const {
25007
25206
  t
25008
25207
  } = useTranslation("userEdit");
@@ -25025,18 +25224,18 @@ const ProfilePicChangeZoom = ({
25025
25224
  }, otherProps)));
25026
25225
  };
25027
25226
 
25028
- var _path$1;
25227
+ var _path$2;
25029
25228
 
25030
- 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); }
25229
+ 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); }
25031
25230
 
25032
25231
  function SvgPhotograph(props) {
25033
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25232
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
25034
25233
  xmlns: "http://www.w3.org/2000/svg",
25035
25234
  className: "plc-h-6 plc-w-6",
25036
25235
  fill: "none",
25037
25236
  viewBox: "0 0 24 24",
25038
25237
  stroke: "currentColor"
25039
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25238
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
25040
25239
  strokeLinecap: "round",
25041
25240
  strokeLinejoin: "round",
25042
25241
  strokeWidth: 2,
@@ -25054,7 +25253,7 @@ const ProfilePicChangeSelectButton = ({
25054
25253
  state: {
25055
25254
  isSubmitting
25056
25255
  }
25057
- } = React.useContext(store$2);
25256
+ } = React.useContext(store$3);
25058
25257
  const {
25059
25258
  t
25060
25259
  } = useTranslation("userEdit");
@@ -25096,7 +25295,7 @@ const ProfilePicChangeRemoveButton = ({
25096
25295
  state: {
25097
25296
  isSubmitting
25098
25297
  }
25099
- } = React.useContext(store$2);
25298
+ } = React.useContext(store$3);
25100
25299
  const {
25101
25300
  t
25102
25301
  } = useTranslation("userEdit");
@@ -25119,7 +25318,7 @@ const ProfilePicChangeWrapper = () => {
25119
25318
  state: {
25120
25319
  imageSrc
25121
25320
  }
25122
- } = React.useContext(store$2);
25321
+ } = React.useContext(store$3);
25123
25322
  const {
25124
25323
  t
25125
25324
  } = useTranslation("userEdit");
@@ -25181,17 +25380,17 @@ function ProfilePicChangeModal({
25181
25380
  }
25182
25381
  ProfilePicChangeModal.viewId = "profile-picture";
25183
25382
 
25184
- const initialState$1 = {
25383
+ const initialState$2 = {
25185
25384
  isSubmitting: false,
25186
25385
  alert: {
25187
25386
  type: "error",
25188
25387
  content: ""
25189
25388
  }
25190
25389
  };
25191
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25390
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
25192
25391
  const {
25193
- Provider: Provider$1
25194
- } = store$1;
25392
+ Provider: Provider$2
25393
+ } = store$2;
25195
25394
 
25196
25395
  const EmailVerifyContainer = ({
25197
25396
  style,
@@ -25254,21 +25453,21 @@ const EmailVerifyContainer = ({
25254
25453
  default:
25255
25454
  return state;
25256
25455
  }
25257
- }, initialState$1);
25456
+ }, initialState$2);
25258
25457
  return /*#__PURE__*/React__default['default'].createElement("div", {
25259
25458
  style: { ...style
25260
25459
  },
25261
25460
  className: `pelcro-container pelcro-email-verify-container ${className}`
25262
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25461
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
25263
25462
  value: {
25264
25463
  state,
25265
25464
  dispatch
25266
25465
  }
25267
25466
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25268
- store: store$1,
25467
+ store: store$2,
25269
25468
  key: i
25270
25469
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25271
- store: store$1
25470
+ store: store$2
25272
25471
  })));
25273
25472
  };
25274
25473
 
@@ -25282,7 +25481,7 @@ const EmailVerifyResendButton = ({
25282
25481
  state: {
25283
25482
  isSubmitting
25284
25483
  }
25285
- } = React.useContext(store$1);
25484
+ } = React.useContext(store$2);
25286
25485
  const {
25287
25486
  t
25288
25487
  } = useTranslation("verifyEmail");
@@ -25297,16 +25496,16 @@ const EmailVerifyResendButton = ({
25297
25496
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
25298
25497
  };
25299
25498
 
25300
- var _path, _path2;
25499
+ var _path$1, _path2;
25301
25500
 
25302
- 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); }
25501
+ 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); }
25303
25502
 
25304
25503
  function SvgEmailVerify(props) {
25305
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25504
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25306
25505
  className: "plc-w-6 plc-h-6",
25307
25506
  viewBox: "0 0 700 700",
25308
25507
  xmlns: "http://www.w3.org/2000/svg"
25309
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25508
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25310
25509
  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"
25311
25510
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
25312
25511
  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"
@@ -25410,11 +25609,11 @@ const invoicePaymentSubmitButton = props => {
25410
25609
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
25411
25610
  };
25412
25611
 
25413
- const initialState = {};
25414
- const store = /*#__PURE__*/React.createContext(initialState);
25612
+ const initialState$1 = {};
25613
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25415
25614
  const {
25416
- Provider
25417
- } = store;
25615
+ Provider: Provider$1
25616
+ } = store$1;
25418
25617
 
25419
25618
  const InvoiceDetailsContainer = ({
25420
25619
  style,
@@ -25435,21 +25634,21 @@ const InvoiceDetailsContainer = ({
25435
25634
  default:
25436
25635
  return state;
25437
25636
  }
25438
- }, initialState);
25637
+ }, initialState$1);
25439
25638
  return /*#__PURE__*/React__default['default'].createElement("div", {
25440
25639
  style: { ...style
25441
25640
  },
25442
25641
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25443
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25642
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25444
25643
  value: {
25445
25644
  state,
25446
25645
  dispatch
25447
25646
  }
25448
25647
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25449
- store,
25648
+ store: store$1,
25450
25649
  key: i
25451
25650
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25452
- store
25651
+ store: store$1
25453
25652
  })));
25454
25653
  };
25455
25654
 
@@ -25481,7 +25680,7 @@ const InvoiceDetailsPayButton = ({
25481
25680
  }) => {
25482
25681
  const {
25483
25682
  dispatch
25484
- } = React.useContext(store);
25683
+ } = React.useContext(store$1);
25485
25684
  const {
25486
25685
  t
25487
25686
  } = useTranslation("invoiceDetails");
@@ -25586,6 +25785,232 @@ const InvoiceDetailsModal = ({
25586
25785
  };
25587
25786
  InvoiceDetailsModal.viewId = "invoice-details";
25588
25787
 
25788
+ const initialState = {
25789
+ selectedOption: ""
25790
+ };
25791
+ const store = /*#__PURE__*/React.createContext(initialState);
25792
+ const {
25793
+ Provider
25794
+ } = store;
25795
+
25796
+ const SubscriptionOptionsContainer = ({
25797
+ style,
25798
+ className = "",
25799
+ onRenewSubSuccess = () => {},
25800
+ onNewSubSuccess = () => {},
25801
+ children,
25802
+ ...props
25803
+ }) => {
25804
+ const submit = ({
25805
+ selectedOption
25806
+ }, dispatch) => {
25807
+ if (selectedOption === "renew") return onRenewSubSuccess();
25808
+ if (selectedOption === "new") return onNewSubSuccess();
25809
+ };
25810
+
25811
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25812
+ switch (action.type) {
25813
+ case SWITCH_TO_NEW:
25814
+ return lib_7({ ...state,
25815
+ selectedOption: "new"
25816
+ });
25817
+
25818
+ case SWITCH_TO_RENEW:
25819
+ return lib_7({ ...state,
25820
+ selectedOption: "renew"
25821
+ });
25822
+
25823
+ case HANDLE_SUBMIT:
25824
+ return lib_4((state, dispatch) => submit(state));
25825
+
25826
+ default:
25827
+ return state;
25828
+ }
25829
+ }, initialState);
25830
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25831
+ style: { ...style
25832
+ },
25833
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25834
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25835
+ value: {
25836
+ state,
25837
+ dispatch
25838
+ }
25839
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25840
+ store,
25841
+ key: i
25842
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25843
+ store
25844
+ })));
25845
+ };
25846
+
25847
+ var _path;
25848
+
25849
+ 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); }
25850
+
25851
+ function SvgPlusCircle(props) {
25852
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25853
+ xmlns: "http://www.w3.org/2000/svg",
25854
+ className: "plc-h-6 plc-w-6",
25855
+ fill: "none",
25856
+ viewBox: "0 0 24 24",
25857
+ stroke: "currentColor",
25858
+ strokeWidth: 2
25859
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25860
+ strokeLinecap: "round",
25861
+ strokeLinejoin: "round",
25862
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25863
+ })));
25864
+ }
25865
+
25866
+ const SubscriptionOptionsNewButton = ({
25867
+ name,
25868
+ onClick,
25869
+ ...otherProps
25870
+ }) => {
25871
+ const {
25872
+ dispatch,
25873
+ state: {
25874
+ selectedOption
25875
+ }
25876
+ } = React.useContext(store);
25877
+ const {
25878
+ t
25879
+ } = useTranslation("subscriptionOptions");
25880
+ const isChecked = selectedOption === "new";
25881
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25882
+ className: "plc-hidden pelcro-new-sub-option",
25883
+ 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"}`,
25884
+ id: "pelcro-new-sub-option",
25885
+ name: "option",
25886
+ onChange: () => {
25887
+ dispatch({
25888
+ type: SWITCH_TO_NEW
25889
+ });
25890
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25891
+ },
25892
+ checked: isChecked
25893
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25894
+ className: "plc-w-full plc-h-full plc-mr-0"
25895
+ }));
25896
+ };
25897
+
25898
+ const SubscriptionOptionsRenewButton = ({
25899
+ name,
25900
+ onClick,
25901
+ ...otherProps
25902
+ }) => {
25903
+ const {
25904
+ dispatch,
25905
+ state: {
25906
+ selectedOption
25907
+ }
25908
+ } = React.useContext(store);
25909
+ const {
25910
+ t
25911
+ } = useTranslation("subscriptionOptions");
25912
+ const isChecked = selectedOption === "renew";
25913
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25914
+ className: "plc-hidden pelcro-renew-sub-option",
25915
+ 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"}`,
25916
+ id: "pelcro-renew-sub-option",
25917
+ name: "option",
25918
+ onChange: () => {
25919
+ dispatch({
25920
+ type: SWITCH_TO_RENEW
25921
+ });
25922
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25923
+ },
25924
+ checked: isChecked
25925
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
25926
+ className: "plc-w-full plc-h-full plc-mr-0"
25927
+ }));
25928
+ };
25929
+
25930
+ const SubscriptionOptionsSubmit = ({
25931
+ name,
25932
+ onClick,
25933
+ ...otherProps
25934
+ }) => {
25935
+ const {
25936
+ dispatch,
25937
+ state: {
25938
+ selectedOption
25939
+ }
25940
+ } = React.useContext(store);
25941
+ const {
25942
+ t
25943
+ } = useTranslation("subscriptionOptions");
25944
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25945
+ onClick: () => {
25946
+ dispatch({
25947
+ type: HANDLE_SUBMIT
25948
+ });
25949
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25950
+ },
25951
+ disabled: !selectedOption
25952
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25953
+ };
25954
+
25955
+ const SubscriptionOptionsView = props => {
25956
+ const {
25957
+ t
25958
+ } = useTranslation("subscriptionOptions");
25959
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25960
+ id: "pelcro-subscription-options-view"
25961
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25962
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25963
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
25964
+ className: "plc-text-2xl plc-font-semibold"
25965
+ }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
25966
+ action: "javascript:void(0);",
25967
+ className: "plc-mt-2 pelcro-form"
25968
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25969
+ className: "plc-flex plc-justify-between plc-items-center"
25970
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
25971
+ role: "submit",
25972
+ className: "plc-mt-4 plc-w-full",
25973
+ name: t("next"),
25974
+ id: "pelcro-submit"
25975
+ }))));
25976
+ };
25977
+
25978
+ const SubscriptionOptionsModal = ({
25979
+ onDisplay,
25980
+ onClose,
25981
+ ...otherProps
25982
+ }) => {
25983
+ const {
25984
+ switchView,
25985
+ setProductsList
25986
+ } = usePelcro();
25987
+
25988
+ const onRenewSubSuccess = () => {
25989
+ var _otherProps$onRenewSu;
25990
+
25991
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
25992
+ setProductsList(getRenewableProducts());
25993
+ switchView("_plan-select-renew");
25994
+ };
25995
+
25996
+ const onNewSubSuccess = () => {
25997
+ var _otherProps$onNewSubS;
25998
+
25999
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
26000
+ switchView("plan-select");
26001
+ };
26002
+
26003
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
26004
+ onDisplay: onDisplay,
26005
+ onClose: onClose,
26006
+ id: "pelcro-subscription-options-modal"
26007
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
26008
+ onNewSubSuccess: onNewSubSuccess,
26009
+ onRenewSubSuccess: onRenewSubSuccess
26010
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
26011
+ };
26012
+ SubscriptionOptionsModal.viewId = "subscription-options";
26013
+
25589
26014
  exports.AddressCreateCity = AddressCreateCity;
25590
26015
  exports.AddressCreateContainer = AddressCreateContainer;
25591
26016
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -25763,6 +26188,12 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
25763
26188
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
25764
26189
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
25765
26190
  exports.SubscriptionCreateView = SubscriptionCreateView;
26191
+ exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
26192
+ exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
26193
+ exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
26194
+ exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
26195
+ exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
26196
+ exports.SubscriptionOptionsView = SubscriptionOptionsView;
25766
26197
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
25767
26198
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
25768
26199
  exports.SubscriptionRenewView = SubscriptionRenewView;