@pelcro/react-pelcro-js 3.2.0-beta.1 → 3.2.0-beta.4

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,28 @@ 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
+ const renewableSubs = window.Pelcro.subscription.list().filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1);
6818
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6819
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6820
+ const {
6821
+ productsList
6822
+ } = usePelcro.getStore();
6823
+ return productsList.map(product => {
6824
+ if (renewableProductsIds.includes(product.id)) {
6825
+ const renewablePlans = getRenewablePlansOnly(product);
6826
+ return { ...product,
6827
+ plans: renewablePlans
6828
+ };
6829
+ }
6830
+ }).filter(product => product);
6831
+
6832
+ function getRenewablePlansOnly(product) {
6833
+ var _product$plans$filter, _product$plans;
6834
+
6835
+ return (_product$plans$filter = product === null || product === void 0 ? void 0 : (_product$plans = product.plans) === null || _product$plans === void 0 ? void 0 : _product$plans.filter(plan => renewablePlansIds.includes(plan.id))) !== null && _product$plans$filter !== void 0 ? _product$plans$filter : [];
6836
+ }
6837
+ }
6758
6838
 
6759
6839
  const resources = {
6760
6840
  en: {
@@ -6779,7 +6859,8 @@ const resources = {
6779
6859
  dashboard: dashboard_en,
6780
6860
  select: select_en,
6781
6861
  notification: notification_en,
6782
- invoiceDetails: invoiceDetails_en
6862
+ invoiceDetails: invoiceDetails_en,
6863
+ subscriptionOptions: subscriptionOptions_en
6783
6864
  },
6784
6865
  fr: {
6785
6866
  common: common_fr,
@@ -6803,7 +6884,8 @@ const resources = {
6803
6884
  dashboard: dashboard_fr,
6804
6885
  select: select_fr,
6805
6886
  notification: notification_fr,
6806
- invoiceDetails: invoiceDetails_fr
6887
+ invoiceDetails: invoiceDetails_fr,
6888
+ subscriptionOptions: subscriptionOptions_fr
6807
6889
  }
6808
6890
  }; // set UI language to the page language or default to the language in site settings
6809
6891
 
@@ -7094,8 +7176,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7094
7176
 
7095
7177
  let e={data:""},t=t=>"undefined"!=typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,n=(e,t)=>{let r,l="",a="",o="";for(let c in e){let s=e[c];"object"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):c,a+="@"==c[0]?"f"==c[1]?n(s,c):c+"{"+n(s,"k"==c[1]?"":t)+"}":n(s,r)):"@"==c[0]&&"i"==c[1]?l=c+" "+s+";":(c=c.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=n.p?n.p(c,s):c+":"+s+";");}return o[0]?(r=t?t+"{"+o+"}":o,l+r+a):l+a},o={},c=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p="object"==typeof e?c(e):e,u=o[p]||(o[p]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(p));if(!o[u]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{["@keyframes "+u]:t}:t,r?"":"."+u);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":n(e,""):e;}return e+l+(null==o?"":o)},"");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,f,d;p.bind({g:1});let b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,f=r,d=l;}function y(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=p.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=c.as||e;return d&&i[0]&&d(c),u(i,c)}return t?t(a):a}}
7096
7178
 
7097
- function _extends$y() {
7098
- _extends$y = Object.assign || function (target) {
7179
+ function _extends$A() {
7180
+ _extends$A = Object.assign || function (target) {
7099
7181
  for (var i = 1; i < arguments.length; i++) {
7100
7182
  var source = arguments[i];
7101
7183
 
@@ -7109,7 +7191,7 @@ function _extends$y() {
7109
7191
  return target;
7110
7192
  };
7111
7193
 
7112
- return _extends$y.apply(this, arguments);
7194
+ return _extends$A.apply(this, arguments);
7113
7195
  }
7114
7196
 
7115
7197
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7199,7 +7281,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7199
7281
  var reducer = function reducer(state, action) {
7200
7282
  switch (action.type) {
7201
7283
  case ActionType.ADD_TOAST:
7202
- return _extends$y({}, state, {
7284
+ return _extends$A({}, state, {
7203
7285
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7204
7286
  });
7205
7287
 
@@ -7209,9 +7291,9 @@ var reducer = function reducer(state, action) {
7209
7291
  clearFromRemoveQueue(action.toast.id);
7210
7292
  }
7211
7293
 
7212
- return _extends$y({}, state, {
7294
+ return _extends$A({}, state, {
7213
7295
  toasts: state.toasts.map(function (t) {
7214
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7296
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7215
7297
  })
7216
7298
  });
7217
7299
 
@@ -7238,9 +7320,9 @@ var reducer = function reducer(state, action) {
7238
7320
  });
7239
7321
  }
7240
7322
 
7241
- return _extends$y({}, state, {
7323
+ return _extends$A({}, state, {
7242
7324
  toasts: state.toasts.map(function (t) {
7243
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7325
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7244
7326
  visible: false
7245
7327
  }) : t;
7246
7328
  })
@@ -7248,28 +7330,28 @@ var reducer = function reducer(state, action) {
7248
7330
 
7249
7331
  case ActionType.REMOVE_TOAST:
7250
7332
  if (action.toastId === undefined) {
7251
- return _extends$y({}, state, {
7333
+ return _extends$A({}, state, {
7252
7334
  toasts: []
7253
7335
  });
7254
7336
  }
7255
7337
 
7256
- return _extends$y({}, state, {
7338
+ return _extends$A({}, state, {
7257
7339
  toasts: state.toasts.filter(function (t) {
7258
7340
  return t.id !== action.toastId;
7259
7341
  })
7260
7342
  });
7261
7343
 
7262
7344
  case ActionType.START_PAUSE:
7263
- return _extends$y({}, state, {
7345
+ return _extends$A({}, state, {
7264
7346
  pausedAt: action.time
7265
7347
  });
7266
7348
 
7267
7349
  case ActionType.END_PAUSE:
7268
7350
  var diff = action.time - (state.pausedAt || 0);
7269
- return _extends$y({}, state, {
7351
+ return _extends$A({}, state, {
7270
7352
  pausedAt: undefined,
7271
7353
  toasts: state.toasts.map(function (t) {
7272
- return _extends$y({}, t, {
7354
+ return _extends$A({}, t, {
7273
7355
  pauseDuration: t.pauseDuration + diff
7274
7356
  });
7275
7357
  })
@@ -7316,12 +7398,12 @@ var useStore = function useStore(toastOptions) {
7316
7398
  var mergedToasts = state.toasts.map(function (t) {
7317
7399
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7318
7400
 
7319
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7401
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7320
7402
  duration: t.duration || ((_toastOptions$t$type = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type.duration) || ((_toastOptions = toastOptions) == null ? void 0 : _toastOptions.duration) || defaultTimeouts[t.type],
7321
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7403
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7322
7404
  });
7323
7405
  });
7324
- return _extends$y({}, state, {
7406
+ return _extends$A({}, state, {
7325
7407
  toasts: mergedToasts
7326
7408
  });
7327
7409
  };
@@ -7331,7 +7413,7 @@ var createToast = function createToast(message, type, opts) {
7331
7413
  type = 'blank';
7332
7414
  }
7333
7415
 
7334
- return _extends$y({
7416
+ return _extends$A({
7335
7417
  createdAt: Date.now(),
7336
7418
  visible: true,
7337
7419
  type: type,
@@ -7381,14 +7463,14 @@ toast.remove = function (toastId) {
7381
7463
  };
7382
7464
 
7383
7465
  toast.promise = function (promise, msgs, opts) {
7384
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7466
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7385
7467
  promise.then(function (p) {
7386
- toast.success(resolveValue(msgs.success, p), _extends$y({
7468
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7387
7469
  id: id
7388
7470
  }, opts, opts == null ? void 0 : opts.success));
7389
7471
  return p;
7390
7472
  })["catch"](function (e) {
7391
- toast.error(resolveValue(msgs.error, e), _extends$y({
7473
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7392
7474
  id: id
7393
7475
  }, opts, opts == null ? void 0 : opts.error));
7394
7476
  });
@@ -7727,7 +7809,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7727
7809
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7728
7810
  return React.createElement(ToastBarBase, {
7729
7811
  className: toast.className,
7730
- style: _extends$y({}, animationStyle, style, toast.style)
7812
+ style: _extends$A({}, animationStyle, style, toast.style)
7731
7813
  }, typeof children === 'function' ? children({
7732
7814
  icon: icon,
7733
7815
  message: message
@@ -7757,7 +7839,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7757
7839
  } : position.includes('right') ? {
7758
7840
  justifyContent: 'flex-end'
7759
7841
  } : {};
7760
- return _extends$y({
7842
+ return _extends$A({
7761
7843
  left: 0,
7762
7844
  right: 0,
7763
7845
  display: 'flex',
@@ -7784,7 +7866,7 @@ var Toaster = function Toaster(_ref) {
7784
7866
  handlers = _useToaster.handlers;
7785
7867
 
7786
7868
  return React.createElement("div", {
7787
- style: _extends$y({
7869
+ style: _extends$A({
7788
7870
  position: 'fixed',
7789
7871
  zIndex: 9999,
7790
7872
  top: DEFAULT_OFFSET,
@@ -7819,82 +7901,82 @@ var Toaster = function Toaster(_ref) {
7819
7901
  }));
7820
7902
  };
7821
7903
 
7822
- var _path$v;
7904
+ var _path$x;
7823
7905
 
7824
- 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); }
7906
+ function _extends$z() { _extends$z = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
7825
7907
 
7826
7908
  function SvgCheckSolid(props) {
7827
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7909
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
7828
7910
  xmlns: "http://www.w3.org/2000/svg",
7829
7911
  className: "h-5 w-5",
7830
7912
  viewBox: "0 0 20 20",
7831
7913
  fill: "currentColor"
7832
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7914
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
7833
7915
  fillRule: "evenodd",
7834
7916
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
7835
7917
  clipRule: "evenodd"
7836
7918
  })));
7837
7919
  }
7838
7920
 
7839
- var _path$u;
7921
+ var _path$w;
7840
7922
 
7841
- 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); }
7923
+ function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7842
7924
 
7843
7925
  function SvgXIcon(props) {
7844
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7926
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7845
7927
  xmlns: "http://www.w3.org/2000/svg",
7846
7928
  viewBox: "0 0 20 20",
7847
7929
  fill: "currentColor"
7848
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7930
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7849
7931
  fill: "evenodd",
7850
7932
  d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
7851
7933
  clipRule: "evenodd"
7852
7934
  })));
7853
7935
  }
7854
7936
 
7855
- var _path$t;
7937
+ var _path$v;
7856
7938
 
7857
- 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); }
7939
+ function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7858
7940
 
7859
7941
  function SvgXIconSolid(props) {
7860
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7942
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7861
7943
  className: "plc-w-4 plc-h-4",
7862
7944
  fill: "currentColor",
7863
7945
  xmlns: "http://www.w3.org/2000/svg",
7864
7946
  viewBox: "0 0 100 100"
7865
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7947
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7866
7948
  d: "M94.842 48.408c0 24.852-20.148 44.999-45.002 44.999-24.851 0-44.997-20.146-44.997-44.999 0-24.854 20.146-45 44.997-45 24.853 0 45.002 20.146 45.002 45zM71.073 64.841L54.73 48.497l16.344-16.344-4.979-4.979-16.343 16.345-16.343-16.344-4.799 4.799 16.344 16.344L28.61 64.661l4.979 4.978 16.344-16.344 16.343 16.344 4.797-4.798z"
7867
7949
  })));
7868
7950
  }
7869
7951
 
7870
- var _path$s;
7952
+ var _path$u;
7871
7953
 
7872
- 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); }
7954
+ function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7873
7955
 
7874
7956
  function SvgExclamation(props) {
7875
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7957
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7876
7958
  className: "plc-w-4 plc-h-4 plc-mr-1",
7877
7959
  xmlns: "http://www.w3.org/2000/svg",
7878
7960
  viewBox: "0 0 20 20",
7879
7961
  fill: "currentColor"
7880
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7962
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7881
7963
  fillRule: "evenodd",
7882
7964
  d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
7883
7965
  clipRule: "evenodd"
7884
7966
  })));
7885
7967
  }
7886
7968
 
7887
- var _path$r, _path2$4;
7969
+ var _path$t, _path2$4;
7888
7970
 
7889
- 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); }
7971
+ function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7890
7972
 
7891
7973
  function SvgSpinner(props) {
7892
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7974
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7893
7975
  className: "plc-animate-spin",
7894
7976
  viewBox: "0 0 24 24",
7895
7977
  fill: "currentColor",
7896
7978
  xmlns: "http://www.w3.org/2000/svg"
7897
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7979
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7898
7980
  opacity: 0.2,
7899
7981
  fill: "evenodd",
7900
7982
  clipRule: "evenodd",
@@ -8184,7 +8266,9 @@ const init$1 = () => {
8184
8266
  return switchToAddressView();
8185
8267
  });
8186
8268
  } else {
8187
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8269
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8270
+ return switchView("subscription-options");
8271
+ });
8188
8272
  }
8189
8273
  }
8190
8274
  }
@@ -8346,7 +8430,8 @@ function Link({
8346
8430
  const init = () => {
8347
8431
  const {
8348
8432
  switchView,
8349
- set
8433
+ set,
8434
+ setProductsList
8350
8435
  } = usePelcro.getStore();
8351
8436
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8352
8437
 
@@ -8397,7 +8482,8 @@ const init = () => {
8397
8482
  }
8398
8483
 
8399
8484
  notify.dismiss(NOTIFICATION_ID);
8400
- switchView("_plan-select-entitlements");
8485
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8486
+ switchView("plan-select");
8401
8487
  }
8402
8488
  }, "Subscribe"), "now to get full page access.")), {
8403
8489
  className: "pelcro-notification-entitlement",
@@ -8952,8 +9038,7 @@ const initViewFromURL = () => {
8952
9038
  }
8953
9039
 
8954
9040
  if (view === "invoice-details") {
8955
- // FIXME: commented out to remove from the release
8956
- return false; // return showInvoiceDetailsFromUrl();
9041
+ return showInvoiceDetailsFromUrl();
8957
9042
  }
8958
9043
 
8959
9044
  switchView(view);
@@ -9132,6 +9217,43 @@ const verifyEmailTokenFromUrl = () => {
9132
9217
  });
9133
9218
  };
9134
9219
 
9220
+ const showInvoiceDetailsFromUrl = () => {
9221
+ const {
9222
+ isAuthenticated,
9223
+ setInvoice,
9224
+ whenSiteReady,
9225
+ switchView
9226
+ } = usePelcro.getStore();
9227
+ whenSiteReady(() => {
9228
+ if (!isAuthenticated()) {
9229
+ return switchView("login");
9230
+ }
9231
+
9232
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9233
+ const wasSetSuccessfully = setInvoice(invoiceId);
9234
+
9235
+ if (!wasSetSuccessfully) {
9236
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9237
+ returnObjects: true
9238
+ });
9239
+ return notify.error(errorMessage);
9240
+ }
9241
+
9242
+ const {
9243
+ invoice
9244
+ } = usePelcro.getStore();
9245
+
9246
+ if (invoice.total === 0) {
9247
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9248
+ returnObjects: true
9249
+ });
9250
+ return notify.error(errorMessage);
9251
+ }
9252
+
9253
+ return switchView("invoice-details");
9254
+ });
9255
+ };
9256
+
9135
9257
  const defaultOptions = {
9136
9258
  loadPaymentSDKs: true,
9137
9259
  loadAuth0SDK: true,
@@ -9189,7 +9311,7 @@ const PelcroModalController = ({
9189
9311
  type
9190
9312
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9191
9313
  type
9192
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9314
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9193
9315
  type
9194
9316
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9195
9317
  type
@@ -9470,8 +9592,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9470
9592
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9471
9593
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9472
9594
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9595
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9596
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9473
9597
 
9474
- const initialState$h = {
9598
+ const initialState$i = {
9475
9599
  email: "",
9476
9600
  password: "",
9477
9601
  emailError: null,
@@ -9482,10 +9606,10 @@ const initialState$h = {
9482
9606
  content: ""
9483
9607
  }
9484
9608
  };
9485
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
9609
+ const store$i = /*#__PURE__*/React.createContext(initialState$i);
9486
9610
  const {
9487
- Provider: Provider$h
9488
- } = store$h;
9611
+ Provider: Provider$i
9612
+ } = store$i;
9489
9613
 
9490
9614
  const LoginContainer = ({
9491
9615
  style,
@@ -9592,7 +9716,7 @@ const LoginContainer = ({
9592
9716
  });
9593
9717
 
9594
9718
  case RESET_LOGIN_FORM:
9595
- return initialState$h;
9719
+ return initialState$i;
9596
9720
 
9597
9721
  case DISABLE_LOGIN_BUTTON:
9598
9722
  return lib_7({ ...state,
@@ -9610,12 +9734,12 @@ const LoginContainer = ({
9610
9734
  default:
9611
9735
  return state;
9612
9736
  }
9613
- }, initialState$h);
9737
+ }, initialState$i);
9614
9738
  return /*#__PURE__*/React__default['default'].createElement("div", {
9615
9739
  style: { ...style
9616
9740
  },
9617
9741
  className: `pelcro-container pelcro-login-container ${className}`
9618
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9742
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9619
9743
  value: {
9620
9744
  state,
9621
9745
  dispatch
@@ -9623,12 +9747,12 @@ const LoginContainer = ({
9623
9747
  }, children.length ? children.map((child, i) => {
9624
9748
  if (child) {
9625
9749
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9626
- store: store$h,
9750
+ store: store$i,
9627
9751
  key: i
9628
9752
  });
9629
9753
  }
9630
9754
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9631
- store: store$h
9755
+ store: store$i
9632
9756
  })));
9633
9757
  };
9634
9758
 
@@ -9873,7 +9997,7 @@ const LoginButton = ({
9873
9997
  buttonDisabled
9874
9998
  },
9875
9999
  dispatch
9876
- } = React.useContext(store$h);
10000
+ } = React.useContext(store$i);
9877
10001
  const {
9878
10002
  t
9879
10003
  } = useTranslation("login");
@@ -9894,23 +10018,23 @@ const LoginButton = ({
9894
10018
  };
9895
10019
 
9896
10020
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9897
- store: store$h
10021
+ store: store$i
9898
10022
  }, props));
9899
10023
 
9900
10024
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9901
- store: store$h
10025
+ store: store$i
9902
10026
  }, props));
9903
10027
 
9904
- var _path$q;
10028
+ var _path$s;
9905
10029
 
9906
- 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); }
10030
+ 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); }
9907
10031
 
9908
10032
  function SvgCheck(props) {
9909
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10033
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9910
10034
  xmlns: "http://www.w3.org/2000/svg",
9911
10035
  fill: "currentColor",
9912
10036
  viewBox: "0 0 20 20"
9913
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10037
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9914
10038
  fillRule: "evenodd",
9915
10039
  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",
9916
10040
  clipRule: "evenodd"
@@ -9975,7 +10099,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9975
10099
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9976
10100
  facebookLoginRenderProps.FacebookLogin;
9977
10101
 
9978
- const initialState$g = {
10102
+ const initialState$h = {
9979
10103
  email: "",
9980
10104
  password: "",
9981
10105
  emailError: null,
@@ -9992,10 +10116,10 @@ const initialState$g = {
9992
10116
  content: ""
9993
10117
  }
9994
10118
  };
9995
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
10119
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9996
10120
  const {
9997
- Provider: Provider$g
9998
- } = store$g;
10121
+ Provider: Provider$h
10122
+ } = store$h;
9999
10123
 
10000
10124
  const RegisterContainer = ({
10001
10125
  style,
@@ -10178,7 +10302,7 @@ const RegisterContainer = ({
10178
10302
  });
10179
10303
 
10180
10304
  case RESET_LOGIN_FORM:
10181
- return initialState$g;
10305
+ return initialState$h;
10182
10306
 
10183
10307
  case DISABLE_REGISTRATION_BUTTON:
10184
10308
  return lib_7({ ...state,
@@ -10196,12 +10320,12 @@ const RegisterContainer = ({
10196
10320
  default:
10197
10321
  return state;
10198
10322
  }
10199
- }, initialState$g);
10323
+ }, initialState$h);
10200
10324
  return /*#__PURE__*/React__default['default'].createElement("div", {
10201
10325
  style: { ...style
10202
10326
  },
10203
10327
  className: `pelcro-container pelcro-register-container ${className}`
10204
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10328
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10205
10329
  value: {
10206
10330
  state,
10207
10331
  dispatch
@@ -10209,12 +10333,12 @@ const RegisterContainer = ({
10209
10333
  }, children.length ? children.map((child, i) => {
10210
10334
  if (child) {
10211
10335
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10212
- store: store$g,
10336
+ store: store$h,
10213
10337
  key: i
10214
10338
  });
10215
10339
  }
10216
10340
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10217
- store: store$g
10341
+ store: store$h
10218
10342
  })));
10219
10343
  };
10220
10344
  /**
@@ -10229,15 +10353,15 @@ function hasSecurityTokenEnabled$1() {
10229
10353
  return hasSecuritySdkLoaded;
10230
10354
  }
10231
10355
 
10232
- var _path$p;
10356
+ var _path$r;
10233
10357
 
10234
- 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); }
10358
+ 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); }
10235
10359
 
10236
10360
  function SvgFacebookLogo(props) {
10237
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10361
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10238
10362
  xmlns: "http://www.w3.org/2000/svg",
10239
10363
  viewBox: "88.428 12.828 107.543 207.085"
10240
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10364
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10241
10365
  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",
10242
10366
  fill: "#3c5a9a"
10243
10367
  })));
@@ -10254,10 +10378,10 @@ const FacebookLoginButton = ({
10254
10378
  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;
10255
10379
  const {
10256
10380
  dispatch: loginDispatch
10257
- } = React.useContext(store$h);
10381
+ } = React.useContext(store$i);
10258
10382
  const {
10259
10383
  dispatch: registerDispatch
10260
- } = React.useContext(store$g);
10384
+ } = React.useContext(store$h);
10261
10385
 
10262
10386
  const onSuccess = facebookUser => {
10263
10387
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10310,15 +10434,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10310
10434
  unwrapExports(googleLogin);
10311
10435
  var googleLogin_1 = googleLogin.GoogleLogin;
10312
10436
 
10313
- var _path$o, _path2$3, _path3$1, _path4;
10437
+ var _path$q, _path2$3, _path3$1, _path4;
10314
10438
 
10315
- 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); }
10439
+ 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); }
10316
10440
 
10317
10441
  function SvgGoogleLogo(props) {
10318
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10442
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10319
10443
  viewBox: "0 0 24 24",
10320
10444
  xmlns: "http://www.w3.org/2000/svg"
10321
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10445
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10322
10446
  fill: "#4285F4",
10323
10447
  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"
10324
10448
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10344,10 +10468,10 @@ const GoogleLoginButton = ({
10344
10468
  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;
10345
10469
  const {
10346
10470
  dispatch: loginDispatch
10347
- } = React.useContext(store$h);
10471
+ } = React.useContext(store$i);
10348
10472
  const {
10349
10473
  dispatch: registerDispatch
10350
- } = React.useContext(store$g);
10474
+ } = React.useContext(store$h);
10351
10475
 
10352
10476
  const onSuccess = response => {
10353
10477
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10395,15 +10519,15 @@ const GoogleLoginButton = ({
10395
10519
  }) : null;
10396
10520
  };
10397
10521
 
10398
- var _path$n;
10522
+ var _path$p;
10399
10523
 
10400
- 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); }
10524
+ 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); }
10401
10525
 
10402
10526
  function SvgAuth0Logo(props) {
10403
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10527
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10404
10528
  viewBox: "0 0 256 285",
10405
10529
  xmlns: "http://www.w3.org/2000/svg"
10406
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10530
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10407
10531
  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"
10408
10532
  })));
10409
10533
  }
@@ -10443,10 +10567,10 @@ const Auth0LoginButton = ({
10443
10567
  }, [auth0Enabled, auth0Loaded]);
10444
10568
  const {
10445
10569
  dispatch: loginDispatch
10446
- } = React.useContext(store$h);
10570
+ } = React.useContext(store$i);
10447
10571
  const {
10448
10572
  dispatch: registerDispatch
10449
- } = React.useContext(store$g);
10573
+ } = React.useContext(store$h);
10450
10574
 
10451
10575
  function handleClick() {
10452
10576
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10579,15 +10703,15 @@ function LoginView(props) {
10579
10703
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10580
10704
  }
10581
10705
 
10582
- var _path$m, _path2$2, _path3;
10706
+ var _path$o, _path2$2, _path3;
10583
10707
 
10584
- 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); }
10708
+ 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); }
10585
10709
 
10586
10710
  function SvgPelcroAuthorship(props) {
10587
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10711
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10588
10712
  xmlns: "http://www.w3.org/2000/svg",
10589
10713
  viewBox: "0 -80.652 497.072 179.991"
10590
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10714
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10591
10715
  fill: "none",
10592
10716
  stroke: "#4a4a4a",
10593
10717
  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"
@@ -10734,11 +10858,11 @@ function LoginModal({
10734
10858
  LoginModal.viewId = "login";
10735
10859
 
10736
10860
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10737
- store: store$g
10861
+ store: store$h
10738
10862
  }, props));
10739
10863
 
10740
10864
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10741
- store: store$g
10865
+ store: store$h
10742
10866
  }, props));
10743
10867
 
10744
10868
  const RegisterButton = ({
@@ -10758,7 +10882,7 @@ const RegisterButton = ({
10758
10882
  buttonDisabled
10759
10883
  },
10760
10884
  dispatch
10761
- } = React.useContext(store$g);
10885
+ } = React.useContext(store$h);
10762
10886
  const {
10763
10887
  t
10764
10888
  } = useTranslation("register");
@@ -10896,7 +11020,7 @@ function FirstName({
10896
11020
  }
10897
11021
 
10898
11022
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10899
- store: store$g
11023
+ store: store$h
10900
11024
  }, props));
10901
11025
 
10902
11026
  function LastName({
@@ -10927,7 +11051,7 @@ function LastName({
10927
11051
  }
10928
11052
 
10929
11053
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10930
- store: store$g
11054
+ store: store$h
10931
11055
  }, props));
10932
11056
 
10933
11057
  /**
@@ -11051,7 +11175,7 @@ function TextInput({
11051
11175
 
11052
11176
  const RegisterTextInput = props => {
11053
11177
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11054
- store: store$g
11178
+ store: store$h
11055
11179
  }));
11056
11180
  };
11057
11181
 
@@ -11198,6 +11322,7 @@ function SelectModalWithHook(props) {
11198
11322
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11199
11323
  }, []);
11200
11324
  const {
11325
+ productsList,
11201
11326
  isGift,
11202
11327
  plan,
11203
11328
  product,
@@ -11207,11 +11332,12 @@ function SelectModalWithHook(props) {
11207
11332
  view,
11208
11333
  set
11209
11334
  } = usePelcro();
11210
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11211
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11335
+ const isRenewingSub = view === "_plan-select-renew";
11212
11336
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11337
+ productsList: productsList,
11213
11338
  isGift: isGift,
11214
- disableGifting: isRenewingGift,
11339
+ disableGifting: isRenewingGift || isRenewingSub,
11340
+ isRenewingSub: isRenewingSub,
11215
11341
  plan: plan,
11216
11342
  product: product,
11217
11343
  onClose: () => {
@@ -11225,8 +11351,10 @@ function SelectModalWithHook(props) {
11225
11351
  plan,
11226
11352
  isGift
11227
11353
  }),
11228
- setView: switchView,
11229
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11354
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11355
+ subscriptionIdToRenew
11356
+ }),
11357
+ setView: switchView
11230
11358
  });
11231
11359
  }
11232
11360
  SelectModalWithHook.viewId = "plan-select";
@@ -11258,10 +11386,10 @@ class SelectModal extends React.Component {
11258
11386
  });
11259
11387
  }
11260
11388
 
11261
- if (this.state.productList.length === 1) {
11389
+ if (this.props.productsList.length === 1) {
11262
11390
  this.setState({
11263
- product: this.state.productList[0],
11264
- planList: this.state.productList[0].plans,
11391
+ product: this.props.productsList[0],
11392
+ planList: this.props.productsList[0].plans,
11265
11393
  mode: "plan"
11266
11394
  });
11267
11395
  }
@@ -11278,7 +11406,7 @@ class SelectModal extends React.Component {
11278
11406
  });
11279
11407
 
11280
11408
  _defineProperty$3(this, "onProductChange", e => {
11281
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11409
+ const product = productsList[e.target.selectedIndex];
11282
11410
  this.setState({
11283
11411
  product: product,
11284
11412
  plan: product.plans[0]
@@ -11344,7 +11472,7 @@ class SelectModal extends React.Component {
11344
11472
 
11345
11473
  _defineProperty$3(this, "renderProducts", () => {
11346
11474
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11347
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11475
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11348
11476
  return productsToShow.map((product, index) => {
11349
11477
  return this.renderOneProduct(product, index);
11350
11478
  });
@@ -11357,7 +11485,7 @@ class SelectModal extends React.Component {
11357
11485
  return this.renderOneProduct(this.state.product);
11358
11486
  }
11359
11487
 
11360
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11488
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11361
11489
 
11362
11490
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11363
11491
  return this.renderProducts();
@@ -11373,10 +11501,7 @@ class SelectModal extends React.Component {
11373
11501
  className: "plc-text-sm plc-font-semibold"
11374
11502
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11375
11503
 
11376
- function productsWithMatchedTaggedFirst() {
11377
- var _window$Pelcro$produc;
11378
-
11379
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11504
+ function productsWithMatchedTaggedFirst(allProducts) {
11380
11505
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11381
11506
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11382
11507
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11410,7 +11535,7 @@ class SelectModal extends React.Component {
11410
11535
  _defineProperty$3(this, "selectProduct", e => {
11411
11536
  const id = e.target.dataset.key;
11412
11537
 
11413
- for (const product of this.state.productList) {
11538
+ for (const product of this.props.productsList) {
11414
11539
  if (+product.id === +id) {
11415
11540
  var _this$state$plan;
11416
11541
 
@@ -11463,6 +11588,14 @@ class SelectModal extends React.Component {
11463
11588
 
11464
11589
  _defineProperty$3(this, "submitOption", () => {
11465
11590
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11591
+
11592
+ if (this.props.isRenewingSub) {
11593
+ var _matchingSub$id;
11594
+
11595
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11596
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11597
+ }
11598
+
11466
11599
  const {
11467
11600
  product,
11468
11601
  isGift
@@ -11500,8 +11633,7 @@ class SelectModal extends React.Component {
11500
11633
  plan: {},
11501
11634
  isGift: props.isGift,
11502
11635
  disabled: true,
11503
- mode: "product",
11504
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11636
+ mode: "product"
11505
11637
  };
11506
11638
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11507
11639
  this.locale = this.props.t;
@@ -11509,7 +11641,7 @@ class SelectModal extends React.Component {
11509
11641
  }
11510
11642
 
11511
11643
  render() {
11512
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11644
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11513
11645
 
11514
11646
  const {
11515
11647
  disableGifting
@@ -11543,7 +11675,7 @@ class SelectModal extends React.Component {
11543
11675
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11544
11676
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11545
11677
  className: "plc-text-2xl plc-font-semibold"
11546
- }, 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", {
11678
+ }, 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", {
11547
11679
  className: "pelcro-select-products-wrapper"
11548
11680
  }, (_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", {
11549
11681
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -13103,6 +13235,12 @@ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13103
13235
 
13104
13236
  var _createSubscription3 = /*#__PURE__*/new WeakMap();
13105
13237
 
13238
+ var _renewSubscription2 = /*#__PURE__*/new WeakMap();
13239
+
13240
+ var _createGiftedSubscription3 = /*#__PURE__*/new WeakMap();
13241
+
13242
+ var _renewGiftedSubscription2 = /*#__PURE__*/new WeakMap();
13243
+
13106
13244
  class VantivGateway {
13107
13245
  constructor() {
13108
13246
  _paymentGateway3.set(this, {
@@ -13117,6 +13255,18 @@ class VantivGateway {
13117
13255
  case types.CREATE_SUBSCRIPTION:
13118
13256
  return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13119
13257
 
13258
+ case types.RENEW_SUBSCRIPTION:
13259
+ return _classPrivateFieldGet(this, _renewSubscription2).call(this, options, callback);
13260
+
13261
+ case types.CREATE_GIFTED_SUBSCRIPTION:
13262
+ return _classPrivateFieldGet(this, _createGiftedSubscription3).call(this, options, callback);
13263
+
13264
+ case types.RENEW_GIFTED_SUBSCRIPTION:
13265
+ return _classPrivateFieldGet(this, _renewGiftedSubscription2).call(this, options, callback);
13266
+ // TODO: implement paying invoices as well
13267
+ // case types.PAY_INVOICE:
13268
+ // return this.#payInvoice(options, callback);
13269
+
13120
13270
  default:
13121
13271
  console.error("Unsupported subscriptiion method: vantiv Gateway");
13122
13272
  }
@@ -13131,46 +13281,151 @@ class VantivGateway {
13131
13281
  couponCode,
13132
13282
  product,
13133
13283
  quantity = 1,
13134
- addressId
13284
+ addressId,
13285
+ isExistingSource
13135
13286
  } = options;
13287
+ const params = isExistingSource ? {
13288
+ source_id: token
13289
+ } : {
13290
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13291
+ gateway_token: token
13292
+ };
13136
13293
  window.Pelcro.subscription.create({
13137
13294
  quantity,
13138
- gateway_token: token,
13139
- payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13140
13295
  auth_token: window.Pelcro.user.read().auth_token,
13141
13296
  plan_id: plan.id,
13142
13297
  coupon_code: couponCode,
13143
- address_id: product.address_required ? addressId : null
13298
+ address_id: product.address_required ? addressId : null,
13299
+ ...params
13144
13300
  }, (err, res) => {
13145
13301
  callback(err, res);
13146
13302
  });
13147
13303
  }
13148
13304
  });
13149
- }
13150
-
13151
- }
13152
13305
 
13153
- /**
13154
- * @typedef {Object} PaymentStateType
13155
- * @property {boolean} disableSubmit
13156
- * @property {boolean} isLoading
13157
- * @property {boolean} disableCouponButton
13158
- * @property {object} couponObject
13159
- * @property {string} couponCode
13160
- * @property {string} couponError
13161
- * @property {boolean} enableCouponField
13162
- * @property {string} percentOff
13163
- * @property {unknown} canMakePayment
13164
- * @property {unknown} paymentRequest
13165
- * @property {number} updatedPrice
13166
- * @property {number} taxAmount
13167
- * @property {object} currentPlan
13168
- * @property {object} alert
13169
- */
13306
+ _renewSubscription2.set(this, {
13307
+ writable: true,
13308
+ value: (options, callback) => {
13309
+ const {
13310
+ subscriptionIdToRenew,
13311
+ token,
13312
+ plan,
13313
+ couponCode,
13314
+ product,
13315
+ addressId,
13316
+ isExistingSource
13317
+ } = options;
13318
+ const params = isExistingSource ? {
13319
+ source_id: token
13320
+ } : {
13321
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13322
+ gateway_token: token
13323
+ };
13324
+ window.Pelcro.subscription.renew({
13325
+ auth_token: window.Pelcro.user.read().auth_token,
13326
+ plan_id: plan.id,
13327
+ coupon_code: couponCode,
13328
+ subscription_id: subscriptionIdToRenew,
13329
+ address_id: product.address_required ? addressId : null,
13330
+ ...params
13331
+ }, (err, res) => {
13332
+ callback(err, res);
13333
+ });
13334
+ }
13335
+ });
13336
+
13337
+ _createGiftedSubscription3.set(this, {
13338
+ writable: true,
13339
+ value: (options, callback) => {
13340
+ const {
13341
+ token,
13342
+ plan,
13343
+ couponCode,
13344
+ product,
13345
+ giftRecipient,
13346
+ quantity = 1,
13347
+ addressId,
13348
+ isExistingSource
13349
+ } = options;
13350
+ const params = isExistingSource ? {
13351
+ source_id: token
13352
+ } : {
13353
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13354
+ gateway_token: token
13355
+ };
13356
+ window.Pelcro.subscription.create({
13357
+ quantity,
13358
+ auth_token: window.Pelcro.user.read().auth_token,
13359
+ plan_id: plan.id,
13360
+ coupon_code: couponCode,
13361
+ gift_recipient_email: giftRecipient.email,
13362
+ gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13363
+ gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
13364
+ gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
13365
+ gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
13366
+ address_id: product.address_required ? addressId : null,
13367
+ ...params
13368
+ }, (err, res) => {
13369
+ callback(err, res);
13370
+ });
13371
+ }
13372
+ });
13373
+
13374
+ _renewGiftedSubscription2.set(this, {
13375
+ writable: true,
13376
+ value: (options, callback) => {
13377
+ const {
13378
+ subscriptionIdToRenew,
13379
+ token,
13380
+ product,
13381
+ plan,
13382
+ couponCode,
13383
+ addressId,
13384
+ isExistingSource
13385
+ } = options;
13386
+ const params = isExistingSource ? {
13387
+ source_id: token
13388
+ } : {
13389
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13390
+ gateway_token: token
13391
+ };
13392
+ window.Pelcro.subscription.renewGift({
13393
+ auth_token: window.Pelcro.user.read().auth_token,
13394
+ plan_id: plan.id,
13395
+ coupon_code: couponCode,
13396
+ subscription_id: subscriptionIdToRenew,
13397
+ address_id: product.address_required ? addressId : null,
13398
+ ...params
13399
+ }, (err, res) => {
13400
+ callback(err, res);
13401
+ });
13402
+ }
13403
+ });
13404
+ }
13405
+
13406
+ }
13407
+
13408
+ /**
13409
+ * @typedef {Object} PaymentStateType
13410
+ * @property {boolean} disableSubmit
13411
+ * @property {boolean} isLoading
13412
+ * @property {boolean} disableCouponButton
13413
+ * @property {object} couponObject
13414
+ * @property {string} couponCode
13415
+ * @property {string} couponError
13416
+ * @property {boolean} enableCouponField
13417
+ * @property {string} percentOff
13418
+ * @property {unknown} canMakePayment
13419
+ * @property {unknown} paymentRequest
13420
+ * @property {number} updatedPrice
13421
+ * @property {number} taxAmount
13422
+ * @property {object} currentPlan
13423
+ * @property {object} alert
13424
+ */
13170
13425
 
13171
13426
  /** @type {PaymentStateType} */
13172
13427
 
13173
- const initialState$f = {
13428
+ const initialState$g = {
13174
13429
  disableSubmit: false,
13175
13430
  isLoading: false,
13176
13431
  disableCouponButton: false,
@@ -13189,10 +13444,10 @@ const initialState$f = {
13189
13444
  content: ""
13190
13445
  }
13191
13446
  };
13192
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
13447
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
13193
13448
  const {
13194
- Provider: Provider$f
13195
- } = store$f;
13449
+ Provider: Provider$g
13450
+ } = store$g;
13196
13451
 
13197
13452
  const PaymentMethodContainerWithoutStripe = ({
13198
13453
  style,
@@ -13205,7 +13460,7 @@ const PaymentMethodContainerWithoutStripe = ({
13205
13460
  onFailure = () => {},
13206
13461
  ...props
13207
13462
  }) => {
13208
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
13463
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isGift, _props$isRenewingGift, _props$invoice;
13209
13464
 
13210
13465
  const {
13211
13466
  t
@@ -13221,6 +13476,7 @@ const PaymentMethodContainerWithoutStripe = ({
13221
13476
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
13222
13477
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
13223
13478
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
13479
+ const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
13224
13480
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13225
13481
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
13226
13482
  React.useEffect(() => {
@@ -13238,53 +13494,134 @@ const PaymentMethodContainerWithoutStripe = ({
13238
13494
  }, []);
13239
13495
 
13240
13496
  function submitVantivPayment() {
13241
- if (!vantivInstanceRef.current) {
13242
- return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13243
- }
13497
+ if (!selectedPaymentMethodId) {
13498
+ if (!vantivInstanceRef.current) {
13499
+ return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13500
+ }
13244
13501
 
13245
- const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13502
+ const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13246
13503
 
13247
- vantivInstanceRef.current.getPaypageRegistrationId({
13248
- id: orderId,
13249
- orderId: orderId
13250
- });
13504
+ vantivInstanceRef.current.getPaypageRegistrationId({
13505
+ id: orderId,
13506
+ orderId: orderId
13507
+ });
13508
+ } else {
13509
+ handleVantivPayment(null);
13510
+ }
13251
13511
  }
13252
13512
 
13253
13513
  function handleVantivPayment(paymentRequest) {
13254
- const SUCCESS_STATUS = "870";
13514
+ if (paymentRequest) {
13515
+ const SUCCESS_STATUS = "870";
13255
13516
 
13256
- if (paymentRequest.response !== SUCCESS_STATUS) {
13257
- return handlePaymentError({
13258
- error: new Error(paymentRequest.message)
13259
- });
13517
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13518
+ return handlePaymentError({
13519
+ error: new Error(paymentRequest.message)
13520
+ });
13521
+ }
13260
13522
  }
13261
13523
 
13262
13524
  const subscription = new Subscription(new VantivGateway());
13263
- const {
13264
- couponCode
13265
- } = state;
13266
- return subscription.execute({
13267
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13268
- token: paymentRequest,
13269
- quantity: plan.quantity,
13270
- plan,
13271
- couponCode,
13272
- product,
13273
- addressId: selectedAddressId
13274
- }, (err, res) => {
13275
- if (err) {
13276
- return handlePaymentError(err);
13277
- }
13278
13525
 
13279
- onSuccess(res);
13280
- });
13526
+ if (type === "createPayment") {
13527
+ handleVantivSubscription();
13528
+ } // TODO: handle other types of payments
13529
+ // } else if (type === "orderCreate") {
13530
+ // purchase(stripeSource, state, dispatch);
13531
+ // } else if (type === "invoicePayment") {
13532
+ // payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13533
+ // }
13534
+
13535
+
13536
+ function handleVantivSubscription() {
13537
+ const createSubscription = !isGift && !subscriptionIdToRenew;
13538
+ const renewSubscription = !isGift && subscriptionIdToRenew;
13539
+ const giftSubscriprition = isGift && !subscriptionIdToRenew;
13540
+ const renewGift = isRenewingGift;
13541
+ const {
13542
+ couponCode
13543
+ } = state;
13544
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13545
+
13546
+ if (renewGift) {
13547
+ return subscription.execute({
13548
+ type: SUBSCRIPTION_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13549
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13550
+ plan,
13551
+ couponCode,
13552
+ product,
13553
+ isExistingSource: isUsingExistingPaymentMethod,
13554
+ subscriptionIdToRenew,
13555
+ addressId: selectedAddressId
13556
+ }, (err, res) => {
13557
+ if (err) {
13558
+ return handlePaymentError(err);
13559
+ }
13560
+
13561
+ onSuccess(res);
13562
+ });
13563
+ } else if (giftSubscriprition) {
13564
+ return subscription.execute({
13565
+ type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13566
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13567
+ quantity: plan.quantity,
13568
+ plan,
13569
+ couponCode,
13570
+ product,
13571
+ isExistingSource: isUsingExistingPaymentMethod,
13572
+ giftRecipient,
13573
+ addressId: selectedAddressId
13574
+ }, (err, res) => {
13575
+ if (err) {
13576
+ return handlePaymentError(err);
13577
+ }
13578
+
13579
+ onSuccess(res);
13580
+ });
13581
+ } else if (renewSubscription) {
13582
+ return subscription.execute({
13583
+ type: SUBSCRIPTION_TYPES.RENEW_SUBSCRIPTION,
13584
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13585
+ quantity: plan.quantity,
13586
+ plan,
13587
+ couponCode,
13588
+ product,
13589
+ isExistingSource: isUsingExistingPaymentMethod,
13590
+ subscriptionIdToRenew,
13591
+ addressId: selectedAddressId
13592
+ }, (err, res) => {
13593
+ if (err) {
13594
+ return handlePaymentError(err);
13595
+ }
13596
+
13597
+ onSuccess(res);
13598
+ });
13599
+ } else if (createSubscription) {
13600
+ return subscription.execute({
13601
+ type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13602
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13603
+ quantity: plan.quantity,
13604
+ plan,
13605
+ couponCode,
13606
+ product,
13607
+ isExistingSource: isUsingExistingPaymentMethod,
13608
+ addressId: selectedAddressId
13609
+ }, (err, res) => {
13610
+ if (err) {
13611
+ return handlePaymentError(err);
13612
+ }
13613
+
13614
+ onSuccess(res);
13615
+ });
13616
+ }
13617
+ }
13281
13618
  }
13282
13619
 
13283
13620
  const vantivInstanceRef = React__default['default'].useRef(null);
13284
13621
  React.useEffect(() => {
13285
13622
  const cardProcessor = getSiteCardProcessor();
13286
13623
 
13287
- if (cardProcessor === "vantiv") {
13624
+ if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13288
13625
  var _window$Pelcro$site$r;
13289
13626
 
13290
13627
  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;
@@ -13307,7 +13644,7 @@ const PaymentMethodContainerWithoutStripe = ({
13307
13644
  }
13308
13645
  });
13309
13646
  }
13310
- }, []);
13647
+ }, [selectedPaymentMethodId]);
13311
13648
 
13312
13649
  const initPaymentRequest = (state, dispatch) => {
13313
13650
  try {
@@ -14226,6 +14563,10 @@ const PaymentMethodContainerWithoutStripe = ({
14226
14563
  disableSubmit: true,
14227
14564
  isLoading: true
14228
14565
  }, (state, dispatch) => {
14566
+ if (getSiteCardProcessor() === "vantiv") {
14567
+ return submitVantivPayment();
14568
+ }
14569
+
14229
14570
  if (selectedPaymentMethodId) {
14230
14571
  // pay with selected method (source) if exists already
14231
14572
  return handlePayment({
@@ -14238,10 +14579,6 @@ const PaymentMethodContainerWithoutStripe = ({
14238
14579
  return updatePaymentSource(state, dispatch);
14239
14580
  }
14240
14581
 
14241
- if (getSiteCardProcessor() === "vantiv") {
14242
- return submitVantivPayment();
14243
- }
14244
-
14245
14582
  submitPayment(state);
14246
14583
  });
14247
14584
 
@@ -14310,21 +14647,21 @@ const PaymentMethodContainerWithoutStripe = ({
14310
14647
  default:
14311
14648
  return state;
14312
14649
  }
14313
- }, initialState$f);
14650
+ }, initialState$g);
14314
14651
  return /*#__PURE__*/React__default['default'].createElement("div", {
14315
14652
  style: { ...style
14316
14653
  },
14317
14654
  className: `pelcro-container pelcro-payment-container ${className}`
14318
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14655
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14319
14656
  value: {
14320
14657
  state,
14321
14658
  dispatch
14322
14659
  }
14323
14660
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14324
- store: store$f,
14661
+ store: store$g,
14325
14662
  key: i
14326
14663
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14327
- store: store$f
14664
+ store: store$g
14328
14665
  })));
14329
14666
  };
14330
14667
 
@@ -14346,7 +14683,7 @@ const PaymentMethodContainer = props => {
14346
14683
  stripeAccount: window.Pelcro.site.read().account_id,
14347
14684
  locale: getPageOrDefaultLanguage()
14348
14685
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14349
- store: store$f
14686
+ store: store$g
14350
14687
  }, props))));
14351
14688
  }
14352
14689
 
@@ -14399,7 +14736,7 @@ const PelcroPaymentRequestButton = props => {
14399
14736
  currentPlan,
14400
14737
  updatedPrice
14401
14738
  }
14402
- } = React.useContext(store$f);
14739
+ } = React.useContext(store$g);
14403
14740
 
14404
14741
  const updatePaymentRequest = () => {
14405
14742
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14475,7 +14812,7 @@ const DiscountedPrice = props => {
14475
14812
  taxAmount,
14476
14813
  percentOff
14477
14814
  }
14478
- } = React.useContext(store$f);
14815
+ } = React.useContext(store$g);
14479
14816
  const {
14480
14817
  order,
14481
14818
  plan
@@ -14525,7 +14862,7 @@ const SubmitPaymentMethod = ({
14525
14862
  isLoading,
14526
14863
  updatedPrice
14527
14864
  }
14528
- } = React.useContext(store$f);
14865
+ } = React.useContext(store$g);
14529
14866
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14530
14867
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14531
14868
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14546,17 +14883,17 @@ const SubmitPaymentMethod = ({
14546
14883
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14547
14884
  };
14548
14885
 
14549
- var _path$l;
14886
+ var _path$n;
14550
14887
 
14551
- 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); }
14888
+ 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); }
14552
14889
 
14553
14890
  function SvgArrowLeft(props) {
14554
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14891
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14555
14892
  xmlns: "http://www.w3.org/2000/svg",
14556
14893
  fill: "none",
14557
14894
  viewBox: "0 0 24 24",
14558
14895
  stroke: "currentColor"
14559
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14896
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14560
14897
  strokeLinecap: "round",
14561
14898
  strokeLinejoin: "round",
14562
14899
  strokeWidth: 2,
@@ -14575,7 +14912,7 @@ const ApplyCouponButton = ({
14575
14912
  disableCouponButton
14576
14913
  },
14577
14914
  dispatch
14578
- } = React.useContext(store$f);
14915
+ } = React.useContext(store$g);
14579
14916
  const {
14580
14917
  t
14581
14918
  } = useTranslation("checkoutForm");
@@ -14609,7 +14946,7 @@ const CouponCodeField = props => {
14609
14946
  couponCode,
14610
14947
  couponError
14611
14948
  }
14612
- } = React.useContext(store$f);
14949
+ } = React.useContext(store$g);
14613
14950
 
14614
14951
  const onCouponCodeChange = e => {
14615
14952
  dispatch({
@@ -14638,17 +14975,17 @@ const CouponCodeField = props => {
14638
14975
  }, props));
14639
14976
  };
14640
14977
 
14641
- var _path$k;
14978
+ var _path$m;
14642
14979
 
14643
- 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); }
14980
+ 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); }
14644
14981
 
14645
14982
  function SvgTicket(props) {
14646
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
14983
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14647
14984
  xmlns: "http://www.w3.org/2000/svg",
14648
14985
  fill: "none",
14649
14986
  viewBox: "0 0 24 24",
14650
14987
  stroke: "currentColor"
14651
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
14988
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14652
14989
  strokeLinecap: "round",
14653
14990
  strokeLinejoin: "round",
14654
14991
  strokeWidth: 2,
@@ -14665,7 +15002,7 @@ const CouponCode = ({
14665
15002
  state: {
14666
15003
  enableCouponField
14667
15004
  }
14668
- } = React.useContext(store$f);
15005
+ } = React.useContext(store$g);
14669
15006
  const {
14670
15007
  t
14671
15008
  } = useTranslation("checkoutForm");
@@ -14922,7 +15259,7 @@ const PaypalSubscribeButton = props => {
14922
15259
  const {
14923
15260
  dispatch,
14924
15261
  state
14925
- } = React.useContext(store$f);
15262
+ } = React.useContext(store$g);
14926
15263
  const {
14927
15264
  product,
14928
15265
  plan,
@@ -15008,16 +15345,16 @@ const BankRedirection = () => {
15008
15345
  }));
15009
15346
  };
15010
15347
 
15011
- var _path$j;
15348
+ var _path$l;
15012
15349
 
15013
- 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); }
15350
+ 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); }
15014
15351
 
15015
15352
  function SvgLock(props) {
15016
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15353
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15017
15354
  xmlns: "http://www.w3.org/2000/svg",
15018
15355
  viewBox: "0 0 20 20",
15019
15356
  fill: "currentColor"
15020
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15357
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15021
15358
  fillRule: "evenodd",
15022
15359
  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",
15023
15360
  clipRule: "evenodd"
@@ -15034,7 +15371,7 @@ const SelectedPaymentMethod = () => {
15034
15371
  state: {
15035
15372
  isLoading
15036
15373
  }
15037
- } = React.useContext(store$f);
15374
+ } = React.useContext(store$g);
15038
15375
  const {
15039
15376
  switchView,
15040
15377
  selectedPaymentMethodId
@@ -15076,7 +15413,7 @@ const TaxAmount = () => {
15076
15413
  state: {
15077
15414
  taxAmount
15078
15415
  }
15079
- } = React.useContext(store$f);
15416
+ } = React.useContext(store$g);
15080
15417
  const {
15081
15418
  plan
15082
15419
  } = usePelcro();
@@ -15240,12 +15577,12 @@ function SubscriptionRenewModal({
15240
15577
  }
15241
15578
  SubscriptionRenewModal.viewId = "subscription-renew";
15242
15579
 
15243
- var _path$i;
15580
+ var _path$k;
15244
15581
 
15245
- 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); }
15582
+ 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); }
15246
15583
 
15247
15584
  function SvgGift(props) {
15248
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15585
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15249
15586
  className: "plc-w-6 plc-h-6 plc-mr-2",
15250
15587
  fill: "none",
15251
15588
  stroke: "currentColor",
@@ -15254,7 +15591,7 @@ function SvgGift(props) {
15254
15591
  strokeWidth: 2,
15255
15592
  viewBox: "0 0 24 24",
15256
15593
  xmlns: "http://www.w3.org/2000/svg"
15257
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15594
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15258
15595
  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"
15259
15596
  })));
15260
15597
  }
@@ -15595,7 +15932,7 @@ class DefaultNewsLetter extends React.Component {
15595
15932
 
15596
15933
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15597
15934
 
15598
- const initialState$e = {
15935
+ const initialState$f = {
15599
15936
  didSubToNewslettersBefore: false,
15600
15937
  newsletters: [],
15601
15938
  isListLoading: true,
@@ -15605,10 +15942,10 @@ const initialState$e = {
15605
15942
  content: ""
15606
15943
  }
15607
15944
  };
15608
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
15945
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
15609
15946
  const {
15610
- Provider: Provider$e
15611
- } = store$e;
15947
+ Provider: Provider$f
15948
+ } = store$f;
15612
15949
 
15613
15950
  const NewsletterUpdateContainer = ({
15614
15951
  style,
@@ -15721,7 +16058,7 @@ const NewsletterUpdateContainer = ({
15721
16058
  default:
15722
16059
  return state;
15723
16060
  }
15724
- }, initialState$e);
16061
+ }, initialState$f);
15725
16062
  React.useEffect(() => {
15726
16063
  const getUserNewsletters = () => {
15727
16064
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15765,7 +16102,7 @@ const NewsletterUpdateContainer = ({
15765
16102
  style: { ...style
15766
16103
  },
15767
16104
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15768
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16105
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
15769
16106
  value: {
15770
16107
  state,
15771
16108
  dispatch
@@ -15773,12 +16110,12 @@ const NewsletterUpdateContainer = ({
15773
16110
  }, children.length ? children.map((child, i) => {
15774
16111
  if (child) {
15775
16112
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15776
- store: store$e,
16113
+ store: store$f,
15777
16114
  key: i
15778
16115
  });
15779
16116
  }
15780
16117
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15781
- store: store$e
16118
+ store: store$f
15782
16119
  })));
15783
16120
  };
15784
16121
 
@@ -15793,7 +16130,7 @@ const NewsletterUpdateButton = ({
15793
16130
  isSubmitting,
15794
16131
  isListLoading
15795
16132
  }
15796
- } = React.useContext(store$e);
16133
+ } = React.useContext(store$f);
15797
16134
  const {
15798
16135
  t
15799
16136
  } = useTranslation("newsletter");
@@ -15823,7 +16160,7 @@ const NewsletterUpdateList = () => {
15823
16160
  newsletters,
15824
16161
  isListLoading
15825
16162
  }
15826
- } = React.useContext(store$e);
16163
+ } = React.useContext(store$f);
15827
16164
 
15828
16165
  if (isListLoading) {
15829
16166
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -16027,7 +16364,7 @@ function SubscriptionCreateModal({
16027
16364
  SubscriptionCreateModal.viewId = "subscription-create";
16028
16365
 
16029
16366
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
16030
- const initialState$d = {
16367
+ const initialState$e = {
16031
16368
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
16032
16369
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
16033
16370
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -16040,10 +16377,10 @@ const initialState$d = {
16040
16377
  content: ""
16041
16378
  }
16042
16379
  };
16043
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16380
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
16044
16381
  const {
16045
- Provider: Provider$d
16046
- } = store$d;
16382
+ Provider: Provider$e
16383
+ } = store$e;
16047
16384
 
16048
16385
  const UserUpdateContainer = ({
16049
16386
  style,
@@ -16175,27 +16512,27 @@ const UserUpdateContainer = ({
16175
16512
  default:
16176
16513
  return state;
16177
16514
  }
16178
- }, initialState$d);
16515
+ }, initialState$e);
16179
16516
  return /*#__PURE__*/React__default['default'].createElement("div", {
16180
16517
  style: { ...style
16181
16518
  },
16182
16519
  className: `pelcro-container pelcro-user-update-container ${className}`
16183
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16520
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16184
16521
  value: {
16185
16522
  state,
16186
16523
  dispatch
16187
16524
  }
16188
16525
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16189
- store: store$d,
16526
+ store: store$e,
16190
16527
  key: i
16191
16528
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16192
- store: store$d
16529
+ store: store$e
16193
16530
  })));
16194
16531
  };
16195
16532
 
16196
16533
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16197
16534
  disabled: true,
16198
- store: store$d
16535
+ store: store$e
16199
16536
  }, props));
16200
16537
 
16201
16538
  const UserUpdateButton = ({
@@ -16208,7 +16545,7 @@ const UserUpdateButton = ({
16208
16545
  buttonDisabled
16209
16546
  },
16210
16547
  dispatch
16211
- } = React.useContext(store$d);
16548
+ } = React.useContext(store$e);
16212
16549
  const {
16213
16550
  t
16214
16551
  } = useTranslation("userEdit");
@@ -16225,11 +16562,11 @@ const UserUpdateButton = ({
16225
16562
  };
16226
16563
 
16227
16564
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16228
- store: store$d
16565
+ store: store$e
16229
16566
  }, props));
16230
16567
 
16231
16568
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16232
- store: store$d
16569
+ store: store$e
16233
16570
  }, props));
16234
16571
 
16235
16572
  function Phone({
@@ -16258,22 +16595,22 @@ function Phone({
16258
16595
  }
16259
16596
 
16260
16597
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16261
- store: store$d
16598
+ store: store$e
16262
16599
  }, props));
16263
16600
 
16264
16601
  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";
16265
16602
 
16266
- var _path$h;
16603
+ var _path$j;
16267
16604
 
16268
- 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); }
16605
+ 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); }
16269
16606
 
16270
16607
  function SvgEdit(props) {
16271
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
16608
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16272
16609
  className: "plc-w-6 plc-h-6",
16273
16610
  xmlns: "http://www.w3.org/2000/svg",
16274
16611
  viewBox: "0 0 20 20",
16275
16612
  fill: "currentColor"
16276
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
16613
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16277
16614
  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"
16278
16615
  })));
16279
16616
  }
@@ -16405,16 +16742,16 @@ function DisplayName({
16405
16742
  }
16406
16743
 
16407
16744
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16408
- store: store$d
16745
+ store: store$e
16409
16746
  }, props));
16410
16747
 
16411
16748
  const UserUpdateTextInput = props => {
16412
16749
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16413
- store: store$d
16750
+ store: store$e
16414
16751
  }));
16415
16752
  };
16416
16753
 
16417
- const initialState$c = {
16754
+ const initialState$d = {
16418
16755
  isSubmitting: false,
16419
16756
  firstName: "",
16420
16757
  firstNameError: "",
@@ -16439,10 +16776,10 @@ const initialState$c = {
16439
16776
  content: ""
16440
16777
  }
16441
16778
  };
16442
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
16779
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16443
16780
  const {
16444
- Provider: Provider$c
16445
- } = store$c;
16781
+ Provider: Provider$d
16782
+ } = store$d;
16446
16783
 
16447
16784
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16448
16785
 
@@ -16649,7 +16986,7 @@ const AddressCreateContainer = ({
16649
16986
  default:
16650
16987
  return state;
16651
16988
  }
16652
- }, initialState$c);
16989
+ }, initialState$d);
16653
16990
  React.useEffect(() => {
16654
16991
  const getStates = () => {
16655
16992
  dispatch({
@@ -16681,16 +17018,16 @@ const AddressCreateContainer = ({
16681
17018
  style: { ...style
16682
17019
  },
16683
17020
  className: `pelcro-container pelcro-address-create-container ${className}`
16684
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17021
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16685
17022
  value: {
16686
17023
  state,
16687
17024
  dispatch
16688
17025
  }
16689
17026
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16690
- store: store$c,
17027
+ store: store$d,
16691
17028
  key: i
16692
17029
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16693
- store: store$c
17030
+ store: store$d
16694
17031
  })));
16695
17032
  };
16696
17033
 
@@ -16701,7 +17038,7 @@ function AddressCreateFirstName(props) {
16701
17038
  firstName,
16702
17039
  firstNameError
16703
17040
  }
16704
- } = React.useContext(store$c);
17041
+ } = React.useContext(store$d);
16705
17042
 
16706
17043
  const handleBlur = () => {
16707
17044
  return dispatch({
@@ -16744,7 +17081,7 @@ function AddressCreateLastName(props) {
16744
17081
  lastName,
16745
17082
  lastNameError
16746
17083
  }
16747
- } = React.useContext(store$c);
17084
+ } = React.useContext(store$d);
16748
17085
 
16749
17086
  const handleBlur = () => {
16750
17087
  return dispatch({
@@ -16787,7 +17124,7 @@ function AddressCreateLine1(props) {
16787
17124
  line1,
16788
17125
  line1Error
16789
17126
  }
16790
- } = React.useContext(store$c);
17127
+ } = React.useContext(store$d);
16791
17128
 
16792
17129
  const handleBlur = () => {
16793
17130
  return dispatch({
@@ -16830,7 +17167,7 @@ function AddressCreateCity(props) {
16830
17167
  city,
16831
17168
  cityError
16832
17169
  }
16833
- } = React.useContext(store$c);
17170
+ } = React.useContext(store$d);
16834
17171
 
16835
17172
  const handleBlur = () => {
16836
17173
  return dispatch({
@@ -16873,7 +17210,7 @@ function AddressCreatePostalCode(props) {
16873
17210
  postalCode,
16874
17211
  postalCodeError
16875
17212
  }
16876
- } = React.useContext(store$c);
17213
+ } = React.useContext(store$d);
16877
17214
 
16878
17215
  const handleBlur = () => {
16879
17216
  return dispatch({
@@ -16919,7 +17256,7 @@ const AddressCreateSubmit = ({
16919
17256
  state: {
16920
17257
  isSubmitting
16921
17258
  }
16922
- } = React.useContext(store$c);
17259
+ } = React.useContext(store$d);
16923
17260
  const {
16924
17261
  t
16925
17262
  } = useTranslation("address");
@@ -17030,7 +17367,7 @@ function CountrySelect({
17030
17367
  }
17031
17368
 
17032
17369
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17033
- store: store$c
17370
+ store: store$d
17034
17371
  }, props));
17035
17372
 
17036
17373
  function StateSelect({
@@ -17118,7 +17455,7 @@ function StateSelect({
17118
17455
  }
17119
17456
 
17120
17457
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17121
- store: store$c
17458
+ store: store$d
17122
17459
  }, props));
17123
17460
 
17124
17461
  const AddressCreateView = props => {
@@ -17223,18 +17560,18 @@ AddressCreateModal.viewId = "address-create";
17223
17560
 
17224
17561
  const AddressCreateTextInput = props => {
17225
17562
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17226
- store: store$c
17563
+ store: store$d
17227
17564
  }));
17228
17565
  };
17229
17566
 
17230
17567
  const AddressCreateLine2 = props => {
17231
17568
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17232
17569
  fieldName: "line2",
17233
- store: store$c
17570
+ store: store$d
17234
17571
  }, props));
17235
17572
  };
17236
17573
 
17237
- const initialState$b = {
17574
+ const initialState$c = {
17238
17575
  isSubmitting: false,
17239
17576
  firstName: "",
17240
17577
  firstNameError: "",
@@ -17259,10 +17596,10 @@ const initialState$b = {
17259
17596
  content: ""
17260
17597
  }
17261
17598
  };
17262
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
17599
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
17263
17600
  const {
17264
- Provider: Provider$b
17265
- } = store$b;
17601
+ Provider: Provider$c
17602
+ } = store$c;
17266
17603
 
17267
17604
  const AddressUpdateContainer = ({
17268
17605
  style,
@@ -17314,7 +17651,7 @@ const AddressUpdateContainer = ({
17314
17651
  const thisAddress = addresses[address];
17315
17652
 
17316
17653
  if (+thisAddress.id === +addressId) {
17317
- const newState = { ...initialState$b,
17654
+ const newState = { ...initialState$c,
17318
17655
  firstName: thisAddress.first_name,
17319
17656
  lastName: thisAddress.last_name,
17320
17657
  line1: thisAddress.line1,
@@ -17447,7 +17784,7 @@ const AddressUpdateContainer = ({
17447
17784
  default:
17448
17785
  return state;
17449
17786
  }
17450
- }, initialState$b);
17787
+ }, initialState$c);
17451
17788
  React.useEffect(() => {
17452
17789
  const getStates = () => {
17453
17790
  dispatch({
@@ -17479,21 +17816,21 @@ const AddressUpdateContainer = ({
17479
17816
  style: { ...style
17480
17817
  },
17481
17818
  className: `pelcro-container pelcro-address-update-container ${className}`
17482
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17819
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17483
17820
  value: {
17484
17821
  state,
17485
17822
  dispatch
17486
17823
  }
17487
17824
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17488
- store: store$b,
17825
+ store: store$c,
17489
17826
  key: i
17490
17827
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17491
- store: store$b
17828
+ store: store$c
17492
17829
  })));
17493
17830
  };
17494
17831
 
17495
17832
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17496
- store: store$b
17833
+ store: store$c
17497
17834
  }, props));
17498
17835
 
17499
17836
  function AddressUpdateFirstName(props) {
@@ -17503,7 +17840,7 @@ function AddressUpdateFirstName(props) {
17503
17840
  firstName,
17504
17841
  firstNameError
17505
17842
  }
17506
- } = React.useContext(store$b);
17843
+ } = React.useContext(store$c);
17507
17844
 
17508
17845
  const handleBlur = () => {
17509
17846
  return dispatch({
@@ -17546,7 +17883,7 @@ function AddressUpdateLastName(props) {
17546
17883
  lastName,
17547
17884
  lastNameError
17548
17885
  }
17549
- } = React.useContext(store$b);
17886
+ } = React.useContext(store$c);
17550
17887
 
17551
17888
  const handleBlur = () => {
17552
17889
  return dispatch({
@@ -17589,7 +17926,7 @@ function AddressUpdateLine1(props) {
17589
17926
  line1,
17590
17927
  line1Error
17591
17928
  }
17592
- } = React.useContext(store$b);
17929
+ } = React.useContext(store$c);
17593
17930
 
17594
17931
  const handleBlur = () => {
17595
17932
  return dispatch({
@@ -17629,7 +17966,7 @@ const AddressUpdateLine2 = props => {
17629
17966
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17630
17967
  fieldName: "line2"
17631
17968
  }, props, {
17632
- store: store$b
17969
+ store: store$c
17633
17970
  }));
17634
17971
  };
17635
17972
 
@@ -17640,7 +17977,7 @@ function AddressUpdateCity(props) {
17640
17977
  city,
17641
17978
  cityError
17642
17979
  }
17643
- } = React.useContext(store$b);
17980
+ } = React.useContext(store$c);
17644
17981
 
17645
17982
  const handleBlur = () => {
17646
17983
  return dispatch({
@@ -17683,7 +18020,7 @@ function AddressUpdatePostalCode(props) {
17683
18020
  postalCode,
17684
18021
  postalCodeError
17685
18022
  }
17686
- } = React.useContext(store$b);
18023
+ } = React.useContext(store$c);
17687
18024
 
17688
18025
  const handleBlur = () => {
17689
18026
  return dispatch({
@@ -17729,7 +18066,7 @@ const AddressUpdateSubmit = ({
17729
18066
  state: {
17730
18067
  isSubmitting
17731
18068
  }
17732
- } = React.useContext(store$b);
18069
+ } = React.useContext(store$c);
17733
18070
  const {
17734
18071
  t
17735
18072
  } = useTranslation("address");
@@ -17745,7 +18082,7 @@ const AddressUpdateSubmit = ({
17745
18082
  };
17746
18083
 
17747
18084
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17748
- store: store$b
18085
+ store: store$c
17749
18086
  }, props));
17750
18087
 
17751
18088
  const AddressUpdateView = props => {
@@ -17828,7 +18165,7 @@ AddressUpdateModal.viewId = "address-edit";
17828
18165
 
17829
18166
  const AddressUpdateTextInput = props => {
17830
18167
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17831
- store: store$b
18168
+ store: store$c
17832
18169
  }));
17833
18170
  };
17834
18171
 
@@ -17911,7 +18248,7 @@ const PaymentMethodUpdateModal = props => {
17911
18248
  };
17912
18249
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17913
18250
 
17914
- const initialState$a = {
18251
+ const initialState$b = {
17915
18252
  email: "",
17916
18253
  password: "",
17917
18254
  passwordError: null,
@@ -17924,10 +18261,10 @@ const initialState$a = {
17924
18261
  content: ""
17925
18262
  }
17926
18263
  };
17927
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
18264
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
17928
18265
  const {
17929
- Provider: Provider$a
17930
- } = store$a;
18266
+ Provider: Provider$b
18267
+ } = store$b;
17931
18268
 
17932
18269
  const PasswordResetContainer = ({
17933
18270
  style,
@@ -17984,7 +18321,7 @@ const PasswordResetContainer = ({
17984
18321
  type: SET_EMAIL,
17985
18322
  payload: window.Pelcro.helpers.getURLParameter("email")
17986
18323
  });
17987
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18324
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
17988
18325
  dispatch({
17989
18326
  type: SET_TOKEN,
17990
18327
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -18044,26 +18381,26 @@ const PasswordResetContainer = ({
18044
18381
  default:
18045
18382
  return state;
18046
18383
  }
18047
- }, initialState$a);
18384
+ }, initialState$b);
18048
18385
  return /*#__PURE__*/React__default['default'].createElement("div", {
18049
18386
  style: { ...style
18050
18387
  },
18051
18388
  className: `pelcro-container pelcro-password-reset-container ${className}`
18052
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18389
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
18053
18390
  value: {
18054
18391
  state,
18055
18392
  dispatch
18056
18393
  }
18057
18394
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18058
- store: store$a,
18395
+ store: store$b,
18059
18396
  key: i
18060
18397
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18061
- store: store$a
18398
+ store: store$b
18062
18399
  })));
18063
18400
  };
18064
18401
 
18065
18402
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
18066
- store: store$a
18403
+ store: store$b
18067
18404
  }, props));
18068
18405
 
18069
18406
  const PasswordResetButton = ({
@@ -18076,7 +18413,7 @@ const PasswordResetButton = ({
18076
18413
  buttonDisabled
18077
18414
  },
18078
18415
  dispatch
18079
- } = React.useContext(store$a);
18416
+ } = React.useContext(store$b);
18080
18417
  const {
18081
18418
  t
18082
18419
  } = useTranslation("passwordReset");
@@ -18093,14 +18430,14 @@ const PasswordResetButton = ({
18093
18430
  };
18094
18431
 
18095
18432
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18096
- store: store$a
18433
+ store: store$b
18097
18434
  }, props, {
18098
18435
  value: window.Pelcro.helpers.getURLParameter("email"),
18099
18436
  disabled: true
18100
18437
  }));
18101
18438
 
18102
18439
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
18103
- store: store$a
18440
+ store: store$b
18104
18441
  }, props));
18105
18442
 
18106
18443
  const PasswordResetView = props => {
@@ -18152,7 +18489,7 @@ const PasswordResetModal = ({
18152
18489
  };
18153
18490
  PasswordResetModal.viewId = "password-reset";
18154
18491
 
18155
- const initialState$9 = {
18492
+ const initialState$a = {
18156
18493
  email: "",
18157
18494
  emailError: null,
18158
18495
  buttonDisabled: false,
@@ -18161,10 +18498,10 @@ const initialState$9 = {
18161
18498
  content: ""
18162
18499
  }
18163
18500
  };
18164
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18501
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
18165
18502
  const {
18166
- Provider: Provider$9
18167
- } = store$9;
18503
+ Provider: Provider$a
18504
+ } = store$a;
18168
18505
 
18169
18506
  const PasswordForgotContainer = ({
18170
18507
  style,
@@ -18242,21 +18579,21 @@ const PasswordForgotContainer = ({
18242
18579
  default:
18243
18580
  return state;
18244
18581
  }
18245
- }, initialState$9);
18582
+ }, initialState$a);
18246
18583
  return /*#__PURE__*/React__default['default'].createElement("div", {
18247
18584
  style: { ...style
18248
18585
  },
18249
18586
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18250
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18587
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18251
18588
  value: {
18252
18589
  state,
18253
18590
  dispatch
18254
18591
  }
18255
18592
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18256
- store: store$9,
18593
+ store: store$a,
18257
18594
  key: i
18258
18595
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18259
- store: store$9
18596
+ store: store$a
18260
18597
  })));
18261
18598
  };
18262
18599
 
@@ -18272,7 +18609,7 @@ const PasswordForgotButton = ({
18272
18609
  emailError
18273
18610
  },
18274
18611
  dispatch
18275
- } = React.useContext(store$9);
18612
+ } = React.useContext(store$a);
18276
18613
  const {
18277
18614
  t
18278
18615
  } = useTranslation("passwordForgot");
@@ -18293,7 +18630,7 @@ const PasswordForgotButton = ({
18293
18630
  };
18294
18631
 
18295
18632
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18296
- store: store$9
18633
+ store: store$a
18297
18634
  }, props));
18298
18635
 
18299
18636
  const PasswordForgotView = props => {
@@ -18343,7 +18680,7 @@ const PasswordForgotModal = ({
18343
18680
  };
18344
18681
  PasswordForgotModal.viewId = "password-forgot";
18345
18682
 
18346
- const initialState$8 = {
18683
+ const initialState$9 = {
18347
18684
  currentPassword: "",
18348
18685
  newPassword: "",
18349
18686
  confirmNewPassword: "",
@@ -18357,10 +18694,10 @@ const initialState$8 = {
18357
18694
  content: ""
18358
18695
  }
18359
18696
  };
18360
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18697
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18361
18698
  const {
18362
- Provider: Provider$8
18363
- } = store$8;
18699
+ Provider: Provider$9
18700
+ } = store$9;
18364
18701
  const PasswordChangeContainer = ({
18365
18702
  style,
18366
18703
  className = "",
@@ -18512,21 +18849,21 @@ const PasswordChangeContainer = ({
18512
18849
  default:
18513
18850
  return state;
18514
18851
  }
18515
- }, initialState$8);
18852
+ }, initialState$9);
18516
18853
  return /*#__PURE__*/React__default['default'].createElement("div", {
18517
18854
  style: { ...style
18518
18855
  },
18519
18856
  className: `pelcro-container pelcro-password-change-container ${className}`
18520
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18857
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18521
18858
  value: {
18522
18859
  state,
18523
18860
  dispatch
18524
18861
  }
18525
18862
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18526
- store: store$8,
18863
+ store: store$9,
18527
18864
  key: i
18528
18865
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18529
- store: store$8
18866
+ store: store$9
18530
18867
  })));
18531
18868
  };
18532
18869
 
@@ -18537,7 +18874,7 @@ function PasswordChangeCurrentPassword(props) {
18537
18874
  currentPassword,
18538
18875
  currentPasswordError
18539
18876
  }
18540
- } = React.useContext(store$8);
18877
+ } = React.useContext(store$9);
18541
18878
  const handleBlur = React.useCallback(() => {
18542
18879
  return dispatch({
18543
18880
  type: VALIDATE_PASSWORD
@@ -18571,7 +18908,7 @@ function PasswordChangeNewPassword(props) {
18571
18908
  newPassword,
18572
18909
  newPasswordError
18573
18910
  }
18574
- } = React.useContext(store$8);
18911
+ } = React.useContext(store$9);
18575
18912
  const handleBlur = React.useCallback(() => {
18576
18913
  return dispatch({
18577
18914
  type: VALIDATE_NEW_PASSWORD
@@ -18605,7 +18942,7 @@ function PasswordChangeConfirmNewPassword(props) {
18605
18942
  confirmNewPassword,
18606
18943
  confirmNewPasswordError
18607
18944
  }
18608
- } = React.useContext(store$8);
18945
+ } = React.useContext(store$9);
18609
18946
  const handleBlur = React.useCallback(() => {
18610
18947
  return dispatch({
18611
18948
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18646,7 +18983,7 @@ const PasswordChangeButton = ({
18646
18983
  confirmNewPasswordError
18647
18984
  },
18648
18985
  dispatch
18649
- } = React.useContext(store$8);
18986
+ } = React.useContext(store$9);
18650
18987
  const {
18651
18988
  t
18652
18989
  } = useTranslation("passwordChange");
@@ -18712,17 +19049,17 @@ const PasswordChangeModal = ({
18712
19049
  };
18713
19050
  PasswordChangeModal.viewId = "password-change";
18714
19051
 
18715
- const initialState$7 = {
19052
+ const initialState$8 = {
18716
19053
  buttonDisabled: false,
18717
19054
  alert: {
18718
19055
  type: "error",
18719
19056
  content: ""
18720
19057
  }
18721
19058
  };
18722
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19059
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18723
19060
  const {
18724
- Provider: Provider$7
18725
- } = store$7;
19061
+ Provider: Provider$8
19062
+ } = store$8;
18726
19063
 
18727
19064
  const CartContainer = ({
18728
19065
  style,
@@ -18813,21 +19150,21 @@ const CartContainer = ({
18813
19150
  default:
18814
19151
  return state;
18815
19152
  }
18816
- }, initialState$7);
19153
+ }, initialState$8);
18817
19154
  return /*#__PURE__*/React__default['default'].createElement("div", {
18818
19155
  style: { ...style
18819
19156
  },
18820
19157
  className: `pelcro-container pelcro-cart-container ${className}`
18821
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19158
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18822
19159
  value: {
18823
19160
  state,
18824
19161
  dispatch
18825
19162
  }
18826
19163
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18827
- store: store$7,
19164
+ store: store$8,
18828
19165
  key: i
18829
19166
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18830
- store: store$7
19167
+ store: store$8
18831
19168
  })));
18832
19169
  };
18833
19170
 
@@ -18864,7 +19201,7 @@ const CartSubmit = ({
18864
19201
  buttonDisabled
18865
19202
  },
18866
19203
  dispatch
18867
- } = React.useContext(store$7);
19204
+ } = React.useContext(store$8);
18868
19205
  const {
18869
19206
  t
18870
19207
  } = useTranslation("cart");
@@ -18895,7 +19232,7 @@ const CartTotalPrice = () => {
18895
19232
  state: {
18896
19233
  alert
18897
19234
  }
18898
- } = React.useContext(store$7);
19235
+ } = React.useContext(store$8);
18899
19236
  const {
18900
19237
  cartItems
18901
19238
  } = usePelcro();
@@ -19208,7 +19545,7 @@ const OrderConfirmModal = props => {
19208
19545
  };
19209
19546
  OrderConfirmModal.viewId = "order-confirm";
19210
19547
 
19211
- const initialState$6 = {
19548
+ const initialState$7 = {
19212
19549
  email: "",
19213
19550
  firstName: "",
19214
19551
  lastName: "",
@@ -19220,10 +19557,10 @@ const initialState$6 = {
19220
19557
  content: ""
19221
19558
  }
19222
19559
  };
19223
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19560
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19224
19561
  const {
19225
- Provider: Provider$6
19226
- } = store$6;
19562
+ Provider: Provider$7
19563
+ } = store$7;
19227
19564
 
19228
19565
  const GiftCreateContainer = ({
19229
19566
  style,
@@ -19327,21 +19664,21 @@ const GiftCreateContainer = ({
19327
19664
  default:
19328
19665
  return state;
19329
19666
  }
19330
- }, initialState$6);
19667
+ }, initialState$7);
19331
19668
  return /*#__PURE__*/React__default['default'].createElement("div", {
19332
19669
  style: { ...style
19333
19670
  },
19334
19671
  className: `pelcro-container pelcro-gift-create-container ${className}`
19335
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19672
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19336
19673
  value: {
19337
19674
  state,
19338
19675
  dispatch
19339
19676
  }
19340
19677
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19341
- store: store$6,
19678
+ store: store$7,
19342
19679
  key: i
19343
19680
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19344
- store: store$6
19681
+ store: store$7
19345
19682
  })));
19346
19683
  };
19347
19684
 
@@ -19355,7 +19692,7 @@ const GiftCreateSubmitButton = ({
19355
19692
  state: {
19356
19693
  disableSubmit
19357
19694
  }
19358
- } = React.useContext(store$6);
19695
+ } = React.useContext(store$7);
19359
19696
  const {
19360
19697
  t
19361
19698
  } = useTranslation("register");
@@ -19372,29 +19709,29 @@ const GiftCreateSubmitButton = ({
19372
19709
 
19373
19710
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19374
19711
  initWithUserEmail: false,
19375
- store: store$6
19712
+ store: store$7
19376
19713
  }, props));
19377
19714
 
19378
19715
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19379
- store: store$6
19716
+ store: store$7
19380
19717
  }, props));
19381
19718
 
19382
19719
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19383
- store: store$6
19720
+ store: store$7
19384
19721
  }, props));
19385
19722
 
19386
- var _path$g;
19723
+ var _path$i;
19387
19724
 
19388
- 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); }
19725
+ 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); }
19389
19726
 
19390
19727
  function SvgInfoCircle(props) {
19391
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
19728
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19392
19729
  xmlns: "http://www.w3.org/2000/svg",
19393
19730
  className: "plc-w-5 plc-h-5",
19394
19731
  fill: "none",
19395
19732
  viewBox: "0 0 24 24",
19396
19733
  stroke: "currentColor"
19397
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
19734
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19398
19735
  strokeLinecap: "round",
19399
19736
  strokeLinejoin: "round",
19400
19737
  strokeWidth: 2,
@@ -19465,7 +19802,7 @@ const GiftCreateStartDate = props => {
19465
19802
  const {
19466
19803
  dispatch,
19467
19804
  state
19468
- } = React.useContext(store$6);
19805
+ } = React.useContext(store$7);
19469
19806
 
19470
19807
  const handleInputChange = value => {
19471
19808
  dispatch({
@@ -19538,7 +19875,7 @@ function GiftCreateMessage(props) {
19538
19875
  const {
19539
19876
  dispatch,
19540
19877
  state
19541
- } = React.useContext(store$6);
19878
+ } = React.useContext(store$7);
19542
19879
  const MAX_CHARS_COUNT = 200;
19543
19880
  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;
19544
19881
 
@@ -19662,7 +19999,7 @@ const GiftCreateModal = ({
19662
19999
  };
19663
20000
  GiftCreateModal.viewId = "gift-create";
19664
20001
 
19665
- const initialState$5 = {
20002
+ const initialState$6 = {
19666
20003
  giftCode: "",
19667
20004
  buttonDisabled: true,
19668
20005
  alert: {
@@ -19670,10 +20007,10 @@ const initialState$5 = {
19670
20007
  content: ""
19671
20008
  }
19672
20009
  };
19673
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20010
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19674
20011
  const {
19675
- Provider: Provider$5
19676
- } = store$5;
20012
+ Provider: Provider$6
20013
+ } = store$6;
19677
20014
 
19678
20015
  const GiftRedeemContainer = ({
19679
20016
  style,
@@ -19738,21 +20075,21 @@ const GiftRedeemContainer = ({
19738
20075
  default:
19739
20076
  return state;
19740
20077
  }
19741
- }, initialState$5);
20078
+ }, initialState$6);
19742
20079
  return /*#__PURE__*/React__default['default'].createElement("div", {
19743
20080
  style: { ...style
19744
20081
  },
19745
20082
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19746
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20083
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19747
20084
  value: {
19748
20085
  state,
19749
20086
  dispatch
19750
20087
  }
19751
20088
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19752
- store: store$5,
20089
+ store: store$6,
19753
20090
  key: i
19754
20091
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19755
- store: store$5
20092
+ store: store$6
19756
20093
  })));
19757
20094
  };
19758
20095
 
@@ -19789,7 +20126,7 @@ function GiftCode({
19789
20126
  }
19790
20127
 
19791
20128
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19792
- store: store$5
20129
+ store: store$6
19793
20130
  }, props));
19794
20131
 
19795
20132
  const GiftRedeemSubmitButton = ({
@@ -19802,7 +20139,7 @@ const GiftRedeemSubmitButton = ({
19802
20139
  state: {
19803
20140
  disableSubmit
19804
20141
  }
19805
- } = React.useContext(store$5);
20142
+ } = React.useContext(store$6);
19806
20143
  const {
19807
20144
  t
19808
20145
  } = useTranslation("register");
@@ -19895,7 +20232,7 @@ const moveDefaultAddressToStart = addresses => {
19895
20232
  return [defaultAddress, ...addressesWithoutDefault];
19896
20233
  };
19897
20234
 
19898
- const initialState$4 = {
20235
+ const initialState$5 = {
19899
20236
  addresses: [],
19900
20237
  selectedAddressId: null,
19901
20238
  isSubmitting: false,
@@ -19904,10 +20241,10 @@ const initialState$4 = {
19904
20241
  content: ""
19905
20242
  }
19906
20243
  };
19907
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20244
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19908
20245
  const {
19909
- Provider: Provider$4
19910
- } = store$4;
20246
+ Provider: Provider$5
20247
+ } = store$5;
19911
20248
 
19912
20249
  const AddressSelectContainer = ({
19913
20250
  style,
@@ -20002,7 +20339,7 @@ const AddressSelectContainer = ({
20002
20339
  default:
20003
20340
  return state;
20004
20341
  }
20005
- }, initialState$4);
20342
+ }, initialState$5);
20006
20343
  React.useEffect(() => {
20007
20344
  var _window$Pelcro$user$r;
20008
20345
 
@@ -20015,16 +20352,16 @@ const AddressSelectContainer = ({
20015
20352
  style: { ...style
20016
20353
  },
20017
20354
  className: `pelcro-container pelcro-address-select-container ${className}`
20018
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20355
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20019
20356
  value: {
20020
20357
  state,
20021
20358
  dispatch
20022
20359
  }
20023
20360
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20024
- store: store$4,
20361
+ store: store$5,
20025
20362
  key: i
20026
20363
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20027
- store: store$4
20364
+ store: store$5
20028
20365
  })));
20029
20366
  };
20030
20367
 
@@ -20035,7 +20372,7 @@ const AddressSelectList = () => {
20035
20372
  addresses,
20036
20373
  selectedAddressId
20037
20374
  }
20038
- } = React.useContext(store$4);
20375
+ } = React.useContext(store$5);
20039
20376
 
20040
20377
  const handleAddressSelect = event => {
20041
20378
  dispatch({
@@ -20079,7 +20416,7 @@ const AddressSelectSubmit = ({
20079
20416
  selectedAddressId,
20080
20417
  isSubmitting
20081
20418
  }
20082
- } = React.useContext(store$4);
20419
+ } = React.useContext(store$5);
20083
20420
  const {
20084
20421
  t
20085
20422
  } = useTranslation("address");
@@ -20175,7 +20512,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20175
20512
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20176
20513
  };
20177
20514
 
20178
- const initialState$3 = {
20515
+ const initialState$4 = {
20179
20516
  paymentMethods: [],
20180
20517
  selectedPaymentMethodId: null,
20181
20518
  isSubmitting: false,
@@ -20184,10 +20521,10 @@ const initialState$3 = {
20184
20521
  content: ""
20185
20522
  }
20186
20523
  };
20187
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20524
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20188
20525
  const {
20189
- Provider: Provider$3
20190
- } = store$3;
20526
+ Provider: Provider$4
20527
+ } = store$4;
20191
20528
 
20192
20529
  const PaymentMethodSelectContainer = ({
20193
20530
  style,
@@ -20246,7 +20583,7 @@ const PaymentMethodSelectContainer = ({
20246
20583
  default:
20247
20584
  return state;
20248
20585
  }
20249
- }, initialState$3);
20586
+ }, initialState$4);
20250
20587
  React.useEffect(() => {
20251
20588
  var _window$Pelcro$user$r3;
20252
20589
 
@@ -20259,16 +20596,16 @@ const PaymentMethodSelectContainer = ({
20259
20596
  style: { ...style
20260
20597
  },
20261
20598
  className: `pelcro-container pelcro-payment-select-container ${className}`
20262
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20599
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20263
20600
  value: {
20264
20601
  state,
20265
20602
  dispatch
20266
20603
  }
20267
20604
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20268
- store: store$3,
20605
+ store: store$4,
20269
20606
  key: i
20270
20607
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20271
- store: store$3
20608
+ store: store$4
20272
20609
  })));
20273
20610
  };
20274
20611
 
@@ -20282,7 +20619,7 @@ const PaymentMethodSelectList = () => {
20282
20619
  paymentMethods,
20283
20620
  selectedPaymentMethodId
20284
20621
  }
20285
- } = React.useContext(store$3);
20622
+ } = React.useContext(store$4);
20286
20623
 
20287
20624
  const handlePaymentMethodSelect = event => {
20288
20625
  dispatch({
@@ -20332,7 +20669,7 @@ const PaymentMethodSelectSubmit = ({
20332
20669
  selectedPaymentMethodId,
20333
20670
  isSubmitting
20334
20671
  }
20335
- } = React.useContext(store$3);
20672
+ } = React.useContext(store$4);
20336
20673
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20337
20674
  onClick: () => {
20338
20675
  dispatch({
@@ -20406,8 +20743,8 @@ const PaymentMethodSelectModal = ({
20406
20743
  };
20407
20744
  PaymentMethodSelectModal.viewId = "payment-method-select";
20408
20745
 
20409
- function _extends$h() {
20410
- _extends$h = Object.assign || function (target) {
20746
+ function _extends$j() {
20747
+ _extends$j = Object.assign || function (target) {
20411
20748
  for (var i = 1; i < arguments.length; i++) {
20412
20749
  var source = arguments[i];
20413
20750
 
@@ -20421,7 +20758,7 @@ function _extends$h() {
20421
20758
  return target;
20422
20759
  };
20423
20760
 
20424
- return _extends$h.apply(this, arguments);
20761
+ return _extends$j.apply(this, arguments);
20425
20762
  }
20426
20763
 
20427
20764
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20605,7 +20942,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20605
20942
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20606
20943
  return null;
20607
20944
  }, _match[RenderStrategy.Hidden] = function () {
20608
- return _render(_extends$h({}, _rest, {
20945
+ return _render(_extends$j({}, _rest, {
20609
20946
  hidden: true,
20610
20947
  style: {
20611
20948
  display: 'none'
@@ -21133,7 +21470,7 @@ function TransitionChild(props) {
21133
21470
  var passthroughProps = rest;
21134
21471
  return React__default['default'].createElement(NestingContext.Provider, {
21135
21472
  value: nesting
21136
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21473
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21137
21474
  }
21138
21475
 
21139
21476
  function Transition(props) {
@@ -21177,7 +21514,7 @@ function Transition(props) {
21177
21514
  value: nestingBag
21178
21515
  }, React__default['default'].createElement(TransitionContext.Provider, {
21179
21516
  value: transitionBag
21180
- }, render(_extends$h({}, sharedProps, {
21517
+ }, render(_extends$j({}, sharedProps, {
21181
21518
  as: React.Fragment,
21182
21519
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21183
21520
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21304,12 +21641,12 @@ var ActionTypes;
21304
21641
  })(ActionTypes || (ActionTypes = {}));
21305
21642
 
21306
21643
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21307
- return _extends$h({}, state, {
21644
+ return _extends$j({}, state, {
21308
21645
  activeItemIndex: null,
21309
21646
  menuState: MenuStates.Closed
21310
21647
  });
21311
21648
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21312
- return _extends$h({}, state, {
21649
+ return _extends$j({}, state, {
21313
21650
  menuState: MenuStates.Open
21314
21651
  });
21315
21652
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21328,7 +21665,7 @@ var ActionTypes;
21328
21665
  }
21329
21666
  });
21330
21667
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21331
- return _extends$h({}, state, {
21668
+ return _extends$j({}, state, {
21332
21669
  searchQuery: '',
21333
21670
  activeItemIndex: activeItemIndex
21334
21671
  });
@@ -21339,19 +21676,19 @@ var ActionTypes;
21339
21676
 
21340
21677
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21341
21678
  });
21342
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21679
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21343
21680
  searchQuery: searchQuery
21344
21681
  });
21345
- return _extends$h({}, state, {
21682
+ return _extends$j({}, state, {
21346
21683
  searchQuery: searchQuery,
21347
21684
  activeItemIndex: match
21348
21685
  });
21349
21686
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21350
- return _extends$h({}, state, {
21687
+ return _extends$j({}, state, {
21351
21688
  searchQuery: ''
21352
21689
  });
21353
21690
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21354
- return _extends$h({}, state, {
21691
+ return _extends$j({}, state, {
21355
21692
  items: [].concat(state.items, [{
21356
21693
  id: action.id,
21357
21694
  dataRef: action.dataRef
@@ -21364,7 +21701,7 @@ var ActionTypes;
21364
21701
  return a.id === action.id;
21365
21702
  });
21366
21703
  if (idx !== -1) nextItems.splice(idx, 1);
21367
- return _extends$h({}, state, {
21704
+ return _extends$j({}, state, {
21368
21705
  items: nextItems,
21369
21706
  activeItemIndex: function () {
21370
21707
  if (idx === state.activeItemIndex) return null;
@@ -21403,19 +21740,19 @@ var ActionTypes$1;
21403
21740
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21404
21741
  if (state.disabled) return state;
21405
21742
  if (state.listboxState === ListboxStates.Closed) return state;
21406
- return _extends$h({}, state, {
21743
+ return _extends$j({}, state, {
21407
21744
  activeOptionIndex: null,
21408
21745
  listboxState: ListboxStates.Closed
21409
21746
  });
21410
21747
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21411
21748
  if (state.disabled) return state;
21412
21749
  if (state.listboxState === ListboxStates.Open) return state;
21413
- return _extends$h({}, state, {
21750
+ return _extends$j({}, state, {
21414
21751
  listboxState: ListboxStates.Open
21415
21752
  });
21416
21753
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21417
21754
  if (state.disabled === action.disabled) return state;
21418
- return _extends$h({}, state, {
21755
+ return _extends$j({}, state, {
21419
21756
  disabled: action.disabled
21420
21757
  });
21421
21758
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21436,7 +21773,7 @@ var ActionTypes$1;
21436
21773
  }
21437
21774
  });
21438
21775
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21439
- return _extends$h({}, state, {
21776
+ return _extends$j({}, state, {
21440
21777
  searchQuery: '',
21441
21778
  activeOptionIndex: activeOptionIndex
21442
21779
  });
@@ -21449,10 +21786,10 @@ var ActionTypes$1;
21449
21786
 
21450
21787
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21451
21788
  });
21452
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21789
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21453
21790
  searchQuery: searchQuery
21454
21791
  });
21455
- return _extends$h({}, state, {
21792
+ return _extends$j({}, state, {
21456
21793
  searchQuery: searchQuery,
21457
21794
  activeOptionIndex: match
21458
21795
  });
@@ -21460,11 +21797,11 @@ var ActionTypes$1;
21460
21797
  if (state.disabled) return state;
21461
21798
  if (state.listboxState === ListboxStates.Closed) return state;
21462
21799
  if (state.searchQuery === '') return state;
21463
- return _extends$h({}, state, {
21800
+ return _extends$j({}, state, {
21464
21801
  searchQuery: ''
21465
21802
  });
21466
21803
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21467
- return _extends$h({}, state, {
21804
+ return _extends$j({}, state, {
21468
21805
  options: [].concat(state.options, [{
21469
21806
  id: action.id,
21470
21807
  dataRef: action.dataRef
@@ -21477,7 +21814,7 @@ var ActionTypes$1;
21477
21814
  return a.id === action.id;
21478
21815
  });
21479
21816
  if (idx !== -1) nextOptions.splice(idx, 1);
21480
- return _extends$h({}, state, {
21817
+ return _extends$j({}, state, {
21481
21818
  options: nextOptions,
21482
21819
  activeOptionIndex: function () {
21483
21820
  if (idx === state.activeOptionIndex) return null;
@@ -21538,18 +21875,18 @@ const getPaymentCardIcon = name => {
21538
21875
  }));
21539
21876
  };
21540
21877
 
21541
- var _path$f;
21878
+ var _path$h;
21542
21879
 
21543
- 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); }
21880
+ 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); }
21544
21881
 
21545
21882
  function SvgChevronRight(props) {
21546
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21883
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21547
21884
  className: "plc-w-6 plc-h-6",
21548
21885
  xmlns: "http://www.w3.org/2000/svg",
21549
21886
  fill: "none",
21550
21887
  viewBox: "0 0 24 24",
21551
21888
  stroke: "currentColor"
21552
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21889
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21553
21890
  strokeLinecap: "round",
21554
21891
  strokeLinejoin: "round",
21555
21892
  strokeWidth: 2,
@@ -21765,18 +22102,18 @@ const SavedItems = ({
21765
22102
  });
21766
22103
  };
21767
22104
 
21768
- var _path$e;
22105
+ var _path$g;
21769
22106
 
21770
- 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); }
22107
+ 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); }
21771
22108
 
21772
22109
  function SvgRefresh(props) {
21773
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22110
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21774
22111
  className: "plc-w-4 plc-h-4 plc-mr-1",
21775
22112
  xmlns: "http://www.w3.org/2000/svg",
21776
22113
  fill: "none",
21777
22114
  viewBox: "0 0 24 24",
21778
22115
  stroke: "currentColor"
21779
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22116
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21780
22117
  strokeLinecap: "round",
21781
22118
  strokeLinejoin: "round",
21782
22119
  strokeWidth: 2,
@@ -21784,35 +22121,35 @@ function SvgRefresh(props) {
21784
22121
  })));
21785
22122
  }
21786
22123
 
21787
- var _path$d;
22124
+ var _path$f;
21788
22125
 
21789
- 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); }
22126
+ 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); }
21790
22127
 
21791
22128
  function SvgCalendar(props) {
21792
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22129
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21793
22130
  xmlns: "http://www.w3.org/2000/svg",
21794
22131
  className: "plc-h-4 plc-w-4 plc-mr-1",
21795
22132
  viewBox: "0 0 20 20",
21796
22133
  fill: "currentColor"
21797
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22134
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21798
22135
  fillRule: "evenodd",
21799
22136
  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",
21800
22137
  clipRule: "evenodd"
21801
22138
  })));
21802
22139
  }
21803
22140
 
21804
- var _path$c;
22141
+ var _path$e;
21805
22142
 
21806
- 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); }
22143
+ 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); }
21807
22144
 
21808
22145
  function SvgPlus(props) {
21809
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22146
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21810
22147
  className: "plc-w-5 plc-h-5",
21811
22148
  xmlns: "http://www.w3.org/2000/svg",
21812
22149
  fill: "none",
21813
22150
  viewBox: "0 0 24 24",
21814
22151
  stroke: "currentColor"
21815
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22152
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21816
22153
  strokeLinecap: "round",
21817
22154
  strokeLinejoin: "round",
21818
22155
  strokeWidth: 2,
@@ -21820,17 +22157,17 @@ function SvgPlus(props) {
21820
22157
  })));
21821
22158
  }
21822
22159
 
21823
- var _path$b;
22160
+ var _path$d;
21824
22161
 
21825
- 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); }
22162
+ 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); }
21826
22163
 
21827
22164
  function SvgCheckMark(props) {
21828
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22165
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21829
22166
  className: "plc-w-4 plc-h-4 plc-mr-1",
21830
22167
  xmlns: "http://www.w3.org/2000/svg",
21831
22168
  viewBox: "0 0 20 20",
21832
22169
  fill: "currentColor"
21833
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22170
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21834
22171
  fillRule: "evenodd",
21835
22172
  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",
21836
22173
  clipRule: "evenodd"
@@ -21894,7 +22231,8 @@ const SubscriptionsItems = ({
21894
22231
  } = useTranslation("dashboard");
21895
22232
  const {
21896
22233
  switchView,
21897
- isAuthenticated
22234
+ switchToAddressView,
22235
+ switchToPaymentView
21898
22236
  } = usePelcro();
21899
22237
  const subs = getNonDonationSubs();
21900
22238
  if (subs.length === 0) return null;
@@ -21936,7 +22274,12 @@ const SubscriptionsItems = ({
21936
22274
  const plan = window.Pelcro.plan.getById(plan_id);
21937
22275
  setProductAndPlan(product, plan);
21938
22276
  setSubscriptionIdToRenew(sub.id);
21939
- setView("plan-select");
22277
+
22278
+ if (product.address_required) {
22279
+ return switchToAddressView();
22280
+ }
22281
+
22282
+ return switchToPaymentView();
21940
22283
  };
21941
22284
 
21942
22285
  const getPhases = () => {
@@ -22125,18 +22468,18 @@ Accordion.item = function AccordionItem({
22125
22468
  }, content)) : null;
22126
22469
  };
22127
22470
 
22128
- var _path$a;
22471
+ var _path$c;
22129
22472
 
22130
- 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); }
22473
+ 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); }
22131
22474
 
22132
22475
  function SvgExit(props) {
22133
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22476
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22134
22477
  className: "plc-w-6 plc-h-6",
22135
22478
  xmlns: "http://www.w3.org/2000/svg",
22136
22479
  fill: "none",
22137
22480
  viewBox: "0 0 24 24",
22138
22481
  stroke: "currentColor"
22139
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22482
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22140
22483
  strokeLinecap: "round",
22141
22484
  strokeLinejoin: "round",
22142
22485
  strokeWidth: 2,
@@ -22144,17 +22487,17 @@ function SvgExit(props) {
22144
22487
  })));
22145
22488
  }
22146
22489
 
22147
- var _path$9;
22490
+ var _path$b;
22148
22491
 
22149
- 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); }
22492
+ 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); }
22150
22493
 
22151
22494
  function SvgUser(props) {
22152
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22495
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22153
22496
  xmlns: "http://www.w3.org/2000/svg",
22154
22497
  fill: "none",
22155
22498
  viewBox: "0 0 24 24",
22156
22499
  stroke: "currentColor"
22157
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22500
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22158
22501
  strokeLinecap: "round",
22159
22502
  strokeLinejoin: "round",
22160
22503
  strokeWidth: 2,
@@ -22162,18 +22505,18 @@ function SvgUser(props) {
22162
22505
  })));
22163
22506
  }
22164
22507
 
22165
- var _path$8;
22508
+ var _path$a;
22166
22509
 
22167
- 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); }
22510
+ 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); }
22168
22511
 
22169
22512
  function SvgNewsletter(props) {
22170
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22513
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22171
22514
  xmlns: "http://www.w3.org/2000/svg",
22172
22515
  className: "plc-h-5 plc-w-5",
22173
22516
  fill: "none",
22174
22517
  viewBox: "0 0 24 24",
22175
22518
  stroke: "currentColor"
22176
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22519
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22177
22520
  strokeLinecap: "round",
22178
22521
  strokeLinejoin: "round",
22179
22522
  strokeWidth: 2,
@@ -22181,18 +22524,37 @@ function SvgNewsletter(props) {
22181
22524
  })));
22182
22525
  }
22183
22526
 
22184
- var _path$7;
22527
+ var _path$9;
22185
22528
 
22186
- 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); }
22529
+ 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); }
22530
+
22531
+ function SvgDocument(props) {
22532
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22533
+ xmlns: "http://www.w3.org/2000/svg",
22534
+ className: "plc-h-6 plc-w-6 plc-mr-2",
22535
+ fill: "none",
22536
+ viewBox: "0 0 24 24",
22537
+ stroke: "currentColor"
22538
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22539
+ strokeLinecap: "round",
22540
+ strokeLinejoin: "round",
22541
+ strokeWidth: 2,
22542
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
22543
+ })));
22544
+ }
22545
+
22546
+ var _path$8;
22547
+
22548
+ 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); }
22187
22549
 
22188
22550
  function SvgPaymentCard(props) {
22189
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22551
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22190
22552
  className: "plc-w-6 plc-h-6 plc-mr-2",
22191
22553
  xmlns: "http://www.w3.org/2000/svg",
22192
22554
  fill: "none",
22193
22555
  viewBox: "0 0 24 24",
22194
22556
  stroke: "currentColor"
22195
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22557
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22196
22558
  strokeLinecap: "round",
22197
22559
  strokeLinejoin: "round",
22198
22560
  strokeWidth: 2,
@@ -22200,18 +22562,18 @@ function SvgPaymentCard(props) {
22200
22562
  })));
22201
22563
  }
22202
22564
 
22203
- var _path$6, _path2$1;
22565
+ var _path$7, _path2$1;
22204
22566
 
22205
- 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); }
22567
+ 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); }
22206
22568
 
22207
22569
  function SvgLocationPin(props) {
22208
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22570
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22209
22571
  className: "plc-w-6 plc-h-6 plc-mr-2",
22210
22572
  xmlns: "http://www.w3.org/2000/svg",
22211
22573
  fill: "none",
22212
22574
  viewBox: "0 0 24 24",
22213
22575
  stroke: "currentColor"
22214
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22576
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22215
22577
  strokeLinecap: "round",
22216
22578
  strokeLinejoin: "round",
22217
22579
  strokeWidth: 2,
@@ -22226,10 +22588,10 @@ function SvgLocationPin(props) {
22226
22588
 
22227
22589
  var _switch;
22228
22590
 
22229
- 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); }
22591
+ 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); }
22230
22592
 
22231
22593
  function SvgSubscription(props) {
22232
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22594
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22233
22595
  xmlns: "http://www.w3.org/2000/svg",
22234
22596
  viewBox: "0 0 100 125",
22235
22597
  fill: "currentColor"
@@ -22244,18 +22606,18 @@ function SvgSubscription(props) {
22244
22606
  }))))));
22245
22607
  }
22246
22608
 
22247
- var _path$5;
22609
+ var _path$6;
22248
22610
 
22249
- 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); }
22611
+ 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); }
22250
22612
 
22251
22613
  function SvgShopping(props) {
22252
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22614
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22253
22615
  className: "plc-w-6 plc-h-6 plc-mr-2",
22254
22616
  xmlns: "http://www.w3.org/2000/svg",
22255
22617
  fill: "none",
22256
22618
  viewBox: "0 0 24 24",
22257
22619
  stroke: "currentColor"
22258
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22620
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22259
22621
  strokeLinecap: "round",
22260
22622
  strokeLinejoin: "round",
22261
22623
  strokeWidth: 2,
@@ -22263,18 +22625,18 @@ function SvgShopping(props) {
22263
22625
  })));
22264
22626
  }
22265
22627
 
22266
- var _path$4;
22628
+ var _path$5;
22267
22629
 
22268
- 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); }
22630
+ 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); }
22269
22631
 
22270
22632
  function SvgBookmark(props) {
22271
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22633
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22272
22634
  className: "plc-w-6 plc-h-6 plc-mr-2",
22273
22635
  xmlns: "http://www.w3.org/2000/svg",
22274
22636
  fill: "none",
22275
22637
  viewBox: "0 0 24 24",
22276
22638
  stroke: "currentColor"
22277
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22639
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22278
22640
  strokeLinecap: "round",
22279
22641
  strokeLinejoin: "round",
22280
22642
  strokeWidth: 2,
@@ -22282,33 +22644,33 @@ function SvgBookmark(props) {
22282
22644
  })));
22283
22645
  }
22284
22646
 
22285
- var _path$3;
22647
+ var _path$4;
22286
22648
 
22287
- 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); }
22649
+ 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); }
22288
22650
 
22289
22651
  function SvgKey(props) {
22290
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22652
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22291
22653
  xmlns: "http://www.w3.org/2000/svg",
22292
22654
  viewBox: "0 0 20 20",
22293
22655
  fill: "currentColor"
22294
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22656
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22295
22657
  fillRule: "evenodd",
22296
22658
  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",
22297
22659
  clipRule: "evenodd"
22298
22660
  })));
22299
22661
  }
22300
22662
 
22301
- var _path$2;
22663
+ var _path$3;
22302
22664
 
22303
- 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); }
22665
+ 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); }
22304
22666
 
22305
22667
  function SvgDonate(props) {
22306
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22668
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22307
22669
  width: 24,
22308
22670
  height: 24,
22309
22671
  fill: "currentColor",
22310
22672
  xmlns: "http://www.w3.org/2000/svg"
22311
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22673
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22312
22674
  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"
22313
22675
  })));
22314
22676
  }
@@ -22344,17 +22706,149 @@ const DonationsMenu = () => {
22344
22706
  }), subscriptions));
22345
22707
  };
22346
22708
 
22347
- function getDonationSubs() {
22348
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22709
+ function getDonationSubs() {
22710
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22711
+
22712
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22713
+ const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22714
+ return [...donations, ...canceledDonations];
22715
+ }
22716
+
22717
+ function formatStartDate(date) {
22718
+ const startDate = new Date(date);
22719
+ return new Intl.DateTimeFormat("en-CA").format(startDate);
22720
+ }
22721
+
22722
+ const InvoicesMenu = props => {
22723
+ const {
22724
+ t
22725
+ } = useTranslation("dashboard");
22726
+ return /*#__PURE__*/React__default['default'].createElement("table", {
22727
+ className: "plc-w-full plc-table-fixed"
22728
+ }, /*#__PURE__*/React__default['default'].createElement("thead", {
22729
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22730
+ }, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
22731
+ className: "plc-w-4/12 "
22732
+ }, t("labels.details")), /*#__PURE__*/React__default['default'].createElement("th", {
22733
+ className: "plc-w-4/12 "
22734
+ }, t("labels.status.title")), /*#__PURE__*/React__default['default'].createElement("th", {
22735
+ className: "plc-w-3/12 "
22736
+ }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
22737
+ className: "plc-h-4"
22738
+ }), /*#__PURE__*/React__default['default'].createElement(InvoicesItems, props)));
22739
+ };
22740
+
22741
+ const InvoicesItems = () => {
22742
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22743
+
22744
+ const {
22745
+ t
22746
+ } = useTranslation("dashboard");
22747
+ const {
22748
+ setInvoice,
22749
+ switchView
22750
+ } = usePelcro();
22751
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22752
+
22753
+ const showInvoiceDetails = event => {
22754
+ if (setInvoice(event.target.dataset.id)) {
22755
+ switchView("invoice-details");
22756
+ }
22757
+ };
22758
+
22759
+ if (invoices.length === 0) return null;
22760
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22761
+ const invoiceStatus = getInvoiceStatus(invoice);
22762
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22763
+ return /*#__PURE__*/React__default['default'].createElement("tr", {
22764
+ key: invoice.id,
22765
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22766
+ }, /*#__PURE__*/React__default['default'].createElement("td", {
22767
+ className: "plc-truncate"
22768
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22769
+ className: "plc-font-semibold plc-text-gray-500"
22770
+ }, `#${invoice.id}`), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22771
+ className: "plc-text-sm plc-text-gray-500"
22772
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22773
+ className: "plc-text-sm plc-text-gray-500"
22774
+ }, formattedCreationDate)), /*#__PURE__*/React__default['default'].createElement("td", {
22775
+ className: "plc-py-2"
22776
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22777
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22778
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
22779
+ variant: "ghost",
22780
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22781
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, {
22782
+ className: "plc-w-4 plc-h-4"
22783
+ }),
22784
+ onClick: showInvoiceDetails,
22785
+ "data-id": invoice.id
22786
+ }, t("labels.view"))));
22787
+ });
22788
+ };
22789
+
22790
+ function getInvoiceStatus(invoice) {
22791
+ const translations = i18next.t("dashboard:labels", {
22792
+ returnObjects: true
22793
+ });
22794
+
22795
+ switch (invoice.status) {
22796
+ case "paid":
22797
+ return {
22798
+ textColor: "plc-text-green-700",
22799
+ bgColor: "plc-bg-green-100",
22800
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null),
22801
+ title: translations.paid
22802
+ };
22803
+
22804
+ case "past_due":
22805
+ return {
22806
+ textColor: "plc-text-orange-700",
22807
+ bgColor: "plc-bg-orange-100",
22808
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22809
+ title: translations.pastDue
22810
+ };
22349
22811
 
22350
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22351
- const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22352
- return [...donations, ...canceledDonations];
22353
- }
22812
+ case "open":
22813
+ return {
22814
+ textColor: "plc-text-yellow-700",
22815
+ bgColor: "plc-bg-yellow-100",
22816
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22817
+ title: translations.open
22818
+ };
22354
22819
 
22355
- function formatStartDate(date) {
22356
- const startDate = new Date(date);
22357
- return new Intl.DateTimeFormat("en-CA").format(startDate);
22820
+ case "draft":
22821
+ return {
22822
+ textColor: "plc-text-blue-700",
22823
+ bgColor: "plc-bg-blue-100",
22824
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, null),
22825
+ title: translations.draft
22826
+ };
22827
+
22828
+ case "scheduled":
22829
+ return {
22830
+ textColor: "plc-text-blue-700",
22831
+ bgColor: "plc-bg-blue-100",
22832
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCalendar, null),
22833
+ title: translations.scheduled
22834
+ };
22835
+
22836
+ case "uncollectible":
22837
+ return {
22838
+ textColor: "plc-text-red-700",
22839
+ bgColor: "plc-bg-red-100",
22840
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
22841
+ title: translations.uncollectible
22842
+ };
22843
+
22844
+ case "void":
22845
+ return {
22846
+ textColor: "plc-text-gray-700",
22847
+ bgColor: "plc-bg-gray-100",
22848
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
22849
+ title: translations.void
22850
+ };
22851
+ }
22358
22852
  }
22359
22853
 
22360
22854
  const SUB_MENUS = {
@@ -22503,9 +22997,10 @@ class Dashboard extends React.Component {
22503
22997
  }) => {
22504
22998
  if (isGift) {
22505
22999
  this.props.setProductAndPlan(null, null, true);
23000
+ return this.props.setView("plan-select");
22506
23001
  }
22507
23002
 
22508
- return this.props.setView("plan-select");
23003
+ return this.props.setView("subscription-options");
22509
23004
  });
22510
23005
 
22511
23006
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -22910,6 +23405,12 @@ class Dashboard extends React.Component {
22910
23405
  icon: /*#__PURE__*/React__default['default'].createElement(SvgShopping, null),
22911
23406
  title: this.locale("labels.orders.label"),
22912
23407
  content: /*#__PURE__*/React__default['default'].createElement(OrdersMenu, null)
23408
+ }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
23409
+ show: hasInvoices(),
23410
+ name: SUB_MENUS.INVOICES,
23411
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, null),
23412
+ title: this.locale("labels.invoices"),
23413
+ content: /*#__PURE__*/React__default['default'].createElement(InvoicesMenu, null)
22913
23414
  }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22914
