@pelcro/react-pelcro-js 3.0.0-beta.1 → 3.0.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.esm.js CHANGED
@@ -3216,7 +3216,7 @@ var validation$1 = {
3216
3216
  enterEmail: "Un courriel est requis.",
3217
3217
  enterPassword: "Mot de passe requis."
3218
3218
  };
3219
- var buttons$7 = {
3219
+ var buttons$9 = {
3220
3220
  account: "Accès abonné(e)s",
3221
3221
  login: "Se connecter"
3222
3222
  };
@@ -3293,7 +3293,7 @@ var confirm$5 = {
3293
3293
  };
3294
3294
  var common_fr = {
3295
3295
  validation: validation$1,
3296
- buttons: buttons$7,
3296
+ buttons: buttons$9,
3297
3297
  dashboard: dashboard$1,
3298
3298
  select: select$3,
3299
3299
  confirm: confirm$5
@@ -3304,7 +3304,7 @@ var validation = {
3304
3304
  enterEmail: "Email address is required.",
3305
3305
  enterPassword: "Password is required."
3306
3306
  };
3307
- var buttons$6 = {
3307
+ var buttons$8 = {
3308
3308
  account: "My account",
3309
3309
  login: "Login"
3310
3310
  };
@@ -3381,7 +3381,7 @@ var confirm$4 = {
3381
3381
  };
3382
3382
  var common_en = {
3383
3383
  validation: validation,
3384
- buttons: buttons$6,
3384
+ buttons: buttons$8,
3385
3385
  dashboard: dashboard,
3386
3386
  select: select$2,
3387
3387
  confirm: confirm$4
@@ -3431,10 +3431,10 @@ var paymentMethod_fr = {
3431
3431
  select: select
3432
3432
  };
3433
3433
 
3434
- var title$d = "Enter your email to subscribe to our newsletter";
3434
+ var title$f = "Enter your email to subscribe to our newsletter";
3435
3435
  var updateTitle$1 = "Update newsletter selections";
3436
3436
  var subtitle$7 = "We may use your email for other marketing communication";
3437
- var labels$n = {
3437
+ var labels$p = {
3438
3438
  submit: "Submit",
3439
3439
  firstName: "First name",
3440
3440
  lastName: "Last name",
@@ -3450,17 +3450,17 @@ var messages$r = {
3450
3450
  here: "here"
3451
3451
  };
3452
3452
  var newsletter_en = {
3453
- title: title$d,
3453
+ title: title$f,
3454
3454
  updateTitle: updateTitle$1,
3455
3455
  subtitle: subtitle$7,
3456
- labels: labels$n,
3456
+ labels: labels$p,
3457
3457
  messages: messages$r
3458
3458
  };
3459
3459
 
3460
- var title$c = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3460
+ var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3461
3461
  var updateTitle = "Mettre à jour son choix d'infolettres";
3462
3462
  var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3463
- var labels$m = {
3463
+ var labels$o = {
3464
3464
  submit: "Lire l’article !",
3465
3465
  firstName: "Prénom",
3466
3466
  lastName: "Nom de famille",
@@ -3476,14 +3476,14 @@ var messages$q = {
3476
3476
  here: "ici"
3477
3477
  };
3478
3478
  var newsletter_fr = {
3479
- title: title$c,
3479
+ title: title$e,
3480
3480
  updateTitle: updateTitle,
3481
3481
  subtitle: subtitle$6,
3482
- labels: labels$m,
3482
+ labels: labels$o,
3483
3483
  messages: messages$q
3484
3484
  };
3485
3485
 
3486
- var labels$l = {
3486
+ var labels$n = {
3487
3487
  "continue": "Continue to content"
3488
3488
  };
3489
3489
  var messages$p = {
@@ -3502,18 +3502,22 @@ var messages$p = {
3502
3502
  giftRedeem: {
3503
3503
  title: "Congratulations",
3504
3504
  content: "You have successfully redeemed your gift subscription. Enjoy!"
3505
+ },
3506
+ invoicePayment: {
3507
+ title: "Invoice paid successfully",
3508
+ content: "Please contact us if you have any questions or concerns."
3505
3509
  }
3506
3510
  };
3507
3511
  var errors$9 = {
3508
3512
  "": ""
3509
3513
  };
3510
3514
  var success_en = {
3511
- labels: labels$l,
3515
+ labels: labels$n,
3512
3516
  messages: messages$p,
3513
3517
  errors: errors$9
3514
3518
  };
3515
3519
 
3516
- var labels$k = {
3520
+ var labels$m = {
3517
3521
  "continue": "Abonnement réussi !"
3518
3522
  };
3519
3523
  var messages$o = {
@@ -3532,13 +3536,17 @@ var messages$o = {
3532
3536
  giftRedeem: {
3533
3537
  title: "Félicitations",
3534
3538
  content: "Vous avez validé votre abonnement cadeau. Profitez-en!"
3539
+ },
3540
+ invoicePayment: {
3541
+ title: "Invoice paid successfully",
3542
+ content: "Please contact us if you have any questions or concerns."
3535
3543
  }
3536
3544
  };
3537
3545
  var errors$8 = {
3538
3546
  "": ""
3539
3547
  };
3540
3548
  var success_fr = {
3541
- labels: labels$k,
3549
+ labels: labels$m,
3542
3550
  messages: messages$o,
3543
3551
  errors: errors$8
3544
3552
  };
@@ -3575,7 +3583,7 @@ var messages$l = {
3575
3583
  youAreSafe: "You're safe - PCI compliant 128 SSL by",
3576
3584
  bankRedirection: "Please hold, redirecting you to your bank."
3577
3585
  };
3578
- var labels$j = {
3586
+ var labels$l = {
3579
3587
  card: "Enter card number",
3580
3588
  date: "Expiration date",
3581
3589
  CVC: "CVC",
@@ -3595,14 +3603,14 @@ var labels$j = {
3595
3603
  };
3596
3604
  var checkoutForm_en = {
3597
3605
  messages: messages$l,
3598
- labels: labels$j
3606
+ labels: labels$l
3599
3607
  };
3600
3608
 
3601
3609
  var messages$k = {
3602
3610
  youAreSafe: "Vous êtes en sécurité - PCI conforme 128 SSL par",
3603
3611
  bankRedirection: "Veuillez patienter, nous vous redirigeons vers votre banque."
3604
3612
  };
3605
- var labels$i = {
3613
+ var labels$k = {
3606
3614
  card: "Entrez le numéro de carte",
3607
3615
  date: "Date d’expiration",
3608
3616
  CVC: "CVC",
@@ -3622,7 +3630,7 @@ var labels$i = {
3622
3630
  };
3623
3631
  var checkoutForm_fr = {
3624
3632
  messages: messages$k,
3625
- labels: labels$i
3633
+ labels: labels$k
3626
3634
  };
3627
3635
 
3628
3636
  var youAreSafe$1 = "You're safe - PCI compliant 128 SSL by";
@@ -3631,13 +3639,15 @@ var giftSent$1 = "Subscription gift has been sent to";
3631
3639
  var successfully$1 = "successfully";
3632
3640
  var entitlement$1 = "Some of the content on this page is available with one or more of our plans. <1>Subscribe</1> now to get full page access.";
3633
3641
  var recaptcha$1 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
3642
+ var invalidInvoice$1 = "Invalid invoice ID, please contact support";
3634
3643
  var messages_en = {
3635
3644
  youAreSafe: youAreSafe$1,
3636
3645
  cancel: cancel$1,
3637
3646
  giftSent: giftSent$1,
3638
3647
  successfully: successfully$1,
3639
3648
  entitlement: entitlement$1,
3640
- recaptcha: recaptcha$1
3649
+ recaptcha: recaptcha$1,
3650
+ invalidInvoice: invalidInvoice$1
3641
3651
  };
3642
3652
 
3643
3653
  var youAreSafe = "Vous êtes en sécurité - PCI conforme 128 SSL par";
@@ -3646,16 +3656,18 @@ var giftSent = "Le cadeau d’abonnement a été envoyé à";
3646
3656
  var successfully = "avec succès.";
3647
3657
  var entitlement = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1>Abonnez-vous</1> à l'un de nos plans disponibles pour accéder à plus de contenu";
3648
3658
  var recaptcha = "Ce site est protégé par reCAPTCHA - les <1>règles de confidentialité</1> Google ainsi que les <3>conditions d'utilisation</3> s'appliquent.";
3659
+ var invalidInvoice = "Invalid invoice ID, please contact support";
3649
3660
  var messages_fr = {
3650
3661
  youAreSafe: youAreSafe,
3651
3662
  cancel: cancel,
3652
3663
  giftSent: giftSent,
3653
3664
  successfully: successfully,
3654
3665
  entitlement: entitlement,
3655
- recaptcha: recaptcha
3666
+ recaptcha: recaptcha,
3667
+ invalidInvoice: invalidInvoice
3656
3668
  };
3657
3669
 
3658
- var labels$h = {
3670
+ var labels$j = {
3659
3671
  email: "Enter email",
3660
3672
  password: "Enter password",
3661
3673
  required: "required",
@@ -3682,12 +3694,12 @@ var errors$5 = {
3682
3694
  "": ""
3683
3695
  };
3684
3696
  var login_en = {
3685
- labels: labels$h,
3697
+ labels: labels$j,
3686
3698
  messages: messages$j,
3687
3699
  errors: errors$5
3688
3700
  };
3689
3701
 
3690
- var labels$g = {
3702
+ var labels$i = {
3691
3703
  email: "Entrez votre adresse courriel",
3692
3704
  password: "Entrez votre mot de passe",
3693
3705
  required: "Champs obligatoires",
@@ -3714,14 +3726,14 @@ var errors$4 = {
3714
3726
  "": ""
3715
3727
  };
3716
3728
  var login_fr = {
3717
- labels: labels$g,
3729
+ labels: labels$i,
3718
3730
  messages: messages$i,
3719
3731
  errors: errors$4
3720
3732
  };
3721
3733
 
3722
- var title$b = "Create an account";
3734
+ var title$d = "Create an account";
3723
3735
  var subtitle$5 = "Enter your email and password below";
3724
- var labels$f = {
3736
+ var labels$h = {
3725
3737
  signUpFacebook: "Sign up with Facebook",
3726
3738
  signUpGoogle: "Sign up with Google",
3727
3739
  signUpEmail: "Sign up with Email",
@@ -3805,18 +3817,18 @@ var redeem$1 = {
3805
3817
  }
3806
3818
  };
3807
3819
  var register_en = {
3808
- title: title$b,
3820
+ title: title$d,
3809
3821
  subtitle: subtitle$5,
3810
- labels: labels$f,
3822
+ labels: labels$h,
3811
3823
  messages: messages$h,
3812
3824
  errors: errors$3,
3813
3825
  gift: gift$1,
3814
3826
  redeem: redeem$1
3815
3827
  };
3816
3828
 
3817
- var title$a = "Créer un compte";
3829
+ var title$c = "Créer un compte";
3818
3830
  var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3819
- var labels$e = {
3831
+ var labels$g = {
3820
3832
  signUpFacebook: "Inscrivez-vous avec Facebook",
3821
3833
  signUpGoogle: "Inscrivez-vous avec Google",
3822
3834
  signUpEmail: "Inscrivez-vous avec votre courriel",
@@ -3901,16 +3913,16 @@ var redeem = {
3901
3913
  }
3902
3914
  };
3903
3915
  var register_fr = {
3904
- title: title$a,
3916
+ title: title$c,
3905
3917
  subtitle: subtitle$4,
3906
- labels: labels$e,
3918
+ labels: labels$g,
3907
3919
  messages: messages$g,
3908
3920
  errors: errors$2,
3909
3921
  gift: gift,
3910
3922
  redeem: redeem
3911
3923
  };
3912
3924
 
3913
- var labels$d = {
3925
+ var labels$f = {
3914
3926
  title: "Want to update your profile?",
3915
3927
  subtitle: "Enter your information below to update your profile",
3916
3928
  email: "Email",
@@ -3932,11 +3944,11 @@ var messages$f = {
3932
3944
  pictureUpdated: "Your profile picture was updated successfully."
3933
3945
  };
3934
3946
  var userEdit_en = {
3935
- labels: labels$d,
3947
+ labels: labels$f,
3936
3948
  messages: messages$f
3937
3949
  };
3938
3950
 
3939
- var labels$c = {
3951
+ var labels$e = {
3940
3952
  title: "Voulez-vous mettre à jour votre profil ?",
3941
3953
  subtitle: "Entrez vos informations ci-dessous pour mettre à jour votre profil",
3942
3954
  email: "Address courriel",
@@ -3958,14 +3970,14 @@ var messages$e = {
3958
3970
  pictureUpdated: "Votre photo de profil a été mise à jour avec succès."
3959
3971
  };
3960
3972
  var userEdit_fr = {
3961
- labels: labels$c,
3973
+ labels: labels$e,
3962
3974
  messages: messages$e
3963
3975
  };
3964
3976
 
3965
- var title$9 = "Enter your shipping address";
3977
+ var title$b = "Enter your shipping address";
3966
3978
  var selectAddressTitle$1 = "Please select an address";
3967
3979
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
3968
- var labels$b = {
3980
+ var labels$d = {
3969
3981
  address: "Address",
3970
3982
  code: "Postal Code/Zip",
3971
3983
  city: "City",
@@ -3975,7 +3987,7 @@ var labels$b = {
3975
3987
  lastName: "Last name",
3976
3988
  required: "required"
3977
3989
  };
3978
- var buttons$5 = {
3990
+ var buttons$7 = {
3979
3991
  submit: "Submit",
3980
3992
  selectAddress: "Select address",
3981
3993
  addAddress: "Add new address"
@@ -3985,18 +3997,18 @@ var messages$d = {
3985
3997
  subRedeemed: "Your subscription has been redeemed."
3986
3998
  };
3987
3999
  var address_en = {
3988
- title: title$9,
4000
+ title: title$b,
3989
4001
  selectAddressTitle: selectAddressTitle$1,
3990
4002
  selectAddressSubtitle: selectAddressSubtitle$1,
3991
- labels: labels$b,
3992
- buttons: buttons$5,
4003
+ labels: labels$d,
4004
+ buttons: buttons$7,
3993
4005
  messages: messages$d
3994
4006
  };
3995
4007
 
3996
- var title$8 = "Entrez votre adresse de livraison";
4008
+ var title$a = "Entrez votre adresse de livraison";
3997
4009
  var selectAddressTitle = "Veuillez sélectionner une adresse";
3998
4010
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
3999
- var labels$a = {
4011
+ var labels$c = {
4000
4012
  address: "Adresse",
4001
4013
  code: "Code postal / Zip",
4002
4014
  city: "Ville",
@@ -4006,7 +4018,7 @@ var labels$a = {
4006
4018
  lastName: "Nom de famille",
4007
4019
  required: "Champs obligatoires"
4008
4020
  };
4009
- var buttons$4 = {
4021
+ var buttons$6 = {
4010
4022
  submit: "Valider",
4011
4023
  selectAddress: "Choisir cette adresse",
4012
4024
  addAddress: "Ajouter une nouvelle adresse"
@@ -4016,15 +4028,15 @@ var messages$c = {
4016
4028
  subRedeemed: "Votre abonnement a bien été activé."
4017
4029
  };
4018
4030
  var address_fr = {
4019
- title: title$8,
4031
+ title: title$a,
4020
4032
  selectAddressTitle: selectAddressTitle,
4021
4033
  selectAddressSubtitle: selectAddressSubtitle,
4022
- labels: labels$a,
4023
- buttons: buttons$4,
4034
+ labels: labels$c,
4035
+ buttons: buttons$6,
4024
4036
  messages: messages$c
4025
4037
  };
4026
4038
 
4027
- var title$7 = "Reset your password";
4039
+ var title$9 = "Reset your password";
4028
4040
  var subtitle$3 = "Enter a new password below";
4029
4041
  var email$3 = "Email";
4030
4042
  var password$3 = "Password";
@@ -4033,7 +4045,7 @@ var submit$5 = "Submit";
4033
4045
  var required$5 = "Required";
4034
4046
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4035
4047
  var passwordReset_en = {
4036
- title: title$7,
4048
+ title: title$9,
4037
4049
  subtitle: subtitle$3,
4038
4050
  email: email$3,
4039
4051
  password: password$3,
@@ -4043,7 +4055,7 @@ var passwordReset_en = {
4043
4055
  passwordUpdated: passwordUpdated$1
4044
4056
  };
4045
4057
 
4046
- var title$6 = "Réinitialiser votre mot de passe";
4058
+ var title$8 = "Réinitialiser votre mot de passe";
4047
4059
  var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4048
4060
  var email$2 = "Adresse courriel";
4049
4061
  var password$2 = "Mot de passe";
@@ -4052,7 +4064,7 @@ var submit$4 = "Soumettre";
4052
4064
  var required$4 = "Champs obligatoires";
4053
4065
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4054
4066
  var passwordReset_fr = {
4055
- title: title$6,
4067
+ title: title$8,
4056
4068
  subtitle: subtitle$2,
4057
4069
  email: email$2,
4058
4070
  password: password$2,
@@ -4062,7 +4074,7 @@ var passwordReset_fr = {
4062
4074
  passwordUpdated: passwordUpdated
4063
4075
  };
4064
4076
 
4065
- var title$5 = "Forgot your password?";
4077
+ var title$7 = "Forgot your password?";
4066
4078
  var email$1 = "Email";
4067
4079
  var password$1 = "Password";
4068
4080
  var submit$3 = "Submit";
@@ -4073,7 +4085,7 @@ var messages$b = {
4073
4085
  loginHere: "login here."
4074
4086
  };
4075
4087
  var passwordForgot_en = {
4076
- title: title$5,
4088
+ title: title$7,
4077
4089
  email: email$1,
4078
4090
  password: password$1,
4079
4091
  submit: submit$3,
@@ -4082,7 +4094,7 @@ var passwordForgot_en = {
4082
4094
  messages: messages$b
4083
4095
  };
4084
4096
 
4085
- var title$4 = "Mot de passe oublié ?";
4097
+ var title$6 = "Mot de passe oublié ?";
4086
4098
  var email = "Courriel";
4087
4099
  var password = "Mot de passe";
4088
4100
  var submit$2 = "Soumettre";
@@ -4093,7 +4105,7 @@ var messages$a = {
4093
4105
  loginHere: "Connectez-vous ici"
4094
4106
  };
4095
4107
  var passwordForgot_fr = {
4096
- title: title$4,
4108
+ title: title$6,
4097
4109
  email: email,
4098
4110
  password: password,
4099
4111
  submit: submit$2,
@@ -4102,7 +4114,7 @@ var passwordForgot_fr = {
4102
4114
  messages: messages$a
4103
4115
  };
4104
4116
 
4105
- var title$3 = "Change your password";
4117
+ var title$5 = "Change your password";
4106
4118
  var currentPassword$1 = "Current password";
4107
4119
  var newPassword$1 = "New password";
4108
4120
  var confirmNewPassword$1 = "Confirm new password";
@@ -4112,7 +4124,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4112
4124
  var passwordsNotMatching$1 = "Passwords don't match";
4113
4125
  var weakPassword$1 = "Your password must contain at least 6 characters";
4114
4126
  var passwordChange_en = {
4115
- title: title$3,
4127
+ title: title$5,
4116
4128
  currentPassword: currentPassword$1,
4117
4129
  newPassword: newPassword$1,
4118
4130
  confirmNewPassword: confirmNewPassword$1,
@@ -4123,7 +4135,7 @@ var passwordChange_en = {
4123
4135
  weakPassword: weakPassword$1
4124
4136
  };
4125
4137
 
4126
- var title$2 = "Changez votre mot de passe";
4138
+ var title$4 = "Changez votre mot de passe";
4127
4139
  var currentPassword = "Mot de passe actuel";
4128
4140
  var newPassword = "Nouveau mot de passe";
4129
4141
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4133,7 +4145,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4133
4145
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4134
4146
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4135
4147
  var passwordChange_fr = {
4136
- title: title$2,
4148
+ title: title$4,
4137
4149
  currentPassword: currentPassword,
4138
4150
  newPassword: newPassword,
4139
4151
  confirmNewPassword: confirmNewPassword,
@@ -4144,7 +4156,7 @@ var passwordChange_fr = {
4144
4156
  weakPassword: weakPassword
4145
4157
  };
4146
4158
 
4147
- var title$1 = "Votre panier";
4159
+ var title$3 = "Votre panier";
4148
4160
  var subtitle$1 = "Terminez votre achat ci-dessous";
4149
4161
  var name$1 = "Produit";
4150
4162
  var quantity$1 = "Quantité";
@@ -4156,7 +4168,7 @@ var confirm$3 = "Passer à la caisse";
4156
4168
  var empty$1 = "Votre panier est vide.";
4157
4169
  var removeAll$1 = "Vider";
4158
4170
  var cart_fr = {
4159
- title: title$1,
4171
+ title: title$3,
4160
4172
  subtitle: subtitle$1,
4161
4173
  name: name$1,
4162
4174
  quantity: quantity$1,
@@ -4169,7 +4181,7 @@ var cart_fr = {
4169
4181
  removeAll: removeAll$1
4170
4182
  };
4171
4183
 
4172
- var title = "Your shopping cart";
4184
+ var title$2 = "Your shopping cart";
4173
4185
  var subtitle = "Comple your purchase below";
4174
4186
  var name = "Name";
4175
4187
  var quantity = "Quantity";
@@ -4181,7 +4193,7 @@ var confirm$2 = "Checkout";
4181
4193
  var empty = "Your cart is empty.";
4182
4194
  var removeAll = "Remove all";
4183
4195
  var cart_en = {
4184
- title: title,
4196
+ title: title$2,
4185
4197
  subtitle: subtitle,
4186
4198
  name: name,
4187
4199
  quantity: quantity,
@@ -4194,7 +4206,7 @@ var cart_en = {
4194
4206
  removeAll: removeAll
4195
4207
  };
4196
4208
 
4197
- var buttons$3 = {
4209
+ var buttons$5 = {
4198
4210
  select: "Select",
4199
4211
  added: "Added to cart",
4200
4212
  purchase: "Purchase",
@@ -4209,17 +4221,17 @@ var messages$9 = {
4209
4221
  multipleCurrencies: "Your cart currently contains items which are available in different currencies. In order to proceed with the checkout, please make sure that all items have the same currency.",
4210
4222
  currencyMismatch: "The selected item(s) do not match your current default currency ({{currency}}). Please choose item(s) only matching this currency."
4211
4223
  };
4212
- var labels$9 = {
4224
+ var labels$b = {
4213
4225
  summary: "Order summary",
4214
4226
  total: "total"
4215
4227
  };
4216
4228
  var shop_en = {
4217
- buttons: buttons$3,
4229
+ buttons: buttons$5,
4218
4230
  messages: messages$9,
4219
- labels: labels$9
4231
+ labels: labels$b
4220
4232
  };
4221
4233
 
4222
- var buttons$2 = {
4234
+ var buttons$4 = {
4223
4235
  select: "Choisir",
4224
4236
  added: "Ajouté au panier",
4225
4237
  purchase: "Acheter",
@@ -4234,17 +4246,17 @@ var messages$8 = {
4234
4246
  multipleCurrencies: "Votre panier contient des articles disponibles dans différentes devises. Avant de passer à la caisse, veuillez vous assurer que tous les articles ont la même devise.",
4235
4247
  currencyMismatch: "Les articles sélectionnés ne sont pas compatibles avec la devise associée à votre compte ({{currency}}). Veuillez choisir des articles uniquement offerts dans cette devise."
4236
4248
  };
4237
- var labels$8 = {
4249
+ var labels$a = {
4238
4250
  summary: "récapitulatif de commande",
4239
4251
  total: "total"
4240
4252
  };
4241
4253
  var shop_fr = {
4242
- buttons: buttons$2,
4254
+ buttons: buttons$4,
4243
4255
  messages: messages$8,
4244
- labels: labels$8
4256
+ labels: labels$a
4245
4257
  };
4246
4258
 
4247
- var labels$7 = {
4259
+ var labels$9 = {
4248
4260
  cardNumber: "Numéro de carte",
4249
4261
  securityCode: "Code de sécurité",
4250
4262
  submit: "Soumettre",
@@ -4279,12 +4291,12 @@ var errors$1 = {
4279
4291
  "": ""
4280
4292
  };
4281
4293
  var payment_fr = {
4282
- labels: labels$7,
4294
+ labels: labels$9,
4283
4295
  messages: messages$7,
4284
4296
  errors: errors$1
4285
4297
  };
4286
4298
 
4287
- var labels$6 = {
4299
+ var labels$8 = {
4288
4300
  cardNumber: "Card number",
4289
4301
  securityCode: "Security Code",
4290
4302
  submit: "Submit",
@@ -4319,12 +4331,12 @@ var errors = {
4319
4331
  "": ""
4320
4332
  };
4321
4333
  var payment_en = {
4322
- labels: labels$6,
4334
+ labels: labels$8,
4323
4335
  messages: messages$6,
4324
4336
  errors: errors
4325
4337
  };
4326
4338
 
4327
- var labels$5 = {
4339
+ var labels$7 = {
4328
4340
  menu: "Pelcro Menu",
4329
4341
  name: "Name",
4330
4342
  email: "Email",
@@ -4349,6 +4361,15 @@ var labels$5 = {
4349
4361
  purchases: "Purchases",
4350
4362
  subscriptions: "Subscriptions",
4351
4363
  donations: "Donations",
4364
+ invoices: "Invoices",
4365
+ details: "Details",
4366
+ view: "View",
4367
+ paid: "Paid",
4368
+ open: "Open",
4369
+ draft: "Draft",
4370
+ uncollectible: "Uncollectible",
4371
+ "void": "Void",
4372
+ pastDue: "Past due",
4352
4373
  updatePaymentSource: "Update",
4353
4374
  profile: "Profile",
4354
4375
  updateProfile: "Edit profile",
@@ -4401,11 +4422,11 @@ var messages$5 = {
4401
4422
  }
4402
4423
  };
4403
4424
  var dashboard_en = {
4404
- labels: labels$5,
4425
+ labels: labels$7,
4405
4426
  messages: messages$5
4406
4427
  };
4407
4428
 
4408
- var labels$4 = {
4429
+ var labels$6 = {
4409
4430
  menu: "Menu Pelcro",
4410
4431
  name: "Nom",
4411
4432
  email: "Courriel",
@@ -4430,6 +4451,15 @@ var labels$4 = {
4430
4451
  purchases: "Achats",
4431
4452
  subscriptions: "Abonnements",
4432
4453
  donations: "Des dons",
4454
+ invoices: "Invoices",
4455
+ details: "Details",
4456
+ view: "View",
4457
+ paid: "Paid",
4458
+ open: "open",
4459
+ draft: "Draft",
4460
+ uncollectible: "Uncollectible",
4461
+ "void": "Void",
4462
+ pastDue: "Past due",
4433
4463
  updatePaymentSource: "Mettre à jour la source de paiement",
4434
4464
  profile: "Profil",
4435
4465
  updateProfile: "Mettre à jour le profil",
@@ -4482,7 +4512,7 @@ var messages$4 = {
4482
4512
  }
4483
4513
  };
4484
4514
  var dashboard_fr = {
4485
- labels: labels$4,
4515
+ labels: labels$6,
4486
4516
  messages: messages$4
4487
4517
  };
4488
4518
 
@@ -4491,7 +4521,7 @@ var messages$3 = {
4491
4521
  loginHere: "Login here",
4492
4522
  checkbox: "Check this box to gift this subscription"
4493
4523
  };
4494
- var labels$3 = {
4524
+ var labels$5 = {
4495
4525
  plan: {
4496
4526
  title: "Subscribe to a plan",
4497
4527
  subtitle: "Select one of the plans below and click on next."
@@ -4508,15 +4538,15 @@ var labels$3 = {
4508
4538
  or: "Or take a look at some of our other options below"
4509
4539
  }
4510
4540
  };
4511
- var buttons$1 = {
4541
+ var buttons$3 = {
4512
4542
  next: "Next",
4513
4543
  select: "Select",
4514
4544
  back: "Back"
4515
4545
  };
4516
4546
  var select_en = {
4517
4547
  messages: messages$3,
4518
- labels: labels$3,
4519
- buttons: buttons$1
4548
+ labels: labels$5,
4549
+ buttons: buttons$3
4520
4550
  };
4521
4551
 
4522
4552
  var messages$2 = {
@@ -4524,7 +4554,7 @@ var messages$2 = {
4524
4554
  loginHere: "Connectez-vous ici",
4525
4555
  checkbox: "Cochez cette case pour offrir cet abonnement"
4526
4556
  };
4527
- var labels$2 = {
4557
+ var labels$4 = {
4528
4558
  plan: {
4529
4559
  title: "Abonnez-vous à un plan",
4530
4560
  subtitle: "Sélectionnez l’un des plans ci-dessous et cliquez sur suivant."
@@ -4541,15 +4571,15 @@ var labels$2 = {
4541
4571
  or: "Sinon, jetez un coup d'oeil à d'autres offres ci-dessous"
4542
4572
  }
4543
4573
  };
4544
- var buttons = {
4574
+ var buttons$2 = {
4545
4575
  next: "Prochain",
4546
4576
  select: "Choisir",
4547
4577
  back: "Retour"
4548
4578
  };
4549
4579
  var select_fr = {
4550
4580
  messages: messages$2,
4551
- labels: labels$2,
4552
- buttons: buttons
4581
+ labels: labels$4,
4582
+ buttons: buttons$2
4553
4583
  };
4554
4584
 
4555
4585
  var confirm$1 = {
@@ -4572,7 +4602,7 @@ var notification_fr = {
4572
4602
  confirm: confirm
4573
4603
  };
4574
4604
 
4575
- var labels$1 = {
4605
+ var labels$3 = {
4576
4606
  title: "Verify your email",
4577
4607
  instructions: "You're on your way!\nLet's confirm your email address.\nClick on the verification link we've sent to your email:",
4578
4608
  resend: "Resend email"
@@ -4582,11 +4612,11 @@ var messages$1 = {
4582
4612
  success: "Email verified successfully!"
4583
4613
  };
4584
4614
  var verifyEmail_en = {
4585
- labels: labels$1,
4615
+ labels: labels$3,
4586
4616
  messages: messages$1
4587
4617
  };
4588
4618
 
4589
- var labels = {
4619
+ var labels$2 = {
4590
4620
  title: "Vérifiez votre e-mail",
4591
4621
  instructions: "Vous êtes en route!\nConfirmons votre adresse e-mail.\nCliquez sur le lien de vérification que nous vous avons envoyé par e-mail:",
4592
4622
  resend: "Ré-envoyer l'email"
@@ -4596,10 +4626,46 @@ var messages = {
4596
4626
  success: "Email vérifié avec succès!"
4597
4627
  };
4598
4628
  var verifyEmail_fr = {
4599
- labels: labels,
4629
+ labels: labels$2,
4600
4630
  messages: messages
4601
4631
  };
4602
4632
 
4633
+ var title$1 = "Invoice details";
4634
+ var labels$1 = {
4635
+ summary: "Summary",
4636
+ total: "Total",
4637
+ amountPaid: "Amount paid",
4638
+ amountDue: "Amount due",
4639
+ creationDate: "Created on:"
4640
+ };
4641
+ var buttons$1 = {
4642
+ download: "Download",
4643
+ pay: "Pay now"
4644
+ };
4645
+ var invoiceDetails_en = {
4646
+ title: title$1,
4647
+ labels: labels$1,
4648
+ buttons: buttons$1
4649
+ };
4650
+
4651
+ var title = "Invoice details";
4652
+ var labels = {
4653
+ summary: "Summary",
4654
+ total: "Total",
4655
+ amountPaid: "Amount paid",
4656
+ amountDue: "Amount due",
4657
+ creationDate: "Created on:"
4658
+ };
4659
+ var buttons = {
4660
+ download: "Download",
4661
+ pay: "Pay now"
4662
+ };
4663
+ var invoiceDetails_fr = {
4664
+ title: title,
4665
+ labels: labels,
4666
+ buttons: buttons
4667
+ };
4668
+
4603
4669
  function create$1(createState) {
4604
4670
  let state;
4605
4671
  const listeners = new Set();
@@ -5949,7 +6015,7 @@ class PelcroActions {
5949
6015
  view,
5950
6016
  cartItems,
5951
6017
  ...otherStateFields
5952
- } = initialState$h;
6018
+ } = initialState$i;
5953
6019
  this.set(otherStateFields);
5954
6020
  });
5955
6021
 
@@ -5993,10 +6059,11 @@ class PelcroActions {
5993
6059
  resetView,
5994
6060
  switchToCheckoutForm,
5995
6061
  product,
5996
- order
6062
+ order,
6063
+ invoice
5997
6064
  } = this.get();
5998
6065
 
5999
- if (product || order) {
6066
+ if (product || order || invoice) {
6000
6067
  // direct user to stripe checkout form when there are no existing cards
6001
6068
  if (!userHasPaymentMethod()) {
6002
6069
  return switchToCheckoutForm();
@@ -6013,7 +6080,8 @@ class PelcroActions {
6013
6080
  switchView,
6014
6081
  product,
6015
6082
  subscriptionIdToRenew,
6016
- order
6083
+ order,
6084
+ invoice
6017
6085
  } = this.get();
6018
6086
 
6019
6087
  if (product && subscriptionIdToRenew) {
@@ -6027,6 +6095,10 @@ class PelcroActions {
6027
6095
  if (order) {
6028
6096
  return switchView("order-create");
6029
6097
  }
6098
+
6099
+ if (invoice) {
6100
+ return switchView("invoice-payment");
6101
+ }
6030
6102
  });
6031
6103
 
6032
6104
  _defineProperty$3(this, "switchToAddressView", () => {
@@ -6057,6 +6129,23 @@ class PelcroActions {
6057
6129
  });
6058
6130
  });
6059
6131
 
6132
+ _defineProperty$3(this, "setInvoice", id => {
6133
+ var _window$Pelcro$invoic;
6134
+
6135
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
6136
+ const invoice = invoices.find(inv => String(inv.id) === String(id));
6137
+
6138
+ if (!invoice) {
6139
+ console.error("invalid invoice id");
6140
+ return false;
6141
+ }
6142
+
6143
+ this.set({
6144
+ invoice
6145
+ });
6146
+ return true;
6147
+ });
6148
+
6060
6149
  _defineProperty$3(this, "logout", () => {
6061
6150
  var _ReactGA$event;
6062
6151
 
@@ -6245,7 +6334,7 @@ class PelcroCallbacks {
6245
6334
 
6246
6335
  }
6247
6336
 
6248
- const initialState$h = {
6337
+ const initialState$i = {
6249
6338
  // View
6250
6339
  view: null,
6251
6340
  // Plans
@@ -6260,6 +6349,8 @@ const initialState$h = {
6260
6349
  cartItems: [],
6261
6350
  order: null,
6262
6351
  // null | SKU[] | SKU,
6352
+ // invoices
6353
+ invoice: null,
6263
6354
  // User
6264
6355
  isAuthenticated: () => window.Pelcro.user.isAuthenticated(),
6265
6356
  selectedPaymentMethodId: null,
@@ -6273,7 +6364,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6273
6364
  return {
6274
6365
  // Store setter
6275
6366
  set,
6276
- ...initialState$h,
6367
+ ...initialState$i,
6277
6368
  // State actions
6278
6369
  ...actions,
6279
6370
  // Callbacks
@@ -6424,7 +6515,7 @@ const calcAndFormatItemsTotal = (items, currency) => {
6424
6515
  */
6425
6516
 
6426
6517
  const isValidViewFromURL = viewID => {
6427
- if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart", "email-verify"].includes(viewID) || hasValidNewsletterUpdateUrl()) {
6518
+ if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart", "email-verify", "invoice-details"].includes(viewID) || hasValidNewsletterUpdateUrl()) {
6428
6519
  return true;
6429
6520
  }
6430
6521
 
@@ -6651,7 +6742,8 @@ const resources = {
6651
6742
  payment: payment_en,
6652
6743
  dashboard: dashboard_en,
6653
6744
  select: select_en,
6654
- notification: notification_en
6745
+ notification: notification_en,
6746
+ invoiceDetails: invoiceDetails_en
6655
6747
  },
6656
6748
  fr: {
6657
6749
  common: common_fr,
@@ -6674,7 +6766,8 @@ const resources = {
6674
6766
  payment: payment_fr,
6675
6767
  dashboard: dashboard_fr,
6676
6768
  select: select_fr,
6677
- notification: notification_fr
6769
+ notification: notification_fr,
6770
+ invoiceDetails: invoiceDetails_fr
6678
6771
  }
6679
6772
  }; // set UI language to the page language or default to the language in site settings
6680
6773
 
@@ -6965,8 +7058,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6965
7058
 
6966
7059
  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}}
6967
7060
 
6968
- function _extends$y() {
6969
- _extends$y = Object.assign || function (target) {
7061
+ function _extends$z() {
7062
+ _extends$z = Object.assign || function (target) {
6970
7063
  for (var i = 1; i < arguments.length; i++) {
6971
7064
  var source = arguments[i];
6972
7065
 
@@ -6980,7 +7073,7 @@ function _extends$y() {
6980
7073
  return target;
6981
7074
  };
6982
7075
 
6983
- return _extends$y.apply(this, arguments);
7076
+ return _extends$z.apply(this, arguments);
6984
7077
  }
6985
7078
 
6986
7079
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7070,7 +7163,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7070
7163
  var reducer = function reducer(state, action) {
7071
7164
  switch (action.type) {
7072
7165
  case ActionType.ADD_TOAST:
7073
- return _extends$y({}, state, {
7166
+ return _extends$z({}, state, {
7074
7167
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7075
7168
  });
7076
7169
 
@@ -7080,9 +7173,9 @@ var reducer = function reducer(state, action) {
7080
7173
  clearFromRemoveQueue(action.toast.id);
7081
7174
  }
7082
7175
 
7083
- return _extends$y({}, state, {
7176
+ return _extends$z({}, state, {
7084
7177
  toasts: state.toasts.map(function (t) {
7085
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7178
+ return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7086
7179
  })
7087
7180
  });
7088
7181
 
@@ -7109,9 +7202,9 @@ var reducer = function reducer(state, action) {
7109
7202
  });
7110
7203
  }
7111
7204
 
7112
- return _extends$y({}, state, {
7205
+ return _extends$z({}, state, {
7113
7206
  toasts: state.toasts.map(function (t) {
7114
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7207
+ return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7115
7208
  visible: false
7116
7209
  }) : t;
7117
7210
  })
@@ -7119,28 +7212,28 @@ var reducer = function reducer(state, action) {
7119
7212
 
7120
7213
  case ActionType.REMOVE_TOAST:
7121
7214
  if (action.toastId === undefined) {
7122
- return _extends$y({}, state, {
7215
+ return _extends$z({}, state, {
7123
7216
  toasts: []
7124
7217
  });
7125
7218
  }
7126
7219
 
7127
- return _extends$y({}, state, {
7220
+ return _extends$z({}, state, {
7128
7221
  toasts: state.toasts.filter(function (t) {
7129
7222
  return t.id !== action.toastId;
7130
7223
  })
7131
7224
  });
7132
7225
 
7133
7226
  case ActionType.START_PAUSE:
7134
- return _extends$y({}, state, {
7227
+ return _extends$z({}, state, {
7135
7228
  pausedAt: action.time
7136
7229
  });
7137
7230
 
7138
7231
  case ActionType.END_PAUSE:
7139
7232
  var diff = action.time - (state.pausedAt || 0);
7140
- return _extends$y({}, state, {
7233
+ return _extends$z({}, state, {
7141
7234
  pausedAt: undefined,
7142
7235
  toasts: state.toasts.map(function (t) {
7143
- return _extends$y({}, t, {
7236
+ return _extends$z({}, t, {
7144
7237
  pauseDuration: t.pauseDuration + diff
7145
7238
  });
7146
7239
  })
@@ -7187,12 +7280,12 @@ var useStore = function useStore(toastOptions) {
7187
7280
  var mergedToasts = state.toasts.map(function (t) {
7188
7281
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7189
7282
 
7190
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7283
+ return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7191
7284
  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],
7192
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7285
+ style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7193
7286
  });
7194
7287
  });
7195
- return _extends$y({}, state, {
7288
+ return _extends$z({}, state, {
7196
7289
  toasts: mergedToasts
7197
7290
  });
7198
7291
  };
@@ -7202,7 +7295,7 @@ var createToast = function createToast(message, type, opts) {
7202
7295
  type = 'blank';
7203
7296
  }
7204
7297
 
7205
- return _extends$y({
7298
+ return _extends$z({
7206
7299
  createdAt: Date.now(),
7207
7300
  visible: true,
7208
7301
  type: type,
@@ -7252,14 +7345,14 @@ toast.remove = function (toastId) {
7252
7345
  };
7253
7346
 
7254
7347
  toast.promise = function (promise, msgs, opts) {
7255
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7348
+ var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7256
7349
  promise.then(function (p) {
7257
- toast.success(resolveValue(msgs.success, p), _extends$y({
7350
+ toast.success(resolveValue(msgs.success, p), _extends$z({
7258
7351
  id: id
7259
7352
  }, opts, opts == null ? void 0 : opts.success));
7260
7353
  return p;
7261
7354
  })["catch"](function (e) {
7262
- toast.error(resolveValue(msgs.error, e), _extends$y({
7355
+ toast.error(resolveValue(msgs.error, e), _extends$z({
7263
7356
  id: id
7264
7357
  }, opts, opts == null ? void 0 : opts.error));
7265
7358
  });
@@ -7598,7 +7691,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7598
7691
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7599
7692
  return createElement(ToastBarBase, {
7600
7693
  className: toast.className,
7601
- style: _extends$y({}, animationStyle, style, toast.style)
7694
+ style: _extends$z({}, animationStyle, style, toast.style)
7602
7695
  }, typeof children === 'function' ? children({
7603
7696
  icon: icon,
7604
7697
  message: message
@@ -7628,7 +7721,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7628
7721
  } : position.includes('right') ? {
7629
7722
  justifyContent: 'flex-end'
7630
7723
  } : {};
7631
- return _extends$y({
7724
+ return _extends$z({
7632
7725
  left: 0,
7633
7726
  right: 0,
7634
7727
  display: 'flex',
@@ -7655,7 +7748,7 @@ var Toaster = function Toaster(_ref) {
7655
7748
  handlers = _useToaster.handlers;
7656
7749
 
7657
7750
  return createElement("div", {
7658
- style: _extends$y({
7751
+ style: _extends$z({
7659
7752
  position: 'fixed',
7660
7753
  zIndex: 9999,
7661
7754
  top: DEFAULT_OFFSET,
@@ -7690,82 +7783,82 @@ var Toaster = function Toaster(_ref) {
7690
7783
  }));
7691
7784
  };
7692
7785
 
7693
- var _path$v;
7786
+ var _path$w;
7694
7787
 
7695
- 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); }
7788
+ 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); }
7696
7789
 
7697
7790
  function SvgCheckSolid(props) {
7698
- return /*#__PURE__*/React.createElement("svg", _extends$x({
7791
+ return /*#__PURE__*/React.createElement("svg", _extends$y({
7699
7792
  xmlns: "http://www.w3.org/2000/svg",
7700
7793
  className: "h-5 w-5",
7701
7794
  viewBox: "0 0 20 20",
7702
7795
  fill: "currentColor"
7703
- }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7796
+ }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7704
7797
  fillRule: "evenodd",
7705
7798
  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",
7706
7799
  clipRule: "evenodd"
7707
7800
  })));
7708
7801
  }
7709
7802
 
7710
- var _path$u;
7803
+ var _path$v;
7711
7804
 
7712
- 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); }
7805
+ 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); }
7713
7806
 
7714
7807
  function SvgXIcon(props) {
7715
- return /*#__PURE__*/React.createElement("svg", _extends$w({
7808
+ return /*#__PURE__*/React.createElement("svg", _extends$x({
7716
7809
  xmlns: "http://www.w3.org/2000/svg",
7717
7810
  viewBox: "0 0 20 20",
7718
7811
  fill: "currentColor"
7719
- }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7812
+ }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7720
7813
  fill: "evenodd",
7721
7814
  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",
7722
7815
  clipRule: "evenodd"
7723
7816
  })));
7724
7817
  }
7725
7818
 
7726
- var _path$t;
7819
+ var _path$u;
7727
7820
 
7728
- 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); }
7821
+ 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); }
7729
7822
 
7730
7823
  function SvgXIconSolid(props) {
7731
- return /*#__PURE__*/React.createElement("svg", _extends$v({
7824
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
7732
7825
  className: "plc-w-4 plc-h-4",
7733
7826
  fill: "currentColor",
7734
7827
  xmlns: "http://www.w3.org/2000/svg",
7735
7828
  viewBox: "0 0 100 100"
7736
- }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7829
+ }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7737
7830
  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"
7738
7831
  })));
7739
7832
  }
7740
7833
 
7741
- var _path$s;
7834
+ var _path$t;
7742
7835
 
7743
- 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); }
7836
+ 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); }
7744
7837
 
7745
7838
  function SvgExclamation(props) {
7746
- return /*#__PURE__*/React.createElement("svg", _extends$u({
7839
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7747
7840
  className: "plc-w-4 plc-h-4 plc-mr-1",
7748
7841
  xmlns: "http://www.w3.org/2000/svg",
7749
7842
  viewBox: "0 0 20 20",
7750
7843
  fill: "currentColor"
7751
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7844
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7752
7845
  fillRule: "evenodd",
7753
7846
  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",
7754
7847
  clipRule: "evenodd"
7755
7848
  })));
7756
7849
  }
7757
7850
 
7758
- var _path$r, _path2$4;
7851
+ var _path$s, _path2$4;
7759
7852
 
7760
- 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); }
7853
+ 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); }
7761
7854
 
7762
7855
  function SvgSpinner(props) {
7763
- return /*#__PURE__*/React.createElement("svg", _extends$t({
7856
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
7764
7857
  className: "plc-animate-spin",
7765
7858
  viewBox: "0 0 24 24",
7766
7859
  fill: "currentColor",
7767
7860
  xmlns: "http://www.w3.org/2000/svg"
7768
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7861
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7769
7862
  opacity: 0.2,
7770
7863
  fill: "evenodd",
7771
7864
  clipRule: "evenodd",
@@ -8799,6 +8892,10 @@ const initViewFromURL = () => {
8799
8892
  return verifyEmailTokenFromUrl();
8800
8893
  }
8801
8894
 
8895
+ if (view === "invoice-details") {
8896
+ return showInvoiceDetailsFromUrl();
8897
+ }
8898
+
8802
8899
  switchView(view);
8803
8900
  });
8804
8901
  }
@@ -8975,6 +9072,28 @@ const verifyEmailTokenFromUrl = () => {
8975
9072
  });
8976
9073
  };
8977
9074
 
9075
+ const showInvoiceDetailsFromUrl = () => {
9076
+ const {
9077
+ isAuthenticated,
9078
+ setInvoice,
9079
+ switchView
9080
+ } = usePelcro.getStore();
9081
+
9082
+ if (!isAuthenticated()) {
9083
+ return switchView("login");
9084
+ }
9085
+
9086
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9087
+ const wasSetSuccessfully = setInvoice(invoiceId);
9088
+
9089
+ if (!wasSetSuccessfully) {
9090
+ const translations = i18next.t("messages", {
9091
+ returnObjects: true
9092
+ });
9093
+ notify.error(translations.invalidInvoice);
9094
+ }
9095
+ };
9096
+
8978
9097
  const defaultOptions = {
8979
9098
  loadPaymentSDKs: true,
8980
9099
  loadAuth0SDK: true,
@@ -9314,7 +9433,7 @@ const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9314
9433
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9315
9434
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9316
9435
 
9317
- const initialState$g = {
9436
+ const initialState$h = {
9318
9437
  email: "",
9319
9438
  password: "",
9320
9439
  emailError: null,
@@ -9325,10 +9444,10 @@ const initialState$g = {
9325
9444
  content: ""
9326
9445
  }
9327
9446
  };
9328
- const store$g = /*#__PURE__*/createContext(initialState$g);
9447
+ const store$h = /*#__PURE__*/createContext(initialState$h);
9329
9448
  const {
9330
- Provider: Provider$g
9331
- } = store$g;
9449
+ Provider: Provider$h
9450
+ } = store$h;
9332
9451
 
9333
9452
  const LoginContainer = ({
9334
9453
  style,
@@ -9435,7 +9554,7 @@ const LoginContainer = ({
9435
9554
  });
9436
9555
 
9437
9556
  case RESET_LOGIN_FORM:
9438
- return initialState$g;
9557
+ return initialState$h;
9439
9558
 
9440
9559
  case DISABLE_LOGIN_BUTTON:
9441
9560
  return lib_7({ ...state,
@@ -9453,12 +9572,12 @@ const LoginContainer = ({
9453
9572
  default:
9454
9573
  return state;
9455
9574
  }
9456
- }, initialState$g);
9575
+ }, initialState$h);
9457
9576
  return /*#__PURE__*/React__default.createElement("div", {
9458
9577
  style: { ...style
9459
9578
  },
9460
9579
  className: `pelcro-container pelcro-login-container ${className}`
9461
- }, /*#__PURE__*/React__default.createElement(Provider$g, {
9580
+ }, /*#__PURE__*/React__default.createElement(Provider$h, {
9462
9581
  value: {
9463
9582
  state,
9464
9583
  dispatch
@@ -9466,12 +9585,12 @@ const LoginContainer = ({
9466
9585
  }, children.length ? children.map((child, i) => {
9467
9586
  if (child) {
9468
9587
  return /*#__PURE__*/React__default.cloneElement(child, {
9469
- store: store$g,
9588
+ store: store$h,
9470
9589
  key: i
9471
9590
  });
9472
9591
  }
9473
9592
  }) : /*#__PURE__*/React__default.cloneElement(children, {
9474
- store: store$g
9593
+ store: store$h
9475
9594
  })));
9476
9595
  };
9477
9596
 
@@ -9716,7 +9835,7 @@ const LoginButton = ({
9716
9835
  buttonDisabled
9717
9836
  },
9718
9837
  dispatch
9719
- } = useContext(store$g);
9838
+ } = useContext(store$h);
9720
9839
  const {
9721
9840
  t
9722
9841
  } = useTranslation("login");
@@ -9737,23 +9856,23 @@ const LoginButton = ({
9737
9856
  };
9738
9857
 
9739
9858
  const LoginEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
9740
- store: store$g
9859
+ store: store$h
9741
9860
  }, props));
9742
9861
 
9743
9862
  const LoginPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
9744
- store: store$g
9863
+ store: store$h
9745
9864
  }, props));
9746
9865
 
9747
- var _path$q;
9866
+ var _path$r;
9748
9867
 
9749
- 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); }
9868
+ 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); }
9750
9869
 
9751
9870
  function SvgCheck(props) {
9752
- return /*#__PURE__*/React.createElement("svg", _extends$s({
9871
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
9753
9872
  xmlns: "http://www.w3.org/2000/svg",
9754
9873
  fill: "currentColor",
9755
9874
  viewBox: "0 0 20 20"
9756
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
9875
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
9757
9876
  fillRule: "evenodd",
9758
9877
  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",
9759
9878
  clipRule: "evenodd"
@@ -9818,7 +9937,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9818
9937
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9819
9938
  facebookLoginRenderProps.FacebookLogin;
9820
9939
 
9821
- const initialState$f = {
9940
+ const initialState$g = {
9822
9941
  email: "",
9823
9942
  password: "",
9824
9943
  emailError: null,
@@ -9835,10 +9954,10 @@ const initialState$f = {
9835
9954
  content: ""
9836
9955
  }
9837
9956
  };
9838
- const store$f = /*#__PURE__*/createContext(initialState$f);
9957
+ const store$g = /*#__PURE__*/createContext(initialState$g);
9839
9958
  const {
9840
- Provider: Provider$f
9841
- } = store$f;
9959
+ Provider: Provider$g
9960
+ } = store$g;
9842
9961
 
9843
9962
  const RegisterContainer = ({
9844
9963
  style,
@@ -10021,7 +10140,7 @@ const RegisterContainer = ({
10021
10140
  });
10022
10141
 
10023
10142
  case RESET_LOGIN_FORM:
10024
- return initialState$f;
10143
+ return initialState$g;
10025
10144
 
10026
10145
  case DISABLE_REGISTRATION_BUTTON:
10027
10146
  return lib_7({ ...state,
@@ -10039,12 +10158,12 @@ const RegisterContainer = ({
10039
10158
  default:
10040
10159
  return state;
10041
10160
  }
10042
- }, initialState$f);
10161
+ }, initialState$g);
10043
10162
  return /*#__PURE__*/React__default.createElement("div", {
10044
10163
  style: { ...style
10045
10164
  },
10046
10165
  className: `pelcro-container pelcro-register-container ${className}`
10047
- }, /*#__PURE__*/React__default.createElement(Provider$f, {
10166
+ }, /*#__PURE__*/React__default.createElement(Provider$g, {
10048
10167
  value: {
10049
10168
  state,
10050
10169
  dispatch
@@ -10052,12 +10171,12 @@ const RegisterContainer = ({
10052
10171
  }, children.length ? children.map((child, i) => {
10053
10172
  if (child) {
10054
10173
  return /*#__PURE__*/React__default.cloneElement(child, {
10055
- store: store$f,
10174
+ store: store$g,
10056
10175
  key: i
10057
10176
  });
10058
10177
  }
10059
10178
  }) : /*#__PURE__*/React__default.cloneElement(children, {
10060
- store: store$f
10179
+ store: store$g
10061
10180
  })));
10062
10181
  };
10063
10182
  /**
@@ -10072,15 +10191,15 @@ function hasSecurityTokenEnabled$1() {
10072
10191
  return hasSecuritySdkLoaded;
10073
10192
  }
10074
10193
 
10075
- var _path$p;
10194
+ var _path$q;
10076
10195
 
10077
- 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); }
10196
+ 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); }
10078
10197
 
10079
10198
  function SvgFacebookLogo(props) {
10080
- return /*#__PURE__*/React.createElement("svg", _extends$r({
10199
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
10081
10200
  xmlns: "http://www.w3.org/2000/svg",
10082
10201
  viewBox: "88.428 12.828 107.543 207.085"
10083
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10202
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10084
10203
  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",
10085
10204
  fill: "#3c5a9a"
10086
10205
  })));
@@ -10097,10 +10216,10 @@ const FacebookLoginButton = ({
10097
10216
  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;
10098
10217
  const {
10099
10218
  dispatch: loginDispatch
10100
- } = useContext(store$g);
10219
+ } = useContext(store$h);
10101
10220
  const {
10102
10221
  dispatch: registerDispatch
10103
- } = useContext(store$f);
10222
+ } = useContext(store$g);
10104
10223
 
10105
10224
  const onSuccess = facebookUser => {
10106
10225
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10153,15 +10272,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10153
10272
  unwrapExports(googleLogin);
10154
10273
  var googleLogin_1 = googleLogin.GoogleLogin;
10155
10274
 
10156
- var _path$o, _path2$3, _path3$1, _path4;
10275
+ var _path$p, _path2$3, _path3$1, _path4;
10157
10276
 
10158
- 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); }
10277
+ 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); }
10159
10278
 
10160
10279
  function SvgGoogleLogo(props) {
10161
- return /*#__PURE__*/React.createElement("svg", _extends$q({
10280
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
10162
10281
  viewBox: "0 0 24 24",
10163
10282
  xmlns: "http://www.w3.org/2000/svg"
10164
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10283
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10165
10284
  fill: "#4285F4",
10166
10285
  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"
10167
10286
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
@@ -10187,10 +10306,10 @@ const GoogleLoginButton = ({
10187
10306
  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;
10188
10307
  const {
10189
10308
  dispatch: loginDispatch
10190
- } = useContext(store$g);
10309
+ } = useContext(store$h);
10191
10310
  const {
10192
10311
  dispatch: registerDispatch
10193
- } = useContext(store$f);
10312
+ } = useContext(store$g);
10194
10313
 
10195
10314
  const onSuccess = response => {
10196
10315
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10238,15 +10357,15 @@ const GoogleLoginButton = ({
10238
10357
  }) : null;
10239
10358
  };
10240
10359
 
10241
- var _path$n;
10360
+ var _path$o;
10242
10361
 
10243
- 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); }
10362
+ 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); }
10244
10363
 
10245
10364
  function SvgAuth0Logo(props) {
10246
- return /*#__PURE__*/React.createElement("svg", _extends$p({
10365
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
10247
10366
  viewBox: "0 0 256 285",
10248
10367
  xmlns: "http://www.w3.org/2000/svg"
10249
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10368
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10250
10369
  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"
10251
10370
  })));
10252
10371
  }
@@ -10258,26 +10377,43 @@ const Auth0LoginButton = ({
10258
10377
  iconClassName = ""
10259
10378
  }) => {
10260
10379
  const auth0Enabled = Boolean(window.Pelcro.site.read().auth0_client_id && window.Pelcro.site.read().auth0_base_url);
10380
+ const auth0Script = document.querySelector("#auth0-sdk");
10381
+ const [auth0Loaded, setAuth0Loaded] = useState(Boolean(window.auth0));
10382
+ React__default.useEffect(() => {
10383
+ function handleScriptLoaded() {
10384
+ setAuth0Loaded(true);
10385
+ }
10386
+
10387
+ if (auth0Enabled && !auth0Loaded) {
10388
+ auth0Script.addEventListener("load", handleScriptLoaded);
10389
+ }
10390
+
10391
+ return () => {
10392
+ var _auth0Script$removeEv;
10393
+
10394
+ auth0Script === null || auth0Script === void 0 ? void 0 : (_auth0Script$removeEv = auth0Script.removeEventListener) === null || _auth0Script$removeEv === void 0 ? void 0 : _auth0Script$removeEv.call(auth0Script, "load", handleScriptLoaded);
10395
+ };
10396
+ }, [auth0Script, auth0Enabled, auth0Loaded]);
10261
10397
  const auth0InstanceRef = React__default.useRef(null);
10262
10398
  React__default.useEffect(() => {
10263
- if (auth0Enabled && window.auth0 && auth0InstanceRef.current === null) {
10399
+ if (auth0Enabled && auth0Loaded && auth0InstanceRef.current === null) {
10264
10400
  auth0InstanceRef.current = new window.auth0.WebAuth({
10265
10401
  domain: window.Pelcro.site.read().auth0_base_url,
10266
10402
  clientID: window.Pelcro.site.read().auth0_client_id
10267
10403
  });
10268
10404
  }
10269
- }, [auth0Enabled, window.auth0]);
10405
+ }, [auth0Enabled, auth0Loaded]);
10270
10406
  const {
10271
10407
  dispatch: loginDispatch
10272
- } = useContext(store$g);
10408
+ } = useContext(store$h);
10273
10409
  const {
10274
10410
  dispatch: registerDispatch
10275
- } = useContext(store$f);
10411
+ } = useContext(store$g);
10276
10412
 
10277
10413
  function handleClick() {
10278
10414
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
10279
10415
 
10280
- if (!window.auth0) {
10416
+ if (!auth0Loaded) {
10281
10417
  return console.error("Auth0 sdk script wasn't loaded, you need to load auth0 sdk before rendering the Auth0LoginButton");
10282
10418
  }
10283
10419
 
@@ -10405,15 +10541,15 @@ function LoginView(props) {
10405
10541
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10406
10542
  }
10407
10543
 
10408
- var _path$m, _path2$2, _path3;
10544
+ var _path$n, _path2$2, _path3;
10409
10545
 
10410
- 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); }
10546
+ 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); }
10411
10547
 
10412
10548
  function SvgPelcroAuthorship(props) {
10413
- return /*#__PURE__*/React.createElement("svg", _extends$o({
10549
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
10414
10550
  xmlns: "http://www.w3.org/2000/svg",
10415
10551
  viewBox: "0 -80.652 497.072 179.991"
10416
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
10552
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10417
10553
  fill: "none",
10418
10554
  stroke: "#4a4a4a",
10419
10555
  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"
@@ -10560,11 +10696,11 @@ function LoginModal({
10560
10696
  LoginModal.viewId = "login";
10561
10697
 
10562
10698
  const RegisterEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
10563
- store: store$f
10699
+ store: store$g
10564
10700
  }, props));
10565
10701
 
10566
10702
  const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
10567
- store: store$f
10703
+ store: store$g
10568
10704
  }, props));
10569
10705
 
10570
10706
  const RegisterButton = ({
@@ -10584,7 +10720,7 @@ const RegisterButton = ({
10584
10720
  buttonDisabled
10585
10721
  },
10586
10722
  dispatch
10587
- } = useContext(store$f);
10723
+ } = useContext(store$g);
10588
10724
  const {
10589
10725
  t
10590
10726
  } = useTranslation("register");
@@ -10722,7 +10858,7 @@ function FirstName({
10722
10858
  }
10723
10859
 
10724
10860
  const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
10725
- store: store$f
10861
+ store: store$g
10726
10862
  }, props));
10727
10863
 
10728
10864
  function LastName({
@@ -10753,7 +10889,7 @@ function LastName({
10753
10889
  }
10754
10890
 
10755
10891
  const RegisterLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
10756
- store: store$f
10892
+ store: store$g
10757
10893
  }, props));
10758
10894
 
10759
10895
  /**
@@ -10877,7 +11013,7 @@ function TextInput({
10877
11013
 
10878
11014
  const RegisterTextInput = props => {
10879
11015
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
10880
- store: store$f
11016
+ store: store$g
10881
11017
  }));
10882
11018
  };
10883
11019
 
@@ -12546,7 +12682,8 @@ const SUBSCRIPTION_TYPES = {
12546
12682
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12547
12683
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12548
12684
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12549
- RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION"
12685
+ RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12686
+ PAY_INVOICE: "PAY_INVOICE"
12550
12687
  };
12551
12688
 
12552
12689
  var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
@@ -12608,6 +12745,7 @@ class Subscription {
12608
12745
  * @property {number} [subscriptionIdToRenew]
12609
12746
  * @property {number} [quantity]
12610
12747
  * @property {string} addressId
12748
+ * @property {number} invoiceId
12611
12749
  */
12612
12750
 
12613
12751
  /**
@@ -12648,6 +12786,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12648
12786
 
12649
12787
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12650
12788
 
12789
+ var _payInvoice = /*#__PURE__*/new WeakMap();
12790
+
12651
12791
  class StripeGateway {
12652
12792
  constructor() {
12653
12793
  _paymentGateway.set(this, {
@@ -12671,6 +12811,9 @@ class StripeGateway {
12671
12811
  case types.RENEW_GIFTED_SUBSCRIPTION:
12672
12812
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12673
12813
 
12814
+ case types.PAY_INVOICE:
12815
+ return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12816
+
12674
12817
  default:
12675
12818
  console.error("Unsupported subscriptiion method: Stripe Gateway");
12676
12819
  }
@@ -12779,6 +12922,23 @@ class StripeGateway {
12779
12922
  });
12780
12923
  }
12781
12924
  });
12925
+
12926
+ _payInvoice.set(this, {
12927
+ writable: true,
12928
+ value: (options, callback) => {
12929
+ const {
12930
+ token,
12931
+ invoiceId
12932
+ } = options;
12933
+ window.Pelcro.invoice.pay({
12934
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
12935
+ gateway_token: token,
12936
+ invoice_id: invoiceId
12937
+ }, (err, res) => {
12938
+ callback(err, res);
12939
+ });
12940
+ }
12941
+ });
12782
12942
  }
12783
12943
 
12784
12944
  }
@@ -12792,6 +12952,8 @@ var _createSubscription2 = /*#__PURE__*/new WeakMap();
12792
12952
 
12793
12953
  var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12794
12954
 
12955
+ var _payInvoice2 = /*#__PURE__*/new WeakMap();
12956
+
12795
12957
  class PaypalGateWay {
12796
12958
  constructor() {
12797
12959
  _paymentGateway2.set(this, {
@@ -12809,6 +12971,9 @@ class PaypalGateWay {
12809
12971
  case types.CREATE_GIFTED_SUBSCRIPTION:
12810
12972
  return _classPrivateFieldGet(this, _createGiftedSubscription2).call(this, options, callback);
12811
12973
 
12974
+ case types.PAY_INVOICE:
12975
+ return _classPrivateFieldGet(this, _payInvoice2).call(this, options, callback);
12976
+
12812
12977
  default:
12813
12978
  console.error("Unsupported subscriptiion method: PayPal Gateway");
12814
12979
  }
@@ -12869,6 +13034,23 @@ class PaypalGateWay {
12869
13034
  });
12870
13035
  }
12871
13036
  });
13037
+
13038
+ _payInvoice2.set(this, {
13039
+ writable: true,
13040
+ value: (options, callback) => {
13041
+ const {
13042
+ token,
13043
+ invoiceId
13044
+ } = options;
13045
+ window.Pelcro.invoice.pay({
13046
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
13047
+ gateway_token: token,
13048
+ invoice_id: invoiceId
13049
+ }, (err, res) => {
13050
+ callback(err, res);
13051
+ });
13052
+ }
13053
+ });
12872
13054
  }
12873
13055
 
12874
13056
  }
@@ -12893,7 +13075,7 @@ class PaypalGateWay {
12893
13075
 
12894
13076
  /** @type {PaymentStateType} */
12895
13077
 
12896
- const initialState$e = {
13078
+ const initialState$f = {
12897
13079
  disableSubmit: false,
12898
13080
  isLoading: false,
12899
13081
  disableCouponButton: false,
@@ -12912,10 +13094,10 @@ const initialState$e = {
12912
13094
  content: ""
12913
13095
  }
12914
13096
  };
12915
- const store$e = /*#__PURE__*/createContext(initialState$e);
13097
+ const store$f = /*#__PURE__*/createContext(initialState$f);
12916
13098
  const {
12917
- Provider: Provider$e
12918
- } = store$e;
13099
+ Provider: Provider$f
13100
+ } = store$f;
12919
13101
 
12920
13102
  const PaymentMethodContainerWithoutStripe = ({
12921
13103
  style,
@@ -12928,7 +13110,7 @@ const PaymentMethodContainerWithoutStripe = ({
12928
13110
  onFailure = () => {},
12929
13111
  ...props
12930
13112
  }) => {
12931
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift;
13113
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
12932
13114
 
12933
13115
  const {
12934
13116
  t
@@ -12945,6 +13127,7 @@ const PaymentMethodContainerWithoutStripe = ({
12945
13127
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
12946
13128
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
12947
13129
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13130
+ const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
12948
13131
  useEffect(() => {
12949
13132
  if (window.Pelcro.coupon.getFromUrl()) {
12950
13133
  dispatch({
@@ -13513,6 +13696,40 @@ const PaymentMethodContainerWithoutStripe = ({
13513
13696
  });
13514
13697
  };
13515
13698
 
13699
+ const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13700
+ const subscription = new Subscription(gatewayService);
13701
+ return subscription.execute({
13702
+ type: SUBSCRIPTION_TYPES.PAY_INVOICE,
13703
+ token: gatewayToken,
13704
+ invoiceId: invoice.id
13705
+ }, (err, res) => {
13706
+ dispatch({
13707
+ type: DISABLE_SUBMIT,
13708
+ payload: false
13709
+ });
13710
+ dispatch({
13711
+ type: LOADING,
13712
+ payload: false
13713
+ });
13714
+
13715
+ if (err) {
13716
+ onFailure(err);
13717
+ return dispatch({
13718
+ type: SHOW_ALERT,
13719
+ payload: {
13720
+ type: "error",
13721
+ content: getErrorMessages(err)
13722
+ }
13723
+ });
13724
+ }
13725
+
13726
+ set({
13727
+ invoice: null
13728
+ });
13729
+ onSuccess(res);
13730
+ });
13731
+ };
13732
+
13516
13733
  const updatePaymentSource = (state, dispatch) => {
13517
13734
  return stripe.createSource({
13518
13735
  type: "card"
@@ -13587,13 +13804,17 @@ const PaymentMethodContainerWithoutStripe = ({
13587
13804
  source,
13588
13805
  error
13589
13806
  }) => {
13590
- var _ref, _state$updatedPrice, _source$card3;
13807
+ var _ref, _ref2, _state$updatedPrice, _source$card3;
13591
13808
 
13592
13809
  if (error) {
13593
13810
  return handlePaymentError(error);
13594
13811
  }
13595
13812
 
13596
13813
  const getOrderItemsTotal = () => {
13814
+ if (!order) {
13815
+ return null;
13816
+ }
13817
+
13597
13818
  const isQuickPurchase = !Array.isArray(order);
13598
13819
 
13599
13820
  if (isQuickPurchase) {
@@ -13609,7 +13830,7 @@ const PaymentMethodContainerWithoutStripe = ({
13609
13830
  }, 0);
13610
13831
  };
13611
13832
 
13612
- const totalAmount = (_ref = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13833
+ const totalAmount = (_ref = (_ref2 = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13613
13834
 
13614
13835
  if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
13615
13836
  return resolveTaxCalculation().then(res => {
@@ -13642,6 +13863,10 @@ const PaymentMethodContainerWithoutStripe = ({
13642
13863
  const resolveTaxCalculation = () => {
13643
13864
  var _window$Pelcro$site$r2;
13644
13865
 
13866
+ if (type === "invoicePayment") {
13867
+ return new Promise(resolve => resolve());
13868
+ }
13869
+
13645
13870
  const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
13646
13871
  return new Promise((resolve, reject) => {
13647
13872
  // resolve early if taxes isn't enabled
@@ -13715,6 +13940,8 @@ const PaymentMethodContainerWithoutStripe = ({
13715
13940
  subscribe(stripeSource, state, dispatch);
13716
13941
  } else if (stripeSource && type === "orderCreate") {
13717
13942
  purchase(stripeSource, state, dispatch);
13943
+ } else if (stripeSource && type === "invoicePayment") {
13944
+ payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13718
13945
  }
13719
13946
  };
13720
13947
 
@@ -13848,7 +14075,13 @@ const PaymentMethodContainerWithoutStripe = ({
13848
14075
  });
13849
14076
 
13850
14077
  case HANDLE_PAYPAL_SUBSCRIPTION:
13851
- return lib_5(state, () => handlePaypalSubscription(state, action.payload));
14078
+ return lib_5(state, (state, dispatch) => {
14079
+ if (type === "invoicePayment") {
14080
+ payInvoice(new PaypalGateWay(), action.payload, dispatch);
14081
+ } else {
14082
+ handlePaypalSubscription(state, action.payload);
14083
+ }
14084
+ });
13852
14085
 
13853
14086
  case SET_UPDATED_PRICE:
13854
14087
  return lib_7({ ...state,
@@ -13906,21 +14139,21 @@ const PaymentMethodContainerWithoutStripe = ({
13906
14139
  default:
13907
14140
  return state;
13908
14141
  }
13909
- }, initialState$e);
14142
+ }, initialState$f);
13910
14143
  return /*#__PURE__*/React__default.createElement("div", {
13911
14144
  style: { ...style
13912
14145
  },
13913
14146
  className: `pelcro-container pelcro-payment-container ${className}`
13914
- }, /*#__PURE__*/React__default.createElement(Provider$e, {
14147
+ }, /*#__PURE__*/React__default.createElement(Provider$f, {
13915
14148
  value: {
13916
14149
  state,
13917
14150
  dispatch
13918
14151
  }
13919
14152
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
13920
- store: store$e,
14153
+ store: store$f,
13921
14154
  key: i
13922
14155
  })) : /*#__PURE__*/React__default.cloneElement(children, {
13923
- store: store$e
14156
+ store: store$f
13924
14157
  })));
13925
14158
  };
13926
14159
 
@@ -13942,7 +14175,7 @@ const PaymentMethodContainer = props => {
13942
14175
  stripeAccount: window.Pelcro.site.read().account_id,
13943
14176
  locale: getPageOrDefaultLanguage()
13944
14177
  }, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
13945
- store: store$e
14178
+ store: store$f
13946
14179
  }, props))));
13947
14180
  }
13948
14181
 
@@ -13995,7 +14228,7 @@ const PelcroPaymentRequestButton = props => {
13995
14228
  currentPlan,
13996
14229
  updatedPrice
13997
14230
  }
13998
- } = useContext(store$e);
14231
+ } = useContext(store$f);
13999
14232
 
14000
14233
  const updatePaymentRequest = () => {
14001
14234
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14055,7 +14288,7 @@ const DiscountedPrice = props => {
14055
14288
  taxAmount,
14056
14289
  percentOff
14057
14290
  }
14058
- } = useContext(store$e);
14291
+ } = useContext(store$f);
14059
14292
  const {
14060
14293
  order,
14061
14294
  plan
@@ -14105,7 +14338,7 @@ const SubmitPaymentMethod = ({
14105
14338
  isLoading,
14106
14339
  updatedPrice
14107
14340
  }
14108
- } = useContext(store$e);
14341
+ } = useContext(store$f);
14109
14342
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14110
14343
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14111
14344
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14126,17 +14359,17 @@ const SubmitPaymentMethod = ({
14126
14359
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14127
14360
  };
14128
14361
 
14129
- var _path$l;
14362
+ var _path$m;
14130
14363
 
14131
- 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); }
14364
+ 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); }
14132
14365
 
14133
14366
  function SvgArrowLeft(props) {
14134
- return /*#__PURE__*/React.createElement("svg", _extends$n({
14367
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
14135
14368
  xmlns: "http://www.w3.org/2000/svg",
14136
14369
  fill: "none",
14137
14370
  viewBox: "0 0 24 24",
14138
14371
  stroke: "currentColor"
14139
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14372
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
14140
14373
  strokeLinecap: "round",
14141
14374
  strokeLinejoin: "round",
14142
14375
  strokeWidth: 2,
@@ -14155,7 +14388,7 @@ const ApplyCouponButton = ({
14155
14388
  disableCouponButton
14156
14389
  },
14157
14390
  dispatch
14158
- } = useContext(store$e);
14391
+ } = useContext(store$f);
14159
14392
  const {
14160
14393
  t
14161
14394
  } = useTranslation("checkoutForm");
@@ -14189,7 +14422,7 @@ const CouponCodeField = props => {
14189
14422
  couponCode,
14190
14423
  couponError
14191
14424
  }
14192
- } = useContext(store$e);
14425
+ } = useContext(store$f);
14193
14426
 
14194
14427
  const onCouponCodeChange = e => {
14195
14428
  dispatch({
@@ -14218,17 +14451,17 @@ const CouponCodeField = props => {
14218
14451
  }, props));
14219
14452
  };
14220
14453
 
14221
- var _path$k;
14454
+ var _path$l;
14222
14455
 
14223
- 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); }
14456
+ 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); }
14224
14457
 
14225
14458
  function SvgTicket(props) {
14226
- return /*#__PURE__*/React.createElement("svg", _extends$m({
14459
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
14227
14460
  xmlns: "http://www.w3.org/2000/svg",
14228
14461
  fill: "none",
14229
14462
  viewBox: "0 0 24 24",
14230
14463
  stroke: "currentColor"
14231
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14464
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14232
14465
  strokeLinecap: "round",
14233
14466
  strokeLinejoin: "round",
14234
14467
  strokeWidth: 2,
@@ -14245,7 +14478,7 @@ const CouponCode = ({
14245
14478
  state: {
14246
14479
  enableCouponField
14247
14480
  }
14248
- } = useContext(store$e);
14481
+ } = useContext(store$f);
14249
14482
  const {
14250
14483
  t
14251
14484
  } = useTranslation("checkoutForm");
@@ -14502,17 +14735,18 @@ const PaypalSubscribeButton = props => {
14502
14735
  const {
14503
14736
  dispatch,
14504
14737
  state
14505
- } = useContext(store$e);
14738
+ } = useContext(store$f);
14506
14739
  const {
14507
14740
  product,
14508
14741
  plan,
14742
+ invoice,
14509
14743
  selectedAddressId
14510
14744
  } = usePelcro();
14511
14745
  useEffect(() => {
14512
- var _ref, _state$updatedPrice, _props$plan, _props$selectedAddres;
14746
+ var _ref, _ref2, _state$updatedPrice, _props$plan, _props$selectedAddres;
14513
14747
 
14514
14748
  // sometimes, price is updated. eg. Coupon codes.
14515
- const updatedPrice = (_ref = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref !== void 0 ? _ref : plan.amount;
14749
+ const updatedPrice = (_ref = (_ref2 = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref2 !== void 0 ? _ref2 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref !== void 0 ? _ref : invoice.amount_remaining;
14516
14750
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
14517
14751
 
14518
14752
  const initializePaypal = async () => {
@@ -14521,7 +14755,7 @@ const PaypalSubscribeButton = props => {
14521
14755
  const paypalCheckoutInstance = new PaypalClient({
14522
14756
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
14523
14757
  style: props.buttonStyle,
14524
- enableShippingAddress: (_props$product$addres = (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.address_required) !== null && _props$product$addres !== void 0 ? _props$product$addres : product.address_required,
14758
+ enableShippingAddress: (_props$product$addres = (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.address_required) !== null && _props$product$addres !== void 0 ? _props$product$addres : product === null || product === void 0 ? void 0 : product.address_required,
14525
14759
  shippingAddressEditable: props.makeAddressEditable,
14526
14760
  displayName: props.merchantDisplayName,
14527
14761
  locale: props.locale,
@@ -14531,9 +14765,9 @@ const PaypalSubscribeButton = props => {
14531
14765
  await paypalCheckoutInstance.build(); // Create paypal payment
14532
14766
 
14533
14767
  paypalCheckoutInstance.createPayment({
14534
- product: (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14768
+ product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14535
14769
  amount: updatedPrice,
14536
- address: selectedAddress,
14770
+ address: invoice ? null : selectedAddress,
14537
14771
  onButtonClick: () => {
14538
14772
  dispatch({
14539
14773
  type: DISABLE_SUBMIT,
@@ -14587,16 +14821,16 @@ const BankRedirection = () => {
14587
14821
  }));
14588
14822
  };
14589
14823
 
14590
- var _path$j;
14824
+ var _path$k;
14591
14825
 
14592
- 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); }
14826
+ 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); }
14593
14827
 
14594
14828
  function SvgLock(props) {
14595
- return /*#__PURE__*/React.createElement("svg", _extends$l({
14829
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
14596
14830
  xmlns: "http://www.w3.org/2000/svg",
14597
14831
  viewBox: "0 0 20 20",
14598
14832
  fill: "currentColor"
14599
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
14833
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14600
14834
  fillRule: "evenodd",
14601
14835
  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",
14602
14836
  clipRule: "evenodd"
@@ -14613,7 +14847,7 @@ const SelectedPaymentMethod = () => {
14613
14847
  state: {
14614
14848
  isLoading
14615
14849
  }
14616
- } = useContext(store$e);
14850
+ } = useContext(store$f);
14617
14851
  const {
14618
14852
  switchView,
14619
14853
  selectedPaymentMethodId
@@ -14655,7 +14889,7 @@ const TaxAmount = () => {
14655
14889
  state: {
14656
14890
  taxAmount
14657
14891
  }
14658
- } = useContext(store$e);
14892
+ } = useContext(store$f);
14659
14893
  const {
14660
14894
  plan
14661
14895
  } = usePelcro();
@@ -14818,12 +15052,12 @@ function SubscriptionRenewModal({
14818
15052
  }
14819
15053
  SubscriptionRenewModal.viewId = "subscription-renew";
14820
15054
 
14821
- var _path$i;
15055
+ var _path$j;
14822
15056
 
14823
- 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); }
15057
+ 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); }
14824
15058
 
14825
15059
  function SvgGift(props) {
14826
- return /*#__PURE__*/React.createElement("svg", _extends$k({
15060
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
14827
15061
  className: "plc-w-6 plc-h-6 plc-mr-2",
14828
15062
  fill: "none",
14829
15063
  stroke: "currentColor",
@@ -14832,7 +15066,7 @@ function SvgGift(props) {
14832
15066
  strokeWidth: 2,
14833
15067
  viewBox: "0 0 24 24",
14834
15068
  xmlns: "http://www.w3.org/2000/svg"
14835
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
15069
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
14836
15070
  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"
14837
15071
  })));
14838
15072
  }
@@ -14870,10 +15104,13 @@ const getCurrentFlow = () => {
14870
15104
  const {
14871
15105
  product,
14872
15106
  giftRecipient,
14873
- giftCode
15107
+ giftCode,
15108
+ invoice
14874
15109
  } = usePelcro.getStore();
14875
15110
 
14876
- if (giftRecipient) {
15111
+ if (invoice) {
15112
+ return "invoicePayment";
15113
+ } else if (giftRecipient) {
14877
15114
  return "giftCreate";
14878
15115
  } else if (giftCode) {
14879
15116
  return "giftRedeem";
@@ -14910,6 +15147,13 @@ const getSuccessContent = i18n => {
14910
15147
  }),
14911
15148
  successTitle: i18n("messages.giftRedeem.title"),
14912
15149
  successContent: i18n("messages.giftRedeem.content")
15150
+ },
15151
+ invoicePayment: {
15152
+ successIcon: /*#__PURE__*/React__default.createElement(SvgCheckSolid, {
15153
+ className: "plc-w-32 plc-my-4 plc-text-green-500"
15154
+ }),
15155
+ successTitle: i18n("messages.invoicePayment.title"),
15156
+ successContent: i18n("messages.invoicePayment.title")
14913
15157
  }
14914
15158
  };
14915
15159
  return wordingDictionary[flow];
@@ -15163,7 +15407,7 @@ class DefaultNewsLetter extends Component {
15163
15407
 
15164
15408
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15165
15409
 
15166
- const initialState$d = {
15410
+ const initialState$e = {
15167
15411
  didSubToNewslettersBefore: false,
15168
15412
  newsletters: [],
15169
15413
  isListLoading: true,
@@ -15173,10 +15417,10 @@ const initialState$d = {
15173
15417
  content: ""
15174
15418
  }
15175
15419
  };
15176
- const store$d = /*#__PURE__*/createContext(initialState$d);
15420
+ const store$e = /*#__PURE__*/createContext(initialState$e);
15177
15421
  const {
15178
- Provider: Provider$d
15179
- } = store$d;
15422
+ Provider: Provider$e
15423
+ } = store$e;
15180
15424
 
15181
15425
  const NewsletterUpdateContainer = ({
15182
15426
  style,
@@ -15289,7 +15533,7 @@ const NewsletterUpdateContainer = ({
15289
15533
  default:
15290
15534
  return state;
15291
15535
  }
15292
- }, initialState$d);
15536
+ }, initialState$e);
15293
15537
  useEffect(() => {
15294
15538
  const getUserNewsletters = () => {
15295
15539
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15333,7 +15577,7 @@ const NewsletterUpdateContainer = ({
15333
15577
  style: { ...style
15334
15578
  },
15335
15579
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15336
- }, /*#__PURE__*/React__default.createElement(Provider$d, {
15580
+ }, /*#__PURE__*/React__default.createElement(Provider$e, {
15337
15581
  value: {
15338
15582
  state,
15339
15583
  dispatch
@@ -15341,12 +15585,12 @@ const NewsletterUpdateContainer = ({
15341
15585
  }, children.length ? children.map((child, i) => {
15342
15586
  if (child) {
15343
15587
  return /*#__PURE__*/React__default.cloneElement(child, {
15344
- store: store$d,
15588
+ store: store$e,
15345
15589
  key: i
15346
15590
  });
15347
15591
  }
15348
15592
  }) : /*#__PURE__*/React__default.cloneElement(children, {
15349
- store: store$d
15593
+ store: store$e
15350
15594
  })));
15351
15595
  };
15352
15596
 
@@ -15361,7 +15605,7 @@ const NewsletterUpdateButton = ({
15361
15605
  isSubmitting,
15362
15606
  isListLoading
15363
15607
  }
15364
- } = useContext(store$d);
15608
+ } = useContext(store$e);
15365
15609
  const {
15366
15610
  t
15367
15611
  } = useTranslation("newsletter");
@@ -15391,7 +15635,7 @@ const NewsletterUpdateList = () => {
15391
15635
  newsletters,
15392
15636
  isListLoading
15393
15637
  }
15394
- } = useContext(store$d);
15638
+ } = useContext(store$e);
15395
15639
 
15396
15640
  if (isListLoading) {
15397
15641
  return /*#__PURE__*/React__default.createElement(Loader, {
@@ -15595,7 +15839,7 @@ function SubscriptionCreateModal({
15595
15839
  SubscriptionCreateModal.viewId = "subscription-create";
15596
15840
 
15597
15841
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15598
- const initialState$c = {
15842
+ const initialState$d = {
15599
15843
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15600
15844
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15601
15845
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15608,10 +15852,10 @@ const initialState$c = {
15608
15852
  content: ""
15609
15853
  }
15610
15854
  };
15611
- const store$c = /*#__PURE__*/createContext(initialState$c);
15855
+ const store$d = /*#__PURE__*/createContext(initialState$d);
15612
15856
  const {
15613
- Provider: Provider$c
15614
- } = store$c;
15857
+ Provider: Provider$d
15858
+ } = store$d;
15615
15859
 
15616
15860
  const UserUpdateContainer = ({
15617
15861
  style,
@@ -15743,27 +15987,27 @@ const UserUpdateContainer = ({
15743
15987
  default:
15744
15988
  return state;
15745
15989
  }
15746
- }, initialState$c);
15990
+ }, initialState$d);
15747
15991
  return /*#__PURE__*/React__default.createElement("div", {
15748
15992
  style: { ...style
15749
15993
  },
15750
15994
  className: `pelcro-container pelcro-user-update-container ${className}`
15751
- }, /*#__PURE__*/React__default.createElement(Provider$c, {
15995
+ }, /*#__PURE__*/React__default.createElement(Provider$d, {
15752
15996
  value: {
15753
15997
  state,
15754
15998
  dispatch
15755
15999
  }
15756
16000
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
15757
- store: store$c,
16001
+ store: store$d,
15758
16002
  key: i
15759
16003
  })) : /*#__PURE__*/React__default.cloneElement(children, {
15760
- store: store$c
16004
+ store: store$d
15761
16005
  })));
15762
16006
  };
15763
16007
 
15764
16008
  const UserUpdateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
15765
16009
  disabled: true,
15766
- store: store$c
16010
+ store: store$d
15767
16011
  }, props));
15768
16012
 
15769
16013
  const UserUpdateButton = ({
@@ -15776,7 +16020,7 @@ const UserUpdateButton = ({
15776
16020
  buttonDisabled
15777
16021
  },
15778
16022
  dispatch
15779
- } = useContext(store$c);
16023
+ } = useContext(store$d);
15780
16024
  const {
15781
16025
  t
15782
16026
  } = useTranslation("userEdit");
@@ -15793,11 +16037,11 @@ const UserUpdateButton = ({
15793
16037
  };
15794
16038
 
15795
16039
  const UserUpdateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
15796
- store: store$c
16040
+ store: store$d
15797
16041
  }, props));
15798
16042
 
15799
16043
  const UserUpdateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
15800
- store: store$c
16044
+ store: store$d
15801
16045
  }, props));
15802
16046
 
15803
16047
  function Phone({
@@ -15826,22 +16070,22 @@ function Phone({
15826
16070
  }
15827
16071
 
15828
16072
  const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone, Object.assign({
15829
- store: store$c
16073
+ store: store$d
15830
16074
  }, props));
15831
16075
 
15832
16076
  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";
15833
16077
 
15834
- var _path$h;
16078
+ var _path$i;
15835
16079
 
15836
- 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); }
16080
+ 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); }
15837
16081
 
15838
16082
  function SvgEdit(props) {
15839
- return /*#__PURE__*/React.createElement("svg", _extends$j({
16083
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
15840
16084
  className: "plc-w-6 plc-h-6",
15841
16085
  xmlns: "http://www.w3.org/2000/svg",
15842
16086
  viewBox: "0 0 20 20",
15843
16087
  fill: "currentColor"
15844
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
16088
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
15845
16089
  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"
15846
16090
  })));
15847
16091
  }
@@ -15973,16 +16217,16 @@ function DisplayName({
15973
16217
  }
15974
16218
 
15975
16219
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default.createElement(DisplayName, Object.assign({
15976
- store: store$c
16220
+ store: store$d
15977
16221
  }, props));
15978
16222
 
15979
16223
  const UserUpdateTextInput = props => {
15980
16224
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
15981
- store: store$c
16225
+ store: store$d
15982
16226
  }));
15983
16227
  };
15984
16228
 
15985
- const initialState$b = {
16229
+ const initialState$c = {
15986
16230
  isSubmitting: false,
15987
16231
  firstName: "",
15988
16232
  firstNameError: "",
@@ -16007,10 +16251,10 @@ const initialState$b = {
16007
16251
  content: ""
16008
16252
  }
16009
16253
  };
16010
- const store$b = /*#__PURE__*/createContext(initialState$b);
16254
+ const store$c = /*#__PURE__*/createContext(initialState$c);
16011
16255
  const {
16012
- Provider: Provider$b
16013
- } = store$b;
16256
+ Provider: Provider$c
16257
+ } = store$c;
16014
16258
 
16015
16259
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16016
16260
 
@@ -16217,7 +16461,7 @@ const AddressCreateContainer = ({
16217
16461
  default:
16218
16462
  return state;
16219
16463
  }
16220
- }, initialState$b);
16464
+ }, initialState$c);
16221
16465
  useEffect(() => {
16222
16466
  const getStates = () => {
16223
16467
  dispatch({
@@ -16249,16 +16493,16 @@ const AddressCreateContainer = ({
16249
16493
  style: { ...style
16250
16494
  },
16251
16495
  className: `pelcro-container pelcro-address-create-container ${className}`
16252
- }, /*#__PURE__*/React__default.createElement(Provider$b, {
16496
+ }, /*#__PURE__*/React__default.createElement(Provider$c, {
16253
16497
  value: {
16254
16498
  state,
16255
16499
  dispatch
16256
16500
  }
16257
16501
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
16258
- store: store$b,
16502
+ store: store$c,
16259
16503
  key: i
16260
16504
  })) : /*#__PURE__*/React__default.cloneElement(children, {
16261
- store: store$b
16505
+ store: store$c
16262
16506
  })));
16263
16507
  };
16264
16508
 
@@ -16269,7 +16513,7 @@ function AddressCreateFirstName(props) {
16269
16513
  firstName,
16270
16514
  firstNameError
16271
16515
  }
16272
- } = useContext(store$b);
16516
+ } = useContext(store$c);
16273
16517
 
16274
16518
  const handleBlur = () => {
16275
16519
  return dispatch({
@@ -16312,7 +16556,7 @@ function AddressCreateLastName(props) {
16312
16556
  lastName,
16313
16557
  lastNameError
16314
16558
  }
16315
- } = useContext(store$b);
16559
+ } = useContext(store$c);
16316
16560
 
16317
16561
  const handleBlur = () => {
16318
16562
  return dispatch({
@@ -16355,7 +16599,7 @@ function AddressCreateLine1(props) {
16355
16599
  line1,
16356
16600
  line1Error
16357
16601
  }
16358
- } = useContext(store$b);
16602
+ } = useContext(store$c);
16359
16603
 
16360
16604
  const handleBlur = () => {
16361
16605
  return dispatch({
@@ -16398,7 +16642,7 @@ function AddressCreateCity(props) {
16398
16642
  city,
16399
16643
  cityError
16400
16644
  }
16401
- } = useContext(store$b);
16645
+ } = useContext(store$c);
16402
16646
 
16403
16647
  const handleBlur = () => {
16404
16648
  return dispatch({
@@ -16441,7 +16685,7 @@ function AddressCreatePostalCode(props) {
16441
16685
  postalCode,
16442
16686
  postalCodeError
16443
16687
  }
16444
- } = useContext(store$b);
16688
+ } = useContext(store$c);
16445
16689
 
16446
16690
  const handleBlur = () => {
16447
16691
  return dispatch({
@@ -16487,7 +16731,7 @@ const AddressCreateSubmit = ({
16487
16731
  state: {
16488
16732
  isSubmitting
16489
16733
  }
16490
- } = useContext(store$b);
16734
+ } = useContext(store$c);
16491
16735
  const {
16492
16736
  t
16493
16737
  } = useTranslation("address");
@@ -16598,7 +16842,7 @@ function CountrySelect({
16598
16842
  }
16599
16843
 
16600
16844
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
16601
- store: store$b
16845
+ store: store$c
16602
16846
  }, props));
16603
16847
 
16604
16848
  function StateSelect({
@@ -16686,7 +16930,7 @@ function StateSelect({
16686
16930
  }
16687
16931
 
16688
16932
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
16689
- store: store$b
16933
+ store: store$c
16690
16934
  }, props));
16691
16935
 
16692
16936
  const AddressCreateView = props => {
@@ -16791,18 +17035,18 @@ AddressCreateModal.viewId = "address-create";
16791
17035
 
16792
17036
  const AddressCreateTextInput = props => {
16793
17037
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
16794
- store: store$b
17038
+ store: store$c
16795
17039
  }));
16796
17040
  };
16797
17041
 
16798
17042
  const AddressCreateLine2 = props => {
16799
17043
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
16800
17044
  fieldName: "line2",
16801
- store: store$b
17045
+ store: store$c
16802
17046
  }, props));
16803
17047
  };
16804
17048
 
16805
- const initialState$a = {
17049
+ const initialState$b = {
16806
17050
  isSubmitting: false,
16807
17051
  firstName: "",
16808
17052
  firstNameError: "",
@@ -16827,10 +17071,10 @@ const initialState$a = {
16827
17071
  content: ""
16828
17072
  }
16829
17073
  };
16830
- const store$a = /*#__PURE__*/createContext(initialState$a);
17074
+ const store$b = /*#__PURE__*/createContext(initialState$b);
16831
17075
  const {
16832
- Provider: Provider$a
16833
- } = store$a;
17076
+ Provider: Provider$b
17077
+ } = store$b;
16834
17078
 
16835
17079
  const AddressUpdateContainer = ({
16836
17080
  style,
@@ -16882,7 +17126,7 @@ const AddressUpdateContainer = ({
16882
17126
  const thisAddress = addresses[address];
16883
17127
 
16884
17128
  if (+thisAddress.id === +addressId) {
16885
- const newState = { ...initialState$a,
17129
+ const newState = { ...initialState$b,
16886
17130
  firstName: thisAddress.first_name,
16887
17131
  lastName: thisAddress.last_name,
16888
17132
  line1: thisAddress.line1,
@@ -17015,7 +17259,7 @@ const AddressUpdateContainer = ({
17015
17259
  default:
17016
17260
  return state;
17017
17261
  }
17018
- }, initialState$a);
17262
+ }, initialState$b);
17019
17263
  useEffect(() => {
17020
17264
  const getStates = () => {
17021
17265
  dispatch({
@@ -17047,21 +17291,21 @@ const AddressUpdateContainer = ({
17047
17291
  style: { ...style
17048
17292
  },
17049
17293
  className: `pelcro-container pelcro-address-update-container ${className}`
17050
- }, /*#__PURE__*/React__default.createElement(Provider$a, {
17294
+ }, /*#__PURE__*/React__default.createElement(Provider$b, {
17051
17295
  value: {
17052
17296
  state,
17053
17297
  dispatch
17054
17298
  }
17055
17299
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17056
- store: store$a,
17300
+ store: store$b,
17057
17301
  key: i
17058
17302
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17059
- store: store$a
17303
+ store: store$b
17060
17304
  })));
17061
17305
  };
17062
17306
 
17063
17307
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
17064
- store: store$a
17308
+ store: store$b
17065
17309
  }, props));
17066
17310
 
17067
17311
  function AddressUpdateFirstName(props) {
@@ -17071,7 +17315,7 @@ function AddressUpdateFirstName(props) {
17071
17315
  firstName,
17072
17316
  firstNameError
17073
17317
  }
17074
- } = useContext(store$a);
17318
+ } = useContext(store$b);
17075
17319
 
17076
17320
  const handleBlur = () => {
17077
17321
  return dispatch({
@@ -17114,7 +17358,7 @@ function AddressUpdateLastName(props) {
17114
17358
  lastName,
17115
17359
  lastNameError
17116
17360
  }
17117
- } = useContext(store$a);
17361
+ } = useContext(store$b);
17118
17362
 
17119
17363
  const handleBlur = () => {
17120
17364
  return dispatch({
@@ -17157,7 +17401,7 @@ function AddressUpdateLine1(props) {
17157
17401
  line1,
17158
17402
  line1Error
17159
17403
  }
17160
- } = useContext(store$a);
17404
+ } = useContext(store$b);
17161
17405
 
17162
17406
  const handleBlur = () => {
17163
17407
  return dispatch({
@@ -17197,7 +17441,7 @@ const AddressUpdateLine2 = props => {
17197
17441
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
17198
17442
  fieldName: "line2"
17199
17443
  }, props, {
17200
- store: store$a
17444
+ store: store$b
17201
17445
  }));
17202
17446
  };
17203
17447
 
@@ -17208,7 +17452,7 @@ function AddressUpdateCity(props) {
17208
17452
  city,
17209
17453
  cityError
17210
17454
  }
17211
- } = useContext(store$a);
17455
+ } = useContext(store$b);
17212
17456
 
17213
17457
  const handleBlur = () => {
17214
17458
  return dispatch({
@@ -17251,7 +17495,7 @@ function AddressUpdatePostalCode(props) {
17251
17495
  postalCode,
17252
17496
  postalCodeError
17253
17497
  }
17254
- } = useContext(store$a);
17498
+ } = useContext(store$b);
17255
17499
 
17256
17500
  const handleBlur = () => {
17257
17501
  return dispatch({
@@ -17297,7 +17541,7 @@ const AddressUpdateSubmit = ({
17297
17541
  state: {
17298
17542
  isSubmitting
17299
17543
  }
17300
- } = useContext(store$a);
17544
+ } = useContext(store$b);
17301
17545
  const {
17302
17546
  t
17303
17547
  } = useTranslation("address");
@@ -17313,7 +17557,7 @@ const AddressUpdateSubmit = ({
17313
17557
  };
17314
17558
 
17315
17559
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
17316
- store: store$a
17560
+ store: store$b
17317
17561
  }, props));
17318
17562
 
17319
17563
  const AddressUpdateView = props => {
@@ -17396,7 +17640,7 @@ AddressUpdateModal.viewId = "address-edit";
17396
17640
 
17397
17641
  const AddressUpdateTextInput = props => {
17398
17642
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
17399
- store: store$a
17643
+ store: store$b
17400
17644
  }));
17401
17645
  };
17402
17646
 
@@ -17479,7 +17723,7 @@ const PaymentMethodUpdateModal = props => {
17479
17723
  };
17480
17724
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17481
17725
 
17482
- const initialState$9 = {
17726
+ const initialState$a = {
17483
17727
  email: "",
17484
17728
  password: "",
17485
17729
  passwordError: null,
@@ -17492,10 +17736,10 @@ const initialState$9 = {
17492
17736
  content: ""
17493
17737
  }
17494
17738
  };
17495
- const store$9 = /*#__PURE__*/createContext(initialState$9);
17739
+ const store$a = /*#__PURE__*/createContext(initialState$a);
17496
17740
  const {
17497
- Provider: Provider$9
17498
- } = store$9;
17741
+ Provider: Provider$a
17742
+ } = store$a;
17499
17743
 
17500
17744
  const PasswordResetContainer = ({
17501
17745
  style,
@@ -17552,7 +17796,7 @@ const PasswordResetContainer = ({
17552
17796
  type: SET_EMAIL,
17553
17797
  payload: window.Pelcro.helpers.getURLParameter("email")
17554
17798
  });
17555
- initialState$9.email = window.Pelcro.helpers.getURLParameter("email");
17799
+ initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
17556
17800
  dispatch({
17557
17801
  type: SET_TOKEN,
17558
17802
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17612,26 +17856,26 @@ const PasswordResetContainer = ({
17612
17856
  default:
17613
17857
  return state;
17614
17858
  }
17615
- }, initialState$9);
17859
+ }, initialState$a);
17616
17860
  return /*#__PURE__*/React__default.createElement("div", {
17617
17861
  style: { ...style
17618
17862
  },
17619
17863
  className: `pelcro-container pelcro-password-reset-container ${className}`
17620
- }, /*#__PURE__*/React__default.createElement(Provider$9, {
17864
+ }, /*#__PURE__*/React__default.createElement(Provider$a, {
17621
17865
  value: {
17622
17866
  state,
17623
17867
  dispatch
17624
17868
  }
17625
17869
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17626
- store: store$9,
17870
+ store: store$a,
17627
17871
  key: i
17628
17872
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17629
- store: store$9
17873
+ store: store$a
17630
17874
  })));
17631
17875
  };
17632
17876
 
17633
17877
  const PasswordResetPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
17634
- store: store$9
17878
+ store: store$a
17635
17879
  }, props));
17636
17880
 
17637
17881
  const PasswordResetButton = ({
@@ -17644,7 +17888,7 @@ const PasswordResetButton = ({
17644
17888
  buttonDisabled
17645
17889
  },
17646
17890
  dispatch
17647
- } = useContext(store$9);
17891
+ } = useContext(store$a);
17648
17892
  const {
17649
17893
  t
17650
17894
  } = useTranslation("passwordReset");
@@ -17661,14 +17905,14 @@ const PasswordResetButton = ({
17661
17905
  };
17662
17906
 
17663
17907
  const PasswordResetEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
17664
- store: store$9
17908
+ store: store$a
17665
17909
  }, props, {
17666
17910
  value: window.Pelcro.helpers.getURLParameter("email"),
17667
17911
  disabled: true
17668
17912
  }));
17669
17913
 
17670
17914
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default.createElement(ConfirmPassword, Object.assign({
17671
- store: store$9
17915
+ store: store$a
17672
17916
  }, props));
17673
17917
 
17674
17918
  const PasswordResetView = props => {
@@ -17720,7 +17964,7 @@ const PasswordResetModal = ({
17720
17964
  };
17721
17965
  PasswordResetModal.viewId = "password-reset";
17722
17966
 
17723
- const initialState$8 = {
17967
+ const initialState$9 = {
17724
17968
  email: "",
17725
17969
  emailError: null,
17726
17970
  buttonDisabled: false,
@@ -17729,10 +17973,10 @@ const initialState$8 = {
17729
17973
  content: ""
17730
17974
  }
17731
17975
  };
17732
- const store$8 = /*#__PURE__*/createContext(initialState$8);
17976
+ const store$9 = /*#__PURE__*/createContext(initialState$9);
17733
17977
  const {
17734
- Provider: Provider$8
17735
- } = store$8;
17978
+ Provider: Provider$9
17979
+ } = store$9;
17736
17980
 
17737
17981
  const PasswordForgotContainer = ({
17738
17982
  style,
@@ -17810,21 +18054,21 @@ const PasswordForgotContainer = ({
17810
18054
  default:
17811
18055
  return state;
17812
18056
  }
17813
- }, initialState$8);
18057
+ }, initialState$9);
17814
18058
  return /*#__PURE__*/React__default.createElement("div", {
17815
18059
  style: { ...style
17816
18060
  },
17817
18061
  className: `pelcro-container pelcro-password-forgot-container ${className}`
17818
- }, /*#__PURE__*/React__default.createElement(Provider$8, {
18062
+ }, /*#__PURE__*/React__default.createElement(Provider$9, {
17819
18063
  value: {
17820
18064
  state,
17821
18065
  dispatch
17822
18066
  }
17823
18067
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17824
- store: store$8,
18068
+ store: store$9,
17825
18069
  key: i
17826
18070
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17827
- store: store$8
18071
+ store: store$9
17828
18072
  })));
17829
18073
  };
17830
18074
 
@@ -17840,7 +18084,7 @@ const PasswordForgotButton = ({
17840
18084
  emailError
17841
18085
  },
17842
18086
  dispatch
17843
- } = useContext(store$8);
18087
+ } = useContext(store$9);
17844
18088
  const {
17845
18089
  t
17846
18090
  } = useTranslation("passwordForgot");
@@ -17861,7 +18105,7 @@ const PasswordForgotButton = ({
17861
18105
  };
17862
18106
 
17863
18107
  const PasswordForgotEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
17864
- store: store$8
18108
+ store: store$9
17865
18109
  }, props));
17866
18110
 
17867
18111
  const PasswordForgotView = props => {
@@ -17911,7 +18155,7 @@ const PasswordForgotModal = ({
17911
18155
  };
17912
18156
  PasswordForgotModal.viewId = "password-forgot";
17913
18157
 
17914
- const initialState$7 = {
18158
+ const initialState$8 = {
17915
18159
  currentPassword: "",
17916
18160
  newPassword: "",
17917
18161
  confirmNewPassword: "",
@@ -17925,10 +18169,10 @@ const initialState$7 = {
17925
18169
  content: ""
17926
18170
  }
17927
18171
  };
17928
- const store$7 = /*#__PURE__*/createContext(initialState$7);
18172
+ const store$8 = /*#__PURE__*/createContext(initialState$8);
17929
18173
  const {
17930
- Provider: Provider$7
17931
- } = store$7;
18174
+ Provider: Provider$8
18175
+ } = store$8;
17932
18176
  const PasswordChangeContainer = ({
17933
18177
  style,
17934
18178
  className = "",
@@ -18080,21 +18324,21 @@ const PasswordChangeContainer = ({
18080
18324
  default:
18081
18325
  return state;
18082
18326
  }
18083
- }, initialState$7);
18327
+ }, initialState$8);
18084
18328
  return /*#__PURE__*/React__default.createElement("div", {
18085
18329
  style: { ...style
18086
18330
  },
18087
18331
  className: `pelcro-container pelcro-password-change-container ${className}`
18088
- }, /*#__PURE__*/React__default.createElement(Provider$7, {
18332
+ }, /*#__PURE__*/React__default.createElement(Provider$8, {
18089
18333
  value: {
18090
18334
  state,
18091
18335
  dispatch
18092
18336
  }
18093
18337
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18094
- store: store$7,
18338
+ store: store$8,
18095
18339
  key: i
18096
18340
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18097
- store: store$7
18341
+ store: store$8
18098
18342
  })));
18099
18343
  };
18100
18344
 
@@ -18105,7 +18349,7 @@ function PasswordChangeCurrentPassword(props) {
18105
18349
  currentPassword,
18106
18350
  currentPasswordError
18107
18351
  }
18108
- } = useContext(store$7);
18352
+ } = useContext(store$8);
18109
18353
  const handleBlur = useCallback(() => {
18110
18354
  return dispatch({
18111
18355
  type: VALIDATE_PASSWORD
@@ -18139,7 +18383,7 @@ function PasswordChangeNewPassword(props) {
18139
18383
  newPassword,
18140
18384
  newPasswordError
18141
18385
  }
18142
- } = useContext(store$7);
18386
+ } = useContext(store$8);
18143
18387
  const handleBlur = useCallback(() => {
18144
18388
  return dispatch({
18145
18389
  type: VALIDATE_NEW_PASSWORD
@@ -18173,7 +18417,7 @@ function PasswordChangeConfirmNewPassword(props) {
18173
18417
  confirmNewPassword,
18174
18418
  confirmNewPasswordError
18175
18419
  }
18176
- } = useContext(store$7);
18420
+ } = useContext(store$8);
18177
18421
  const handleBlur = useCallback(() => {
18178
18422
  return dispatch({
18179
18423
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18214,7 +18458,7 @@ const PasswordChangeButton = ({
18214
18458
  confirmNewPasswordError
18215
18459
  },
18216
18460
  dispatch
18217
- } = useContext(store$7);
18461
+ } = useContext(store$8);
18218
18462
  const {
18219
18463
  t
18220
18464
  } = useTranslation("passwordChange");
@@ -18280,17 +18524,17 @@ const PasswordChangeModal = ({
18280
18524
  };
18281
18525
  PasswordChangeModal.viewId = "password-change";
18282
18526
 
18283
- const initialState$6 = {
18527
+ const initialState$7 = {
18284
18528
  buttonDisabled: false,
18285
18529
  alert: {
18286
18530
  type: "error",
18287
18531
  content: ""
18288
18532
  }
18289
18533
  };
18290
- const store$6 = /*#__PURE__*/createContext(initialState$6);
18534
+ const store$7 = /*#__PURE__*/createContext(initialState$7);
18291
18535
  const {
18292
- Provider: Provider$6
18293
- } = store$6;
18536
+ Provider: Provider$7
18537
+ } = store$7;
18294
18538
 
18295
18539
  const CartContainer = ({
18296
18540
  style,
@@ -18381,21 +18625,21 @@ const CartContainer = ({
18381
18625
  default:
18382
18626
  return state;
18383
18627
  }
18384
- }, initialState$6);
18628
+ }, initialState$7);
18385
18629
  return /*#__PURE__*/React__default.createElement("div", {
18386
18630
  style: { ...style
18387
18631
  },
18388
18632
  className: `pelcro-container pelcro-cart-container ${className}`
18389
- }, /*#__PURE__*/React__default.createElement(Provider$6, {
18633
+ }, /*#__PURE__*/React__default.createElement(Provider$7, {
18390
18634
  value: {
18391
18635
  state,
18392
18636
  dispatch
18393
18637
  }
18394
18638
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18395
- store: store$6,
18639
+ store: store$7,
18396
18640
  key: i
18397
18641
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18398
- store: store$6
18642
+ store: store$7
18399
18643
  })));
18400
18644
  };
18401
18645
 
@@ -18432,7 +18676,7 @@ const CartSubmit = ({
18432
18676
  buttonDisabled
18433
18677
  },
18434
18678
  dispatch
18435
- } = useContext(store$6);
18679
+ } = useContext(store$7);
18436
18680
  const {
18437
18681
  t
18438
18682
  } = useTranslation("cart");
@@ -18463,7 +18707,7 @@ const CartTotalPrice = () => {
18463
18707
  state: {
18464
18708
  alert
18465
18709
  }
18466
- } = useContext(store$6);
18710
+ } = useContext(store$7);
18467
18711
  const {
18468
18712
  cartItems
18469
18713
  } = usePelcro();
@@ -18776,7 +19020,7 @@ const OrderConfirmModal = props => {
18776
19020
  };
18777
19021
  OrderConfirmModal.viewId = "order-confirm";
18778
19022
 
18779
- const initialState$5 = {
19023
+ const initialState$6 = {
18780
19024
  email: "",
18781
19025
  firstName: "",
18782
19026
  lastName: "",
@@ -18788,10 +19032,10 @@ const initialState$5 = {
18788
19032
  content: ""
18789
19033
  }
18790
19034
  };
18791
- const store$5 = /*#__PURE__*/createContext(initialState$5);
19035
+ const store$6 = /*#__PURE__*/createContext(initialState$6);
18792
19036
  const {
18793
- Provider: Provider$5
18794
- } = store$5;
19037
+ Provider: Provider$6
19038
+ } = store$6;
18795
19039
 
18796
19040
  const GiftCreateContainer = ({
18797
19041
  style,
@@ -18895,21 +19139,21 @@ const GiftCreateContainer = ({
18895
19139
  default:
18896
19140
  return state;
18897
19141
  }
18898
- }, initialState$5);
19142
+ }, initialState$6);
18899
19143
  return /*#__PURE__*/React__default.createElement("div", {
18900
19144
  style: { ...style
18901
19145
  },
18902
19146
  className: `pelcro-container pelcro-gift-create-container ${className}`
18903
- }, /*#__PURE__*/React__default.createElement(Provider$5, {
19147
+ }, /*#__PURE__*/React__default.createElement(Provider$6, {
18904
19148
  value: {
18905
19149
  state,
18906
19150
  dispatch
18907
19151
  }
18908
19152
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18909
- store: store$5,
19153
+ store: store$6,
18910
19154
  key: i
18911
19155
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18912
- store: store$5
19156
+ store: store$6
18913
19157
  })));
18914
19158
  };
18915
19159
 
@@ -18923,7 +19167,7 @@ const GiftCreateSubmitButton = ({
18923
19167
  state: {
18924
19168
  disableSubmit
18925
19169
  }
18926
- } = useContext(store$5);
19170
+ } = useContext(store$6);
18927
19171
  const {
18928
19172
  t
18929
19173
  } = useTranslation("register");
@@ -18940,29 +19184,29 @@ const GiftCreateSubmitButton = ({
18940
19184
 
18941
19185
  const GiftCreateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
18942
19186
  initWithUserEmail: false,
18943
- store: store$5
19187
+ store: store$6
18944
19188
  }, props));
18945
19189
 
18946
19190
  const GiftCreateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
18947
- store: store$5
19191
+ store: store$6
18948
19192
  }, props));
18949
19193
 
18950
19194
  const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
18951
- store: store$5
19195
+ store: store$6
18952
19196
  }, props));
18953
19197
 
18954
- var _path$g;
19198
+ var _path$h;
18955
19199
 
18956
- 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); }
19200
+ 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); }
18957
19201
 
18958
19202
  function SvgInfoCircle(props) {
18959
- return /*#__PURE__*/React.createElement("svg", _extends$i({
19203
+ return /*#__PURE__*/React.createElement("svg", _extends$j({
18960
19204
  xmlns: "http://www.w3.org/2000/svg",
18961
19205
  className: "plc-w-5 plc-h-5",
18962
19206
  fill: "none",
18963
19207
  viewBox: "0 0 24 24",
18964
19208
  stroke: "currentColor"
18965
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
19209
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
18966
19210
  strokeLinecap: "round",
18967
19211
  strokeLinejoin: "round",
18968
19212
  strokeWidth: 2,
@@ -19033,7 +19277,7 @@ const GiftCreateStartDate = props => {
19033
19277
  const {
19034
19278
  dispatch,
19035
19279
  state
19036
- } = useContext(store$5);
19280
+ } = useContext(store$6);
19037
19281
 
19038
19282
  const handleInputChange = value => {
19039
19283
  dispatch({
@@ -19104,7 +19348,7 @@ function GiftCreateMessage(props) {
19104
19348
  const {
19105
19349
  dispatch,
19106
19350
  state
19107
- } = useContext(store$5);
19351
+ } = useContext(store$6);
19108
19352
 
19109
19353
  const handleInputChange = value => {
19110
19354
  dispatch({
@@ -19224,7 +19468,7 @@ const GiftCreateModal = ({
19224
19468
  };
19225
19469
  GiftCreateModal.viewId = "gift-create";
19226
19470
 
19227
- const initialState$4 = {
19471
+ const initialState$5 = {
19228
19472
  giftCode: "",
19229
19473
  buttonDisabled: true,
19230
19474
  alert: {
@@ -19232,10 +19476,10 @@ const initialState$4 = {
19232
19476
  content: ""
19233
19477
  }
19234
19478
  };
19235
- const store$4 = /*#__PURE__*/createContext(initialState$4);
19479
+ const store$5 = /*#__PURE__*/createContext(initialState$5);
19236
19480
  const {
19237
- Provider: Provider$4
19238
- } = store$4;
19481
+ Provider: Provider$5
19482
+ } = store$5;
19239
19483
 
19240
19484
  const GiftRedeemContainer = ({
19241
19485
  style,
@@ -19300,21 +19544,21 @@ const GiftRedeemContainer = ({
19300
19544
  default:
19301
19545
  return state;
19302
19546
  }
19303
- }, initialState$4);
19547
+ }, initialState$5);
19304
19548
  return /*#__PURE__*/React__default.createElement("div", {
19305
19549
  style: { ...style
19306
19550
  },
19307
19551
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19308
- }, /*#__PURE__*/React__default.createElement(Provider$4, {
19552
+ }, /*#__PURE__*/React__default.createElement(Provider$5, {
19309
19553
  value: {
19310
19554
  state,
19311
19555
  dispatch
19312
19556
  }
19313
19557
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19314
- store: store$4,
19558
+ store: store$5,
19315
19559
  key: i
19316
19560
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19317
- store: store$4
19561
+ store: store$5
19318
19562
  })));
19319
19563
  };
19320
19564
 
@@ -19351,7 +19595,7 @@ function GiftCode({
19351
19595
  }
19352
19596
 
19353
19597
  const GiftRedeemCode = props => /*#__PURE__*/React__default.createElement(GiftCode, Object.assign({
19354
- store: store$4
19598
+ store: store$5
19355
19599
  }, props));
19356
19600
 
19357
19601
  const GiftRedeemSubmitButton = ({
@@ -19364,7 +19608,7 @@ const GiftRedeemSubmitButton = ({
19364
19608
  state: {
19365
19609
  disableSubmit
19366
19610
  }
19367
- } = useContext(store$4);
19611
+ } = useContext(store$5);
19368
19612
  const {
19369
19613
  t
19370
19614
  } = useTranslation("register");
@@ -19457,7 +19701,7 @@ const moveDefaultAddressToStart = addresses => {
19457
19701
  return [defaultAddress, ...addressesWithoutDefault];
19458
19702
  };
19459
19703
 
19460
- const initialState$3 = {
19704
+ const initialState$4 = {
19461
19705
  addresses: [],
19462
19706
  selectedAddressId: null,
19463
19707
  isSubmitting: false,
@@ -19466,10 +19710,10 @@ const initialState$3 = {
19466
19710
  content: ""
19467
19711
  }
19468
19712
  };
19469
- const store$3 = /*#__PURE__*/createContext(initialState$3);
19713
+ const store$4 = /*#__PURE__*/createContext(initialState$4);
19470
19714
  const {
19471
- Provider: Provider$3
19472
- } = store$3;
19715
+ Provider: Provider$4
19716
+ } = store$4;
19473
19717
 
19474
19718
  const AddressSelectContainer = ({
19475
19719
  style,
@@ -19564,7 +19808,7 @@ const AddressSelectContainer = ({
19564
19808
  default:
19565
19809
  return state;
19566
19810
  }
19567
- }, initialState$3);
19811
+ }, initialState$4);
19568
19812
  useEffect(() => {
19569
19813
  var _window$Pelcro$user$r;
19570
19814
 
@@ -19577,16 +19821,16 @@ const AddressSelectContainer = ({
19577
19821
  style: { ...style
19578
19822
  },
19579
19823
  className: `pelcro-container pelcro-address-select-container ${className}`
19580
- }, /*#__PURE__*/React__default.createElement(Provider$3, {
19824
+ }, /*#__PURE__*/React__default.createElement(Provider$4, {
19581
19825
  value: {
19582
19826
  state,
19583
19827
  dispatch
19584
19828
  }
19585
19829
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19586
- store: store$3,
19830
+ store: store$4,
19587
19831
  key: i
19588
19832
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19589
- store: store$3
19833
+ store: store$4
19590
19834
  })));
19591
19835
  };
19592
19836
 
@@ -19597,7 +19841,7 @@ const AddressSelectList = () => {
19597
19841
  addresses,
19598
19842
  selectedAddressId
19599
19843
  }
19600
- } = useContext(store$3);
19844
+ } = useContext(store$4);
19601
19845
 
19602
19846
  const handleAddressSelect = event => {
19603
19847
  dispatch({
@@ -19641,7 +19885,7 @@ const AddressSelectSubmit = ({
19641
19885
  selectedAddressId,
19642
19886
  isSubmitting
19643
19887
  }
19644
- } = useContext(store$3);
19888
+ } = useContext(store$4);
19645
19889
  const {
19646
19890
  t
19647
19891
  } = useTranslation("address");
@@ -19729,10 +19973,15 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
19729
19973
 
19730
19974
  const defaultPaymentMethod = (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.source;
19731
19975
  const paymentMethodsWithoutDefault = paymentMethods.filter(paymentMethod => paymentMethod.id !== defaultPaymentMethod.id);
19976
+
19977
+ if (defaultPaymentMethod.status !== "chargeable") {
19978
+ return paymentMethodsWithoutDefault;
19979
+ }
19980
+
19732
19981
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
19733
19982
  };
19734
19983
 
19735
- const initialState$2 = {
19984
+ const initialState$3 = {
19736
19985
  paymentMethods: [],
19737
19986
  selectedPaymentMethodId: null,
19738
19987
  isSubmitting: false,
@@ -19741,10 +19990,10 @@ const initialState$2 = {
19741
19990
  content: ""
19742
19991
  }
19743
19992
  };
19744
- const store$2 = /*#__PURE__*/createContext(initialState$2);
19993
+ const store$3 = /*#__PURE__*/createContext(initialState$3);
19745
19994
  const {
19746
- Provider: Provider$2
19747
- } = store$2;
19995
+ Provider: Provider$3
19996
+ } = store$3;
19748
19997
 
19749
19998
  const PaymentMethodSelectContainer = ({
19750
19999
  style,
@@ -19789,7 +20038,7 @@ const PaymentMethodSelectContainer = ({
19789
20038
  default:
19790
20039
  return state;
19791
20040
  }
19792
- }, initialState$2);
20041
+ }, initialState$3);
19793
20042
  useEffect(() => {
19794
20043
  var _window$Pelcro$user$r4;
19795
20044
 
@@ -19802,16 +20051,16 @@ const PaymentMethodSelectContainer = ({
19802
20051
  style: { ...style
19803
20052
  },
19804
20053
  className: `pelcro-container pelcro-payment-select-container ${className}`
19805
- }, /*#__PURE__*/React__default.createElement(Provider$2, {
20054
+ }, /*#__PURE__*/React__default.createElement(Provider$3, {
19806
20055
  value: {
19807
20056
  state,
19808
20057
  dispatch
19809
20058
  }
19810
20059
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19811
- store: store$2,
20060
+ store: store$3,
19812
20061
  key: i
19813
20062
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19814
- store: store$2
20063
+ store: store$3
19815
20064
  })));
19816
20065
  };
19817
20066
 
@@ -19825,7 +20074,7 @@ const PaymentMethodSelectList = () => {
19825
20074
  paymentMethods,
19826
20075
  selectedPaymentMethodId
19827
20076
  }
19828
- } = useContext(store$2);
20077
+ } = useContext(store$3);
19829
20078
 
19830
20079
  const handlePaymentMethodSelect = event => {
19831
20080
  dispatch({
@@ -19875,7 +20124,7 @@ const PaymentMethodSelectSubmit = ({
19875
20124
  selectedPaymentMethodId,
19876
20125
  isSubmitting
19877
20126
  }
19878
- } = useContext(store$2);
20127
+ } = useContext(store$3);
19879
20128
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
19880
20129
  onClick: () => {
19881
20130
  dispatch({
@@ -19949,8 +20198,8 @@ const PaymentMethodSelectModal = ({
19949
20198
  };
19950
20199
  PaymentMethodSelectModal.viewId = "payment-method-select";
19951
20200
 
19952
- function _extends$h() {
19953
- _extends$h = Object.assign || function (target) {
20201
+ function _extends$i() {
20202
+ _extends$i = Object.assign || function (target) {
19954
20203
  for (var i = 1; i < arguments.length; i++) {
19955
20204
  var source = arguments[i];
19956
20205
 
@@ -19964,7 +20213,7 @@ function _extends$h() {
19964
20213
  return target;
19965
20214
  };
19966
20215
 
19967
- return _extends$h.apply(this, arguments);
20216
+ return _extends$i.apply(this, arguments);
19968
20217
  }
19969
20218
 
19970
20219
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20148,7 +20397,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20148
20397
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20149
20398
  return null;
20150
20399
  }, _match[RenderStrategy.Hidden] = function () {
20151
- return _render(_extends$h({}, _rest, {
20400
+ return _render(_extends$i({}, _rest, {
20152
20401
  hidden: true,
20153
20402
  style: {
20154
20403
  display: 'none'
@@ -20676,7 +20925,7 @@ function TransitionChild(props) {
20676
20925
  var passthroughProps = rest;
20677
20926
  return React__default.createElement(NestingContext.Provider, {
20678
20927
  value: nesting
20679
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20928
+ }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20680
20929
  }
20681
20930
 
20682
20931
  function Transition(props) {
@@ -20720,7 +20969,7 @@ function Transition(props) {
20720
20969
  value: nestingBag
20721
20970
  }, React__default.createElement(TransitionContext.Provider, {
20722
20971
  value: transitionBag
20723
- }, render(_extends$h({}, sharedProps, {
20972
+ }, render(_extends$i({}, sharedProps, {
20724
20973
  as: Fragment,
20725
20974
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
20726
20975
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -20847,12 +21096,12 @@ var ActionTypes;
20847
21096
  })(ActionTypes || (ActionTypes = {}));
20848
21097
 
20849
21098
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
20850
- return _extends$h({}, state, {
21099
+ return _extends$i({}, state, {
20851
21100
  activeItemIndex: null,
20852
21101
  menuState: MenuStates.Closed
20853
21102
  });
20854
21103
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
20855
- return _extends$h({}, state, {
21104
+ return _extends$i({}, state, {
20856
21105
  menuState: MenuStates.Open
20857
21106
  });
20858
21107
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -20871,7 +21120,7 @@ var ActionTypes;
20871
21120
  }
20872
21121
  });
20873
21122
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
20874
- return _extends$h({}, state, {
21123
+ return _extends$i({}, state, {
20875
21124
  searchQuery: '',
20876
21125
  activeItemIndex: activeItemIndex
20877
21126
  });
@@ -20882,19 +21131,19 @@ var ActionTypes;
20882
21131
 
20883
21132
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
20884
21133
  });
20885
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21134
+ if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
20886
21135
  searchQuery: searchQuery
20887
21136
  });
20888
- return _extends$h({}, state, {
21137
+ return _extends$i({}, state, {
20889
21138
  searchQuery: searchQuery,
20890
21139
  activeItemIndex: match
20891
21140
  });
20892
21141
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
20893
- return _extends$h({}, state, {
21142
+ return _extends$i({}, state, {
20894
21143
  searchQuery: ''
20895
21144
  });
20896
21145
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
20897
- return _extends$h({}, state, {
21146
+ return _extends$i({}, state, {
20898
21147
  items: [].concat(state.items, [{
20899
21148
  id: action.id,
20900
21149
  dataRef: action.dataRef
@@ -20907,7 +21156,7 @@ var ActionTypes;
20907
21156
  return a.id === action.id;
20908
21157
  });
20909
21158
  if (idx !== -1) nextItems.splice(idx, 1);
20910
- return _extends$h({}, state, {
21159
+ return _extends$i({}, state, {
20911
21160
  items: nextItems,
20912
21161
  activeItemIndex: function () {
20913
21162
  if (idx === state.activeItemIndex) return null;
@@ -20946,19 +21195,19 @@ var ActionTypes$1;
20946
21195
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
20947
21196
  if (state.disabled) return state;
20948
21197
  if (state.listboxState === ListboxStates.Closed) return state;
20949
- return _extends$h({}, state, {
21198
+ return _extends$i({}, state, {
20950
21199
  activeOptionIndex: null,
20951
21200
  listboxState: ListboxStates.Closed
20952
21201
  });
20953
21202
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
20954
21203
  if (state.disabled) return state;
20955
21204
  if (state.listboxState === ListboxStates.Open) return state;
20956
- return _extends$h({}, state, {
21205
+ return _extends$i({}, state, {
20957
21206
  listboxState: ListboxStates.Open
20958
21207
  });
20959
21208
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
20960
21209
  if (state.disabled === action.disabled) return state;
20961
- return _extends$h({}, state, {
21210
+ return _extends$i({}, state, {
20962
21211
  disabled: action.disabled
20963
21212
  });
20964
21213
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -20979,7 +21228,7 @@ var ActionTypes$1;
20979
21228
  }
20980
21229
  });
20981
21230
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
20982
- return _extends$h({}, state, {
21231
+ return _extends$i({}, state, {
20983
21232
  searchQuery: '',
20984
21233
  activeOptionIndex: activeOptionIndex
20985
21234
  });
@@ -20992,10 +21241,10 @@ var ActionTypes$1;
20992
21241
 
20993
21242
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
20994
21243
  });
20995
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21244
+ if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
20996
21245
  searchQuery: searchQuery
20997
21246
  });
20998
- return _extends$h({}, state, {
21247
+ return _extends$i({}, state, {
20999
21248
  searchQuery: searchQuery,
21000
21249
  activeOptionIndex: match
21001
21250
  });
@@ -21003,11 +21252,11 @@ var ActionTypes$1;
21003
21252
  if (state.disabled) return state;
21004
21253
  if (state.listboxState === ListboxStates.Closed) return state;
21005
21254
  if (state.searchQuery === '') return state;
21006
- return _extends$h({}, state, {
21255
+ return _extends$i({}, state, {
21007
21256
  searchQuery: ''
21008
21257
  });
21009
21258
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21010
- return _extends$h({}, state, {
21259
+ return _extends$i({}, state, {
21011
21260
  options: [].concat(state.options, [{
21012
21261
  id: action.id,
21013
21262
  dataRef: action.dataRef
@@ -21020,7 +21269,7 @@ var ActionTypes$1;
21020
21269
  return a.id === action.id;
21021
21270
  });
21022
21271
  if (idx !== -1) nextOptions.splice(idx, 1);
21023
- return _extends$h({}, state, {
21272
+ return _extends$i({}, state, {
21024
21273
  options: nextOptions,
21025
21274
  activeOptionIndex: function () {
21026
21275
  if (idx === state.activeOptionIndex) return null;
@@ -21081,18 +21330,18 @@ const getPaymentCardIcon = name => {
21081
21330
  }));
21082
21331
  };
21083
21332
 
21084
- var _path$f;
21333
+ var _path$g;
21085
21334
 
21086
- 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); }
21335
+ 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); }
21087
21336
 
21088
21337
  function SvgChevronRight(props) {
21089
- return /*#__PURE__*/React.createElement("svg", _extends$g({
21338
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
21090
21339
  className: "plc-w-6 plc-h-6",
21091
21340
  xmlns: "http://www.w3.org/2000/svg",
21092
21341
  fill: "none",
21093
21342
  viewBox: "0 0 24 24",
21094
21343
  stroke: "currentColor"
21095
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21344
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
21096
21345
  strokeLinecap: "round",
21097
21346
  strokeLinejoin: "round",
21098
21347
  strokeWidth: 2,
@@ -21308,18 +21557,18 @@ const SavedItems = ({
21308
21557
  });
21309
21558
  };
21310
21559
 
21311
- var _path$e;
21560
+ var _path$f;
21312
21561
 
21313
- 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); }
21562
+ 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); }
21314
21563
 
21315
21564
  function SvgRefresh(props) {
21316
- return /*#__PURE__*/React.createElement("svg", _extends$f({
21565
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
21317
21566
  className: "plc-w-4 plc-h-4 plc-mr-1",
21318
21567
  xmlns: "http://www.w3.org/2000/svg",
21319
21568
  fill: "none",
21320
21569
  viewBox: "0 0 24 24",
21321
21570
  stroke: "currentColor"
21322
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21571
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21323
21572
  strokeLinecap: "round",
21324
21573
  strokeLinejoin: "round",
21325
21574
  strokeWidth: 2,
@@ -21327,35 +21576,35 @@ function SvgRefresh(props) {
21327
21576
  })));
21328
21577
  }
21329
21578
 
21330
- var _path$d;
21579
+ var _path$e;
21331
21580
 
21332
- 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); }
21581
+ 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); }
21333
21582
 
21334
21583
  function SvgCalendar(props) {
21335
- return /*#__PURE__*/React.createElement("svg", _extends$e({
21584
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
21336
21585
  xmlns: "http://www.w3.org/2000/svg",
21337
21586
  className: "plc-h-4 plc-w-4 plc-mr-1",
21338
21587
  viewBox: "0 0 20 20",
21339
21588
  fill: "currentColor"
21340
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21589
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21341
21590
  fillRule: "evenodd",
21342
21591
  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",
21343
21592
  clipRule: "evenodd"
21344
21593
  })));
21345
21594
  }
21346
21595
 
21347
- var _path$c;
21596
+ var _path$d;
21348
21597
 
21349
- 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); }
21598
+ 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); }
21350
21599
 
21351
21600
  function SvgPlus(props) {
21352
- return /*#__PURE__*/React.createElement("svg", _extends$d({
21601
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
21353
21602
  className: "plc-w-5 plc-h-5",
21354
21603
  xmlns: "http://www.w3.org/2000/svg",
21355
21604
  fill: "none",
21356
21605
  viewBox: "0 0 24 24",
21357
21606
  stroke: "currentColor"
21358
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21607
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21359
21608
  strokeLinecap: "round",
21360
21609
  strokeLinejoin: "round",
21361
21610
  strokeWidth: 2,
@@ -21363,17 +21612,17 @@ function SvgPlus(props) {
21363
21612
  })));
21364
21613
  }
21365
21614
 
21366
- var _path$b;
21615
+ var _path$c;
21367
21616
 
21368
- 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); }
21617
+ 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); }
21369
21618
 
21370
21619
  function SvgCheckMark(props) {
21371
- return /*#__PURE__*/React.createElement("svg", _extends$c({
21620
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
21372
21621
  className: "plc-w-4 plc-h-4 plc-mr-1",
21373
21622
  xmlns: "http://www.w3.org/2000/svg",
21374
21623
  viewBox: "0 0 20 20",
21375
21624
  fill: "currentColor"
21376
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21625
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21377
21626
  fillRule: "evenodd",
21378
21627
  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",
21379
21628
  clipRule: "evenodd"
@@ -21668,18 +21917,18 @@ Accordion.item = function AccordionItem({
21668
21917
  }, content)) : null;
21669
21918
  };
21670
21919
 
21671
- var _path$a;
21920
+ var _path$b;
21672
21921
 
21673
- 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); }
21922
+ 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); }
21674
21923
 
21675
21924
  function SvgExit(props) {
21676
- return /*#__PURE__*/React.createElement("svg", _extends$b({
21925
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
21677
21926
  className: "plc-w-6 plc-h-6",
21678
21927
  xmlns: "http://www.w3.org/2000/svg",
21679
21928
  fill: "none",
21680
21929
  viewBox: "0 0 24 24",
21681
21930
  stroke: "currentColor"
21682
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
21931
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21683
21932
  strokeLinecap: "round",
21684
21933
  strokeLinejoin: "round",
21685
21934
  strokeWidth: 2,
@@ -21687,13 +21936,32 @@ function SvgExit(props) {
21687
21936
  })));
21688
21937
  }
21689
21938
 
21939
+ var _path$a;
21940
+
21941
+ 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); }
21942
+
21943
+ function SvgUser(props) {
21944
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
21945
+ xmlns: "http://www.w3.org/2000/svg",
21946
+ fill: "none",
21947
+ viewBox: "0 0 24 24",
21948
+ stroke: "currentColor"
21949
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
21950
+ strokeLinecap: "round",
21951
+ strokeLinejoin: "round",
21952
+ strokeWidth: 2,
21953
+ d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
21954
+ })));
21955
+ }
21956
+
21690
21957
  var _path$9;
21691
21958
 
21692
21959
  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); }
21693
21960
 
21694
- function SvgUser(props) {
21961
+ function SvgNewsletter(props) {
21695
21962
  return /*#__PURE__*/React.createElement("svg", _extends$a({
21696
21963
  xmlns: "http://www.w3.org/2000/svg",
21964
+ className: "plc-h-5 plc-w-5",
21697
21965
  fill: "none",
21698
21966
  viewBox: "0 0 24 24",
21699
21967
  stroke: "currentColor"
@@ -21701,7 +21969,7 @@ function SvgUser(props) {
21701
21969
  strokeLinecap: "round",
21702
21970
  strokeLinejoin: "round",
21703
21971
  strokeWidth: 2,
21704
- d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
21972
+ d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
21705
21973
  })));
21706
21974
  }
21707
21975
 
@@ -21709,10 +21977,10 @@ var _path$8;
21709
21977
 
21710
21978
  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); }
21711
21979
 
21712
- function SvgNewsletter(props) {
21980
+ function SvgDocument(props) {
21713
21981
  return /*#__PURE__*/React.createElement("svg", _extends$9({
21714
21982
  xmlns: "http://www.w3.org/2000/svg",
21715
- className: "plc-h-5 plc-w-5",
21983
+ className: "plc-h-6 plc-w-6 plc-mr-2",
21716
21984
  fill: "none",
21717
21985
  viewBox: "0 0 24 24",
21718
21986
  stroke: "currentColor"
@@ -21720,7 +21988,7 @@ function SvgNewsletter(props) {
21720
21988
  strokeLinecap: "round",
21721
21989
  strokeLinejoin: "round",
21722
21990
  strokeWidth: 2,
21723
- d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
21991
+ 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"
21724
21992
  })));
21725
21993
  }
21726
21994
 
@@ -21898,6 +22166,130 @@ function formatStartDate(date) {
21898
22166
  return new Intl.DateTimeFormat("en-CA").format(startDate);
21899
22167
  }
21900
22168
 
22169
+ const InvoicesMenu = props => {
22170
+ const {
22171
+ t
22172
+ } = useTranslation("dashboard");
22173
+ return /*#__PURE__*/React__default.createElement("table", {
22174
+ className: "plc-w-full plc-table-fixed"
22175
+ }, /*#__PURE__*/React__default.createElement("thead", {
22176
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22177
+ }, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
22178
+ className: "plc-w-4/12 "
22179
+ }, t("labels.details")), /*#__PURE__*/React__default.createElement("th", {
22180
+ className: "plc-w-4/12 "
22181
+ }, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
22182
+ className: "plc-w-3/12 "
22183
+ }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
22184
+ className: "plc-h-4"
22185
+ }), /*#__PURE__*/React__default.createElement(InvoicesItems, props)));
22186
+ };
22187
+
22188
+ const InvoicesItems = () => {
22189
+ var _window$Pelcro$invoic;
22190
+
22191
+ const {
22192
+ t
22193
+ } = useTranslation("dashboard");
22194
+ const {
22195
+ setInvoice,
22196
+ switchView
22197
+ } = usePelcro();
22198
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22199
+
22200
+ const showInvoiceDetails = event => {
22201
+ if (setInvoice(event.target.dataset.id)) {
22202
+ switchView("invoice-details");
22203
+ }
22204
+ };
22205
+
22206
+ if (invoices.length === 0) return null;
22207
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22208
+ const invoiceStatus = getInvoiceStatus(invoice);
22209
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22210
+ return /*#__PURE__*/React__default.createElement("tr", {
22211
+ key: invoice.id,
22212
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22213
+ }, /*#__PURE__*/React__default.createElement("td", {
22214
+ className: "plc-truncate"
22215
+ }, /*#__PURE__*/React__default.createElement("span", {
22216
+ className: "plc-font-semibold plc-text-gray-500"
22217
+ }, `#${invoice.id}`), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22218
+ className: "plc-text-sm plc-text-gray-500"
22219
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22220
+ className: "plc-text-sm plc-text-gray-500"
22221
+ }, formattedCreationDate)), /*#__PURE__*/React__default.createElement("td", {
22222
+ className: "plc-py-2"
22223
+ }, /*#__PURE__*/React__default.createElement("span", {
22224
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22225
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
22226
+ variant: "ghost",
22227
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22228
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, {
22229
+ className: "plc-w-4 plc-h-4"
22230
+ }),
22231
+ onClick: showInvoiceDetails,
22232
+ "data-id": invoice.id
22233
+ }, t("labels.view"))));
22234
+ });
22235
+ };
22236
+
22237
+ function getInvoiceStatus(invoice) {
22238
+ const translations = i18next.t("dashboard:labels", {
22239
+ returnObjects: true
22240
+ });
22241
+
22242
+ switch (invoice.status) {
22243
+ case "paid":
22244
+ return {
22245
+ textColor: "plc-text-green-700",
22246
+ bgColor: "plc-bg-green-100",
22247
+ icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null),
22248
+ title: translations.paid
22249
+ };
22250
+
22251
+ case "past_due":
22252
+ return {
22253
+ textColor: "plc-text-orange-700",
22254
+ bgColor: "plc-bg-orange-100",
22255
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22256
+ title: translations.pastDue
22257
+ };
22258
+
22259
+ case "open":
22260
+ return {
22261
+ textColor: "plc-text-yellow-700",
22262
+ bgColor: "plc-bg-yellow-100",
22263
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22264
+ title: translations.open
22265
+ };
22266
+
22267
+ case "draft":
22268
+ return {
22269
+ textColor: "plc-text-blue-700",
22270
+ bgColor: "plc-bg-blue-100",
22271
+ icon: /*#__PURE__*/React__default.createElement(SvgEdit, null),
22272
+ title: translations.draft
22273
+ };
22274
+
22275
+ case "uncollectible":
22276
+ return {
22277
+ textColor: "plc-text-red-700",
22278
+ bgColor: "plc-bg-red-100",
22279
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22280
+ title: translations.uncollectible
22281
+ };
22282
+
22283
+ case "void":
22284
+ return {
22285
+ textColor: "plc-text-gray-700",
22286
+ bgColor: "plc-bg-gray-100",
22287
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22288
+ title: translations.void
22289
+ };
22290
+ }
22291
+ }
22292
+
21901
22293
  const SUB_MENUS = {
21902
22294
  PROFILE: "profile",
21903
22295
  SUBSCRIPTIONS: "subscriptions",
@@ -21906,6 +22298,7 @@ const SUB_MENUS = {
21906
22298
  ADDRESSES: "addresses",
21907
22299
  GIFTS: "gifts",
21908
22300
  ORDERS: "orders",
22301
+ INVOICES: "invoices",
21909
22302
  SAVED_ITEMS: "saved-items"
21910
22303
  };
21911
22304
  /**
@@ -22448,6 +22841,12 @@ class Dashboard extends Component {
22448
22841
  icon: /*#__PURE__*/React__default.createElement(SvgShopping, null),
22449
22842
  title: this.locale("labels.orders.label"),
22450
22843
  content: /*#__PURE__*/React__default.createElement(OrdersMenu, null)
22844
+ }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22845
+ show: hasInvoices(),
22846
+ name: SUB_MENUS.INVOICES,
22847
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, null),
22848
+ title: this.locale("labels.invoices"),
22849
+ content: /*#__PURE__*/React__default.createElement(InvoicesMenu, null)
22451
22850
  }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22452
22851
  name: SUB_MENUS.SAVED_ITEMS,
22453
22852
  icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
@@ -22463,6 +22862,13 @@ class Dashboard extends Component {
22463
22862
 
22464
22863
  }
22465
22864
 
22865
+ function hasInvoices() {
22866
+ var _window$Pelcro$invoic;
22867
+
22868
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22869
+ return invoices.length > 0;
22870
+ }
22871
+
22466
22872
  function hasDonationSubs() {
22467
22873
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
22468
22874
 
@@ -22497,7 +22903,7 @@ const DashboardOpenButton = () => {
22497
22903
  };
22498
22904
  DashboardOpenButton.viewId = "dashboard-open";
22499
22905
 
22500
- const initialState$1 = {
22906
+ const initialState$2 = {
22501
22907
  imageSrc: null,
22502
22908
  crop: {
22503
22909
  x: 0,
@@ -22511,10 +22917,10 @@ const initialState$1 = {
22511
22917
  content: ""
22512
22918
  }
22513
22919
  };
22514
- const store$1 = /*#__PURE__*/createContext(initialState$1);
22920
+ const store$2 = /*#__PURE__*/createContext(initialState$2);
22515
22921
  const {
22516
- Provider: Provider$1
22517
- } = store$1;
22922
+ Provider: Provider$2
22923
+ } = store$2;
22518
22924
 
22519
22925
  const ProfilePicChangeContainer = ({
22520
22926
  style,
@@ -22648,21 +23054,21 @@ const ProfilePicChangeContainer = ({
22648
23054
  default:
22649
23055
  return state;
22650
23056
  }
22651
- }, initialState$1);
23057
+ }, initialState$2);
22652
23058
  return /*#__PURE__*/React__default.createElement("div", {
22653
23059
  style: { ...style
22654
23060
  },
22655
23061
  className: `pelcro-container pelcro-profile-picture-container ${className}`
22656
- }, /*#__PURE__*/React__default.createElement(Provider$1, {
23062
+ }, /*#__PURE__*/React__default.createElement(Provider$2, {
22657
23063
  value: {
22658
23064
  state,
22659
23065
  dispatch
22660
23066
  }
22661
23067
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
22662
- store: store$1,
23068
+ store: store$2,
22663
23069
  key: i
22664
23070
  })) : /*#__PURE__*/React__default.cloneElement(children, {
22665
- store: store$1
23071
+ store: store$2
22666
23072
  })));
22667
23073
  };
22668
23074
  /**
@@ -22724,7 +23130,7 @@ const ProfilePicChangeButton = ({
22724
23130
  isSubmitting
22725
23131
  },
22726
23132
  dispatch
22727
- } = useContext(store$1);
23133
+ } = useContext(store$2);
22728
23134
  const {
22729
23135
  t
22730
23136
  } = useTranslation("userEdit");
@@ -24092,7 +24498,7 @@ const ProfilePicChangeCropper = ({
24092
24498
  zoom
24093
24499
  },
24094
24500
  dispatch
24095
- } = useContext(store$1);
24501
+ } = useContext(store$2);
24096
24502
  return /*#__PURE__*/React__default.createElement("div", {
24097
24503
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24098
24504
  }, /*#__PURE__*/React__default.createElement(Cropper, Object.assign({
@@ -24134,7 +24540,7 @@ const ProfilePicChangeZoom = ({
24134
24540
  zoom
24135
24541
  },
24136
24542
  dispatch
24137
- } = useContext(store$1);
24543
+ } = useContext(store$2);
24138
24544
  const {
24139
24545
  t
24140
24546
  } = useTranslation("userEdit");
@@ -24186,7 +24592,7 @@ const ProfilePicChangeSelectButton = ({
24186
24592
  state: {
24187
24593
  isSubmitting
24188
24594
  }
24189
- } = useContext(store$1);
24595
+ } = useContext(store$2);
24190
24596
  const {
24191
24597
  t
24192
24598
  } = useTranslation("userEdit");
@@ -24228,7 +24634,7 @@ const ProfilePicChangeRemoveButton = ({
24228
24634
  state: {
24229
24635
  isSubmitting
24230
24636
  }
24231
- } = useContext(store$1);
24637
+ } = useContext(store$2);
24232
24638
  const {
24233
24639
  t
24234
24640
  } = useTranslation("userEdit");
@@ -24251,7 +24657,7 @@ const ProfilePicChangeWrapper = () => {
24251
24657
  state: {
24252
24658
  imageSrc
24253
24659
  }
24254
- } = useContext(store$1);
24660
+ } = useContext(store$2);
24255
24661
  const {
24256
24662
  t
24257
24663
  } = useTranslation("userEdit");
@@ -24313,17 +24719,17 @@ function ProfilePicChangeModal({
24313
24719
  }
24314
24720
  ProfilePicChangeModal.viewId = "profile-picture";
24315
24721
 
24316
- const initialState = {
24722
+ const initialState$1 = {
24317
24723
  isSubmitting: false,
24318
24724
  alert: {
24319
24725
  type: "error",
24320
24726
  content: ""
24321
24727
  }
24322
24728
  };
24323
- const store = /*#__PURE__*/createContext(initialState);
24729
+ const store$1 = /*#__PURE__*/createContext(initialState$1);
24324
24730
  const {
24325
- Provider
24326
- } = store;
24731
+ Provider: Provider$1
24732
+ } = store$1;
24327
24733
 
24328
24734
  const EmailVerifyContainer = ({
24329
24735
  style,
@@ -24386,21 +24792,21 @@ const EmailVerifyContainer = ({
24386
24792
  default:
24387
24793
  return state;
24388
24794
  }
24389
- }, initialState);
24795
+ }, initialState$1);
24390
24796
  return /*#__PURE__*/React__default.createElement("div", {
24391
24797
  style: { ...style
24392
24798
  },
24393
24799
  className: `pelcro-container pelcro-email-verify-container ${className}`
24394
- }, /*#__PURE__*/React__default.createElement(Provider, {
24800
+ }, /*#__PURE__*/React__default.createElement(Provider$1, {
24395
24801
  value: {
24396
24802
  state,
24397
24803
  dispatch
24398
24804
  }
24399
24805
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
24400
- store,
24806
+ store: store$1,
24401
24807
  key: i
24402
24808
  })) : /*#__PURE__*/React__default.cloneElement(children, {
24403
- store
24809
+ store: store$1
24404
24810
  })));
24405
24811
  };
24406
24812
 
@@ -24414,7 +24820,7 @@ const EmailVerifyResendButton = ({
24414
24820
  state: {
24415
24821
  isSubmitting
24416
24822
  }
24417
- } = useContext(store);
24823
+ } = useContext(store$1);
24418
24824
  const {
24419
24825
  t
24420
24826
  } = useTranslation("verifyEmail");
@@ -24489,4 +24895,233 @@ const EmailVerifyModal = ({
24489
24895
  };
24490
24896
  EmailVerifyModal.viewId = "email-verify";
24491
24897
 
24492
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
24898
+ const InvoicePaymentContainer = props => /*#__PURE__*/React__default.createElement(PaymentMethodContainer, Object.assign({
24899
+ type: "invoicePayment",
24900
+ className: "pelcro-invoice-payment-container"
24901
+ }, props));
24902
+
24903
+ const InvoicePaymentView = props => {
24904
+ const {
24905
+ t
24906
+ } = useTranslation("payment");
24907
+ return /*#__PURE__*/React__default.createElement("div", {
24908
+ id: "pelcro-invoice-payment-view"
24909
+ }, /*#__PURE__*/React__default.createElement("div", {
24910
+ className: "plc-mb-6 plc-text-2xl plc-font-semibold plc-text-center plc-text-gray-900 pelcro-title-wrapper"
24911
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("labels.checkout.title"))), /*#__PURE__*/React__default.createElement("form", {
24912
+ action: "javascript:void(0);",
24913
+ className: "plc-mt-2 pelcro-form"
24914
+ }, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
24915
+ type: "invoicePayment",
24916
+ showCoupon: false,
24917
+ showExternalPaymentMethods: true
24918
+ }, props))));
24919
+ };
24920
+
24921
+ const InvoicePaymentModal = ({
24922
+ onDisplay,
24923
+ onClose,
24924
+ ...otherProps
24925
+ }) => {
24926
+ const {
24927
+ switchView
24928
+ } = usePelcro();
24929
+
24930
+ const onSuccess = () => {
24931
+ var _otherProps$onSuccess;
24932
+
24933
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
24934
+ return switchView("subscription-success");
24935
+ };
24936
+
24937
+ return /*#__PURE__*/React__default.createElement(Modal, {
24938
+ id: "pelcro-invoice-payment-modal",
24939
+ onDisplay: onDisplay,
24940
+ onClose: onClose
24941
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(InvoicePaymentView, Object.assign({}, otherProps, {
24942
+ onSuccess: onSuccess
24943
+ }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
24944
+ };
24945
+ InvoicePaymentModal.viewId = "invoice-payment";
24946
+
24947
+ const invoicePaymentSubmitButton = props => {
24948
+ return /*#__PURE__*/React__default.createElement(SubmitPaymentMethod, props);
24949
+ };
24950
+
24951
+ const initialState = {};
24952
+ const store = /*#__PURE__*/createContext(initialState);
24953
+ const {
24954
+ Provider
24955
+ } = store;
24956
+
24957
+ const InvoiceDetailsContainer = ({
24958
+ style,
24959
+ className = "",
24960
+ onSuccess = () => {},
24961
+ children,
24962
+ ...props
24963
+ }) => {
24964
+ const onPayButtonClick = () => {
24965
+ return onSuccess();
24966
+ };
24967
+
24968
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
24969
+ switch (action.type) {
24970
+ case HANDLE_SUBMIT:
24971
+ return lib_4((state, dispatch) => onPayButtonClick());
24972
+
24973
+ default:
24974
+ return state;
24975
+ }
24976
+ }, initialState);
24977
+ return /*#__PURE__*/React__default.createElement("div", {
24978
+ style: { ...style
24979
+ },
24980
+ className: `pelcro-container pelcro-invoice-details-container ${className}`
24981
+ }, /*#__PURE__*/React__default.createElement(Provider, {
24982
+ value: {
24983
+ state,
24984
+ dispatch
24985
+ }
24986
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
24987
+ store,
24988
+ key: i
24989
+ })) : /*#__PURE__*/React__default.cloneElement(children, {
24990
+ store
24991
+ })));
24992
+ };
24993
+
24994
+ const InvoiceDetailsDownloadButton = ({
24995
+ name,
24996
+ url,
24997
+ className,
24998
+ ...otherProps
24999
+ }) => {
25000
+ const {
25001
+ t
25002
+ } = useTranslation("invoiceDetails");
25003
+ const {
25004
+ invoice
25005
+ } = usePelcro();
25006
+ return /*#__PURE__*/React__default.createElement(Link, Object.assign({
25007
+ className: `plc-px-6 plc-py-2 plc-uppercase plc-bg-transparent plc-text-primary-500 plc-border plc-border-primary-500 plc-rounded focus:plc-outline-none focus:plc-ring-2 focus:plc-ring-primary-300 plc-tracking-wider hover:plc-bg-primary-600 focus:plc-bg-primary-600 hover:plc-text-white focus:plc-text-white hover:plc-shadow-none plc-no-underline ${className}`,
25008
+ id: "pelcro-download-invoice-link",
25009
+ href: url !== null && url !== void 0 ? url : invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25010
+ target: "_blank",
25011
+ rel: "noopener noreferrer"
25012
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.download"));
25013
+ };
25014
+
25015
+ const InvoiceDetailsPayButton = ({
25016
+ name,
25017
+ onClick,
25018
+ ...otherProps
25019
+ }) => {
25020
+ const {
25021
+ dispatch
25022
+ } = useContext(store);
25023
+ const {
25024
+ t
25025
+ } = useTranslation("invoiceDetails");
25026
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
25027
+ onClick: () => {
25028
+ dispatch({
25029
+ type: HANDLE_SUBMIT
25030
+ });
25031
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25032
+ }
25033
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.pay"));
25034
+ };
25035
+
25036
+ const InvoiceDetailsView = props => {
25037
+ const {
25038
+ t
25039
+ } = useTranslation("invoiceDetails");
25040
+ const {
25041
+ invoice
25042
+ } = usePelcro();
25043
+ const showPayButton = canPayInvoice(invoice);
25044
+ const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25045
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25046
+ return /*#__PURE__*/React__default.createElement("div", {
25047
+ id: "pelcro-invoice-details-view"
25048
+ }, /*#__PURE__*/React__default.createElement("div", {
25049
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25050
+ }, /*#__PURE__*/React__default.createElement("h4", {
25051
+ className: "plc-text-2xl plc-font-semibold"
25052
+ }, t("title"))), /*#__PURE__*/React__default.createElement("form", {
25053
+ action: "javascript:void(0);",
25054
+ className: "plc-mt-2 pelcro-form"
25055
+ }, /*#__PURE__*/React__default.createElement(InvoiceDetailsContainer, props, /*#__PURE__*/React__default.createElement("div", {
25056
+ className: "plc-mt-5 pelcro-invoice-summary-wrapper"
25057
+ }, /*#__PURE__*/React__default.createElement("p", {
25058
+ className: "plc-font-bold pelcro-invoice-summary-title"
25059
+ }, t("labels.summary")), invoice && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
25060
+ className: "plc-mr-2 pelcro-invoice-creation-date"
25061
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default.createElement("div", {
25062
+ className: "plc-flex plc-items-center plc-pt-2 plc-mt-2 plc-border-t plc-border-gray-400 plc-min-h-12 plc-justify-evenly pelcro-invoice-plan-wrapper"
25063
+ }, /*#__PURE__*/React__default.createElement("div", {
25064
+ className: "plc-w-1/2 plc-break-words pelcro-invoice-plan-name"
25065
+ }, invoice.plan.nickname), /*#__PURE__*/React__default.createElement("div", {
25066
+ className: "plc-w-1/5 plc-text-center pelcro-invoice-summary-price"
25067
+ }, calcAndFormatItemsTotal([invoice.plan], invoice.currency))), /*#__PURE__*/React__default.createElement("div", {
25068
+ className: "plc-flex plc-justify-end plc-pt-2 plc-mt-2 plc-font-bold plc-border-t plc-border-gray-400 pelcro-invoice-total-wrapper"
25069
+ }, /*#__PURE__*/React__default.createElement("div", {
25070
+ className: "plc-mr-2 plc-flex plc-flex-col"
25071
+ }, /*#__PURE__*/React__default.createElement("p", {
25072
+ className: "pelcro-invoice-total-text"
25073
+ }, t("labels.total")), /*#__PURE__*/React__default.createElement("p", {
25074
+ className: "pelcro-invoice-total-text"
25075
+ }, t("labels.amountPaid")), /*#__PURE__*/React__default.createElement("p", {
25076
+ className: "plc-font-semibold pelcro-invoice-total-text"
25077
+ }, t("labels.amountDue"))), /*#__PURE__*/React__default.createElement("div", {
25078
+ className: "plc-flex plc-flex-col"
25079
+ }, /*#__PURE__*/React__default.createElement("p", {
25080
+ className: "pelcro-invoice-total"
25081
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("p", {
25082
+ className: "pelcro-invoice-total"
25083
+ }, getFormattedPriceByLocal(invoice.amount_paid, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("p", {
25084
+ className: "plc-font-semibold pelcro-invoice-total"
25085
+ }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default.createElement("div", {
25086
+ className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25087
+ }, /*#__PURE__*/React__default.createElement(InvoiceDetailsDownloadButton, {
25088
+ url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25089
+ className: "plc-w-full plc-text-center"
25090
+ }), showPayButton && /*#__PURE__*/React__default.createElement(InvoiceDetailsPayButton, {
25091
+ role: "submit",
25092
+ className: "plc-ml-4 plc-w-full",
25093
+ id: "pelcro-submit"
25094
+ })))));
25095
+ };
25096
+
25097
+ function canPayInvoice(invoice) {
25098
+ return (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "open" || (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "past_due";
25099
+ }
25100
+
25101
+ const InvoiceDetailsModal = ({
25102
+ onDisplay,
25103
+ onClose,
25104
+ ...otherProps
25105
+ }) => {
25106
+ const {
25107
+ switchToPaymentView
25108
+ } = usePelcro();
25109
+
25110
+ const onSuccess = () => {
25111
+ var _otherProps$onSuccess;
25112
+
25113
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
25114
+ switchToPaymentView();
25115
+ };
25116
+
25117
+ return /*#__PURE__*/React__default.createElement(Modal, {
25118
+ onDisplay: onDisplay,
25119
+ onClose: onClose,
25120
+ id: "pelcro-invoice-details-modal"
25121
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(InvoiceDetailsView, Object.assign({}, otherProps, {
25122
+ onSuccess: onSuccess
25123
+ }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
25124
+ };
25125
+ InvoiceDetailsModal.viewId = "invoice-details";
25126
+
25127
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };