@redneckz/wildless-cms-uni-blocks 0.2.82 → 0.2.85
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/bundle/bundle.umd.js +155 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.js +9 -5
- package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/dist/components/Footer/SocialMedia.js +2 -2
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +7 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.js +10 -6
- package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/lib/components/Footer/SocialMedia.js +2 -2
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.js +7 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +1 -1
- package/package.json +16 -15
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +7 -0
- package/src/components/CreditCalculator/CreditCalculator.tsx +15 -17
- package/src/components/Footer/SocialMedia.tsx +3 -10
- package/src/components/Header/HeaderSecondaryMenu.tsx +4 -8
- package/src/components/Header/HeaderSecondaryMenuButton.tsx +1 -1
- package/src/icons/GridIcon.svg +4 -7
- package/src/ui-kit/Icon/Icon.tsx +23 -9
- package/src/ui-kit/Icon/IconProps.ts +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -273,7 +273,13 @@
|
|
|
273
273
|
return (jsxs("div", { className: buttonInnerClasses, children: [appendLeft ? appendLeft : null, !withoutText ? (jsxs("div", { children: [jsx("div", { className: "text-xxs text-left", children: aboveText }), jsx("div", { className: "text-sm font-medium text-left", children: text })] })) : null] }));
|
|
274
274
|
});
|
|
275
275
|
|
|
276
|
-
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt,
|
|
276
|
+
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
277
|
+
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
278
|
+
if (asSVG) {
|
|
279
|
+
return (jsxs("svg", { className: className, ...imgProps, "aria-hidden": "true", children: [title ? jsx("title", { children: title }) : null, alt ? jsx("desc", { children: alt }) : null, jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }));
|
|
280
|
+
}
|
|
281
|
+
return (jsx("img", { className: className, src: href, alt: alt, title: title, ...imgProps, "aria-hidden": "true" }));
|
|
282
|
+
});
|
|
277
283
|
|
|
278
284
|
const Img = JSX(({ className, image }) => (jsxs("picture", { className: `${className || ''}`, children: [image.sources?.length
|
|
279
285
|
? image.sources.map(({ src, format }, index) => (jsx("source", { srcSet: src, type: formatToMimeType(format) }, `${index}_${src}`)))
|
|
@@ -369,7 +375,7 @@
|
|
|
369
375
|
const BaseTile = JSX(({ className, context, title, titleSize, description, children, buttons, image, items, version = 'primary', }) => {
|
|
370
376
|
const router = context.useRouter();
|
|
371
377
|
const { handlerDecorator } = context;
|
|
372
|
-
return (jsxs("div", { className: `font-sans flex flex-col grow h-full`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: TITLE_CLASSES, children: title })), jsxs("div", { className: "flex grow justify-between", children: [jsxs("div", { className: "flex flex-col justify-between items-start", children: [jsxs("div", { children: [description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mb-5", children: description })) : null, children, items?.length ? renderItems$1(items, version) : null] }), buttons?.length ? (jsx("div", { className: "flex mt-9 gap-3", children: buttons.map((button, index) => renderButton(useLink({ router, handlerDecorator }, button), index)) })) : null] }), image?.src && jsx(Img, { className: "mt-auto ml-7", image: image })] })] }));
|
|
378
|
+
return (jsxs("div", { className: `font-sans flex flex-col grow h-full`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: TITLE_CLASSES, children: title })), jsxs("div", { className: "flex grow justify-between", children: [jsxs("div", { className: "flex flex-col justify-between items-start", children: [jsxs("div", { children: [description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mb-5", children: description })) : null, children, items?.length ? renderItems$1(items, version) : null] }), buttons?.length ? (jsx("div", { className: "flex mt-9 gap-3", children: buttons.map((button, index) => renderButton$1(useLink({ router, handlerDecorator }, button), index)) })) : null] }), image?.src && jsx(Img, { className: "mt-auto ml-7", image: image })] })] }));
|
|
373
379
|
});
|
|
374
380
|
function getTitleSizeByClassName(className = '') {
|
|
375
381
|
const colSpan = getColSpan(className);
|
|
@@ -386,7 +392,7 @@
|
|
|
386
392
|
function renderItems$1(items = [], version) {
|
|
387
393
|
return (jsx("section", { className: "max-w-[600px]", role: "list", children: items.map((_, i) => (jsx(BlockItem, { className: i ? 'mt-2.5' : '', text: _, version: version }, String(i)))) }));
|
|
388
394
|
}
|
|
389
|
-
function renderButton({ icon, ...button }, i) {
|
|
395
|
+
function renderButton$1({ icon, ...button }, i) {
|
|
390
396
|
if (!button?.text)
|
|
391
397
|
return;
|
|
392
398
|
if (icon)
|
|
@@ -613,7 +619,7 @@
|
|
|
613
619
|
const { icon, label, width, height } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
614
620
|
if (!icon)
|
|
615
621
|
return null;
|
|
616
|
-
return (jsx(Button, { rounded: true, href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "border-solid border border-main-divider w-9 h-9 flex items-center justify-center hover:fill-primary-main", appendLeft: jsx(Icon, { name: icon, width: width, height: height,
|
|
622
|
+
return (jsx(Button, { rounded: true, href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "border-solid border border-main-divider w-9 h-9 flex items-center justify-center hover:fill-primary-main", appendLeft: jsx(Icon, { name: icon, width: width, height: height, asSVG: true }) }));
|
|
617
623
|
});
|
|
618
624
|
|
|
619
625
|
const TextInformation = JSX(({ className, links, context }) => {
|
|
@@ -697,11 +703,11 @@
|
|
|
697
703
|
return (jsx("a", { className: `inline-block border border-solid bg-transparent text-center no-underline ${flat ? '' : 'px-4 py-2'} ${linkStyle} ${className || ''}`, href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": ariaLabel, children: jsx("span", { className: `font-sans font-normal text-sm ${textStyle}`, children: text || children }) }));
|
|
698
704
|
});
|
|
699
705
|
|
|
700
|
-
const HeaderSecondaryMenuButton = JSX(({ className, children, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${className || ''}`, disabled: true, "aria-label": ariaLabel, children: children })));
|
|
706
|
+
const HeaderSecondaryMenuButton = JSX(({ className, children, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${className || ''}`, disabled: true, "aria-label": ariaLabel, children: children })));
|
|
701
707
|
|
|
702
708
|
const HeaderSecondaryMenu = JSX(({ context, className, defaultLocation = '' }) => {
|
|
703
709
|
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
704
|
-
return (jsxs("div", { className: `flex items-center ${className || ''}`, children: [jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: jsx(Icon, { name: "LoupeIcon", "aria-hidden": "true" }) }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: jsx(Icon, { name: "ProfileIcon", "aria-hidden": "true" }) }), jsx(HeaderSecondaryMenuButton, { className: "
|
|
710
|
+
return (jsxs("div", { className: `flex items-center ${className || ''}`, children: [jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: jsx(Icon, { name: "LoupeIcon", "aria-hidden": "true", className: "h-full", asSVG: true }) }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: jsx(Icon, { name: "ProfileIcon", "aria-hidden": "true", className: "h-full", asSVG: true }) }), jsx(HeaderSecondaryMenuButton, { className: "min-w-[32px] min-h-[32px] fill-secondary-light hover:fill-secondary-hover", ariaLabel: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0441\u044B\u043B\u043A\u0438", children: jsx(Icon, { name: "GridIcon", "aria-hidden": "true", className: "h-full", asSVG: true }) })] }));
|
|
705
711
|
});
|
|
706
712
|
|
|
707
713
|
function isSubItemActive(router) {
|
|
@@ -929,6 +935,148 @@
|
|
|
929
935
|
return (jsxs("section", { className: `p-[50px] font-sans bg-white text-primary-text ${className || ''}`, children: [title ? jsx(Title, { className: "m-0 mb-2.5", children: title }) : null, accordionItems?.length ? (jsx("ul", { className: "list-none m-0 p-0", children: accordionItems.map((item, i) => (jsx(AccordionItem, { ...item, context: context }, `AccordionItem${i}`))) })) : null] }));
|
|
930
936
|
});
|
|
931
937
|
|
|
938
|
+
function useCreditCalculatorData(useAsyncData, directoryName) {
|
|
939
|
+
const { data } = useAsyncData(creditCalculatorUrl(directoryName), () => fetchCreditCalculatorData(directoryName));
|
|
940
|
+
return data || {};
|
|
941
|
+
}
|
|
942
|
+
async function fetchCreditCalculatorData(directoryName) {
|
|
943
|
+
const response = await fetch(creditCalculatorUrl(directoryName));
|
|
944
|
+
return await response.json();
|
|
945
|
+
}
|
|
946
|
+
function creditCalculatorUrl(directoryName) {
|
|
947
|
+
return `/wcms-resources/${directoryName || 'credit-calculator-data'}.json`;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
const CHECK_PATHS = [
|
|
951
|
+
{
|
|
952
|
+
d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
|
|
953
|
+
fillRule: 'evenodd',
|
|
954
|
+
clipRule: 'evenodd',
|
|
955
|
+
fill: 'white',
|
|
956
|
+
},
|
|
957
|
+
];
|
|
958
|
+
const Checkbox = JSX(({ text, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center cursor-pointer relative", children: [jsx("input", { className: `peer appearance-none w-5 h-5 border-solid border rounded border-black checked:bg-primary-main checked:border-primary-main`, type: "checkbox", onChange: (e) => {
|
|
959
|
+
onChange(e.target.checked);
|
|
960
|
+
}, checked: checked }), jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-2 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }), text ? jsx("span", { className: "font-sans ml-2 text-sm cursor-pointer", children: text }) : null] }) })));
|
|
961
|
+
|
|
962
|
+
const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', { maximumSignificantDigits: 3 }).format(number);
|
|
963
|
+
|
|
964
|
+
const InputRange = JSX(({ className, title, items = [], min = 1, max = 100, step = 1, value = min, onChange }) => {
|
|
965
|
+
const handleChange = (value) => {
|
|
966
|
+
if (!onChange)
|
|
967
|
+
return;
|
|
968
|
+
const sanitizedValue = Number(value.replace(/\D/g, ''));
|
|
969
|
+
onChange(sanitizedValue);
|
|
970
|
+
};
|
|
971
|
+
const inputStyle = {
|
|
972
|
+
backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
973
|
+
};
|
|
974
|
+
const handleBlur = () => {
|
|
975
|
+
if (!onChange)
|
|
976
|
+
return;
|
|
977
|
+
if (value < min)
|
|
978
|
+
onChange(min);
|
|
979
|
+
if (value > max)
|
|
980
|
+
onChange(max);
|
|
981
|
+
};
|
|
982
|
+
return (jsxs("div", { className: className, children: [jsxs("div", { className: "relative", children: [title ? (jsx("span", { className: "absolute text-xs text-secondary-text top-1 mt-0.5 pl-4 ml-0.5", children: title })) : null, jsx("input", { className: `m-0 font-sans text-sm w-full h-12 border-2 border-solid border-main-divider rounded-md outline-none p-0 pl-4 m-0 box-border text-primary-text ${title ? 'pt-4' : ''}`, value: addSpacesBetweenNumbers(value), onChange: (e) => handleChange(e.target.value), onBlur: handleBlur }), jsx("div", { className: "absolute inset-x-0 mt-0.5 top-8 px-4", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider", type: "range", min: min, max: max, step: step, value: value, onChange: (e) => handleChange(e.target.value), style: inputStyle }) })] }), jsx("div", { className: "flex justify-between mt-3 mb-4", children: items.map((item, i) => (jsx("span", { className: "text-xs text-secondary-text pl-4", children: item }, String(i)))) })] }));
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
986
|
+
|
|
987
|
+
const DEFAULT_MIN_SUM = 30000;
|
|
988
|
+
const DEFAULT_MAX_SUM = 3000000;
|
|
989
|
+
const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
|
|
990
|
+
const DEFAULT_MIN_MONTHS = 1;
|
|
991
|
+
const DEFAULT_MAX_MONTHS = 84;
|
|
992
|
+
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
993
|
+
const MONTHS_IN_YEAR = 12;
|
|
994
|
+
|
|
995
|
+
const getCalculatorParams = (params) => {
|
|
996
|
+
const { tableRows, isAnnuity = false } = params;
|
|
997
|
+
if (!tableRows)
|
|
998
|
+
return {};
|
|
999
|
+
const calculatorParams = tableRows.find((row) => row.isAnnuity === isAnnuity);
|
|
1000
|
+
return calculatorParams || {};
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
const DEFAULT_RATE = 5;
|
|
1004
|
+
const getCreditRate = (params) => {
|
|
1005
|
+
const { calculatorParams, isInsurance } = params;
|
|
1006
|
+
if (!calculatorParams)
|
|
1007
|
+
return DEFAULT_RATE;
|
|
1008
|
+
return isInsurance
|
|
1009
|
+
? calculatorParams?.rateWithInsurance || DEFAULT_RATE
|
|
1010
|
+
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE;
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
const MAX_YEARS_LENGTH = 5;
|
|
1014
|
+
const getCreditTermYears = (minMonths, maxMonths) => {
|
|
1015
|
+
const totalYears = Math.ceil((maxMonths - minMonths) / 12);
|
|
1016
|
+
const firstYear = Math.floor(minMonths / MONTHS_IN_YEAR) + 1;
|
|
1017
|
+
const result = new Array(Math.min(totalYears - 1, MAX_YEARS_LENGTH))
|
|
1018
|
+
.fill(0)
|
|
1019
|
+
.map((_, i) => firstYear + i);
|
|
1020
|
+
const maxYear = totalYears + firstYear - 1;
|
|
1021
|
+
return result.concat(maxYear);
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
const getMonthlyPayment = (params) => {
|
|
1025
|
+
const { calculatorParams, paymentType, rate, sum, months } = params;
|
|
1026
|
+
if (!calculatorParams)
|
|
1027
|
+
return 0;
|
|
1028
|
+
const finalSum = clamp(sum, calculatorParams.minSum || DEFAULT_MIN_SUM, calculatorParams.maxSum || DEFAULT_MAX_SUM);
|
|
1029
|
+
if (paymentType === 'annuity') {
|
|
1030
|
+
const annuityCoef = Number(rate) / (MONTHS_IN_YEAR * 100);
|
|
1031
|
+
return finalSum * (annuityCoef + annuityCoef / (Math.pow(1 + annuityCoef, months) - 1));
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
return finalSum / months + finalSum * (Number(rate) / 12);
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
const STEP_MONEY = 1000;
|
|
1039
|
+
const STEP_MONTHS = 1;
|
|
1040
|
+
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
1041
|
+
const borderStyle = 'border-solid border-3 border-primary-main rounded-md';
|
|
1042
|
+
const CreditCalculator = JSX(({ context, className, directoryName }) => {
|
|
1043
|
+
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1044
|
+
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1045
|
+
const [isAnnuityChecked, setIsAnnuityChecked] = context.useState(true);
|
|
1046
|
+
const [isInsuranceChecked, setIsInsuranceChecked] = context.useState(true);
|
|
1047
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, directoryName).rows;
|
|
1048
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isAnnuityChecked });
|
|
1049
|
+
const defaultSum = calculatorParams.maxSum && calculatorParams.minSum
|
|
1050
|
+
? (calculatorParams.maxSum - calculatorParams.minSum) / 2
|
|
1051
|
+
: DEFAULT_SUM;
|
|
1052
|
+
const defaultMonths = calculatorParams.maxMonths && calculatorParams.minMonths
|
|
1053
|
+
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
1054
|
+
: DEFAULT_MONTHS;
|
|
1055
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
1056
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
1057
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
1058
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
1059
|
+
const rate = getCreditRate({ calculatorParams, isInsurance: isInsuranceChecked });
|
|
1060
|
+
const montlyPayment = getMonthlyPayment({
|
|
1061
|
+
calculatorParams,
|
|
1062
|
+
paymentType: DEFAULT_PAYMENT_TYPE,
|
|
1063
|
+
rate,
|
|
1064
|
+
sum: moneyValue || defaultSum,
|
|
1065
|
+
months: monthsValue || defaultMonths,
|
|
1066
|
+
});
|
|
1067
|
+
const creditTermYears = getCreditTermYears(minMonths, maxMonths);
|
|
1068
|
+
function handleButtonClick(value) {
|
|
1069
|
+
setMonthsValue(clamp(value * MONTHS_IN_YEAR, minMonths, maxMonths));
|
|
1070
|
+
}
|
|
1071
|
+
return (jsx("section", { className: `font-sans text-primary-text bg-white p-4 ${className}`, children: jsxs("div", { className: `box-border p-12 flex flex-col justify-between ${borderStyle}`, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "grow mr-11", children: [jsx(InputRange, { title: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD", items: [
|
|
1072
|
+
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
1073
|
+
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
1074
|
+
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }), jsx(InputRange, { title: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ['Или выберите из предложенных вариантов ниже'], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: monthsValue || defaultMonths, onChange: setMonthsValue }), jsx("div", { className: "flex mb-7", children: creditTermYears.map((number, i) => renderButton(number, i, handleButtonClick)) }), jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", checked: isAnnuityChecked, onChange: setIsAnnuityChecked }), jsx(Checkbox, { className: "mb-4", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsuranceChecked, onChange: setIsInsuranceChecked })] }), jsxs("div", { className: "p-9 bg-primary-main rounded-md text-white", children: [jsx("div", { className: "text-base mb-5", children: "\u041D\u0430\u0448\u0435 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }), jsx("div", { className: "text-sm opacity-60", children: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436" }), jsxs("div", { className: "text-lg mb-3", children: [addSpacesBetweenNumbers(Math.round(montlyPayment)), " \u20BD"] }), jsx("div", { className: "text-sm opacity-60", children: "\u0421\u0442\u0430\u0432\u043A\u0430" }), jsxs("div", { className: "text-lg", children: [rate, " %"] })] })] }), jsxs("div", { className: "flex items-center", children: [jsx(Button, { className: "mr-3", text: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443", version: "primary", href: "#" }), jsx("div", { className: "w-80 text-xxs leading-4 text-secondary-text", "aria-label": "\u0421\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u0435 \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u044F \u0437\u0430\u044F\u0432\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u043E \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F\u043C \u0424\u0417\u00A0\u00AB\u041E\u00A0\u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445\u00BB" })] })] }) }));
|
|
1075
|
+
});
|
|
1076
|
+
function renderButton(number, i, handleClick) {
|
|
1077
|
+
return (jsx("button", { className: "bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none", onClick: () => handleClick(number), children: jsxs("span", { className: "font-semibold text-sm", children: [number, " ", number === 1 ? 'год' : number > 4 ? 'лет' : 'года'] }) }, String(i)));
|
|
1078
|
+
}
|
|
1079
|
+
|
|
932
1080
|
const Blocks = {
|
|
933
1081
|
Header,
|
|
934
1082
|
Footer: Footer$1,
|
|
@@ -947,6 +1095,7 @@
|
|
|
947
1095
|
MiniGallery,
|
|
948
1096
|
ComparisonTable,
|
|
949
1097
|
Accordion,
|
|
1098
|
+
CreditCalculator,
|
|
950
1099
|
};
|
|
951
1100
|
|
|
952
1101
|
const Footer = JSX(({ className, context }) => (jsx("footer", { className: `${className} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`, children: jsx(TextInformation, { context: context }) })));
|
package/bundle/bundle.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";const t=(e,r)=>{t._jsx=e,t._jsxs=r||e};t.vue=e=>{t(((t,{children:r,dangerouslySetInnerHTML:n,...a}={})=>{const i=Object.assign({},a,n?{innerHTML:n.__html}:{});return e(t,i,"string"!=typeof t?()=>r:r)}))};const r=(...e)=>t._jsx(...e),n=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,r){const{children:n,...a}=t||{},i=r?.slots?.default,l=n||i&&i();return e(Object.assign(a,l&&{children:l}),r)},e._tmpl.inheritAttrs=!1),e._tmpl),i=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ENABLE_ASSIST(){return this._.ENABLE_ASSIST}get SITEMAP(){return this._.SITEMAP}get CDN(){return this._.CDN}},l="likesToken";const s=a((({HeadComponent:e,data:t,children:a})=>{const{title:i,description:l,keywords:s,robots:c,og:o}=t;return n(e,{children:[r("title",{children:i}),r("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),l&&r("meta",{name:"description",content:l}),s&&r("meta",{name:"keywords",content:s.join(",")}),c&&r("meta",{name:"robots",content:c.join(",")}),o?Object.entries(o).map((([e,t])=>r("meta",{name:`og:${e}`,content:t},e))):null,a]})})),c=a((({className:e,onClick:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:o()}))),o=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),r("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},d=a((({className:e,context:t})=>{const a=t.useLikeService();return n("div",{className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,children:[r(c,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),r(c,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),r("span",{className:"select-none",children:a.likeCount})]})})),m={primary:"bg-primary-main",secondary:"bg-white"},h={primary:"text-primary-text",secondary:"text-white"},x=a((({className:e,text:t,children:a,version:i="primary"})=>n("div",{className:`inline-block flex ${e||""}`,role:"listitem",children:[r("div",{className:`inline-block w-[8px] h-[8px] min-w-[8px] min-h-[8px] rounded-full mt-2 ${m[i]}`}),r("span",{className:`text-base font-normal font-sans mx-3 ${h[i]}`,children:t||a})]}))),p={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active"},u={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text"},f="inline-block text-center font-sans select-none",b=a((({className:e,text:t,aboveText:n,appendLeft:a,href:i,target:l,onClick:s,children:c,disabled:o,rounded:d,version:m="none",ariaLabel:h,...x})=>{const b=c??r(g,{text:t,aboveText:n,appendLeft:a,rounded:d});return o?r("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:"-1",className:`${f} ${u[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,children:b}):r("a",{className:`${f} cursor-pointer no-underline ${p[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,href:i,target:l,onClick:s,"aria-label":h,role:i?"link":"button",...x,children:b})})),g=a((({text:e,aboveText:t,appendLeft:a,rounded:i})=>{const l=!e&&!t&&Boolean(a);return n("div",{className:`flex items-center justify-center ${l?"h-12 w-12 min-h-12 min-w-12":"px-8 gap-2 "+(t?"py-2":"py-[13px]")} ${i?"rounded-full":""}`,children:[a||null,l?null:n("div",{children:[r("div",{className:"text-xxs text-left",children:t}),r("div",{className:"text-sm font-medium text-left",children:e})]})]})})),v=a((({className:e,name:t,alt:a=`Icon ${t}`,title:l=a,...s})=>n("svg",{className:e,...s,"aria-hidden":"true",children:[l?r("title",{children:l}):null,a?r("desc",{children:a}):null,r("use",{href:`${i.CDN||""}icons/${t}.svg#icon`,xlinkHref:`${i.CDN||""}icons/${t}.svg#icon`})]}))),N=a((({className:e,image:t})=>n("picture",{className:`${e||""}`,children:[t.sources?.length?t.sources.map((({src:e,format:t},n)=>r("source",{srcSet:e,type:y(t)},`${n}_${e}`))):null,r("img",{src:t.src,alt:t.alt||t.title,title:t.title,...t?.size})]})));function y(e){return e?`image/${String(e)}`:void 0}var w;!function(e){e.XL="text-title-lg",e.L="text-title",e.M="text-title-sm",e.S="text-title-xs"}(w||(w={}));const k=a((({size:e="L",className:t,children:n,...a})=>r("XL"===e?"h1":"h2",{className:$(w[e],t),...a,children:n}))),$=(...e)=>e.filter(Boolean).join(" "),S="/mobile",C=e=>e?.includes("//"),_=(e,t,r=((e,t)=>e===t))=>r(L(e),j(L(C(e)?t.href:t.pathname))),L=e=>(e||"").replace(/\/?\?.*/,""),j=e=>(e||"").replace(S,""),D=e=>{if(!C(e))return;const t=e,r=t.indexOf("//"),n=t.indexOf("/",r+"//".length);return-1!==n?t.substring(0,n):t},T=(e,t)=>{if(!e)return e;const r=R(e,t),n=t?.pathname.startsWith(S);return n&&!C(r)?`/mobile${r}`:r},R=(e,t)=>{if(!e)return e;const r=D(t?.href);return r?e.replace(r,"")||"/":e};var I=Object.freeze({__proto__:null,MOBILE_URL_PATH:S,isURL:C,isHrefActive:_,withoutQuery:L,withoutMobilePath:j,getOrigin:D,adjustHref:T,toRelativeHref:R});const A=(e,t)=>e;function B({router:e,handlerDecorator:t=A},r){const n=T(r.href,e);return{...r,href:n,ariaLabel:r.text,onClick:t((t=>{const a=n&&!C(n),i=!r.target||"_self"===r.target;a&&i&&(t.preventDefault(),e.push(n))}),r)}}const O=e=>{const t="col-span-",r=e.split(/\s+/).find((e=>e.startsWith(t)));return r?parseInt(r.substring(t.length),10):12},P=a((({className:e,context:t,title:a,titleSize:i,description:l,children:s,buttons:c,image:o,items:d,version:m="primary"})=>{const h=t.useRouter(),{handlerDecorator:x}=t;return n("div",{className:"font-sans flex flex-col grow h-full",children:[a&&r(k,{size:i||M(e),className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]",children:a}),n("div",{className:"flex grow justify-between",children:[n("div",{className:"flex flex-col justify-between items-start",children:[n("div",{children:[l?r("div",{className:"font-normal text-base max-w-[600px] mb-5",children:l}):null,s,d?.length?H(d,m):null]}),c?.length?r("div",{className:"flex mt-9 gap-3",children:c.map(((e,t)=>function({icon:e,...t},n){if(!t?.text)return;return r(b,e?{appendLeft:r(v,{name:e,width:"24",height:"24"}),...t}:{...t},String(n))}(B({router:h,handlerDecorator:x},e),t)))}):null]}),o?.src&&r(N,{className:"mt-auto ml-7",image:o})]})]})}));function M(e=""){const t=O(e);return t<=4?"S":t<=8?"M":"L"}function H(e=[],t){return r("section",{className:"max-w-[600px]",role:"list",children:e.map(((e,n)=>r(x,{className:n?"mt-2.5":"",text:e,version:t},String(n))))})}const Z={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},F=a((e=>{const{children:t,className:n,version:a="primary"}=e;return r("section",{className:`font-sans p-9 min-h-[320px] box-border ${n||""} ${Z[a]} ${V(n)} `,children:r(P,{...e,children:t})})}));function V(e=""){const t=O(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const E=a((({className:e,context:t,title:n})=>r(F,{className:e,context:t,title:n,description:"Блок в разработке...",children:r("figure",{className:"m-0 min-w-[600px]",children:z()})}))),z=(e=3)=>G(100,e).map((e=>Math.floor(e))).map(U),U=(e=100,t)=>r("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),G=(e,t)=>[e].concat(t>0?G(e/1.618,t-1):[]),W=({blockClassName:e,block:t,render:r})=>r({blockClassName:e,block:t}),J=a((({className:e,context:t,blocksRegistry:a,data:{style:i,blocks:l,likeControl:s,colorPalette:c="pc"},blockDecorator:o=W})=>n("section",{className:"relative","data-theme":c,children:[r("div",{className:`grid grid-cols-12 gap-1 ${X(i)} ${e||""}`,children:l?.length?l.map((function e(n,i){const{type:l}=n;l in a||console.warn(`No block with "${l}" is registered`);const s=a[l]||E;return o({blockClassName:X(n.style),block:n,render:n=>{const{version:a,content:c,blocks:o}=n.block;return r(s,{className:n.blockClassName,version:a,context:t,...c,children:o?.length?o.map(e):null},`${l}-${i}`)}},`block-${i}`)})):null}),s&&r("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:r(d,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})));function X(e){return e?e.join(" "):""}function Q(e){const{mobile:t}=e;return t?{...e,style:t.style?.length?t.style:e.style}:e}const q=a((({className:e,title:t,benefits:a})=>n("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[r("h2",{className:"font-medium text-title m-0 max-w-[47rem] text-center",children:t}),a?.length?r("div",{className:"grid grid-cols-2 gap-5 mt-9",children:a.map(K)}):null]}))),K=(e,t)=>n("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&r(v,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),n("div",{children:[r("h3",{className:"font-medium text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm mt-2",children:e.description})]})]},String(t)),Y="https://www.cbr-xml-daily.ru/daily_json.js",ee=["USD","EUR"],te={USD:"DollarIcon",EUR:"EuroIcon"},re=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],ne=a((({className:e,context:t,title:a})=>{const{data:i}=t.useAsyncData(Y,le);return r(F,{className:e,context:t,title:a||"Курсы обмена валют",buttons:re,children:n("table",{children:[r("thead",{children:n("tr",{children:[r(ae,{children:"Валюта"}),r(ae,{className:"pl-11",children:"Курс"})]})}),r("tbody",{children:ee.map((e=>{const t=(i?.Valute||{})[e]?.Value;return n("tr",{children:[r(ie,{className:"pt-4",children:n("div",{className:"flex items-center",children:[r(v,{name:te[e],width:"24",height:"24"}),r("span",{className:"ml-2",children:e})]})}),r(ie,{className:"pt-4 pl-11",children:ce(t)})]},e)}))})]})})})),ae=a((({className:e="",children:t})=>r("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ie=a((({className:e="",children:t})=>r("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function le(){const e=await fetch(Y);return await e.json()}const se=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),ce=e=>e?se.format(e):"",oe=a((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...s})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>r("path",{d:e,fill:t||"currentColor",...s,...n},a)))}))),de=["m13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z","M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z","M33.93 35.53c.3-.41.6-.85.87-1.3v-2.66h-.87v3.96Zm2.54-4.92c.12-.4.24-.78.34-1.16h-2.88v.7h.43c.77-.02 1.63-.03 2.11.46Zm-19.19-1.27h-.78v7.91h.78v-7.9Z","M14.7 27.83h2.58c.67 0 1.14.14 1.4.4.27.25.4.72.4 1.38v7.4c0 .66-.12 1.12-.4 1.38-.4.41-1.16.41-1.78.41l-.4-.01v3.5l.78.14v-2.88c1.2 0 1.97-.4 2.34-1.22v4.29h.26l.5-.01V29.74c0-.68.13-1.16.4-1.43.25-.27.72-.4 1.37-.4.67 0 1.65-.1 2.16.4.26.27.38.76.38 1.43v3.8h-1.77v-4.06h-.77v12.99c.26-.03.5-.07.77-.12V34.3h1.77v7.64c.36-.1.72-.21 1.08-.34v-7c0-.8.19-1.4 1-1.67l-.9-4.87h1.8l.3 5.31h.22l.3-5.31h1.88l-1.01 4.87c.84.3 1.01.81 1.01 1.66v4.53a16.63 16.63 0 0 0 1.5-1.27v-9.83h5.25l.1-.72H24.93l.17.89c-.38-.72-1.12-1.08-2.2-1.08h-.77c-1.3 0-2.1.52-2.4 1.55-.27-1.08-1.1-1.62-2.46-1.62h-3.36v14.52c.26.09.52.18.78.25V27.84Zm16.29 5.58-.85-.8.85-4.37v5.17Z","M27.66 40.79c.27-.14.55-.28.8-.43v-5.98h-.8v6.4Z"],me=a((({className:e,href:t,children:a,targetBlank:i})=>n("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self",children:[r(oe,{className:"text-primary-main w-10",viewBox:"0 0 40 45",paths:de.map((e=>({d:e})))}),r("span",{className:"text-black text-base font-medium ml-2.5",children:a||"Россельхозбанк"})]}))),he=a((({className:e,context:t})=>{const{term:a,setTerm:i}=t.useSearch();return n("form",{className:`relative ${e||""}`,children:[n("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[r("div",{className:"w-[24px] h-[24px]",children:r(v,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&r("span",{className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),r("input",{className:"pl-12 w-full font-sans font-normal text-base text-black border border-solid border-main-divider rounded h-full box-border outline-none pr-[6%]",value:a,onChange:e=>i(e.target.value),type:"text",name:"s"}),a&&r("button",{type:"submit",className:"absolute font-sans font-normal text-sm cursor-pointer bg-transparent hover:bg-primary-hover active:bg-primary-active text-primary-main hover:text-white border-none px-5 py-2 rounded top-1 right-1 outline-none",onClick:e=>{e.preventDefault(),console.log("click")},children:"Найти"})]})})),xe=a((({className:e,items:t,hasButton:a,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return n("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(pe):null,a?r(b,{version:"primary",className:"my-4",...B({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),pe=(e,t)=>{const{type:a,text:i,description:l}=e;return n("div",{className:"mb-4",children:[r("div",{children:ue(a,i)}),r("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},ue=(e,t)=>{switch(e){case"tel":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${fe(t)}`,children:t});case"email":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return r("span",{children:t})}},fe=e=>e.replaceAll(/(\-|\s|\(|\)|\D+)/g,""),be=a((({className:e,links:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:i}=n;return r("div",{className:`${e||""}`,children:t?.length?r("div",{className:"flex justify-between items-center gap-5 py-5 border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>r(ge,{index:t,...B({router:a,handlerDecorator:i},e)},String(t))))}):null})})),ge=a((({className:e,index:t,text:n,href:a,target:i,onClick:l})=>r("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:n||`Документ ${t}`}))),ve=e=>t=>e?.href===t?.href;function Ne(e,t){return(n=e,a=t,(n||[]).map((e=>a?.find(ve(e))||e))).concat((r=e,(t||[]).filter((e=>!r?.find(ve(e))))));var r,n,a}function ye(e){const{data:t}=e(ke(),we);return t||{}}async function we(){const e=await fetch(ke());return await e.json()}function ke(){return`/wcms-resources/${i.SITEMAP||"sitemap"}.json`}const $e=a((({className:e,items:t,context:n})=>{const a=Ne(ye(n.useAsyncData).topItems,t),i={router:n.useRouter(),handlerDecorator:n.handlerDecorator};return r("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:a?.map(((e,t)=>Se(e,t,i)))})})),Se=(e,t,{router:a,handlerDecorator:i})=>{const{text:l,href:s,items:c,target:o}=e;return n("div",{className:"flex flex-col w-[235px] gap-[14px]",children:[r("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:l||`Раздел ${t}`}),c?.map(((e,t)=>r(Ce,{...B({router:a,handlerDecorator:i},e)},String(t))))]},String(t))},Ce=a((({text:e,href:t,target:n,index:a})=>r("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:n||"_self",children:e||`Раздел ${a}`}))),_e=[{origins:["t.me","telegram.org"],icon:"TelegramIcon",label:"Телеграм",width:"20px",height:"16px"},{origins:["vk.com"],icon:"VKIcon",label:"ВКонтакте",width:"24px",height:"12px"},{origins:["ok.ru"],icon:"OkIcon",label:"Одноклассники",width:"12px",height:"20px"}],Le=a((({className:e,media:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:i}=n;return r("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>r(je,{...B({router:a,handlerDecorator:i},e)},String(t))))})})),je=a((({href:e})=>{const{icon:t,label:n,width:a,height:i}=_e.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return t?r(b,{rounded:!0,href:e,target:"_blank",rel:"noopener noreferrer","aria-label":n,className:"border-solid border border-main-divider w-9 h-9 flex items-center justify-center hover:fill-primary-main",appendLeft:r(v,{name:t,width:a,height:i,className:"[&>*]:fill-primary-text [&>*]:hover:fill-primary-main"})}):null})),De=a((({className:e,links:t,context:a})=>{const i=a.useRouter(),{handlerDecorator:l}=a;return n("div",{className:`${e||""}`,children:[r("div",{className:"pt-5 pb-[5px]",children:r("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?r("div",{className:"flex justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>r(Te,{index:t,...B({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),Te=a((({className:e,index:t,text:n,href:a,target:i,onClick:l})=>r("a",{className:`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:n||`Документ ${t}`}))),Re=a((({className:e,documents:t,relatedEnterprises:a,contacts:i,socialMedia:l,topItems:s,context:c})=>n("footer",{className:`${e} px-9 py-10 bg-white`,children:[n("div",{className:"flex items-stretch gap-32 pb-8 xl:gap-8",children:[r(me,{className:"w-[280px] xl:w-[220px]"}),r(he,{context:c,className:"grow"})]}),n("div",{className:"flex items-stretch gap-32 xl:gap-8",children:[r(xe,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:i,context:c,hasButton:!0}),r($e,{className:"pt-[3px]",context:c,items:s})]}),r(Le,{media:l,context:c}),r(be,{links:a,context:c}),r(De,{links:t,context:c})]}))),Ie=[{d:"m9 12 4-4-4-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"},{d:"M2 9a1 1 0 0 1 0-2v2Zm6-2a1 1 0 0 1 0 2V7ZM2 7h6v2H2V7Z"}],Ae=a((({className:e,disabled:t,...n})=>r(b,{rounded:!0,className:`shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main"} ${e||""}`,disabled:t,...n,children:r(oe,{paths:Ie,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),Be={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},Oe={normal:380,mini:276},Pe={normal:3,mini:4},Me=a((({title:e,description:t,context:a,cards:i=[],className:l,version:s="normal"})=>{const[c,o]=a.useState(0);const d=i?.length>Pe[s],m=d&&i?.length-c>Pe[s],h=d&&c>0;return n("section",{className:`relative font-sans text-primary-text bg-white p-12 overflow-hidden ${l}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[e?r(k,{className:"font-medium m-0 text-center",children:e}):null,t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:`flex ${i?.length<=Pe[s]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*Oe[s]}px)`},role:"list",children:i?.map(((e,t)=>function(e,t,a){return n("div",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${Be[a]} w-full`,role:"listitem",children:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(N,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.items.map(He)}):null]}),e.href?r(b,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},String(t))}(e,t,s)))}),h&&r(Ae,{className:"absolute top-1/2 left-8 rotate-180",onClick:function(){o(c-1)},ariaLabel:"Пролистать влево"}),m&&r(Ae,{className:"absolute top-1/2 right-1 z-10",onClick:function(){o(c+1)},ariaLabel:"Пролистать вправо"}),r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})}));function He(e,t){return r(x,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))}const Ze=a((e=>r(Me,{...e,version:"normal"}))),Fe=a((({className:e,text:t,href:a,target:i,active:l,onClick:s,children:c})=>n("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:i,onClick:s,children:[r("span",{className:`font-sans font-normal text-base ${l?"text-primary-main":"text-primary-text hover:text-primary-main"}`,children:t||c}),l?r("div",{className:"absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main"}):null]}))),Ve=a((({className:e,text:t,href:n,target:a,active:i,flat:l,onClick:s,children:c,ariaLabel:o})=>r("a",{className:`inline-block border border-solid bg-transparent text-center no-underline ${l?"":"px-4 py-2"} ${i?"border-primary-main rounded-md":"border-transparent"} ${e||""}`,href:n,target:a,onClick:s,rel:"noopener noreferrer","aria-label":o,children:r("span",{className:`font-sans font-normal text-sm ${i?"text-primary-main":(l?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"}`,children:t||c})}))),Ee=a((({className:e,children:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${e||""}`,disabled:!0,"aria-label":n,children:t}))),ze=a((({context:e,className:t,defaultLocation:a=""})=>{const[i,l]=e.useGeolocation(a);return n("div",{className:`flex items-center ${t||""}`,children:[r(Ve,{className:"mr-5",flat:!0,href:"#",text:i,ariaLabel:"Местоположение",onClick:l}),r(Ve,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов"}),r(Ee,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Поиск по сайту",children:r(v,{name:"LoupeIcon","aria-hidden":"true"})}),r(Ee,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Профиль",children:r(v,{name:"ProfileIcon","aria-hidden":"true"})}),r(Ee,{className:"mr-5 text-secondary-light hover:text-primary-main min-w-[32px] min-h-[32px]",ariaLabel:"Дополнительные ссылки",children:r(v,{name:"GridIcon","aria-hidden":"true",className:"[&>*]:fill-secondary-light [&>*]:hover:fill-primary-main"})})]})}));const Ue=a((({className:e,defaultLocation:t,context:a,topItems:i})=>{const l=a.useRouter(),s=ye(a.useAsyncData),{handlerDecorator:c}=a,o=Ne(s.topItems,i),d=o.find(function(e){return t=>_(t.href,e,((e,t)=>t.startsWith(e)))}(l)),m=d?.items,h=m?.find(function(e){return t=>_(t.href,e)}(l)),x=o.map(((e,t)=>r(Ve,{active:e===d,...B({router:l,handlerDecorator:c},e),ariaLabel:e.text},String(t)))),p=m?.map((e=>r(Fe,{className:"mr-8",active:e===h,...B({router:l,handlerDecorator:c},e)},e.href)));return n("header",{className:`pt-5 pb-8 px-20 bg-white ${e||""}`,children:[n("div",{className:"flex items-center",children:[r(me,{className:"mr-8"}),x,r(ze,{context:a,className:"ml-auto",defaultLocation:t})]}),r("div",{className:"mt-5 h-[1px] bg-main-divider"}),r("nav",{className:"mt-5",children:p})]})})),Ge=a((e=>r(Me,{...e,version:"mini"}))),We=a((({className:e,context:t,title:a="Мобильное приложение",qr:i,buttons:l=[]})=>r(F,{className:e,context:t,title:a,buttons:l,children:n("div",{className:"flex items-center",children:[i?.src&&i?.href&&r("a",{href:i.href,target:"_blank",children:r("img",{src:i.src,alt:a,title:a,width:"164",height:"164",className:"w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light"})}),r("span",{className:"font-normal text-sm text-secondary-text ml-4",children:"Наведите камеру телефона на QR-код и скачайте приложение"})]})}))),Je=a((({className:e,context:t,title:a,titleSize:i,description:l,benefits:s,buttons:c,image:o,items:d})=>n("div",{className:`flex grow justify-between items-stretch ${e||""}`,children:[n("div",{className:"flex flex-col",children:[a&&r(k,{size:i||"XL",className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px] text-primary-text",children:a}),r(P,{context:t,description:l,items:d,buttons:c,children:s?.length?r("div",{className:"flex gap-6 mt-6 mb-3.5",children:s.map(Xe)}):null})]}),o?.src&&r(N,{className:"mt-auto",image:o})]})));function Xe(e,t){return n("div",{className:"flex gap-4 items-center",children:[e.icon&&r(v,{className:"w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border",name:e.icon,width:"24",height:"24"}),n("div",{className:"flex gap-1 flex-col h-full",children:[r("h4",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const Qe=a((({text:e,href:t,target:n,onClick:a,className:i,children:l})=>t?r("a",{className:`no-underline ${i||""}`,href:t,target:n,onClick:a,children:r("span",{className:`${i||""}`,children:e||l})}):r("span",{className:`${i||""}`,children:e||l})));function qe(e){return t=>t.reduce(((t,r,n)=>t.length?t.concat({...e,key:n},r):[r]),[])}const Ke=a((e=>{const{context:t,className:a,breadcrumbs:i}=e,l=t.useRouter(),{handlerDecorator:s}=t;return n("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${a||""}`,children:[i?.length?r("div",{className:"text-xs mb-6",children:qe(r("span",{className:"text-secondary-text mx-2",children:"/"}))(i.map(((e,t)=>r(Qe,{...B({router:l,handlerDecorator:s},{className:"text-secondary-text",...e})},String(t)))))}):null,r(Je,{...e})]})})),Ye=a((({className:e,context:t,duration:a=0,slides:i=[]})=>{const l=i.map((e=>e.nav)),s=i.map((e=>e.productBlock)),[c,o]=t.useState(0);return n("section",{className:`font-sans bg-white overflow-hidden w-100 ${e||""}`,children:[r("div",{className:"flex duration-1000",style:{transform:`translateX(-${c}00%)`},role:"list",children:s.map(((e,n)=>function(e,t,n){return r("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:r("div",{className:"p-10 flex grow",children:r(Je,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:n,...e})})},String(t))}(e,n,t)))}),r("div",{className:"border-t border-solid border-main-divider flex",children:l.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:a,onClick:i,duration:l}){const s=t===a,c=s?"animate-slide":"";return n("button",{type:"button",onClick:i,className:"group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 py-4 grow basis-0",children:[n("div",{className:"border-0 border-r border-solid border-main-divider px-6",children:[r("div",{className:"text-sm font-medium group-hover:text-primary-text "+(s?"text-primary-text":"text-secondary-text"),children:e?.title}),r("div",{className:"text-xs text-secondary-text",children:e.desc})]}),r("div",{className:`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${c}`,style:{animationDuration:`${l}s`}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:a})))})]})}));const et=a((e=>{const{benefits:t,version:a}=e;return r(F,{...e,children:n("div",{className:"flex mt-5 mb-1",children:[t?.length?r("div",{className:"mr-8",children:t.map(tt)}):null,t?.length?r("div",{className:"pt-1",children:t.map(((e,t)=>function(e,t,n="primary"){return r("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[n]}`,children:e.label},String(t))}(e,t,a)))}):null]})})}));function tt(e,t){return r("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.description},String(t))}const rt=a((({className:e,context:t,title:a="Акции и спецпредложения",date:i,description:l,buttons:s=[],version:c})=>r(F,{className:e,context:t,title:a,buttons:s,version:c,children:n("div",{children:[i&&r("div",{className:"text-sm mb-2",children:nt(i)}),r("div",{className:"text-base",children:l})]})})));function nt(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const at=a((({className:e,title:t,steps:a})=>n("section",{className:`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${e||""}`,children:[r(k,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}),a?.length?n("div",{children:[r("div",{className:"flex mt-9 items-center px-[88px]",children:qe(r("div",{className:"h-0.5 w-full bg-secondary-light"}))(a.map(((e,t)=>it(e,t))))}),r("div",{className:"flex mt-9 justify-between gap-x-24",children:a.map(lt)})]}):null]}))),it=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative",children:r("div",{className:"h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10",children:e.icon&&r(v,{name:e.icon,width:"48",height:"48"})||r("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),lt=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative w-[276px]",children:n("div",{className:"max-w-min",children:[r("h5",{className:"font-medium text-xl m-0 mt-4 whitespace-nowrap px-3",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description})]})},String(t)),st={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"},secondary:{background:"bg-primary-main",icon:"bg-white text-primary-main",title:"text-white",description:"text-white"},"secondary-light":{background:"bg-primary-main/10",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"}},ct=a((({title:e,description:t,blockVersion:a="primary",iconVersion:i,image:l,className:s})=>{const c=st[a];return n("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:[i&&"small"===i?ot(c.icon):null,i&&"big"===i?dt(l):null,n("div",{className:"py-0.5",children:[e&&r("div",{className:`font-medium text-base mb-1 ${c.title}`,children:e}),t&&r("div",{className:`text-sm ${c.description}`,children:t})]})]})}));function ot(e){return r("div",{className:"pt-1.5 pr-4",children:r("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function dt(e){return e?.src?r(N,{className:"pt-0.5 pr-3",image:e}):null}const mt=a((({children:e})=>r("div",{className:"self-start flex flex-col",role:"row",children:r("div",{className:"flex",children:e})}))),ht="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",xt="border-main-stroke border-solid border",pt="border-main-divider border border-t-0 border-x-0",ut="w-[200px] mr-6",ft=a((({children:e,activeCardIndex:t})=>r("div",{className:"flex flex-1 overflow-hidden",children:r("div",{className:"flex gap-4 duration-1000",style:{transform:`translateX(-${336*t}px)`},children:e})}))),bt=a((({icon:e,image:t,title:a,link:i})=>n("div",{className:`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-12 ${xt} ${ht}`,role:"columnheader",scope:"col",children:[e&&!t?.src&&r(v,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",name:e,width:"63",height:"63"}),t?.src&&r(N,{className:"mb-4",image:t}),a&&r(k,{size:"S",className:"font-medium m-0 text-center text-white",children:a}),i?.text&&r("div",{className:"mt-auto w-full",children:r(b,{href:i.href,target:i.target,className:"mt-4 w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:r("div",{className:"text-xs py-[11px]",children:i.text})})})]}))),gt=a((({cell:e,isFirstRow:t,isLastRow:n,isFillGradient:a})=>r("div",{className:`w-80 box-border flex flex-col ${xt} ${n?"border-t-0 rounded-b-md":"border-y-0"} ${a?ht:""}`,role:"cell",children:r("div",{className:`mx-7 h-full ${pt} ${a&&t?"border-t":""} ${n?"":"border-solid"}`,children:e.map(((e,t)=>vt(e,t,a)))})}))),vt=({label:e,description:t},a,i)=>n("div",{className:"first:pt-7 pt-6 last:pb-7",children:[e&&r("h5",{className:"text-xl font-medium m-0 "+(i?"text-white":""),children:e}),t&&r("div",{className:"text-sm opacity-80 "+(i?"text-white":"text-secondary-text"),children:t})]},String(a)),Nt=a((({row:{header:e,data:t},activeCardIndex:a,isColoredFirstColumn:i,isFirstRow:l,isLastRow:s})=>n(mt,{children:[e?.title?r("div",{className:`text-sm py-7 ${pt} w-[200px] mr-6 ${s?"":"border-solid"}`,children:e.title}):null,t?.length?r(ft,{activeCardIndex:a,children:t.map(((e,t)=>r(gt,{cell:e,isFirstRow:l,isLastRow:s,isFillGradient:i&&0===t},String(t))))}):null]}))),yt=a((({className:e,context:t,title:a,rowHeaders:i,columns:l,visibleRowLength:s=0,isColoredFirstColumn:c=!1})=>{const o=t.useRouter(),{handlerDecorator:d}=t,[m,h]=t.useState(0),[x,p]=t.useState(!s),u=l?.map((({header:e})=>e||{})),f=l?.map((({data:e})=>e))||[],b=i?.map(((e,t)=>({header:e,data:f.map((e=>e?.[t]||[{}]))}))).slice(0,x?i.length:s),g=f?.length&&f.length>2,v=g&&f?.length-m>2,N=g&&m>0;return n("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(k,{className:"font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto",children:a}),n("div",{role:"table",children:[u?.length?n(mt,{children:[r("div",{className:ut,role:"columnheader",scope:"col"}),r(ft,{activeCardIndex:m,children:u.map(((e,t)=>r(bt,{...e,link:e.link&&B({router:o,handlerDecorator:d},e.link)},String(t))))})]}):null,b?.length?n("div",{className:"relative",children:[b.map(((e,t,{length:n})=>r(Nt,{row:e,isFirstRow:0===t,isLastRow:t+1===n,activeCardIndex:m,isColoredFirstColumn:c},String(t)))),g?r("div",{children:n("div",{className:"absolute top-7 right-7 z-10",children:[r(Ae,{onClick:()=>h(m+1),disabled:!v,ariaLabel:"Пролистать вправо"}),r(Ae,{className:"mt-4 rotate-180",onClick:()=>h(m-1),disabled:!N,ariaLabel:"Пролистать влево"})]})}):null]}):null]}),g?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null,s?r("div",{className:"pr-[50px]",children:n("div",{className:"flex w-full",children:[r("div",{className:ut}),r("button",{onClick:()=>p(!x),className:"mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:r("div",{className:"font-sans font-medium text-xs py-[11px]",children:x?"Скрыть":"Показать все параметры"})})]})}):null]})})),wt={TextBlock:ct},kt=a((({label:e,blocks:t,context:a})=>{const[i,l]=a.useState(!1),s=t?.length,c=i?"MinusIcon":"PlusIcon";return n("li",{className:"border-0 border-b border-solid border-main-divider last:border-b-0",children:[n("button",{className:"border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text\n "+(s?"group cursor-pointer":""),onClick:e=>{if(!s)return null;l(!i);const t=St(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`},children:[r("span",{className:"m-0 text-xl pr-2.5 font-medium "+(s?"group-hover:text-primary-main":""),children:e}),s?r(v,{name:c,width:"24",height:"24"}):null]}),s?r("div",{className:(i?"pb-5":"")+" text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 ",children:t?.length?t.map($t):null}):null]})})),$t=(e,t)=>{if(e.type&&e.data&&!wt.hasOwnProperty(e.type))return null;const n=e.type&&wt[e.type];return r("div",{className:"mb-5 last:mb-0",children:r(n,{...e.data})},`component${t}`)},St=e=>"BUTTON"===e.target.tagName?e.target.nextSibling:e.target.parentNode.nextSibling,Ct=a((({title:e,accordionItems:t,context:a,className:i})=>n("section",{className:`p-[50px] font-sans bg-white text-primary-text ${i||""}`,children:[e?r(k,{className:"m-0 mb-2.5",children:e}):null,t?.length?r("ul",{className:"list-none m-0 p-0",children:t.map(((e,t)=>r(kt,{...e,context:a},`AccordionItem${t}`)))}):null]}))),_t={Header:Ue,Footer:Re,Placeholder:E,Tile:F,PromoTile:rt,TextBlock:ct,ProductTile:et,ProductBlock:Ke,StepsBlock:at,BenefitsBlock:q,ProductGallery:Ye,ExchangeRateTile:ne,MobileAppTile:We,Gallery:Ze,MiniGallery:Ge,ComparisonTable:yt,Accordion:Ct},Lt=a((({className:e,context:t})=>r("footer",{className:`${e} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`,children:r(De,{context:t})}))),jt=a((({title:e,description:t,cards:a=[],className:i})=>n("section",{className:`relative font-sans text-primary-text bg-white p-4 overflow-hidden ${i}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[r(k,{className:"font-medium m-0 text-centers",children:e}),t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:"horizontal-list no-scrollbar",role:"list",children:a?.map(Dt)})]})));function Dt(e,t){return n("div",{className:"box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch",role:"listitem",children:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(N,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?Tt(e.items):null]}),e.href?r(b,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function Tt(e=[]){return r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>r(x,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const Rt=a((({titleSize:e,image:t,benefits:n,...a})=>{const{className:i}=a;return r("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${i||""}`,children:r(Je,{...a,titleSize:"L"})})})),It={Header:Ue,Footer:Lt,Placeholder:E,Tile:F,ProductTile:et,ProductBlock:Rt,TextBlock:ct,ExchangeRateTile:ne,MobileAppTile:We,Gallery:jt};e.Blocks=_t,e.ContentPage=J,e.ContentPageHead=s,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),r=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await r.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function r(){try{const e=JSON.parse(globalThis.localStorage.getItem(l)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:r,name:n}=await e.json();return globalThis.localStorage.setItem(l,JSON.stringify({token:r,name:n})),{token:r,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...n){if(!n.length)return[];const{token:a}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify({node_ids:n})}),{likes:i}=await r.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(n){if(!n)return 0;const{token:a,name:i}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:n,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(n){if(!n)return 0;const{token:a,name:i}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:n,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}}}},e.MobileBlocks=It,e.joinList=qe,e.projectSettings=i,e.setup=t,e.toMobilePage=function(e){const t=e.blocks?.filter((({mobile:e})=>!e?.hidden)).map(Q);return{...e,blocks:t}},e.url=I,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";const t=(e,r)=>{t._jsx=e,t._jsxs=r||e};t.vue=e=>{t(((t,{children:r,dangerouslySetInnerHTML:n,...a}={})=>{const i=Object.assign({},a,n?{innerHTML:n.__html}:{});return e(t,i,"string"!=typeof t?()=>r:r)}))};const r=(...e)=>t._jsx(...e),n=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,r){const{children:n,...a}=t||{},i=r?.slots?.default,l=n||i&&i();return e(Object.assign(a,l&&{children:l}),r)},e._tmpl.inheritAttrs=!1),e._tmpl),i=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ENABLE_ASSIST(){return this._.ENABLE_ASSIST}get SITEMAP(){return this._.SITEMAP}get CDN(){return this._.CDN}},l="likesToken";const s=a((({HeadComponent:e,data:t,children:a})=>{const{title:i,description:l,keywords:s,robots:c,og:o}=t;return n(e,{children:[r("title",{children:i}),r("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),l&&r("meta",{name:"description",content:l}),s&&r("meta",{name:"keywords",content:s.join(",")}),c&&r("meta",{name:"robots",content:c.join(",")}),o?Object.entries(o).map((([e,t])=>r("meta",{name:`og:${e}`,content:t},e))):null,a]})})),c=a((({className:e,onClick:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:o()}))),o=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),r("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},m=a((({className:e,context:t})=>{const a=t.useLikeService();return n("div",{className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,children:[r(c,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),r(c,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),r("span",{className:"select-none",children:a.likeCount})]})})),d={primary:"bg-primary-main",secondary:"bg-white"},h={primary:"text-primary-text",secondary:"text-white"},x=a((({className:e,text:t,children:a,version:i="primary"})=>n("div",{className:`inline-block flex ${e||""}`,role:"listitem",children:[r("div",{className:`inline-block w-[8px] h-[8px] min-w-[8px] min-h-[8px] rounded-full mt-2 ${d[i]}`}),r("span",{className:`text-base font-normal font-sans mx-3 ${h[i]}`,children:t||a})]}))),u={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active"},p={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text"},f="inline-block text-center font-sans select-none",b=a((({className:e,text:t,aboveText:n,appendLeft:a,href:i,target:l,onClick:s,children:c,disabled:o,rounded:m,version:d="none",ariaLabel:h,...x})=>{const b=c??r(g,{text:t,aboveText:n,appendLeft:a,rounded:m});return o?r("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:"-1",className:`${f} ${p[d]||""} ${m?"rounded-full":"rounded-md"} ${e||""}`,children:b}):r("a",{className:`${f} cursor-pointer no-underline ${u[d]||""} ${m?"rounded-full":"rounded-md"} ${e||""}`,href:i,target:l,onClick:s,"aria-label":h,role:i?"link":"button",...x,children:b})})),g=a((({text:e,aboveText:t,appendLeft:a,rounded:i})=>{const l=!e&&!t&&Boolean(a);return n("div",{className:`flex items-center justify-center ${l?"h-12 w-12 min-h-12 min-w-12":"px-8 gap-2 "+(t?"py-2":"py-[13px]")} ${i?"rounded-full":""}`,children:[a||null,l?null:n("div",{children:[r("div",{className:"text-xxs text-left",children:t}),r("div",{className:"text-sm font-medium text-left",children:e})]})]})})),N=a((({className:e,name:t,alt:a=`Icon ${t}`,title:l=a,asSVG:s,...c})=>{const o=`${i.CDN||""}icons/${t}.svg`;return s?n("svg",{className:e,...c,"aria-hidden":"true",children:[l?r("title",{children:l}):null,a?r("desc",{children:a}):null,r("use",{href:`${o}#icon`,xlinkHref:`${o}#icon`})]}):r("img",{className:e,src:o,alt:a,title:l,...c,"aria-hidden":"true"})})),v=a((({className:e,image:t})=>n("picture",{className:`${e||""}`,children:[t.sources?.length?t.sources.map((({src:e,format:t},n)=>r("source",{srcSet:e,type:y(t)},`${n}_${e}`))):null,r("img",{src:t.src,alt:t.alt||t.title,title:t.title,...t?.size})]})));function y(e){return e?`image/${String(e)}`:void 0}var w;!function(e){e.XL="text-title-lg",e.L="text-title",e.M="text-title-sm",e.S="text-title-xs"}(w||(w={}));const k=a((({size:e="L",className:t,children:n,...a})=>r("XL"===e?"h1":"h2",{className:$(w[e],t),...a,children:n}))),$=(...e)=>e.filter(Boolean).join(" "),S="/mobile",C=e=>e?.includes("//"),_=(e,t,r=((e,t)=>e===t))=>r(j(e),L(j(C(e)?t.href:t.pathname))),j=e=>(e||"").replace(/\/?\?.*/,""),L=e=>(e||"").replace(S,""),D=e=>{if(!C(e))return;const t=e,r=t.indexOf("//"),n=t.indexOf("/",r+"//".length);return-1!==n?t.substring(0,n):t},R=(e,t)=>{if(!e)return e;const r=T(e,t),n=t?.pathname.startsWith(S);return n&&!C(r)?`/mobile${r}`:r},T=(e,t)=>{if(!e)return e;const r=D(t?.href);return r?e.replace(r,"")||"/":e};var I=Object.freeze({__proto__:null,MOBILE_URL_PATH:S,isURL:C,isHrefActive:_,withoutQuery:j,withoutMobilePath:L,getOrigin:D,adjustHref:R,toRelativeHref:T});const M=(e,t)=>e;function A({router:e,handlerDecorator:t=M},r){const n=R(r.href,e);return{...r,href:n,ariaLabel:r.text,onClick:t((t=>{const a=n&&!C(n),i=!r.target||"_self"===r.target;a&&i&&(t.preventDefault(),e.push(n))}),r)}}const P=e=>{const t="col-span-",r=e.split(/\s+/).find((e=>e.startsWith(t)));return r?parseInt(r.substring(t.length),10):12},B=a((({className:e,context:t,title:a,titleSize:i,description:l,children:s,buttons:c,image:o,items:m,version:d="primary"})=>{const h=t.useRouter(),{handlerDecorator:x}=t;return n("div",{className:"font-sans flex flex-col grow h-full",children:[a&&r(k,{size:i||O(e),className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]",children:a}),n("div",{className:"flex grow justify-between",children:[n("div",{className:"flex flex-col justify-between items-start",children:[n("div",{children:[l?r("div",{className:"font-normal text-base max-w-[600px] mb-5",children:l}):null,s,m?.length?V(m,d):null]}),c?.length?r("div",{className:"flex mt-9 gap-3",children:c.map(((e,t)=>function({icon:e,...t},n){if(!t?.text)return;return r(b,e?{appendLeft:r(N,{name:e,width:"24",height:"24"}),...t}:{...t},String(n))}(A({router:h,handlerDecorator:x},e),t)))}):null]}),o?.src&&r(v,{className:"mt-auto ml-7",image:o})]})]})}));function O(e=""){const t=P(e);return t<=4?"S":t<=8?"M":"L"}function V(e=[],t){return r("section",{className:"max-w-[600px]",role:"list",children:e.map(((e,n)=>r(x,{className:n?"mt-2.5":"",text:e,version:t},String(n))))})}const H={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},Z=a((e=>{const{children:t,className:n,version:a="primary"}=e;return r("section",{className:`font-sans p-9 min-h-[320px] box-border ${n||""} ${H[a]} ${F(n)} `,children:r(B,{...e,children:t})})}));function F(e=""){const t=P(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const z=a((({className:e,context:t,title:n})=>r(Z,{className:e,context:t,title:n,description:"Блок в разработке...",children:r("figure",{className:"m-0 min-w-[600px]",children:E()})}))),E=(e=3)=>U(100,e).map((e=>Math.floor(e))).map(G),G=(e=100,t)=>r("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),U=(e,t)=>[e].concat(t>0?U(e/1.618,t-1):[]),W=({blockClassName:e,block:t,render:r})=>r({blockClassName:e,block:t}),J=a((({className:e,context:t,blocksRegistry:a,data:{style:i,blocks:l,likeControl:s,colorPalette:c="pc"},blockDecorator:o=W})=>n("section",{className:"relative","data-theme":c,children:[r("div",{className:`grid grid-cols-12 gap-1 ${X(i)} ${e||""}`,children:l?.length?l.map((function e(n,i){const{type:l}=n;l in a||console.warn(`No block with "${l}" is registered`);const s=a[l]||z;return o({blockClassName:X(n.style),block:n,render:n=>{const{version:a,content:c,blocks:o}=n.block;return r(s,{className:n.blockClassName,version:a,context:t,...c,children:o?.length?o.map(e):null},`${l}-${i}`)}},`block-${i}`)})):null}),s&&r("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:r(m,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})));function X(e){return e?e.join(" "):""}function Q(e){const{mobile:t}=e;return t?{...e,style:t.style?.length?t.style:e.style}:e}const q=a((({className:e,title:t,benefits:a})=>n("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[r("h2",{className:"font-medium text-title m-0 max-w-[47rem] text-center",children:t}),a?.length?r("div",{className:"grid grid-cols-2 gap-5 mt-9",children:a.map(K)}):null]}))),K=(e,t)=>n("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&r(N,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),n("div",{children:[r("h3",{className:"font-medium text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm mt-2",children:e.description})]})]},String(t)),Y="https://www.cbr-xml-daily.ru/daily_json.js",ee=["USD","EUR"],te={USD:"DollarIcon",EUR:"EuroIcon"},re=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],ne=a((({className:e,context:t,title:a})=>{const{data:i}=t.useAsyncData(Y,le);return r(Z,{className:e,context:t,title:a||"Курсы обмена валют",buttons:re,children:n("table",{children:[r("thead",{children:n("tr",{children:[r(ae,{children:"Валюта"}),r(ae,{className:"pl-11",children:"Курс"})]})}),r("tbody",{children:ee.map((e=>{const t=(i?.Valute||{})[e]?.Value;return n("tr",{children:[r(ie,{className:"pt-4",children:n("div",{className:"flex items-center",children:[r(N,{name:te[e],width:"24",height:"24"}),r("span",{className:"ml-2",children:e})]})}),r(ie,{className:"pt-4 pl-11",children:ce(t)})]},e)}))})]})})})),ae=a((({className:e="",children:t})=>r("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ie=a((({className:e="",children:t})=>r("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function le(){const e=await fetch(Y);return await e.json()}const se=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),ce=e=>e?se.format(e):"",oe=a((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...s})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>r("path",{d:e,fill:t||"currentColor",...s,...n},a)))}))),me=["m13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z","M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z","M33.93 35.53c.3-.41.6-.85.87-1.3v-2.66h-.87v3.96Zm2.54-4.92c.12-.4.24-.78.34-1.16h-2.88v.7h.43c.77-.02 1.63-.03 2.11.46Zm-19.19-1.27h-.78v7.91h.78v-7.9Z","M14.7 27.83h2.58c.67 0 1.14.14 1.4.4.27.25.4.72.4 1.38v7.4c0 .66-.12 1.12-.4 1.38-.4.41-1.16.41-1.78.41l-.4-.01v3.5l.78.14v-2.88c1.2 0 1.97-.4 2.34-1.22v4.29h.26l.5-.01V29.74c0-.68.13-1.16.4-1.43.25-.27.72-.4 1.37-.4.67 0 1.65-.1 2.16.4.26.27.38.76.38 1.43v3.8h-1.77v-4.06h-.77v12.99c.26-.03.5-.07.77-.12V34.3h1.77v7.64c.36-.1.72-.21 1.08-.34v-7c0-.8.19-1.4 1-1.67l-.9-4.87h1.8l.3 5.31h.22l.3-5.31h1.88l-1.01 4.87c.84.3 1.01.81 1.01 1.66v4.53a16.63 16.63 0 0 0 1.5-1.27v-9.83h5.25l.1-.72H24.93l.17.89c-.38-.72-1.12-1.08-2.2-1.08h-.77c-1.3 0-2.1.52-2.4 1.55-.27-1.08-1.1-1.62-2.46-1.62h-3.36v14.52c.26.09.52.18.78.25V27.84Zm16.29 5.58-.85-.8.85-4.37v5.17Z","M27.66 40.79c.27-.14.55-.28.8-.43v-5.98h-.8v6.4Z"],de=a((({className:e,href:t,children:a,targetBlank:i})=>n("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self",children:[r(oe,{className:"text-primary-main w-10",viewBox:"0 0 40 45",paths:me.map((e=>({d:e})))}),r("span",{className:"text-black text-base font-medium ml-2.5",children:a||"Россельхозбанк"})]}))),he=a((({className:e,context:t})=>{const{term:a,setTerm:i}=t.useSearch();return n("form",{className:`relative ${e||""}`,children:[n("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[r("div",{className:"w-[24px] h-[24px]",children:r(N,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&r("span",{className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),r("input",{className:"pl-12 w-full font-sans font-normal text-base text-black border border-solid border-main-divider rounded h-full box-border outline-none pr-[6%]",value:a,onChange:e=>i(e.target.value),type:"text",name:"s"}),a&&r("button",{type:"submit",className:"absolute font-sans font-normal text-sm cursor-pointer bg-transparent hover:bg-primary-hover active:bg-primary-active text-primary-main hover:text-white border-none px-5 py-2 rounded top-1 right-1 outline-none",onClick:e=>{e.preventDefault(),console.log("click")},children:"Найти"})]})})),xe=a((({className:e,items:t,hasButton:a,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return n("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(ue):null,a?r(b,{version:"primary",className:"my-4",...A({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),ue=(e,t)=>{const{type:a,text:i,description:l}=e;return n("div",{className:"mb-4",children:[r("div",{children:pe(a,i)}),r("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},pe=(e,t)=>{switch(e){case"tel":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${fe(t)}`,children:t});case"email":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return r("span",{children:t})}},fe=e=>e.replaceAll(/(\-|\s|\(|\)|\D+)/g,""),be=a((({className:e,links:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:i}=n;return r("div",{className:`${e||""}`,children:t?.length?r("div",{className:"flex justify-between items-center gap-5 py-5 border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>r(ge,{index:t,...A({router:a,handlerDecorator:i},e)},String(t))))}):null})})),ge=a((({className:e,index:t,text:n,href:a,target:i,onClick:l})=>r("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:n||`Документ ${t}`}))),Ne=e=>t=>e?.href===t?.href;function ve(e,t){return(n=e,a=t,(n||[]).map((e=>a?.find(Ne(e))||e))).concat((r=e,(t||[]).filter((e=>!r?.find(Ne(e))))));var r,n,a}function ye(e){const{data:t}=e(ke(),we);return t||{}}async function we(){const e=await fetch(ke());return await e.json()}function ke(){return`/wcms-resources/${i.SITEMAP||"sitemap"}.json`}const $e=a((({className:e,items:t,context:n})=>{const a=ve(ye(n.useAsyncData).topItems,t),i={router:n.useRouter(),handlerDecorator:n.handlerDecorator};return r("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:a?.map(((e,t)=>Se(e,t,i)))})})),Se=(e,t,{router:a,handlerDecorator:i})=>{const{text:l,href:s,items:c,target:o}=e;return n("div",{className:"flex flex-col w-[235px] gap-[14px]",children:[r("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:l||`Раздел ${t}`}),c?.map(((e,t)=>r(Ce,{...A({router:a,handlerDecorator:i},e)},String(t))))]},String(t))},Ce=a((({text:e,href:t,target:n,index:a})=>r("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:n||"_self",children:e||`Раздел ${a}`}))),_e=[{origins:["t.me","telegram.org"],icon:"TelegramIcon",label:"Телеграм",width:"20px",height:"16px"},{origins:["vk.com"],icon:"VKIcon",label:"ВКонтакте",width:"24px",height:"12px"},{origins:["ok.ru"],icon:"OkIcon",label:"Одноклассники",width:"12px",height:"20px"}],je=a((({className:e,media:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:i}=n;return r("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>r(Le,{...A({router:a,handlerDecorator:i},e)},String(t))))})})),Le=a((({href:e})=>{const{icon:t,label:n,width:a,height:i}=_e.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return t?r(b,{rounded:!0,href:e,target:"_blank",rel:"noopener noreferrer","aria-label":n,className:"border-solid border border-main-divider w-9 h-9 flex items-center justify-center hover:fill-primary-main",appendLeft:r(N,{name:t,width:a,height:i,asSVG:!0})}):null})),De=a((({className:e,links:t,context:a})=>{const i=a.useRouter(),{handlerDecorator:l}=a;return n("div",{className:`${e||""}`,children:[r("div",{className:"pt-5 pb-[5px]",children:r("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?r("div",{className:"flex justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>r(Re,{index:t,...A({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),Re=a((({className:e,index:t,text:n,href:a,target:i,onClick:l})=>r("a",{className:`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:n||`Документ ${t}`}))),Te=a((({className:e,documents:t,relatedEnterprises:a,contacts:i,socialMedia:l,topItems:s,context:c})=>n("footer",{className:`${e} px-9 py-10 bg-white`,children:[n("div",{className:"flex items-stretch gap-32 pb-8 xl:gap-8",children:[r(de,{className:"w-[280px] xl:w-[220px]"}),r(he,{context:c,className:"grow"})]}),n("div",{className:"flex items-stretch gap-32 xl:gap-8",children:[r(xe,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:i,context:c,hasButton:!0}),r($e,{className:"pt-[3px]",context:c,items:s})]}),r(je,{media:l,context:c}),r(be,{links:a,context:c}),r(De,{links:t,context:c})]}))),Ie=[{d:"m9 12 4-4-4-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"},{d:"M2 9a1 1 0 0 1 0-2v2Zm6-2a1 1 0 0 1 0 2V7ZM2 7h6v2H2V7Z"}],Me=a((({className:e,disabled:t,...n})=>r(b,{rounded:!0,className:`shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main"} ${e||""}`,disabled:t,...n,children:r(oe,{paths:Ie,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),Ae={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},Pe={normal:380,mini:276},Be={normal:3,mini:4},Oe=a((({title:e,description:t,context:a,cards:i=[],className:l,version:s="normal"})=>{const[c,o]=a.useState(0);const m=i?.length>Be[s],d=m&&i?.length-c>Be[s],h=m&&c>0;return n("section",{className:`relative font-sans text-primary-text bg-white p-12 overflow-hidden ${l}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[e?r(k,{className:"font-medium m-0 text-center",children:e}):null,t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:`flex ${i?.length<=Be[s]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*Pe[s]}px)`},role:"list",children:i?.map(((e,t)=>function(e,t,a){return n("div",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${Ae[a]} w-full`,role:"listitem",children:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(v,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.items.map(Ve)}):null]}),e.href?r(b,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},String(t))}(e,t,s)))}),h&&r(Me,{className:"absolute top-1/2 left-8 rotate-180",onClick:function(){o(c-1)},ariaLabel:"Пролистать влево"}),d&&r(Me,{className:"absolute top-1/2 right-1 z-10",onClick:function(){o(c+1)},ariaLabel:"Пролистать вправо"}),r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})}));function Ve(e,t){return r(x,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))}const He=a((e=>r(Oe,{...e,version:"normal"}))),Ze=a((({className:e,text:t,href:a,target:i,active:l,onClick:s,children:c})=>n("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:i,onClick:s,children:[r("span",{className:`font-sans font-normal text-base ${l?"text-primary-main":"text-primary-text hover:text-primary-main"}`,children:t||c}),l?r("div",{className:"absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main"}):null]}))),Fe=a((({className:e,text:t,href:n,target:a,active:i,flat:l,onClick:s,children:c,ariaLabel:o})=>r("a",{className:`inline-block border border-solid bg-transparent text-center no-underline ${l?"":"px-4 py-2"} ${i?"border-primary-main rounded-md":"border-transparent"} ${e||""}`,href:n,target:a,onClick:s,rel:"noopener noreferrer","aria-label":o,children:r("span",{className:`font-sans font-normal text-sm ${i?"text-primary-main":(l?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"}`,children:t||c})}))),ze=a((({className:e,children:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${e||""}`,disabled:!0,"aria-label":n,children:t}))),Ee=a((({context:e,className:t,defaultLocation:a=""})=>{const[i,l]=e.useGeolocation(a);return n("div",{className:`flex items-center ${t||""}`,children:[r(Fe,{className:"mr-5",flat:!0,href:"#",text:i,ariaLabel:"Местоположение",onClick:l}),r(Fe,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов"}),r(ze,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Поиск по сайту",children:r(N,{name:"LoupeIcon","aria-hidden":"true",className:"h-full",asSVG:!0})}),r(ze,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Профиль",children:r(N,{name:"ProfileIcon","aria-hidden":"true",className:"h-full",asSVG:!0})}),r(ze,{className:"min-w-[32px] min-h-[32px] fill-secondary-light hover:fill-secondary-hover",ariaLabel:"Дополнительные ссылки",children:r(N,{name:"GridIcon","aria-hidden":"true",className:"h-full",asSVG:!0})})]})}));const Ge=a((({className:e,defaultLocation:t,context:a,topItems:i})=>{const l=a.useRouter(),s=ye(a.useAsyncData),{handlerDecorator:c}=a,o=ve(s.topItems,i),m=o.find(function(e){return t=>_(t.href,e,((e,t)=>t.startsWith(e)))}(l)),d=m?.items,h=d?.find(function(e){return t=>_(t.href,e)}(l)),x=o.map(((e,t)=>r(Fe,{active:e===m,...A({router:l,handlerDecorator:c},e),ariaLabel:e.text},String(t)))),u=d?.map((e=>r(Ze,{className:"mr-8",active:e===h,...A({router:l,handlerDecorator:c},e)},e.href)));return n("header",{className:`pt-5 pb-8 px-20 bg-white ${e||""}`,children:[n("div",{className:"flex items-center",children:[r(de,{className:"mr-8"}),x,r(Ee,{context:a,className:"ml-auto",defaultLocation:t})]}),r("div",{className:"mt-5 h-[1px] bg-main-divider"}),r("nav",{className:"mt-5",children:u})]})})),Ue=a((e=>r(Oe,{...e,version:"mini"}))),We=a((({className:e,context:t,title:a="Мобильное приложение",qr:i,buttons:l=[]})=>r(Z,{className:e,context:t,title:a,buttons:l,children:n("div",{className:"flex items-center",children:[i?.src&&i?.href&&r("a",{href:i.href,target:"_blank",children:r("img",{src:i.src,alt:a,title:a,width:"164",height:"164",className:"w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light"})}),r("span",{className:"font-normal text-sm text-secondary-text ml-4",children:"Наведите камеру телефона на QR-код и скачайте приложение"})]})}))),Je=a((({className:e,context:t,title:a,titleSize:i,description:l,benefits:s,buttons:c,image:o,items:m})=>n("div",{className:`flex grow justify-between items-stretch ${e||""}`,children:[n("div",{className:"flex flex-col",children:[a&&r(k,{size:i||"XL",className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px] text-primary-text",children:a}),r(B,{context:t,description:l,items:m,buttons:c,children:s?.length?r("div",{className:"flex gap-6 mt-6 mb-3.5",children:s.map(Xe)}):null})]}),o?.src&&r(v,{className:"mt-auto",image:o})]})));function Xe(e,t){return n("div",{className:"flex gap-4 items-center",children:[e.icon&&r(N,{className:"w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border",name:e.icon,width:"24",height:"24"}),n("div",{className:"flex gap-1 flex-col h-full",children:[r("h4",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const Qe=a((({text:e,href:t,target:n,onClick:a,className:i,children:l})=>t?r("a",{className:`no-underline ${i||""}`,href:t,target:n,onClick:a,children:r("span",{className:`${i||""}`,children:e||l})}):r("span",{className:`${i||""}`,children:e||l})));function qe(e){return t=>t.reduce(((t,r,n)=>t.length?t.concat({...e,key:n},r):[r]),[])}const Ke=a((e=>{const{context:t,className:a,breadcrumbs:i}=e,l=t.useRouter(),{handlerDecorator:s}=t;return n("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${a||""}`,children:[i?.length?r("div",{className:"text-xs mb-6",children:qe(r("span",{className:"text-secondary-text mx-2",children:"/"}))(i.map(((e,t)=>r(Qe,{...A({router:l,handlerDecorator:s},{className:"text-secondary-text",...e})},String(t)))))}):null,r(Je,{...e})]})})),Ye=a((({className:e,context:t,duration:a=0,slides:i=[]})=>{const l=i.map((e=>e.nav)),s=i.map((e=>e.productBlock)),[c,o]=t.useState(0);return n("section",{className:`font-sans bg-white overflow-hidden w-100 ${e||""}`,children:[r("div",{className:"flex duration-1000",style:{transform:`translateX(-${c}00%)`},role:"list",children:s.map(((e,n)=>function(e,t,n){return r("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:r("div",{className:"p-10 flex grow",children:r(Je,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:n,...e})})},String(t))}(e,n,t)))}),r("div",{className:"border-t border-solid border-main-divider flex",children:l.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:a,onClick:i,duration:l}){const s=t===a,c=s?"animate-slide":"";return n("button",{type:"button",onClick:i,className:"group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 py-4 grow basis-0",children:[n("div",{className:"border-0 border-r border-solid border-main-divider px-6",children:[r("div",{className:"text-sm font-medium group-hover:text-primary-text "+(s?"text-primary-text":"text-secondary-text"),children:e?.title}),r("div",{className:"text-xs text-secondary-text",children:e.desc})]}),r("div",{className:`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${c}`,style:{animationDuration:`${l}s`}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:a})))})]})}));const et=a((e=>{const{benefits:t,version:a}=e;return r(Z,{...e,children:n("div",{className:"flex mt-5 mb-1",children:[t?.length?r("div",{className:"mr-8",children:t.map(tt)}):null,t?.length?r("div",{className:"pt-1",children:t.map(((e,t)=>function(e,t,n="primary"){return r("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[n]}`,children:e.label},String(t))}(e,t,a)))}):null]})})}));function tt(e,t){return r("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.description},String(t))}const rt=a((({className:e,context:t,title:a="Акции и спецпредложения",date:i,description:l,buttons:s=[],version:c})=>r(Z,{className:e,context:t,title:a,buttons:s,version:c,children:n("div",{children:[i&&r("div",{className:"text-sm mb-2",children:nt(i)}),r("div",{className:"text-base",children:l})]})})));function nt(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const at=a((({className:e,title:t,steps:a})=>n("section",{className:`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${e||""}`,children:[r(k,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}),a?.length?n("div",{children:[r("div",{className:"flex mt-9 items-center px-[88px]",children:qe(r("div",{className:"h-0.5 w-full bg-secondary-light"}))(a.map(((e,t)=>it(e,t))))}),r("div",{className:"flex mt-9 justify-between gap-x-24",children:a.map(lt)})]}):null]}))),it=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative",children:r("div",{className:"h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10",children:e.icon&&r(N,{name:e.icon,width:"48",height:"48"})||r("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),lt=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative w-[276px]",children:n("div",{className:"max-w-min",children:[r("h5",{className:"font-medium text-xl m-0 mt-4 whitespace-nowrap px-3",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description})]})},String(t)),st={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"},secondary:{background:"bg-primary-main",icon:"bg-white text-primary-main",title:"text-white",description:"text-white"},"secondary-light":{background:"bg-primary-main/10",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"}},ct=a((({title:e,description:t,blockVersion:a="primary",iconVersion:i,image:l,className:s})=>{const c=st[a];return n("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:[i&&"small"===i?ot(c.icon):null,i&&"big"===i?mt(l):null,n("div",{className:"py-0.5",children:[e&&r("div",{className:`font-medium text-base mb-1 ${c.title}`,children:e}),t&&r("div",{className:`text-sm ${c.description}`,children:t})]})]})}));function ot(e){return r("div",{className:"pt-1.5 pr-4",children:r("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function mt(e){return e?.src?r(v,{className:"pt-0.5 pr-3",image:e}):null}const dt=a((({children:e})=>r("div",{className:"self-start flex flex-col",role:"row",children:r("div",{className:"flex",children:e})}))),ht="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",xt="border-main-stroke border-solid border",ut="border-main-divider border border-t-0 border-x-0",pt="w-[200px] mr-6",ft=a((({children:e,activeCardIndex:t})=>r("div",{className:"flex flex-1 overflow-hidden",children:r("div",{className:"flex gap-4 duration-1000",style:{transform:`translateX(-${336*t}px)`},children:e})}))),bt=a((({icon:e,image:t,title:a,link:i})=>n("div",{className:`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-12 ${xt} ${ht}`,role:"columnheader",scope:"col",children:[e&&!t?.src&&r(N,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",name:e,width:"63",height:"63"}),t?.src&&r(v,{className:"mb-4",image:t}),a&&r(k,{size:"S",className:"font-medium m-0 text-center text-white",children:a}),i?.text&&r("div",{className:"mt-auto w-full",children:r(b,{href:i.href,target:i.target,className:"mt-4 w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:r("div",{className:"text-xs py-[11px]",children:i.text})})})]}))),gt=a((({cell:e,isFirstRow:t,isLastRow:n,isFillGradient:a})=>r("div",{className:`w-80 box-border flex flex-col ${xt} ${n?"border-t-0 rounded-b-md":"border-y-0"} ${a?ht:""}`,role:"cell",children:r("div",{className:`mx-7 h-full ${ut} ${a&&t?"border-t":""} ${n?"":"border-solid"}`,children:e.map(((e,t)=>Nt(e,t,a)))})}))),Nt=({label:e,description:t},a,i)=>n("div",{className:"first:pt-7 pt-6 last:pb-7",children:[e&&r("h5",{className:"text-xl font-medium m-0 "+(i?"text-white":""),children:e}),t&&r("div",{className:"text-sm opacity-80 "+(i?"text-white":"text-secondary-text"),children:t})]},String(a)),vt=a((({row:{header:e,data:t},activeCardIndex:a,isColoredFirstColumn:i,isFirstRow:l,isLastRow:s})=>n(dt,{children:[e?.title?r("div",{className:`text-sm py-7 ${ut} w-[200px] mr-6 ${s?"":"border-solid"}`,children:e.title}):null,t?.length?r(ft,{activeCardIndex:a,children:t.map(((e,t)=>r(gt,{cell:e,isFirstRow:l,isLastRow:s,isFillGradient:i&&0===t},String(t))))}):null]}))),yt=a((({className:e,context:t,title:a,rowHeaders:i,columns:l,visibleRowLength:s=0,isColoredFirstColumn:c=!1})=>{const o=t.useRouter(),{handlerDecorator:m}=t,[d,h]=t.useState(0),[x,u]=t.useState(!s),p=l?.map((({header:e})=>e||{})),f=l?.map((({data:e})=>e))||[],b=i?.map(((e,t)=>({header:e,data:f.map((e=>e?.[t]||[{}]))}))).slice(0,x?i.length:s),g=f?.length&&f.length>2,N=g&&f?.length-d>2,v=g&&d>0;return n("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(k,{className:"font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto",children:a}),n("div",{role:"table",children:[p?.length?n(dt,{children:[r("div",{className:pt,role:"columnheader",scope:"col"}),r(ft,{activeCardIndex:d,children:p.map(((e,t)=>r(bt,{...e,link:e.link&&A({router:o,handlerDecorator:m},e.link)},String(t))))})]}):null,b?.length?n("div",{className:"relative",children:[b.map(((e,t,{length:n})=>r(vt,{row:e,isFirstRow:0===t,isLastRow:t+1===n,activeCardIndex:d,isColoredFirstColumn:c},String(t)))),g?r("div",{children:n("div",{className:"absolute top-7 right-7 z-10",children:[r(Me,{onClick:()=>h(d+1),disabled:!N,ariaLabel:"Пролистать вправо"}),r(Me,{className:"mt-4 rotate-180",onClick:()=>h(d-1),disabled:!v,ariaLabel:"Пролистать влево"})]})}):null]}):null]}),g?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null,s?r("div",{className:"pr-[50px]",children:n("div",{className:"flex w-full",children:[r("div",{className:pt}),r("button",{onClick:()=>u(!x),className:"mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:r("div",{className:"font-sans font-medium text-xs py-[11px]",children:x?"Скрыть":"Показать все параметры"})})]})}):null]})})),wt={TextBlock:ct},kt=a((({label:e,blocks:t,context:a})=>{const[i,l]=a.useState(!1),s=t?.length,c=i?"MinusIcon":"PlusIcon";return n("li",{className:"border-0 border-b border-solid border-main-divider last:border-b-0",children:[n("button",{className:"border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text\n "+(s?"group cursor-pointer":""),onClick:e=>{if(!s)return null;l(!i);const t=St(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`},children:[r("span",{className:"m-0 text-xl pr-2.5 font-medium "+(s?"group-hover:text-primary-main":""),children:e}),s?r(N,{name:c,width:"24",height:"24"}):null]}),s?r("div",{className:(i?"pb-5":"")+" text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 ",children:t?.length?t.map($t):null}):null]})})),$t=(e,t)=>{if(e.type&&e.data&&!wt.hasOwnProperty(e.type))return null;const n=e.type&&wt[e.type];return r("div",{className:"mb-5 last:mb-0",children:r(n,{...e.data})},`component${t}`)},St=e=>"BUTTON"===e.target.tagName?e.target.nextSibling:e.target.parentNode.nextSibling,Ct=a((({title:e,accordionItems:t,context:a,className:i})=>n("section",{className:`p-[50px] font-sans bg-white text-primary-text ${i||""}`,children:[e?r(k,{className:"m-0 mb-2.5",children:e}):null,t?.length?r("ul",{className:"list-none m-0 p-0",children:t.map(((e,t)=>r(kt,{...e,context:a},`AccordionItem${t}`)))}):null]})));function _t(e,t){const{data:r}=e(jt(t),(()=>async function(e){const t=await fetch(jt(e));return await t.json()}(t)));return r||{}}function jt(e){return`/wcms-resources/${e||"credit-calculator-data"}.json`}const Lt=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],Dt=a((({text:e,checked:t,onChange:a,className:i})=>r("div",{className:i,children:n("label",{className:"flex items-center cursor-pointer relative",children:[r("input",{className:"peer appearance-none w-5 h-5 border-solid border rounded border-black checked:bg-primary-main checked:border-primary-main",type:"checkbox",onChange:e=>{a(e.target.checked)},checked:t}),r(oe,{paths:Lt,className:"hidden absolute left-2 ml-px peer-checked:block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"}),e?r("span",{className:"font-sans ml-2 text-sm cursor-pointer",children:e}):null]})}))),Rt=e=>new Intl.NumberFormat("ru-RU",{maximumSignificantDigits:3}).format(e),Tt=a((({className:e,title:t,items:a=[],min:i=1,max:l=100,step:s=1,value:c=i,onChange:o})=>{const m=e=>{if(!o)return;const t=Number(e.replace(/\D/g,""));o(t)},d={backgroundSize:`${(100*(c-i)/(l-i)).toFixed(2)}% 100%`};return n("div",{className:e,children:[n("div",{className:"relative",children:[t?r("span",{className:"absolute text-xs text-secondary-text top-1 mt-0.5 pl-4 ml-0.5",children:t}):null,r("input",{className:"m-0 font-sans text-sm w-full h-12 border-2 border-solid border-main-divider rounded-md outline-none p-0 pl-4 m-0 box-border text-primary-text "+(t?"pt-4":""),value:Rt(c),onChange:e=>m(e.target.value),onBlur:()=>{o&&(c<i&&o(i),c>l&&o(l))}}),r("div",{className:"absolute inset-x-0 mt-0.5 top-8 px-4",children:r("input",{className:"box-border w-full m-0 cursor-pointer slider",type:"range",min:i,max:l,step:s,value:c,onChange:e=>m(e.target.value),style:d})})]}),r("div",{className:"flex justify-between mt-3 mb-4",children:a.map(((e,t)=>r("span",{className:"text-xs text-secondary-text pl-4",children:e},String(t))))})]})})),It=(e,t,r)=>Math.max(t,Math.min(e,r)),Mt=3e4,At=3e6,Pt=Math.round(41.5),Bt=a((({context:e,className:t,directoryName:a})=>{const[i,l]=e.useState(void 0),[s,c]=e.useState(void 0),[o,m]=e.useState(!0),[d,h]=e.useState(!0),x=(e=>{const{tableRows:t,isAnnuity:r=!1}=e;return t&&t.find((e=>e.isAnnuity===r))||{}})({tableRows:_t(e.useAsyncData,a).rows,isAnnuity:o}),u=x.maxSum&&x.minSum?(x.maxSum-x.minSum)/2:1485e3,p=x.maxMonths&&x.minMonths?Math.round((x.maxMonths-x.minMonths)/2):Pt,f=x?.minSum||Mt,g=x?.maxSum||At,N=x?.minMonths||1,v=x?.maxMonths||84,y=(e=>{const{calculatorParams:t,isInsurance:r}=e;return t?r?t?.rateWithInsurance||5:t?.rateWithoutInsurance||5:5})({calculatorParams:x,isInsurance:d}),w=(e=>{const{calculatorParams:t,paymentType:r,rate:n,sum:a,months:i}=e;if(!t)return 0;const l=It(a,t.minSum||Mt,t.maxSum||At);if("annuity"===r){const e=Number(n)/1200;return l*(e+e/(Math.pow(1+e,i)-1))}return l/i+l*(Number(n)/12)})({calculatorParams:x,paymentType:"annuity",rate:y,sum:i||u,months:s||p}),k=((e,t)=>{const r=Math.ceil((t-e)/12),n=Math.floor(e/12)+1,a=new Array(Math.min(r-1,5)).fill(0).map(((e,t)=>n+t)),i=r+n-1;return a.concat(i)})(N,v);function $(e){c(It(12*e,N,v))}return r("section",{className:`font-sans text-primary-text bg-white p-4 ${t}`,children:n("div",{className:"box-border p-12 flex flex-col justify-between border-solid border-3 border-primary-main rounded-md",children:[n("div",{className:"flex justify-between",children:[n("div",{className:"grow mr-11",children:[r(Tt,{title:"Желаемая сумма кредита, ₽",items:[`От ${Rt(f)} рублей`,`До ${Rt(g)} рублей`],min:f,max:g,step:1e3,value:i||u,onChange:l}),r(Tt,{title:"Срок кредита, месяцев",items:["Или выберите из предложенных вариантов ниже"],min:N,max:v,step:1,value:s||p,onChange:c}),r("div",{className:"flex mb-7",children:k.map(((e,t)=>function(e,t,a){return r("button",{className:"bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none",onClick:()=>a(e),children:n("span",{className:"font-semibold text-sm",children:[e," ",1===e?"год":e>4?"лет":"года"]})},String(t))}(e,t,$)))}),r(Dt,{text:"Получаю пенсию на карту Россельхозбанка",checked:o,onChange:m}),r(Dt,{className:"mb-4",text:"Комплексная страховая защита",checked:d,onChange:h})]}),n("div",{className:"p-9 bg-primary-main rounded-md text-white",children:[r("div",{className:"text-base mb-5",children:"Наше предложение"}),r("div",{className:"text-sm opacity-60",children:"Ежемесячный платёж"}),n("div",{className:"text-lg mb-3",children:[Rt(Math.round(w))," ₽"]}),r("div",{className:"text-sm opacity-60",children:"Ставка"}),n("div",{className:"text-lg",children:[y," %"]})]})]}),n("div",{className:"flex items-center",children:[r(b,{className:"mr-3",text:"Отправить заявку",version:"primary",href:"#"}),r("div",{className:"w-80 text-xxs leading-4 text-secondary-text","aria-label":"Соглашение на обработку персональных данных",children:"Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно требованиям ФЗ «О персональных данных»"})]})]})})}));const Ot={Header:Ge,Footer:Te,Placeholder:z,Tile:Z,PromoTile:rt,TextBlock:ct,ProductTile:et,ProductBlock:Ke,StepsBlock:at,BenefitsBlock:q,ProductGallery:Ye,ExchangeRateTile:ne,MobileAppTile:We,Gallery:He,MiniGallery:Ue,ComparisonTable:yt,Accordion:Ct,CreditCalculator:Bt},Vt=a((({className:e,context:t})=>r("footer",{className:`${e} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`,children:r(De,{context:t})}))),Ht=a((({title:e,description:t,cards:a=[],className:i})=>n("section",{className:`relative font-sans text-primary-text bg-white p-4 overflow-hidden ${i}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[r(k,{className:"font-medium m-0 text-centers",children:e}),t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:"horizontal-list no-scrollbar",role:"list",children:a?.map(Zt)})]})));function Zt(e,t){return n("div",{className:"box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch",role:"listitem",children:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(v,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?Ft(e.items):null]}),e.href?r(b,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function Ft(e=[]){return r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>r(x,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const zt=a((({titleSize:e,image:t,benefits:n,...a})=>{const{className:i}=a;return r("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${i||""}`,children:r(Je,{...a,titleSize:"L"})})})),Et={Header:Ge,Footer:Vt,Placeholder:z,Tile:Z,ProductTile:et,ProductBlock:zt,TextBlock:ct,ExchangeRateTile:ne,MobileAppTile:We,Gallery:Ht};e.Blocks=Ot,e.ContentPage=J,e.ContentPageHead=s,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),r=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await r.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function r(){try{const e=JSON.parse(globalThis.localStorage.getItem(l)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:r,name:n}=await e.json();return globalThis.localStorage.setItem(l,JSON.stringify({token:r,name:n})),{token:r,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...n){if(!n.length)return[];const{token:a}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify({node_ids:n})}),{likes:i}=await r.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(n){if(!n)return 0;const{token:a,name:i}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:n,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(n){if(!n)return 0;const{token:a,name:i}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:n,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}}}},e.MobileBlocks=Et,e.joinList=qe,e.projectSettings=i,e.setup=t,e.toMobilePage=function(e){const t=e.blocks?.filter((({mobile:e})=>!e?.hidden)).map(Q);return{...e,blocks:t}},e.url=I,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -16,4 +16,5 @@ export declare const Blocks: {
|
|
|
16
16
|
MiniGallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./MiniGallery/MiniGallery").MiniGalleryProps, any>, context?: any) => any;
|
|
17
17
|
ComparisonTable: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ComparisonTable/ComparisonTable").ComparisonTableProps, any>, context?: any) => any;
|
|
18
18
|
Accordion: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Accordion/Accordion").AccordionProps, any>, context?: any) => any;
|
|
19
|
+
CreditCalculator: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./CreditCalculator/CreditCalculator").CreditCalculatorProps, any>, context?: any) => any;
|
|
19
20
|
};
|
|
@@ -17,6 +17,7 @@ const TextBlock_1 = require("./TextBlock/TextBlock");
|
|
|
17
17
|
const Tile_1 = require("./Tile/Tile");
|
|
18
18
|
const ComparisonTable_1 = require("./ComparisonTable/ComparisonTable");
|
|
19
19
|
const Accordion_1 = require("./Accordion/Accordion");
|
|
20
|
+
const CreditCalculator_1 = require("./CreditCalculator/CreditCalculator");
|
|
20
21
|
exports.Blocks = {
|
|
21
22
|
Header: Header_1.Header,
|
|
22
23
|
Footer: Footer_1.Footer,
|
|
@@ -35,5 +36,6 @@ exports.Blocks = {
|
|
|
35
36
|
MiniGallery: MiniGallery_1.MiniGallery,
|
|
36
37
|
ComparisonTable: ComparisonTable_1.ComparisonTable,
|
|
37
38
|
Accordion: Accordion_1.Accordion,
|
|
39
|
+
CreditCalculator: CreditCalculator_1.CreditCalculator,
|
|
38
40
|
};
|
|
39
41
|
//# sourceMappingURL=Blocks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../../src/components/Blocks.ts"],"names":[],"mappings":";;AAAA,iEAA8D;AAC9D,0EAAuE;AACvE,4CAAyC;AACzC,+CAA4C;AAC5C,4CAAyC;AACzC,2DAAwD;AACxD,iEAA8D;AAC9D,2DAAwD;AACxD,8DAA2D;AAC3D,oEAAiE;AACjE,2DAAwD;AACxD,qDAAkD;AAClD,wDAAqD;AACrD,qDAAkD;AAClD,sCAAmC;AACnC,uEAAoE;AACpE,qDAAkD;
|
|
1
|
+
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../../src/components/Blocks.ts"],"names":[],"mappings":";;AAAA,iEAA8D;AAC9D,0EAAuE;AACvE,4CAAyC;AACzC,+CAA4C;AAC5C,4CAAyC;AACzC,2DAAwD;AACxD,iEAA8D;AAC9D,2DAAwD;AACxD,8DAA2D;AAC3D,oEAAiE;AACjE,2DAAwD;AACxD,qDAAkD;AAClD,wDAAqD;AACrD,qDAAkD;AAClD,sCAAmC;AACnC,uEAAoE;AACpE,qDAAkD;AAClD,0EAAuE;AAE1D,QAAA,MAAM,GAAG;IACpB,MAAM,EAAN,eAAM;IACN,MAAM,EAAN,eAAM;IACN,WAAW,EAAX,yBAAW;IACX,IAAI,EAAJ,WAAI;IACJ,SAAS,EAAT,qBAAS;IACT,SAAS,EAAT,qBAAS;IACT,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,2BAAY;IACZ,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,aAAa,EAAb,6BAAa;IACb,OAAO,EAAP,iBAAO;IACP,WAAW,EAAX,yBAAW;IACX,eAAe,EAAf,iCAAe;IACf,SAAS,EAAT,qBAAS;IACT,gBAAgB,EAAhB,mCAAgB;CACjB,CAAC"}
|
|
@@ -30,6 +30,10 @@ exports.CreditCalculator = (0, uni_jsx_1.JSX)(({ context, className, directoryNa
|
|
|
30
30
|
const defaultMonths = calculatorParams.maxMonths && calculatorParams.minMonths
|
|
31
31
|
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
32
32
|
: constants_1.DEFAULT_MONTHS;
|
|
33
|
+
const minSum = calculatorParams?.minSum || constants_1.DEFAULT_MIN_SUM;
|
|
34
|
+
const maxSum = calculatorParams?.maxSum || constants_1.DEFAULT_MAX_SUM;
|
|
35
|
+
const minMonths = calculatorParams?.minMonths || constants_1.DEFAULT_MIN_MONTHS;
|
|
36
|
+
const maxMonths = calculatorParams?.maxMonths || constants_1.DEFAULT_MAX_MONTHS;
|
|
33
37
|
const rate = (0, getCreditRate_1.getCreditRate)({ calculatorParams, isInsurance: isInsuranceChecked });
|
|
34
38
|
const montlyPayment = (0, getMonthlyPayment_1.getMonthlyPayment)({
|
|
35
39
|
calculatorParams,
|
|
@@ -38,14 +42,14 @@ exports.CreditCalculator = (0, uni_jsx_1.JSX)(({ context, className, directoryNa
|
|
|
38
42
|
sum: moneyValue || defaultSum,
|
|
39
43
|
months: monthsValue || defaultMonths,
|
|
40
44
|
});
|
|
41
|
-
const creditTermYears = (0, getCreditTermYears_1.getCreditTermYears)(
|
|
45
|
+
const creditTermYears = (0, getCreditTermYears_1.getCreditTermYears)(minMonths, maxMonths);
|
|
42
46
|
function handleButtonClick(value) {
|
|
43
|
-
setMonthsValue((0, clamp_1.clamp)(value * constants_1.MONTHS_IN_YEAR,
|
|
47
|
+
setMonthsValue((0, clamp_1.clamp)(value * constants_1.MONTHS_IN_YEAR, minMonths, maxMonths));
|
|
44
48
|
}
|
|
45
49
|
return ((0, jsx_runtime_1.jsx)("section", { className: `font-sans text-primary-text bg-white p-4 ${className}`, children: (0, jsx_runtime_1.jsxs)("div", { className: `box-border p-12 flex flex-col justify-between ${borderStyle}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grow mr-11", children: [(0, jsx_runtime_1.jsx)(InputRange_1.InputRange, { title: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD", items: [
|
|
46
|
-
`От ${(0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(
|
|
47
|
-
`До ${(0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(
|
|
48
|
-
], min:
|
|
50
|
+
`От ${(0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(minSum)} рублей`,
|
|
51
|
+
`До ${(0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(maxSum)} рублей`,
|
|
52
|
+
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }), (0, jsx_runtime_1.jsx)(InputRange_1.InputRange, { title: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ['Или выберите из предложенных вариантов ниже'], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: monthsValue || defaultMonths, onChange: setMonthsValue }), (0, jsx_runtime_1.jsx)("div", { className: "flex mb-7", children: creditTermYears.map((number, i) => renderButton(number, i, handleButtonClick)) }), (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", checked: isAnnuityChecked, onChange: setIsAnnuityChecked }), (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { className: "mb-4", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsuranceChecked, onChange: setIsInsuranceChecked })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-9 bg-primary-main rounded-md text-white", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-base mb-5", children: "\u041D\u0430\u0448\u0435 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm opacity-60", children: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg mb-3", children: [(0, addSpacesBetweenNumbers_1.addSpacesBetweenNumbers)(Math.round(montlyPayment)), " \u20BD"] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm opacity-60", children: "\u0421\u0442\u0430\u0432\u043A\u0430" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg", children: [rate, " %"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { className: "mr-3", text: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443", version: "primary", href: "#" }), (0, jsx_runtime_1.jsx)("div", { className: "w-80 text-xxs leading-4 text-secondary-text", "aria-label": "\u0421\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u0435 \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u044F \u0437\u0430\u044F\u0432\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u043E \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F\u043C \u0424\u0417\u00A0\u00AB\u041E\u00A0\u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445\u00BB" })] })] }) }));
|
|
49
53
|
});
|
|
50
54
|
function renderButton(number, i, handleClick) {
|
|
51
55
|
return ((0, jsx_runtime_1.jsx)("button", { className: "bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none", onClick: () => handleClick(number), children: (0, jsx_runtime_1.jsxs)("span", { className: "font-semibold text-sm", children: [number, " ", number === 1 ? 'год' : number > 4 ? 'лет' : 'года'] }) }, String(i)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditCalculator.js","sourceRoot":"","sources":["../../../src/components/CreditCalculator/CreditCalculator.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iFAA8E;AAE9E,uDAAoD;AACpD,6DAA0D;AAC1D,mEAAgE;AAChE,iFAA8E;AAC9E,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"CreditCalculator.js","sourceRoot":"","sources":["../../../src/components/CreditCalculator/CreditCalculator.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iFAA8E;AAE9E,uDAAoD;AACpD,6DAA0D;AAC1D,mEAAgE;AAChE,iFAA8E;AAC9E,6CAA0C;AAC1C,2CAQqB;AAErB,+DAA4D;AAC5D,mDAAgD;AAChD,6DAA0D;AAC1D,2DAAwD;AAIxD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,MAAM,WAAW,GAAG,sDAAsD,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,aAAG,EACjC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,EAAE;IACxC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACpF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACtF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3E,MAAM,SAAS,GAAG,IAAA,iDAAuB,EAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC;IAEpF,MAAM,gBAAgB,GAAG,IAAA,yCAAmB,EAAC,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAEzF,MAAM,UAAU,GACd,gBAAgB,CAAC,MAAM,IAAI,gBAAgB,CAAC,MAAM;QAChD,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC;QACzD,CAAC,CAAC,uBAAW,CAAC;IAElB,MAAM,aAAa,GACjB,gBAAgB,CAAC,SAAS,IAAI,gBAAgB,CAAC,SAAS;QACtD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC,CAAC,0BAAc,CAAC;IAErB,MAAM,MAAM,GAAG,gBAAgB,EAAE,MAAM,IAAI,2BAAe,CAAC;IAC3D,MAAM,MAAM,GAAG,gBAAgB,EAAE,MAAM,IAAI,2BAAe,CAAC;IAC3D,MAAM,SAAS,GAAG,gBAAgB,EAAE,SAAS,IAAI,8BAAkB,CAAC;IACpE,MAAM,SAAS,GAAG,gBAAgB,EAAE,SAAS,IAAI,8BAAkB,CAAC;IAEpE,MAAM,IAAI,GAAG,IAAA,6BAAa,EAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAElF,MAAM,aAAa,GAAG,IAAA,qCAAiB,EAAC;QACtC,gBAAgB;QAChB,WAAW,EAAE,oBAAoB;QACjC,IAAI;QACJ,GAAG,EAAE,UAAU,IAAI,UAAU;QAC7B,MAAM,EAAE,WAAW,IAAI,aAAa;KACrC,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,IAAA,uCAAkB,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAEjE,SAAS,iBAAiB,CAAC,KAAa;QACtC,cAAc,CAAC,IAAA,aAAK,EAAC,KAAK,GAAG,0BAAc,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,CACL,oCAAS,SAAS,EAAE,4CAA4C,SAAS,EAAE,YACzE,iCAAK,SAAS,EAAE,iDAAiD,WAAW,EAAE,aAC5E,iCAAK,SAAS,EAAC,sBAAsB,aACnC,iCAAK,SAAS,EAAC,YAAY,aACzB,uBAAC,uBAAU,IACT,KAAK,EAAC,oIAA2B,EACjC,KAAK,EAAE;wCACL,MAAM,IAAA,iDAAuB,EAAC,MAAM,CAAC,SAAS;wCAC9C,MAAM,IAAA,iDAAuB,EAAC,MAAM,CAAC,SAAS;qCAC/C,EACD,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,IAAI,UAAU,EAC/B,QAAQ,EAAE,aAAa,GACvB,EACF,uBAAC,uBAAU,IACT,KAAK,EAAC,iHAAuB,EAC7B,KAAK,EAAE,CAAC,6CAA6C,CAAC,EACtD,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,WAAW,IAAI,aAAa,EACnC,QAAQ,EAAE,cAAc,GACxB,EACF,gCAAK,SAAS,EAAC,WAAW,YACvB,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC,GAC3E,EACN,uBAAC,mBAAQ,IACP,IAAI,EAAC,wNAAyC,EAC9C,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,mBAAmB,GAC7B,EACF,uBAAC,mBAAQ,IACP,SAAS,EAAC,MAAM,EAChB,IAAI,EAAC,gKAA8B,EACnC,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,qBAAqB,GAC/B,IACE,EACN,iCAAK,SAAS,EAAC,2CAA2C,aACxD,gCAAK,SAAS,EAAC,gBAAgB,4GAAuB,EACtD,gCAAK,SAAS,EAAC,oBAAoB,wHAAyB,EAC5D,iCAAK,SAAS,EAAC,cAAc,aAC1B,IAAA,iDAAuB,EAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,eAC/C,EACN,gCAAK,SAAS,EAAC,oBAAoB,qDAAa,EAChD,iCAAK,SAAS,EAAC,SAAS,aAAE,IAAI,UAAS,IACnC,IACF,EACN,iCAAK,SAAS,EAAC,mBAAmB,aAChC,uBAAC,eAAM,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAC,6FAAkB,EAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,GAAG,GAAG,EAC9E,gCACE,SAAS,EAAC,6CAA6C,gBAC5C,gPAA6C,qqBAIpD,IACF,IACF,GACE,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,YAAY,CAAC,MAAc,EAAE,CAAS,EAAE,WAAqC;IACpF,OAAO,CACL,mCAEE,SAAS,EAAC,0HAA0H,EACpI,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,YAElC,kCAAM,SAAS,EAAC,uBAAuB,aACpC,MAAM,OAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,IACvD,IANF,MAAM,CAAC,CAAC,CAAC,CAOP,CACV,CAAC;AACJ,CAAC"}
|