@pelcro/react-pelcro-js 4.0.0-alpha.70 → 4.0.0-alpha.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +312 -150
- package/dist/index.esm.js +312 -150
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3248,7 +3248,9 @@ var validation$3 = {
|
|
|
3248
3248
|
enterEmails: "Email addresses are required.",
|
|
3249
3249
|
enterUsername: "User name is required.",
|
|
3250
3250
|
enterPassword: "Password is required.",
|
|
3251
|
-
confirmPassword: "Confirm password is required."
|
|
3251
|
+
confirmPassword: "Confirm password is required.",
|
|
3252
|
+
enterFirstName: "First name is required.",
|
|
3253
|
+
enterLastName: "Last name is required."
|
|
3252
3254
|
};
|
|
3253
3255
|
var buttons$j = {
|
|
3254
3256
|
account: "My account",
|
|
@@ -3476,7 +3478,9 @@ var labels$11 = {
|
|
|
3476
3478
|
lastName: "Last name",
|
|
3477
3479
|
phone: "Phone",
|
|
3478
3480
|
freeItems: "Free Items",
|
|
3479
|
-
isDefault: "Set as default"
|
|
3481
|
+
isDefault: "Set as default",
|
|
3482
|
+
shippingAddress: "Shipping Address",
|
|
3483
|
+
contactDetails: "Contact Details"
|
|
3480
3484
|
};
|
|
3481
3485
|
var checkoutForm_en = {
|
|
3482
3486
|
messages: messages$14,
|
|
@@ -3857,6 +3861,7 @@ var labels$W = {
|
|
|
3857
3861
|
},
|
|
3858
3862
|
checkout: {
|
|
3859
3863
|
title: "Payment Information",
|
|
3864
|
+
shippingAddress: "Shipping Address",
|
|
3860
3865
|
billingAddress: "Billing Address",
|
|
3861
3866
|
NoBillingAddress: "No Billing Address Found",
|
|
3862
3867
|
changeBillingAddress: "Change",
|
|
@@ -4165,7 +4170,9 @@ var validation$2 = {
|
|
|
4165
4170
|
enterEmails: "Les adresses e-mail sont obligatoires.",
|
|
4166
4171
|
enterUsername: "Nom d'utilisateur est nécessaire.",
|
|
4167
4172
|
enterPassword: "Mot de passe requis.",
|
|
4168
|
-
confirmPassword: "Confirmer le mot de passe requis."
|
|
4173
|
+
confirmPassword: "Confirmer le mot de passe requis.",
|
|
4174
|
+
enterFirstName: "Le prénom est requis.",
|
|
4175
|
+
enterLastName: "Le nom de famille est requis."
|
|
4169
4176
|
};
|
|
4170
4177
|
var buttons$e = {
|
|
4171
4178
|
account: "Accès abonné(e)s",
|
|
@@ -13575,6 +13582,8 @@ const initialState$n = {
|
|
|
13575
13582
|
password: "",
|
|
13576
13583
|
emailError: null,
|
|
13577
13584
|
passwordError: null,
|
|
13585
|
+
firstNameError: null,
|
|
13586
|
+
lastNameError: null,
|
|
13578
13587
|
confirmPassword: "",
|
|
13579
13588
|
confirmPasswordError: null,
|
|
13580
13589
|
confirmPasswordUsed: false,
|
|
@@ -13733,12 +13742,14 @@ const RegisterContainer = ({
|
|
|
13733
13742
|
|
|
13734
13743
|
case SET_FIRST_NAME:
|
|
13735
13744
|
return lib_7({ ...state,
|
|
13736
|
-
firstName: action.payload
|
|
13745
|
+
firstName: action.payload,
|
|
13746
|
+
firstNameError: null
|
|
13737
13747
|
});
|
|
13738
13748
|
|
|
13739
13749
|
case SET_LAST_NAME:
|
|
13740
13750
|
return lib_7({ ...state,
|
|
13741
|
-
lastName: action.payload
|
|
13751
|
+
lastName: action.payload,
|
|
13752
|
+
lastNameError: null
|
|
13742
13753
|
});
|
|
13743
13754
|
|
|
13744
13755
|
case SET_TEXT_FIELD:
|
|
@@ -13764,6 +13775,18 @@ const RegisterContainer = ({
|
|
|
13764
13775
|
password: ""
|
|
13765
13776
|
});
|
|
13766
13777
|
|
|
13778
|
+
case SET_FIRST_NAME_ERROR:
|
|
13779
|
+
return lib_7({ ...state,
|
|
13780
|
+
firstNameError: action.payload,
|
|
13781
|
+
firstName: ""
|
|
13782
|
+
});
|
|
13783
|
+
|
|
13784
|
+
case SET_LAST_NAME_ERROR:
|
|
13785
|
+
return lib_7({ ...state,
|
|
13786
|
+
lastNameError: action.payload,
|
|
13787
|
+
lastName: ""
|
|
13788
|
+
});
|
|
13789
|
+
|
|
13767
13790
|
case SET_CONFIRM_PASSWORD_ERROR:
|
|
13768
13791
|
return lib_7({ ...state,
|
|
13769
13792
|
confirmPasswordError: action.payload,
|
|
@@ -14583,117 +14606,77 @@ const RegisterButton = ({
|
|
|
14583
14606
|
}, otherProps), name !== null && name !== void 0 ? name : t("messages.createAccount"));
|
|
14584
14607
|
};
|
|
14585
14608
|
|
|
14586
|
-
const Loader = props => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14587
|
-
className: `pelcro-loader-wrapper ${props.className}`
|
|
14588
|
-
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
14589
|
-
width: props.width,
|
|
14590
|
-
height: props.height,
|
|
14591
|
-
viewBox: "0 0 120 30",
|
|
14592
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14593
|
-
fill: "currentColor",
|
|
14594
|
-
"aria-label": props.label
|
|
14595
|
-
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14596
|
-
cx: "15",
|
|
14597
|
-
cy: "15",
|
|
14598
|
-
r: props.radius + 6
|
|
14599
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14600
|
-
attributeName: "r",
|
|
14601
|
-
from: "15",
|
|
14602
|
-
to: "15",
|
|
14603
|
-
begin: "0s",
|
|
14604
|
-
dur: "0.8s",
|
|
14605
|
-
values: "15;9;15",
|
|
14606
|
-
calcMode: "linear",
|
|
14607
|
-
repeatCount: "indefinite"
|
|
14608
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14609
|
-
attributeName: "fillOpacity",
|
|
14610
|
-
from: "1",
|
|
14611
|
-
to: "1",
|
|
14612
|
-
begin: "0s",
|
|
14613
|
-
dur: "0.8s",
|
|
14614
|
-
values: "1;.5;1",
|
|
14615
|
-
calcMode: "linear",
|
|
14616
|
-
repeatCount: "indefinite"
|
|
14617
|
-
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14618
|
-
cx: "60",
|
|
14619
|
-
cy: "15",
|
|
14620
|
-
r: props.radius,
|
|
14621
|
-
attributeName: "fillOpacity",
|
|
14622
|
-
from: "1",
|
|
14623
|
-
to: "0.3"
|
|
14624
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14625
|
-
attributeName: "r",
|
|
14626
|
-
from: "9",
|
|
14627
|
-
to: "9",
|
|
14628
|
-
begin: "0s",
|
|
14629
|
-
dur: "0.8s",
|
|
14630
|
-
values: "9;15;9",
|
|
14631
|
-
calcMode: "linear",
|
|
14632
|
-
repeatCount: "indefinite"
|
|
14633
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14634
|
-
attributeName: "fillOpacity",
|
|
14635
|
-
from: "0.5",
|
|
14636
|
-
to: "0.5",
|
|
14637
|
-
begin: "0s",
|
|
14638
|
-
dur: "0.8s",
|
|
14639
|
-
values: ".5;1;.5",
|
|
14640
|
-
calcMode: "linear",
|
|
14641
|
-
repeatCount: "indefinite"
|
|
14642
|
-
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14643
|
-
cx: "105",
|
|
14644
|
-
cy: "15",
|
|
14645
|
-
r: props.radius + 6
|
|
14646
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14647
|
-
attributeName: "r",
|
|
14648
|
-
from: "15",
|
|
14649
|
-
to: "15",
|
|
14650
|
-
begin: "0s",
|
|
14651
|
-
dur: "0.8s",
|
|
14652
|
-
values: "15;9;15",
|
|
14653
|
-
calcMode: "linear",
|
|
14654
|
-
repeatCount: "indefinite"
|
|
14655
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14656
|
-
attributeName: "fillOpacity",
|
|
14657
|
-
from: "1",
|
|
14658
|
-
to: "1",
|
|
14659
|
-
begin: "0s",
|
|
14660
|
-
dur: "0.8s",
|
|
14661
|
-
values: "1;.5;1",
|
|
14662
|
-
calcMode: "linear",
|
|
14663
|
-
repeatCount: "indefinite"
|
|
14664
|
-
}))));
|
|
14665
|
-
Loader.defaultProps = {
|
|
14666
|
-
height: 50,
|
|
14667
|
-
width: 35,
|
|
14668
|
-
color: "#32aea1",
|
|
14669
|
-
label: "Loading data..",
|
|
14670
|
-
radius: 9
|
|
14671
|
-
};
|
|
14672
|
-
|
|
14673
14609
|
function FirstName({
|
|
14610
|
+
initWithUserFirstName = true,
|
|
14674
14611
|
store,
|
|
14675
14612
|
...otherProps
|
|
14676
14613
|
}) {
|
|
14614
|
+
const {
|
|
14615
|
+
t
|
|
14616
|
+
} = useTranslation("common");
|
|
14677
14617
|
const {
|
|
14678
14618
|
dispatch,
|
|
14679
|
-
state
|
|
14619
|
+
state: {
|
|
14620
|
+
firstName: stateFirstName,
|
|
14621
|
+
firstNameError
|
|
14622
|
+
}
|
|
14680
14623
|
} = React.useContext(store);
|
|
14624
|
+
const [firstName, setFirstName] = React.useState(stateFirstName);
|
|
14625
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
14626
|
+
const handleInputChange = React.useCallback(value => {
|
|
14627
|
+
setFirstName(value);
|
|
14681
14628
|
|
|
14682
|
-
|
|
14629
|
+
if (finishedTyping) {
|
|
14630
|
+
if (firstName !== null && firstName !== void 0 && firstName.length) {
|
|
14631
|
+
dispatch({
|
|
14632
|
+
type: SET_FIRST_NAME,
|
|
14633
|
+
payload: firstName
|
|
14634
|
+
});
|
|
14635
|
+
} else {
|
|
14636
|
+
if (otherProps.required) {
|
|
14637
|
+
dispatch({
|
|
14638
|
+
type: SET_FIRST_NAME_ERROR,
|
|
14639
|
+
payload: t("validation.enterFirstName")
|
|
14640
|
+
});
|
|
14641
|
+
} else {
|
|
14642
|
+
dispatch({
|
|
14643
|
+
type: SET_FIRST_NAME,
|
|
14644
|
+
payload: firstName
|
|
14645
|
+
});
|
|
14646
|
+
}
|
|
14647
|
+
}
|
|
14648
|
+
}
|
|
14649
|
+
}, [dispatch, firstName, finishedTyping]);
|
|
14650
|
+
React.useEffect(() => {
|
|
14651
|
+
handleInputChange(firstName);
|
|
14652
|
+
}, [finishedTyping, firstName, handleInputChange]); // Initialize first name field with user's first name
|
|
14653
|
+
|
|
14654
|
+
const loadFirstNameIntoField = () => {
|
|
14655
|
+
handleInputChange(window.Pelcro.user.read().first_name);
|
|
14683
14656
|
dispatch({
|
|
14684
14657
|
type: SET_FIRST_NAME,
|
|
14685
|
-
payload:
|
|
14658
|
+
payload: window.Pelcro.user.read().first_name
|
|
14686
14659
|
});
|
|
14687
14660
|
};
|
|
14688
14661
|
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14662
|
+
React.useEffect(() => {
|
|
14663
|
+
if (initWithUserFirstName) {
|
|
14664
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
14665
|
+
loadFirstNameIntoField();
|
|
14666
|
+
});
|
|
14667
|
+
loadFirstNameIntoField();
|
|
14668
|
+
return () => {
|
|
14669
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
14670
|
+
};
|
|
14671
|
+
}
|
|
14672
|
+
}, []);
|
|
14693
14673
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
14694
14674
|
type: "text",
|
|
14695
|
-
|
|
14696
|
-
|
|
14675
|
+
error: firstNameError,
|
|
14676
|
+
value: firstName,
|
|
14677
|
+
onChange: e => handleInputChange(e.target.value),
|
|
14678
|
+
onBlur: () => setFinishedTyping(true),
|
|
14679
|
+
onFocus: () => setFinishedTyping(false)
|
|
14697
14680
|
}, otherProps));
|
|
14698
14681
|
}
|
|
14699
14682
|
|
|
@@ -14702,29 +14685,76 @@ const RegisterFirstName = props => /*#__PURE__*/React__default['default'].create
|
|
|
14702
14685
|
}, props));
|
|
14703
14686
|
|
|
14704
14687
|
function LastName({
|
|
14688
|
+
initWithUserLastName = true,
|
|
14705
14689
|
store,
|
|
14706
14690
|
...otherProps
|
|
14707
14691
|
}) {
|
|
14692
|
+
const {
|
|
14693
|
+
t
|
|
14694
|
+
} = useTranslation("common");
|
|
14708
14695
|
const {
|
|
14709
14696
|
dispatch,
|
|
14710
|
-
state
|
|
14697
|
+
state: {
|
|
14698
|
+
lastName: stateLastName,
|
|
14699
|
+
lastNameError
|
|
14700
|
+
}
|
|
14711
14701
|
} = React.useContext(store);
|
|
14702
|
+
const [lastName, setLastName] = React.useState(stateLastName);
|
|
14703
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
14704
|
+
const handleInputChange = React.useCallback(value => {
|
|
14705
|
+
setLastName(value);
|
|
14712
14706
|
|
|
14713
|
-
|
|
14707
|
+
if (finishedTyping) {
|
|
14708
|
+
if (lastName !== null && lastName !== void 0 && lastName.length) {
|
|
14709
|
+
dispatch({
|
|
14710
|
+
type: SET_LAST_NAME,
|
|
14711
|
+
payload: lastName
|
|
14712
|
+
});
|
|
14713
|
+
} else {
|
|
14714
|
+
if (otherProps.required) {
|
|
14715
|
+
dispatch({
|
|
14716
|
+
type: SET_LAST_NAME_ERROR,
|
|
14717
|
+
payload: t("validation.enterLastName")
|
|
14718
|
+
});
|
|
14719
|
+
} else {
|
|
14720
|
+
dispatch({
|
|
14721
|
+
type: SET_LAST_NAME,
|
|
14722
|
+
payload: lastName
|
|
14723
|
+
});
|
|
14724
|
+
}
|
|
14725
|
+
}
|
|
14726
|
+
}
|
|
14727
|
+
}, [dispatch, lastName, finishedTyping]);
|
|
14728
|
+
React.useEffect(() => {
|
|
14729
|
+
handleInputChange(lastName);
|
|
14730
|
+
}, [finishedTyping, lastName, handleInputChange]); // Initialize last name field with user's last name
|
|
14731
|
+
|
|
14732
|
+
const loadLastNameIntoField = () => {
|
|
14733
|
+
handleInputChange(window.Pelcro.user.read().last_name);
|
|
14714
14734
|
dispatch({
|
|
14715
14735
|
type: SET_LAST_NAME,
|
|
14716
|
-
payload:
|
|
14736
|
+
payload: window.Pelcro.user.read().last_name
|
|
14717
14737
|
});
|
|
14718
14738
|
};
|
|
14719
14739
|
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14740
|
+
React.useEffect(() => {
|
|
14741
|
+
if (initWithUserLastName) {
|
|
14742
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
14743
|
+
loadLastNameIntoField();
|
|
14744
|
+
});
|
|
14745
|
+
loadLastNameIntoField();
|
|
14746
|
+
return () => {
|
|
14747
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
14748
|
+
};
|
|
14749
|
+
}
|
|
14750
|
+
}, []);
|
|
14724
14751
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
14725
14752
|
type: "text",
|
|
14726
|
-
|
|
14727
|
-
|
|
14753
|
+
error: lastNameError,
|
|
14754
|
+
value: lastName,
|
|
14755
|
+
onChange: e => handleInputChange(e.target.value),
|
|
14756
|
+
onBlur: () => setFinishedTyping(true),
|
|
14757
|
+
onFocus: () => setFinishedTyping(false)
|
|
14728
14758
|
}, otherProps));
|
|
14729
14759
|
}
|
|
14730
14760
|
|
|
@@ -14817,6 +14847,93 @@ function hasSecurityTokenEnabled() {
|
|
|
14817
14847
|
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
|
|
14818
14848
|
}
|
|
14819
14849
|
|
|
14850
|
+
const Loader = props => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14851
|
+
className: `pelcro-loader-wrapper ${props.className}`
|
|
14852
|
+
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
14853
|
+
width: props.width,
|
|
14854
|
+
height: props.height,
|
|
14855
|
+
viewBox: "0 0 120 30",
|
|
14856
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14857
|
+
fill: "currentColor",
|
|
14858
|
+
"aria-label": props.label
|
|
14859
|
+
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14860
|
+
cx: "15",
|
|
14861
|
+
cy: "15",
|
|
14862
|
+
r: props.radius + 6
|
|
14863
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14864
|
+
attributeName: "r",
|
|
14865
|
+
from: "15",
|
|
14866
|
+
to: "15",
|
|
14867
|
+
begin: "0s",
|
|
14868
|
+
dur: "0.8s",
|
|
14869
|
+
values: "15;9;15",
|
|
14870
|
+
calcMode: "linear",
|
|
14871
|
+
repeatCount: "indefinite"
|
|
14872
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14873
|
+
attributeName: "fillOpacity",
|
|
14874
|
+
from: "1",
|
|
14875
|
+
to: "1",
|
|
14876
|
+
begin: "0s",
|
|
14877
|
+
dur: "0.8s",
|
|
14878
|
+
values: "1;.5;1",
|
|
14879
|
+
calcMode: "linear",
|
|
14880
|
+
repeatCount: "indefinite"
|
|
14881
|
+
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14882
|
+
cx: "60",
|
|
14883
|
+
cy: "15",
|
|
14884
|
+
r: props.radius,
|
|
14885
|
+
attributeName: "fillOpacity",
|
|
14886
|
+
from: "1",
|
|
14887
|
+
to: "0.3"
|
|
14888
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14889
|
+
attributeName: "r",
|
|
14890
|
+
from: "9",
|
|
14891
|
+
to: "9",
|
|
14892
|
+
begin: "0s",
|
|
14893
|
+
dur: "0.8s",
|
|
14894
|
+
values: "9;15;9",
|
|
14895
|
+
calcMode: "linear",
|
|
14896
|
+
repeatCount: "indefinite"
|
|
14897
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14898
|
+
attributeName: "fillOpacity",
|
|
14899
|
+
from: "0.5",
|
|
14900
|
+
to: "0.5",
|
|
14901
|
+
begin: "0s",
|
|
14902
|
+
dur: "0.8s",
|
|
14903
|
+
values: ".5;1;.5",
|
|
14904
|
+
calcMode: "linear",
|
|
14905
|
+
repeatCount: "indefinite"
|
|
14906
|
+
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14907
|
+
cx: "105",
|
|
14908
|
+
cy: "15",
|
|
14909
|
+
r: props.radius + 6
|
|
14910
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14911
|
+
attributeName: "r",
|
|
14912
|
+
from: "15",
|
|
14913
|
+
to: "15",
|
|
14914
|
+
begin: "0s",
|
|
14915
|
+
dur: "0.8s",
|
|
14916
|
+
values: "15;9;15",
|
|
14917
|
+
calcMode: "linear",
|
|
14918
|
+
repeatCount: "indefinite"
|
|
14919
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14920
|
+
attributeName: "fillOpacity",
|
|
14921
|
+
from: "1",
|
|
14922
|
+
to: "1",
|
|
14923
|
+
begin: "0s",
|
|
14924
|
+
dur: "0.8s",
|
|
14925
|
+
values: "1;.5;1",
|
|
14926
|
+
calcMode: "linear",
|
|
14927
|
+
repeatCount: "indefinite"
|
|
14928
|
+
}))));
|
|
14929
|
+
Loader.defaultProps = {
|
|
14930
|
+
height: 50,
|
|
14931
|
+
width: 35,
|
|
14932
|
+
color: "#32aea1",
|
|
14933
|
+
label: "Loading data..",
|
|
14934
|
+
radius: 9
|
|
14935
|
+
};
|
|
14936
|
+
|
|
14820
14937
|
function TextInput({
|
|
14821
14938
|
store,
|
|
14822
14939
|
fieldName,
|
|
@@ -26670,20 +26787,18 @@ const SelectedAddress = ({
|
|
|
26670
26787
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
26671
26788
|
className: "plc-p-4 plc-my-4 last:plc-mb-0 plc-rounded plc-text-gray-900 pelcro-address-wrapper plc-shadow-md_dark plc-relative"
|
|
26672
26789
|
}, address && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
26673
|
-
className: "pelcro-select-address-radio plc-order-2",
|
|
26674
|
-
id: `pelcro-address-select-${address.id}`,
|
|
26675
26790
|
name: "address"
|
|
26676
26791
|
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26677
26792
|
className: "pelcro-address-name plc-font-semibold"
|
|
26678
|
-
}, t("labels.checkout.billingAddress")), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26793
|
+
}, t("labels.checkout.billingAddress")), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26679
26794
|
className: "pelcro-address-company"
|
|
26680
26795
|
}, address.company), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26681
|
-
className: "pelcro-address-
|
|
26796
|
+
className: "pelcro-address-name plc-text-sm plc-mt-2"
|
|
26797
|
+
}, address.first_name, " ", address.last_name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26798
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
26682
26799
|
}, address.line1), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
26683
26800
|
className: "pelcro-address-country plc-text-sm"
|
|
26684
|
-
}, address.city, ", ", address.
|
|
26685
|
-
className: "pelcro-address-phone plc-text-sm"
|
|
26686
|
-
}, address === null || address === void 0 ? void 0 : address.phone)), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
26801
|
+
}, address.city, ", ", address.state, " ", address.postal_code, ",", " ", address.country, ", ", address === null || address === void 0 ? void 0 : address.phone))), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
26687
26802
|
onClick: onAddNewAddress,
|
|
26688
26803
|
disabled: isLoading,
|
|
26689
26804
|
variant: "ghost",
|
|
@@ -28305,33 +28420,34 @@ const MeterModal = props => {
|
|
|
28305
28420
|
};
|
|
28306
28421
|
MeterModal.viewId = "meter";
|
|
28307
28422
|
|
|
28308
|
-
const
|
|
28309
|
-
|
|
28310
|
-
onFailure = () => {}
|
|
28311
|
-
}) => {
|
|
28312
|
-
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
28423
|
+
const SubscriptionCreateSummary = () => {
|
|
28424
|
+
var _window$Pelcro$user$r, _window, _window$Pelcro, _window$Pelcro$user, _window$Pelcro$user$r2, _window2, _window2$Pelcro, _window2$Pelcro$user, _addresses$find, _addresses$find2;
|
|
28313
28425
|
|
|
28314
28426
|
const {
|
|
28315
28427
|
t
|
|
28316
28428
|
} = useTranslation("checkoutForm");
|
|
28317
28429
|
const {
|
|
28318
28430
|
product,
|
|
28319
|
-
plan
|
|
28431
|
+
plan,
|
|
28432
|
+
selectedAddressId
|
|
28320
28433
|
} = usePelcro();
|
|
28321
|
-
const
|
|
28322
|
-
|
|
28434
|
+
const {
|
|
28435
|
+
addresses
|
|
28436
|
+
} = (_window$Pelcro$user$r = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro = _window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read()) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
28437
|
+
const user = (_window$Pelcro$user$r2 = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Pelcro = _window2.Pelcro) === null || _window2$Pelcro === void 0 ? void 0 : (_window2$Pelcro$user = _window2$Pelcro.user) === null || _window2$Pelcro$user === void 0 ? void 0 : _window2$Pelcro$user.read()) !== null && _window$Pelcro$user$r2 !== void 0 ? _window$Pelcro$user$r2 : [];
|
|
28438
|
+
const address = selectedAddressId ? (_addresses$find = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.id == selectedAddressId)) !== null && _addresses$find !== void 0 ? _addresses$find : null : (_addresses$find2 = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.type == "shipping" && address.is_default)) !== null && _addresses$find2 !== void 0 ? _addresses$find2 : null;
|
|
28323
28439
|
|
|
28324
28440
|
const getPricingText = plan => {
|
|
28325
28441
|
var _plan$quantity;
|
|
28326
28442
|
|
|
28327
28443
|
const autoRenewed = plan.auto_renew;
|
|
28328
28444
|
const {
|
|
28329
|
-
interval_translated,
|
|
28330
|
-
interval_count
|
|
28445
|
+
interval_translated: intervalTranslated,
|
|
28446
|
+
interval_count: intervalCount
|
|
28331
28447
|
} = plan;
|
|
28332
28448
|
const intervalText = t("labels.interval", {
|
|
28333
|
-
interval:
|
|
28334
|
-
count:
|
|
28449
|
+
interval: intervalTranslated,
|
|
28450
|
+
count: intervalCount
|
|
28335
28451
|
});
|
|
28336
28452
|
const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
28337
28453
|
return /*#__PURE__*/React__default['default'].createElement("p", {
|
|
@@ -28345,9 +28461,7 @@ const SubscriptionCreateView = ({
|
|
|
28345
28461
|
}, autoRenewed ? "/" : t("labels.for"), " ", intervalText));
|
|
28346
28462
|
};
|
|
28347
28463
|
|
|
28348
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28349
|
-
id: "pelcro-subscription-create-view"
|
|
28350
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28464
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28351
28465
|
className: "plc-flex plc-flex-row plc-items-center plc-mb-6 plc-text-left plc-text-gray-900 pelcro-title-wrapper"
|
|
28352
28466
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28353
28467
|
className: "plc-w-full plc-font-semibold plc-text-left plc-text-gray-900"
|
|
@@ -28359,7 +28473,49 @@ const SubscriptionCreateView = ({
|
|
|
28359
28473
|
src: product.image,
|
|
28360
28474
|
alt: "",
|
|
28361
28475
|
className: "plc-rounded-md"
|
|
28362
|
-
}))), /*#__PURE__*/React__default['default'].createElement(
|
|
28476
|
+
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28477
|
+
className: "plc-flex plc-flex-row plc-justify-between"
|
|
28478
|
+
}, address && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28479
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
28480
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
28481
|
+
name: "address"
|
|
28482
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28483
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
28484
|
+
}, t("labels.shippingAddress")), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28485
|
+
className: "pelcro-address-company"
|
|
28486
|
+
}, address === null || address === void 0 ? void 0 : address.company), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28487
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
28488
|
+
}, address === null || address === void 0 ? void 0 : address.first_name, " ", address === null || address === void 0 ? void 0 : address.last_name), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28489
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
28490
|
+
}, address === null || address === void 0 ? void 0 : address.line1), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28491
|
+
className: "pelcro-address-country plc-text-sm"
|
|
28492
|
+
}, address === null || address === void 0 ? void 0 : address.city, ", ", address === null || address === void 0 ? void 0 : address.state, " ", address === null || address === void 0 ? void 0 : address.postal_code, ", ", address === null || address === void 0 ? void 0 : address.country))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28493
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
28494
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
28495
|
+
name: "address"
|
|
28496
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28497
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
28498
|
+
}, t("labels.contactDetails")), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28499
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
28500
|
+
}, user.email), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28501
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
28502
|
+
}, address === null || address === void 0 ? void 0 : address.phone))));
|
|
28503
|
+
};
|
|
28504
|
+
|
|
28505
|
+
const SubscriptionCreateView = ({
|
|
28506
|
+
onSuccess = () => {},
|
|
28507
|
+
onFailure = () => {}
|
|
28508
|
+
}) => {
|
|
28509
|
+
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
28510
|
+
|
|
28511
|
+
const {
|
|
28512
|
+
plan
|
|
28513
|
+
} = usePelcro();
|
|
28514
|
+
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
28515
|
+
const showSubscriptionButton = skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0;
|
|
28516
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28517
|
+
id: "pelcro-subscription-create-view"
|
|
28518
|
+
}, /*#__PURE__*/React__default['default'].createElement(SubscriptionCreateSummary, null), /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
28363
28519
|
type: "createPayment",
|
|
28364
28520
|
showCoupon: true,
|
|
28365
28521
|
showExternalPaymentMethods: true,
|
|
@@ -28912,6 +29068,7 @@ const initialState$h = {
|
|
|
28912
29068
|
email: (_window$Pelcro$user$r$1 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r$1 === void 0 ? void 0 : _window$Pelcro$user$r$1.email,
|
|
28913
29069
|
emailError: null,
|
|
28914
29070
|
firstName: (_window$Pelcro$user$r2$1 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2$1 === void 0 ? void 0 : _window$Pelcro$user$r2$1.first_name,
|
|
29071
|
+
firstNameError: null,
|
|
28915
29072
|
lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
|
|
28916
29073
|
lastNameError: null,
|
|
28917
29074
|
username: (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.username,
|
|
@@ -29043,17 +29200,26 @@ const UserUpdateContainer = ({
|
|
|
29043
29200
|
|
|
29044
29201
|
case SET_EMAIL:
|
|
29045
29202
|
return lib_7({ ...state,
|
|
29046
|
-
email: action.payload
|
|
29203
|
+
email: action.payload,
|
|
29204
|
+
emailError: null
|
|
29047
29205
|
});
|
|
29048
29206
|
|
|
29049
29207
|
case SET_EMAIL_ERROR:
|
|
29050
29208
|
return lib_7({ ...state,
|
|
29051
|
-
emailError: action.payload
|
|
29209
|
+
emailError: action.payload,
|
|
29210
|
+
email: ""
|
|
29052
29211
|
});
|
|
29053
29212
|
|
|
29054
29213
|
case SET_FIRST_NAME:
|
|
29055
29214
|
return lib_7({ ...state,
|
|
29056
|
-
firstName: action.payload
|
|
29215
|
+
firstName: action.payload,
|
|
29216
|
+
firstNameError: null
|
|
29217
|
+
});
|
|
29218
|
+
|
|
29219
|
+
case SET_FIRST_NAME_ERROR:
|
|
29220
|
+
return lib_7({ ...state,
|
|
29221
|
+
firstNameError: action.payload,
|
|
29222
|
+
firstName: ""
|
|
29057
29223
|
});
|
|
29058
29224
|
|
|
29059
29225
|
case SET_DISPLAY_NAME:
|
|
@@ -29063,7 +29229,14 @@ const UserUpdateContainer = ({
|
|
|
29063
29229
|
|
|
29064
29230
|
case SET_LAST_NAME:
|
|
29065
29231
|
return lib_7({ ...state,
|
|
29066
|
-
lastName: action.payload
|
|
29232
|
+
lastName: action.payload,
|
|
29233
|
+
lastNameError: null
|
|
29234
|
+
});
|
|
29235
|
+
|
|
29236
|
+
case SET_LAST_NAME_ERROR:
|
|
29237
|
+
return lib_7({ ...state,
|
|
29238
|
+
lastNameError: action.payload,
|
|
29239
|
+
lastName: ""
|
|
29067
29240
|
});
|
|
29068
29241
|
|
|
29069
29242
|
case SET_USERNAME:
|
|
@@ -29429,8 +29602,6 @@ const nowDate$1 = new Date();
|
|
|
29429
29602
|
const nowDateISO$1 = nowDate$1.toISOString().substr(0, 10);
|
|
29430
29603
|
const hundredYearsFromNowDateISO = new Date(new Date().setFullYear(nowDate$1.getFullYear() - 100)).toISOString().substr(0, 10);
|
|
29431
29604
|
const UserUpdateDateOfBirth = props => {
|
|
29432
|
-
var _state$dateOfBirth;
|
|
29433
|
-
|
|
29434
29605
|
// const { t } = useTranslation("userEdit");
|
|
29435
29606
|
const {
|
|
29436
29607
|
dispatch,
|
|
@@ -29451,7 +29622,7 @@ const UserUpdateDateOfBirth = props => {
|
|
|
29451
29622
|
return /*#__PURE__*/React__default['default'].createElement(DatePicker, Object.assign({
|
|
29452
29623
|
min: hundredYearsFromNowDateISO,
|
|
29453
29624
|
max: nowDateISO$1,
|
|
29454
|
-
value:
|
|
29625
|
+
value: state.dateOfBirth,
|
|
29455
29626
|
onChange: e => handleInputChange(e.target.value) // tooltipText={t("labels.dateOfBirth")}
|
|
29456
29627
|
|
|
29457
29628
|
}, props));
|
|
@@ -31093,13 +31264,6 @@ function AddressUpdatePhone(props) {
|
|
|
31093
31264
|
}
|
|
31094
31265
|
} = React.useContext(store$f);
|
|
31095
31266
|
|
|
31096
|
-
const handleBlur = () => {
|
|
31097
|
-
return dispatch({
|
|
31098
|
-
type: VALIDATE_FIELD,
|
|
31099
|
-
payload: "phone"
|
|
31100
|
-
});
|
|
31101
|
-
};
|
|
31102
|
-
|
|
31103
31267
|
const handleInputChange = value => {
|
|
31104
31268
|
dispatch({
|
|
31105
31269
|
type: SET_TEXT_FIELD,
|
|
@@ -31124,7 +31288,6 @@ function AddressUpdatePhone(props) {
|
|
|
31124
31288
|
value: phone,
|
|
31125
31289
|
error: phoneError,
|
|
31126
31290
|
onChange: e => handleInputChange(e.target.value),
|
|
31127
|
-
onBlur: handleBlur,
|
|
31128
31291
|
onFocus: handleFocus
|
|
31129
31292
|
}, props));
|
|
31130
31293
|
}
|
|
@@ -31187,8 +31350,7 @@ const AddressUpdateView = props => {
|
|
|
31187
31350
|
}, /*#__PURE__*/React__default['default'].createElement(AddressUpdatePhone, {
|
|
31188
31351
|
id: "pelcro-input-phone",
|
|
31189
31352
|
errorId: "pelcro-input-phone-error",
|
|
31190
|
-
label: t("labels.phone")
|
|
31191
|
-
required: true
|
|
31353
|
+
label: t("labels.phone")
|
|
31192
31354
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31193
31355
|
className: "plc-flex plc-space-x-3 plc-items-start plc-mb-3"
|
|
31194
31356
|
}, /*#__PURE__*/React__default['default'].createElement(AddressUpdateSetDefault, {
|
package/dist/index.esm.js
CHANGED
|
@@ -3218,7 +3218,9 @@ var validation$3 = {
|
|
|
3218
3218
|
enterEmails: "Email addresses are required.",
|
|
3219
3219
|
enterUsername: "User name is required.",
|
|
3220
3220
|
enterPassword: "Password is required.",
|
|
3221
|
-
confirmPassword: "Confirm password is required."
|
|
3221
|
+
confirmPassword: "Confirm password is required.",
|
|
3222
|
+
enterFirstName: "First name is required.",
|
|
3223
|
+
enterLastName: "Last name is required."
|
|
3222
3224
|
};
|
|
3223
3225
|
var buttons$j = {
|
|
3224
3226
|
account: "My account",
|
|
@@ -3446,7 +3448,9 @@ var labels$11 = {
|
|
|
3446
3448
|
lastName: "Last name",
|
|
3447
3449
|
phone: "Phone",
|
|
3448
3450
|
freeItems: "Free Items",
|
|
3449
|
-
isDefault: "Set as default"
|
|
3451
|
+
isDefault: "Set as default",
|
|
3452
|
+
shippingAddress: "Shipping Address",
|
|
3453
|
+
contactDetails: "Contact Details"
|
|
3450
3454
|
};
|
|
3451
3455
|
var checkoutForm_en = {
|
|
3452
3456
|
messages: messages$14,
|
|
@@ -3827,6 +3831,7 @@ var labels$W = {
|
|
|
3827
3831
|
},
|
|
3828
3832
|
checkout: {
|
|
3829
3833
|
title: "Payment Information",
|
|
3834
|
+
shippingAddress: "Shipping Address",
|
|
3830
3835
|
billingAddress: "Billing Address",
|
|
3831
3836
|
NoBillingAddress: "No Billing Address Found",
|
|
3832
3837
|
changeBillingAddress: "Change",
|
|
@@ -4135,7 +4140,9 @@ var validation$2 = {
|
|
|
4135
4140
|
enterEmails: "Les adresses e-mail sont obligatoires.",
|
|
4136
4141
|
enterUsername: "Nom d'utilisateur est nécessaire.",
|
|
4137
4142
|
enterPassword: "Mot de passe requis.",
|
|
4138
|
-
confirmPassword: "Confirmer le mot de passe requis."
|
|
4143
|
+
confirmPassword: "Confirmer le mot de passe requis.",
|
|
4144
|
+
enterFirstName: "Le prénom est requis.",
|
|
4145
|
+
enterLastName: "Le nom de famille est requis."
|
|
4139
4146
|
};
|
|
4140
4147
|
var buttons$e = {
|
|
4141
4148
|
account: "Accès abonné(e)s",
|
|
@@ -13545,6 +13552,8 @@ const initialState$n = {
|
|
|
13545
13552
|
password: "",
|
|
13546
13553
|
emailError: null,
|
|
13547
13554
|
passwordError: null,
|
|
13555
|
+
firstNameError: null,
|
|
13556
|
+
lastNameError: null,
|
|
13548
13557
|
confirmPassword: "",
|
|
13549
13558
|
confirmPasswordError: null,
|
|
13550
13559
|
confirmPasswordUsed: false,
|
|
@@ -13703,12 +13712,14 @@ const RegisterContainer = ({
|
|
|
13703
13712
|
|
|
13704
13713
|
case SET_FIRST_NAME:
|
|
13705
13714
|
return lib_7({ ...state,
|
|
13706
|
-
firstName: action.payload
|
|
13715
|
+
firstName: action.payload,
|
|
13716
|
+
firstNameError: null
|
|
13707
13717
|
});
|
|
13708
13718
|
|
|
13709
13719
|
case SET_LAST_NAME:
|
|
13710
13720
|
return lib_7({ ...state,
|
|
13711
|
-
lastName: action.payload
|
|
13721
|
+
lastName: action.payload,
|
|
13722
|
+
lastNameError: null
|
|
13712
13723
|
});
|
|
13713
13724
|
|
|
13714
13725
|
case SET_TEXT_FIELD:
|
|
@@ -13734,6 +13745,18 @@ const RegisterContainer = ({
|
|
|
13734
13745
|
password: ""
|
|
13735
13746
|
});
|
|
13736
13747
|
|
|
13748
|
+
case SET_FIRST_NAME_ERROR:
|
|
13749
|
+
return lib_7({ ...state,
|
|
13750
|
+
firstNameError: action.payload,
|
|
13751
|
+
firstName: ""
|
|
13752
|
+
});
|
|
13753
|
+
|
|
13754
|
+
case SET_LAST_NAME_ERROR:
|
|
13755
|
+
return lib_7({ ...state,
|
|
13756
|
+
lastNameError: action.payload,
|
|
13757
|
+
lastName: ""
|
|
13758
|
+
});
|
|
13759
|
+
|
|
13737
13760
|
case SET_CONFIRM_PASSWORD_ERROR:
|
|
13738
13761
|
return lib_7({ ...state,
|
|
13739
13762
|
confirmPasswordError: action.payload,
|
|
@@ -14553,117 +14576,77 @@ const RegisterButton = ({
|
|
|
14553
14576
|
}, otherProps), name !== null && name !== void 0 ? name : t("messages.createAccount"));
|
|
14554
14577
|
};
|
|
14555
14578
|
|
|
14556
|
-
const Loader = props => /*#__PURE__*/React__default.createElement("div", {
|
|
14557
|
-
className: `pelcro-loader-wrapper ${props.className}`
|
|
14558
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
14559
|
-
width: props.width,
|
|
14560
|
-
height: props.height,
|
|
14561
|
-
viewBox: "0 0 120 30",
|
|
14562
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14563
|
-
fill: "currentColor",
|
|
14564
|
-
"aria-label": props.label
|
|
14565
|
-
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
14566
|
-
cx: "15",
|
|
14567
|
-
cy: "15",
|
|
14568
|
-
r: props.radius + 6
|
|
14569
|
-
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14570
|
-
attributeName: "r",
|
|
14571
|
-
from: "15",
|
|
14572
|
-
to: "15",
|
|
14573
|
-
begin: "0s",
|
|
14574
|
-
dur: "0.8s",
|
|
14575
|
-
values: "15;9;15",
|
|
14576
|
-
calcMode: "linear",
|
|
14577
|
-
repeatCount: "indefinite"
|
|
14578
|
-
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14579
|
-
attributeName: "fillOpacity",
|
|
14580
|
-
from: "1",
|
|
14581
|
-
to: "1",
|
|
14582
|
-
begin: "0s",
|
|
14583
|
-
dur: "0.8s",
|
|
14584
|
-
values: "1;.5;1",
|
|
14585
|
-
calcMode: "linear",
|
|
14586
|
-
repeatCount: "indefinite"
|
|
14587
|
-
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
14588
|
-
cx: "60",
|
|
14589
|
-
cy: "15",
|
|
14590
|
-
r: props.radius,
|
|
14591
|
-
attributeName: "fillOpacity",
|
|
14592
|
-
from: "1",
|
|
14593
|
-
to: "0.3"
|
|
14594
|
-
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14595
|
-
attributeName: "r",
|
|
14596
|
-
from: "9",
|
|
14597
|
-
to: "9",
|
|
14598
|
-
begin: "0s",
|
|
14599
|
-
dur: "0.8s",
|
|
14600
|
-
values: "9;15;9",
|
|
14601
|
-
calcMode: "linear",
|
|
14602
|
-
repeatCount: "indefinite"
|
|
14603
|
-
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14604
|
-
attributeName: "fillOpacity",
|
|
14605
|
-
from: "0.5",
|
|
14606
|
-
to: "0.5",
|
|
14607
|
-
begin: "0s",
|
|
14608
|
-
dur: "0.8s",
|
|
14609
|
-
values: ".5;1;.5",
|
|
14610
|
-
calcMode: "linear",
|
|
14611
|
-
repeatCount: "indefinite"
|
|
14612
|
-
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
14613
|
-
cx: "105",
|
|
14614
|
-
cy: "15",
|
|
14615
|
-
r: props.radius + 6
|
|
14616
|
-
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14617
|
-
attributeName: "r",
|
|
14618
|
-
from: "15",
|
|
14619
|
-
to: "15",
|
|
14620
|
-
begin: "0s",
|
|
14621
|
-
dur: "0.8s",
|
|
14622
|
-
values: "15;9;15",
|
|
14623
|
-
calcMode: "linear",
|
|
14624
|
-
repeatCount: "indefinite"
|
|
14625
|
-
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14626
|
-
attributeName: "fillOpacity",
|
|
14627
|
-
from: "1",
|
|
14628
|
-
to: "1",
|
|
14629
|
-
begin: "0s",
|
|
14630
|
-
dur: "0.8s",
|
|
14631
|
-
values: "1;.5;1",
|
|
14632
|
-
calcMode: "linear",
|
|
14633
|
-
repeatCount: "indefinite"
|
|
14634
|
-
}))));
|
|
14635
|
-
Loader.defaultProps = {
|
|
14636
|
-
height: 50,
|
|
14637
|
-
width: 35,
|
|
14638
|
-
color: "#32aea1",
|
|
14639
|
-
label: "Loading data..",
|
|
14640
|
-
radius: 9
|
|
14641
|
-
};
|
|
14642
|
-
|
|
14643
14579
|
function FirstName({
|
|
14580
|
+
initWithUserFirstName = true,
|
|
14644
14581
|
store,
|
|
14645
14582
|
...otherProps
|
|
14646
14583
|
}) {
|
|
14584
|
+
const {
|
|
14585
|
+
t
|
|
14586
|
+
} = useTranslation("common");
|
|
14647
14587
|
const {
|
|
14648
14588
|
dispatch,
|
|
14649
|
-
state
|
|
14589
|
+
state: {
|
|
14590
|
+
firstName: stateFirstName,
|
|
14591
|
+
firstNameError
|
|
14592
|
+
}
|
|
14650
14593
|
} = useContext(store);
|
|
14594
|
+
const [firstName, setFirstName] = useState(stateFirstName);
|
|
14595
|
+
const [finishedTyping, setFinishedTyping] = useState(false);
|
|
14596
|
+
const handleInputChange = useCallback(value => {
|
|
14597
|
+
setFirstName(value);
|
|
14651
14598
|
|
|
14652
|
-
|
|
14599
|
+
if (finishedTyping) {
|
|
14600
|
+
if (firstName !== null && firstName !== void 0 && firstName.length) {
|
|
14601
|
+
dispatch({
|
|
14602
|
+
type: SET_FIRST_NAME,
|
|
14603
|
+
payload: firstName
|
|
14604
|
+
});
|
|
14605
|
+
} else {
|
|
14606
|
+
if (otherProps.required) {
|
|
14607
|
+
dispatch({
|
|
14608
|
+
type: SET_FIRST_NAME_ERROR,
|
|
14609
|
+
payload: t("validation.enterFirstName")
|
|
14610
|
+
});
|
|
14611
|
+
} else {
|
|
14612
|
+
dispatch({
|
|
14613
|
+
type: SET_FIRST_NAME,
|
|
14614
|
+
payload: firstName
|
|
14615
|
+
});
|
|
14616
|
+
}
|
|
14617
|
+
}
|
|
14618
|
+
}
|
|
14619
|
+
}, [dispatch, firstName, finishedTyping]);
|
|
14620
|
+
useEffect(() => {
|
|
14621
|
+
handleInputChange(firstName);
|
|
14622
|
+
}, [finishedTyping, firstName, handleInputChange]); // Initialize first name field with user's first name
|
|
14623
|
+
|
|
14624
|
+
const loadFirstNameIntoField = () => {
|
|
14625
|
+
handleInputChange(window.Pelcro.user.read().first_name);
|
|
14653
14626
|
dispatch({
|
|
14654
14627
|
type: SET_FIRST_NAME,
|
|
14655
|
-
payload:
|
|
14628
|
+
payload: window.Pelcro.user.read().first_name
|
|
14656
14629
|
});
|
|
14657
14630
|
};
|
|
14658
14631
|
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
|
|
14632
|
+
useEffect(() => {
|
|
14633
|
+
if (initWithUserFirstName) {
|
|
14634
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
14635
|
+
loadFirstNameIntoField();
|
|
14636
|
+
});
|
|
14637
|
+
loadFirstNameIntoField();
|
|
14638
|
+
return () => {
|
|
14639
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
14640
|
+
};
|
|
14641
|
+
}
|
|
14642
|
+
}, []);
|
|
14663
14643
|
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
14664
14644
|
type: "text",
|
|
14665
|
-
|
|
14666
|
-
|
|
14645
|
+
error: firstNameError,
|
|
14646
|
+
value: firstName,
|
|
14647
|
+
onChange: e => handleInputChange(e.target.value),
|
|
14648
|
+
onBlur: () => setFinishedTyping(true),
|
|
14649
|
+
onFocus: () => setFinishedTyping(false)
|
|
14667
14650
|
}, otherProps));
|
|
14668
14651
|
}
|
|
14669
14652
|
|
|
@@ -14672,29 +14655,76 @@ const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(Fir
|
|
|
14672
14655
|
}, props));
|
|
14673
14656
|
|
|
14674
14657
|
function LastName({
|
|
14658
|
+
initWithUserLastName = true,
|
|
14675
14659
|
store,
|
|
14676
14660
|
...otherProps
|
|
14677
14661
|
}) {
|
|
14662
|
+
const {
|
|
14663
|
+
t
|
|
14664
|
+
} = useTranslation("common");
|
|
14678
14665
|
const {
|
|
14679
14666
|
dispatch,
|
|
14680
|
-
state
|
|
14667
|
+
state: {
|
|
14668
|
+
lastName: stateLastName,
|
|
14669
|
+
lastNameError
|
|
14670
|
+
}
|
|
14681
14671
|
} = useContext(store);
|
|
14672
|
+
const [lastName, setLastName] = useState(stateLastName);
|
|
14673
|
+
const [finishedTyping, setFinishedTyping] = useState(false);
|
|
14674
|
+
const handleInputChange = useCallback(value => {
|
|
14675
|
+
setLastName(value);
|
|
14682
14676
|
|
|
14683
|
-
|
|
14677
|
+
if (finishedTyping) {
|
|
14678
|
+
if (lastName !== null && lastName !== void 0 && lastName.length) {
|
|
14679
|
+
dispatch({
|
|
14680
|
+
type: SET_LAST_NAME,
|
|
14681
|
+
payload: lastName
|
|
14682
|
+
});
|
|
14683
|
+
} else {
|
|
14684
|
+
if (otherProps.required) {
|
|
14685
|
+
dispatch({
|
|
14686
|
+
type: SET_LAST_NAME_ERROR,
|
|
14687
|
+
payload: t("validation.enterLastName")
|
|
14688
|
+
});
|
|
14689
|
+
} else {
|
|
14690
|
+
dispatch({
|
|
14691
|
+
type: SET_LAST_NAME,
|
|
14692
|
+
payload: lastName
|
|
14693
|
+
});
|
|
14694
|
+
}
|
|
14695
|
+
}
|
|
14696
|
+
}
|
|
14697
|
+
}, [dispatch, lastName, finishedTyping]);
|
|
14698
|
+
useEffect(() => {
|
|
14699
|
+
handleInputChange(lastName);
|
|
14700
|
+
}, [finishedTyping, lastName, handleInputChange]); // Initialize last name field with user's last name
|
|
14701
|
+
|
|
14702
|
+
const loadLastNameIntoField = () => {
|
|
14703
|
+
handleInputChange(window.Pelcro.user.read().last_name);
|
|
14684
14704
|
dispatch({
|
|
14685
14705
|
type: SET_LAST_NAME,
|
|
14686
|
-
payload:
|
|
14706
|
+
payload: window.Pelcro.user.read().last_name
|
|
14687
14707
|
});
|
|
14688
14708
|
};
|
|
14689
14709
|
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14710
|
+
useEffect(() => {
|
|
14711
|
+
if (initWithUserLastName) {
|
|
14712
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
14713
|
+
loadLastNameIntoField();
|
|
14714
|
+
});
|
|
14715
|
+
loadLastNameIntoField();
|
|
14716
|
+
return () => {
|
|
14717
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
14718
|
+
};
|
|
14719
|
+
}
|
|
14720
|
+
}, []);
|
|
14694
14721
|
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
14695
14722
|
type: "text",
|
|
14696
|
-
|
|
14697
|
-
|
|
14723
|
+
error: lastNameError,
|
|
14724
|
+
value: lastName,
|
|
14725
|
+
onChange: e => handleInputChange(e.target.value),
|
|
14726
|
+
onBlur: () => setFinishedTyping(true),
|
|
14727
|
+
onFocus: () => setFinishedTyping(false)
|
|
14698
14728
|
}, otherProps));
|
|
14699
14729
|
}
|
|
14700
14730
|
|
|
@@ -14787,6 +14817,93 @@ function hasSecurityTokenEnabled() {
|
|
|
14787
14817
|
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
|
|
14788
14818
|
}
|
|
14789
14819
|
|
|
14820
|
+
const Loader = props => /*#__PURE__*/React__default.createElement("div", {
|
|
14821
|
+
className: `pelcro-loader-wrapper ${props.className}`
|
|
14822
|
+
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
14823
|
+
width: props.width,
|
|
14824
|
+
height: props.height,
|
|
14825
|
+
viewBox: "0 0 120 30",
|
|
14826
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14827
|
+
fill: "currentColor",
|
|
14828
|
+
"aria-label": props.label
|
|
14829
|
+
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
14830
|
+
cx: "15",
|
|
14831
|
+
cy: "15",
|
|
14832
|
+
r: props.radius + 6
|
|
14833
|
+
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14834
|
+
attributeName: "r",
|
|
14835
|
+
from: "15",
|
|
14836
|
+
to: "15",
|
|
14837
|
+
begin: "0s",
|
|
14838
|
+
dur: "0.8s",
|
|
14839
|
+
values: "15;9;15",
|
|
14840
|
+
calcMode: "linear",
|
|
14841
|
+
repeatCount: "indefinite"
|
|
14842
|
+
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14843
|
+
attributeName: "fillOpacity",
|
|
14844
|
+
from: "1",
|
|
14845
|
+
to: "1",
|
|
14846
|
+
begin: "0s",
|
|
14847
|
+
dur: "0.8s",
|
|
14848
|
+
values: "1;.5;1",
|
|
14849
|
+
calcMode: "linear",
|
|
14850
|
+
repeatCount: "indefinite"
|
|
14851
|
+
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
14852
|
+
cx: "60",
|
|
14853
|
+
cy: "15",
|
|
14854
|
+
r: props.radius,
|
|
14855
|
+
attributeName: "fillOpacity",
|
|
14856
|
+
from: "1",
|
|
14857
|
+
to: "0.3"
|
|
14858
|
+
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14859
|
+
attributeName: "r",
|
|
14860
|
+
from: "9",
|
|
14861
|
+
to: "9",
|
|
14862
|
+
begin: "0s",
|
|
14863
|
+
dur: "0.8s",
|
|
14864
|
+
values: "9;15;9",
|
|
14865
|
+
calcMode: "linear",
|
|
14866
|
+
repeatCount: "indefinite"
|
|
14867
|
+
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14868
|
+
attributeName: "fillOpacity",
|
|
14869
|
+
from: "0.5",
|
|
14870
|
+
to: "0.5",
|
|
14871
|
+
begin: "0s",
|
|
14872
|
+
dur: "0.8s",
|
|
14873
|
+
values: ".5;1;.5",
|
|
14874
|
+
calcMode: "linear",
|
|
14875
|
+
repeatCount: "indefinite"
|
|
14876
|
+
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
14877
|
+
cx: "105",
|
|
14878
|
+
cy: "15",
|
|
14879
|
+
r: props.radius + 6
|
|
14880
|
+
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14881
|
+
attributeName: "r",
|
|
14882
|
+
from: "15",
|
|
14883
|
+
to: "15",
|
|
14884
|
+
begin: "0s",
|
|
14885
|
+
dur: "0.8s",
|
|
14886
|
+
values: "15;9;15",
|
|
14887
|
+
calcMode: "linear",
|
|
14888
|
+
repeatCount: "indefinite"
|
|
14889
|
+
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14890
|
+
attributeName: "fillOpacity",
|
|
14891
|
+
from: "1",
|
|
14892
|
+
to: "1",
|
|
14893
|
+
begin: "0s",
|
|
14894
|
+
dur: "0.8s",
|
|
14895
|
+
values: "1;.5;1",
|
|
14896
|
+
calcMode: "linear",
|
|
14897
|
+
repeatCount: "indefinite"
|
|
14898
|
+
}))));
|
|
14899
|
+
Loader.defaultProps = {
|
|
14900
|
+
height: 50,
|
|
14901
|
+
width: 35,
|
|
14902
|
+
color: "#32aea1",
|
|
14903
|
+
label: "Loading data..",
|
|
14904
|
+
radius: 9
|
|
14905
|
+
};
|
|
14906
|
+
|
|
14790
14907
|
function TextInput({
|
|
14791
14908
|
store,
|
|
14792
14909
|
fieldName,
|
|
@@ -26640,20 +26757,18 @@ const SelectedAddress = ({
|
|
|
26640
26757
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
26641
26758
|
className: "plc-p-4 plc-my-4 last:plc-mb-0 plc-rounded plc-text-gray-900 pelcro-address-wrapper plc-shadow-md_dark plc-relative"
|
|
26642
26759
|
}, address && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
26643
|
-
className: "pelcro-select-address-radio plc-order-2",
|
|
26644
|
-
id: `pelcro-address-select-${address.id}`,
|
|
26645
26760
|
name: "address"
|
|
26646
26761
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
26647
26762
|
className: "pelcro-address-name plc-font-semibold"
|
|
26648
|
-
}, t("labels.checkout.billingAddress")), /*#__PURE__*/React__default.createElement("p", {
|
|
26763
|
+
}, t("labels.checkout.billingAddress")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", {
|
|
26649
26764
|
className: "pelcro-address-company"
|
|
26650
26765
|
}, address.company), /*#__PURE__*/React__default.createElement("p", {
|
|
26651
|
-
className: "pelcro-address-
|
|
26766
|
+
className: "pelcro-address-name plc-text-sm plc-mt-2"
|
|
26767
|
+
}, address.first_name, " ", address.last_name), /*#__PURE__*/React__default.createElement("p", {
|
|
26768
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
26652
26769
|
}, address.line1), /*#__PURE__*/React__default.createElement("p", {
|
|
26653
26770
|
className: "pelcro-address-country plc-text-sm"
|
|
26654
|
-
}, address.city, ", ", address.
|
|
26655
|
-
className: "pelcro-address-phone plc-text-sm"
|
|
26656
|
-
}, address === null || address === void 0 ? void 0 : address.phone)), /*#__PURE__*/React__default.createElement(Button, {
|
|
26771
|
+
}, address.city, ", ", address.state, " ", address.postal_code, ",", " ", address.country, ", ", address === null || address === void 0 ? void 0 : address.phone))), /*#__PURE__*/React__default.createElement(Button, {
|
|
26657
26772
|
onClick: onAddNewAddress,
|
|
26658
26773
|
disabled: isLoading,
|
|
26659
26774
|
variant: "ghost",
|
|
@@ -28275,33 +28390,34 @@ const MeterModal = props => {
|
|
|
28275
28390
|
};
|
|
28276
28391
|
MeterModal.viewId = "meter";
|
|
28277
28392
|
|
|
28278
|
-
const
|
|
28279
|
-
|
|
28280
|
-
onFailure = () => {}
|
|
28281
|
-
}) => {
|
|
28282
|
-
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
28393
|
+
const SubscriptionCreateSummary = () => {
|
|
28394
|
+
var _window$Pelcro$user$r, _window, _window$Pelcro, _window$Pelcro$user, _window$Pelcro$user$r2, _window2, _window2$Pelcro, _window2$Pelcro$user, _addresses$find, _addresses$find2;
|
|
28283
28395
|
|
|
28284
28396
|
const {
|
|
28285
28397
|
t
|
|
28286
28398
|
} = useTranslation("checkoutForm");
|
|
28287
28399
|
const {
|
|
28288
28400
|
product,
|
|
28289
|
-
plan
|
|
28401
|
+
plan,
|
|
28402
|
+
selectedAddressId
|
|
28290
28403
|
} = usePelcro();
|
|
28291
|
-
const
|
|
28292
|
-
|
|
28404
|
+
const {
|
|
28405
|
+
addresses
|
|
28406
|
+
} = (_window$Pelcro$user$r = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro = _window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read()) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
28407
|
+
const user = (_window$Pelcro$user$r2 = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Pelcro = _window2.Pelcro) === null || _window2$Pelcro === void 0 ? void 0 : (_window2$Pelcro$user = _window2$Pelcro.user) === null || _window2$Pelcro$user === void 0 ? void 0 : _window2$Pelcro$user.read()) !== null && _window$Pelcro$user$r2 !== void 0 ? _window$Pelcro$user$r2 : [];
|
|
28408
|
+
const address = selectedAddressId ? (_addresses$find = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.id == selectedAddressId)) !== null && _addresses$find !== void 0 ? _addresses$find : null : (_addresses$find2 = addresses === null || addresses === void 0 ? void 0 : addresses.find(address => address.type == "shipping" && address.is_default)) !== null && _addresses$find2 !== void 0 ? _addresses$find2 : null;
|
|
28293
28409
|
|
|
28294
28410
|
const getPricingText = plan => {
|
|
28295
28411
|
var _plan$quantity;
|
|
28296
28412
|
|
|
28297
28413
|
const autoRenewed = plan.auto_renew;
|
|
28298
28414
|
const {
|
|
28299
|
-
interval_translated,
|
|
28300
|
-
interval_count
|
|
28415
|
+
interval_translated: intervalTranslated,
|
|
28416
|
+
interval_count: intervalCount
|
|
28301
28417
|
} = plan;
|
|
28302
28418
|
const intervalText = t("labels.interval", {
|
|
28303
|
-
interval:
|
|
28304
|
-
count:
|
|
28419
|
+
interval: intervalTranslated,
|
|
28420
|
+
count: intervalCount
|
|
28305
28421
|
});
|
|
28306
28422
|
const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
28307
28423
|
return /*#__PURE__*/React__default.createElement("p", {
|
|
@@ -28315,9 +28431,7 @@ const SubscriptionCreateView = ({
|
|
|
28315
28431
|
}, autoRenewed ? "/" : t("labels.for"), " ", intervalText));
|
|
28316
28432
|
};
|
|
28317
28433
|
|
|
28318
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
28319
|
-
id: "pelcro-subscription-create-view"
|
|
28320
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
28434
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
28321
28435
|
className: "plc-flex plc-flex-row plc-items-center plc-mb-6 plc-text-left plc-text-gray-900 pelcro-title-wrapper"
|
|
28322
28436
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
28323
28437
|
className: "plc-w-full plc-font-semibold plc-text-left plc-text-gray-900"
|
|
@@ -28329,7 +28443,49 @@ const SubscriptionCreateView = ({
|
|
|
28329
28443
|
src: product.image,
|
|
28330
28444
|
alt: "",
|
|
28331
28445
|
className: "plc-rounded-md"
|
|
28332
|
-
}))), /*#__PURE__*/React__default.createElement(
|
|
28446
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
28447
|
+
className: "plc-flex plc-flex-row plc-justify-between"
|
|
28448
|
+
}, address && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
28449
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
28450
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
28451
|
+
name: "address"
|
|
28452
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
28453
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
28454
|
+
}, t("labels.shippingAddress")), /*#__PURE__*/React__default.createElement("p", {
|
|
28455
|
+
className: "pelcro-address-company"
|
|
28456
|
+
}, address === null || address === void 0 ? void 0 : address.company), /*#__PURE__*/React__default.createElement("p", {
|
|
28457
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
28458
|
+
}, address === null || address === void 0 ? void 0 : address.first_name, " ", address === null || address === void 0 ? void 0 : address.last_name), /*#__PURE__*/React__default.createElement("p", {
|
|
28459
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
28460
|
+
}, address === null || address === void 0 ? void 0 : address.line1), /*#__PURE__*/React__default.createElement("p", {
|
|
28461
|
+
className: "pelcro-address-country plc-text-sm"
|
|
28462
|
+
}, address === null || address === void 0 ? void 0 : address.city, ", ", address === null || address === void 0 ? void 0 : address.state, " ", address === null || address === void 0 ? void 0 : address.postal_code, ", ", address === null || address === void 0 ? void 0 : address.country))), /*#__PURE__*/React__default.createElement("div", {
|
|
28463
|
+
className: "pelcro-select-address-radio plc-order-2",
|
|
28464
|
+
id: `pelcro-address-select-${address === null || address === void 0 ? void 0 : address.id}`,
|
|
28465
|
+
name: "address"
|
|
28466
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
28467
|
+
className: "pelcro-address-name plc-font-semibold"
|
|
28468
|
+
}, t("labels.contactDetails")), /*#__PURE__*/React__default.createElement("p", {
|
|
28469
|
+
className: "pelcro-address-name plc-text-sm plc-mt-1"
|
|
28470
|
+
}, user.email), /*#__PURE__*/React__default.createElement("p", {
|
|
28471
|
+
className: "pelcro-address-line1 plc-text-sm"
|
|
28472
|
+
}, address === null || address === void 0 ? void 0 : address.phone))));
|
|
28473
|
+
};
|
|
28474
|
+
|
|
28475
|
+
const SubscriptionCreateView = ({
|
|
28476
|
+
onSuccess = () => {},
|
|
28477
|
+
onFailure = () => {}
|
|
28478
|
+
}) => {
|
|
28479
|
+
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
28480
|
+
|
|
28481
|
+
const {
|
|
28482
|
+
plan
|
|
28483
|
+
} = usePelcro();
|
|
28484
|
+
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
28485
|
+
const showSubscriptionButton = skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0;
|
|
28486
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
28487
|
+
id: "pelcro-subscription-create-view"
|
|
28488
|
+
}, /*#__PURE__*/React__default.createElement(SubscriptionCreateSummary, null), /*#__PURE__*/React__default.createElement(PaymentMethodView, {
|
|
28333
28489
|
type: "createPayment",
|
|
28334
28490
|
showCoupon: true,
|
|
28335
28491
|
showExternalPaymentMethods: true,
|
|
@@ -28882,6 +29038,7 @@ const initialState$h = {
|
|
|
28882
29038
|
email: (_window$Pelcro$user$r$1 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r$1 === void 0 ? void 0 : _window$Pelcro$user$r$1.email,
|
|
28883
29039
|
emailError: null,
|
|
28884
29040
|
firstName: (_window$Pelcro$user$r2$1 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2$1 === void 0 ? void 0 : _window$Pelcro$user$r2$1.first_name,
|
|
29041
|
+
firstNameError: null,
|
|
28885
29042
|
lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
|
|
28886
29043
|
lastNameError: null,
|
|
28887
29044
|
username: (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.username,
|
|
@@ -29013,17 +29170,26 @@ const UserUpdateContainer = ({
|
|
|
29013
29170
|
|
|
29014
29171
|
case SET_EMAIL:
|
|
29015
29172
|
return lib_7({ ...state,
|
|
29016
|
-
email: action.payload
|
|
29173
|
+
email: action.payload,
|
|
29174
|
+
emailError: null
|
|
29017
29175
|
});
|
|
29018
29176
|
|
|
29019
29177
|
case SET_EMAIL_ERROR:
|
|
29020
29178
|
return lib_7({ ...state,
|
|
29021
|
-
emailError: action.payload
|
|
29179
|
+
emailError: action.payload,
|
|
29180
|
+
email: ""
|
|
29022
29181
|
});
|
|
29023
29182
|
|
|
29024
29183
|
case SET_FIRST_NAME:
|
|
29025
29184
|
return lib_7({ ...state,
|
|
29026
|
-
firstName: action.payload
|
|
29185
|
+
firstName: action.payload,
|
|
29186
|
+
firstNameError: null
|
|
29187
|
+
});
|
|
29188
|
+
|
|
29189
|
+
case SET_FIRST_NAME_ERROR:
|
|
29190
|
+
return lib_7({ ...state,
|
|
29191
|
+
firstNameError: action.payload,
|
|
29192
|
+
firstName: ""
|
|
29027
29193
|
});
|
|
29028
29194
|
|
|
29029
29195
|
case SET_DISPLAY_NAME:
|
|
@@ -29033,7 +29199,14 @@ const UserUpdateContainer = ({
|
|
|
29033
29199
|
|
|
29034
29200
|
case SET_LAST_NAME:
|
|
29035
29201
|
return lib_7({ ...state,
|
|
29036
|
-
lastName: action.payload
|
|
29202
|
+
lastName: action.payload,
|
|
29203
|
+
lastNameError: null
|
|
29204
|
+
});
|
|
29205
|
+
|
|
29206
|
+
case SET_LAST_NAME_ERROR:
|
|
29207
|
+
return lib_7({ ...state,
|
|
29208
|
+
lastNameError: action.payload,
|
|
29209
|
+
lastName: ""
|
|
29037
29210
|
});
|
|
29038
29211
|
|
|
29039
29212
|
case SET_USERNAME:
|
|
@@ -29399,8 +29572,6 @@ const nowDate$1 = new Date();
|
|
|
29399
29572
|
const nowDateISO$1 = nowDate$1.toISOString().substr(0, 10);
|
|
29400
29573
|
const hundredYearsFromNowDateISO = new Date(new Date().setFullYear(nowDate$1.getFullYear() - 100)).toISOString().substr(0, 10);
|
|
29401
29574
|
const UserUpdateDateOfBirth = props => {
|
|
29402
|
-
var _state$dateOfBirth;
|
|
29403
|
-
|
|
29404
29575
|
// const { t } = useTranslation("userEdit");
|
|
29405
29576
|
const {
|
|
29406
29577
|
dispatch,
|
|
@@ -29421,7 +29592,7 @@ const UserUpdateDateOfBirth = props => {
|
|
|
29421
29592
|
return /*#__PURE__*/React__default.createElement(DatePicker, Object.assign({
|
|
29422
29593
|
min: hundredYearsFromNowDateISO,
|
|
29423
29594
|
max: nowDateISO$1,
|
|
29424
|
-
value:
|
|
29595
|
+
value: state.dateOfBirth,
|
|
29425
29596
|
onChange: e => handleInputChange(e.target.value) // tooltipText={t("labels.dateOfBirth")}
|
|
29426
29597
|
|
|
29427
29598
|
}, props));
|
|
@@ -31063,13 +31234,6 @@ function AddressUpdatePhone(props) {
|
|
|
31063
31234
|
}
|
|
31064
31235
|
} = useContext(store$f);
|
|
31065
31236
|
|
|
31066
|
-
const handleBlur = () => {
|
|
31067
|
-
return dispatch({
|
|
31068
|
-
type: VALIDATE_FIELD,
|
|
31069
|
-
payload: "phone"
|
|
31070
|
-
});
|
|
31071
|
-
};
|
|
31072
|
-
|
|
31073
31237
|
const handleInputChange = value => {
|
|
31074
31238
|
dispatch({
|
|
31075
31239
|
type: SET_TEXT_FIELD,
|
|
@@ -31094,7 +31258,6 @@ function AddressUpdatePhone(props) {
|
|
|
31094
31258
|
value: phone,
|
|
31095
31259
|
error: phoneError,
|
|
31096
31260
|
onChange: e => handleInputChange(e.target.value),
|
|
31097
|
-
onBlur: handleBlur,
|
|
31098
31261
|
onFocus: handleFocus
|
|
31099
31262
|
}, props));
|
|
31100
31263
|
}
|
|
@@ -31157,8 +31320,7 @@ const AddressUpdateView = props => {
|
|
|
31157
31320
|
}, /*#__PURE__*/React__default.createElement(AddressUpdatePhone, {
|
|
31158
31321
|
id: "pelcro-input-phone",
|
|
31159
31322
|
errorId: "pelcro-input-phone-error",
|
|
31160
|
-
label: t("labels.phone")
|
|
31161
|
-
required: true
|
|
31323
|
+
label: t("labels.phone")
|
|
31162
31324
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
31163
31325
|
className: "plc-flex plc-space-x-3 plc-items-start plc-mb-3"
|
|
31164
31326
|
}, /*#__PURE__*/React__default.createElement(AddressUpdateSetDefault, {
|