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