@alma/widgets 3.1.3 → 3.2.0
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/raw/widgets.js +147 -66
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +147 -66
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +99 -24
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +147 -66
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +4 -2
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +4 -2
- package/dist/types/Widgets/EligibilityModal/components/Info/index.d.ts +3 -1
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/widgets.js +1 -1
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.m.js +1 -1
- package/dist/widgets.m.js.map +1 -1
- package/dist/widgets.modern.js +1 -1
- package/dist/widgets.modern.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/raw/widgets.js
CHANGED
|
@@ -1554,6 +1554,9 @@ function formatCents(cents) {
|
|
|
1554
1554
|
return String(priceFromCents(cents)).replace('.', ',');
|
|
1555
1555
|
}
|
|
1556
1556
|
var desktopWidth = 800;
|
|
1557
|
+
var isP1X = function isP1X(plan) {
|
|
1558
|
+
return (plan == null ? void 0 : plan.installments_count) === 1 && (plan == null ? void 0 : plan.deferred_days) === 0 && (plan == null ? void 0 : plan.deferred_months) === 0;
|
|
1559
|
+
};
|
|
1557
1560
|
|
|
1558
1561
|
/* eslint-disable */
|
|
1559
1562
|
|
|
@@ -1888,6 +1891,9 @@ var messagesDE = {
|
|
|
1888
1891
|
"eligibility-modal.bullet-2": "Lassen Sie sich führen und bestätigen Sie Ihre Zahlung in <strong>2 Minuten.</strong>",
|
|
1889
1892
|
"eligibility-modal.bullet-3": "<strong>Behalten Sie die Kontrolle</strong> , indem Sie Ihre Fristen in Ihrem eigenen Tempo vor- oder zurückverlegen.",
|
|
1890
1893
|
"eligibility-modal.no-eligibility": "Ups, die Prüfung hat anscheinend nicht funktioniert.",
|
|
1894
|
+
"eligibility-modal.p1x-bullet-1": "Wählen Sie <strong>Alma - 1X</strong> bei der Bezahlung.",
|
|
1895
|
+
"eligibility-modal.p1x-bullet-2": "Füllen Sie die Informationen auf Ihrer <strong>Kreditkarte aus.</strong>",
|
|
1896
|
+
"eligibility-modal.p1x-bullet-3": "<strong>Die Bestätigung </strong> Ihrer Zahlung erfolgt sofort!",
|
|
1891
1897
|
"eligibility-modal.title-deferred-plan": "Zahlen Sie mit Alma in Raten oder später.",
|
|
1892
1898
|
"eligibility-modal.title-normal": "Zahlen Sie mit Alma in mehreren Raten.",
|
|
1893
1899
|
"installments.today": "Heute",
|
|
@@ -1900,7 +1906,8 @@ var messagesDE = {
|
|
|
1900
1906
|
"payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
|
|
1901
1907
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1902
1908
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1903
|
-
"payment-plan-strings.no-fee": "(0% Finanzierung)"
|
|
1909
|
+
"payment-plan-strings.no-fee": "(0% Finanzierung)",
|
|
1910
|
+
"payment-plan-strings.pay-now": "Bezahlen Sie jetzt {totalAmount}"
|
|
1904
1911
|
};
|
|
1905
1912
|
|
|
1906
1913
|
var messagesEN = {
|
|
@@ -1911,6 +1918,9 @@ var messagesEN = {
|
|
|
1911
1918
|
"eligibility-modal.bullet-2": "Let us guide you and validate your payment in <strong>2 minutes.</strong>",
|
|
1912
1919
|
"eligibility-modal.bullet-3": "<strong>Stay in control</strong> by moving your deadlines forward or backward at your own pace.",
|
|
1913
1920
|
"eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
|
|
1921
|
+
"eligibility-modal.p1x-bullet-1": "Choose <strong>Alma - 1X</strong> at checkout.",
|
|
1922
|
+
"eligibility-modal.p1x-bullet-2": "Fill in your <strong>credit card information.</strong>",
|
|
1923
|
+
"eligibility-modal.p1x-bullet-3": "<strong>The validation </strong> of your payment is instantaneous!",
|
|
1914
1924
|
"eligibility-modal.title-deferred-plan": "Pay in installments or later by credit card with Alma.",
|
|
1915
1925
|
"eligibility-modal.title-normal": "Pay in installments by credit card with Alma.",
|
|
1916
1926
|
"installments.today": "Today",
|
|
@@ -1923,7 +1933,8 @@ var messagesEN = {
|
|
|
1923
1933
|
"payment-plan-strings.ineligible-lower-than-min": "From {minAmount}",
|
|
1924
1934
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1925
1935
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1926
|
-
"payment-plan-strings.no-fee": "(free of charge)"
|
|
1936
|
+
"payment-plan-strings.no-fee": "(free of charge)",
|
|
1937
|
+
"payment-plan-strings.pay-now": "Pay now {totalAmount}"
|
|
1927
1938
|
};
|
|
1928
1939
|
|
|
1929
1940
|
var messagesES = {
|
|
@@ -1934,6 +1945,9 @@ var messagesES = {
|
|
|
1934
1945
|
"eligibility-modal.bullet-2": "Déjese guiar y valide su pago en <strong>2 minutos.</strong>",
|
|
1935
1946
|
"eligibility-modal.bullet-3": "<strong>Mantenga el control</strong> adelantando o retrasando los plazos a su propio ritmo.",
|
|
1936
1947
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1948
|
+
"eligibility-modal.p1x-bullet-1": "Elija <strong>Alma - 1X</strong> en la caja.",
|
|
1949
|
+
"eligibility-modal.p1x-bullet-2": "Introduzca los datos de su tarjeta de crédito en <strong>.</strong>",
|
|
1950
|
+
"eligibility-modal.p1x-bullet-3": "<strong>¡La validación </strong> de su pago es instantánea!",
|
|
1937
1951
|
"eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
|
|
1938
1952
|
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
|
|
1939
1953
|
"installments.today": "Hoy",
|
|
@@ -1946,7 +1960,8 @@ var messagesES = {
|
|
|
1946
1960
|
"payment-plan-strings.ineligible-lower-than-min": "Desde {minAmount}",
|
|
1947
1961
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} hoy, después {numberOfRemainingInstallments} mensualidad de {othersInstallmentAmount}} other {{firstInstallmentAmount} hoy, después {numberOfRemainingInstallments} mensualidades de {othersInstallmentAmount}}}",
|
|
1948
1962
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} plazos de {totalAmount}",
|
|
1949
|
-
"payment-plan-strings.no-fee": "(sin intereses)"
|
|
1963
|
+
"payment-plan-strings.no-fee": "(sin intereses)",
|
|
1964
|
+
"payment-plan-strings.pay-now": "Pague ahora {totalAmount}"
|
|
1950
1965
|
};
|
|
1951
1966
|
|
|
1952
1967
|
var messagesFR = {
|
|
@@ -1957,6 +1972,9 @@ var messagesFR = {
|
|
|
1957
1972
|
"eligibility-modal.bullet-2": "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
1958
1973
|
"eligibility-modal.bullet-3": "<strong>Gardez le contrôle</strong> en avançant ou reculant vos échéances à votre rythme.",
|
|
1959
1974
|
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
|
|
1975
|
+
"eligibility-modal.p1x-bullet-1": "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
1976
|
+
"eligibility-modal.p1x-bullet-2": "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
1977
|
+
"eligibility-modal.p1x-bullet-3": "<strong>La validation </strong> de votre paiement est instantanée !",
|
|
1960
1978
|
"eligibility-modal.title-deferred-plan": "Payez en plusieurs fois ou plus tard par carte bancaire avec Alma.",
|
|
1961
1979
|
"eligibility-modal.title-normal": "Payez en plusieurs fois par carte bancaire avec Alma.",
|
|
1962
1980
|
"installments.today": "Aujourd'hui",
|
|
@@ -1969,7 +1987,8 @@ var messagesFR = {
|
|
|
1969
1987
|
"payment-plan-strings.ineligible-lower-than-min": "À partir de {minAmount}",
|
|
1970
1988
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1971
1989
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1972
|
-
"payment-plan-strings.no-fee": "(sans frais)"
|
|
1990
|
+
"payment-plan-strings.no-fee": "(sans frais)",
|
|
1991
|
+
"payment-plan-strings.pay-now": "Payez maintenant {totalAmount}"
|
|
1973
1992
|
};
|
|
1974
1993
|
|
|
1975
1994
|
var messagesIT = {
|
|
@@ -1980,6 +1999,9 @@ var messagesIT = {
|
|
|
1980
1999
|
"eligibility-modal.bullet-2": "Lasciatevi guidare e convalidate il pagamento in <strong>2 minuti.</strong>",
|
|
1981
2000
|
"eligibility-modal.bullet-3": "<strong>Mantenete il controllo</strong> spostando le scadenze in avanti o indietro al vostro ritmo.",
|
|
1982
2001
|
"eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
|
|
2002
|
+
"eligibility-modal.p1x-bullet-1": "Scegliere <strong>Alma - 1X</strong> alla cassa.",
|
|
2003
|
+
"eligibility-modal.p1x-bullet-2": "Compilare i dati della carta di credito <strong>.</strong>",
|
|
2004
|
+
"eligibility-modal.p1x-bullet-3": "<strong>La convalida </strong> del vostro pagamento è istantanea!",
|
|
1983
2005
|
"eligibility-modal.title-deferred-plan": "Paga a rate o posticipa il pagamento con Alma, senza registrazione.",
|
|
1984
2006
|
"eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
|
|
1985
2007
|
"installments.today": "Oggi",
|
|
@@ -1992,7 +2014,8 @@ var messagesIT = {
|
|
|
1992
2014
|
"payment-plan-strings.ineligible-lower-than-min": "Pagamento rateale disponibile a partire da {minAmount}",
|
|
1993
2015
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {Oggi paghi {firstInstallmentAmount} poi tra {numberOfRemainingInstallments} mese {othersInstallmentAmount}} other {Oggi paghi {firstInstallmentAmount} poi {numberOfRemainingInstallments} rate mensili di {othersInstallmentAmount}}}",
|
|
1994
2016
|
"payment-plan-strings.multiple-installments-same-amount": "In {installmentsCount} rate mensili di {totalAmount}",
|
|
1995
|
-
"payment-plan-strings.no-fee": "(senza interessi)"
|
|
2017
|
+
"payment-plan-strings.no-fee": "(senza interessi)",
|
|
2018
|
+
"payment-plan-strings.pay-now": "Paga ora {totalAmount}"
|
|
1996
2019
|
};
|
|
1997
2020
|
|
|
1998
2021
|
var messagesNL = {
|
|
@@ -2003,6 +2026,9 @@ var messagesNL = {
|
|
|
2003
2026
|
"eligibility-modal.bullet-2": "Laat ons u begeleiden en uw betaling valideren in <strong>2 minuten.</strong>",
|
|
2004
2027
|
"eligibility-modal.bullet-3": "<strong>Houd de controle op</strong> door uw deadlines in uw eigen tempo vooruit of achteruit te schuiven.",
|
|
2005
2028
|
"eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
|
|
2029
|
+
"eligibility-modal.p1x-bullet-1": "Kies <strong>Alma - 1X</strong> bij het afrekenen.",
|
|
2030
|
+
"eligibility-modal.p1x-bullet-2": "Vul uw <strong>creditcardgegevens in.</strong>",
|
|
2031
|
+
"eligibility-modal.p1x-bullet-3": "<strong>De validatie </strong> van uw betaling is onmiddellijk!",
|
|
2006
2032
|
"eligibility-modal.title-deferred-plan": "Betaal in termijnen of later per creditcard met Alma.",
|
|
2007
2033
|
"eligibility-modal.title-normal": "Betaal in termijnen met een creditcard bij Alma.",
|
|
2008
2034
|
"installments.today": "Tegenwoordig",
|
|
@@ -2015,7 +2041,8 @@ var messagesNL = {
|
|
|
2015
2041
|
"payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
|
|
2016
2042
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
2017
2043
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
2018
|
-
"payment-plan-strings.no-fee": "(zonder kosten)"
|
|
2044
|
+
"payment-plan-strings.no-fee": "(zonder kosten)",
|
|
2045
|
+
"payment-plan-strings.pay-now": "Betaal nu {totalAmount}"
|
|
2019
2046
|
};
|
|
2020
2047
|
|
|
2021
2048
|
var messagesPT = {
|
|
@@ -2026,6 +2053,9 @@ var messagesPT = {
|
|
|
2026
2053
|
"eligibility-modal.bullet-2": "Deixe-nos guiá-lo e validar o seu pagamento em <strong>2 minutos.</strong>",
|
|
2027
2054
|
"eligibility-modal.bullet-3": "<strong>Mantenha-se em controlo</strong> avançando ou recuando os seus prazos ao seu próprio ritmo.",
|
|
2028
2055
|
"eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
|
|
2056
|
+
"eligibility-modal.p1x-bullet-1": "Escolher <strong>Alma - 1X</strong> no checkout.",
|
|
2057
|
+
"eligibility-modal.p1x-bullet-2": "Preencha as informações do seu <strong>cartão de crédito.</strong>",
|
|
2058
|
+
"eligibility-modal.p1x-bullet-3": "<strong>A validação </strong> do seu pagamento é instantânea!",
|
|
2029
2059
|
"eligibility-modal.title-deferred-plan": "Pagar em prestações ou mais tarde por cartão de crédito com Alma.",
|
|
2030
2060
|
"eligibility-modal.title-normal": "Pagar em prestações por cartão de crédito com Alma.",
|
|
2031
2061
|
"installments.today": "Hoje",
|
|
@@ -2038,7 +2068,8 @@ var messagesPT = {
|
|
|
2038
2068
|
"payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
|
|
2039
2069
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
2040
2070
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
2041
|
-
"payment-plan-strings.no-fee": "(sem encargos)"
|
|
2071
|
+
"payment-plan-strings.no-fee": "(sem encargos)",
|
|
2072
|
+
"payment-plan-strings.pay-now": "Pague agora {totalAmount}"
|
|
2042
2073
|
};
|
|
2043
2074
|
|
|
2044
2075
|
var getTranslationsByLocale = function getTranslationsByLocale(locale) {
|
|
@@ -2158,17 +2189,13 @@ var getPaymentPlanBoundaries = function getPaymentPlanBoundaries(plan, configPla
|
|
|
2158
2189
|
};
|
|
2159
2190
|
|
|
2160
2191
|
var filterELigibility = function filterELigibility(eligibilities, configPlans) {
|
|
2161
|
-
//
|
|
2162
|
-
var filteredEligibilityPlans = eligibilities.filter(function (plan) {
|
|
2163
|
-
return !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0);
|
|
2164
|
-
}); // If no configPlans was provided, return eligibility response
|
|
2165
|
-
|
|
2192
|
+
// If no configPlans was provided, return eligibility response
|
|
2166
2193
|
if (!configPlans) {
|
|
2167
|
-
return
|
|
2194
|
+
return eligibilities;
|
|
2168
2195
|
} // Else check if the plan is eligible regarding the related configPlan
|
|
2169
2196
|
|
|
2170
2197
|
|
|
2171
|
-
return
|
|
2198
|
+
return eligibilities.map(function (plan) {
|
|
2172
2199
|
var eligibilityDeferredDays = (plan.deferred_months ? plan.deferred_months : 0) * 30 + (plan.deferred_days ? plan.deferred_days : 0); // find the related configPlan
|
|
2173
2200
|
|
|
2174
2201
|
var relatedConfigPlan = configPlans.find(function (configPlan) {
|
|
@@ -2402,7 +2429,8 @@ var paymentPlanShorthandName = function paymentPlanShorthandName(payment) {
|
|
|
2402
2429
|
installmentsCount = payment.installments_count;
|
|
2403
2430
|
var deferredDaysCount = deferred_days + deferred_months * 30;
|
|
2404
2431
|
|
|
2405
|
-
if (installmentsCount === 1) {
|
|
2432
|
+
if (installmentsCount === 1 && deferredDaysCount > 0) {
|
|
2433
|
+
// For now there is no distinction between deferred days and deferred months, it will be J+ anyway
|
|
2406
2434
|
return /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2407
2435
|
id: "payment-plan-strings.day-abbreviation",
|
|
2408
2436
|
defaultMessage: "J{numberOfDeferredDays}",
|
|
@@ -2491,6 +2519,21 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
|
|
|
2491
2519
|
return index === 0 || installment.total_amount === payment_plan[0].total_amount;
|
|
2492
2520
|
});
|
|
2493
2521
|
|
|
2522
|
+
if (isP1X(payment)) {
|
|
2523
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2524
|
+
id: "payment-plan-strings.pay-now",
|
|
2525
|
+
defaultMessage: "Payez maintenant {totalAmount}",
|
|
2526
|
+
values: {
|
|
2527
|
+
totalAmount: /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
|
|
2528
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
2529
|
+
style: "currency",
|
|
2530
|
+
currency: "EUR"
|
|
2531
|
+
}),
|
|
2532
|
+
installmentsCount: installmentsCount
|
|
2533
|
+
}
|
|
2534
|
+
}), withNoFee(payment));
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2494
2537
|
if (areInstallmentsOfSameAmount) {
|
|
2495
2538
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2496
2539
|
id: "payment-plan-strings.multiple-installments-same-amount",
|
|
@@ -2797,53 +2840,82 @@ var Cards = function Cards(_ref) {
|
|
|
2797
2840
|
|
|
2798
2841
|
var s$7 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2799
2842
|
|
|
2800
|
-
var Info = function Info() {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2843
|
+
var Info = function Info(_ref) {
|
|
2844
|
+
var isCurrentPlanP1X = _ref.isCurrentPlanP1X;
|
|
2845
|
+
return (
|
|
2846
|
+
/*#__PURE__*/
|
|
2847
|
+
// TODO: refactor this component into subcomponent to factorise code and be cleaner
|
|
2848
|
+
React__default.createElement("div", {
|
|
2849
|
+
className: cx(s$7.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2850
|
+
"data-testid": "modal-info-element"
|
|
2851
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2852
|
+
className: s$7.listItem
|
|
2853
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2854
|
+
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2855
|
+
}, "1"), /*#__PURE__*/React__default.createElement("div", {
|
|
2856
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2857
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2858
|
+
id: "eligibility-modal.p1x-bullet-1",
|
|
2859
|
+
defaultMessage: "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
2860
|
+
values: {
|
|
2861
|
+
strong: function strong() {
|
|
2862
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2863
|
+
}
|
|
2816
2864
|
}
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2825
|
-
id: "eligibility-modal.bullet-2",
|
|
2826
|
-
defaultMessage: "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
2827
|
-
values: {
|
|
2828
|
-
strong: function strong() {
|
|
2829
|
-
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2865
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2866
|
+
id: "eligibility-modal.bullet-1",
|
|
2867
|
+
defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
|
|
2868
|
+
values: {
|
|
2869
|
+
strong: function strong() {
|
|
2870
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2871
|
+
}
|
|
2830
2872
|
}
|
|
2831
|
-
}
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2873
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2874
|
+
className: s$7.listItem
|
|
2875
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2876
|
+
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2877
|
+
}, "2"), /*#__PURE__*/React__default.createElement("div", {
|
|
2878
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2879
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2880
|
+
id: "eligibility-modal.p1x-bullet-2",
|
|
2881
|
+
defaultMessage: "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
2882
|
+
values: {
|
|
2883
|
+
strong: function strong() {
|
|
2884
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2885
|
+
}
|
|
2844
2886
|
}
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2887
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2888
|
+
id: "eligibility-modal.bullet-2",
|
|
2889
|
+
defaultMessage: "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
2890
|
+
values: {
|
|
2891
|
+
strong: function strong() {
|
|
2892
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2896
|
+
className: s$7.listItem
|
|
2897
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2898
|
+
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2899
|
+
}, "3"), /*#__PURE__*/React__default.createElement("div", {
|
|
2900
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2901
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2902
|
+
id: "eligibility-modal.p1x-bullet-3",
|
|
2903
|
+
defaultMessage: "<strong>La validation </strong> de votre paiement est instantan\xE9e !",
|
|
2904
|
+
values: {
|
|
2905
|
+
strong: function strong() {
|
|
2906
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2910
|
+
id: "eligibility-modal.bullet-3",
|
|
2911
|
+
defaultMessage: "<strong>Gardez le contr\xF4le</strong> en avan\xE7ant ou reculant vos \xE9ch\xE9ances \xE0 votre rythme.",
|
|
2912
|
+
values: {
|
|
2913
|
+
strong: function strong() {
|
|
2914
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
}))))
|
|
2918
|
+
);
|
|
2847
2919
|
};
|
|
2848
2920
|
|
|
2849
2921
|
var s$8 = {"title":"_3ERx-"};
|
|
@@ -2867,7 +2939,8 @@ var s$9 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC","logo":"_xW3wt"
|
|
|
2867
2939
|
var DesktopModal = function DesktopModal(_ref) {
|
|
2868
2940
|
var children = _ref.children,
|
|
2869
2941
|
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2870
|
-
cards = _ref.cards
|
|
2942
|
+
cards = _ref.cards,
|
|
2943
|
+
isCurrentPlanP1X = _ref.isCurrentPlanP1X;
|
|
2871
2944
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2872
2945
|
className: cx(s$9.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
|
|
2873
2946
|
"data-testid": "modal-container"
|
|
@@ -2875,7 +2948,9 @@ var DesktopModal = function DesktopModal(_ref) {
|
|
|
2875
2948
|
className: cx([s$9.block, s$9.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2876
2949
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
2877
2950
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2878
|
-
}), /*#__PURE__*/React__default.createElement(Info,
|
|
2951
|
+
}), /*#__PURE__*/React__default.createElement(Info, {
|
|
2952
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2953
|
+
}), cards && /*#__PURE__*/React__default.createElement(Cards, {
|
|
2879
2954
|
cards: cards
|
|
2880
2955
|
}), /*#__PURE__*/React__default.createElement(AlmaLogo, {
|
|
2881
2956
|
className: s$9.logo,
|
|
@@ -2892,13 +2967,16 @@ var s$b = {"container":"_2G7Ch","logo":"_2779r"};
|
|
|
2892
2967
|
var MobileModal = function MobileModal(_ref) {
|
|
2893
2968
|
var children = _ref.children,
|
|
2894
2969
|
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2895
|
-
cards = _ref.cards
|
|
2970
|
+
cards = _ref.cards,
|
|
2971
|
+
isCurrentPlanP1X = _ref.isCurrentPlanP1X;
|
|
2896
2972
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2897
2973
|
className: cx(s$b.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
|
|
2898
2974
|
"data-testid": "modal-container"
|
|
2899
2975
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
2900
2976
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2901
|
-
}), children, /*#__PURE__*/React__default.createElement(Info,
|
|
2977
|
+
}), children, /*#__PURE__*/React__default.createElement(Info, {
|
|
2978
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2979
|
+
}), cards && /*#__PURE__*/React__default.createElement(Cards, {
|
|
2902
2980
|
cards: cards
|
|
2903
2981
|
}), /*#__PURE__*/React__default.createElement(AlmaLogo, {
|
|
2904
2982
|
className: s$b.logo,
|
|
@@ -2935,7 +3013,8 @@ var EligibilityModal = function EligibilityModal(_ref) {
|
|
|
2935
3013
|
isOpen: true
|
|
2936
3014
|
}, /*#__PURE__*/React__default.createElement(ModalComponent, {
|
|
2937
3015
|
isSomePlanDeferred: isSomePlanDeferred,
|
|
2938
|
-
cards: cards
|
|
3016
|
+
cards: cards,
|
|
3017
|
+
isCurrentPlanP1X: isP1X(currentPlan)
|
|
2939
3018
|
}, status === apiStatus.PENDING && /*#__PURE__*/React__default.createElement("div", {
|
|
2940
3019
|
className: s$a.loader
|
|
2941
3020
|
}, /*#__PURE__*/React__default.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3052,7 +3131,9 @@ var getIndexOfActivePlan = function getIndexOfActivePlan(_ref) {
|
|
|
3052
3131
|
var _loop = function _loop(index) {
|
|
3053
3132
|
var installmentsCount = suggestedPaymentPlanArray[index];
|
|
3054
3133
|
var planFound = eligibilityPlans.findIndex(function (plan) {
|
|
3055
|
-
return plan.installments_count === installmentsCount && plan.eligible
|
|
3134
|
+
return plan.installments_count === installmentsCount && plan.eligible && // Remove the PayLater plans from the plan to target, we will code a better solution later
|
|
3135
|
+
// To differentiate P1X from PayLater while using the `suggestedPaymentPlan` property.
|
|
3136
|
+
!plan.deferred_days && !plan.deferred_months;
|
|
3056
3137
|
});
|
|
3057
3138
|
|
|
3058
3139
|
if (planFound !== -1) {
|
|
@@ -3091,7 +3172,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
3091
3172
|
|
|
3092
3173
|
var s$d = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","monochrome":"_2hx83","notEligible":"_3O1bg","hideBorder":"_3_qcn","info":"_25GrF","loader":"_30j1O","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
3093
3174
|
|
|
3094
|
-
var VERY_LONG_TIME_IN_MS = 1000 * 3600
|
|
3175
|
+
var VERY_LONG_TIME_IN_MS = 1000 * 3600;
|
|
3095
3176
|
var DEFAULT_TRANSITION_TIME = 5500;
|
|
3096
3177
|
|
|
3097
3178
|
var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|