23415
  name: SUB_MENUS.SAVED_ITEMS,
22915
23416
  icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
@@ -22925,6 +23426,13 @@ class Dashboard extends React.Component {
22925
23426
 
22926
23427
  }
22927
23428
 
23429
+ function hasInvoices() {
23430
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
23431
+
23432
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
23433
+ return invoices.length > 0;
23434
+ }
23435
+
22928
23436
  function hasDonationSubs() {
22929
23437
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22930
23438
 
@@ -22960,7 +23468,7 @@ const DashboardOpenButton = () => {
22960
23468
  };
22961
23469
  DashboardOpenButton.viewId = "dashboard-open";
22962
23470
 
22963
- const initialState$2 = {
23471
+ const initialState$3 = {
22964
23472
  imageSrc: null,
22965
23473
  crop: {
22966
23474
  x: 0,
@@ -22974,10 +23482,10 @@ const initialState$2 = {
22974
23482
  content: ""
22975
23483
  }
22976
23484
  };
22977
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23485
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
22978
23486
  const {
22979
- Provider: Provider$2
22980
- } = store$2;
23487
+ Provider: Provider$3
23488
+ } = store$3;
22981
23489
 
22982
23490
  const ProfilePicChangeContainer = ({
22983
23491
  style,
@@ -23111,21 +23619,21 @@ const ProfilePicChangeContainer = ({
23111
23619
  default:
23112
23620
  return state;
23113
23621
  }
23114
- }, initialState$2);
23622
+ }, initialState$3);
23115
23623
  return /*#__PURE__*/React__default['default'].createElement("div", {
23116
23624
  style: { ...style
23117
23625
  },
23118
23626
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23119
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23627
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
23120
23628
  value: {
23121
23629
  state,
23122
23630
  dispatch
23123
23631
  }
23124
23632
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
23125
- store: store$2,
23633
+ store: store$3,
23126
23634
  key: i
23127
23635
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
23128
- store: store$2
23636
+ store: store$3
23129
23637
  })));
23130
23638
  };
23131
23639
  /**
@@ -23187,7 +23695,7 @@ const ProfilePicChangeButton = ({
23187
23695
  isSubmitting
23188
23696
  },
23189
23697
  dispatch
23190
- } = React.useContext(store$2);
23698
+ } = React.useContext(store$3);
23191
23699
  const {
23192
23700
  t
23193
23701
  } = useTranslation("userEdit");
@@ -24555,7 +25063,7 @@ const ProfilePicChangeCropper = ({
24555
25063
  zoom
24556
25064
  },
24557
25065
  dispatch
24558
- } = React.useContext(store$2);
25066
+ } = React.useContext(store$3);
24559
25067
  return /*#__PURE__*/React__default['default'].createElement("div", {
24560
25068
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24561
25069
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24597,7 +25105,7 @@ const ProfilePicChangeZoom = ({
24597
25105
  zoom
24598
25106
  },
24599
25107
  dispatch
24600
- } = React.useContext(store$2);
25108
+ } = React.useContext(store$3);
24601
25109
  const {
24602
25110
  t
24603
25111
  } = useTranslation("userEdit");
@@ -24620,18 +25128,18 @@ const ProfilePicChangeZoom = ({
24620
25128
  }, otherProps)));
24621
25129
  };
24622
25130
 
24623
- var _path$1;
25131
+ var _path$2;
24624
25132
 
24625
- 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); }
25133
+ 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); }
24626
25134
 
24627
25135
  function SvgPhotograph(props) {
24628
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25136
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
24629
25137
  xmlns: "http://www.w3.org/2000/svg",
24630
25138
  className: "plc-h-6 plc-w-6",
24631
25139
  fill: "none",
24632
25140
  viewBox: "0 0 24 24",
24633
25141
  stroke: "currentColor"
24634
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25142
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
24635
25143
  strokeLinecap: "round",
24636
25144
  strokeLinejoin: "round",
24637
25145
  strokeWidth: 2,
@@ -24649,7 +25157,7 @@ const ProfilePicChangeSelectButton = ({
24649
25157
  state: {
24650
25158
  isSubmitting
24651
25159
  }
24652
- } = React.useContext(store$2);
25160
+ } = React.useContext(store$3);
24653
25161
  const {
24654
25162
  t
24655
25163
  } = useTranslation("userEdit");
@@ -24691,7 +25199,7 @@ const ProfilePicChangeRemoveButton = ({
24691
25199
  state: {
24692
25200
  isSubmitting
24693
25201
  }
24694
- } = React.useContext(store$2);
25202
+ } = React.useContext(store$3);
24695
25203
  const {
24696
25204
  t
24697
25205
  } = useTranslation("userEdit");
@@ -24714,7 +25222,7 @@ const ProfilePicChangeWrapper = () => {
24714
25222
  state: {
24715
25223
  imageSrc
24716
25224
  }
24717
- } = React.useContext(store$2);
25225
+ } = React.useContext(store$3);
24718
25226
  const {
24719
25227
  t
24720
25228
  } = useTranslation("userEdit");
@@ -24776,17 +25284,17 @@ function ProfilePicChangeModal({
24776
25284
  }
24777
25285
  ProfilePicChangeModal.viewId = "profile-picture";
24778
25286
 
24779
- const initialState$1 = {
25287
+ const initialState$2 = {
24780
25288
  isSubmitting: false,
24781
25289
  alert: {
24782
25290
  type: "error",
24783
25291
  content: ""
24784
25292
  }
24785
25293
  };
24786
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25294
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
24787
25295
  const {
24788
- Provider: Provider$1
24789
- } = store$1;
25296
+ Provider: Provider$2
25297
+ } = store$2;
24790
25298
 
24791
25299
  const EmailVerifyContainer = ({
24792
25300
  style,
@@ -24849,21 +25357,21 @@ const EmailVerifyContainer = ({
24849
25357
  default:
24850
25358
  return state;
24851
25359
  }
24852
- }, initialState$1);
25360
+ }, initialState$2);
24853
25361
  return /*#__PURE__*/React__default['default'].createElement("div", {
24854
25362
  style: { ...style
24855
25363
  },
24856
25364
  className: `pelcro-container pelcro-email-verify-container ${className}`
24857
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25365
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
24858
25366
  value: {
24859
25367
  state,
24860
25368
  dispatch
24861
25369
  }
24862
25370
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24863
- store: store$1,
25371
+ store: store$2,
24864
25372
  key: i
24865
25373
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24866
- store: store$1
25374
+ store: store$2
24867
25375
  })));
24868
25376
  };
24869
25377
 
@@ -24877,7 +25385,7 @@ const EmailVerifyResendButton = ({
24877
25385
  state: {
24878
25386
  isSubmitting
24879
25387
  }
24880
- } = React.useContext(store$1);
25388
+ } = React.useContext(store$2);
24881
25389
  const {
24882
25390
  t
24883
25391
  } = useTranslation("verifyEmail");
@@ -24892,16 +25400,16 @@ const EmailVerifyResendButton = ({
24892
25400
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
24893
25401
  };
24894
25402
 
24895
- var _path, _path2;
25403
+ var _path$1, _path2;
24896
25404
 
24897
- 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); }
25405
+ 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); }
24898
25406
 
24899
25407
  function SvgEmailVerify(props) {
24900
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25408
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
24901
25409
  className: "plc-w-6 plc-h-6",
24902
25410
  viewBox: "0 0 700 700",
24903
25411
  xmlns: "http://www.w3.org/2000/svg"
24904
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25412
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
24905
25413
  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"
24906
25414
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
24907
25415
  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"
@@ -25005,11 +25513,11 @@ const invoicePaymentSubmitButton = props => {
25005
25513
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
25006
25514
  };
25007
25515
 
25008
- const initialState = {};
25009
- const store = /*#__PURE__*/React.createContext(initialState);
25516
+ const initialState$1 = {};
25517
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25010
25518
  const {
25011
- Provider
25012
- } = store;
25519
+ Provider: Provider$1
25520
+ } = store$1;
25013
25521
 
25014
25522
  const InvoiceDetailsContainer = ({
25015
25523
  style,
@@ -25030,21 +25538,21 @@ const InvoiceDetailsContainer = ({
25030
25538
  default:
25031
25539
  return state;
25032
25540
  }
25033
- }, initialState);
25541
+ }, initialState$1);
25034
25542
  return /*#__PURE__*/React__default['default'].createElement("div", {
25035
25543
  style: { ...style
25036
25544
  },
25037
25545
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25038
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25546
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25039
25547
  value: {
25040
25548
  state,
25041
25549
  dispatch
25042
25550
  }
25043
25551
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25044
- store,
25552
+ store: store$1,
25045
25553
  key: i
25046
25554
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25047
- store
25555
+ store: store$1
25048
25556
  })));
25049
25557
  };
25050
25558
 
@@ -25076,7 +25584,7 @@ const InvoiceDetailsPayButton = ({
25076
25584
  }) => {
25077
25585
  const {
25078
25586
  dispatch
25079
- } = React.useContext(store);
25587
+ } = React.useContext(store$1);
25080
25588
  const {
25081
25589
  t
25082
25590
  } = useTranslation("invoiceDetails");
@@ -25181,6 +25689,232 @@ const InvoiceDetailsModal = ({
25181
25689
  };
25182
25690
  InvoiceDetailsModal.viewId = "invoice-details";
25183
25691
 
25692
+ const initialState = {
25693
+ selectedOption: ""
25694
+ };
25695
+ const store = /*#__PURE__*/React.createContext(initialState);
25696
+ const {
25697
+ Provider
25698
+ } = store;
25699
+
25700
+ const SubscriptionOptionsContainer = ({
25701
+ style,
25702
+ className = "",
25703
+ onRenewSubSuccess = () => {},
25704
+ onNewSubSuccess = () => {},
25705
+ children,
25706
+ ...props
25707
+ }) => {
25708
+ const submit = ({
25709
+ selectedOption
25710
+ }, dispatch) => {
25711
+ if (selectedOption === "renew") return onRenewSubSuccess();
25712
+ if (selectedOption === "new") return onNewSubSuccess();
25713
+ };
25714
+
25715
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25716
+ switch (action.type) {
25717
+ case SWITCH_TO_NEW:
25718
+ return lib_7({ ...state,
25719
+ selectedOption: "new"
25720
+ });
25721
+
25722
+ case SWITCH_TO_RENEW:
25723
+ return lib_7({ ...state,
25724
+ selectedOption: "renew"
25725
+ });
25726
+
25727
+ case HANDLE_SUBMIT:
25728
+ return lib_4((state, dispatch) => submit(state));
25729
+
25730
+ default:
25731
+ return state;
25732
+ }
25733
+ }, initialState);
25734
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25735
+ style: { ...style
25736
+ },
25737
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25738
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25739
+ value: {
25740
+ state,
25741
+ dispatch
25742
+ }
25743
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25744
+ store,
25745
+ key: i
25746
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25747
+ store
25748
+ })));
25749
+ };
25750
+
25751
+ var _path;
25752
+
25753
+ 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); }
25754
+
25755
+ function SvgPlusCircle(props) {
25756
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25757
+ xmlns: "http://www.w3.org/2000/svg",
25758
+ className: "plc-h-6 plc-w-6",
25759
+ fill: "none",
25760
+ viewBox: "0 0 24 24",
25761
+ stroke: "currentColor",
25762
+ strokeWidth: 2
25763
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25764
+ strokeLinecap: "round",
25765
+ strokeLinejoin: "round",
25766
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25767
+ })));
25768
+ }
25769
+
25770
+ const SubscriptionOptionsNewButton = ({
25771
+ name,
25772
+ onClick,
25773
+ ...otherProps
25774
+ }) => {
25775
+ const {
25776
+ dispatch,
25777
+ state: {
25778
+ selectedOption
25779
+ }
25780
+ } = React.useContext(store);
25781
+ const {
25782
+ t
25783
+ } = useTranslation("subscriptionOptions");
25784
+ const isChecked = selectedOption === "new";
25785
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25786
+ className: "plc-hidden pelcro-new-sub-option",
25787
+ 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"}`,
25788
+ id: "pelcro-new-sub-option",
25789
+ name: "option",
25790
+ onChange: () => {
25791
+ dispatch({
25792
+ type: SWITCH_TO_NEW
25793
+ });
25794
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25795
+ },
25796
+ checked: isChecked
25797
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25798
+ className: "plc-w-full plc-h-full plc-mr-0"
25799
+ }));
25800
+ };
25801
+
25802
+ const SubscriptionOptionsRenewButton = ({
25803
+ name,
25804
+ onClick,
25805
+ ...otherProps
25806
+ }) => {
25807
+ const {
25808
+ dispatch,
25809
+ state: {
25810
+ selectedOption
25811
+ }
25812
+ } = React.useContext(store);
25813
+ const {
25814
+ t
25815
+ } = useTranslation("subscriptionOptions");
25816
+ const isChecked = selectedOption === "renew";
25817
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25818
+ className: "plc-hidden pelcro-renew-sub-option",
25819
+ 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"}`,
25820
+ id: "pelcro-renew-sub-option",
25821
+ name: "option",
25822
+ onChange: () => {
25823
+ dispatch({
25824
+ type: SWITCH_TO_RENEW
25825
+ });
25826
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25827
+ },
25828
+ checked: isChecked
25829
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
25830
+ className: "plc-w-full plc-h-full plc-mr-0"
25831
+ }));
25832
+ };
25833
+
25834
+ const SubscriptionOptionsSubmit = ({
25835
+ name,
25836
+ onClick,
25837
+ ...otherProps
25838
+ }) => {
25839
+ const {
25840
+ dispatch,
25841
+ state: {
25842
+ selectedOption
25843
+ }
25844
+ } = React.useContext(store);
25845
+ const {
25846
+ t
25847
+ } = useTranslation("subscriptionOptions");
25848
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25849
+ onClick: () => {
25850
+ dispatch({
25851
+ type: HANDLE_SUBMIT
25852
+ });
25853
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25854
+ },
25855
+ disabled: !selectedOption
25856
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25857
+ };
25858
+
25859
+ const SubscriptionOptionsView = props => {
25860
+ const {
25861
+ t
25862
+ } = useTranslation("subscriptionOptions");
25863
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25864
+ id: "pelcro-subscription-options-view"
25865
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25866
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25867
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
25868
+ className: "plc-text-2xl plc-font-semibold"
25869
+ }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
25870
+ action: "javascript:void(0);",
25871
+ className: "plc-mt-2 pelcro-form"
25872
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25873
+ className: "plc-flex plc-justify-between plc-items-center"
25874
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
25875
+ role: "submit",
25876
+ className: "plc-mt-4 plc-w-full",
25877
+ name: t("next"),
25878
+ id: "pelcro-submit"
25879
+ }))));
25880
+ };
25881
+
25882
+ const SubscriptionOptionsModal = ({
25883
+ onDisplay,
25884
+ onClose,
25885
+ ...otherProps
25886
+ }) => {
25887
+ const {
25888
+ switchView,
25889
+ setProductsList
25890
+ } = usePelcro();
25891
+
25892
+ const onRenewSubSuccess = () => {
25893
+ var _otherProps$onRenewSu;
25894
+
25895
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
25896
+ setProductsList(getRenewableProducts());
25897
+ switchView("_plan-select-renew");
25898
+ };
25899
+
25900
+ const onNewSubSuccess = () => {
25901
+ var _otherProps$onNewSubS;
25902
+
25903
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
25904
+ switchView("plan-select");
25905
+ };
25906
+
25907
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
25908
+ onDisplay: onDisplay,
25909
+ onClose: onClose,
25910
+ id: "pelcro-subscription-options-modal"
25911
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
25912
+ onNewSubSuccess: onNewSubSuccess,
25913
+ onRenewSubSuccess: onRenewSubSuccess
25914
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
25915
+ };
25916
+ SubscriptionOptionsModal.viewId = "subscription-options";
25917
+
25184
25918
  exports.AddressCreateCity = AddressCreateCity;
25185
25919
  exports.AddressCreateContainer = AddressCreateContainer;
25186
25920
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -25358,6 +26092,12 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
25358
26092
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
25359
26093
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
25360
26094
  exports.SubscriptionCreateView = SubscriptionCreateView;
26095
+ exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
26096
+ exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
26097
+ exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
26098
+ exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
26099
+ exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
26100
+ exports.SubscriptionOptionsView = SubscriptionOptionsView;
25361
26101
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
25362
26102
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
25363
26103
  exports.SubscriptionRenewView = SubscriptionRenewView;