@redneckz/wildless-cms-uni-blocks 0.14.973 → 0.14.975
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +39 -143
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/bundle/components/GalleryLayout/utils.d.ts +2 -2
- package/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/model/HeadlineType.d.ts +14 -1
- package/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/GalleryLayout/utils.d.ts +2 -2
- package/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/dist/components/ProductBlock/ProductBlock.js +16 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/model/HeadlineType.d.ts +14 -1
- package/dist/retail/api/createUserTaskDebit.d.ts +0 -1
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/components/Fields/AddressRetailField.js +0 -20
- package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/dist/retail/components/Fields/PaymentSystemField.js +2 -14
- package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +7 -20
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/GalleryLayout/utils.d.ts +2 -2
- package/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +16 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/model/HeadlineType.d.ts +14 -1
- package/lib/retail/api/createUserTaskDebit.d.ts +0 -1
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/components/Fields/AddressRetailField.js +0 -20
- package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/lib/retail/components/Fields/PaymentSystemField.js +2 -14
- package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +7 -20
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +39 -143
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/model/HeadlineType.d.ts +14 -1
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/dist/components/ProductBlock/ProductBlock.js +16 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/model/HeadlineType.d.ts +14 -1
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/components/Fields/AddressRetailField.js +0 -20
- package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js +2 -14
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +7 -20
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/lib/components/ProductBlock/ProductBlock.js +16 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/model/HeadlineType.d.ts +14 -1
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/components/Fields/AddressRetailField.js +0 -20
- package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js +2 -14
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +7 -20
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +57 -14
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +6 -2
- package/mobile/src/model/HeadlineType.ts +20 -1
- package/mobile/src/retail/api/createUserTaskDebit.ts +0 -1
- package/mobile/src/retail/components/Fields/AddressRetailField.tsx +0 -26
- package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +7 -22
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +22 -0
- package/src/components/ProductBlock/ProductBlock.tsx +57 -14
- package/src/components/ProductBlock/ProductBlockContent.ts +6 -2
- package/src/icons/IconName.ts +4 -4
- package/src/model/HeadlineType.ts +20 -1
- package/src/retail/api/createUserTaskDebit.ts +0 -1
- package/src/retail/components/Fields/AddressRetailField.tsx +0 -26
- package/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
- package/src/retail/components/Fields/RegionRetailField.tsx +7 -22
- package/bundle/retail/api/getClaimChannel.d.ts +0 -8
- package/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/bundle/retail/utils/hasDelivery.d.ts +0 -10
- package/bundle/utils/getSlugFromUrl.d.ts +0 -1
- package/dist/retail/api/getClaimChannel.d.ts +0 -8
- package/dist/retail/api/getClaimChannel.js +0 -9
- package/dist/retail/api/getClaimChannel.js.map +0 -1
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/dist/retail/utils/filterPaymentSystems.js +0 -13
- package/dist/retail/utils/filterPaymentSystems.js.map +0 -1
- package/dist/retail/utils/hasDelivery.d.ts +0 -10
- package/dist/retail/utils/hasDelivery.js +0 -13
- package/dist/retail/utils/hasDelivery.js.map +0 -1
- package/dist/utils/getSlugFromUrl.d.ts +0 -1
- package/dist/utils/getSlugFromUrl.js +0 -12
- package/dist/utils/getSlugFromUrl.js.map +0 -1
- package/lib/retail/api/getClaimChannel.d.ts +0 -8
- package/lib/retail/api/getClaimChannel.js +0 -6
- package/lib/retail/api/getClaimChannel.js.map +0 -1
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/lib/retail/utils/filterPaymentSystems.js +0 -10
- package/lib/retail/utils/filterPaymentSystems.js.map +0 -1
- package/lib/retail/utils/hasDelivery.d.ts +0 -10
- package/lib/retail/utils/hasDelivery.js +0 -9
- package/lib/retail/utils/hasDelivery.js.map +0 -1
- package/lib/utils/getSlugFromUrl.d.ts +0 -1
- package/lib/utils/getSlugFromUrl.js +0 -9
- package/lib/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/bundle/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/bundle/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/bundle/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/dist/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/dist/retail/api/getClaimChannel.js +0 -9
- package/mobile/dist/retail/api/getClaimChannel.js.map +0 -1
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/mobile/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/dist/retail/utils/filterPaymentSystems.js +0 -13
- package/mobile/dist/retail/utils/filterPaymentSystems.js.map +0 -1
- package/mobile/dist/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/dist/retail/utils/hasDelivery.js +0 -13
- package/mobile/dist/retail/utils/hasDelivery.js.map +0 -1
- package/mobile/dist/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/dist/utils/getSlugFromUrl.js +0 -12
- package/mobile/dist/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/lib/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/lib/retail/api/getClaimChannel.js +0 -6
- package/mobile/lib/retail/api/getClaimChannel.js.map +0 -1
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/mobile/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/lib/retail/utils/filterPaymentSystems.js +0 -10
- package/mobile/lib/retail/utils/filterPaymentSystems.js.map +0 -1
- package/mobile/lib/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/lib/retail/utils/hasDelivery.js +0 -9
- package/mobile/lib/retail/utils/hasDelivery.js.map +0 -1
- package/mobile/lib/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/lib/utils/getSlugFromUrl.js +0 -9
- package/mobile/lib/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/src/retail/api/getClaimChannel.ts +0 -18
- package/mobile/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
- package/mobile/src/retail/utils/filterPaymentSystems.ts +0 -14
- package/mobile/src/retail/utils/hasDelivery.ts +0 -22
- package/mobile/src/utils/getSlugFromUrl.ts +0 -10
- package/src/retail/api/getClaimChannel.ts +0 -18
- package/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
- package/src/retail/utils/filterPaymentSystems.ts +0 -14
- package/src/retail/utils/hasDelivery.ts +0 -22
- package/src/utils/getSlugFromUrl.ts +0 -10
|
@@ -985,7 +985,30 @@
|
|
|
985
985
|
return OutputComponent;
|
|
986
986
|
}
|
|
987
987
|
|
|
988
|
-
const
|
|
988
|
+
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
989
|
+
function saveSessionQuery() {
|
|
990
|
+
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
991
|
+
if (result) {
|
|
992
|
+
globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
|
|
993
|
+
}
|
|
994
|
+
return result;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicUtmDescription, dynamicDescriptionSource, description, ...rest }) => {
|
|
998
|
+
const formatDescription = getFormatDescription(dynamicUtmDescription, dynamicDescriptionSource?.list, description);
|
|
999
|
+
return (jsx(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: jsx(BaseProductTile, { defaultPadding: defaultPadding || 'p-6xl', padding: padding, description: formatDescription, className: "grow h-full", ...rest }) }));
|
|
1000
|
+
});
|
|
1001
|
+
const getFormatDescription = (dynamicUtmDescription = {}, valuesList = [], description = '') => {
|
|
1002
|
+
const { utm, value } = dynamicUtmDescription;
|
|
1003
|
+
const sessionQuery = saveSessionQuery();
|
|
1004
|
+
const utmValue = getUtmValue(utm ?? 'utm_source', sessionQuery);
|
|
1005
|
+
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
1006
|
+
return dynamicValue ? description.replace(String(value), dynamicValue) : description;
|
|
1007
|
+
};
|
|
1008
|
+
const getUtmValue = (utm, queryString) => {
|
|
1009
|
+
const params = new URLSearchParams(queryString);
|
|
1010
|
+
return params.get(utm);
|
|
1011
|
+
};
|
|
989
1012
|
|
|
990
1013
|
const AdTile = JSX((props) => {
|
|
991
1014
|
const { items } = (props.options?.page?.adSourceBook ?? {});
|
|
@@ -1013,15 +1036,6 @@
|
|
|
1013
1036
|
locationNavigator._impl = impl;
|
|
1014
1037
|
};
|
|
1015
1038
|
|
|
1016
|
-
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
1017
|
-
function saveSessionQuery() {
|
|
1018
|
-
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
1019
|
-
if (result) {
|
|
1020
|
-
globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
|
|
1021
|
-
}
|
|
1022
|
-
return result;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
1039
|
const adjustSessionQuery = (href) => {
|
|
1026
1040
|
const sessionQuery = saveSessionQuery();
|
|
1027
1041
|
if (!isURL(href) || !sessionQuery) {
|
|
@@ -4550,15 +4564,6 @@
|
|
|
4550
4564
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
4551
4565
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
4552
4566
|
|
|
4553
|
-
function getCardSlugFromUrl(url) {
|
|
4554
|
-
const lastSegment = url.split('/').filter(Boolean).pop();
|
|
4555
|
-
if (!lastSegment) {
|
|
4556
|
-
return null;
|
|
4557
|
-
}
|
|
4558
|
-
const parts = lastSegment.split('-');
|
|
4559
|
-
return parts.length > 1 ? parts[parts.length - 1] : null;
|
|
4560
|
-
}
|
|
4561
|
-
|
|
4562
4567
|
const fetchRegionOffices = async (regionKey) => {
|
|
4563
4568
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
4564
4569
|
regionRfCd: {
|
|
@@ -4587,21 +4592,9 @@
|
|
|
4587
4592
|
return result || [];
|
|
4588
4593
|
};
|
|
4589
4594
|
|
|
4590
|
-
const BIBLIOGLOBUS_SLUG = 'biblioglobus';
|
|
4591
|
-
const UNIONPAY_TEXT = 'UnionPay';
|
|
4592
|
-
const filterPaymentSystems = (systems, slug) => {
|
|
4593
|
-
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
4594
|
-
return systems;
|
|
4595
|
-
}
|
|
4596
|
-
return systems.filter((system) => system.text === UNIONPAY_TEXT);
|
|
4597
|
-
};
|
|
4598
|
-
|
|
4599
|
-
const BIBLIOGLOBUS_OFFICE_ID = '714680716';
|
|
4600
4595
|
const AddressRetailField = JSX(({ field, input }) => {
|
|
4601
4596
|
const [offices, setOffices] = useState([]);
|
|
4602
4597
|
const { data } = useLeadFormData('REGION_RF');
|
|
4603
|
-
const sessionStore = useSessionStore();
|
|
4604
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
4605
4598
|
const regionValue = field('regionRetail')?.value || {};
|
|
4606
4599
|
const addressField = field(input?.name ?? '');
|
|
4607
4600
|
useEffect(() => {
|
|
@@ -4613,20 +4606,6 @@
|
|
|
4613
4606
|
addressField.onChange?.('');
|
|
4614
4607
|
}
|
|
4615
4608
|
}, [regionValue.key]);
|
|
4616
|
-
// Логика для biblioglobus - выбор отделения по умолчанию
|
|
4617
|
-
useEffect(() => {
|
|
4618
|
-
if (!referrerUrl || !offices.length) {
|
|
4619
|
-
return;
|
|
4620
|
-
}
|
|
4621
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
4622
|
-
if (slug === BIBLIOGLOBUS_SLUG) {
|
|
4623
|
-
const defaultOffice = offices.find((office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID);
|
|
4624
|
-
addressField.onChange?.({
|
|
4625
|
-
key: defaultOffice?.id?.toString() || '',
|
|
4626
|
-
text: defaultOffice?.address || '',
|
|
4627
|
-
});
|
|
4628
|
-
}
|
|
4629
|
-
}, [referrerUrl, offices]);
|
|
4630
4609
|
const { points } = useOfficesAtmsMapData({
|
|
4631
4610
|
data: offices,
|
|
4632
4611
|
filtrationState: {},
|
|
@@ -5735,21 +5714,12 @@
|
|
|
5735
5714
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
5736
5715
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
5737
5716
|
const localStore = useLocalStore();
|
|
5738
|
-
const sessionStore = useSessionStore();
|
|
5739
5717
|
useAsyncEffect(async () => {
|
|
5740
5718
|
const { programId } = localStore;
|
|
5741
|
-
if (
|
|
5742
|
-
|
|
5743
|
-
}
|
|
5744
|
-
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5745
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
5746
|
-
if (!referrerUrl) {
|
|
5719
|
+
if (programId) {
|
|
5720
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5747
5721
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
5748
|
-
return;
|
|
5749
5722
|
}
|
|
5750
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
5751
|
-
const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
|
|
5752
|
-
setPaymentSystemOptions(filteredSystems);
|
|
5753
5723
|
}, []);
|
|
5754
5724
|
const items = useMemo(() => paymentSystemOptions?.map((_) => ({ id: _.key, text: _.text })) ?? [], [paymentSystemOptions]);
|
|
5755
5725
|
return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: items, ...field(input?.name ?? '', {
|
|
@@ -5768,49 +5738,11 @@
|
|
|
5768
5738
|
return res || undefined;
|
|
5769
5739
|
};
|
|
5770
5740
|
|
|
5771
|
-
const useBiblioglobusDefaultRegion = (args) => {
|
|
5772
|
-
const { referrerUrl, regions, regionsDelivery, onRegionChange, onRegionHasDeliveryChange, onMethodObtainChange, } = args;
|
|
5773
|
-
const slug = referrerUrl ? getCardSlugFromUrl(referrerUrl) : '';
|
|
5774
|
-
const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
|
|
5775
|
-
const regionHasDelivery = Boolean(regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg);
|
|
5776
|
-
const isReady = Boolean(referrerUrl &&
|
|
5777
|
-
regions &&
|
|
5778
|
-
regionsDelivery &&
|
|
5779
|
-
slug === BIBLIOGLOBUS_SLUG &&
|
|
5780
|
-
defaultRegion?.key &&
|
|
5781
|
-
defaultRegion?.value);
|
|
5782
|
-
useEffect(() => {
|
|
5783
|
-
if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
|
|
5784
|
-
return;
|
|
5785
|
-
}
|
|
5786
|
-
onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
|
|
5787
|
-
onRegionHasDeliveryChange?.(regionHasDelivery);
|
|
5788
|
-
onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
|
|
5789
|
-
}, [
|
|
5790
|
-
isReady,
|
|
5791
|
-
defaultRegion,
|
|
5792
|
-
regionHasDelivery,
|
|
5793
|
-
onRegionChange,
|
|
5794
|
-
onRegionHasDeliveryChange,
|
|
5795
|
-
onMethodObtainChange,
|
|
5796
|
-
]);
|
|
5797
|
-
};
|
|
5798
|
-
|
|
5799
|
-
const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
|
|
5800
|
-
const calculateRegionHasDelivery = (args) => {
|
|
5801
|
-
const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
|
|
5802
|
-
if (isDebit) {
|
|
5803
|
-
return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
|
|
5804
|
-
}
|
|
5805
|
-
return isDeliveryActive && regionDelivery;
|
|
5806
|
-
};
|
|
5807
|
-
|
|
5808
5741
|
const RegionRetailField = JSX(({ field, input }) => {
|
|
5809
5742
|
const { programId, productType } = useRetailFormStore();
|
|
5810
5743
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
5811
5744
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
5812
5745
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
5813
|
-
const sessionStore = useSessionStore();
|
|
5814
5746
|
const isDebit = productType === 'debitCard';
|
|
5815
5747
|
const isSalaryCard = programId === '38';
|
|
5816
5748
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
@@ -5819,26 +5751,17 @@
|
|
|
5819
5751
|
const handleChangeRegion = field('regionRetail')?.onChange;
|
|
5820
5752
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
5821
5753
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
5822
|
-
useBiblioglobusDefaultRegion({
|
|
5823
|
-
referrerUrl: sessionStore.referrerUrl ?? undefined,
|
|
5824
|
-
regions,
|
|
5825
|
-
regionsDelivery,
|
|
5826
|
-
onRegionChange: handleChangeRegion,
|
|
5827
|
-
onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
|
|
5828
|
-
onMethodObtainChange: handleChangeMethodObtain,
|
|
5829
|
-
});
|
|
5830
5754
|
const onChange = useCallback((value) => {
|
|
5831
|
-
const regionHasDelivery =
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
});
|
|
5755
|
+
const regionHasDelivery = isDebit
|
|
5756
|
+
? isEsiaAuth &&
|
|
5757
|
+
!isSalaryCard &&
|
|
5758
|
+
isDeliveryActive &&
|
|
5759
|
+
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
|
|
5760
|
+
: isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
|
|
5838
5761
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5839
5762
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
5840
5763
|
handleChangeRegion?.(value);
|
|
5841
|
-
}, [
|
|
5764
|
+
}, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
|
|
5842
5765
|
useEffect(() => {
|
|
5843
5766
|
if (!isEsiaAuth && isDebit) {
|
|
5844
5767
|
handleChangeRegionHasDelivery?.(false);
|
|
@@ -6042,11 +5965,6 @@
|
|
|
6042
5965
|
return res || {};
|
|
6043
5966
|
};
|
|
6044
5967
|
|
|
6045
|
-
const getClaimChannel = async () => {
|
|
6046
|
-
const res = await fetchRetailJSON('light-api-cash/v1/claimChannel/', 'GET');
|
|
6047
|
-
return res || [];
|
|
6048
|
-
};
|
|
6049
|
-
|
|
6050
5968
|
const getLastTaskStatus = async (body) => {
|
|
6051
5969
|
const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
|
|
6052
5970
|
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
@@ -6734,7 +6652,7 @@
|
|
|
6734
6652
|
...consents,
|
|
6735
6653
|
};
|
|
6736
6654
|
};
|
|
6737
|
-
const getDebitLeadFormTaskData = (
|
|
6655
|
+
const getDebitLeadFormTaskData = (formData, programId, marketingInfo) => {
|
|
6738
6656
|
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
6739
6657
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
6740
6658
|
return {
|
|
@@ -6757,7 +6675,6 @@
|
|
|
6757
6675
|
],
|
|
6758
6676
|
marketingInfo,
|
|
6759
6677
|
},
|
|
6760
|
-
...(claimChannelCode ? { claimChannelCode } : {}),
|
|
6761
6678
|
};
|
|
6762
6679
|
};
|
|
6763
6680
|
const getTaskSource = (source) => {
|
|
@@ -6833,7 +6750,6 @@
|
|
|
6833
6750
|
});
|
|
6834
6751
|
const referalData = leadFormStore.referalData;
|
|
6835
6752
|
const marketingInfo = sessionStore.marketingInfo;
|
|
6836
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
6837
6753
|
if (!profileId) {
|
|
6838
6754
|
throw new Error();
|
|
6839
6755
|
}
|
|
@@ -6847,7 +6763,6 @@
|
|
|
6847
6763
|
marketingInfo,
|
|
6848
6764
|
saveUserData,
|
|
6849
6765
|
sendAspects,
|
|
6850
|
-
referrerUrl,
|
|
6851
6766
|
});
|
|
6852
6767
|
verifyPhoneDialog.close();
|
|
6853
6768
|
if (productType === 'debitCard') {
|
|
@@ -6964,29 +6879,14 @@
|
|
|
6964
6879
|
.filter((_) => formData[_])
|
|
6965
6880
|
.map((_) => consents[_]?.text);
|
|
6966
6881
|
};
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
return undefined;
|
|
6971
|
-
}
|
|
6972
|
-
const claimData = await getClaimChannel();
|
|
6973
|
-
return claimData.find((item) => item.key === slug)?.code;
|
|
6974
|
-
};
|
|
6975
|
-
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, referrerUrl, }) => {
|
|
6882
|
+
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, }) => {
|
|
6883
|
+
let taskId;
|
|
6884
|
+
let participantId;
|
|
6976
6885
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
6977
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
6978
6886
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
6979
6887
|
try {
|
|
6980
|
-
let taskId;
|
|
6981
|
-
let participantId;
|
|
6982
6888
|
if (productType === 'debitCard') {
|
|
6983
|
-
const
|
|
6984
|
-
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData({
|
|
6985
|
-
formData,
|
|
6986
|
-
programId,
|
|
6987
|
-
marketingInfo,
|
|
6988
|
-
claimChannelCode,
|
|
6989
|
-
}));
|
|
6889
|
+
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData(formData, programId, marketingInfo));
|
|
6990
6890
|
taskId = debitData.taskId;
|
|
6991
6891
|
participantId = debitData.participantId;
|
|
6992
6892
|
}
|
|
@@ -7416,10 +7316,6 @@
|
|
|
7416
7316
|
leadFormStore.productType = productType;
|
|
7417
7317
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
7418
7318
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
7419
|
-
const referrer = globalThis.document.referrer;
|
|
7420
|
-
if (referrer) {
|
|
7421
|
-
sessionStore.referrerUrl = referrer;
|
|
7422
|
-
}
|
|
7423
7319
|
}, [queryFromStorage]);
|
|
7424
7320
|
useEffect(() => {
|
|
7425
7321
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
@@ -12955,7 +12851,7 @@
|
|
|
12955
12851
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
12956
12852
|
});
|
|
12957
12853
|
|
|
12958
|
-
const packageVersion = "0.14.
|
|
12854
|
+
const packageVersion = "0.14.974";
|
|
12959
12855
|
|
|
12960
12856
|
exports.Blocks = Blocks;
|
|
12961
12857
|
exports.ContentPage = ContentPage;
|