@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -977,7 +977,30 @@
|
|
|
977
977
|
return OutputComponent;
|
|
978
978
|
}
|
|
979
979
|
|
|
980
|
-
const
|
|
980
|
+
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
981
|
+
function saveSessionQuery() {
|
|
982
|
+
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
983
|
+
if (result) {
|
|
984
|
+
globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
|
|
985
|
+
}
|
|
986
|
+
return result;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicUtmDescription, dynamicDescriptionSource, description, ...rest }) => {
|
|
990
|
+
const formatDescription = getFormatDescription(dynamicUtmDescription, dynamicDescriptionSource?.list, description);
|
|
991
|
+
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 }) }));
|
|
992
|
+
});
|
|
993
|
+
const getFormatDescription = (dynamicUtmDescription = {}, valuesList = [], description = '') => {
|
|
994
|
+
const { utm, value } = dynamicUtmDescription;
|
|
995
|
+
const sessionQuery = saveSessionQuery();
|
|
996
|
+
const utmValue = getUtmValue(utm ?? 'utm_source', sessionQuery);
|
|
997
|
+
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
998
|
+
return dynamicValue ? description.replace(String(value), dynamicValue) : description;
|
|
999
|
+
};
|
|
1000
|
+
const getUtmValue = (utm, queryString) => {
|
|
1001
|
+
const params = new URLSearchParams(queryString);
|
|
1002
|
+
return params.get(utm);
|
|
1003
|
+
};
|
|
981
1004
|
|
|
982
1005
|
const AdTile = JSX((props) => {
|
|
983
1006
|
const { items } = (props.options?.page?.adSourceBook ?? {});
|
|
@@ -1005,15 +1028,6 @@
|
|
|
1005
1028
|
locationNavigator._impl = impl;
|
|
1006
1029
|
};
|
|
1007
1030
|
|
|
1008
|
-
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
1009
|
-
function saveSessionQuery() {
|
|
1010
|
-
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
1011
|
-
if (result) {
|
|
1012
|
-
globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
|
|
1013
|
-
}
|
|
1014
|
-
return result;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
1031
|
const adjustSessionQuery = (href) => {
|
|
1018
1032
|
const sessionQuery = saveSessionQuery();
|
|
1019
1033
|
if (!isURL(href) || !sessionQuery) {
|
|
@@ -4542,15 +4556,6 @@
|
|
|
4542
4556
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
4543
4557
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
4544
4558
|
|
|
4545
|
-
function getCardSlugFromUrl(url) {
|
|
4546
|
-
const lastSegment = url.split('/').filter(Boolean).pop();
|
|
4547
|
-
if (!lastSegment) {
|
|
4548
|
-
return null;
|
|
4549
|
-
}
|
|
4550
|
-
const parts = lastSegment.split('-');
|
|
4551
|
-
return parts.length > 1 ? parts[parts.length - 1] : null;
|
|
4552
|
-
}
|
|
4553
|
-
|
|
4554
4559
|
const fetchRegionOffices = async (regionKey) => {
|
|
4555
4560
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
4556
4561
|
regionRfCd: {
|
|
@@ -4579,21 +4584,9 @@
|
|
|
4579
4584
|
return result || [];
|
|
4580
4585
|
};
|
|
4581
4586
|
|
|
4582
|
-
const BIBLIOGLOBUS_SLUG = 'biblioglobus';
|
|
4583
|
-
const UNIONPAY_TEXT = 'UnionPay';
|
|
4584
|
-
const filterPaymentSystems = (systems, slug) => {
|
|
4585
|
-
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
4586
|
-
return systems;
|
|
4587
|
-
}
|
|
4588
|
-
return systems.filter((system) => system.text === UNIONPAY_TEXT);
|
|
4589
|
-
};
|
|
4590
|
-
|
|
4591
|
-
const BIBLIOGLOBUS_OFFICE_ID = '714680716';
|
|
4592
4587
|
const AddressRetailField = JSX(({ field, input }) => {
|
|
4593
4588
|
const [offices, setOffices] = useState([]);
|
|
4594
4589
|
const { data } = useLeadFormData('REGION_RF');
|
|
4595
|
-
const sessionStore = useSessionStore();
|
|
4596
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
4597
4590
|
const regionValue = field('regionRetail')?.value || {};
|
|
4598
4591
|
const addressField = field(input?.name ?? '');
|
|
4599
4592
|
useEffect(() => {
|
|
@@ -4605,20 +4598,6 @@
|
|
|
4605
4598
|
addressField.onChange?.('');
|
|
4606
4599
|
}
|
|
4607
4600
|
}, [regionValue.key]);
|
|
4608
|
-
// Логика для biblioglobus - выбор отделения по умолчанию
|
|
4609
|
-
useEffect(() => {
|
|
4610
|
-
if (!referrerUrl || !offices.length) {
|
|
4611
|
-
return;
|
|
4612
|
-
}
|
|
4613
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
4614
|
-
if (slug === BIBLIOGLOBUS_SLUG) {
|
|
4615
|
-
const defaultOffice = offices.find((office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID);
|
|
4616
|
-
addressField.onChange?.({
|
|
4617
|
-
key: defaultOffice?.id?.toString() || '',
|
|
4618
|
-
text: defaultOffice?.address || '',
|
|
4619
|
-
});
|
|
4620
|
-
}
|
|
4621
|
-
}, [referrerUrl, offices]);
|
|
4622
4601
|
const { points } = useOfficesAtmsMapData({
|
|
4623
4602
|
data: offices,
|
|
4624
4603
|
filtrationState: {},
|
|
@@ -5727,21 +5706,12 @@
|
|
|
5727
5706
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
5728
5707
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
5729
5708
|
const localStore = useLocalStore();
|
|
5730
|
-
const sessionStore = useSessionStore();
|
|
5731
5709
|
useAsyncEffect(async () => {
|
|
5732
5710
|
const { programId } = localStore;
|
|
5733
|
-
if (
|
|
5734
|
-
|
|
5735
|
-
}
|
|
5736
|
-
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5737
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
5738
|
-
if (!referrerUrl) {
|
|
5711
|
+
if (programId) {
|
|
5712
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5739
5713
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
5740
|
-
return;
|
|
5741
5714
|
}
|
|
5742
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
5743
|
-
const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
|
|
5744
|
-
setPaymentSystemOptions(filteredSystems);
|
|
5745
5715
|
}, []);
|
|
5746
5716
|
const items = useMemo(() => paymentSystemOptions?.map((_) => ({ id: _.key, text: _.text })) ?? [], [paymentSystemOptions]);
|
|
5747
5717
|
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 ?? '', {
|
|
@@ -5760,49 +5730,11 @@
|
|
|
5760
5730
|
return res || undefined;
|
|
5761
5731
|
};
|
|
5762
5732
|
|
|
5763
|
-
const useBiblioglobusDefaultRegion = (args) => {
|
|
5764
|
-
const { referrerUrl, regions, regionsDelivery, onRegionChange, onRegionHasDeliveryChange, onMethodObtainChange, } = args;
|
|
5765
|
-
const slug = referrerUrl ? getCardSlugFromUrl(referrerUrl) : '';
|
|
5766
|
-
const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
|
|
5767
|
-
const regionHasDelivery = Boolean(regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg);
|
|
5768
|
-
const isReady = Boolean(referrerUrl &&
|
|
5769
|
-
regions &&
|
|
5770
|
-
regionsDelivery &&
|
|
5771
|
-
slug === BIBLIOGLOBUS_SLUG &&
|
|
5772
|
-
defaultRegion?.key &&
|
|
5773
|
-
defaultRegion?.value);
|
|
5774
|
-
useEffect(() => {
|
|
5775
|
-
if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
|
|
5776
|
-
return;
|
|
5777
|
-
}
|
|
5778
|
-
onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
|
|
5779
|
-
onRegionHasDeliveryChange?.(regionHasDelivery);
|
|
5780
|
-
onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
|
|
5781
|
-
}, [
|
|
5782
|
-
isReady,
|
|
5783
|
-
defaultRegion,
|
|
5784
|
-
regionHasDelivery,
|
|
5785
|
-
onRegionChange,
|
|
5786
|
-
onRegionHasDeliveryChange,
|
|
5787
|
-
onMethodObtainChange,
|
|
5788
|
-
]);
|
|
5789
|
-
};
|
|
5790
|
-
|
|
5791
|
-
const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
|
|
5792
|
-
const calculateRegionHasDelivery = (args) => {
|
|
5793
|
-
const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
|
|
5794
|
-
if (isDebit) {
|
|
5795
|
-
return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
|
|
5796
|
-
}
|
|
5797
|
-
return isDeliveryActive && regionDelivery;
|
|
5798
|
-
};
|
|
5799
|
-
|
|
5800
5733
|
const RegionRetailField = JSX(({ field, input }) => {
|
|
5801
5734
|
const { programId, productType } = useRetailFormStore();
|
|
5802
5735
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
5803
5736
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
5804
5737
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
5805
|
-
const sessionStore = useSessionStore();
|
|
5806
5738
|
const isDebit = productType === 'debitCard';
|
|
5807
5739
|
const isSalaryCard = programId === '38';
|
|
5808
5740
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
@@ -5811,26 +5743,17 @@
|
|
|
5811
5743
|
const handleChangeRegion = field('regionRetail')?.onChange;
|
|
5812
5744
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
5813
5745
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
5814
|
-
useBiblioglobusDefaultRegion({
|
|
5815
|
-
referrerUrl: sessionStore.referrerUrl ?? undefined,
|
|
5816
|
-
regions,
|
|
5817
|
-
regionsDelivery,
|
|
5818
|
-
onRegionChange: handleChangeRegion,
|
|
5819
|
-
onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
|
|
5820
|
-
onMethodObtainChange: handleChangeMethodObtain,
|
|
5821
|
-
});
|
|
5822
5746
|
const onChange = useCallback((value) => {
|
|
5823
|
-
const regionHasDelivery =
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
});
|
|
5747
|
+
const regionHasDelivery = isDebit
|
|
5748
|
+
? isEsiaAuth &&
|
|
5749
|
+
!isSalaryCard &&
|
|
5750
|
+
isDeliveryActive &&
|
|
5751
|
+
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
|
|
5752
|
+
: isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
|
|
5830
5753
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5831
5754
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
5832
5755
|
handleChangeRegion?.(value);
|
|
5833
|
-
}, [
|
|
5756
|
+
}, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
|
|
5834
5757
|
useEffect(() => {
|
|
5835
5758
|
if (!isEsiaAuth && isDebit) {
|
|
5836
5759
|
handleChangeRegionHasDelivery?.(false);
|
|
@@ -6034,11 +5957,6 @@
|
|
|
6034
5957
|
return res || {};
|
|
6035
5958
|
};
|
|
6036
5959
|
|
|
6037
|
-
const getClaimChannel = async () => {
|
|
6038
|
-
const res = await fetchRetailJSON('light-api-cash/v1/claimChannel/', 'GET');
|
|
6039
|
-
return res || [];
|
|
6040
|
-
};
|
|
6041
|
-
|
|
6042
5960
|
const getLastTaskStatus = async (body) => {
|
|
6043
5961
|
const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
|
|
6044
5962
|
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
@@ -6726,7 +6644,7 @@
|
|
|
6726
6644
|
...consents,
|
|
6727
6645
|
};
|
|
6728
6646
|
};
|
|
6729
|
-
const getDebitLeadFormTaskData = (
|
|
6647
|
+
const getDebitLeadFormTaskData = (formData, programId, marketingInfo) => {
|
|
6730
6648
|
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
6731
6649
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
6732
6650
|
return {
|
|
@@ -6749,7 +6667,6 @@
|
|
|
6749
6667
|
],
|
|
6750
6668
|
marketingInfo,
|
|
6751
6669
|
},
|
|
6752
|
-
...(claimChannelCode ? { claimChannelCode } : {}),
|
|
6753
6670
|
};
|
|
6754
6671
|
};
|
|
6755
6672
|
const getTaskSource = (source) => {
|
|
@@ -6825,7 +6742,6 @@
|
|
|
6825
6742
|
});
|
|
6826
6743
|
const referalData = leadFormStore.referalData;
|
|
6827
6744
|
const marketingInfo = sessionStore.marketingInfo;
|
|
6828
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
6829
6745
|
if (!profileId) {
|
|
6830
6746
|
throw new Error();
|
|
6831
6747
|
}
|
|
@@ -6839,7 +6755,6 @@
|
|
|
6839
6755
|
marketingInfo,
|
|
6840
6756
|
saveUserData,
|
|
6841
6757
|
sendAspects,
|
|
6842
|
-
referrerUrl,
|
|
6843
6758
|
});
|
|
6844
6759
|
verifyPhoneDialog.close();
|
|
6845
6760
|
if (productType === 'debitCard') {
|
|
@@ -6956,29 +6871,14 @@
|
|
|
6956
6871
|
.filter((_) => formData[_])
|
|
6957
6872
|
.map((_) => consents[_]?.text);
|
|
6958
6873
|
};
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
return undefined;
|
|
6963
|
-
}
|
|
6964
|
-
const claimData = await getClaimChannel();
|
|
6965
|
-
return claimData.find((item) => item.key === slug)?.code;
|
|
6966
|
-
};
|
|
6967
|
-
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, referrerUrl, }) => {
|
|
6874
|
+
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, }) => {
|
|
6875
|
+
let taskId;
|
|
6876
|
+
let participantId;
|
|
6968
6877
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
6969
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
6970
6878
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
6971
6879
|
try {
|
|
6972
|
-
let taskId;
|
|
6973
|
-
let participantId;
|
|
6974
6880
|
if (productType === 'debitCard') {
|
|
6975
|
-
const
|
|
6976
|
-
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData({
|
|
6977
|
-
formData,
|
|
6978
|
-
programId,
|
|
6979
|
-
marketingInfo,
|
|
6980
|
-
claimChannelCode,
|
|
6981
|
-
}));
|
|
6881
|
+
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData(formData, programId, marketingInfo));
|
|
6982
6882
|
taskId = debitData.taskId;
|
|
6983
6883
|
participantId = debitData.participantId;
|
|
6984
6884
|
}
|
|
@@ -7408,10 +7308,6 @@
|
|
|
7408
7308
|
leadFormStore.productType = productType;
|
|
7409
7309
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
7410
7310
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
7411
|
-
const referrer = globalThis.document.referrer;
|
|
7412
|
-
if (referrer) {
|
|
7413
|
-
sessionStore.referrerUrl = referrer;
|
|
7414
|
-
}
|
|
7415
7311
|
}, [queryFromStorage]);
|
|
7416
7312
|
useEffect(() => {
|
|
7417
7313
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
@@ -13173,7 +13069,7 @@
|
|
|
13173
13069
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13174
13070
|
});
|
|
13175
13071
|
|
|
13176
|
-
const packageVersion = "0.14.
|
|
13072
|
+
const packageVersion = "0.14.974";
|
|
13177
13073
|
|
|
13178
13074
|
exports.Blocks = Blocks;
|
|
13179
13075
|
exports.ContentPage = ContentPage;
|